]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: Add helper function to request SRv6 locator information
authorCarmine Scarpitta <cscarpit@cisco.com>
Sat, 15 Feb 2025 09:39:30 +0000 (10:39 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 15 Feb 2025 14:40:39 +0000 (14:40 +0000)
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)

isisd/isis_srv6.c
isisd/isis_srv6.h

index 4b97b5372ef5aea33a3e6a3751d658932d6c3916..f7a8733f761ff2c070c093039ae3c4b1573acb34 100644 (file)
@@ -657,6 +657,27 @@ int isis_srv6_ifp_up_notify(struct interface *ifp)
        return 0;
 }
 
+/**
+ * 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.
  *
index eeb76c0b86b6f43cc6a7f352c83a317a3f211347..c2d6107367620b397c803da50a629ea96aa2a6fb 100644 (file)
@@ -155,6 +155,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);