FD.io VPP  v16.06
Vector Packet Processing
vxlan_gpe_packet.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_vxlan_gpe_packet_h
16 #define included_vxlan_gpe_packet_h
17 
18 /*
19  * From draft-quinn-vxlan-gpe-03.txt
20  *
21  * 0 1 2 3
22  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
23  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
24  * |R|R|R|R|I|P|R|O|Ver| Reserved |Next Protocol |
25  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
26  * | VXLAN Network Identifier (VNI) | Reserved |
27  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
28  *
29  * I Bit: Flag bit 4 indicates that the VNI is valid.
30  *
31  * P Bit: Flag bit 5 is defined as the Next Protocol bit. The P bit
32  * MUST be set to 1 to indicate the presence of the 8 bit next
33  * protocol field.
34  *
35  * O Bit: Flag bit 7 is defined as the O bit. When the O bit is set to 1,
36  *
37  * the packet is an OAM packet and OAM processing MUST occur. The OAM
38  * protocol details are out of scope for this document. As with the
39  * P-bit, bit 7 is currently a reserved flag in VXLAN.
40  *
41  * VXLAN-gpe bits 8 and 9 are defined as version bits. These bits are
42  * reserved in VXLAN. The version field is used to ensure backward
43  * compatibility going forward with future VXLAN-gpe updates.
44  *
45  * The initial version for VXLAN-gpe is 0.
46  *
47  * This draft defines the following Next Protocol values:
48  *
49  * 0x1 : IPv4
50  * 0x2 : IPv6
51  * 0x3 : Ethernet
52  * 0x4 : Network Service Header [NSH]
53  */
54 
55 #define foreach_vxlan_gpe_protocol \
56 _ (0x01, IP4) \
57 _ (0x02, IP6) \
58 _ (0x03, ETHERNET) \
59 _ (0x04, NSH)
60 
61 
62 typedef enum {
63 #define _(n,f) VXLAN_GPE_PROTOCOL_##f = n,
65 #undef _
67 
68 typedef struct {
72  /* see vxlan_gpe_protocol_t */
76 
77 #define VXLAN_GPE_FLAGS_I 0x08
78 #define VXLAN_GPE_FLAGS_P 0x04
79 #define VXLAN_GPE_FLAGS_O 0x01
80 #define VXLAN_GPE_VERSION 0x0
81 
82 #endif /* included_vxlan_gpe_packet_h */
#define foreach_vxlan_gpe_protocol
unsigned int u32
Definition: types.h:88
unsigned char u8
Definition: types.h:56
vxlan_gpe_protocol_t