DPDK  24.03.0
rte_vxlan.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018-2019 Intel Corporation
3  */
4 
5 #ifndef _RTE_VXLAN_H_
6 #define _RTE_VXLAN_H_
7 
14 #include <stdint.h>
15 
16 #include <rte_byteorder.h>
17 #include <rte_udp.h>
18 
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
25 #define RTE_VXLAN_DEFAULT_PORT 4789
26 #define RTE_VXLAN_GPE_DEFAULT_PORT 4790
27 
33 __extension__ /* no named member in struct */
34 struct rte_vxlan_hdr {
35  union {
36  struct {
39  };
40  struct {
41  uint8_t flags;
42  uint8_t rsvd0[3];
43  uint8_t vni[3];
44  uint8_t rsvd1;
45  };
46  };
47 } __rte_packed;
48 
50 #define RTE_ETHER_VXLAN_HLEN \
51  (sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr))
52 
53 
59 __extension__ /* no named member in struct */
61  union {
62  struct {
63  uint8_t vx_flags;
64  uint8_t reserved[2];
65  uint8_t protocol;
67  };
68  struct {
69  uint8_t flags;
70  uint8_t rsvd0[2];
71  uint8_t proto;
72  uint8_t vni[3];
73  uint8_t rsvd1;
74  };
75  };
76 } __rte_packed;
77 
79 #define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \
80  sizeof(struct rte_vxlan_gpe_hdr))
81 
82 /* VXLAN-GPE next protocol types */
83 #define RTE_VXLAN_GPE_TYPE_IPV4 1
84 #define RTE_VXLAN_GPE_TYPE_IPV6 2
85 #define RTE_VXLAN_GPE_TYPE_ETH 3
86 #define RTE_VXLAN_GPE_TYPE_NSH 4
87 #define RTE_VXLAN_GPE_TYPE_MPLS 5
88 #define RTE_VXLAN_GPE_TYPE_GBP 6
89 #define RTE_VXLAN_GPE_TYPE_VBNG 7
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif /* RTE_VXLAN_H_ */
uint8_t rsvd0[3]
Definition: rte_vxlan.h:42
uint32_t rte_be32_t
rte_be32_t vx_flags
Definition: rte_vxlan.h:37
rte_be32_t vx_vni
Definition: rte_vxlan.h:66
uint8_t rsvd1
Definition: rte_vxlan.h:44
uint8_t vx_flags
Definition: rte_vxlan.h:63
#define __rte_packed
Definition: rte_common.h:102
uint8_t vni[3]
Definition: rte_vxlan.h:43
uint8_t flags
Definition: rte_vxlan.h:41
rte_be32_t vx_vni
Definition: rte_vxlan.h:38
uint8_t protocol
Definition: rte_vxlan.h:65