On Wed, 2005-11-09 at 15:27 -0500, Haizhu Liu wrote:
> I see on the other thread:
> 
> "Note that it's this 'snmp_sess_transport' API works with
> the opaque (session_list) pointer - *NOT* the "netsnmp_session"
> pointer returned by 'snmp_open()'.
> 
> So you probably want something like:
> 
>       netsnmp_session *sess = snmp_open(...);
>       netsnmp_transport *t = snmp_sess_transport(
>                                 snmp_sess_pointer( sess ));
>       int sock = t->socket;
> "
> 
> the code as above is really using snmp_open() instead of snmp_sess_open(),

But note what parameter is passed to 'snmp_sess_transport'.
This doesn't take 'sess' directly - it uses the result of
the "snmp_sess_pointer(sess)" call.  That routine turns a
(traditional) netsnmp_session structure into the corresponding
(opaque) SSI pointer.

Maybe if the code above was expanded a bit, it might help:

     netsnmp_session *sess = snmp_open( .... );
     void            *s2   = snmp_sess_pointer( sess );
     netsnmp_transport *t  = snmp_sess_transport( s2 );


is basically equivalent to:

     void            *s2   = snmp_sess_open( .... );
     netsnmp_transport *t  = snmp_sess_transport( s2 );

Any clearer?

Dave


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to