^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _GTP_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _GTP_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) /* General GTP protocol related definitions. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define GTP0_PORT 3386
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define GTP1U_PORT 2152
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define GTP_TPDU 255
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct gtp0_header { /* According to GSM TS 09.60. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) __u8 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) __u8 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) __be16 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) __be16 seq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __be16 flow;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) __u8 number;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) __u8 spare[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) __be64 tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) } __attribute__ ((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct gtp1_header { /* According to 3GPP TS 29.060. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) __u8 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) __u8 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) __be16 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __be32 tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) } __attribute__ ((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define GTP1_F_NPDU 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define GTP1_F_SEQ 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define GTP1_F_EXTHDR 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define GTP1_F_MASK 0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #endif