summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_neighbor.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-06-12 17:32:23 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-03-25 08:52:36 +0100
commit3012671ffadbd839626b5c0b0b1fd36b3698f582 (patch)
tree847bacd0156e5e8dc2e64cbfbbf10c2f6e3ac9ac /ospf6d/ospf6_neighbor.c
parentbuild: split off libfrrsnmp (diff)
downloadfrr-3012671ffadbd839626b5c0b0b1fd36b3698f582.tar.xz
frr-3012671ffadbd839626b5c0b0b1fd36b3698f582.zip
*: use hooks for sending SNMP traps
This means there are no ties into the SNMP code anymore other than the init call at startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_neighbor.c')
-rw-r--r--ospf6d/ospf6_neighbor.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c
index ec79a1552..118210dfc 100644
--- a/ospf6d/ospf6_neighbor.c
+++ b/ospf6d/ospf6_neighbor.c
@@ -38,7 +38,6 @@
#include "ospf6_neighbor.h"
#include "ospf6_intra.h"
#include "ospf6_flood.h"
-#include "ospf6_snmp.h"
#include "ospf6d.h"
#include "ospf6_bfd.h"
#include "ospf6_abr.h"
@@ -47,6 +46,10 @@
#include "ospf6_spf.h"
#include "ospf6_zebra.h"
+DEFINE_HOOK(ospf6_neighbor_change,
+ (struct ospf6_neighbor *on, int state, int next_state),
+ (on, state, next_state))
+
unsigned char conf_debug_ospf6_neighbor = 0;
const char *ospf6_neighbor_state_str[] =
@@ -202,13 +205,7 @@ ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on, int e
next_state != OSPF6_NEIGHBOR_LOADING))
ospf6_maxage_remove (on->ospf6_if->area->ospf6);
-#ifdef HAVE_SNMP
- /* Terminal state or regression */
- if ((next_state == OSPF6_NEIGHBOR_FULL) ||
- (next_state == OSPF6_NEIGHBOR_TWOWAY) ||
- (next_state < prev_state))
- ospf6TrapNbrStateChange (on);
-#endif
+ hook_call(ospf6_neighbor_change, on, next_state, prev_state);
ospf6_bfd_trigger_event(on, prev_state, next_state);
}