On Thu, 2005-01-27 at 21:35, Andrew Hood wrote: > The trap is forwarded in whatever form it was received. Are you implying > snmptrapd's forward directive can be persuaded to convert incoming traps > to a single version? I can't see that in the man pages.
Hmmmm... it's a while since I worked on the trapd forwarding mechanism, but checking the code, it looks as if you're probably correct. That seems to simply pass the trap on exactly as it arrived. It shouldn't be too difficult to tweak this handler to cope with enforcing a particular outgoing version (perhaps using the handler's version and/or data fields). The agent library already contains 'convert_v2pdu_to_v1' and 'convert_v1pdu_to_v2' routines which could be used as a direct alternative to the 'snmp_clone_pdu' call. I'd originally been assuming you were using the snmpd agent to forward the trap. But thinking about it further, I'm not sure that actually supports this anyway. The traphandler is a much more appropriate tool. If you want to have a stab at adding this functionality, I'm sure Robert, Wes and the rest would be happy to include it in future releases. > If the original trap *had* an agent address I want it left alone. If it > didn't, I want the source address because that it the best approximation > I can make. > > The contention that the generator should have set the agent address is > reasonable. Unfortunately that isn't always the case. OK - so the forward trap handler would also need to be tweaked to add this functionality. Again, it shouldn't be too difficult. One of the parameters to the trap handler routines is the transport structure that the trap arrived on, so you should be able to check that this *is* an IPv4 transport, and extract the address. That would probably need to be a separately configurable feature (probably defaulting to being disabled). But I can see how it might be useful in certain circumstances. I trust you will also report to the vendors of this equipment that their trap generation code is broken? :-) Dave ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders