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>
dest will not be freed due to lock but coverity does not know
that. Give it a hint. This change includes modifying bgp_dest_unlock_node
to return the dest pointer so that we can determine if we should
continue working on dest or not with an assert. Since this
is lock based we should be ok.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Pass through a bunch of BGP_EVENT_ADD's and make
the code use a proper connection instead of a
peer->connection. There still are a bunch
of places where peer->connection is used and
later commits will probably go through and
clean these up more.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Modify all the receive functions to pass around the actual
connection being acted upon. Modify the collision detection
function to look at the possible two connections.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Modify bgp_fsm_change_status to be connection oriented and
also make the BGP_TIMER_ON and BGP_EVENT_ADD macros connection
oriented as well. Attempt to make peer_xfer_conn a bit more
understandable because, frankly it was/is confusing.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The usage of BGP_EVENT_FLUSH is unnecessarily abstracting the
call into event_cancel_event_ready and in addtion the macro
was not always being used! Just convert to using the actual
event_cancel_event_ready function directly.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Only attempt to install in netlink iprules that include supported
actions; ignore requests with actions that aren't supported by
netlink.
Signed-off-by: Mark Stapp <mjs@labn.net>
Currently evpn passes into bgp_path_info_cmp the pfx_buf
uninitialized. The bgp_path_info_cmp functionality actually
expects this value to be initialized. Additionally the
evpn section of bgp_path_info_comp was resetting the
new_buf and exist_buf values that were already being
set above to the same values if !debug was on( which
precluded it ever from happening )
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
... by converting the hash table to a typesafe hash.
Honestly I was just looking around for things to convert to the typesafe
hash table code, but then I noticed that cpu_record_clear() deletes
items from inside the hash_iterate() callback :(
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This is noted in doc/developer/lists.rst, but judging by the previous
commit that's not where people look for this thing. Let's try a comment
in the header file.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This reverts commit 72eae2c3cb.
`frr_each_const(X, ...)` is not needed since it is the same as
`frr_each(X_const, ...)`.
The fact that it wasn't properly set up for clang-format, and that then
work-arounded with "clang-format off" is all the more reason to not do
this.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>