Re: Can't retreive peername in V2 trap

Mihir Lala <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
The peername can be retrieved from the transport
information(pdu->transport_data) that is passed to your trap handler.

Code like this would work:

struct sockaddr_in *addr = (struct sockaddr_in *)pdu->transport_data;
struct hostent *host = gethostbyaddr((char *)&(addr->sin_addr),
                                     sizeof(struct in_addr), AF_INET);

-mrl

--- Denis Rheault <[email protected]> wrote:

> Hi,
> 
> Writing a snmptrapd and when I receive V2 trap I can't find where to 
> retreive the peername. When receiving V1 I use pdy->agent_addr[]
> 
> Thanks
> 
> _________________________________________________________________
> Take charge with a pop-up guard built on patented Microsoft®
> SmartScreen 
> Technology. 
>
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> 
>   Start enjoying all the benefits of MSN® Premium right now and get
> the 
> first two months FREE*.
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing
> & QA
> Security * Process Improvement & Measurement *
> http://www.sqe.com/bsce5sf
> _______________________________________________
> 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
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.