On Tue, 2005-09-13 at 12:45 -0400, RH wrote:
> I need to set the apply getsockopt() and setsockopt() against the socket(s)
> used to send SNMP PDUs to an agent.  It's a must-have capability to transmit
> packets with a defined TOS option configuration.

> That's obviously better than my admittedly act-of-desperation hack:
> Defeating the detail hiding / abstraction layer and use the session pointer
> from snmp_open() to get access to the sock field of the netsnmp_transport
> member of the session_list struct associated with that session.

I'm not sure exactly how you were thinking of doing (or not doing!)
this, but I'm tempted to suggest that it may actually be the best
way to go.
   There is already a defined API  (snmp_sess_transport) for
retrieving the transport structure associated with a particular
session,  and the socket is one of the top-level fields of this
transport structure.  It's probably not unreasonable to access
this field (and perhaps the transport flags field) directly.

The main purpose of the module transport mechanism is to hide
the transport-specific aspects of how things operate - this level
of transport-independent information seems fair game, IMO.



We *could* provide a wrapper API:
    int netsnmp_transport_socket( netsnmp_transport *);
I suppose, but it hardly seems worth it.


Dave


-------------------------------------------------------
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

Reply via email to