summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarmine Scarpitta <cscarpit@cisco.com>2025-02-15 10:39:30 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2025-02-15 14:57:41 +0000
commit9c5d87ef84bc6bc4af6fb0bb3656398507cdd5d5 (patch)
tree301210c68b033eaa9449cfc8f4e4ebfc9a4724c3
parentf3249ab68613df0fbd85c0e72d176a43db6550c4 (diff)
isisd: Add helper function to request SRv6 locator information
This commit adds a function that iterates over all IS-IS areas and asks the SRv6 Manager for information about the configured locators. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com> (cherry picked from commit 0b76fb3c133951c8d1203dbe7c2e5a4e1b67dffe)
-rw-r--r--isisd/isis_srv6.c21
-rw-r--r--isisd/isis_srv6.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/isisd/isis_srv6.c b/isisd/isis_srv6.c
index 2348bd043a..8e9c21aa23 100644
--- a/isisd/isis_srv6.c
+++ b/isisd/isis_srv6.c
@@ -658,6 +658,27 @@ int isis_srv6_ifp_up_notify(struct interface *ifp)
}
/**
+ * Request SRv6 locator info from the SID Manager for all IS-IS areas where SRv6
+ * is enabled and a locator has been configured.
+ * This function is called as soon as the connection with Zebra is established
+ * to get information about all configured locators.
+ */
+void isis_srv6_locators_request(void)
+{
+ struct isis *isis = isis_lookup_by_vrfid(VRF_DEFAULT);
+ struct listnode *node;
+ struct isis_area *area;
+
+ if (!isis)
+ return;
+
+ for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area))
+ if (area->srv6db.config.enabled &&
+ area->srv6db.config.srv6_locator_name[0] != '\0' && !area->srv6db.srv6_locator)
+ isis_zebra_srv6_manager_get_locator(area->srv6db.config.srv6_locator_name);
+}
+
+/**
* IS-IS SRv6 initialization for given area.
*
* @param area IS-IS area
diff --git a/isisd/isis_srv6.h b/isisd/isis_srv6.h
index bde14965f6..bb221b760a 100644
--- a/isisd/isis_srv6.h
+++ b/isisd/isis_srv6.h
@@ -156,6 +156,8 @@ isis_srv6_sid_alloc(struct isis_area *area, struct srv6_locator *locator,
struct in6_addr *sid_value);
extern void isis_srv6_sid_free(struct isis_srv6_sid *sid);
+void isis_srv6_locators_request(void);
+
extern void isis_srv6_area_init(struct isis_area *area);
extern void isis_srv6_area_term(struct isis_area *area);