summaryrefslogtreecommitdiff
path: root/ospfd/ospf_ism.c
diff options
context:
space:
mode:
authorvincent <vincent>2005-09-29 16:34:30 +0000
committervincent <vincent>2005-09-29 16:34:30 +0000
commit5e4914c31ead7b99eeed73067451367336b21422 (patch)
treef2c49d5c8182d4ee1b8ad8ca5005fe1223da18c8 /ospfd/ospf_ism.c
parentceacedba227e77156f92f7676b274c48a2817e8f (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 'ospfd/ospf_ism.c')
-rw-r--r--ospfd/ospf_ism.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c
index b251e590..ab91e8d8 100644
--- a/ospfd/ospf_ism.c
+++ b/ospfd/ospf_ism.c
@@ -43,6 +43,7 @@
#include "ospfd/ospf_packet.h"
#include "ospfd/ospf_flood.h"
#include "ospfd/ospf_abr.h"
+#include "ospfd/ospf_snmp.h"
/* elect DR and BDR. Refer to RFC2319 section 9.4 */
static struct ospf_neighbor *
@@ -552,6 +553,20 @@ ism_change_state (struct ospf_interface *oi, int state)
oi->state = state;
oi->state_change++;
+#ifdef HAVE_SNMP
+ /* Terminal state or regression */
+ if ((state == ISM_DR) || (state == ISM_Backup) || (state == ISM_DROther) ||
+ (state == ISM_PointToPoint) || (state < old_state))
+ {
+ /* ospfVirtIfStateChange */
+ if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
+ ospfTrapVirtIfStateChange (oi);
+ /* ospfIfStateChange */
+ else
+ ospfTrapIfStateChange (oi);
+ }
+#endif
+
/* Set multicast memberships appropriately for new state. */
ospf_if_set_multicast(oi);