DPDK 21.11.0
rte_gtp.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 1982, 1986, 1990, 1993
3 * The Regents of the University of California.
4 * Copyright(c) 2010-2014 Intel Corporation.
5 * All rights reserved.
6 */
7
8#ifndef _RTE_GTP_H_
9#define _RTE_GTP_H_
10
17#include <stdint.h>
18#include <rte_byteorder.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
30__extension__
32 union {
33 uint8_t gtp_hdr_info;
34 struct {
35#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
36 uint8_t pn:1;
37 uint8_t s:1;
38 uint8_t e:1;
39 uint8_t res1:1;
40 uint8_t pt:1;
41 uint8_t ver:3;
42#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
43 uint8_t ver:3;
44 uint8_t pt:1;
45 uint8_t res1:1;
46 uint8_t e:1;
47 uint8_t s:1;
48 uint8_t pn:1;
49#endif
50 };
51 };
52 uint8_t msg_type;
56
57/* Optional word of GTP header, present if any of E, S, PN is set. */
58struct rte_gtp_hdr_ext_word {
59 rte_be16_t sqn;
60 uint8_t npdu;
61 uint8_t next_ext;
63
68__extension__
70 uint8_t ext_hdr_len;
71#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
72 uint8_t type:4;
73 uint8_t qmp:1;
74 uint8_t pad:3;
75 uint8_t spare:2;
76 uint8_t qfi:6;
77#else
78 uint8_t qfi:6;
79 uint8_t spare:2;
80 uint8_t pad:3;
81 uint8_t qmp:1;
82 uint8_t type:4;
83#endif
84 uint8_t data[0];
86
91__extension__
93 uint8_t ext_hdr_len;
94#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
95 uint8_t type:4;
96 uint8_t qmp:1;
97 uint8_t snp:1;
98 uint8_t spare_dl1:2;
99 uint8_t ppp:1;
100 uint8_t rqi:1;
101 uint8_t qfi:6;
102#else
103 uint8_t qfi:6;
104 uint8_t rqi:1;
105 uint8_t ppp:1;
106 uint8_t spare_dl1:2;
107 uint8_t snp:1;
108 uint8_t type:4;
109#endif
110 uint8_t data[0];
112
117__extension__
119 uint8_t ext_hdr_len;
120#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
121 uint8_t type:4;
122 uint8_t qmp:1;
123 uint8_t dl_delay_ind:1;
124 uint8_t ul_delay_ind:1;
125 uint8_t snp:1;
126 uint8_t n_delay_ind:1;
127 uint8_t spare_ul2:1;
128 uint8_t qfi:6;
129#else
130 uint8_t qfi:6;
131 uint8_t spare_ul2:1;
132 uint8_t n_delay_ind:1;
133 uint8_t snp:1;
134 uint8_t ul_delay_ind:1;
135 uint8_t dl_delay_ind:1;
136 uint8_t qmp:1;
137 uint8_t type:4;
138#endif
139 uint8_t data[0];
141
143#define RTE_ETHER_GTP_HLEN \
144 (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
145/* GTP next protocol type */
146#define RTE_GTP_TYPE_IPV4 0x40
147#define RTE_GTP_TYPE_IPV6 0x60
148/* GTP destination port number */
149#define RTE_GTPC_UDP_PORT 2123
150#define RTE_GTPU_UDP_PORT 2152
152#ifdef __cplusplus
153}
154#endif
155
156#endif /* RTE_GTP_H_ */
uint32_t rte_be32_t
uint16_t rte_be16_t
#define __rte_packed
Definition: rte_common.h:86
uint8_t gtp_hdr_info
Definition: rte_gtp.h:33
rte_be16_t plen
Definition: rte_gtp.h:53
uint8_t pt
Definition: rte_gtp.h:40
uint8_t s
Definition: rte_gtp.h:37
uint8_t e
Definition: rte_gtp.h:38
rte_be32_t teid
Definition: rte_gtp.h:54
uint8_t res1
Definition: rte_gtp.h:39
uint8_t ver
Definition: rte_gtp.h:41
uint8_t pn
Definition: rte_gtp.h:36
uint8_t msg_type
Definition: rte_gtp.h:52
uint8_t ext_hdr_len
Definition: rte_gtp.h:93
uint8_t data[0]
Definition: rte_gtp.h:110
uint8_t ul_delay_ind
Definition: rte_gtp.h:124
uint8_t dl_delay_ind
Definition: rte_gtp.h:123
uint8_t data[0]
Definition: rte_gtp.h:139