On 28 February 2011 13:21, Giuseppe Modugno <[email protected]> wrote: > But I have some difficulties to find a good point where to call the > select(), considering that the init() function must return and the > registered handler is called only for SET/GET requests from the network.
There is a mechanism provided within the Net-SNMP library that is designed for this precise type of requirement. Have a look at 'snmplib/fd_event_manager.c' The 'register_readfd' call allows you to insert a file descriptor into the 'select' call within the main agent loop, together with a callback routine to handle anything received on that descriptor. The only example I can find of where this is used is in agent/mibgroup/if-mib/data_access/interface_linux.c See the routine 'netsnmp_prefix_process' Niels' suggestion of hacking the main select loop would certainly work, but this mechanism has been provided to avoid the need to do this. We should perhaps look at re-working the SMUX module to make use of this facility, but it's never been sufficiently high priority to warrent the time involved. Dave ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
