MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/3/cwd/usr/share/snmp/mib2c-data/generic-table-indexes-from-oid.m2i
#############################################################  -*- c -*-
## generic include for XXX. Do not use directly.
##
## $Id: generic-table-indexes-from-oid.m2i 11300 2004-10-08 23:39:17Z rstory $
########################################################################
@if $m2c_mark_boundary == 1@
/** START code generated by $RCSfile$ $Revision: 11300 $ */
@end@
########################################################################
##
/**
 * extract ${context} indexes from a netsnmp_index
 *
 * @retval SNMP_ERR_NOERROR  : no error
 * @retval SNMP_ERR_GENERR   : error
 */
int
${context}_index_from_oid(netsnmp_index *oid_idx,
                         ${context}_mib_index *mib_idx)
{
@include generic-table-indexes-varbind-setup.m2i@

    DEBUGMSGTL(("verbose:${context}:${context}_index_from_oid","called\n"));

    /*
     * parse the oid into the individual index components
     */
    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
                             &var_$m2c_dii_first );
    if (err == SNMP_ERR_NOERROR) {
        /*
         * copy out values
         */
@    eval $m2c_node_name = ""@ # purge node name to re-eval $m2c_node_var_name
@    foreach $node index@
@        eval $m2c_node_var_name = "var_${node}."@
@        include m2c_setup_node.m2i@
@        if $m2c_node_needlength == 1@
    /*
     * NOTE: val_len is in bytes, ${node}_len might not be
     */
         if(var_${node}.val_len > sizeof(mib_idx->$node))
             err = SNMP_ERR_GENERR;
         else {
             memcpy(mib_idx->${node}, var_${node}.val.string, var_${node}.val_len);
             mib_idx->${node}_len = var_${node}.val_len / sizeof(mib_idx->${node}[0]);
         }
@        else@
    mib_idx->$node = $m2c_node_var_val;
@        end@
@    end@ # foreach
@    eval $m2c_node_var_name = ""@ #reset custom name
@    eval $m2c_node_name = ""@ # purge node name to re-eval $m2c_node_var_name


    }

    /*
     * parsing may have allocated memory. free it.
     */
    snmp_reset_var_buffers( &var_$m2c_dii_first );

    return err;
} /* ${context}_index_from_oid */

##
########################################################################
@if $m2c_mark_boundary == 1@
/** END code generated by $RCSfile$ $Revision: 11300 $ */
@end@