vxlan: multiarch optimization of vxlan
[vpp.git] / extras / deprecated / plugins / l2e / l2e.h
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    */
31   u8 enabled;
32 } l2_emulation_t;
33
34 /**
35  * per-packet trace data
36  */
37 typedef struct l2_emulation_trace_t_
38 {
39   /* per-pkt trace data */
40   u8 extracted;
41 } l2_emulation_trace_t;
42
43 /**
44  * Grouping of global data for the L2 emulation feature
45  */
46 typedef struct l2_emulation_main_t_
47 {
48   u16 msg_id_base;
49
50   u32 l2_emulation_node_index;
51
52   /**
53    * Per-interface vector of emulation configs
54    */
55   l2_emulation_t *l2_emulations;
56
57   /**
58    * Next nodes for L2 output features
59    */
60   u32 l2_input_feat_next[32];
61 } l2_emulation_main_t;
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);
72 extern void l2_emulation_disable (u32 sw_if_index);
73
74 extern l2_emulation_main_t l2_emulation_main;
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  */