I am trying to get a subagent to process a get next on a column in a
table.
For some reason the table_info->colnum is always 1 column greater then
the column being requested via the getnext request.

Upon a get or getnext request I want to be able to read the data from my
internal database and respond accordingly. The index to the table and
the number of rows in the table can change at any given time. So when a
get next request comes in I want to be able to process it base on what
is in my current database.

Therefore I did not initialize netsnmp with the rows in the init
function that sets up the handler. Because these may not be correct when
the get or getnext request comes in.

I am able to process a GET with no problem, the column is read correctly
and I can verify the index to the table is correct - and respond with
the correct data.

However, when a getnext request comes in nothing works correctly.

Here is an example of a simple table I am trying to get working:

I initialze the table:
reg = netsnmp_create_handler_registration("sysORTable",
sysORTable_handler, sysORTable_oid,
sysORTable_oid_len, HANDLER_CAN_RONLY);

table_set = netsnmp_create_table_data_set("sysORTable");
table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_inf o);
netsnmp_table_set_add_indexes(table_set, ASN_INTEGER, 0);
table_info->min_column = COLUMN_SYSORID;
table_info->max_column = COLUMN_SYSORUPTIME;

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);
netsnmp_register_table_data_set(reg, table_set, table_info);


and in the handler I have
case MODE_GETNEXT:
for (request = requests; request; request = request->next)
{
table_info = netsnmp_extract_table_info(request);

(table_info->colnum is always one greater then the request being made
for. In a walk it loops forever.

I do a get next on sysORDescr.0 and the table_info tells me the column
requested is sysORUpTime.0

Any ideas on what I am doing wrong would be appreciated.

I am also very confused as to which is recommended to use:
table_data = netsnmp_tdata_create_table("sysORTable", 0);
table_set = netsnmp_create_table_data_set("sysORTable");

Thanks,
Joan
Landry

-------------------------------------------------------------------------
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;198757...un.com/javaone
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users