On Thu, Oct 28, 2021 at 5:23 PM Craig Small <csm...@dropbear.xyz> wrote:
> On Fri, 29 Oct 2021 at 05:14, Feroz <feroz.afs...@gmail.com> wrote: > >> hi, >> Is it necessary to maintain any specific order in SNMP TRAP for varbinds? >> > For the first two, yes. > I always followed the principles of: 1/ least surprise 2/ Be precise in what you send, and forgiving in what you receive. Having said that, reading that the first 'two varbinds are the uptime and trapOID respectively' and that a MIB source file lists the varbind in some order... Why not send them in the order shown? Why randomize? (ie. the principle of least surprise) And, regardless if they are sent in the order specified (why not?), if you were to implement a receiver, you certainly couldn't go wrong by 'accepting' them in any order. (principle #2). After all, each variable _does_ come with it's OID (rather than just a simple pre-ordered list of values). The other things to keep in mind are that: a) some traps do not have a varbind list defined in the MIB, and yet send varbinds anyway. (so there wasn't an order to follow) (but then again, the guy writing the MIB did a poor job in the first place!) b) there may be a trap re-writter in the middle between the sender and the receiver. And that man-in-the-middle may add additional (unexpected/undocumented) varbinds on the end of the original trap. (And heck, if they can add stuff onto the end, I wouldn't be surprised anymore to see someone shuffle the original list, or throw new stuff anywhere in between.) [I've seen both done 'in the real world', and I've cursed the people/companies involved.]
_______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders