summaryrefslogtreecommitdiffstats
path: root/pathd
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 /pathd
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 'pathd')
-rw-r--r--pathd/path_zebra.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/pathd/path_zebra.c b/pathd/path_zebra.c
index 53d834f36..156267a39 100644
--- a/pathd/path_zebra.c
+++ b/pathd/path_zebra.c
@@ -320,6 +320,12 @@ static int path_zebra_opaque_msg_handler(ZAPI_CALLBACK_ARGS)
return ret;
}
+static zclient_handler *const path_handlers[] = {
+ [ZEBRA_SR_POLICY_NOTIFY_STATUS] = path_zebra_sr_policy_notify_status,
+ [ZEBRA_ROUTER_ID_UPDATE] = path_zebra_router_id_update,
+ [ZEBRA_OPAQUE_MESSAGE] = path_zebra_opaque_msg_handler,
+};
+
/**
* Initializes Zebra asynchronous connection.
*
@@ -331,15 +337,13 @@ void path_zebra_init(struct thread_master *master)
options.synchronous = true;
/* Initialize asynchronous zclient. */
- zclient = zclient_new(master, &zclient_options_default);
+ zclient = zclient_new(master, &zclient_options_default, path_handlers,
+ array_size(path_handlers));
zclient_init(zclient, ZEBRA_ROUTE_SRTE, 0, &pathd_privs);
zclient->zebra_connected = path_zebra_connected;
- zclient->sr_policy_notify_status = path_zebra_sr_policy_notify_status;
- zclient->router_id_update = path_zebra_router_id_update;
- zclient->opaque_msg_handler = path_zebra_opaque_msg_handler;
/* Initialize special zclient for synchronous message exchanges. */
- zclient_sync = zclient_new(master, &options);
+ zclient_sync = zclient_new(master, &options, NULL, 0);
zclient_sync->sock = -1;
zclient_sync->redist_default = ZEBRA_ROUTE_SRTE;
zclient_sync->instance = 1;