FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
l2_xcrw.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_l2_xcrw_h__
16 #define __included_l2_xcrw_h__
17 
18 #include <vlib/vlib.h>
19 #include <vnet/vnet.h>
20 #include <vppinfra/error.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/l2/l2_input.h>
23 #include <vnet/l2/l2_output.h>
24 #include <vnet/api_errno.h>
25 #include <vnet/ethernet/ethernet.h>
26 
27 typedef struct
28 {
29  /*
30  * Let: rewrite_header.sw_if_index = tx_fib_index or ~0.
31  * rewrite_header.next_index = L2_XCRW_NEXT_XXX
32  */
35 
36 typedef struct
37 {
38  /* L2 interface */
40 
41  /* Tunnel interface */
42  u32 tunnel_sw_if_index; /* This field remains set in freed pool elts */
43 
45 
46 typedef struct
47 {
49 
50  /* Vector of cross-connect rewrites */
52 
53  /* Pool of xcrw tunnels */
55 
56  /* Tunnel index by tunnel sw_if_index */
58 
59  /* convenience variables */
63 
64 typedef enum
65 {
69 
70 #define foreach_l2_xcrw_error \
71 _(DROP, "Packets dropped") \
72 _(FWD, "Packets forwarded")
73 
74 typedef enum
75 {
76 #define _(sym,str) L2_XCRW_ERROR_##sym,
78 #undef _
81 
83 
84 #endif /* __included_l2_xcrw_h__ */
85 
86 /*
87  * fd.io coding-style-patch-verification: ON
88  *
89  * Local Variables:
90  * eval: (c-set-style "gnu")
91  * End:
92  */
vlib.h
l2_xcrw_main_t::cached_next_index
u32 cached_next_index
Definition: l2_xcrw.h:48
l2_xcrw_adjacency_t
Definition: l2_xcrw.h:27
l2_xcrw_error_t
l2_xcrw_error_t
Definition: l2_xcrw.h:74
l2_xcrw_node
vlib_node_registration_t l2_xcrw_node
(constructor) VLIB_REGISTER_NODE (l2_xcrw_node)
Definition: l2_xcrw.c:242
l2_xcrw_adjacency_t::VNET_DECLARE_REWRITE
VNET_DECLARE_REWRITE
Definition: l2_xcrw.h:33
ethernet.h
l2_xcrw_tunnel_t
Definition: l2_xcrw.h:36
l2_xcrw_tunnel_t::tunnel_sw_if_index
u32 tunnel_sw_if_index
Definition: l2_xcrw.h:42
error.h
l2_output.h
l2_xcrw_next_t
l2_xcrw_next_t
Definition: l2_xcrw.h:64
uword
u64 uword
Definition: types.h:112
l2_xcrw_main_t
Definition: l2_xcrw.h:46
L2_XCRW_NEXT_DROP
@ L2_XCRW_NEXT_DROP
Definition: l2_xcrw.h:66
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
L2_XCRW_N_NEXT
@ L2_XCRW_N_NEXT
Definition: l2_xcrw.h:67
l2_input.h
vnet_main_t
Definition: vnet.h:76
l2_xcrw_main_t::vlib_main
vlib_main_t * vlib_main
Definition: l2_xcrw.h:60
l2_xcrw_main_t::tunnel_index_by_l2_sw_if_index
uword * tunnel_index_by_l2_sw_if_index
Definition: l2_xcrw.h:57
ip.h
u32
unsigned int u32
Definition: types.h:88
l2_xcrw_main_t::tunnels
l2_xcrw_tunnel_t * tunnels
Definition: l2_xcrw.h:54
vlib_main_t
Definition: main.h:102
l2_xcrw_main_t::adj_by_sw_if_index
l2_xcrw_adjacency_t * adj_by_sw_if_index
Definition: l2_xcrw.h:51
foreach_l2_xcrw_error
#define foreach_l2_xcrw_error
Definition: l2_xcrw.h:70
vnet.h
api_errno.h
l2_xcrw_main_t::vnet_main
vnet_main_t * vnet_main
Definition: l2_xcrw.h:61
l2_xcrw_tunnel_t::l2_sw_if_index
u32 l2_sw_if_index
Definition: l2_xcrw.h:39
L2_XCRW_N_ERROR
@ L2_XCRW_N_ERROR
Definition: l2_xcrw.h:79