1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/netdevice.h>
6 #include <linux/types.h>
7 #include <net/rtnetlink.h>
9 /* General GTP protocol related definitions. */
11 #define GTP0_PORT 3386
12 #define GTP1U_PORT 2152
14 /* GTP messages types */
15 #define GTP_ECHO_REQ 1 /* Echo Request */
16 #define GTP_ECHO_RSP 2 /* Echo Response */
19 #define GTPIE_RECOVERY 14
21 struct gtp0_header { /* According to GSM TS 09.60. */
30 } __attribute__ ((packed));
32 struct gtp1_header { /* According to 3GPP TS 29.060. */
37 } __attribute__ ((packed));
39 struct gtp1_header_long { /* According to 3GPP TS 29.060. */
49 /* GTP Information Element */
56 struct gtp0_header gtp0_h;
61 struct gtp1_header_long gtp1u_h;
65 struct gtp_pdu_session_info { /* According to 3GPP TS 38.415. */
70 static inline bool netif_is_gtp(const struct net_device *dev)
72 return dev->rtnl_link_ops &&
73 !strcmp(dev->rtnl_link_ops->kind, "gtp");
76 #define GTP1_F_NPDU 0x01
77 #define GTP1_F_SEQ 0x02
78 #define GTP1_F_EXTHDR 0x04
79 #define GTP1_F_MASK 0x07