summaryrefslogtreecommitdiff
path: root/lib/link_state.h
diff options
context:
space:
mode:
authorHiroki Shirokura <hiroki.shirokura@linecorp.com>2022-01-22 11:07:40 +0000
committerLouis Scalbert <louis.scalbert@6wind.com>2023-04-18 10:11:43 +0200
commit81a067cd9251b60a04bbc8133546e790044fa790 (patch)
treea9082b7945b7da51ad54df3adb73b4013205d070 /lib/link_state.h
parent7f8dddf4300911a8d125d53f87eb64598e2bbcf8 (diff)
lib,isisd: refactor igp-agnostic sr misc functions
SR Algorithms are independent of specific IGPs such as IS-IS. This commit adds lib/sr to aggregate IGP agnostic functions and constants. Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'lib/link_state.h')
-rw-r--r--lib/link_state.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/link_state.h b/lib/link_state.h
index b75f035431..3d2ed7a872 100644
--- a/lib/link_state.h
+++ b/lib/link_state.h
@@ -92,6 +92,9 @@ struct ls_node_id {
*/
extern int ls_node_id_same(struct ls_node_id i1, struct ls_node_id i2);
+/* Supported number of algorithm by the link-state library */
+#define LIB_LS_SR_ALGO_COUNT 2
+
/* Link State flags to indicate which Node parameters are valid */
#define LS_NODE_UNSET 0x0000
#define LS_NODE_NAME 0x0001
@@ -123,7 +126,7 @@ struct ls_node {
uint32_t lower_bound; /* MPLS label lower bound */
uint32_t range_size; /* MPLS label range size */
} srlb;
- uint8_t algo[2]; /* Segment Routing Algorithms */
+ uint8_t algo[LIB_LS_SR_ALGO_COUNT]; /* Segment Routing Algorithms */
uint8_t msd; /* Maximum Stack Depth */
};