FD.io VPP
v16.06
Vector Packet Processing
Main Page
Related Pages
Data Structures
Source
Files
Symbols
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 <
vnet/pg/pg.h
>
21
#include <
vppinfra/error.h
>
22
#include <
vnet/ip/ip.h
>
23
#include <
vnet/l2/l2_input.h
>
24
#include <
vnet/l2/l2_output.h
>
25
#include <
vnet/api_errno.h
>
26
#include <
vnet/ethernet/ethernet.h
>
27
28
typedef
struct
{
29
/*
30
* Let: rewrite_header.sw_if_index = tx_fib_index or ~0.
31
* rewrite_header.next_index = L2_XCRW_NEXT_XXX
32
*/
33
vnet_declare_rewrite
(
VLIB_BUFFER_PRE_DATA_SIZE
);
34
}
l2_xcrw_adjacency_t
;
35
36
typedef
struct
{
37
/* L2 interface */
38
u32
l2_sw_if_index
;
39
40
/* Tunnel interface */
41
u32
tunnel_sw_if_index
;
/* This field remains set in freed pool elts */
42
43
}
l2_xcrw_tunnel_t
;
44
45
typedef
struct
{
46
u32
cached_next_index
;
47
48
/* Vector of cross-connect rewrites */
49
l2_xcrw_adjacency_t
*
adj_by_sw_if_index
;
50
51
/* Pool of xcrw tunnels */
52
l2_xcrw_tunnel_t
*
tunnels
;
53
54
/* Tunnel index by tunnel sw_if_index */
55
uword
*
tunnel_index_by_l2_sw_if_index
;
56
57
/* convenience variables */
58
vlib_main_t
*
vlib_main
;
59
vnet_main_t
*
vnet_main
;
60
}
l2_xcrw_main_t
;
61
62
typedef
enum
{
63
L2_XCRW_NEXT_DROP
,
64
L2_XCRW_N_NEXT
,
65
}
l2_xcrw_next_t
;
66
67
#define foreach_l2_xcrw_error \
68
_(DROP, "Packets dropped") \
69
_(FWD, "Packets forwarded")
70
71
typedef
enum
{
72
#define _(sym,str) L2_XCRW_ERROR_##sym,
73
foreach_l2_xcrw_error
74
#undef _
75
L2_XCRW_N_ERROR
,
76
}
l2_xcrw_error_t
;
77
78
#endif
/* __included_l2_xcrw_h__ */
l2_xcrw_adjacency_t
Definition:
l2_xcrw.h:28
error.h
l2_xcrw_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
l2_xcrw.h:58
ip.h
L2_XCRW_NEXT_DROP
Definition:
l2_xcrw.h:63
l2_xcrw_tunnel_t
Definition:
l2_xcrw.h:36
l2_input.h
api_errno.h
l2_xcrw_error_t
l2_xcrw_error_t
Definition:
l2_xcrw.h:71
l2_xcrw_tunnel_t::l2_sw_if_index
u32 l2_sw_if_index
Definition:
l2_xcrw.h:38
VLIB_BUFFER_PRE_DATA_SIZE
#define VLIB_BUFFER_PRE_DATA_SIZE
Definition:
buffer.h:56
ethernet.h
l2_xcrw_main_t::tunnels
l2_xcrw_tunnel_t * tunnels
Definition:
l2_xcrw.h:52
l2_xcrw_main_t
Definition:
l2_xcrw.h:45
l2_xcrw_main_t::vnet_main
vnet_main_t * vnet_main
Definition:
l2_xcrw.h:59
vnet.h
l2_xcrw_main_t::cached_next_index
u32 cached_next_index
Definition:
l2_xcrw.h:46
foreach_l2_xcrw_error
#define foreach_l2_xcrw_error
Definition:
l2_xcrw.h:67
l2_xcrw_next_t
l2_xcrw_next_t
Definition:
l2_xcrw.h:62
vlib.h
pg.h
vnet_main_t
Definition:
vnet.h:58
u32
unsigned int u32
Definition:
types.h:88
uword
u64 uword
Definition:
types.h:112
vnet_declare_rewrite
#define vnet_declare_rewrite(total_bytes)
Definition:
rewrite.h:82
vlib_main_t
Definition:
main.h:59
l2_output.h
L2_XCRW_N_ERROR
Definition:
l2_xcrw.h:75
l2_xcrw_tunnel_t::tunnel_sw_if_index
u32 tunnel_sw_if_index
Definition:
l2_xcrw.h:41
L2_XCRW_N_NEXT
Definition:
l2_xcrw.h:64
l2_xcrw_main_t::adj_by_sw_if_index
l2_xcrw_adjacency_t * adj_by_sw_if_index
Definition:
l2_xcrw.h:49
l2_xcrw_main_t::tunnel_index_by_l2_sw_if_index
uword * tunnel_index_by_l2_sw_if_index
Definition:
l2_xcrw.h:55
vnet
vnet
l2
l2_xcrw.h
Generated on Thu Sep 1 2016 09:11:42 for FD.io VPP by
1.8.11