diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-04-22 23:03:52 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-04-23 04:50:24 +0200 |
commit | 453844abd7bce28479d10490de513ca59cd0d490 (patch) | |
tree | 7396f2ff275f5e8186975d819b3cc75a4b3b34bc /zebra/zserv.h | |
parent | zebra: clean up zapi organization (diff) | |
download | frr-453844abd7bce28479d10490de513ca59cd0d490.tar.xz frr-453844abd7bce28479d10490de513ca59cd0d490.zip |
zebra: use hooks for client lifecycle callbacks
zserv.c was using hardcoded callbacks to clean up various components
when a client disconnected. Ergo zserv.c had to know about all these
unrelated components that it should not care about. We have hooks now,
let's use the proper thing instead.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/zserv.h')
-rw-r--r-- | zebra/zserv.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/zebra/zserv.h b/zebra/zserv.h index 2a148f645..b3f3cce7e 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -34,6 +34,7 @@ #include "lib/thread.h" /* for thread, thread_master */ #include "lib/linklist.h" /* for list */ #include "lib/workqueue.h" /* for work_queue */ +#include "lib/hook.h" /* for DECLARE_HOOK, DECLARE_KOOH */ #include "zebra/zebra_vrf.h" /* for zebra_vrf */ @@ -88,7 +89,7 @@ struct zserv { /* client's protocol */ uint8_t proto; - unsigned short instance; + uint16_t instance; uint8_t is_synchronous; /* Statistics */ @@ -141,6 +142,10 @@ struct zserv { struct zserv *client, struct zmsghdr *hdr, struct stream *msg, \ struct zebra_vrf *zvrf +/* Hooks for client connect / disconnect */ +DECLARE_HOOK(client_connect, (struct zserv *client), (client)); +DECLARE_KOOH(client_close, (struct zserv *client), (client)); + /* Zebra instance */ struct zebra_t { /* Thread master */ |