diff options
author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-03-20 19:05:18 +0100 |
---|---|---|
committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-09-11 17:35:02 +0200 |
commit | 164bcddab782fba52d57387799cfef5641bedbbf (patch) | |
tree | 351aaa899e4740d433eeb6666da860c81aca7dd6 /lib/srv6.h | |
parent | lib: Add new enum for seg6local flavor operations (diff) | |
download | frr-164bcddab782fba52d57387799cfef5641bedbbf.tar.xz frr-164bcddab782fba52d57387799cfef5641bedbbf.zip |
lib: Add SRv6 flavors info to `seg6local` nexthop
The RFC 8986 defines the SRv6 Network Programming concept and specifies
the base set of SRv6 behaviors that enables the creation of
interoperable overlays with underlay optimization. In addition, the RFC
8986 introduces the concept of "flavors", additional operations that can
modify or extend the existing SRv6 behaviors.
In the Linux kernel and in FRR, an SRv6 SID is implemented as a route
associated with a `seg6local` nexthop. A `seg6local` nexthop represents
an SRv6 behavior bound to a SID.
The Linux kernel already supports the ability to add a set of flavors
to a `seg6local` nexthop to modify or extend the associated behavior.
This commit aligns the `seg6local` nexthop implementation of FRR to the
Linux kernel. It extends the `seg6local` nexthop implementation by
adding a struct `seg6local_flavors_info` that encodes the SRv6
flavors information.
Currently, the `seg6local_flavors_info` data structure has three
members:
- `tlv_ops` indicates which flavors are enabled for the `seg6local`
nexthop;
- `lcblock_len`is the length of the Locator-Block part of the SID;
- `lcnode_func_len` is the length of the combined Node and Function
parts of the SID.
`lcblock_len` and `lcnode_func_len` define the SID structure. They are
required for some behaviors (e.g. NEXT-C-SID and REPLACE-C-SID). For
other flavors (e.g. PSP, USP, USD) these parameters are not required and
can be omitted.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'lib/srv6.h')
-rw-r--r-- | lib/srv6.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/srv6.h b/lib/srv6.h index 4f004bf5d..f5a943189 100644 --- a/lib/srv6.h +++ b/lib/srv6.h @@ -69,10 +69,21 @@ struct seg6_segs { struct in6_addr segs[256]; }; +struct seg6local_flavors_info { + /* Flavor operations */ + uint32_t flv_ops; + + /* Locator-Block length, expressed in bits */ + uint8_t lcblock_len; + /* Locator-Node Function length, expressed in bits */ + uint8_t lcnode_func_len; +}; + struct seg6local_context { struct in_addr nh4; struct in6_addr nh6; uint32_t table; + struct seg6local_flavors_info flv; }; struct srv6_locator { |