On Sat, 25 Dec 2004 10:00:25 -0500 Alex wrote:
AK> Hi, is there an example? 

There are lots of examples of iterator modules in the code. A grep on
netsnmp_register_table_iterator will turn up several. One of the simplest is

  agent/mibgroup/mibII/vacm_context.c

AK> What do I do the get-next off?

In your get_first_data_point function you set the 
my_loop_context pointer to something you can use as a loop control for all your
data (like a pointer to the head of a linked list, or the index of an array).
Then you set the MIB index in put_data and return.

Then the get_next_data_point function will be called, and you use the loop
context pointer to find the next item in your data, and set the MIB index in
put data. This repeats until you go through all your data, at which point you
should return NULL.

Note that you should be be trying to order your data. Simple set the indexes in
put_data for each row in turn, and the helper figures out the right row for a
request.

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to