a problem in mib2c

"Porat, Dan" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <095758746BB502459CAB185FA3FFE6418807F8@IsrExch01.israel.polycom.com>
While creating a c file using the mib2c , using the dataset option, 

It creates all the indexes in the table as well, 

Instead of creating the indexes in the "netsnmp_table_set_add_indexes"
alone.

It creates it over there , and in the
netsnmp_table_set_multi_add_default_row.

This prevents from doing a correct walk over the table.

 

 

Example:

 

initialize_table_ipAddrTable(void)

{

    static oid      ipAddrTable_oid[] = { 1, 3, 6, 1, 2, 1, 4, 20 };

    size_t          ipAddrTable_oid_len = OID_LENGTH(ipAddrTable_oid);

    netsnmp_table_data_set *table_set;

 

    /*

     * create the table structure itself

     */

    table_set = netsnmp_create_table_data_set("ipAddrTable");

 

    /*

     * comment this out or delete if you don't support creation of new
rows

     */

    table_set->allow_creation = 1;

 

    /***************************************************

     * Adding indexes

     */

    DEBUGMSGTL(("initialize_table_ipAddrTable",

                "adding indexes to table ipAddrTable\n"));

    netsnmp_table_set_add_indexes(table_set, ASN_IPADDRESS,     /*
index: ipAdEntAddr */

                                  0);

 

    DEBUGMSGTL(("initialize_table_ipAddrTable",

                "adding column types to table ipAddrTable\n"));

    netsnmp_table_set_multi_add_default_row(table_set,

                                            COLUMN_IPADENTADDR,

                                            ASN_IPADDRESS, 0, NULL, 0,

                                            COLUMN_IPADENTIFINDEX,

                                            ASN_INTEGER, 0, NULL, 0,

                                            COLUMN_IPADENTNETMASK,

                                            ASN_IPADDRESS, 0, NULL, 0,

                                            COLUMN_IPADENTBCASTADDR,

                                            ASN_INTEGER, 0, NULL, 0,

                                            COLUMN_IPADENTREASMMAXSIZE,

                                            ASN_INTEGER, 0, NULL, 0, 0);

 

 

Dan Porat

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.