From a2bd91e5b8d169c2ad20a12a34a73125da6f95d9 Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Tue, 14 Feb 2023 11:08:07 +0100 Subject: [PATCH] isisd: Add copy function for SRv6 Locator TLV Add a function to copy an SRv6 Locator TLV (RFC 9352 section #7.1). Signed-off-by: Carmine Scarpitta --- isisd/isis_tlvs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index 94e0f5c2c1..4d9735df97 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -5521,6 +5521,21 @@ static void copy_mt_items(enum isis_tlv_context context, } } +/* Functions related to TLV 27 SRv6 Locator as per RFC 9352 section #7.1*/ +static struct isis_item *copy_item_srv6_locator(struct isis_item *i) +{ + struct isis_srv6_locator_tlv *loc = (struct isis_srv6_locator_tlv *)i; + struct isis_srv6_locator_tlv *rv = XCALLOC(MTYPE_ISIS_TLV, sizeof(*rv)); + + rv->metric = loc->metric; + rv->flags = loc->flags; + rv->algorithm = loc->algorithm; + rv->prefix = loc->prefix; + rv->subtlvs = copy_subtlvs(loc->subtlvs); + + return (struct isis_item *)rv; +} + /* Functions related to tlvs in general */ struct isis_tlvs *isis_alloc_tlvs(void)