I am using net-snmp-5-4-1.
I looked at the generic helper code. In the file 
net-snmp-5.4.1/agent/helpers/table_generic.c

All the functions are empty. I attached the file. So I am not sure how
this helper will work.

My goal is very simple.
I want to code a subagent to register for a mib table and be able to
handle the get, getnext, set for the rows and columns in the table
because the data is in the subagent not the master agent. I was able to
use the following for the get and the set but not for the getnext.
Meaning I can do a get on all the rows and the columns in the table,
which would possibly indicate that I created the table ok and added the
rows correctly. For some reason though the getnext does not work
correctly:
netsnmp_create_table_data_set
netsnmp_table_set_add_indexes
netsnmp_table_set_multi_add_default_row
netsnmp_create_table_data_row
netsnmp_table_row_add_index
netsnmp_set_row_column
netsnmp_table_dataset_add_row

One of the errors I get is that instead of getting the next row of the
current column - I get the next column. Also, a walk never exits the
loop of getnext. 

So I am now using:
REGISTER_MIB(...)
To handle get,get next, and set. This works ok.
Is this the recommended approach instead of using the helpers?

Thanks,
Joan

Thanks,
Joan 
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Dave Shield
Sent: Wednesday, April 23, 2008 5:33 PM
To: Joan Landry; Mike Ayers
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: tablesnmpwalk on table not working via subagent - need help
please

2008/4/23 Mike Ayers <[EMAIL PROTECTED]>:
>  > I have found no information about table_dataset2 helper. Does  > 
> this exist?

No.

>         I suspect that it is this:
>
>  http://www.net-snmp.org/dev/agent/group__tdata.html

Not quite.
The 'table_tdata' helper is a reworked version of the 'table_data'
helper.

Both of these represent the table as a collection of individual row data
structures.   The helper takes care of selecting the appropriate row
from
within this collection.   The user-provided handler should then select
the requested column value from within this data structure.

The 'table_dataset' helper takes this a stage further.
As well as taking care of the table as a collection of rows, it also
handles each row as a collection of column values.
The standard helper can therefore process an SNMP request without
needing *any* user-provided handler code.

The original intention of the table_dataset2' helper was to apply the
same 'table_data' -> 'table_tdata' reworking to the dataset framework.
But this never actually happened.


>  > Can anyone clarify for me which code in net-snmp works for  > the 
> purpose of implementing a table.

All of the table helpers have been used for implementing assorted tables
with the Net-SNMP agent, so they should all work successfully.
I still hope to look properly at the problems you have been having.


>   The table_dataset/group_tdata functions are for "datamatted" [sic] 
> tables those for which you store the data and forget.

That's true for 'table_dataset', but not for 'table_tdata'.


>  I don't see any functions to build the rows, either.

The code for building a row in a 'tdata'-based table is specific to the
individual MIB table, so isn't part of the tdata helper itself.
Instead it will be generated as part of the mib2c.tdata.conf template.


>  I suggest taking a look here:
>
>  http://www.net-snmp.org/dev/agent/group__table__generic.html
>
>         ...for what appears to be a more generic and complete set of
functions.


That's not actually a user-level table helper.
It's more intended as a design framework of the API that a particular
table helper should look at providing.

Dave

Attachment: table_generic.c
Description: table_generic.c

-------------------------------------------------------------------------
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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to