snmpwalk on table not working via subagent

"Joan Landry" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <A9FCB77F97940A418A61FD9BB71E4170A1C65A@dexbe012-6.exch012.intermedia.net>
I have created the following table subagent code. I am able to walk
objects in the table, but if I walk the entire table starting at the top
of the table I get no data returned.
Also, do the functions below work or should I be using the old style
code:
      REGISTER_MIB("abc", abc_variables, variable4, variables_oid);
 
So far I have spent days trying to get a mib walk to work with a very
simple table, using the many different variations of mib2c and nothing I
have done so far works.
 
Please tell me what I could possibly doing wrong with this setup:
   table_set = netsnmp_create_table_data_set("sysORTable");
    table_set->allow_creation = 0;
 
    netsnmp_table_set_add_indexes(table_set, ASN_INTEGER, 0);
    netsnmp_table_set_multi_add_default_row(table_set,
             COLUMN_SYSORINDEX, ASN_INTEGER, 0, NULL, 0, 
             COLUMN_SYSORID,    ASN_OBJECT_ID, 0, NULL, 0,
             COLUMN_SYSORDESCR, ASN_OCTET_STR, 0, NULL, 0, 
             COLUMN_SYSORUPTIME, ASN_TIMETICKS, 0, NULL, 0, 0);
    table_set->table->store_indexes = 1;
    netsnmp_register_table_data_set(netsnmp_create_handler_registration
                                    ("sysORTable",  NULL,
                                     sysORTable_oid,
                                     OID_LENGTH(sysORTable_oid),
                                     HANDLER_CAN_RONLY), table_set,
NULL);
    row = netsnmp_create_table_data_row();
    sysORIndex = 1;
    netsnmp_table_row_add_index(row, ASN_INTEGER, &sysORIndex,
sizeof(sysORIndex));
    netsnmp_set_row_column(row, COLUMN_SYSORID, ASN_OBJECT_ID,
             (u_char *)sysOidSpec[0].id, sysOidSpec[0].len);
    netsnmp_set_row_column(row, COLUMN_SYSORDESCR, ASN_OCTET_STR,
             sysOidSpec[0].sysOidDesc,
strlen(sysOidSpec[0].sysOidDesc));
    netsnmp_set_row_column(row, COLUMN_SYSORUPTIME, ASN_TIMETICKS,
ptr, sizeof(long));
    netsnmp_table_dataset_add_row(table_set, row);
    sysORIndex = 2;
    row = netsnmp_create_table_data_row();
    netsnmp_table_row_add_index(row, ASN_INTEGER, &sysORIndex,
sizeof(sysORIndex));
    netsnmp_set_row_column(row, COLUMN_SYSORID, ASN_OBJECT_ID,
             (u_char *)sysOidSpec[1].id, sysOidSpec[1].len);
    netsnmp_set_row_column(row, COLUMN_SYSORDESCR, ASN_OCTET_STR,
             sysOidSpec[1].sysOidDesc,
strlen(sysOidSpec[1].sysOidDesc));
    netsnmp_set_row_column(row, COLUMN_SYSORUPTIME, ASN_TIMETICKS,
ptr, sizeof(long));
    netsnmp_table_dataset_add_row(table_set, row);
 
this creates 2 rows - and if I walk sysORDesc I get both rows, if I
start the walk at sysOrEntryTable I get nothing.
 
Any help would be appreciated.
Thanks,
Joan

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
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.