Skip to content

Commit

Permalink
isisd: add isis flex-algo lsp advertisement
Browse files Browse the repository at this point in the history
Deal with the packing and unpacking of following Flex-Algo
(Sub-)-Sub-TLVs:

- Router Capability (already defined TLV 242)
	- List of the Flex-Algo Definitions (Sub-TLV 26)
		- Exclude admin group (Sub-Sub-TLV 1)
                - Include-any admin group (Sub-Sub-TLV 2)
                - Include-all admin group (Sub-Sub-TLV 3)
                - Flags (for prefix-metric) (Sub-Sub-TLV 4)
- Extended IS Reachability (already defined TLV 22)
	- Application-Specific Link Attributes (Sub-TLV 16)
	  (to enable the Flex-Algo flag on a link)
		- Admin-group (Sub-Sub-TLV 3)
		- Extended Admin-group (Sub-Sub-TLV 14)

Not that:

- Admin-group deals with affinities.
- List of SR Algorithm (Sub-TLV 19) within Router Capability (TLV 242)
  are already set in a previous commit.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
  • Loading branch information
slankdev authored and louis-6wind committed Oct 11, 2022
1 parent d0c7f27 commit 93b0b7f
Show file tree
Hide file tree
Showing 3 changed files with 565 additions and 2 deletions.
24 changes: 22 additions & 2 deletions isisd/isis_lsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "isisd/fabricd.h"
#include "isisd/isis_tx_queue.h"
#include "isisd/isis_nb.h"
#include "isisd/isis_flex_algo.h"

DEFINE_MTYPE_STATIC(ISISD, ISIS_LSP, "ISIS LSP");

Expand Down Expand Up @@ -1067,6 +1068,8 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
/* Add Router Capability TLV. */
if (area->isis->router_id != 0) {
struct isis_router_cap cap = {};
struct listnode *node;
struct flex_algo *fa;

/* init SR algo list content to the default value */
for (int i = 0; i < SR_ALGORITHM_COUNT; i++)
Expand All @@ -1089,6 +1092,12 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
/* Then Algorithm */
cap.algo[0] = SR_ALGORITHM_SPF;
cap.algo[1] = SR_ALGORITHM_UNSET;
for (ALL_LIST_ELEMENTS_RO(area->flex_algos->flex_algos,
node, fa)) {
lsp_debug("ISIS (%s): SR Algorithm %u",
area->area_tag, fa->algorithm);
cap.algo[fa->algorithm] = fa->algorithm;
}
/* SRLB */
cap.srlb.flags = 0;
range_size = srdb->config.srlb_upper_bound
Expand All @@ -1100,8 +1109,16 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
}

isis_tlvs_set_router_capability(lsp->tlvs, &cap);
lsp_debug("ISIS (%s): Adding Router Capabilities information",
area->area_tag);

for (ALL_LIST_ELEMENTS_RO(area->flex_algos->flex_algos, node,
fa)) {
if (!fa->advertise_definition)
continue;
lsp_debug("ISIS (%s): Flex-Algo Definition %u",
area->area_tag, fa->algorithm);
isis_tlvs_set_router_capability_fad(area, lsp->tlvs,
fa);
}
}

/* IPv4 address and TE router ID TLVs.
Expand Down Expand Up @@ -1246,6 +1263,9 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
}
}

/* ASLA for Flex-Algo */
isis_tlvs_add_asla_admin_group(circuit);

switch (circuit->circ_type) {
case CIRCUIT_T_BROADCAST:
if (level & circuit->is_type) {
Expand Down
Loading

0 comments on commit 93b0b7f

Please sign in to comment.