generic-table-indexes-to-oid.m2i
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:2k
源码类别:
SNMP编程
开发平台:
Unix_Linux
- ############################################################# -*- c -*-
- ## generic include for XXX. Do not use directly.
- ##
- ## $Id: generic-table-indexes-to-oid.m2i,v 1.7.2.1 2005/03/22 22:27:57 rstory Exp $
- ########################################################################
- @if $m2c_mark_boundary == 1@
- /** START code generated by $RCSfile: generic-table-indexes-to-oid.m2i,v $ $Revision: 1.7.2.1 $ */
- @end@
- ########################################################################
- ##
- /**
- * @internal
- * convert the index component stored in the context to an oid
- */
- int
- ${context}_index_to_oid(netsnmp_index *oid_idx,
- ${context}_mib_index *mib_idx)
- {
- @include generic-table-indexes-varbind-setup.m2i@
- DEBUGMSGTL(("verbose:${context}:${context}_index_to_oid","calledn"));
- @ foreach $node index@
- @ include m2c_setup_node.m2i@
- /* $m2c_node_summary */
- @ if $m2c_node_needlength == 1@
- snmp_set_var_value(&var_$node, (u_char*)&mib_idx->$node,
- mib_idx->${node}_len * sizeof(mib_idx->${node}[0]));
- @ else@
- snmp_set_var_value(&var_$node, (u_char*)&mib_idx->$node,
- sizeof(mib_idx->$node));
- @ end@
- @ end@ # for each column
- err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
- NULL, 0, &var_$m2c_dii_first);
- if(err)
- snmp_log(LOG_ERR,"error %d converting index to oidn", err);
- /*
- * parsing may have allocated memory. free it.
- */
- snmp_reset_var_buffers( &var_$m2c_dii_first );
- return err;
- } /* ${context}_index_to_oid */
- ##
- ########################################################################
- @if $m2c_mark_boundary == 1@
- /** END code generated by $RCSfile: generic-table-indexes-to-oid.m2i,v $ $Revision: 1.7.2.1 $ */
- @end@