summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-10-26 17:33:44 +0200
committerGitHub <noreply@github.com>2021-10-26 17:33:44 +0200
commita2b52cbeb43f28daea6363f2fc6962347dfab334 (patch)
tree7d7b62d44195d08642c826a80720b97635223d6c /ripd
parentMerge pull request #9840 from donaldsharp/lu_commands (diff)
parent*: convert zclient callbacks to table (diff)
downloadfrr-a2b52cbeb43f28daea6363f2fc6962347dfab334.tar.xz
frr-a2b52cbeb43f28daea6363f2fc6962347dfab334.zip
Merge pull request #9854 from opensourcerouting/zapi-call-table
*: convert zclient callbacks to table
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_zebra.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 074370dc2..1f1566863 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -230,17 +230,21 @@ static void rip_zebra_connected(struct zclient *zclient)
zclient_send_reg_requests(zclient, VRF_DEFAULT);
}
+zclient_handler *const rip_handlers[] = {
+ [ZEBRA_INTERFACE_ADDRESS_ADD] = rip_interface_address_add,
+ [ZEBRA_INTERFACE_ADDRESS_DELETE] = rip_interface_address_delete,
+ [ZEBRA_INTERFACE_VRF_UPDATE] = rip_interface_vrf_update,
+ [ZEBRA_REDISTRIBUTE_ROUTE_ADD] = rip_zebra_read_route,
+ [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = rip_zebra_read_route,
+};
+
void rip_zclient_init(struct thread_master *master)
{
/* Set default value to the zebra client structure. */
- zclient = zclient_new(master, &zclient_options_default);
+ zclient = zclient_new(master, &zclient_options_default, rip_handlers,
+ array_size(rip_handlers));
zclient_init(zclient, ZEBRA_ROUTE_RIP, 0, &ripd_privs);
zclient->zebra_connected = rip_zebra_connected;
- zclient->interface_address_add = rip_interface_address_add;
- zclient->interface_address_delete = rip_interface_address_delete;
- zclient->interface_vrf_update = rip_interface_vrf_update;
- zclient->redistribute_route_add = rip_zebra_read_route;
- zclient->redistribute_route_del = rip_zebra_read_route;
}
void rip_zclient_stop(void)