Talking about RFC 3584 section 3.1 step 4, it states that besides the
mandatory varbinds (sysUpTime and snmpTrapOID), if the translation is
being performed by a proxy, three additional varbind shall be appended.
These three varbinds are snmpTrapAdress.0, snmpTrapCommunity.0 and
snmpTrapEnterprise.0 (the value for this last one shall be SNMPv1
enterprise parameter). 
In the convert_v1pdu_to_v2 function, in line 581, the function only add
the snmpTrapEnterprise.0 value if the trap is not enterprise specific.
Is this and error?

var = find_varbind_in_list( template_v2pdu->variables,
                                snmptrapenterprise_oid,
                                snmptrapenterprise_oid_len);
if (!var && 
        template_v1pdu->trap_type != SNMP_TRAP_ENTERPRISESPECIFIC) {
        if (!snmp_varlist_add_variable( &(template_v2pdu->variables),
                 snmptrapenterprise_oid, snmptrapenterprise_oid_len,
                 ASN_OBJECT_ID,
                 (u_char*)template_v1pdu->enterprise, 
                 template_v1pdu->enterprise_length*sizeof(oid)))
            snmp_log(LOG_WARNING,
                 "send_trap: failed to append snmpEnterprise
varbind\n");
    }


Regards,
Pablo 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dave
Shield
Sent: Tuesday, August 01, 2006 6:00 AM
To: Magnus Fromreide
Cc: [email protected]
Subject: Re: Changing originator IP in trap/inform

On 01/08/06, Magnus Fromreide <[EMAIL PROTECTED]> wrote:
> In convert_v1pdu_to_v2:
>
> A community field is eventually inserted among the varbinds.

That's correct.
See RFC 3584, section 3.1, step 4.

>                     It is also odd that it only happens in 
> convert_v1pdu_to_v2.

Not really - this is part of "Translating SNMPv1 Notification Parameters
to SNMPv2 Notification Parameters", so that's the natural place for this
to happen.


> In netsnmp_send_traps:
>
> The agent address field in the v1 pdu is always overwritten, even if 
> the v2 varbind that should override it is included.

I presume you mean the snmpTrapAddress.0 varbind here?
It's possible that this is actually correct behaviour (section 3.2, step
(2), first para), but I really need to check where 'netsnmp_send_traps'
is called.  If it's used when the agent is acting as a proxy, then this
should certainly use the snmpTrapAddress.0 value.  If this routine is
only invoked by "locally generated" traps (which would include AgentX
notifications), then I *think* the existing behaviour is probably fine.

But I need to check this more carefully.

Dave

------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to