> ... Is ss NULL? If not, what does it 
> contain for community?
> ...

OK.  I've built with static libraries and my code now looks like:

    session.peername = "localhost";
    session.retries = 1;
    session.version = SNMP_VERSION_2c;
    session.community = "config";
    session.community_len = strlen(session.community);

    /* establish the session */
    ss = snmp_open(&session);

    snmp_log(LOG_INFO, "session.peername:%s\n", session.peername);
    snmp_log(LOG_INFO, "session.community:%s\n", session.community);
    

    if ( ! ss) {
        snmp_perror("ack");
        snmp_log(LOG_ERR, "Could not establish session with SNMP daemon.\n");
        return NULL;
    }
    
    snmp_log(LOG_INFO, "ss:%p\n", ss);
    snmp_log(LOG_INFO, "ss->peername:%s\n", ss->peername);
    snmp_log(LOG_INFO, "ss->community:%s\n", ss->community);

and my log says:

  session.peername:localhost
  session.community:(null)
  ss:0x101689e0
  ss->peername:localhost
  ss->community:(null)

I can't really step into the code because the target environment is an embedded 
system where I don't have good debugging support.  I can pepper snmp_open() 
with fprintf()s. :-/  But you say that you don't see anything there that would 
trash the community...



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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

Reply via email to