summaryrefslogtreecommitdiffstats
path: root/isisd
diff options
context:
space:
mode:
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>2023-02-22 01:25:12 +0100
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>2023-09-11 22:11:40 +0200
commit48d1cd17482fb37f1927734e70c473d03cf6dc5b (patch)
tree04713e5efe6e78ae19382cb1d02a20f547f4b326 /isisd
parentisisd: Add structure when building End SID Sub-TLV (diff)
downloadfrr-48d1cd17482fb37f1927734e70c473d03cf6dc5b.tar.xz
frr-48d1cd17482fb37f1927734e70c473d03cf6dc5b.zip
isisd: Add SRv6 Locator TLV to the LSP
Add the SRv6 Locator TLV and its Sub-TLV and Sub-Sub-TLVs to the LSP. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_lsp.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index 07c1404a0..e5970f650 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -1229,7 +1229,39 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
srv6db->config.max_h_encaps_msd;
rcap->srv6_msd.max_end_d_msd =
srv6db->config.max_end_d_msd;
+ } else {
+ rcap->srv6_cap.is_srv6_capable = false;
+ }
+ }
+
+ /* Add SRv6 Locator TLV. */
+ if (area->srv6db.config.enabled &&
+ !list_isempty(area->srv6db.srv6_locator_chunks)) {
+ struct isis_srv6_locator locator = {};
+ struct srv6_locator_chunk *chunk;
+
+ /* TODO: support more than one locator */
+ chunk = (struct srv6_locator_chunk *)listgetdata(
+ listhead(area->srv6db.srv6_locator_chunks));
+
+ locator.metric = 0;
+ locator.prefix = chunk->prefix;
+ locator.flags = 0;
+ locator.algorithm = 0;
+
+ struct listnode *sid_node;
+ struct isis_srv6_sid *sid;
+ locator.srv6_sid = list_new();
+ for (ALL_LIST_ELEMENTS_RO(area->srv6db.srv6_sids, sid_node,
+ sid)) {
+ listnode_add(locator.srv6_sid, sid);
}
+
+ isis_tlvs_add_srv6_locator(lsp->tlvs, 0, &locator);
+ lsp_debug("ISIS (%s): Adding SRv6 Locator information",
+ area->area_tag);
+
+ list_delete(&locator.srv6_sid);
}
/* IPv4 address and TE router ID TLVs.