DPDK  21.02.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
21 extern "C" {
22 #endif
23 
30 __extension__
31 struct rte_gtp_hdr {
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;
55 } __rte_packed;
56 
57 /* Optional word of GTP header, present if any of E, S, PN is set. */
58 struct rte_gtp_hdr_ext_word {
59  rte_be16_t sqn;
60  uint8_t npdu;
61  uint8_t next_ext;
62 } __rte_packed;
63 
65 #define RTE_ETHER_GTP_HLEN \
66  (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
67 /* GTP next protocal type */
68 #define RTE_GTP_TYPE_IPV4 0x40
69 #define RTE_GTP_TYPE_IPV6 0x60
70 /* GTP destination port number */
71 #define RTE_GTPC_UDP_PORT 2123
72 #define RTE_GTPU_UDP_PORT 2152
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* RTE_GTP_H_ */
#define __rte_packed
Definition: rte_common.h:84
uint8_t ver
Definition: rte_gtp.h:41
uint8_t e
Definition: rte_gtp.h:38
uint8_t res1
Definition: rte_gtp.h:39
uint32_t rte_be32_t
uint8_t msg_type
Definition: rte_gtp.h:52
rte_be32_t teid
Definition: rte_gtp.h:54
uint8_t s
Definition: rte_gtp.h:37
rte_be16_t plen
Definition: rte_gtp.h:53
uint8_t pn
Definition: rte_gtp.h:36
uint8_t gtp_hdr_info
Definition: rte_gtp.h:33
uint8_t pt
Definition: rte_gtp.h:40
uint16_t rte_be16_t