FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
vxlan_gpe_ioam.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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_vxlan_gpe_ioam_h__
16 #define __included_vxlan_gpe_ioam_h__
17 
21 #include <vnet/ip/ip.h>
22 
23 
25 {
28 
30 {
31  ip46_address_t dst_addr;
37 
38 typedef struct vxlan_gpe_ioam_main_
39 {
40  /**
41  * Linkage into the FIB object graph
42  */
44 
45  /* time scale transform. Joy. */
48 
49 
50  /* Trace option */
52 
53  /* Pot option */
55 
56 #define PPC_NONE 0
57 #define PPC_ENCAP 1
58 #define PPC_DECAP 2
60 
61 #define TSP_SECONDS 0
62 #define TSP_MILLISECONDS 1
63 #define TSP_MICROSECONDS 2
64 #define TSP_NANOSECONDS 3
65 
66  /* Array of function pointers to ADD and POP VxLAN-GPE iOAM option handling routines */
68  int (*add_options[256]) (u8 * rewrite_string, u8 * rewrite_size);
70 
71  /* Array of function pointers to iOAM option handling routines */
73  u8 is_ipv4, u8 use_adj);
74  u8 *(*trace[256]) (u8 * s, vxlan_gpe_ioam_option_t * opt);
75 
76  /* API message ID base */
78 
79  /* Override to export for iOAM */
82 
83  /* sequence of node graph for encap */
86 
87  /* Software interfaces. */
89 
90  /* hash ip4/ip6 -> list of destinations for doing transit iOAM operation */
94 
95  /** per sw_if_index, to maintain bitmap */
98 
99  /** State convenience vlib_main_t */
101  /** State convenience vnet_main_t */
103 
104 
107 
108 /*
109  * Primary h-b-h handler trace support
110  */
111 typedef struct
112 {
115  u8 option_data[256];
116 } ioam_trace_t;
117 
118 
122 
123 clib_error_t *vxlan_gpe_ioam_enable (int has_trace_option, int has_pot_option,
124  int has_ppc_option);
125 
126 clib_error_t *vxlan_gpe_ioam_disable (int has_trace_option,
127  int has_pot_option, int has_ppc_option);
128 
130  int has_trace_option,
131  int has_pot_option,
132  int has_ppc_option, u8 ipv6_set);
134  int has_trace_option, int has_pot_option,
135  int has_ppc_option, u8 ipv6_set);
136 
138  u8 size,
139  int rewrite_options (u8 *
140  rewrite_string,
141  u8 *
142  rewrite_size));
143 
145 
147  int options (vlib_buffer_t * b,
149  opt, u8 is_ipv4, u8 use_adj),
150  u8 * trace (u8 * s,
152  opt));
154 
156 
158 extern void vxlan_gpe_ioam_interface_init (void);
159 int
161  ip46_address_t dst_addr,
162  u32 outer_fib_index,
163  u8 is_ipv4, u8 is_add);
165  (vlib_main_t * vm, ip46_address_t dst_addr, u32 outer_fib_index,
166  u8 ipv4_set);
167 
168 typedef enum
169 {
174 
175 #endif
176 
177 /*
178  * fd.io coding-style-patch-verification: ON
179  *
180  * Local Variables:
181  * eval: (c-set-style "gnu")
182  * End:
183  */
vxlan_gpe_ioam_main_::options_size
u8 options_size[256]
Definition: vxlan_gpe_ioam.h:67
vxlan_gpe_transit_ioam_v4_node
vlib_node_registration_t vxlan_gpe_transit_ioam_v4_node
vxlan_gpe_ioam_main_::sw_interfaces
vxlan_gpe_ioam_sw_interface_t * sw_interfaces
Definition: vxlan_gpe_ioam.h:88
vxlan_gpe_ioam_add_register_option
int vxlan_gpe_ioam_add_register_option(u8 option, u8 size, int rewrite_options(u8 *rewrite_string, u8 *rewrite_size))
Definition: vxlan_gpe_ioam_trace.c:84
ioam_trace_t
Definition: vxlan_gpe_ioam.h:111
vxlan_gpe_trace_profile_cleanup
int vxlan_gpe_trace_profile_cleanup(void)
Definition: vxlan_gpe_ioam_trace.c:472
trace
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
Definition: vlib_api_cli.c:870
vxlan_gpe_ioam_main_::dst_by_ip6
uword * dst_by_ip6
Definition: vxlan_gpe_ioam.h:93
VXLAN_GPE_DECAP_IOAM_V4_NEXT_POP
@ VXLAN_GPE_DECAP_IOAM_V4_NEXT_POP
Definition: vxlan_gpe_ioam.h:170
vxlan_gpe_ioam_main_::has_trace_option
u8 has_trace_option
Definition: vxlan_gpe_ioam.h:51
vxlan_gpe_encap_ioam_v4_node
vlib_node_registration_t vxlan_gpe_encap_ioam_v4_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_ioam_v4_node)
Definition: ioam_encap.c:168
vxlan_gpe_ioam_main_::vlib_time_0
f64 vlib_time_0
Definition: vxlan_gpe_ioam.h:47
vxlan_gpe_ioam_packet.h
VXLAN_GPE_DECAP_IOAM_V4_NEXT_DROP
@ VXLAN_GPE_DECAP_IOAM_V4_NEXT_DROP
Definition: vxlan_gpe_ioam.h:171
vxlan_gpe_ioam_main_::has_ppc_option
u8 has_ppc_option
Definition: vxlan_gpe_ioam.h:59
u16
unsigned short u16
Definition: types.h:57
vxlan_gpe_ioam_main
vxlan_gpe_ioam_main_t vxlan_gpe_ioam_main
Definition: vxlan_gpe_ioam.c:23
vxlan_gpe_sw_interface_::sw_if_index
u32 sw_if_index
Definition: vxlan_gpe_ioam.h:26
vxlan_gpe_ioam_main_::vlib_main
vlib_main_t * vlib_main
State convenience vlib_main_t.
Definition: vxlan_gpe_ioam.h:100
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vxlan_gpe_decap_ioam_v4_next_t
vxlan_gpe_decap_ioam_v4_next_t
Definition: vxlan_gpe_ioam.h:168
vxlan_gpe_decap_ioam_v4_node
vlib_node_registration_t vxlan_gpe_decap_ioam_v4_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_decap_ioam_v4_node)
Definition: ioam_decap.c:197
vxlan_gpe_dest_tunnels_
Definition: vxlan_gpe_ioam.h:29
vxlan_gpe_ioam_main_::unix_time_0
u32 unix_time_0
Definition: vxlan_gpe_ioam.h:46
fib_node_type_t
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
vxlan_gpe_ioam_main_::vnet_main
vnet_main_t * vnet_main
State convenience vnet_main_t.
Definition: vxlan_gpe_ioam.h:102
vxlan_gpe_ioam_main_::has_pot_option
u8 has_pot_option
Definition: vxlan_gpe_ioam.h:54
ip4_header_t
Definition: ip4_packet.h:87
vxlan_gpe_ioam_interface_init
void vxlan_gpe_ioam_interface_init(void)
Definition: vxlan_gpe_ioam.c:749
vxlan_gpe.h
VXLAN GPE definitions.
vxlan_gpe_ioam_register_option
int vxlan_gpe_ioam_register_option(u8 option, int options(vlib_buffer_t *b, vxlan_gpe_ioam_option_t *opt, u8 is_ipv4, u8 use_adj), u8 *trace(u8 *s, vxlan_gpe_ioam_option_t *opt))
Definition: vxlan_gpe_ioam_trace.c:121
vxlan_gpe_ioam_clear
clib_error_t * vxlan_gpe_ioam_clear(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
Definition: vxlan_gpe_ioam.c:126
vxlan_gpe_ioam_main_t
struct vxlan_gpe_ioam_main_ vxlan_gpe_ioam_main_t
vxlan_gpe_ioam_main_::decap_v6_next_override
uword decap_v6_next_override
Definition: vxlan_gpe_ioam.h:81
vxlan_gpe_dest_tunnels_::fp_proto
u32 fp_proto
Definition: vxlan_gpe_ioam.h:32
vxlan_gpe_ioam_set
clib_error_t * vxlan_gpe_ioam_set(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
Definition: vxlan_gpe_ioam.c:148
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
vxlan_gpe_ioam_main_::decap_v4_next_override
uword decap_v4_next_override
Definition: vxlan_gpe_ioam.h:80
vxlan_gpe_dest_tunnels_::fib_entry_index
fib_node_index_t fib_entry_index
Definition: vxlan_gpe_ioam.h:34
uword
u64 uword
Definition: types.h:112
vxlan_gpe_ioam_main_::node
fib_node_t node
Linkage into the FIB object graph.
Definition: vxlan_gpe_ioam.h:43
vxlan_gpe_ioam_enable
clib_error_t * vxlan_gpe_ioam_enable(int has_trace_option, int has_pot_option, int has_ppc_option)
Definition: vxlan_gpe_ioam.c:522
vxlan_gpe_ioam_disable
clib_error_t * vxlan_gpe_ioam_disable(int has_trace_option, int has_pot_option, int has_ppc_option)
Definition: vxlan_gpe_ioam.c:538
vxlan_gpe_ioam_main_::encap_v4_next_node
uword encap_v4_next_node
Definition: vxlan_gpe_ioam.h:84
vxlan_gpe_ioam_main_::msg_id_base
u16 msg_id_base
Definition: vxlan_gpe_ioam.h:77
vxlan_gpe_ioam_main_::pop_options
int(* pop_options[256])(ip4_header_t *ip, vxlan_gpe_ioam_option_t *opt)
Definition: vxlan_gpe_ioam.h:69
dst_addr
vl_api_mac_address_t dst_addr
Definition: flow_types.api:65
f64
double f64
Definition: types.h:142
vxlan_gpe_tunnel_t
Struct for VXLAN GPE tunnel.
Definition: vxlan_gpe.h:103
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
vxlan_gpe_add_unregister_option
int vxlan_gpe_add_unregister_option(u8 option)
Definition: vxlan_gpe_ioam_trace.c:104
vxlan_gpe_sw_interface_
Definition: vxlan_gpe_ioam.h:24
VXLAN_GPE_DECAP_IOAM_V4_N_NEXT
@ VXLAN_GPE_DECAP_IOAM_V4_N_NEXT
Definition: vxlan_gpe_ioam.h:172
vxlan_gpe_ioam_main_::fib_entry_type
fib_node_type_t fib_entry_type
Definition: vxlan_gpe_ioam.h:97
vxlan_gpe_ioam_sw_interface_t
struct vxlan_gpe_sw_interface_ vxlan_gpe_ioam_sw_interface_t
vxlan_gpe_ioam_main_::encap_v6_next_node
uword encap_v6_next_node
Definition: vxlan_gpe_ioam.h:85
vnet_main_t
Definition: vnet.h:76
size
u32 size
Definition: vhost_user.h:125
vxlan_gpe_packet.h
VXLAN GPE packet header structure.
vxlan_gpe_ioam_main_::add_options
int(* add_options[256])(u8 *rewrite_string, u8 *rewrite_size)
Definition: vxlan_gpe_ioam.h:68
ioam_trace_t::trace_len
u32 trace_len
Definition: vxlan_gpe_ioam.h:114
vxlan_gpe_dest_tunnels_::dst_addr
ip46_address_t dst_addr
Definition: vxlan_gpe_ioam.h:31
ioam_trace_t::next_index
u32 next_index
Definition: vxlan_gpe_ioam.h:113
vxlan_gpe_ioam_main_
Definition: vxlan_gpe_ioam.h:38
ip.h
u32
unsigned int u32
Definition: types.h:88
options
static struct option options[]
Definition: main.c:52
vxlan_gpe_ioam_option_t
Definition: vxlan_gpe_ioam_packet.h:43
vxlan_gpe_ioam_main_::dst_tunnels
vxlan_gpe_ioam_dest_tunnels_t * dst_tunnels
Definition: vxlan_gpe_ioam.h:91
vxlan_gpe_ioam_main_::dst_by_ip4
uword * dst_by_ip4
Definition: vxlan_gpe_ioam.h:92
fib_node_t_
An node in the FIB graph.
Definition: fib_node.h:301
vxlan_gpe_trace_profile_setup
int vxlan_gpe_trace_profile_setup(void)
Definition: vxlan_gpe_ioam_trace.c:515
vlib_main_t
Definition: main.h:102
vxlan_gpe_ioam_main_::bool_ref_by_sw_if_index
u8 * bool_ref_by_sw_if_index
per sw_if_index, to maintain bitmap
Definition: vxlan_gpe_ioam.h:96
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vxlan_gpe_dest_tunnels_::sibling_index
u32 sibling_index
Definition: vxlan_gpe_ioam.h:33
ip
vl_api_address_t ip
Definition: l2.api:558
vxlan_gpe_ioam_main_::options
int(* options[256])(vlib_buffer_t *b, vxlan_gpe_ioam_option_t *opt, u8 is_ipv4, u8 use_adj)
Definition: vxlan_gpe_ioam.h:72
vxlan_gpe_ioam_disable_for_dest
int vxlan_gpe_ioam_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 ipv4_set)
Definition: vxlan_gpe_ioam.c:603
vxlan_gpe_ioam_dest_tunnels_t
struct vxlan_gpe_dest_tunnels_ vxlan_gpe_ioam_dest_tunnels_t
vxlan_gpe_ioam_unregister_option
int vxlan_gpe_ioam_unregister_option(u8 option)
Definition: vxlan_gpe_ioam_trace.c:143
vxlan_gpe_enable_disable_ioam_for_dest
int vxlan_gpe_enable_disable_ioam_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 is_ipv4, u8 is_add)
Definition: vxlan_gpe_ioam.c:202
vxlan_gpe_ioam_main_::trace
u8 *(* trace[256])(u8 *s, vxlan_gpe_ioam_option_t *opt)
Definition: vxlan_gpe_ioam.h:74
vxlan_gpe_dest_tunnels_::outer_fib_index
u32 outer_fib_index
Definition: vxlan_gpe_ioam.h:35
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111