Line data Source code
1 : // SPDX-License-Identifier: GPL-2.0-or-later
2 : /*
3 : * SR-TE definitions
4 : * Copyright 2020 NetDef Inc.
5 : * Sascha Kattelmann
6 : */
7 :
8 : #ifndef _FRR_SRTE_H
9 : #define _FRR_SRTE_H
10 :
11 : #ifdef __cplusplus
12 : extern "C" {
13 : #endif
14 :
15 : #define SRTE_POLICY_NAME_MAX_LENGTH 64
16 :
17 : enum zebra_sr_policy_status {
18 : ZEBRA_SR_POLICY_UP = 0,
19 : ZEBRA_SR_POLICY_DOWN,
20 : };
21 :
22 0 : static inline int sr_policy_compare(const struct ipaddr *a_endpoint,
23 : const struct ipaddr *b_endpoint,
24 : uint32_t a_color, uint32_t b_color)
25 : {
26 0 : int ret;
27 :
28 0 : ret = ipaddr_cmp(a_endpoint, b_endpoint);
29 0 : if (ret < 0)
30 : return -1;
31 0 : if (ret > 0)
32 : return 1;
33 :
34 0 : return a_color - b_color;
35 : }
36 :
37 : #ifdef __cplusplus
38 : }
39 : #endif
40 :
41 : #endif /* _FRR_SRTE_H */
|