Re: Index in Table .... request for explanation
Dave Shield <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
2009/1/29 M. Zeeshan - IMS <[email protected]>: > 3. when i generated code using mib2c with "mib2c.create-dataset.conf" file, > then the indexing was done with the function > "netsnmp_table_set_add_indexes()", while the example in data_set.c uses the > function "netsnmp_table_row_add_index()" a bit earlier in the code, whats > the difference between these two functions. netsnmp_table_set_add_indexes() is used to define the structure of the indexing foe the table as a whole. It takes a list of types - specifying what sort of index is used for this table. netsnmp_table_row_add_index() is used to specify the actual indexing for a particular row of this table. It takes a list of *values* - which should match the type(s) specified in netsnmp_table_set_add_indexes() So you might have: /* myTable1 */ netsnmp_table_set_add_indexes( table, ASN_INTEGER, /* End of index list */ 0 ); netsnmp_table_row_add_index( row, ASN_INTEGER, /* Row # */ 4 ); Or /* myTable2 */ netsnmp_table_set_add_indexes( table, ASN_OCTET_STR, ASN_OCTET_STR, /* End of index list */ 0 ); netsnmp_table_row_add_index( row, ASN_OCTET_STR, /* first index value */ "this" ); netsnmp_table_row_add_index( row, ASN_OCTET_STR, /* second index value */ "that" ); The first table would include objects indexed using myTable1Column.4 The second table would include objects indexed using myTable2Column."this"."that" OK? Dave ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users