diff options
author | Hiroki Shirokura <hiroki.shirokura@linecorp.com> | 2022-01-22 12:07:40 +0100 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2023-04-18 10:11:43 +0200 |
commit | 81a067cd9251b60a04bbc8133546e790044fa790 (patch) | |
tree | a9082b7945b7da51ad54df3adb73b4013205d070 /lib/segment_routing.h | |
parent | isisd: update struct isis_sr_psid_info with algorithm id (diff) | |
download | frr-81a067cd9251b60a04bbc8133546e790044fa790.tar.xz frr-81a067cd9251b60a04bbc8133546e790044fa790.zip |
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/segment_routing.h')
-rw-r--r-- | lib/segment_routing.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/segment_routing.h b/lib/segment_routing.h new file mode 100644 index 000000000..5e71466bf --- /dev/null +++ b/lib/segment_routing.h @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/********************************************************************* + * Copyright 2022 Hiroki Shirokura, LINE Corporation + * Copyright 2022 Masakazu Asama + * Copyright 2022 6WIND S.A. + * + * segment_routing.h: Segment-Routing Library + * + * Authors + * ------- + * Hiroki Shirokura + * Masakazu Asama + * Louis Scalbert + */ + +#ifndef _FRR_SR_H +#define _FRR_SR_H + +#include <zebra.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * IGP Algorithm Types + * https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml + */ +#define SR_ALGORITHM_SPF 0 /* RFC8665 */ +#define SR_ALGORITHM_STRICT_SPF 1 /* RFC8665 */ +#define SR_ALGORITHM_UNSET 127 /* FRRouting defined */ +#define SR_ALGORITHM_FLEX_MIN 128 /* RFC9350 Flex-Algorithm */ +#define SR_ALGORITHM_FLEX_MAX 255 /* RFC9350 Flex-Algorithm */ +#define SR_ALGORITHM_COUNT 256 + +const char *sr_algorithm_string(uint8_t algo); + +#ifdef __cplusplus +} +#endif + +#endif /* _FRR_SR_H */ |