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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef included_vnet_l2_emulation_h
17 #define included_vnet_l2_emulation_h
19 #include <vlib/vlib.h>
20 #include <vnet/vnet.h>
23 * Per-interface L2 configuration
25 typedef struct l2_emulation_t_
28 * Enabled or Disabled.
29 * this is required since one L3 protocl can be enabled, but others not
35 * per-packet trace data
37 typedef struct l2_emulation_trace_t_
39 /* per-pkt trace data */
41 } l2_emulation_trace_t;
44 * Grouping of global data for the L2 emulation feature
46 typedef struct l2_emulation_main_t_
50 u32 l2_emulation_node_index;
53 * Per-interface vector of emulation configs
55 l2_emulation_t *l2_emulations;
58 * Next nodes for L2 output features
60 u32 l2_input_feat_next[32];
61 } l2_emulation_main_t;
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.
71 extern void l2_emulation_enable (u32 sw_if_index);
72 extern void l2_emulation_disable (u32 sw_if_index);
74 extern l2_emulation_main_t l2_emulation_main;
79 * fd.io coding-style-patch-verification: ON
82 * eval: (c-set-style "gnu")