mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 21:54:01 +00:00
isisd: Add func to build Sub-TLV from SRv6 End SID
Add a function to build an SRv6 End SID TLV (RFC 9352 section #7.2) to advertise a specific SRv6 End SID passed as an argument. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
This commit is contained in:
parent
2aaa75a6f3
commit
1804d70cbd
@ -7732,6 +7732,40 @@ void isis_tlvs_set_purge_originator(struct isis_tlvs *tlvs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add an SRv6 End SID to the SRv6 End SID Sub-TLV */
|
||||||
|
void isis_subtlvs_add_srv6_end_sid(struct isis_subtlvs *subtlvs,
|
||||||
|
struct isis_srv6_sid *sid)
|
||||||
|
{
|
||||||
|
struct isis_srv6_end_sid_subtlv *sid_subtlv;
|
||||||
|
|
||||||
|
if (!sid)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* The SRv6 End SID Sub-TLV advertises SRv6 SIDs with Endpoint behaviors
|
||||||
|
* that do not require a particular neighbor in order to be correctly
|
||||||
|
* applied (e.g. End, End.DT6, ...). Before proceeding, let's make sure
|
||||||
|
* we are encoding one of the supported behaviors. */
|
||||||
|
if (sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END &&
|
||||||
|
sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END_NEXT_CSID &&
|
||||||
|
sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END_DT6 &&
|
||||||
|
sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END_DT6_USID &&
|
||||||
|
sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END_DT4 &&
|
||||||
|
sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END_DT4_USID &&
|
||||||
|
sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END_DT46 &&
|
||||||
|
sid->behavior != SRV6_ENDPOINT_BEHAVIOR_END_DT46_USID)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Allocate memory for the Sub-TLV */
|
||||||
|
sid_subtlv = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*sid_subtlv));
|
||||||
|
|
||||||
|
/* Fill in the SRv6 End SID Sub-TLV according to the SRv6 SID
|
||||||
|
* configuration */
|
||||||
|
isis_srv6_end_sid2subtlv(sid, sid_subtlv);
|
||||||
|
|
||||||
|
/* Append the SRv6 End SID Sub-TLV to the Sub-TLVs list */
|
||||||
|
append_item(&subtlvs->srv6_end_sids, (struct isis_item *)sid_subtlv);
|
||||||
|
}
|
||||||
|
|
||||||
/* Add an SRv6 Locator to the SRv6 Locator TLV */
|
/* Add an SRv6 Locator to the SRv6 Locator TLV */
|
||||||
void isis_tlvs_add_srv6_locator(struct isis_tlvs *tlvs, uint16_t mtid,
|
void isis_tlvs_add_srv6_locator(struct isis_tlvs *tlvs, uint16_t mtid,
|
||||||
struct isis_srv6_locator *loc)
|
struct isis_srv6_locator *loc)
|
||||||
|
@ -22,6 +22,7 @@ DECLARE_MTYPE(ISIS_SUBTLV);
|
|||||||
|
|
||||||
struct lspdb_head;
|
struct lspdb_head;
|
||||||
struct sr_prefix_cfg;
|
struct sr_prefix_cfg;
|
||||||
|
struct isis_srv6_sid;
|
||||||
struct isis_srv6_locator;
|
struct isis_srv6_locator;
|
||||||
|
|
||||||
struct isis_area_address {
|
struct isis_area_address {
|
||||||
@ -834,6 +835,8 @@ void isis_tlvs_set_purge_originator(struct isis_tlvs *tlvs,
|
|||||||
const uint8_t *generator,
|
const uint8_t *generator,
|
||||||
const uint8_t *sender);
|
const uint8_t *sender);
|
||||||
|
|
||||||
|
void isis_subtlvs_add_srv6_end_sid(struct isis_subtlvs *subtlvs,
|
||||||
|
struct isis_srv6_sid *sid);
|
||||||
void isis_tlvs_add_srv6_locator(struct isis_tlvs *tlvs, uint16_t mtid,
|
void isis_tlvs_add_srv6_locator(struct isis_tlvs *tlvs, uint16_t mtid,
|
||||||
struct isis_srv6_locator *loc);
|
struct isis_srv6_locator *loc);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user