diff options
author | Russ White <russ@riw.us> | 2021-10-26 17:33:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 17:33:44 +0200 |
commit | a2b52cbeb43f28daea6363f2fc6962347dfab334 (patch) | |
tree | 7d7b62d44195d08642c826a80720b97635223d6c /eigrpd | |
parent | Merge pull request #9840 from donaldsharp/lu_commands (diff) | |
parent | *: convert zclient callbacks to table (diff) | |
download | frr-a2b52cbeb43f28daea6363f2fc6962347dfab334.tar.xz frr-a2b52cbeb43f28daea6363f2fc6962347dfab334.zip |
Merge pull request #9854 from opensourcerouting/zapi-call-table
*: convert zclient callbacks to table
Diffstat (limited to 'eigrpd')
-rw-r--r-- | eigrpd/eigrp_zebra.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/eigrpd/eigrp_zebra.c b/eigrpd/eigrp_zebra.c index 7c765248c..89dd5be27 100644 --- a/eigrpd/eigrp_zebra.c +++ b/eigrpd/eigrp_zebra.c @@ -102,20 +102,24 @@ static void eigrp_zebra_connected(struct zclient *zclient) zclient_send_reg_requests(zclient, VRF_DEFAULT); } +static zclient_handler *const eigrp_handlers[] = { + [ZEBRA_ROUTER_ID_UPDATE] = eigrp_router_id_update_zebra, + [ZEBRA_INTERFACE_ADDRESS_ADD] = eigrp_interface_address_add, + [ZEBRA_INTERFACE_ADDRESS_DELETE] = eigrp_interface_address_delete, + [ZEBRA_REDISTRIBUTE_ROUTE_ADD] = eigrp_zebra_read_route, + [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = eigrp_zebra_read_route, + [ZEBRA_ROUTE_NOTIFY_OWNER] = eigrp_zebra_route_notify_owner, +}; + void eigrp_zebra_init(void) { struct zclient_options opt = {.receive_notify = false}; - zclient = zclient_new(master, &opt); + zclient = zclient_new(master, &opt, eigrp_handlers, + array_size(eigrp_handlers)); zclient_init(zclient, ZEBRA_ROUTE_EIGRP, 0, &eigrpd_privs); zclient->zebra_connected = eigrp_zebra_connected; - zclient->router_id_update = eigrp_router_id_update_zebra; - zclient->interface_address_add = eigrp_interface_address_add; - zclient->interface_address_delete = eigrp_interface_address_delete; - zclient->redistribute_route_add = eigrp_zebra_read_route; - zclient->redistribute_route_del = eigrp_zebra_read_route; - zclient->route_notify_owner = eigrp_zebra_route_notify_owner; } |