2009/8/31 Darshan Ghumare <[email protected]>: > I want to make snmpd (daemon) as a part of my code. So it will be > like SNMP-Agent is one of the sub-module of my project but not as a > separate process. How should I go about it?
You _could_ rename the 'main' routine from snmpd.c and invoke that, as sanjaykumar suggests. But that would pull in all of the standard command-line processing from the main Net-SNMP agent. I suspect that this isn't really what you want. If your main application is completely interrupt-driven, then a slightly better solution would be to call the 'receive()' routine (also from snmpd.c), having first set up the SNMP environment. Use the code from 'main()' as guidance. The main thing to be aware when using this approach, is that the 'receive()' routine acts as the application event loop. If your main application already has an event loop, or similar, then you probably can't use 'receive()' either. Instead, you should look at inserting the call 'agent_check_and_process()' into your existing application event loop. If you use "mib2c.mfd.conf" to generate template code (including AgentX subagent support), then the subagent code file will indicate the sort of initialisation that this call requires. Dave ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ 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
