]> git.puffer.fish Git - mirror/frr.git/commitdiff
isis, lib: add isis srv6 capability to ls_node 15653/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 16 Nov 2023 09:06:34 +0000 (10:06 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 23 Apr 2024 12:27:01 +0000 (14:27 +0200)
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
isisd/isis_te.c
lib/link_state.c
lib/link_state.h

index 960ffe9a156e9423781cbb237d8e4776538ce4a1..61c3db7f053d2b9f8b12c77874208be9416cad4d 100644 (file)
@@ -797,6 +797,12 @@ static struct ls_vertex *lsp_to_vertex(struct ls_ted *ted, struct isis_lsp *lsp)
                                lnode.msd = cap->msd;
                                SET_FLAG(lnode.flags, LS_NODE_MSD);
                        }
+                       if (cap->srv6_cap.is_srv6_capable) {
+                               SET_FLAG(lnode.flags, LS_NODE_SRV6);
+                               lnode.srv6_cap_flags = cap->srv6_cap.flags;
+                               memcpy(&lnode.srv6_msd, &cap->srv6_msd,
+                                      sizeof(struct isis_srv6_msd));
+                       }
                }
        }
 
index 321707493f0d0584ceaf6845dcbf529d8f981bbb..c758b7f57517fb1a678735abe079e4f55ac7fbc2 100644 (file)
@@ -140,6 +140,12 @@ int ls_node_same(struct ls_node *n1, struct ls_node *n2)
                if (CHECK_FLAG(n1->flags, LS_NODE_MSD) && (n1->msd != n2->msd))
                        return 0;
        }
+       if (CHECK_FLAG(n1->flags, LS_NODE_SRV6)) {
+               if (n1->srv6_cap_flags != n2->srv6_cap_flags)
+                       return 0;
+               if (memcmp(&n1->srv6_msd, &n2->srv6_msd, sizeof(n1->srv6_msd)))
+                       return 0;
+       }
 
        /* OK, n1 & n2 are equal */
        return 1;
index aaf97a28b92b1e873acd25d8796484b10b55bd14..d819c20db763c3d23dfd4b9296db44195e562223 100644 (file)
@@ -106,6 +106,7 @@ extern int ls_node_id_same(struct ls_node_id i1, struct ls_node_id i2);
 #define LS_NODE_SR             0x0040
 #define LS_NODE_SRLB           0x0080
 #define LS_NODE_MSD            0x0100
+#define LS_NODE_SRV6           0x0200
 
 /* Link State Node structure */
 struct ls_node {
@@ -128,6 +129,14 @@ struct ls_node {
        } srlb;
        uint8_t algo[LIB_LS_SR_ALGO_COUNT]; /* Segment Routing Algorithms */
        uint8_t msd;                    /* Maximum Stack Depth */
+
+       uint16_t srv6_cap_flags; /* draft-ietf-idr-bgpls-srv6-ext, 3.1., flags field */
+       struct ls_srv6_msd { /* draft-ietf-idr-bgpls-srv6-ext, 3.2. */
+               uint8_t max_seg_left_msd;
+               uint8_t max_end_pop_msd;
+               uint8_t max_h_encaps_msd;
+               uint8_t max_end_d_msd;
+       } srv6_msd;
 };
 
 /* Link State flags to indicate which Attribute parameters are valid */