1 /* SPDX-License-Identifier: Apache-2.0
2 * Copyright(c) 2022 Cisco Systems, Inc.
7 * @brief SR Path Tracing data structures definitions
11 #ifndef included_vnet_sr_pt_h
12 #define included_vnet_sr_pt_h
15 #define SR_PT_ERR_NOENT -1 /* No such entry*/
16 #define SR_PT_ERR_EXIST -2 /* Entry exists */
17 #define SR_PT_ERR_IFACE_INVALID -3 /* IFACE invalid */
18 #define SR_PT_ERR_ID_INVALID -4 /* ID invalid */
19 #define SR_PT_ERR_LOAD_INVALID -5 /* LOAD invalid*/
20 #define SR_PT_ERR_TTS_TEMPLATE_INVALID -6 /* TTS Template invalid */
22 /*PT paramters max values*/
23 #define SR_PT_ID_MAX 4095
24 #define SR_PT_LOAD_MAX 15
25 #define SR_PT_TTS_TEMPLATE_MAX 3
28 #define SR_PT_TTS_TEMPLATE_0 0
29 #define SR_PT_TTS_TEMPLATE_1 1
30 #define SR_PT_TTS_TEMPLATE_2 2
31 #define SR_PT_TTS_TEMPLATE_3 3
32 #define SR_PT_TTS_TEMPLATE_DEFAULT 2
34 /*PT TTS Template shift value*/
35 #define SR_PT_TTS_SHIFT_TEMPLATE_0 8
36 #define SR_PT_TTS_SHIFT_TEMPLATE_1 12
37 #define SR_PT_TTS_SHIFT_TEMPLATE_2 16
38 #define SR_PT_TTS_SHIFT_TEMPLATE_3 20
42 u32 iface; /**< Interface */
43 u16 id; /**< Interface ID */
44 u8 ingress_load; /**< Interface Ingress Load */
45 u8 egress_load; /**< Interface Egress Load */
46 u8 tts_template; /**< Interface TTS Template */
50 * @brief Path Tracing main datastructure
54 /* Pool of pt_iface instances */
55 sr_pt_iface_t *sr_pt_iface;
57 /* Hash table for pt iface parameters */
58 mhash_t sr_pt_iface_index_hash;
62 extern sr_pt_main_t sr_pt_main;
63 extern int sr_pt_add_iface (u32 iface, u16 id, u8 ingress_load, u8 egress_load,
65 extern int sr_pt_del_iface (u32 iface);
66 extern void *sr_pt_find_iface (u32 iface);
68 #endif /* included_vnet_sr_pt_h */