diff options
| author | Olivier Dugeon <olivier.dugeon@orange.com> | 2023-04-18 14:45:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-18 14:45:30 +0200 |
| commit | fd4377d9a5a96940446af16f61c183aca8049f48 (patch) | |
| tree | c4edfe0ac8f89a1c24b6b01c00a54358722be66b /lib/segment_routing.c | |
| parent | 59b2a1048f08818a4a4986f48e5da295ed509b67 (diff) | |
| parent | cba6998236f2fdbf0e8a1ca0819a18c6d756bfee (diff) | |
Merge pull request #11667 from louis-6wind/flexalgo-mpls
isisd: Flex-Algo for SR-MPLS
Diffstat (limited to 'lib/segment_routing.c')
| -rw-r--r-- | lib/segment_routing.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/segment_routing.c b/lib/segment_routing.c new file mode 100644 index 0000000000..f45a64d29a --- /dev/null +++ b/lib/segment_routing.c @@ -0,0 +1,30 @@ +// 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.c: Segment-Routing Library + * + * Authors + * ------- + * Hiroki Shirokura + * Masakazu Asama + * Louis Scalbert + */ + +#include "segment_routing.h" + +const char *sr_algorithm_string(uint8_t algo) +{ + switch (algo) { + case SR_ALGORITHM_SPF: + return "SPF"; + case SR_ALGORITHM_STRICT_SPF: + return "Strict SPF"; + case SR_ALGORITHM_UNSET: + return "Unset"; + default: + return algo >= SR_ALGORITHM_FLEX_MIN ? "Flex-Algo" : "Unknown"; + } +} |
