[ Sorry for the delay in responding to this ] > what is the difference between using snmp_open() and snmp_open_ex() > functions?
'snmp_open' is the usual way of creating a "normal" SNMP session. 'snmp_open_ex' is a more flexible interface that allows an application to support special handling, such as routines that are called before/after a request is decode, or even to handle non-SNMP-protocol requests (which is how the AgentX implementation is written). > Will it be fine if I use snmp_sess_open() instead of snmp_open_ex() for > the traphandler(in snmptrapd.c)? 'snmp_sess_open' is a slightly different thing. Both 'snmp_open' and 'snmp_open_ex' create an SNMP session and add it to an internal list of sessions. That's why you don't need to give any parameters to the 'snmp_read' call - because it works with this internal list. 'snmp_sess_open' is part of the "Single Session API" - designed for use in multi-threaded applications, where this (shared) internal session list isn't safe. It's up to the application to keep track of the sessions that it has opened, and pass the appropriate one to 'snmp_sess_read' The two families are best thought of as completely alternative approaches - they probably shouldn't be mix-and-matched. Dave ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ 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