summaryrefslogtreecommitdiffstats
path: root/babeld/babel_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'babeld/babel_zebra.c')
-rw-r--r--babeld/babel_zebra.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c
index d10d41857..d0da93e50 100644
--- a/babeld/babel_zebra.c
+++ b/babeld/babel_zebra.c
@@ -234,16 +234,20 @@ babel_zebra_connected (struct zclient *zclient)
zclient_send_reg_requests (zclient, VRF_DEFAULT);
}
+static zclient_handler *const babel_handlers[] = {
+ [ZEBRA_INTERFACE_ADDRESS_ADD] = babel_interface_address_add,
+ [ZEBRA_INTERFACE_ADDRESS_DELETE] = babel_interface_address_delete,
+ [ZEBRA_REDISTRIBUTE_ROUTE_ADD] = babel_zebra_read_route,
+ [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = babel_zebra_read_route,
+};
+
void babelz_zebra_init(void)
{
- zclient = zclient_new(master, &zclient_options_default);
+ zclient = zclient_new(master, &zclient_options_default, babel_handlers,
+ array_size(babel_handlers));
zclient_init(zclient, ZEBRA_ROUTE_BABEL, 0, &babeld_privs);
zclient->zebra_connected = babel_zebra_connected;
- zclient->interface_address_add = babel_interface_address_add;
- zclient->interface_address_delete = babel_interface_address_delete;
- zclient->redistribute_route_add = babel_zebra_read_route;
- zclient->redistribute_route_del = babel_zebra_read_route;
install_element(BABEL_NODE, &babel_redistribute_type_cmd);
install_element(ENABLE_NODE, &debug_babel_cmd);