my_reg_void pointer in netsnmp_handler_registration structure

Vinh Nguyen <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi all,

I need to keep some external data on registering an snmp instance (or 
table), that can be retrieved back whenever the instance handler is called.
Fromt the name, I assume that my_reg_void in 
netsnmp_handler_registration structure can be used for this purpose, 
could some one please confirm if I am right or wrong?
What I want to do is like this:

1) Register the instance and keep pointer to my external data
  my_reginfo = netsnmp_create_handler_registration("my_instance",
                                            my_instance_handler,
                                            my_oid,
                                            OID_LENGTH(my_oid),
                                            HANDLER_CAN_RWRITE);
  my_reginfo->my_reg_void = (void*) my_external_data_ptr;

2) Recover my external data inside the instance handler
  int my_instance_handler(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *reqinfo,
                         netsnmp_request_info *requests)
 
  mydata = (mydata_type*) reginfo->my_reg_void;


I have done some tests and it works, however I'm not sure that is what 
my_reg_void is intended to be for, and if anything else in snmp 
libraries uses it.

Lots of thanks,
Vinh

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.