From 26d7806d20565a1faf5e6d470d5b4a62bf129827 Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Thu, 2 Feb 2023 12:32:10 +0100 Subject: [PATCH] isisd: Add SRv6 SIDs to SRv6 configuration Add the list of SRv6 SIDs allocated by the IS-IS instance to the per-area SRv6 configuration. The list is area-specific. Each IS-IS area has its own SRv6 SIDs list. The list is initialized when an IS-IS area is created and freed when an IS-IS area is destroyed. Signed-off-by: Carmine Scarpitta --- isisd/isis_srv6.c | 7 +++++++ isisd/isis_srv6.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/isisd/isis_srv6.c b/isisd/isis_srv6.c index 8ae7963941..7ef8e960c0 100644 --- a/isisd/isis_srv6.c +++ b/isisd/isis_srv6.c @@ -185,6 +185,10 @@ void isis_srv6_area_init(struct isis_area *area) /* Initialize SRv6 Locator chunks list */ srv6db->srv6_locator_chunks = list_new(); + + /* Initialize SRv6 SIDs list */ + srv6db->srv6_sids = list_new(); + srv6db->srv6_sids->del = (void (*)(void *))isis_srv6_sid_free; } /** @@ -204,6 +208,9 @@ void isis_srv6_area_term(struct isis_area *area) for (ALL_LIST_ELEMENTS(srv6db->srv6_locator_chunks, node, nnode, chunk)) srv6_locator_chunk_free(&chunk); list_delete(&srv6db->srv6_locator_chunks); + + /* Free SRv6 SIDs list */ + list_delete(&srv6db->srv6_sids); } /** diff --git a/isisd/isis_srv6.h b/isisd/isis_srv6.h index 8d8752192c..270627a166 100644 --- a/isisd/isis_srv6.h +++ b/isisd/isis_srv6.h @@ -55,6 +55,9 @@ struct isis_srv6_db { /* List of SRv6 Locator chunks */ struct list *srv6_locator_chunks; + /* List of SRv6 SIDs allocated by the IS-IS instance */ + struct list *srv6_sids; + /* Area SRv6 configuration. */ struct { /* Administrative status of SRv6 */ -- 2.39.5