On Thu, 2005-04-21 at 21:37, Susanne Goldammer wrote:
> i am developing an application which should receive traps.
> Then i like to resend the received trap to another destination,
> different to the peer from where i got the trap.

You mean like 'snmptrapd' with the 'forward' directive?



> When i now open a second session, clone the received trap-pdu, change 
> the peername of the session and e.g. the remote_port and send the trap
> again, the trap is sent, but not with the right ip address and port.


> But what happens is the following:
> 
> 192.168.1.2 port 3333 --> 192.168.1.3 port 162 (thats me)        OK
> 192.168.1.3 port 5555 (thats me) --> 192.168.1.2 port 3333      NOT OK

What happens if you set the peername to "192.168.1.2:162" ?
I've got a nagging feeling that the 'remote_port' field isn't
actually used any more.

Another possibility is that the 'snmp_send' is using the
transport information from the PDU (the transport_data field)
rather than from the session structure.
   What happens if you clone the pdu into a separate variable,
and set the 'transport_data' (and transport_data_length) fields
to 0, before sending the trap on?   That will introduce a memory
leak, but does it send the trap correctly?

John - you're the expert on the transport stuff.
Is it sensible to copy the transport data as part of cloning the PDU?

Dave



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