diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-02-13 00:29:37 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-03-25 08:52:36 +0100 |
| commit | 4f8ea50c0d97e8f339b40d95ce428f4ffd66ba76 (patch) | |
| tree | d2b9bf793d33f1c14d17f8cf1db7750f0b645e8a /zebra/zebra_rib.c | |
| parent | 5986b66b82d2c8a15c9467032d912be07481f07d (diff) | |
zebra: fpm: convert into module
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index f5b54a2c04..b3e70e46fa 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -48,11 +48,12 @@ #include "zebra/redistribute.h" #include "zebra/zebra_routemap.h" #include "zebra/debug.h" -#include "zebra/zebra_fpm.h" #include "zebra/zebra_rnh.h" #include "zebra/interface.h" #include "zebra/connected.h" +DEFINE_HOOK(rib_update, (struct route_node *rn, const char *reason), (rn, reason)) + /* Should we allow non Quagga processes to delete our routes */ extern int allow_delete; @@ -1110,7 +1111,7 @@ rib_install_kernel (struct route_node *rn, struct rib *rib, struct rib *old) * Make sure we update the FPM any time we send new information to * the kernel. */ - zfpm_trigger_update (rn, "installing in kernel"); + hook_call(rib_update, rn, "installing in kernel"); ret = kernel_route_rib (p, src_p, old, rib); /* If install succeeds, update FIB flag for nexthops. */ @@ -1154,7 +1155,7 @@ rib_uninstall_kernel (struct route_node *rn, struct rib *rib) * Make sure we update the FPM any time we send new information to * the kernel. */ - zfpm_trigger_update (rn, "uninstalling from kernel"); + hook_call(rib_update, rn, "uninstalling from kernel"); ret = kernel_route_rib (p, src_p, rib, NULL); for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing)) @@ -1172,7 +1173,7 @@ rib_uninstall (struct route_node *rn, struct rib *rib) if (CHECK_FLAG (rib->status, RIB_ENTRY_SELECTED_FIB)) { if (info->safi == SAFI_UNICAST) - zfpm_trigger_update (rn, "rib_uninstall"); + hook_call(rib_update, rn, "rib_uninstall"); if (! RIB_SYSTEM_ROUTE (rib)) rib_uninstall_kernel (rn, rib); @@ -1253,7 +1254,7 @@ static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn, struct rib *new) { - zfpm_trigger_update (rn, "new route selected"); + hook_call(rib_update, rn, "new route selected"); /* Update real nexthop. This may actually determine if nexthop is active or not. */ if (!nexthop_active_update (rn, new, 1)) @@ -1289,7 +1290,7 @@ static void rib_process_del_fib(struct zebra_vrf *zvrf, struct route_node *rn, struct rib *old) { - zfpm_trigger_update (rn, "removing existing route"); + hook_call(rib_update, rn, "removing existing route"); /* Uninstall from kernel. */ if (IS_ZEBRA_DEBUG_RIB) @@ -1326,7 +1327,7 @@ rib_process_update_fib (struct zebra_vrf *zvrf, struct route_node *rn, if (new != old || CHECK_FLAG (new->status, RIB_ENTRY_CHANGED)) { - zfpm_trigger_update (rn, "updating existing route"); + hook_call(rib_update, rn, "updating existing route"); /* Update the nexthop; we could determine here that nexthop is inactive. */ if (nexthop_active_update (rn, new, 1)) @@ -2874,7 +2875,7 @@ rib_close_table (struct route_table *table) continue; if (info->safi == SAFI_UNICAST) - zfpm_trigger_update (rn, NULL); + hook_call(rib_update, rn, NULL); if (! RIB_SYSTEM_ROUTE (rib)) rib_uninstall_kernel (rn, rib); |
