This is a discussion on Re: NETSNMP_CALLBACK_OP_CONNECT within the SNMP Coders forums, part of the Networking and Network Related category; --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 26, 2005 at 02:55:...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 26, 2005 at 02:55:26PM -0700, Wes Hardaker wrote: > >>>>> On Fri, 23 Sep 2005 01:16:45 +0200, Magnus Fromreide <magfr@lysator.liu.se> said: > > Magnus> I wa woudering what the purpose of NETSNMP_CALLBACK_OP_CONNECT > Magnus> is. > > Magnus> At a guess it should be issued when a new connection is > Magnus> established with a transports but I do not know for sure, > Magnus> could someone please explain? > > I'm betting it was designed to do that. However, since it doesn't > exist anywhere in the source code to date I suspect it was designed > but never implemented. So would something like the following be what was intended? This patche calls the callback function in the created object and gives it the newly created session as argument, given the declaration of callback I couldn't figure out anything better to do. /MF --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.CALLBACK_OP_CONNECT" Index: snmplib/snmp_api.c ================================================== ================= RCS file: /cvsroot/net-snmp/net-snmp/snmplib/snmp_api.c,v retrieving revision 5.87 diff -u -r5.87 snmp_api.c --- snmplib/snmp_api.c 16 Sep 2005 15:51:08 -0000 5.87 +++ snmplib/snmp_api.c 27 Sep 2005 11:15:43 -0000 @@ -5415,6 +5415,16 @@ if (nslp != NULL) { nslp->next = Sessions; Sessions = nslp; + /* + * Tell the new session about it's existance if possible. + */ + if (nslp->session->callback != NULL) { + DEBUGMSGTL(("sess_read", + "perform callback with op=CONNECT\n")); + nslp->session->callback(NETSNMP_CALLBACK_OP_CONNECT, + nslp->session, 0, + NULL, sp->callback_magic); + } } else { new_transport->f_close(new_transport); netsnmp_transport_free(new_transport); --bp/iNruPH9dso1Pn-- ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |