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:
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.
17 * @brief VXLAN GPE packet header structure
20 #ifndef included_vxlan_gpe_packet_h
21 #define included_vxlan_gpe_packet_h
24 * From draft-quinn-vxlan-gpe-03.txt
27 * 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
28 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
29 * |R|R|R|R|I|P|R|O|Ver| Reserved |Next Protocol |
30 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
31 * | VXLAN Network Identifier (VNI) | Reserved |
32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 * I Bit: Flag bit 4 indicates that the VNI is valid.
36 * P Bit: Flag bit 5 is defined as the Next Protocol bit. The P bit
37 * MUST be set to 1 to indicate the presence of the 8 bit next
40 * O Bit: Flag bit 7 is defined as the O bit. When the O bit is set to 1,
42 * the packet is an OAM packet and OAM processing MUST occur. The OAM
43 * protocol details are out of scope for this document. As with the
44 * P-bit, bit 7 is currently a reserved flag in VXLAN.
46 * VXLAN-gpe bits 8 and 9 are defined as version bits. These bits are
47 * reserved in VXLAN. The version field is used to ensure backward
48 * compatibility going forward with future VXLAN-gpe updates.
50 * The initial version for VXLAN-gpe is 0.
52 * This draft defines the following Next Protocol values:
57 * 0x4 : Network Service Header [NSH]
61 * @brief VXLAN GPE support inner protocol definition.
67 #define foreach_vxlan_gpe_protocol \
76 * @brief Struct for VXLAN GPE support inner protocol definition.
84 #define _(n,f) VXLAN_GPE_PROTOCOL_##f = n,
85 foreach_vxlan_gpe_protocol
87 VXLAN_GPE_PROTOCOL_MAX,
88 } vxlan_gpe_protocol_t;
91 * @brief VXLAN GPE Header definition
95 /** Version and Reserved */
99 /** see vxlan_gpe_protocol_t */
101 /** VNI and Reserved */
103 } vxlan_gpe_header_t;
105 #define VXLAN_GPE_FLAGS_I 0x08
106 #define VXLAN_GPE_FLAGS_P 0x04
107 #define VXLAN_GPE_FLAGS_O 0x01
108 #define VXLAN_GPE_VERSION 0x0
110 #endif /* included_vxlan_gpe_packet_h */