FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
l2e.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 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 included_vnet_l2_emulation_h
17 #define included_vnet_l2_emulation_h
18 
19 #include <vlib/vlib.h>
20 #include <vnet/vnet.h>
21 
22 /**
23  * Per-interface L2 configuration
24  */
25 typedef struct l2_emulation_t_
26 {
27  /**
28  * Enabled or Disabled.
29  * this is required since one L3 protocl can be enabled, but others not
30  */
33 
34 /**
35  * per-packet trace data
36  */
37 typedef struct l2_emulation_trace_t_
38 {
39  /* per-pkt trace data */
42 
43 /**
44  * Grouping of global data for the L2 emulation feature
45  */
46 typedef struct l2_emulation_main_t_
47 {
49 
51 
52  /**
53  * Per-interface vector of emulation configs
54  */
56 
57  /**
58  * Next nodes for L2 output features
59  */
60  u32 l2_input_feat_next[32];
62 
63 /**
64  * L2 Emulation is a feautre that is applied to L2 ports to 'extract'
65  * IP packets from the L2 path and inject them into the L3 path (i.e.
66  * into the appropriate ip[4|6]_input node).
67  * L3 routes in the table_id for that interface should then be configured
68  * as DVR routes, therefore the forwarded packet has the L2 header
69  * preserved and togehter the L3 routed system behaves like an L2 bridge.
70  */
71 extern void l2_emulation_enable (u32 sw_if_index);
73 
75 
76 #endif
77 
78 /*
79  * fd.io coding-style-patch-verification: ON
80  *
81  * Local Variables:
82  * eval: (c-set-style "gnu")
83  * End:
84  */
Grouping of global data for the L2 emulation feature.
Definition: l2e.h:46
l2_emulation_main_t l2_emulation_main
Definition: l2e.c:23
per-packet trace data
Definition: l2e.h:37
unsigned char u8
Definition: types.h:56
vl_api_interface_index_t sw_if_index
Definition: gre.api:59
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
void l2_emulation_enable(u32 sw_if_index)
L2 Emulation is a feautre that is applied to L2 ports to &#39;extract&#39; IP packets from the L2 path and in...
Definition: l2e.c:31
u32 l2_emulation_node_index
Definition: l2e.h:50
void l2_emulation_disable(u32 sw_if_index)
Definition: l2e.c:53
struct l2_emulation_trace_t_ l2_emulation_trace_t
per-packet trace data
u8 enabled
Enabled or Disabled.
Definition: l2e.h:31
Per-interface L2 configuration.
Definition: l2e.h:25
struct l2_emulation_main_t_ l2_emulation_main_t
Grouping of global data for the L2 emulation feature.
l2_emulation_t * l2_emulations
Per-interface vector of emulation configs.
Definition: l2e.h:55
struct l2_emulation_t_ l2_emulation_t
Per-interface L2 configuration.