On Tue, 13 Sep 2005 12:45:42 -0400 RH wrote: R> I need to set the apply getsockopt() and setsockopt() against the socket(s) R> used to send SNMP PDUs to an agent. It's a must-have capability to transmit R> packets with a defined TOS option configuration.
There is a function that sets the default sockopts for udp sockets: _netsnmp_udp_sockopt_set(), but that would set it for all created sockets. R> So far the only thing I've found that's close in the archives is to create R> an netsnmp_transport and map it into the session using snmp_sess_add(). R> R> That's obviously better than my admittedly act-of-desperation hack: R> Defeating the detail hiding / abstraction layer and use the session pointer R> from snmp_open() to get access to the sock field of the netsnmp_transport R> member of the session_list struct associated with that session. It depends on whether or not you want the users to have to know about the special transport. If that's ok, then a new transport that simply wraps around the existing udp transport and sets the socket option should be fine. If you want the details hidden from the user, then you're going to have to defeat the abstraction or patch the library. -- NOTE: messages sent directly to me, instead of the lists, will be deleted unless they are requests for paid consulting services. Robert Story; NET-SNMP Junkie Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- 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/listinfo/net-snmp-coders