On Wed, Jul 19, 2006 at 03:04:09PM +0100, Dave Shield wrote:
> On 19/07/06, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> >         I have notification originator application, which uses Net-SNMP APIs
> > and runs as a separate process (not part of snmpd).
> 
> Presumably this runs as an AgentX subagent - yes?
> 
> >         Net-SNMP APIs assigns the local IP address as the source IP. I am
> > trying to assign a different IP address as source IP by assigning a
> > different IP address for the variable 'localname' in snmp_session structure.
> > But this didn't work.
> >
> > Is there a way to change the source IP in the PDU before notification
> > originator sends the trap/inform?
> 
> Which API are you using to generate the trap?  In particular, are you
> using SNMPv1 or SNMPv2 syntax?   If the latter, try appending a
> 'snmpTrapAddress' varbind to the payload list, with the address you
> want to use.   I'm not sure whether that will do the trick or not, but
> it's worth a try.

It could work, there is sadly a misalignment in the code so if you have the
functions that converts from v2-notification to v1-trap and back and calls
them like:

res = v2tov1(v1tov2(v2tov1(v1tov2(inputV1))));

then res != inputV1.

Additionally, snmpd is wery keen on replacing the source address so it might
be that you loose anyway.

/MF

-------------------------------------------------------------------------
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