]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: Add SRv6 locator chunks to SRv6 config
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Thu, 2 Feb 2023 11:30:35 +0000 (12:30 +0100)
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Mon, 11 Sep 2023 15:34:52 +0000 (17:34 +0200)
Add a list of SRv6 locator chunks allocated to a specific IS-IS area.
The list is initialized when the IS-IS area is created and freed when
the IS-IS area is destroyed. Subsequent commits will introduce the
possibility to allocate and release locator chunks.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
isisd/isis_srv6.c
isisd/isis_srv6.h

index 1397ea4d0b6bf06b80687292b61f9fcf4816d046..b08609d360ed0f73031e6bfb7b0c737e3ace7193 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <zebra.h>
 
+#include "srv6.h"
 #include "termtable.h"
 
 #include "isisd/isisd.h"
@@ -124,6 +125,9 @@ void isis_srv6_area_init(struct isis_area *area)
        srv6db->config.max_end_pop_msd = SRV6_MAX_END_POP;
        srv6db->config.max_h_encaps_msd = SRV6_MAX_H_ENCAPS;
        srv6db->config.max_end_d_msd = SRV6_MAX_END_D;
+
+       /* Initialize SRv6 Locator chunks list */
+       srv6db->srv6_locator_chunks = list_new();
 }
 
 /**
@@ -133,7 +137,16 @@ void isis_srv6_area_init(struct isis_area *area)
  */
 void isis_srv6_area_term(struct isis_area *area)
 {
+       struct isis_srv6_db *srv6db = &area->srv6db;
+       struct listnode *node, *nnode;
+       struct srv6_locator_chunk *chunk;
+
        sr_debug("ISIS-SRv6 (%s): Terminate SRv6", area->area_tag);
+
+       /* Free SRv6 Locator chunks list */
+       for (ALL_LIST_ELEMENTS(srv6db->srv6_locator_chunks, node, nnode, chunk))
+               srv6_locator_chunk_free(&chunk);
+       list_delete(&srv6db->srv6_locator_chunks);
 }
 
 /**
index d999f3b85362ab7349ee52773f2db7d9084165e0..b0e92c8a5b98fb523ed2d4e44f1f063351f01e4c 100644 (file)
@@ -19,6 +19,9 @@
 /* Per-area IS-IS SRv6 Data Base (SRv6 DB) */
 struct isis_srv6_db {
 
+       /* List of SRv6 Locator chunks */
+       struct list *srv6_locator_chunks;
+
        /* Area SRv6 configuration. */
        struct {
                /* Administrative status of SRv6 */