Hi Greeting: I've studied the sysORTable.c and it's implementation. I think I need to do some kind initialization for myTable like what it was implemented in register_sysORTable(). So myTable (a link list) stores the data to be returned by agent later on when it's called for all the instance parsed by from the iteration. Or make it simpler my agent can read the text input and build the linked table (for all the data) at initial time. So by the time the var_myTable() is called it returns the values according to the index of the pointer of the table?
Thanks, Jim -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dave Shield Sent: Wednesday, April 06, 2005 6:07 PM To: Jim Su Cc: Net-Snmp-Users Subject: Re: iteration of entry in table On Sun, 2005-04-03 at 14:00, Jim Su wrote: > I simply want the agent to "list" all the configured modules Nope - that's not how the agent works. The agent is asked for a particular value - either "give me this value" or "give me the next value after this". It's the *client* side (snmpwalk) that uses this to list the configured modules, by sending a sequence of requests. The agent treats each request completely independently. > Will a header_simple_table routine sufficient enough to handle > the iteration? That depends on the definition of your MIB. If it's a simple integer-indexed array (1-N), then yes. > If the header_simple_table routine is sufficient I assume > the MAX_VALID_INDEX is to be set to the total possible number > of moduleId? Yes. Quite correct. > I think what I am not clear about is how all the rows of data > in the table are returned? Each time the var_table() returns one > value and goes on the next oid, isn't it? No - each time, the var_table() routine returns one value. End of story (as far as the agent is concerned). It's *snmpwalk* that goes on to the next OID. > How do I "list" them (the same oid but different instance) header_simple_table() will handle most of this for you. Call that routine, extract the index value from the OID (i.e. the last entry in the 'name' array), and the return the requested value (vp->magic) from that particular row. Dave ------------------------------------------------------- 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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ 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 HW夸)b粗h?+y羕N??v??y?'z汻jwbv楝?,│n?煡?!3諢?傳諲j溣[津??(赭?'!死嘈l飩瓜X砧瘱J^?^J眱須?)??嗓?l〥gr?i?
