Add a function to return information about an SRv6 End SID Sub-TLV
(RFC 9352 section #7.2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a new TLV context value for the SRv6 End SID Sub-TLV. It will be
needed to support unpacking of the Sub-Sub-TLVs of the SRv6 End SID
Sub-TLV in future commits.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a data structure to represent an SRv6 End SID Sub-TLV as per
RFC 9352 section #7.2.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
The SRv6 Locator TLV (RFC 9352 section #7.1) starts with the MTID field.
Let's expect the MTID as the first field when we are unpacking an SRv6
Locator TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
The SRv6 Locator TLV (RFC 9352 section #7.1) starts with the MTID field.
Let's put the MTID as the first field when we are packing an SRv6
Locator TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
General TLV processing functions (i.e., copy, format, free, pack, and
unpack) perform a lookup of the specific handler for a TLV in the
`tlv_table`, and then call the specific handler to process the TLV.
This commit adds the handlers for the SRv6 Locator TLV (stored in
`tlv_srv6_locator_ops`) to the `tlv_table`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Use the ITEM_TLV_OPS macro to define the TLV operations for the SRv6
Locator TLV (RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to unpack an SRv6 Locator TLV and all its Sub-TLVs
(RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to pack an SRv6 Locator TLV and all its Sub-TLVs
(RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to free an SRv6 Locator TLV and all its Sub-TLVs
(RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend generic TLVs format function to return information about SRv6
Locator TLVs (RFC 9352 section #7.1).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add the `IS-IS SRv6 SID Structure Sub-Sub-TLV Codepoint` as defined in the
`IS-IS Sub-Sub-TLVs for SRv6 SID Sub-TLVs` IANA registry. This codepoint
will be used as the Sub-Sub-TLV Type to advertise the SRv6 SID Structure
Sub-Sub-TLV in the SRv6 End SID, SRv6 End.X SID, and SRv6 LAN End.X SID
Sub-TLVs.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add the `IS-IS SRv6 End SID Sub-TLV Codepoint` as defined in the
`IS-IS Sub-TLVs for TLVs Advertising Prefix Reachability` IANA registry.
This codepoint will be used as the Sub-TLV
Type to advertise the SRv6 End SID Sub-TLV in the SRv6 Locator TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend Router Capabilities TLV format function to return information
about SRv6 Capabilities Sub-TLVs (RFC 9352 section #2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a new TLV context value for the SRv6 Locator TLV. It will be needed
to support unpacking of the Sub-TLVs of the SRv6 Locator TLV in future
commits.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add IS-IS SRv6 Locator TLV Codepoint as defined in the IANA registry
IS-IS Top-Level TLV Codepoints.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When an SRv6 locator is unset, remove all the SRv6 End SIDs allocated
from that locator.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When zebra assigns a chunk to IS-IS, zebra sends a
ZEBRA_SRV6_MANAGER_GET_LOCATOR_CHUNK notification to IS-IS.
IS-IS invokes the `isis_zebra_process_srv6_locator_chunk()` callback to
process the received notification.
Actually, `isis_zebra_process_srv6_locator_chunk()` iterates over all
areas of the current IS-IS instance and looks for an area for which the
received chunk was requested.
If a match is found, the new chunk is added to the area's chunk list and
`lsp_regenerate_schedule()` is called to regenerate the LSPs to
advertise the new SRv6 locator.
This commit extends the `isis_zebra_process_srv6_locator_chunk()`
function to automatically allocate an SRv6 End SID from the received
chunk and install it in the data plane.
The SRv6 End SID is the instantiation of a Prefix-SID (RFC 8986 section
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
In some cases, IS-IS may attempt to remove routes that have not been
installed before. We can prevent IS-IS from doing this by aborting
`isis_zebra_route_del_route` when the ISIS_ROUTE_FLAG_ZEBRA_SYNCED flag
is unset, meaning that the route is not installed in the kernel.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When zebra receives a Netlink message containing a seg6local nexthop,
let's use the default values for optional attributes `lcblock_len` and
`lcnode_fn_len`, if they are not specified.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When zebra receives a Netlink message containing a seg6local nexthop,
let's use the default values for optional attributes `lcblock_len` and
`lcnode_fn_len`, if they are not specified.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When installing a local SID in the Linux kernel, `lcblock_len` and
`lcnode_fn_len` Netlink attributes are optional. When omitted, the
kernel uses the default values: lcblock_len=32 and lcnode_fn_len=16.
Let's use the same default values in FRR.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend the `parse_encap_seg6local` function to parse SRv6 flavors
information contained in the Netlink message.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
`struct seg6local_context` contains a `struct seg6local_flavors_info`
that carries SRv6 flavors information. The `seg6local_flavors_info`
data structure contains a field `flv_ops` that indicates which flavors
are enabled for the `seg6local` nexthop. `flv_ops` is a bit-map where
each bit indicates if a particular SRv6 flavor is enabled (bit set to
1) or not (bit set to 0).
This commit defines some macros that can be used to manipulate the SRv6
flavors bit-map:
* CHECK_SRV6_FLV_OP(OPS,OP) - check if a particular flavor is enabled;
* SET_SRV6_FLV_OP(OPS,OP) - enable a particular flavor (OP);
* UNSET_SRV6_FLV_OP(OPS,OP) - disable a particular flavor (OP);
* RESET_SRV6_FLV_OP(OPS) - disable all SRv6 flavors.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
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>
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.
This commit adds a new enum type `seg6local_flavor_op` to represent the
SRv6 flavors operations. Currently we define the following flavor
operations:
- PSP (defined in RFC 8986 section #4.16.1)
- USP (defined in RFC 8986 section #4.16.2)
- USD (defined in RFC 8986 section #4.16.3)
- NEXT-C-SID (defined in draft-ietf-spring-srv6-srh-compression-03 #4.1)
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add more SRv6 endpoint behaviors that are required for implementing
IS-IS SRv6 extensions (RFC 9352).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to allocate an SRv6 SID from an SRv6 locator chunk owned
by IS-IS. The chunk must be allocated by a previous call to
`isis_zebra_srv6_manager_get_locator_chunk()`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add the list of SRv6 SIDs allocated by the IS-IS instance to the per-area
SRv6 configuration. The list is area-specific. Each IS-IS area has its
own SRv6 SIDs list. The list is initialized when an IS-IS area is
created and freed when an IS-IS area is destroyed.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Define a new memtype `MTYPE_ISIS_SRV6_SID` used to allocate objects of
type `IS-IS SRv6 SID`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add SRv6 SID structure as a member of the SRv6 SID to specify the format
of a specific SID (i.e., block/node/function/argument length).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>