Add a function to unset the SRv6 locator for a specific IS-IS area.
This function calls `isis_zebra_srv6_manager_release_locator_chunk()` to
ask zebra to release the locator chunk owned by IS-IS and removes the
chunk from the area's chunks list.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a callback function `isis_zebra_process_srv6_locator_delete()` that
is called when an SRv6 locator is deleted in zebra.
When an existing SRv6 locator is deleted in zebra, zebra sends a
ZEBRA_SRV6_LOCATOR_DELETE notification to all daemons informing them of
the deleted locator.
In IS-IS, we register the new `isis_zebra_process_srv6_locator_delete()`
callback as the handler for ZEBRA_SRV6_LOCATOR_DELETE.
This callback iterates over all areas of the current IS-IS instance and
looks for an area for which the deleted locator was configured.
If a match is found, we remove
the locator's chunks from the area's chunks list and call
`lsp_regenerate_schedule` to remove the locator from the SRv6 Locator
TLV advertised in the LSPs and regenerate the LSPs.
If no match is found, we do nothing.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a callback function `isis_zebra_process_srv6_locator_add()` that is
called upon receiving an SRv6 locator from zebra.
When a new SRv6 locator is created in zebra, zebra sends a
ZEBRA_SRV6_LOCATOR_ADD notification to all daemons informing them of the
new locator.
In IS-IS, we register the new `isis_zebra_process_srv6_locator_add()`
callback as the handler for ZEBRA_SRV6_LOCATOR_ADD.
This callback iterates over all areas of the current IS-IS instance and
looks for an area for which the new locator was configured.
If a match is found, we call
`isis_zebra_srv6_manager_get_locator_chunk()` to ask zebra a chunk from
the locator.
If no match is found, we do nothing.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a callback function that is called upon receiving an SRv6 locator
chunk from zebra.
This function 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.
If no match is found, we free the allocated resources and do nothing.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to ask zebra to release a chunk from the SRv6 locator
specified as a parameter.
The chunk to be released must have been allocated by a previous call to
`isis_zebra_srv6_manager_get_locator_chunk()`.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a function to ask zebra to allocate a chunk from the SRv6 locator
specified as a parameter.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a list of SRv6 locator chunks allocated to a specific IS-IS area.
The list is initialized when the IS-IS area is created and freed when
the IS-IS area is destroyed. Subsequent commits will introduce the
possibility to allocate and release locator chunks.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add the name of the SRv6 locator to use with IS-IS to the per-area SRv6
configuration. If an SRv6 locator is not configured for an IS-IS
instance, the locator name is an empty string. When an IS-IS instance is
configured to use an SRv6 locator, the locator name stores the name of
the selected locator.
Subsequent commits will add the possibility to set and unset an SRv6
locator for a specific IS-IS instance.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a CLI command to print SRv6 capabilities, algorithms and MSDs
supported by the IS-IS nodes.
Example:
r1# show isis segment-routing srv6 node
Area FOO:
IS-IS L1 SRv6-Nodes:
IS-IS L2 SRv6-Nodes:
System ID Algorithm SRH Max SL SRH Max End Pop SRH Max H.encaps SRH Max End D
-----------------------------------------------------------------------------------------
1111.1111.1111 SPF 16 0 1 2
2222.2222.2222 SPF 16 0 1 2
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add Node MSD Sub-TLV containing the SRv6 MSDs to the Router Capabilities
TLV in the LSPs generated with the `lsp_build()` function.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Update the `isis_router_cap_tlv_size` function to take into account the
SRv6 Capabilities Sub-TLV and SRv6-related MSDs when calculating the
size needed to pack the Router Capabilities TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
The Router Capabilities TLV unpack function already unpacks the Node MSD
Sub-TLV.
This commit extends Router Capabilities TLV unpack function to extract
SRv6 MSDs from the Node MSD Sub-TLV (RFC 9352 section #4).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Extend Router Capabilities TLV pack function to pack Node MSD Sub-TLV
with the infomation relevant for SRv6 (RFC 9352 section #4).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add support for SRv6 Node MSDs as per RFC 9352 section #4.
There are four types of SRv6 MSDs:
* Maximum Segments Left MSD Type
* Maximum End Pop MSD Type
* Maximum H.Encaps MSD Type
* Maximum End D MSD Type
These SRv6 Node MSDs are advertised in the Node MSD Sub-TLV, a Sub-TLV
of the Router Capabilities TLV.
This commit adds `struct isis_srv6_msd` data structure, which represents
the SRv6 MSDs advertised in the Node Sub-TLV.
This commit also adds the `struct isis_srv6_msd` to
`struct isis_router_cap`, a data structure representing the Router
Capabilities TLV.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add SRv6 Capabilities Sub-TLV to the Router Capabilities TLV in the LSPs
generated with the `lsp_build()` function.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add Codepoints for SRv6 Capabilities Sub-TLV, SRH Max SL MSD,
SRH Max End Pop MSD, SRH Max H.encaps MSD, SRH Max End D MSD
as per RFC 9352.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add Maximum SRv6 SID Depths (MSDs) parameters as per RFC 9352 section #4
to the per-area IS-IS SRv6 Data Base. Currently the MSD values are
hardcoded.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
`isis_srv6_area_term()` cleans up SRv6 information for a specific
IS-IS area. This commit adds a new function `isis_srv6_term()` that will
be used to perform global SRv6 cleanup.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
`isis_srv6_area_init()` initializes SRv6 information for a specific
IS-IS area. This commit adds a new function `isis_srv6_init()` that will
be used to perform global SRv6 initialization.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
When SRv6 is initialized on a given IS-IS area, set the administrative
enabled status to the default value defined by the YANG model.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add a boolean flag to indicate whether SRv6 is administratively enabled
on a given IS-IS area or not.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Call `isis_srv6_area_term()` to cleanup the per-area SRv6 information
when an IS-IS area is terminated.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Call `isis_srv6_area_init()` to initialize the per-area SRv6 DB when an
IS-IS area is created.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Add `isis_srv6.c` and `isis_srv6.h` files needed to support SRv6 in IS-IS
(as per RFC 9352).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
RCA:
On encountering any attribute error for core attributes in update message,
the error handling is set to 'treat as withdraw' and
further parsing of the remaining attributes is skipped.
But the stream pointer is not being correctly adjusted to
point to the next NLRI field skipping the rest of the attributes.
This leads to incorrect parsing of the NLRI field,
which causes BGP session to reset.
Fix:
The stream pointer offset is rightly adjusted to point to the NLRI field correctly
when the malformed attribute is encountered and remaining attribute parsing is skipped.
Signed-off-by: Samanvitha B Bhargav <bsamanvitha@vmware.com>
The output of gen_json_diff_report is used all over the place and
it outputs d1 and d2. Let's change this to output and expected
as that is how it is used. Should help with debugging.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Let us start using output and expected in lib/topotest.py
because when we see output it is confusing what d1 is
versus what d2 is.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>