summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-07-26 02:27:40 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-07-31 01:06:27 +0200
commitf3e33b690b01c37858c11856901fe9e6614dda6b (patch)
tree99186455fe23a5ea4a27ecc75654bdf8ad6bbe5d /zebra/zserv.h
parentlib: add cancel point to default pthread loop (diff)
downloadfrr-f3e33b690b01c37858c11856901fe9e6614dda6b.tar.xz
frr-f3e33b690b01c37858c11856901fe9e6614dda6b.zip
zebra: dont delete pthreads from under themselves
* Rename some things to be less confusing * Convert client close function to take a client struct rather than a task * Extern client close function and use it when handling SIGTERM Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/zserv.h')
-rw-r--r--zebra/zserv.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/zebra/zserv.h b/zebra/zserv.h
index 78cc200fa..aaefd78ee 100644
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -73,6 +73,9 @@ struct zserv {
struct thread *t_read;
struct thread *t_write;
+ /* Threads for the main pthread */
+ struct thread *t_cleanup;
+
/* default routing table this client munges */
int rtm_table;
@@ -232,6 +235,18 @@ extern int zserv_send_message(struct zserv *client, struct stream *msg);
*/
extern struct zserv *zserv_find_client(uint8_t proto, unsigned short instance);
+
+/*
+ * Close a client.
+ *
+ * Kills a client's thread, removes the client from the client list and cleans
+ * up its resources.
+ *
+ * client
+ * the client to close
+ */
+extern void zserv_close_client(struct zserv *client);
+
#if defined(HANDLE_ZAPI_FUZZING)
extern void zserv_read_file(char *input);
#endif