diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:32 +0000 |
commit | 35cadacd2bb9383686753731e31bd7e145fb2506 (patch) | |
tree | 4489adbde75a837989533837185b2b8369a0bf68 /zebra/zebra_srv6.c | |
parent | Adding debian version 9.1-0.1. (diff) | |
download | frr-35cadacd2bb9383686753731e31bd7e145fb2506.tar.xz frr-35cadacd2bb9383686753731e31bd7e145fb2506.zip |
Merging upstream version 10.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zebra/zebra_srv6.c')
-rw-r--r-- | zebra/zebra_srv6.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/zebra/zebra_srv6.c b/zebra/zebra_srv6.c index 94b93e5..bb872ef 100644 --- a/zebra/zebra_srv6.c +++ b/zebra/zebra_srv6.c @@ -17,6 +17,7 @@ #include "zebra/zebra_router.h" #include "zebra/zebra_srv6.h" #include "zebra/zebra_errors.h" +#include "zebra/ge_netlink.h" #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -216,9 +217,10 @@ void zebra_notify_srv6_locator_delete(struct srv6_locator *locator) } } +struct zebra_srv6 srv6; + struct zebra_srv6 *zebra_srv6_get_default(void) { - static struct zebra_srv6 srv6; static bool first_execution = true; if (first_execution) { @@ -408,6 +410,40 @@ int release_daemon_srv6_locator_chunks(struct zserv *client) return count; } +void zebra_srv6_encap_src_addr_set(struct in6_addr *encap_src_addr) +{ + struct zebra_srv6 *srv6 = zebra_srv6_get_default(); + + if (!encap_src_addr) + return; + + memcpy(&srv6->encap_src_addr, encap_src_addr, sizeof(struct in6_addr)); +} + +void zebra_srv6_encap_src_addr_unset(void) +{ + struct zebra_srv6 *srv6 = zebra_srv6_get_default(); + + memset(&srv6->encap_src_addr, 0, sizeof(struct in6_addr)); +} + +void zebra_srv6_terminate(void) +{ + struct srv6_locator *locator; + + if (!srv6.locators) + return; + + while (listcount(srv6.locators)) { + locator = listnode_head(srv6.locators); + + listnode_delete(srv6.locators, locator); + srv6_locator_free(locator); + } + + list_delete(&srv6.locators); +} + void zebra_srv6_init(void) { hook_register(zserv_client_close, zebra_srv6_cleanup); |