From ee47a75047be152d64e37eef00864ecbcd32426f Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Tue, 14 Feb 2023 13:30:37 +0100 Subject: [PATCH] isisd: Add copy function for SRv6 End SID Sub-TLV Add a function to copy an SRv6 End SID Sub-TLV (RFC 9352 section #7.2). Signed-off-by: Carmine Scarpitta --- isisd/isis_tlvs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index e0671312b4..cd20c97623 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -2056,6 +2056,20 @@ static int unpack_tlvs(enum isis_tlv_context context, size_t avail_len, struct stream *stream, struct sbuf *log, void *dest, int indent, bool *unpacked_known_tlvs); +/* Functions for Sub-TLV 5 SRv6 End SID as per RFC 9352 section #7.2 */ +static struct isis_item *copy_item_srv6_end_sid(struct isis_item *i) +{ + struct isis_srv6_end_sid_subtlv *sid = + (struct isis_srv6_end_sid_subtlv *)i; + struct isis_srv6_end_sid_subtlv *rv = + XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*rv)); + + rv->behavior = sid->behavior; + rv->sid = sid->sid; + + return (struct isis_item *)rv; +} + /* Functions related to TLVs 1 Area Addresses */ static struct isis_item *copy_item_area_address(struct isis_item *i)