I haven't created any new session. 
The session related code in forward_handler() is attached below.
I have updated session.version with the version available in v2_pdu
which is created using convert_v1pdu_to_v2().
Also I have tried with manual setting of session like session.version  =
1; . But in vain. 

****************************
   snmp_sess_init( &session );
        if (strchr( handler->token, ':') == NULL) {
        snprintf( buf, BUFSIZ, "%s:%d", handler->token, SNMP_TRAP_PORT);
        cp = buf;
    } else {
        cp = handler->token;
    }
    session.peername = cp;
        //session.version  = pdu->version; //ORIG.. commented for
testing
        session.version  = v2_pdu->version;
   
    ss = snmp_open( &session );
    if (!ss)
        return NETSNMPTRAPD_HANDLER_FAIL;
**************************
Do I need to include anything more in the session structure? Or I have
gone in wrong direction?

thank you,
renjith 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Dave Shield
Sent: Tuesday, October 19, 2010 6:36 PM
To: Renjith R. V.
Cc: [email protected]
Subject: Re: how to identify variable 'type' and 'value' from pdu
structure

On 19 October 2010 13:58, Renjith R. V. <[email protected]>
wrote:
> I have tried with convert_v1pdu_to_v2().
> But it doesn't worked.
> Upon checking the syslog file, it showed the error "snmptrapd[19529]:
> Forward failed: Cannot send V2 PDU on V1 session"
>
> Can you please tell me what could be the problem? And any solution?

How are you setting up the session structure for the new destination?

Dave
***** Confidentiality Statement/Disclaimer *****

This message and any attachments is intended for the sole use of the intended 
recipient. It may contain confidential information. Any unauthorized use, 
dissemination or modification is strictly prohibited. If you are not the 
intended recipient, please notify the sender immediately then delete it from 
all your systems, and do not copy, use or print. Internet communications are 
not secure and it is the responsibility of the recipient to make sure that it 
is virus/malicious code exempt.
The company/sender cannot be responsible for any unauthorized alterations or 
modifications made to the contents. If you require any form of confirmation of 
the contents, please contact the company/sender. The company/sender is not 
liable for any errors or omissions in the content of this message.

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to