diff options
author | vincent <vincent> | 2005-09-29 16:34:30 +0000 |
---|---|---|
committer | vincent <vincent> | 2005-09-29 16:34:30 +0000 |
commit | 5e4914c31ead7b99eeed73067451367336b21422 (patch) | |
tree | f2c49d5c8182d4ee1b8ad8ca5005fe1223da18c8 /lib | |
parent | ceacedba227e77156f92f7676b274c48a2817e8f (diff) |
2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>
* lib/smux.[ch]: allow to retreive global OID (identified by <0
namelen).
* ospf_ism.c: generate SNMP traps on Interface state change
* ospf_nsm.c: generate SNMP traps on Neighbour state change
* ospf_snmp.[ch]: support for SNMP traps for interface and neighbours.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/smux.c | 33 | ||||
-rw-r--r-- | lib/smux.h | 4 |
3 files changed, 34 insertions, 8 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 2a8256f8..fd3feffa 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2005-09-29 Alain Ritoux <alain.ritoux@6wind.com> + + * smux.[ch]: allow to retreive global OID (identified by <0 + namelen). + 2005-09-29 Paul Jakma <paul.jakma@sun.com> * zebra.h: Solaris capabilities requires priv.h to be included. @@ -1065,13 +1065,34 @@ smux_trap (oid *name, size_t namelen, u_char val_type; /* Make OID. */ - oid_copy (oid, name, namelen); - oid_copy (oid + namelen, trapobj[i].name, trapobj[i].namelen); - oid_copy (oid + namelen + trapobj[i].namelen, iname, inamelen); - oid_len = namelen + trapobj[i].namelen + inamelen; + if (trapobj[i].namelen > 0) + { + oid_copy (oid, name, namelen); + oid_copy (oid + namelen, trapobj[i].name, trapobj[i].namelen); + oid_copy (oid + namelen + trapobj[i].namelen, iname, inamelen); + oid_len = namelen + trapobj[i].namelen + inamelen; + } + else + { + oid_copy (oid, name, namelen); + oid_copy (oid + namelen, trapobj[i].name, trapobj[i].namelen * (-1)); + oid_len = namelen + trapobj[i].namelen * (-1) ; + } - if (debug_smux) - smux_oid_dump ("Trap", oid, oid_len); + if (debug_smux) + { + smux_oid_dump ("Trap", name, namelen); + if (trapobj[i].namelen < 0) + smux_oid_dump ("Trap", + trapobj[i].name, (- 1) * (trapobj[i].namelen)); + else + { + smux_oid_dump ("Trap", trapobj[i].name, (trapobj[i].namelen)); + smux_oid_dump ("Trap", iname, inamelen); + } + smux_oid_dump ("Trap", oid, oid_len); + zlog_info ("BUFSIZ: %d // oid_len: %d", BUFSIZ, oid_len); + } ret = smux_get (oid, &oid_len, 1, &val_type, &val, &val_len); @@ -94,7 +94,7 @@ struct variable FindVarMethod *findVar; /* Suffix of the MIB. */ - u_char namelen; + int namelen; oid name[MAX_OID_LEN]; }; @@ -121,7 +121,7 @@ struct subtree struct trap_object { FindVarMethod *findVar; - u_char namelen; + int namelen; oid name[MAX_OID_LEN]; }; |