Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 459aa660 authored by Pablo Neira's avatar Pablo Neira Committed by David S. Miller
Browse files

gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)

This is an initial implementation of a netdev driver for GTP datapath
(GTP-U) v0 and v1, according to the GSM TS 09.60 and 3GPP TS 29.060
standards. This tunneling protocol is used to prevent subscribers from
accessing mobile carrier core network infrastructure.

This implementation requires a GGSN userspace daemon that implements the
signaling protocol (GTP-C), such as OpenGGSN [1]. This userspace daemon
updates the PDP context database that represents active subscriber
sessions through a genetlink interface.

For more context on this tunneling protocol, you can check the slides
that were presented during the NetDev 1.1 [2].

Only IPv4 is supported at this time.

[1] http://git.osmocom.org/openggsn/
[2] http://www.netdevconf.org/1.1/proceedings/slides/schultz-welte-osmocom-gtp.pdf



Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c047c3b1
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -192,6 +192,23 @@ config GENEVE
	  To compile this driver as a module, choose M here: the module
	  To compile this driver as a module, choose M here: the module
	  will be called geneve.
	  will be called geneve.


config GTP
	tristate "GPRS Tunneling Protocol datapath (GTP-U)"
	depends on INET && NET_UDP_TUNNEL
	select NET_IP_TUNNEL
	---help---
	  This allows one to create gtp virtual interfaces that provide
	  the GPRS Tunneling Protocol datapath (GTP-U). This tunneling protocol
	  is used to prevent subscribers from accessing mobile carrier core
	  network infrastructure. This driver requires a userspace software that
	  implements the signaling protocol (GTP-C) to update its PDP context
	  base, such as OpenGGSN <http://git.osmocom.org/openggsn/). This
	  tunneling protocol is implemented according to the GSM TS 09.60 and
	  3GPP TS 29.060 standards.

	  To compile this drivers as a module, choose M here: the module
	  wil be called gtp.

config MACSEC
config MACSEC
	tristate "IEEE 802.1AE MAC-level encryption (MACsec)"
	tristate "IEEE 802.1AE MAC-level encryption (MACsec)"
	select CRYPTO
	select CRYPTO
+1 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ obj-$(CONFIG_VETH) += veth.o
obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
obj-$(CONFIG_VXLAN) += vxlan.o
obj-$(CONFIG_VXLAN) += vxlan.o
obj-$(CONFIG_GENEVE) += geneve.o
obj-$(CONFIG_GENEVE) += geneve.o
obj-$(CONFIG_GTP) += gtp.o
obj-$(CONFIG_NLMON) += nlmon.o
obj-$(CONFIG_NLMON) += nlmon.o
obj-$(CONFIG_NET_VRF) += vrf.o
obj-$(CONFIG_NET_VRF) += vrf.o


drivers/net/gtp.c

0 → 100644
+1364 −0

File added.

Preview size limit exceeded, changes collapsed.

include/net/gtp.h

0 → 100644
+34 −0
Original line number Original line Diff line number Diff line
#ifndef _GTP_H_
#define _GTP_H

/* General GTP protocol related definitions. */

#define GTP0_PORT	3386
#define GTP1U_PORT	2152

#define GTP_TPDU	255

struct gtp0_header {	/* According to GSM TS 09.60. */
	__u8	flags;
	__u8	type;
	__be16	length;
	__be16	seq;
	__be16	flow;
	__u8	number;
	__u8	spare[3];
	__be64	tid;
} __attribute__ ((packed));

struct gtp1_header {	/* According to 3GPP TS 29.060. */
	__u8	flags;
	__u8	type;
	__be16	length;
	__be32	tid;
} __attribute__ ((packed));

#define GTP1_F_NPDU	0x01
#define GTP1_F_SEQ	0x02
#define GTP1_F_EXTHDR	0x04
#define GTP1_F_MASK	0x07

#endif
+1 −0
Original line number Original line Diff line number Diff line
@@ -141,6 +141,7 @@ header-y += gfs2_ondisk.h
header-y += gigaset_dev.h
header-y += gigaset_dev.h
header-y += gpio.h
header-y += gpio.h
header-y += gsmmux.h
header-y += gsmmux.h
header-y += gtp.h
header-y += hdlcdrv.h
header-y += hdlcdrv.h
header-y += hdlc.h
header-y += hdlc.h
header-y += hdreg.h
header-y += hdreg.h
Loading