diff options
| author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-02-15 11:35:46 +0100 |
|---|---|---|
| committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-09-11 22:11:37 +0200 |
| commit | 6cd23c6d95e52b1a86b2a8a2b77d8c929252e251 (patch) | |
| tree | d98eac50481df32f3dbb7d7eaa493710444e77e4 /isisd/isis_srv6.c | |
| parent | 791ca51ecf3b31aa6b43f7c3da379da3a45d5f37 (diff) | |
isisd: Add function to fill in an SRv6 Locator TLV
Add a function to fill in an SRv6 Locator TLV with information from an
SRv6 locator (RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'isisd/isis_srv6.c')
| -rw-r--r-- | isisd/isis_srv6.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/isisd/isis_srv6.c b/isisd/isis_srv6.c index 588a8fdd40..f8e3ca90d4 100644 --- a/isisd/isis_srv6.c +++ b/isisd/isis_srv6.c @@ -21,6 +21,28 @@ DEFINE_MTYPE_STATIC(ISISD, ISIS_SRV6_SID, "ISIS SRv6 Segment ID"); /** + * Fill in SRv6 Locator TLV with information from an SRv6 locator. + * + * @param loc SRv6 Locator configuration + * @param loc_tlv SRv6 Locator TLV to be updated + */ +void isis_srv6_locator2tlv(const struct isis_srv6_locator *loc, + struct isis_srv6_locator_tlv *loc_tlv) +{ + /* Set SRv6 Locator metric */ + loc_tlv->metric = loc->metric; + + /* Set SRv6 Locator flags */ + loc_tlv->flags = loc->flags; + + /* Set SRv6 Locator algorithm */ + loc_tlv->algorithm = loc->algorithm; + + /* Set SRv6 Locator prefix */ + loc_tlv->prefix = loc->prefix; +} + +/** * Unset the SRv6 locator for a given IS-IS area. * * @param area IS-IS area |
