On Wed, Feb 16, 2011 at 02:00:03PM +0000, th exterit wrote:
> I am writing a trap listener which listens on upd 162.  When each trap comes
> in I want to grab the source IP address of the device which sent the trap.
> My code basically takes snmptrapd.c and stripped it down to essentials -
> http://pastebin.com/fbCSQhpc

If you had looked into snmptrapd_log you would have found

transport->flags &= ~NETSNMP_TRANSPORT_FLAG_HOSTNAME;
tstr = transport->f_fmtaddr(transport, pdu->transport_data,
                            pdu->transport_data_length);

which gives you a textual representation ...

/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to