~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/gtp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _GTP_H_
  3 #define _GTP_H_
  4 
  5 #include <linux/netdevice.h>
  6 #include <linux/types.h>
  7 #include <net/rtnetlink.h>
  8 
  9 /* General GTP protocol related definitions. */
 10 
 11 #define GTP0_PORT       3386
 12 #define GTP1U_PORT      2152
 13 
 14 /* GTP messages types */
 15 #define GTP_ECHO_REQ    1       /* Echo Request */
 16 #define GTP_ECHO_RSP    2       /* Echo Response */
 17 #define GTP_TPDU        255
 18 
 19 #define GTPIE_RECOVERY  14
 20 
 21 struct gtp0_header {    /* According to GSM TS 09.60. */
 22         __u8    flags;
 23         __u8    type;
 24         __be16  length;
 25         __be16  seq;
 26         __be16  flow;
 27         __u8    number;
 28         __u8    spare[3];
 29         __be64  tid;
 30 } __attribute__ ((packed));
 31 
 32 struct gtp1_header {    /* According to 3GPP TS 29.060. */
 33         __u8    flags;
 34         __u8    type;
 35         __be16  length;
 36         __be32  tid;
 37 } __attribute__ ((packed));
 38 
 39 struct gtp1_header_long {       /* According to 3GPP TS 29.060. */
 40         __u8    flags;
 41         __u8    type;
 42         __be16  length;
 43         __be32  tid;
 44         __be16  seq;
 45         __u8    npdu;
 46         __u8    next;
 47 } __packed;
 48 
 49 /* GTP Information Element */
 50 struct gtp_ie {
 51         __u8    tag;
 52         __u8    val;
 53 } __packed;
 54 
 55 struct gtp0_packet {
 56         struct gtp0_header gtp0_h;
 57         struct gtp_ie ie;
 58 } __packed;
 59 
 60 struct gtp1u_packet {
 61         struct gtp1_header_long gtp1u_h;
 62         struct gtp_ie ie;
 63 } __packed;
 64 
 65 struct gtp_pdu_session_info {   /* According to 3GPP TS 38.415. */
 66         u8      pdu_type;
 67         u8      qfi;
 68 };
 69 
 70 static inline bool netif_is_gtp(const struct net_device *dev)
 71 {
 72         return dev->rtnl_link_ops &&
 73                 !strcmp(dev->rtnl_link_ops->kind, "gtp");
 74 }
 75 
 76 #define GTP1_F_NPDU     0x01
 77 #define GTP1_F_SEQ      0x02
 78 #define GTP1_F_EXTHDR   0x04
 79 #define GTP1_F_MASK     0x07
 80 
 81 struct gtp_ext_hdr {
 82         __u8    len;
 83         __u8    data[];
 84 };
 85 
 86 #endif
 87 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php