Re: Subhandler function
"Chino Aureus" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Thanks :) On 8/31/06, sishen <[email protected]> wrote: > > Chino Aureus wrote: > > > > Hi, > > > > I have an integer variable which I'm exposing via my MIB. What I want > > to achive is when a SNMP GET operation is performned on this variable > > , the value will be reset to 0. I'm using the function below to > > register the int variable. > > > > int *netsnmp_register_int_instance* (const char *name, oid *reg_oid, > > size_t reg_oid_len, int *it, Netsnmp_Node_Handler *subhandler) > > > > 1. If a pass a valid 'subhandler'', will this handler be called after > > GET? I thinking of implementing the "reset to 0" in the subhandler. > > 2. How do I create a subhandler? Any example will be greatly > apprecited. > int > handle(netsnmp_mib_handler *handler, > netsnmp_handler_registration *reginfo, > netsnmp_agent_request_info *reqinfo, > netsnmp_request_info *requests) > { > switch(reqinfo->mode) { > > case MODE_GET: > // do what you want here. > break; > case xxx: > break; > default: > break; > } > } > > take care of reqinfo->mode. We can do anything with each mode. > > > > Thanks, > > Chino > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, > security? > > Get stuff done quickly with pre-integrated technology to make your job > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > 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 > > > > > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ 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