1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018-2019 Intel Corporation
11 * VXLAN-related definitions
16 #include <rte_byteorder.h>
24 /** VXLAN default port. */
25 #define RTE_VXLAN_DEFAULT_PORT 4789
26 #define RTE_VXLAN_GPE_DEFAULT_PORT 4790
29 * VXLAN protocol header.
30 * Contains the 8-bit flag, 24-bit VXLAN Network Identifier and
31 * Reserved fields (24 bits and 8 bits)
33 struct rte_vxlan_hdr {
34 rte_be32_t vx_flags; /**< flag (8) + Reserved (24). */
35 rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */
38 /** VXLAN tunnel header length. */
39 #define RTE_ETHER_VXLAN_HLEN \
40 (sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr))
44 * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
45 * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
46 * Identifier and Reserved fields (16 bits and 8 bits).
48 struct rte_vxlan_gpe_hdr {
49 uint8_t vx_flags; /**< flag (8). */
50 uint8_t reserved[2]; /**< Reserved (16). */
51 uint8_t proto; /**< next-protocol (8). */
52 rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */
55 /** VXLAN-GPE tunnel header length. */
56 #define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \
57 sizeof(struct rte_vxlan_gpe_hdr))
59 /* VXLAN-GPE next protocol types */
60 #define RTE_VXLAN_GPE_TYPE_IPV4 1 /**< IPv4 Protocol. */
61 #define RTE_VXLAN_GPE_TYPE_IPV6 2 /**< IPv6 Protocol. */
62 #define RTE_VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
63 #define RTE_VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
64 #define RTE_VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
65 #define RTE_VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
66 #define RTE_VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
73 #endif /* RTE_VXLAN_H_ */