FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
nsh_md2_ioam.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef __included_nsh_md2_ioam_h__
16 #define __included_nsh_md2_ioam_h__
17 
18 #include <nsh/nsh.h>
19 #include <nsh/nsh_packet.h>
20 #include <vnet/ip/ip.h>
21 #include <vnet/ip/ip4_packet.h>
22 #include <vnet/ip/ip6_packet.h>
23 
24 
26 {
29 
31 {
32  ip46_address_t dst_addr;
38 
39 typedef struct nsh_md2_ioam_main_
40 {
41  /**
42  * Linkage into the FIB object graph
43  */
45 
46  /* time scale transform. Joy. */
49 
50 
51  /* Trace option */
53 
54  /* Pot option */
56 
57 #define PPC_NONE 0
58 #define PPC_ENCAP 1
59 #define PPC_DECAP 2
61 
62 #define TSP_SECONDS 0
63 #define TSP_MILLISECONDS 1
64 #define TSP_MICROSECONDS 2
65 #define TSP_NANOSECONDS 3
66 
67 
68  /* API message ID base */
70 
71  /* Override to export for iOAM */
74 
75  /* sequence of node graph for encap */
78 
79  /* Software interfaces. */
81 
82  /* hash ip4/ip6 -> list of destinations for doing transit iOAM operation */
86 
87  /** per sw_if_index, to maintain bitmap */
90 
91 
94 
95 /*
96  * Primary h-b-h handler trace support
97  */
98 typedef struct
99 {
100  u32 next_index;
101  u32 trace_len;
102  u8 option_data[256];
103 } ioam_trace_t;
104 
105 
106 clib_error_t *nsh_md2_ioam_enable_disable (int has_trace_option,
107  int has_pot_option,
108  int has_ppc_option);
109 
110 
111 
113 
115 extern void nsh_md2_ioam_interface_init (void);
116 
117 
118 
119 #endif
nsh_md2_ioam_sw_interface_t
struct nsh_md2_ioam_sw_interface_ nsh_md2_ioam_sw_interface_t
nsh_md2_ioam_trace_profile_cleanup
int nsh_md2_ioam_trace_profile_cleanup(void)
Definition: nsh_md2_ioam_trace.c:387
ioam_trace_t
Definition: vxlan_gpe_ioam.h:111
nsh_md2_ioam_main_::node
fib_node_t node
Linkage into the FIB object graph.
Definition: nsh_md2_ioam.h:44
nsh_md2_ioam_main_::encap_v4_next_node
uword encap_v4_next_node
Definition: nsh_md2_ioam.h:76
nsh_md2_ioam_main_::dst_by_ip6
uword * dst_by_ip6
Definition: nsh_md2_ioam.h:85
nsh_md2_ioam_trace_profile_setup
int nsh_md2_ioam_trace_profile_setup(void)
Definition: nsh_md2_ioam_trace.c:430
nsh_md2_ioam_interface_init
void nsh_md2_ioam_interface_init(void)
Definition: nsh_md2_ioam.c:500
nsh_md2_ioam_main_::fib_entry_type
fib_node_type_t fib_entry_type
Definition: nsh_md2_ioam.h:89
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
nsh_md2_ioam_sw_interface_
Definition: nsh_md2_ioam.h:25
nsh_md2_ioam_main
nsh_md2_ioam_main_t nsh_md2_ioam_main
Definition: nsh_md2_ioam.c:42
nsh_md2_ioam_main_::msg_id_base
u16 msg_id_base
Definition: nsh_md2_ioam.h:69
nsh_md2_ioam_dest_tunnels_::outer_fib_index
u32 outer_fib_index
Definition: nsh_md2_ioam.h:36
u16
unsigned short u16
Definition: types.h:57
nsh_md2_ioam_sw_interface_::sw_if_index
u32 sw_if_index
Definition: nsh_md2_ioam.h:27
nsh_md2_ioam_main_::has_ppc_option
u8 has_ppc_option
Definition: nsh_md2_ioam.h:60
nsh_md2_ioam_main_::has_trace_option
u8 has_trace_option
Definition: nsh_md2_ioam.h:52
nsh_md2_ioam_main_::dst_by_ip4
uword * dst_by_ip4
Definition: nsh_md2_ioam.h:84
fib_node_type_t
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
ip6_packet.h
nsh_md2_ioam_dest_tunnels_::sibling_index
u32 sibling_index
Definition: nsh_md2_ioam.h:34
nsh_md2_ioam_dest_tunnels_::fib_entry_index
fib_node_index_t fib_entry_index
Definition: nsh_md2_ioam.h:35
nsh_md2_ioam_main_
Definition: nsh_md2_ioam.h:39
nsh_md2_ioam_dest_tunnels_
Definition: nsh_md2_ioam.h:30
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
uword
u64 uword
Definition: types.h:112
nsh_md2_ioam_dest_tunnels_::fp_proto
u32 fp_proto
Definition: nsh_md2_ioam.h:33
f64
double f64
Definition: types.h:142
nsh_md2_ioam_main_::decap_v4_next_override
uword decap_v4_next_override
Definition: nsh_md2_ioam.h:72
ip4_packet.h
nsh_md2_ioam_main_::unix_time_0
u32 unix_time_0
Definition: nsh_md2_ioam.h:47
nsh_md2_ioam_dest_tunnels_t
struct nsh_md2_ioam_dest_tunnels_ nsh_md2_ioam_dest_tunnels_t
nsh.h
nsh_md2_ioam_main_::sw_interfaces
nsh_md2_ioam_sw_interface_t * sw_interfaces
Definition: nsh_md2_ioam.h:80
ip.h
u32
unsigned int u32
Definition: types.h:88
nsh_md2_ioam_main_::encap_v6_next_node
uword encap_v6_next_node
Definition: nsh_md2_ioam.h:77
nsh_md2_ioam_dest_tunnels_::dst_addr
ip46_address_t dst_addr
Definition: nsh_md2_ioam.h:32
nsh_packet.h
fib_node_t_
An node in the FIB graph.
Definition: fib_node.h:301
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
nsh_md2_ioam_main_::vlib_time_0
f64 vlib_time_0
Definition: nsh_md2_ioam.h:48
nsh_md2_ioam_main_::dst_tunnels
nsh_md2_ioam_dest_tunnels_t * dst_tunnels
Definition: nsh_md2_ioam.h:83
nsh_md2_ioam_main_::has_pot_option
u8 has_pot_option
Definition: nsh_md2_ioam.h:55
nsh_md2_ioam_main_::decap_v6_next_override
uword decap_v6_next_override
Definition: nsh_md2_ioam.h:73
nsh_md2_ioam_main_t
struct nsh_md2_ioam_main_ nsh_md2_ioam_main_t
nsh_md2_ioam_main_::bool_ref_by_sw_if_index
u8 * bool_ref_by_sw_if_index
per sw_if_index, to maintain bitmap
Definition: nsh_md2_ioam.h:88
nsh_md2_ioam_enable_disable
clib_error_t * nsh_md2_ioam_enable_disable(int has_trace_option, int has_pot_option, int has_ppc_option)
Definition: nsh_md2_ioam.c:345