From 35cadacd2bb9383686753731e31bd7e145fb2506 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 06:24:32 +0200 Subject: Merging upstream version 10.0. Signed-off-by: Daniel Baumann --- zebra/zebra_pw.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'zebra/zebra_pw.c') diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index f76bf74..deed3b6 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -377,15 +377,18 @@ static int zebra_pw_client_close(struct zserv *client) return 0; } -void zebra_pw_init(struct zebra_vrf *zvrf) +static void zebra_pw_init(void) +{ + hook_register(zserv_client_close, zebra_pw_client_close); +} + +void zebra_pw_init_vrf(struct zebra_vrf *zvrf) { RB_INIT(zebra_pw_head, &zvrf->pseudowires); RB_INIT(zebra_static_pw_head, &zvrf->static_pseudowires); - - hook_register(zserv_client_close, zebra_pw_client_close); } -void zebra_pw_exit(struct zebra_vrf *zvrf) +void zebra_pw_exit_vrf(struct zebra_vrf *zvrf) { struct zebra_pw *pw; @@ -396,6 +399,11 @@ void zebra_pw_exit(struct zebra_vrf *zvrf) } } +void zebra_pw_terminate(void) +{ + hook_unregister(zserv_client_close, zebra_pw_client_close); +} + DEFUN_NOSH (pseudowire_if, pseudowire_if_cmd, "pseudowire IFNAME", @@ -837,4 +845,6 @@ void zebra_pw_vty_init(void) install_element(VIEW_NODE, &show_pseudowires_cmd); install_element(VIEW_NODE, &show_pseudowires_detail_cmd); + + zebra_pw_init(); } -- cgit v1.2.3