DPDK
25.03.0-rc1
lib
net
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_packed_begin
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
;
49
rte_be16_t
plen
;
50
rte_be32_t
teid
;
51
} __rte_packed_end;
52
53
/* Optional word of GTP header, present if any of E, S, PN is set. */
54
struct
__rte_packed_begin
rte_gtp_hdr_ext_word {
55
rte_be16_t
sqn;
56
uint8_t npdu;
57
uint8_t next_ext;
58
} __rte_packed_end;
59
64
__extension__
65
struct
__rte_packed_begin
rte_gtp_psc_generic_hdr
{
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_end;
82
87
__extension__
88
struct
__rte_packed_begin
rte_gtp_psc_type0_hdr
{
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_end;
109
114
__extension__
115
struct
__rte_packed_begin
rte_gtp_psc_type1_hdr
{
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_end;
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_ */
rte_byteorder.h
rte_be32_t
uint32_t rte_be32_t
Definition:
rte_byteorder.h:117
rte_be16_t
uint16_t rte_be16_t
Definition:
rte_byteorder.h:116
__rte_packed_begin
#define __rte_packed_begin
Definition:
rte_common.h:124
rte_gtp_hdr
Definition:
rte_gtp.h:27
rte_gtp_hdr::gtp_hdr_info
uint8_t gtp_hdr_info
Definition:
rte_gtp.h:29
rte_gtp_hdr::plen
rte_be16_t plen
Definition:
rte_gtp.h:49
rte_gtp_hdr::pt
uint8_t pt
Definition:
rte_gtp.h:36
rte_gtp_hdr::s
uint8_t s
Definition:
rte_gtp.h:33
rte_gtp_hdr::e
uint8_t e
Definition:
rte_gtp.h:34
rte_gtp_hdr::teid
rte_be32_t teid
Definition:
rte_gtp.h:50
rte_gtp_hdr::res1
uint8_t res1
Definition:
rte_gtp.h:35
rte_gtp_hdr::ver
uint8_t ver
Definition:
rte_gtp.h:37
rte_gtp_hdr::pn
uint8_t pn
Definition:
rte_gtp.h:32
rte_gtp_hdr::msg_type
uint8_t msg_type
Definition:
rte_gtp.h:48
rte_gtp_psc_generic_hdr
Definition:
rte_gtp.h:65
rte_gtp_psc_generic_hdr::qmp
uint8_t qmp
Definition:
rte_gtp.h:69
rte_gtp_psc_generic_hdr::type
uint8_t type
Definition:
rte_gtp.h:68
rte_gtp_psc_generic_hdr::spare
uint8_t spare
Definition:
rte_gtp.h:71
rte_gtp_psc_generic_hdr::qfi
uint8_t qfi
Definition:
rte_gtp.h:72
rte_gtp_psc_generic_hdr::ext_hdr_len
uint8_t ext_hdr_len
Definition:
rte_gtp.h:66
rte_gtp_psc_generic_hdr::pad
uint8_t pad
Definition:
rte_gtp.h:70
rte_gtp_psc_type0_hdr
Definition:
rte_gtp.h:88
rte_gtp_psc_type0_hdr::qmp
uint8_t qmp
Definition:
rte_gtp.h:92
rte_gtp_psc_type0_hdr::type
uint8_t type
Definition:
rte_gtp.h:91
rte_gtp_psc_type0_hdr::rqi
uint8_t rqi
Definition:
rte_gtp.h:96
rte_gtp_psc_type0_hdr::qfi
uint8_t qfi
Definition:
rte_gtp.h:97
rte_gtp_psc_type0_hdr::spare_dl1
uint8_t spare_dl1
Definition:
rte_gtp.h:94
rte_gtp_psc_type0_hdr::ext_hdr_len
uint8_t ext_hdr_len
Definition:
rte_gtp.h:89
rte_gtp_psc_type0_hdr::snp
uint8_t snp
Definition:
rte_gtp.h:93
rte_gtp_psc_type0_hdr::ppp
uint8_t ppp
Definition:
rte_gtp.h:95
rte_gtp_psc_type1_hdr
Definition:
rte_gtp.h:115
rte_gtp_psc_type1_hdr::qmp
uint8_t qmp
Definition:
rte_gtp.h:119
rte_gtp_psc_type1_hdr::ul_delay_ind
uint8_t ul_delay_ind
Definition:
rte_gtp.h:121
rte_gtp_psc_type1_hdr::n_delay_ind
uint8_t n_delay_ind
Definition:
rte_gtp.h:123
rte_gtp_psc_type1_hdr::type
uint8_t type
Definition:
rte_gtp.h:118
rte_gtp_psc_type1_hdr::qfi
uint8_t qfi
Definition:
rte_gtp.h:125
rte_gtp_psc_type1_hdr::ext_hdr_len
uint8_t ext_hdr_len
Definition:
rte_gtp.h:116
rte_gtp_psc_type1_hdr::spare_ul2
uint8_t spare_ul2
Definition:
rte_gtp.h:124
rte_gtp_psc_type1_hdr::dl_delay_ind
uint8_t dl_delay_ind
Definition:
rte_gtp.h:120
rte_gtp_psc_type1_hdr::snp
uint8_t snp
Definition:
rte_gtp.h:122
Generated by
1.9.4