Hello Team, I have a scenario in which I need to collect traps from some devices in local network and forward the same (after adding some more objects) to some selected destinations. As part of a feasibility to do the same, I have referred snmptrapd program to receive traps and snmptrap program to forward traps. I have combined both the mentioned sample programs and called snmptrap main from syslog_handler() of snmptrapd. I have passed the pdu available in syslog_handler to snmptrap main. I am facing two issues while forwarding the traps using this combined application.
1. I have replaced pdu argument to snmp_send() function inside snmptrap application with the one passed from syslog_handler. It resulted in Segmentation fault. 2. I have created a new PDU inside snmptrap main (as the sample program already does) and tried to add some more variable into the PDU(other than system time and trap IOD value). I took the variables available in the pdu passed from syslog_handler for this purpose. But here the issue is snmp_add_var() expect the variable type as 'char' and value as 'const char *'. How can I convert the parameters in PDU structure into this form? Is there any API available for that? Upon printing the hex values of pdu->variables->type, I could see that String variables is having type value '4', IP address is having type value as '40' etc But as per snmptrap man page the expected types are 's'(hex vale: 73) and 'a' (hex vale: 61). Why this mismatch? Am I doing anything wrong? Can anyone support me in this issue? thank you, renjith ***** Confidentiality Statement/Disclaimer ***** This message and any attachments is intended for the sole use of the intended recipient. It may contain confidential information. Any unauthorized use, dissemination or modification is strictly prohibited. If you are not the intended recipient, please notify the sender immediately then delete it from all your systems, and do not copy, use or print. Internet communications are not secure and it is the responsibility of the recipient to make sure that it is virus/malicious code exempt. The company/sender cannot be responsible for any unauthorized alterations or modifications made to the contents. If you require any form of confirmation of the contents, please contact the company/sender. The company/sender is not liable for any errors or omissions in the content of this message. ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
