]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
19 months agoisisd: Free Sub-Sub-TLVs of SRv6 End SID Sub-TLV
Carmine Scarpitta [Sat, 11 Mar 2023 11:01:58 +0000 (12:01 +0100)]
isisd: Free Sub-Sub-TLVs of SRv6 End SID Sub-TLV

Extend SRv6 End SID Sub-TLV free function to free Sub-Sub-TLVs (RFC 9352
section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add Sub-Sub-TLVs to End SID format func
Carmine Scarpitta [Sat, 11 Mar 2023 11:01:07 +0000 (12:01 +0100)]
isisd: Add Sub-Sub-TLVs to End SID format func

Extend SRv6 End SID Sub-TLV format function to return information about
Sub-Sub-TLVs (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Copy Sub-Sub-TLVs of SRv6 End SID Sub-TLV
Carmine Scarpitta [Sat, 11 Mar 2023 11:00:01 +0000 (12:00 +0100)]
isisd: Copy Sub-Sub-TLVs of SRv6 End SID Sub-TLV

Extend SRv6 End SID Sub-TLV copy function to copy Sub-Sub-TLVs (RFC 9352
section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add pack func for Sub-Sub-TLVs in general
Carmine Scarpitta [Sun, 12 Mar 2023 20:19:12 +0000 (21:19 +0100)]
isisd: Add pack func for Sub-Sub-TLVs in general

Add a function to pack all the Sub-Sub-TLVs passed as an argument.

At this time, this function does not pack any Sub-Sub-TLVs because no
Sub-Sub-TLVs have been defined yet. This function will be extended in
future commits to pack specific Sub-Sub-TLVs, as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add free func for Sub-Sub-TLVs in general
Carmine Scarpitta [Fri, 17 Feb 2023 22:27:07 +0000 (23:27 +0100)]
isisd: Add free func for Sub-Sub-TLVs in general

Add a function to free all the Sub-Sub-TLVs and the `isis_subsubtlvs`
data structure passed as an argument.

At this time, this function only frees the `isis_subsubtlvs`. It does
not free any specific Sub-Sub-TLVs because no Sub-Sub-TLVs have been
defined yet. This function will be extended in future commits to free
specific Sub-Sub-TLVs, as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add format func for Sub-Sub-TLVs in general
Carmine Scarpitta [Wed, 1 Mar 2023 15:46:57 +0000 (16:46 +0100)]
isisd: Add format func for Sub-Sub-TLVs in general

Add a function to return information about all the Sub-Sub-TLVs passed
as an argument.

At this time, this function does nothing because no Sub-Sub-TLVs have
been defined yet. This function will be extended in
future commits to return information about specific Sub-Sub-TLVs,
as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add copy func for Sub-Sub-TLVs in general
Carmine Scarpitta [Tue, 14 Feb 2023 14:50:48 +0000 (15:50 +0100)]
isisd: Add copy func for Sub-Sub-TLVs in general

Add a function to copy all the Sub-Sub-TLVs passed as an argument.

At this time, this function does not copy any Sub-Sub-TLVs because no
Sub-Sub-TLVs have been defined yet. This function will be extended in
future commits to copy specific Sub-Sub-TLVs, as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add alloc func for Sub-Sub-TLVs in general
Carmine Scarpitta [Sat, 3 Jun 2023 00:41:36 +0000 (02:41 +0200)]
isisd: Add alloc func for Sub-Sub-TLVs in general

Add a function to allocate memory for IS-IS Sub-Sub-TLVs.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add struct to store Sub-Sub-TLVs info
Carmine Scarpitta [Fri, 24 Feb 2023 21:37:18 +0000 (22:37 +0100)]
isisd: Add struct to store Sub-Sub-TLVs info

Add a data structure to store IS-IS Sub-Sub-TLVs information. At this
time, does not contain any Sub-Sub-TLV information because no
Sub-Sub-TLVs have been defined yet. This data structure will be extended
in future commits to store specific Sub-Sub-TLVs, as they become
supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add new macros to define Sub-Sub-TLV ops
Carmine Scarpitta [Tue, 14 Feb 2023 14:43:52 +0000 (15:43 +0100)]
isisd: Add new macros to define Sub-Sub-TLV ops

Add two macros `SUBSUBTLV_OPS` and `ITEM_SUBSUBTLV_OPS` that help the
developer to define the TLV operations for the IS-IS Sub-Sub-TLVs.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Pack SRv6 End SID when packing Sub-TLVs
Carmine Scarpitta [Tue, 14 Feb 2023 11:52:30 +0000 (12:52 +0100)]
isisd: Pack SRv6 End SID when packing Sub-TLVs

Extend generic Sub-TLVs pack function to pack SRv6 End SID Sub-TLVs
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Free SRv6 End SID when freeing Sub-TLVs
Carmine Scarpitta [Tue, 14 Feb 2023 11:51:17 +0000 (12:51 +0100)]
isisd: Free SRv6 End SID when freeing Sub-TLVs

Extend generic Sub-TLVs free function to free SRv6 End SID Sub-TLVs
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End SID to Sub-TLVs format func
Carmine Scarpitta [Tue, 14 Feb 2023 11:50:19 +0000 (12:50 +0100)]
isisd: Add SRv6 End SID to Sub-TLVs format func

Extend generic Sub-TLVs format function to return information about
SRv6 End SID Sub-TLVs (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Copy SRv6 End SID when copying Sub-TLVs
Carmine Scarpitta [Tue, 14 Feb 2023 11:49:09 +0000 (12:49 +0100)]
isisd: Copy SRv6 End SID when copying Sub-TLVs

Extend generic Sub-TLVs copy function to copy SRv6 End SID Sub-TLVs
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Bind SRv6 End SID Sub-TLV ops to TLV type
Carmine Scarpitta [Wed, 15 Feb 2023 12:28:06 +0000 (13:28 +0100)]
isisd: Bind SRv6 End SID Sub-TLV ops to TLV type

General Sub-TLV processing functions (i.e., copy, format, free, pack,
and unpack) perform a lookup of the specific handler for a Sub-TLV in
the `tlv_table`, and then call the specific handler to process the
Sub-TLV.
This commit adds the handlers for the SRv6 End SID Sub-TLV (stored in
`tlv_srv6_end_sid_ops`) to the `tlv_table`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Define TLV ops for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 14:44:47 +0000 (15:44 +0100)]
isisd: Define TLV ops for SRv6 End SID Sub-TLV

Use the ITEM_SUBTLV_OPS macro to define the TLV operations for the SRv6
End SID Sub-TLV (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add unpack func for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 21 Feb 2023 18:47:03 +0000 (19:47 +0100)]
isisd: Add unpack func for SRv6 End SID Sub-TLV

Add a function to unpack an SRv6 End SID Sub-TLV
(RFC 9352 section FRRouting#7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add pack function for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 12:43:42 +0000 (13:43 +0100)]
isisd: Add pack function for SRv6 End SID Sub-TLV

Add a function to pack an SRv6 End SID Sub-TLV
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add free function for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 12:31:53 +0000 (13:31 +0100)]
isisd: Add free function for SRv6 End SID Sub-TLV

Add a function to free an SRv6 End SID Sub-TLV
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add format func for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 12:51:28 +0000 (13:51 +0100)]
isisd: Add format func for SRv6 End SID Sub-TLV

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>
19 months agoisisd: Add copy function for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 12:30:37 +0000 (13:30 +0100)]
isisd: Add copy function for SRv6 End SID Sub-TLV

Add a function to copy an SRv6 End SID Sub-TLV (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add context value for SRv6 End SID Sub-TLV
Carmine Scarpitta [Fri, 24 Feb 2023 21:37:59 +0000 (22:37 +0100)]
isisd: Add context value for SRv6 End SID Sub-TLV

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>
19 months agoisisd: Initialize SRv6 End SID Sub-TLVs list
Carmine Scarpitta [Tue, 14 Feb 2023 11:46:52 +0000 (12:46 +0100)]
isisd: Initialize SRv6 End SID Sub-TLVs list

Initialize the SRv6 End SID Sub-TLVs list in `isis_alloc_subtlvs()`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End SID Sub-TLV data structure
Carmine Scarpitta [Tue, 21 Feb 2023 23:35:07 +0000 (00:35 +0100)]
isisd: Add SRv6 End SID Sub-TLV data structure

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>
19 months agoisisd: Initialize SRv6 Locator TLVs list
Carmine Scarpitta [Tue, 14 Feb 2023 11:36:19 +0000 (12:36 +0100)]
isisd: Initialize SRv6 Locator TLVs list

Initialize the SRv6 Locator TLVs list in `isis_alloc_tlvs()`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Decode MTID when unpacking SRv6 Locator TLV
Carmine Scarpitta [Sat, 3 Jun 2023 11:30:32 +0000 (13:30 +0200)]
isisd: Decode MTID when unpacking SRv6 Locator TLV

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>
19 months agoisisd: Add MTID when packing SRv6 Locator TLV
Carmine Scarpitta [Sat, 3 Jun 2023 11:28:35 +0000 (13:28 +0200)]
isisd: Add MTID when packing SRv6 Locator TLV

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>
19 months agoisisd: Add SRv6 Locator TLV to `pack_order` struct
Carmine Scarpitta [Fri, 17 Feb 2023 22:25:32 +0000 (23:25 +0100)]
isisd: Add SRv6 Locator TLV to `pack_order` struct

Add the SRv6 Locator TLV to the `pack_order` data structure.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Bind SRv6 Locator TLV ops to IS-IS TLV type
Carmine Scarpitta [Fri, 27 Jan 2023 15:02:25 +0000 (16:02 +0100)]
isisd: Bind SRv6 Locator TLV ops to IS-IS TLV type

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>
19 months agoisisd: Define TLV ops for SRv6 Locator TLV
Carmine Scarpitta [Tue, 14 Feb 2023 14:43:58 +0000 (15:43 +0100)]
isisd: Define TLV ops for SRv6 Locator TLV

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>
19 months agoisisd: Add unpack function for SRv6 Locator TLV
Carmine Scarpitta [Tue, 14 Feb 2023 11:22:29 +0000 (12:22 +0100)]
isisd: Add unpack function for SRv6 Locator TLV

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>
19 months agoisisd: Add pack function for SRv6 Locator TLV
Carmine Scarpitta [Tue, 14 Feb 2023 10:30:45 +0000 (11:30 +0100)]
isisd: Add pack function for SRv6 Locator TLV

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>
19 months agoisisd: Free SRv6 Locator TLV when freeing TLVs
Carmine Scarpitta [Fri, 17 Feb 2023 22:28:40 +0000 (23:28 +0100)]
isisd: Free SRv6 Locator TLV when freeing TLVs

Extend generic TLVs free function to free SRv6 Locator TLVs (RFC 9352
section #7.1).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add free function for SRv6 Locator TLV
Carmine Scarpitta [Tue, 14 Feb 2023 10:09:51 +0000 (11:09 +0100)]
isisd: Add free function for SRv6 Locator TLV

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>
19 months agoisisd: Add SRv6 Locator TLV to TLVs format func
Carmine Scarpitta [Thu, 26 Jan 2023 15:07:24 +0000 (16:07 +0100)]
isisd: Add SRv6 Locator TLV to TLVs format func

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>
19 months agoisisd: Add format function for SRv6 Locator TLV
Carmine Scarpitta [Tue, 14 Feb 2023 11:34:47 +0000 (12:34 +0100)]
isisd: Add format function for SRv6 Locator TLV

Add a function to return information about an SRv6 Locator TLV and all
its Sub-TLVs (RFC 9352 section #7.1).

Examples:

r1# show isis database detail
Area 1:
IS-IS Level-1 link-state database:
LSP ID                  PduLen  SeqNumber   Chksum  Holdtime  ATT/P/OL
r1.00-00             *    248   0x00000005  0xda6e     824    0/0/0
[...]
  SRv6 Locator: fc00:0:1::/48 (Metric: 0) standard
    Sub-TLVs:
[...]

r1# show isis database detail json
[...]
              "srv6-locator":{
                "mt-id":0,
                "prefix":"fc00:0:1::/48",
                "metric":0,
                "d-flag":"",
                "algorithm":0,
                "mt-name":"standard",
                "subtlvs":{

                }
              }
[...]

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Copy SRv6 Locator TLV when copying TLVs
Carmine Scarpitta [Fri, 17 Feb 2023 23:19:07 +0000 (00:19 +0100)]
isisd: Copy SRv6 Locator TLV when copying TLVs

Extend generic TLVs copy function to copy SRv6 Locator TLVs (RFC 9352
section #7.1).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add copy function for SRv6 Locator TLV
Carmine Scarpitta [Tue, 14 Feb 2023 10:08:07 +0000 (11:08 +0100)]
isisd: Add copy function for SRv6 Locator TLV

Add a function to copy an SRv6 Locator TLV (RFC 9352 section #7.1).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 SID Struct Sub-Sub-TLV Codepoint
Carmine Scarpitta [Fri, 27 Jan 2023 14:34:41 +0000 (15:34 +0100)]
isisd: Add SRv6 SID Struct Sub-Sub-TLV Codepoint

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>
19 months agoisisd: Add IS-IS SRv6 End SID Sub-TLV Codepoint
Carmine Scarpitta [Fri, 27 Jan 2023 12:26:54 +0000 (13:26 +0100)]
isisd: Add IS-IS SRv6 End SID Sub-TLV Codepoint

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>
19 months agoisisd: Extend SPF algo to process SRv6 locator
Carmine Scarpitta [Wed, 22 Feb 2023 09:27:15 +0000 (10:27 +0100)]
isisd: Extend SPF algo to process SRv6 locator

Extend SPF algorithm to process SRv6 locator.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 Cap to Router Cap TLV format func
Carmine Scarpitta [Fri, 3 Mar 2023 21:29:10 +0000 (22:29 +0100)]
isisd: Add SRv6 Cap to Router Cap TLV format func

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>
19 months agoisisd: Add context value for SRv6 Locator TLV
Carmine Scarpitta [Tue, 14 Feb 2023 11:21:19 +0000 (12:21 +0100)]
isisd: Add context value for SRv6 Locator TLV

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>
19 months agoisisd: Add SRv6 Locator TLV data structure
Carmine Scarpitta [Tue, 21 Feb 2023 23:03:49 +0000 (00:03 +0100)]
isisd: Add SRv6 Locator TLV data structure

Add a data structure to represent an SRv6 Locator TLV as per RFC 9352
section #7.1.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add IS-IS SRv6 Locator TLV Codepoint
Carmine Scarpitta [Fri, 27 Jan 2023 14:47:16 +0000 (15:47 +0100)]
isisd: Add IS-IS SRv6 Locator TLV Codepoint

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>
19 months agoisisd: Remove SRv6 End SIDs after locator unset
Carmine Scarpitta [Tue, 13 Jun 2023 11:09:57 +0000 (13:09 +0200)]
isisd: Remove SRv6 End SIDs after locator unset

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>
19 months agoisisd: Install SRv6 End SID automatically
Carmine Scarpitta [Wed, 22 Feb 2023 10:20:50 +0000 (11:20 +0100)]
isisd: Install SRv6 End SID automatically

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>
19 months agoisisd: Add func to remove SRv6 SID from dplane
Carmine Scarpitta [Wed, 22 Feb 2023 10:19:28 +0000 (11:19 +0100)]
isisd: Add func to remove SRv6 SID from dplane

Add a function to remove an SRv6 SID from the data plane through
zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to install SRv6 SID in dplane
Carmine Scarpitta [Wed, 22 Feb 2023 10:18:46 +0000 (11:18 +0100)]
isisd: Add func to install SRv6 SID in dplane

Add a function to install an SRv6 SID in the data plane through
zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add function to send SRv6 SID to zebra
Carmine Scarpitta [Sat, 3 Jun 2023 06:39:33 +0000 (08:39 +0200)]
isisd: Add function to send SRv6 SID to zebra

Add a function to install/remove an SRv6 SID in the forwarding plane
through Zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Uninstall routes only if installed
Carmine Scarpitta [Sat, 10 Jun 2023 07:30:17 +0000 (09:30 +0200)]
isisd: Uninstall routes only if installed

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>
19 months agozebra: Encode SRv6 flavors in Netlink messages
Carmine Scarpitta [Mon, 20 Mar 2023 21:32:01 +0000 (22:32 +0100)]
zebra: Encode SRv6 flavors in Netlink messages

Encode SRv6 flavors information when building a seg6local nexthop.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agozebra: Resolve default values for SRv6 flavor attr
Carmine Scarpitta [Mon, 20 Mar 2023 20:53:49 +0000 (21:53 +0100)]
zebra: Resolve default values for SRv6 flavor attr

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>
19 months agozebra: Resolve default values for SRv6 flavor attr
Carmine Scarpitta [Mon, 20 Mar 2023 20:49:07 +0000 (21:49 +0100)]
zebra: Resolve default values for SRv6 flavor attr

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>
19 months agolib: Define default values for SRv6 flavors attrs
Carmine Scarpitta [Mon, 20 Mar 2023 20:48:27 +0000 (21:48 +0100)]
lib: Define default values for SRv6 flavors attrs

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>
19 months agozebra: Extend `rt_netlink.c` to parse SRv6 flavors
Carmine Scarpitta [Mon, 20 Mar 2023 20:35:04 +0000 (21:35 +0100)]
zebra: Extend `rt_netlink.c` to parse SRv6 flavors

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>
19 months agolib: Add SRv6 flavors manipulation macros
Carmine Scarpitta [Sat, 15 Apr 2023 16:11:10 +0000 (18:11 +0200)]
lib: Add SRv6 flavors manipulation macros

`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>
19 months agolib: Add SRv6 flavors info to `seg6local` nexthop
Carmine Scarpitta [Mon, 20 Mar 2023 18:05:18 +0000 (19:05 +0100)]
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>
19 months agolib: Add new enum for seg6local flavor operations
Carmine Scarpitta [Mon, 20 Mar 2023 17:58:49 +0000 (18:58 +0100)]
lib: Add new enum for seg6local flavor operations

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>
19 months agoinclude: Update `seg6_local.h` to last kernel
Carmine Scarpitta [Mon, 20 Mar 2023 17:53:21 +0000 (18:53 +0100)]
include: Update `seg6_local.h` to last kernel

Update `seg6_local.h` to the last kernel version, required to support
SRv6 flavors.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agolib: Add SRv6 behavior codepoints needed for IS-IS
Carmine Scarpitta [Fri, 2 Jun 2023 00:19:17 +0000 (02:19 +0200)]
lib: Add SRv6 behavior codepoints needed for IS-IS

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>
19 months agoisisd: Add function to allocate an SRv6 SID
Carmine Scarpitta [Wed, 22 Feb 2023 09:51:33 +0000 (10:51 +0100)]
isisd: Add function to allocate an SRv6 SID

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>
19 months agoisisd: Add SRv6 SIDs to SRv6 configuration
Carmine Scarpitta [Thu, 2 Feb 2023 11:32:10 +0000 (12:32 +0100)]
isisd: Add SRv6 SIDs to SRv6 configuration

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>
19 months agoisisd: Add function to free an SRv6 SID
Carmine Scarpitta [Wed, 15 Mar 2023 07:49:39 +0000 (08:49 +0100)]
isisd: Add function to free an SRv6 SID

Add a function to free an SRv6 SID.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add new memtype for IS-IS SRv6 SID
Carmine Scarpitta [Tue, 14 Mar 2023 01:42:23 +0000 (02:42 +0100)]
isisd: Add new memtype for IS-IS SRv6 SID

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>
19 months agoisisd: Add SRv6 SID structure to SRv6 SID
Carmine Scarpitta [Tue, 14 Mar 2023 01:47:40 +0000 (02:47 +0100)]
isisd: Add SRv6 SID structure to SRv6 SID

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>
19 months agoisisd: Add SRv6 SID structure data structure
Carmine Scarpitta [Wed, 15 Feb 2023 10:28:01 +0000 (11:28 +0100)]
isisd: Add SRv6 SID structure data structure

Add `struct isis_srv6_sid_structure` data structure to represent an SRv6
SID structure (as defined in RFC 8986 section #3.1).

The struct has the following members:
* loc_block_len: locator block length
* loc_node_len: locator node length
* func_len: function length
* arg_len: argument length

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 SID data structure
Carmine Scarpitta [Tue, 14 Mar 2023 01:40:34 +0000 (02:40 +0100)]
isisd: Add SRv6 SID data structure

Add `struct isis_srv6_sid` data structure to represent an SRv6 SID.

The struct has the following members:
* next: pointer to the next SID, used to build linked lists of SRv6 SIDs
* flags: SID flags
* behavior: the behavior bound to the SRv6 SID (as defined in RFC 8986)
* value: the SID value (i.e., an IPv6 address)
* locator: a backpointer to the parent locator from which the SID has
been allocated.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add CLI command to unset SRv6 locator
Carmine Scarpitta [Fri, 27 Jan 2023 15:07:15 +0000 (16:07 +0100)]
isisd: Add CLI command to unset SRv6 locator

Add a CLI command to unset a previously configured SRv6 locator for a
specific IS-IS instance.

Example:

r1# configure
r1(config)# router isis FOO
r1(config-router)# segment-routing srv6
r1(config-router-srv6)# no locator loc1

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add CLI command to configure SRv6 locator
Carmine Scarpitta [Fri, 27 Jan 2023 15:06:51 +0000 (16:06 +0100)]
isisd: Add CLI command to configure SRv6 locator

Add a CLI command to configure an SRv6 locator for a specific IS-IS
instance.

Example:

r1# configure
r1(config)# router isis FOO
r1(config-router)# segment-routing srv6
r1(config-router-srv6)# locator loc1

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add nb command to show SRv6 locator info
Carmine Scarpitta [Mon, 5 Dec 2022 16:06:36 +0000 (17:06 +0100)]
isisd: Add nb command to show SRv6 locator info

Add a northbound command to show information about the SRv6 locator
configured in IS-IS.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add nb command to unset an SRv6 locator
Carmine Scarpitta [Fri, 27 Jan 2023 15:05:28 +0000 (16:05 +0100)]
isisd: Add nb command to unset an SRv6 locator

Add a northbound command to unset an SRv6 locator for a specific
IS-IS area. This is a wrapper around `isis_srv6_locator_unset()`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add nb command to configure an SRv6 locator
Carmine Scarpitta [Fri, 27 Jan 2023 15:04:49 +0000 (16:04 +0100)]
isisd: Add nb command to configure an SRv6 locator

Add a northbound command to configure an SRv6 locator for a specific
IS-IS area.

After configuring a locator, `isis_zebra_srv6_manager_get_locator_chunk`
is called to ask zebra to allocate a chunk from the configured locator.
The allocated chunk will be owned by IS-IS. IS-IS can allocate SIDs from
its chunk.

Currently, we support only one locator per-area. Therefore, before
configuring a locator we unset the previously configured locator, if
there was any.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoyang: Add SRv6 locator to the IS-IS YANG model
Carmine Scarpitta [Fri, 27 Jan 2023 15:05:52 +0000 (16:05 +0100)]
yang: Add SRv6 locator to the IS-IS YANG model

Add the `locator` leaf  to the IS-IS  YANG model under the
`segment-routing-srv6` container.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to unset the SRv6 locator
Carmine Scarpitta [Fri, 10 Mar 2023 22:50:46 +0000 (23:50 +0100)]
isisd: Add func to unset the SRv6 locator

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>
19 months agoisisd: Add func to process a deleted SRv6 locator
Carmine Scarpitta [Thu, 9 Feb 2023 18:11:05 +0000 (19:11 +0100)]
isisd: Add func to process a deleted SRv6 locator

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>
19 months agoisisd: Add func to process a received SRv6 locator
Carmine Scarpitta [Thu, 9 Feb 2023 18:09:04 +0000 (19:09 +0100)]
isisd: Add func to process a received SRv6 locator

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>
19 months agoisisd: Add function to process received SRv6 chunk
Carmine Scarpitta [Wed, 22 Feb 2023 10:11:35 +0000 (11:11 +0100)]
isisd: Add function to process received SRv6 chunk

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>
19 months agoisisd: Add func to release an SRv6 locator chunk
Carmine Scarpitta [Thu, 2 Feb 2023 12:04:33 +0000 (13:04 +0100)]
isisd: Add func to release an SRv6 locator chunk

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>
19 months agoisisd: Add func to request an SRv6 locator chunk
Carmine Scarpitta [Thu, 2 Feb 2023 11:54:48 +0000 (12:54 +0100)]
isisd: Add func to request an SRv6 locator chunk

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>
19 months agoisisd: Add SRv6 locator chunks to SRv6 config
Carmine Scarpitta [Thu, 2 Feb 2023 11:30:35 +0000 (12:30 +0100)]
isisd: Add SRv6 locator chunks to SRv6 config

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>
19 months agoisisd: Add SRv6 locator name to SRv6 configuration
Carmine Scarpitta [Tue, 14 Mar 2023 07:39:59 +0000 (08:39 +0100)]
isisd: Add SRv6 locator name to SRv6 configuration

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>
19 months agoisisd: Add CLI command to show SRv6 node info
Carmine Scarpitta [Thu, 2 Feb 2023 10:29:09 +0000 (11:29 +0100)]
isisd: Add CLI command to show SRv6 node info

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>
19 months agoisisd: Add Node MSD Sub-TLV (SRv6) to the LSPs
Carmine Scarpitta [Mon, 13 Mar 2023 01:07:16 +0000 (02:07 +0100)]
isisd: Add Node MSD Sub-TLV (SRv6) to the LSPs

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>
19 months agoisisd: Update router cap TLV size computation
Carmine Scarpitta [Sat, 10 Jun 2023 13:51:30 +0000 (15:51 +0200)]
isisd: Update router cap TLV size computation

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>
19 months agoisisd: Unpack Node MSD Sub-TLV with SRv6 MSDs
Carmine Scarpitta [Thu, 2 Feb 2023 10:01:55 +0000 (11:01 +0100)]
isisd: Unpack Node MSD Sub-TLV with SRv6 MSDs

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>
19 months agoisisd: Pack Node MSD Sub-TLV for SRv6
Carmine Scarpitta [Thu, 2 Feb 2023 09:42:45 +0000 (10:42 +0100)]
isisd: Pack Node MSD Sub-TLV for SRv6

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>
19 months agoisisd: Add SRv6 MSDs to Router Capabilities TLV
Carmine Scarpitta [Wed, 1 Feb 2023 12:18:45 +0000 (13:18 +0100)]
isisd: Add SRv6 MSDs to Router Capabilities TLV

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>
19 months agoisisd: Pack SR-Algorithm Sub-TLV for SRv6
Carmine Scarpitta [Wed, 30 Nov 2022 18:35:22 +0000 (19:35 +0100)]
isisd: Pack SR-Algorithm Sub-TLV for SRv6

Extend Router Capabilities TLV pack function to pack SR-Algorithm
Sub-TLV with infomation relevant for SRv6 (RFC 9352 section #3).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
20 months agoisisd: Add SRv6 Capabilities Sub-TLV to the LSPs
Carmine Scarpitta [Thu, 2 Feb 2023 10:20:44 +0000 (11:20 +0100)]
isisd: Add SRv6 Capabilities Sub-TLV to the LSPs

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>
20 months agoisisd: Unpack SRv6 Capabilities Sub-TLV
Carmine Scarpitta [Thu, 2 Feb 2023 09:55:25 +0000 (10:55 +0100)]
isisd: Unpack SRv6 Capabilities Sub-TLV

Extend Router Capabilities TLV unpack function to unpack SRv6
Capabilities Sub-TLV (RFC 9352 section #2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
20 months agoisisd: Pack SRv6 Capabilities Sub-TLV
Carmine Scarpitta [Thu, 2 Feb 2023 09:13:42 +0000 (10:13 +0100)]
isisd: Pack SRv6 Capabilities Sub-TLV

Extend Router Capabilities TLV pack function to pack Router Capabilies
Sub-TLV (RFC 9352 section #2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
20 months agoisisd: Add SRv6 Cap Sub-TLV to Router Cap TLV
Carmine Scarpitta [Wed, 1 Feb 2023 12:41:32 +0000 (13:41 +0100)]
isisd: Add SRv6 Cap Sub-TLV to Router Cap TLV

Add SRv6 Capabilities Sub-TLV to the IS-IS Router Capabilities TLV data
structure. SRv6 Capabilities Sub-TLV includes SRv6 Flags (RFC 9352
section #2) and Maximum SRv6 SID Depths (RFC 9352 section #4).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
20 months agoisisd: Add IS-IS TLV Codepoints for SRv6
Carmine Scarpitta [Wed, 30 Nov 2022 18:29:08 +0000 (19:29 +0100)]
isisd: Add IS-IS TLV Codepoints for SRv6

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>
20 months agoisisd: Add support for SRv6 MSDs
Carmine Scarpitta [Wed, 18 Jan 2023 11:21:16 +0000 (12:21 +0100)]
isisd: Add support for SRv6 MSDs

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>
20 months agoisisd: Add function to terminate the SRv6 module
Carmine Scarpitta [Wed, 30 Nov 2022 14:09:00 +0000 (15:09 +0100)]
isisd: Add function to terminate the SRv6 module

`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>
20 months agoisisd: Add function to initialize the SRv6 module
Carmine Scarpitta [Wed, 30 Nov 2022 14:06:42 +0000 (15:06 +0100)]
isisd: Add function to initialize the SRv6 module

`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>
20 months agoisisd: Add CLI command to disable SRv6
Carmine Scarpitta [Mon, 28 Nov 2022 10:37:08 +0000 (11:37 +0100)]
isisd: Add CLI command to disable SRv6

r1# conf
r1(config)# router isis <area-tag>
r1(config-router)# no segment-routing srv6

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
20 months agoisisd: Add CLI command to enable SRv6
Carmine Scarpitta [Mon, 28 Nov 2022 10:36:34 +0000 (11:36 +0100)]
isisd: Add CLI command to enable SRv6

r1# conf
r1(config)# router isis <area-tag>
r1(config-router)# segment-routing srv6

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
20 months agoisisd: Add nb command to show if SRv6 is enabled
Carmine Scarpitta [Mon, 5 Dec 2022 16:06:04 +0000 (17:06 +0100)]
isisd: Add nb command to show if SRv6 is enabled

Add a northbound command to show whether SRv6 is enabled or not.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>