On Fri, 08 Apr 2005 16:09:00 -0400 [EMAIL PROTECTED] wrote:
CRC> I've looked at mib2c generated code and in table_iterator.h and don't feel
CRC> I have a clear idea of this yet.  mib2c created functions like:
CRC> 
CRC> netsnmp_variable_list *
CRC> ifTable_get_first_data_point(void **my_loop_context,
CRC>                              void **my_data_context,
CRC>                              netsnmp_variable_list * put_index_data,
CRC>                              netsnmp_iterator_info *mydata)
CRC> 
CRC> I take it from the "my" in "mydata" that Net-SNMP doesn't dereference it
CRC> and try to access fields on a netsnmp_iterator_info structure but I'm not
CRC> 100% sure.  Can I do something like:
CRC> 
CRC>    mydata = (netsnmp_iterator_info*)-1;
CRC> 
CRC> to pass data to my get_next_data() function?

No, C doesn't work that way. Values assigned to a parameter in a function don't
change the original value outside the function. That's why the two context
variables are pointers to pointers..

mydata is supposed to be the data associated with the index you set in
get_first or get_next. The agent will remember the mydata pointer for the index
is selects for each varbind in a request.

-- 
NOTE: messages sent directly to me, instead of the lists, will be deleted
      unless they are requests for paid consulting services.

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-users>

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://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

Reply via email to