DPDK  24.11.0-rc3
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 
26 __extension__
27 struct rte_gtp_hdr {
28  union {
29  uint8_t gtp_hdr_info;
30  struct {
31 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
32  uint8_t pn:1;
33  uint8_t s:1;
34  uint8_t e:1;
35  uint8_t res1:1;
36  uint8_t pt:1;
37  uint8_t ver:3;
38 #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
39  uint8_t ver:3;
40  uint8_t pt:1;
41  uint8_t res1:1;
42  uint8_t e:1;
43  uint8_t s:1;
44  uint8_t pn:1;
45 #endif
46  };
47  };
48  uint8_t msg_type;
51 } __rte_packed;
52 
53 /* Optional word of GTP header, present if any of E, S, PN is set. */
54 struct rte_gtp_hdr_ext_word {
55  rte_be16_t sqn;
56  uint8_t npdu;
57  uint8_t next_ext;
58 } __rte_packed;
59 
64 __extension__
66  uint8_t ext_hdr_len;
67 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
68  uint8_t type:4;
69  uint8_t qmp:1;
70  uint8_t pad:3;
71  uint8_t spare:2;
72  uint8_t qfi:6;
73 #else
74  uint8_t pad:3;
75  uint8_t qmp:1;
76  uint8_t type:4;
77  uint8_t qfi:6;
78  uint8_t spare:2;
79 #endif
80  uint8_t data[0];
81 } __rte_packed;
82 
87 __extension__
89  uint8_t ext_hdr_len;
90 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
91  uint8_t type:4;
92  uint8_t qmp:1;
93  uint8_t snp:1;
94  uint8_t spare_dl1:2;
95  uint8_t ppp:1;
96  uint8_t rqi:1;
97  uint8_t qfi:6;
98 #else
99  uint8_t spare_dl1:2;
100  uint8_t snp:1;
101  uint8_t qmp:1;
102  uint8_t type:4;
103  uint8_t qfi:6;
104  uint8_t rqi:1;
105  uint8_t ppp:1;
106 #endif
107  uint8_t data[0];
108 } __rte_packed;
109 
114 __extension__
116  uint8_t ext_hdr_len;
117 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
118  uint8_t type:4;
119  uint8_t qmp:1;
120  uint8_t dl_delay_ind:1;
121  uint8_t ul_delay_ind:1;
122  uint8_t snp:1;
123  uint8_t n_delay_ind:1;
124  uint8_t spare_ul2:1;
125  uint8_t qfi:6;
126 #else
127  uint8_t snp:1;
128  uint8_t ul_delay_ind:1;
129  uint8_t dl_delay_ind:1;
130  uint8_t qmp:1;
131  uint8_t type:4;
132  uint8_t qfi:6;
133  uint8_t spare_ul2:1;
134  uint8_t n_delay_ind:1;
135 #endif
136  uint8_t data[0];
137 } __rte_packed;
138 
140 #define RTE_ETHER_GTP_HLEN \
141  (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
142 /* GTP next protocol type */
143 #define RTE_GTP_TYPE_IPV4 0x40
144 #define RTE_GTP_TYPE_IPV6 0x60
145 /* GTP destination port number */
146 #define RTE_GTPC_UDP_PORT 2123
147 #define RTE_GTPU_UDP_PORT 2152
149 #endif /* RTE_GTP_H_ */
uint8_t ul_delay_ind
Definition: rte_gtp.h:121
uint8_t ver
Definition: rte_gtp.h:37
uint8_t e
Definition: rte_gtp.h:34
uint8_t res1
Definition: rte_gtp.h:35
uint32_t rte_be32_t
uint8_t msg_type
Definition: rte_gtp.h:48
uint8_t dl_delay_ind
Definition: rte_gtp.h:120
rte_be32_t teid
Definition: rte_gtp.h:50
#define __rte_packed
Definition: rte_common.h:108
uint8_t s
Definition: rte_gtp.h:33
rte_be16_t plen
Definition: rte_gtp.h:49
uint8_t pn
Definition: rte_gtp.h:32
uint8_t ext_hdr_len
Definition: rte_gtp.h:89
uint8_t gtp_hdr_info
Definition: rte_gtp.h:29
uint8_t pt
Definition: rte_gtp.h:36
uint16_t rte_be16_t