FD.io VPP
v16.06
Vector Packet Processing
Main Page
Related Pages
Data Structures
Source
Files
Symbols
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
vxlan_gpe.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_vnet_vxlan_gpe_h
16
#define included_vnet_vxlan_gpe_h
17
18
#include <
vppinfra/error.h
>
19
#include <
vppinfra/hash.h
>
20
#include <
vnet/vnet.h
>
21
#include <
vnet/ip/ip.h
>
22
#include <
vnet/l2/l2_input.h
>
23
#include <
vnet/ethernet/ethernet.h
>
24
#include <
vnet/vxlan-gpe/vxlan_gpe_packet.h
>
25
#include <
vnet/ip/ip4_packet.h
>
26
#include <
vnet/ip/udp.h
>
27
28
29
typedef
CLIB_PACKED
(
struct
{
30
ip4_header_t
ip4;
/* 20 bytes */
31
udp_header_t
udp;
/* 8 bytes */
32
vxlan_gpe_header_t
vxlan;
/* 8 bytes */
33
}) ip4_vxlan_gpe_header_t;
34
35
typedef
CLIB_PACKED
(
struct
{
36
/*
37
* Key fields: local remote, vni
38
* all fields in NET byte order
39
*/
40
union
{
41
struct
{
42
u32
local;
43
u32
remote;
44
u32
vni;
/* shifted 8 bits */
45
u32
pad;
46
};
47
u64
as_u64[2];
48
};
49
}) vxlan_gpe_tunnel_key_t;
50
51
typedef
struct
{
52
/* Rewrite string. $$$$ embed vnet_rewrite header */
53
u8
*
rewrite
;
54
55
/* encapsulated protocol */
56
u8
protocol
;
57
58
/* tunnel src and dst addresses */
59
ip4_address_t
local
;
60
ip4_address_t
remote
;
61
62
/* FIB indices */
63
u32
encap_fib_index
;
/* tunnel partner lookup here */
64
u32
decap_fib_index
;
/* inner IP lookup here */
65
66
/* vxlan VNI in HOST byte order, shifted left 8 bits */
67
u32
vni
;
68
69
/* vnet intfc hw/sw_if_index */
70
u32
hw_if_index
;
71
u32
sw_if_index
;
72
73
}
vxlan_gpe_tunnel_t
;
74
75
#define foreach_vxlan_gpe_input_next \
76
_(DROP, "error-drop") \
77
_(IP4_INPUT, "ip4-input") \
78
_(IP6_INPUT, "ip6-input") \
79
_(ETHERNET_INPUT, "ethernet-input")
80
81
typedef
enum
{
82
#define _(s,n) VXLAN_GPE_INPUT_NEXT_##s,
83
foreach_vxlan_gpe_input_next
84
#undef _
85
VXLAN_GPE_INPUT_N_NEXT
,
86
}
vxlan_gpe_input_next_t
;
87
88
typedef
enum
{
89
#define vxlan_gpe_error(n,s) VXLAN_GPE_ERROR_##n,
90
#include <
vnet/vxlan-gpe/vxlan_gpe_error.def
>
91
#undef vxlan_gpe_error
92
VXLAN_GPE_N_ERROR
,
93
}
vxlan_gpe_input_error_t
;
94
95
typedef
struct
{
96
/* vector of encap tunnel instances */
97
vxlan_gpe_tunnel_t
*
tunnels
;
98
99
/* lookup tunnel by key */
100
uword
*
vxlan_gpe_tunnel_by_key
;
101
102
/* Free vlib hw_if_indices */
103
u32
*
free_vxlan_gpe_tunnel_hw_if_indices
;
104
105
/* show device instance by real device instance */
106
u32
*
dev_inst_by_real
;
107
108
/* convenience */
109
vlib_main_t
*
vlib_main
;
110
vnet_main_t
*
vnet_main
;
111
}
vxlan_gpe_main_t
;
112
113
vxlan_gpe_main_t
vxlan_gpe_main
;
114
115
extern
vlib_node_registration_t
vxlan_gpe_encap_node
;
116
extern
vlib_node_registration_t
vxlan_gpe_input_node
;
117
118
u8
*
format_vxlan_gpe_encap_trace
(
u8
* s, va_list * args);
119
120
typedef
struct
{
121
u8
is_add
;
122
ip4_address_t
local,
remote
;
123
u8
protocol
;
124
u32
encap_fib_index
;
125
u32
decap_fib_index
;
126
u32
decap_next_index
;
127
u32
vni
;
128
}
vnet_vxlan_gpe_add_del_tunnel_args_t
;
129
130
131
int
vnet_vxlan_gpe_add_del_tunnel
132
(
vnet_vxlan_gpe_add_del_tunnel_args_t
*
a
,
u32
* sw_if_indexp);
133
134
135
136
137
138
#endif
/* included_vnet_vxlan_gpe_h */
vnet_vxlan_gpe_add_del_tunnel_args_t::protocol
u8 protocol
Definition:
vxlan_gpe.h:123
vxlan_gpe_encap_node
vlib_node_registration_t vxlan_gpe_encap_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_node)
Definition:
encap.c:408
a
a
Definition:
bitmap.h:393
error.h
vxlan_gpe_error.def
format_vxlan_gpe_encap_trace
u8 * format_vxlan_gpe_encap_trace(u8 *s, va_list *args)
Definition:
encap.c:50
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
VXLAN_GPE_N_ERROR
Definition:
vxlan_gpe.h:92
ip.h
udp_header_t
Definition:
udp_packet.h:43
vxlan_gpe_main_t::vnet_main
vnet_main_t * vnet_main
Definition:
vxlan_gpe.h:110
hash.h
vxlan_gpe_main
vxlan_gpe_main_t vxlan_gpe_main
Definition:
vxlan_gpe.h:113
CLIB_PACKED
typedef CLIB_PACKED(struct{ip4_header_t ip4;udp_header_t udp;vxlan_gpe_header_t vxlan;}) ip4_vxlan_gpe_header_t
vxlan_gpe_tunnel_t::local
ip4_address_t local
Definition:
vxlan_gpe.h:59
VXLAN_GPE_INPUT_N_NEXT
Definition:
vxlan_gpe.h:85
l2_input.h
vnet_vxlan_gpe_add_del_tunnel_args_t::remote
ip4_address_t remote
Definition:
vxlan_gpe.h:122
vxlan_gpe_tunnel_t::remote
ip4_address_t remote
Definition:
vxlan_gpe.h:60
vnet_vxlan_gpe_add_del_tunnel_args_t::vni
u32 vni
Definition:
vxlan_gpe.h:127
u64
unsigned long u64
Definition:
types.h:89
vnet_vxlan_gpe_add_del_tunnel_args_t::is_add
u8 is_add
Definition:
vxlan_gpe.h:121
vxlan_gpe_tunnel_t::rewrite
u8 * rewrite
Definition:
vxlan_gpe.h:53
vxlan_gpe_packet.h
ip4_address_t
Definition:
ip4_packet.h:49
ethernet.h
ip4_packet.h
vxlan_gpe_tunnel_t
Definition:
vxlan_gpe.h:51
vnet_vxlan_gpe_add_del_tunnel
int vnet_vxlan_gpe_add_del_tunnel(vnet_vxlan_gpe_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
Definition:
vxlan_gpe.c:180
vxlan_gpe_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
vxlan_gpe.h:109
vxlan_gpe_tunnel_t::protocol
u8 protocol
Definition:
vxlan_gpe.h:56
vnet_vxlan_gpe_add_del_tunnel_args_t::encap_fib_index
u32 encap_fib_index
Definition:
vxlan_gpe.h:124
vnet.h
vxlan_gpe_tunnel_t::vni
u32 vni
Definition:
vxlan_gpe.h:67
vnet_vxlan_gpe_add_del_tunnel_args_t
Definition:
vxlan_gpe.h:120
vxlan_gpe_input_error_t
vxlan_gpe_input_error_t
Definition:
vxlan_gpe.h:88
vnet_vxlan_gpe_add_del_tunnel_args_t::decap_fib_index
u32 decap_fib_index
Definition:
vxlan_gpe.h:125
foreach_vxlan_gpe_input_next
#define foreach_vxlan_gpe_input_next
Definition:
vxlan_gpe.h:75
vnet_main_t
Definition:
vnet.h:58
u32
unsigned int u32
Definition:
types.h:88
vxlan_gpe_main_t
Definition:
vxlan_gpe.h:95
vnet_vxlan_gpe_add_del_tunnel_args_t::decap_next_index
u32 decap_next_index
Definition:
vxlan_gpe.h:126
vxlan_gpe_main_t::tunnels
vxlan_gpe_tunnel_t * tunnels
Definition:
vxlan_gpe.h:97
uword
u64 uword
Definition:
types.h:112
vxlan_gpe_tunnel_t::decap_fib_index
u32 decap_fib_index
Definition:
vxlan_gpe.h:64
u8
unsigned char u8
Definition:
types.h:56
vlib_main_t
Definition:
main.h:59
vxlan_gpe_header_t
Definition:
vxlan_gpe_packet.h:68
vxlan_gpe_tunnel_t::hw_if_index
u32 hw_if_index
Definition:
vxlan_gpe.h:70
vxlan_gpe_main_t::vxlan_gpe_tunnel_by_key
uword * vxlan_gpe_tunnel_by_key
Definition:
vxlan_gpe.h:100
vxlan_gpe_input_next_t
vxlan_gpe_input_next_t
Definition:
vxlan_gpe.h:81
vxlan_gpe_tunnel_t::encap_fib_index
u32 encap_fib_index
Definition:
vxlan_gpe.h:63
vxlan_gpe_tunnel_t::sw_if_index
u32 sw_if_index
Definition:
vxlan_gpe.h:71
vxlan_gpe_main_t::dev_inst_by_real
u32 * dev_inst_by_real
Definition:
vxlan_gpe.h:106
ip4_header_t
Definition:
ip4_packet.h:104
udp.h
vxlan_gpe_main_t::free_vxlan_gpe_tunnel_hw_if_indices
u32 * free_vxlan_gpe_tunnel_hw_if_indices
Definition:
vxlan_gpe.h:103
vxlan_gpe_input_node
vlib_node_registration_t vxlan_gpe_input_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_input_node)
Definition:
decap.c:429
vnet
vnet
vxlan-gpe
vxlan_gpe.h
Generated on Thu Sep 1 2016 09:11:49 for FD.io VPP by
1.8.11