summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-04-14 16:45:09 +0200
committerMark Stapp <mjs@voltanet.io>2020-04-16 18:07:54 +0200
commit4e0b5b31b795815e853ec665e651743b280dfc9d (patch)
tree31aa3e036e43575eb21711b9397da42bb84f2a08 /zebra/zserv.h
parentMerge pull request #6154 from donaldsharp/check_interface_working (diff)
downloadfrr-4e0b5b31b795815e853ec665e651743b280dfc9d.tar.xz
frr-4e0b5b31b795815e853ec665e651743b280dfc9d.zip
lib,zebra: add a session id for zapi sessions
Distinguish zapi sessions, for daemons who use more than one, by adding a session id. The tuple of proto + instance is not adequate to support clients who use multiple zapi sessions. Include the id in the client show output if it's present. Add a bit of info about this to the developer doc. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zserv.h')
-rw-r--r--zebra/zserv.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/zebra/zserv.h b/zebra/zserv.h
index 08df664d5..5506c4299 100644
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -134,9 +134,10 @@ struct zserv {
/* Indicates if client is synchronous. */
bool synchronous;
- /* client's protocol */
+ /* client's protocol and session info */
uint8_t proto;
uint16_t instance;
+ uint32_t session_id;
/*
* Interested for MLAG Updates, and also stores the client
@@ -287,6 +288,24 @@ extern int zserv_send_message(struct zserv *client, struct stream *msg);
extern struct zserv *zserv_find_client(uint8_t proto, unsigned short instance);
/*
+ * Retrieve a client by its protocol, instance number, and session id.
+ *
+ * proto
+ * protocol number
+ *
+ * instance
+ * instance number
+ *
+ * session_id
+ * session id
+ *
+ * Returns:
+ * The Zebra API client.
+ */
+struct zserv *zserv_find_client_session(uint8_t proto, unsigned short instance,
+ uint32_t session_id);
+
+/*
* Close a client.
*
* Kills a client's thread, removes the client from the client list and cleans