Re: a problem about handling snmptrap - SNMP

This is a discussion on Re: a problem about handling snmptrap - SNMP ; --===============1261770687==
Content-Type: multipart/alternative;
boundary="----=_Part_171364_6882790.1179067770401"
------=_Part_171364_6882790.1179067770401
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi Aluisio Leonelo Victal,
> I belive that you want de source address of ip packets, but i need more
>information about the "struct pdu" and any ...

Hi Aluisio Leonelo Victal,
> I belive that you want de source address of ip packets, but i need more
>information about the "struct pdu" and any another information about how
>you catch the packets.

I used net-snmp-5.3.0.1, I also used
snmptrapd_add_session(netsnmp_transport *transport) to get the packet, and
in the function callback function --- snmp_input is used to process an
incoming trap through calling a new
function------trap_message_handler(netsnmp_pdu *, netsnmp_trapsport *,
netsnmp_trapd_handler *) which I add. The pdu is a struct netsnmp_pdu, and
unsigned char agent_addr[4] is the a item of the struct, I get the ip
through agent_addr as follow:

> I belive that you want de source address of ip packets, but i need more >information about the "struct pdu" and any another information about how >you catch the packets.

I used net-snmp-5.3.0.1, I also used snmptrapd_add_session(netsnmp_transport *transport) to get the packet, and in the function callback function --- snmp_input is used to process an incoming trap through calling a new function------trap_message_handler(netsnmp_pdu *, netsnmp_trapsport *, netsnmp_trapd_handler *) which I add. The pdu is a struct netsnmp_pdu, and unsigned char agent_addr[4] is the a item of the struct, I get the ip through agent_addr as follow:

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.http://sourceforge.net/powerbar/db2/
--===============1261770687==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline