Hello list,

I am porting a trap handler code from net-snmp-4.2.7 to net-snmp-5.4.1
on Solaris and linux platforms

To extract addresses (with net-snmp-4.2.7), there was the following code:

char agentAddr[50];
char senderAddr[50];

struct sockaddr_in *agentIp = (struct sockaddr_in *)&pdu->agent_addr;
struct sockaddr_in *pduIp = (struct sockaddr_in *)&pdu->address;

strncpy(agentAddr, inet_ntoa(agentIp->sin_addr), 50);
strncpy(senderAddr, inet_ntoa(pduIp->sin_addr), 50);

With net-snmp-5.4.1, the stuct snmp_dpu fields were modified:
- "snmp_ipaddr address;" was replaced by "void * transport_data;"
- "snmp_ipaddr agent_addr;" was replaced by "unsigned char agent_addr[4];"

Which code can be use to extract addresses (with net-snmp-5.4.1) from
these fields ?



SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
Net-snmp-users mailing list
Please see the following page to unsubscribe or change other options: