diff options
| author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-02-24 22:27:25 +0100 |
|---|---|---|
| committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-09-11 22:11:38 +0200 |
| commit | 2aaa75a6f3e63a176b025e7660a99359b90ee1df (patch) | |
| tree | 2bbfdfff040af50450c095f490f443b5f6709d15 /isisd/isis_tlvs.c | |
| parent | 7e340af13bdb9347e504edb4614dbc2ec777b303 (diff) | |
isisd: Add function to build TLV from SRv6 Locator
Add a function to build an SRv6 Locator TLV (RFC 9352 section #7.1) to
advertise a specific SRv6 Locator passed as an argument.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'isisd/isis_tlvs.c')
| -rw-r--r-- | isisd/isis_tlvs.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index 9bf9d4a5eb..8d0047de76 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -7731,3 +7731,20 @@ void isis_tlvs_set_purge_originator(struct isis_tlvs *tlvs, sizeof(tlvs->purge_originator->sender)); } } + +/* Add an SRv6 Locator to the SRv6 Locator TLV */ +void isis_tlvs_add_srv6_locator(struct isis_tlvs *tlvs, uint16_t mtid, + struct isis_srv6_locator *loc) +{ + struct isis_srv6_locator_tlv *loc_tlv = + XCALLOC(MTYPE_ISIS_TLV, sizeof(*loc_tlv)); + + /* Fill in the SRv6 Locator TLV according to the SRv6 Locator + * configuration */ + isis_srv6_locator2tlv(loc, loc_tlv); + + /* Append the SRv6 Locator TLV to the TLVs list */ + struct isis_item_list *l; + l = isis_get_mt_items(&tlvs->srv6_locator, mtid); + append_item(l, (struct isis_item *)loc_tlv); +} |
