Skip to content

Commit

Permalink
isisd: Add pack func for SID Structure Sub-Sub-TLV
Browse files Browse the repository at this point in the history
Add a function to pack an SRv6 SID Structure Sub-Sub-TLV
(RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
  • Loading branch information
cscarpitta committed Sep 11, 2023
1 parent b5cd8ab commit 2dfe8ef
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions isisd/isis_tlvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,26 @@ static void free_subsubtlv_srv6_sid_structure(
XFREE(MTYPE_ISIS_SUBSUBTLV, sid_struct);
}

static int pack_subsubtlv_srv6_sid_structure(
struct isis_srv6_sid_structure_subsubtlv *sid_struct, struct stream *s)
{
if (!sid_struct)
return 0;

if (STREAM_WRITEABLE(s) < 6) {
return 1;
}

stream_putc(s, ISIS_SUBSUBTLV_SRV6_SID_STRUCTURE);
stream_putc(s, 4);
stream_putc(s, sid_struct->loc_block_len);
stream_putc(s, sid_struct->loc_node_len);
stream_putc(s, sid_struct->func_len);
stream_putc(s, sid_struct->arg_len);

return 0;
}

static struct isis_item *copy_item(enum isis_tlv_context context,
enum isis_tlv_type type,
struct isis_item *item);
Expand Down

0 comments on commit 2dfe8ef

Please sign in to comment.