I'm trying to figure out why I have a null community in my agent when using 5.2.rc1 
but the same code works OK with 5.1.1.   I've got:

    struct snmp_session session;
    init_snmp("snmpapp");
    snmp_sess_init( &session );     
    session.peername = "localhost";
    session.retries = 1;
    session.version = SNMP_VERSION_2c;
    session.community = "config";
    session.community_len = strlen(session.community);

    snmp_log(LOG_INFO, "session.community:<<%s>>, community_len:%d\n",
             session.community, session.community_len);
    
    ss = snmp_open(&session);
    snmp_log(LOG_INFO, "ss->community:<<%s>>, community_len:%d\n",
             ss->community, ss->community_len);

which shows session.community to be "config" and ss->community to be null.  I edited 
snmp_open() to start:

    struct session_list *slp;
    snmp_log(LOG_INFO,
             "%d:session->community=%s\n",
             __LINE__, session->community);

and find that session->community is NULL *on* *entry* to snmp_open().  Then I noticed 
that I'm passing snmp_open() a struct snmp_session* but it's defined as:

   netsnmp_session *
   snmp_open(netsnmp_session *session)
   {
       ....

Which leaves me wondering if snmp_session and netsnmp_session used to be compatible 
and aren't any more.  Any other explanation that the community pointer on the 
structure gets trashed by invoking snmp_open()?

                                Chris



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&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