Skip to content

Commit a2bd91e

Browse files
committed
isisd: Add copy function for SRv6 Locator TLV
Add a function to copy an SRv6 Locator TLV (RFC 9352 section sonic-net#7.1). Signed-off-by: Carmine Scarpitta <[email protected]>
1 parent f915c80 commit a2bd91e

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

isisd/isis_tlvs.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5521,6 +5521,21 @@ static void copy_mt_items(enum isis_tlv_context context,
55215521
}
55225522
}
55235523

5524+
/* Functions related to TLV 27 SRv6 Locator as per RFC 9352 section #7.1*/
5525+
static struct isis_item *copy_item_srv6_locator(struct isis_item *i)
5526+
{
5527+
struct isis_srv6_locator_tlv *loc = (struct isis_srv6_locator_tlv *)i;
5528+
struct isis_srv6_locator_tlv *rv = XCALLOC(MTYPE_ISIS_TLV, sizeof(*rv));
5529+
5530+
rv->metric = loc->metric;
5531+
rv->flags = loc->flags;
5532+
rv->algorithm = loc->algorithm;
5533+
rv->prefix = loc->prefix;
5534+
rv->subtlvs = copy_subtlvs(loc->subtlvs);
5535+
5536+
return (struct isis_item *)rv;
5537+
}
5538+
55245539
/* Functions related to tlvs in general */
55255540

55265541
struct isis_tlvs *isis_alloc_tlvs(void)

0 commit comments

Comments
 (0)