FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
span.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 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 
16 #ifndef __span_h__
17 #define __span_h__
18 
19 #include <vnet/vnet.h>
20 #include <vnet/ip/ip.h>
21 #include <vnet/l2/l2_output.h>
22 
23 typedef enum
24 {
28 } span_feat_t;
29 
30 typedef struct
31 {
35 
36 typedef struct
37 {
40 
41 typedef struct
42 {
43  /* l2 feature Next nodes */
44  u32 l2_input_next[32];
45  u32 l2_output_next[32];
46 
47  /* per-interface vector of span instances */
49 
50  /* biggest sw_if_index used so far */
52 
53  /* convenience */
56 
58 } span_main_t;
59 
60 extern span_main_t span_main;
61 
62 typedef struct
63 {
64  u32 src_sw_if_index; /* mirrored interface index */
65  u32 mirror_sw_if_index; /* output interface index */
66 } span_trace_t;
67 
68 #endif /* __span_h__ */
69 
70 int
71 span_add_delete_entry (vlib_main_t * vm, u32 src_sw_if_index,
72  u32 dst_sw_if_index, u8 state, span_feat_t sf);
73 /*
74  * fd.io coding-style-patch-verification: ON
75  *
76  * Local Variables:
77  * eval: (c-set-style "gnu")
78  * End:
79  */
span_main_t::vlib_main
vlib_main_t * vlib_main
Definition: span.h:54
clib_bitmap_t
uword clib_bitmap_t
Definition: bitmap.h:50
u16
unsigned short u16
Definition: types.h:57
span_main_t
Definition: span.h:41
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
span_mirror_t::num_mirror_ports
u32 num_mirror_ports
Definition: span.h:33
SPAN_FEAT_DEVICE
@ SPAN_FEAT_DEVICE
Definition: span.h:25
state
vl_api_dhcp_client_state_t state
Definition: dhcp.api:201
span_main_t::msg_id_base
u16 msg_id_base
Definition: span.h:57
SPAN_FEAT_N
@ SPAN_FEAT_N
Definition: span.h:27
l2_output.h
span_trace_t::mirror_sw_if_index
u32 mirror_sw_if_index
Definition: span.h:65
span_mirror_t::mirror_ports
clib_bitmap_t * mirror_ports
Definition: span.h:32
VLIB_N_RX_TX
@ VLIB_N_RX_TX
Definition: defs.h:48
vnet_main_t
Definition: vnet.h:76
SPAN_FEAT_L2
@ SPAN_FEAT_L2
Definition: span.h:26
ip.h
u32
unsigned int u32
Definition: types.h:88
span_mirror_t
Definition: span.h:30
span_main_t::vnet_main
vnet_main_t * vnet_main
Definition: span.h:55
span_main
span_main_t span_main
Definition: span.c:24
span_add_delete_entry
int span_add_delete_entry(vlib_main_t *vm, u32 src_sw_if_index, u32 dst_sw_if_index, u8 state, span_feat_t sf)
Definition: span.c:52
vlib_main_t
Definition: main.h:102
u8
unsigned char u8
Definition: types.h:56
vnet.h
span_interface_t
Definition: span.h:36
span_main_t::max_sw_if_index
u32 max_sw_if_index
Definition: span.h:51
span_trace_t::src_sw_if_index
u32 src_sw_if_index
Definition: span.h:64
span_main_t::interfaces
span_interface_t * interfaces
Definition: span.h:48
span_trace_t
Definition: span.h:62
span_feat_t
span_feat_t
Definition: span.h:23