Commit Graph

9 Commits

Author SHA1 Message Date
Pablo Neira Ayuso 9fab0cc515 gtp-link: allow to specify listener address
gtp-link add <device> <family> [--sgsn] [<address>]

Allow to specify listener address, if not specified use ANY_ADDRESS.

Change-Id: I7a9b64393fd68d58c2c158c0e85c0470be007f63
2024-02-16 15:53:49 +01:00
Pablo Neira Ayuso 9911f6bfeb gtp-link: set IPv6 socket only
GTP driver bails out for IPv4-mapped-IPv6 socket with EADDRNOAVAIL,
to prevent issues with setsockopt IPV6_ADDRFORM.

GTP control plane checks that tunnel family matches the socket family
for this GTP device, ie. there is a 1:1 mapping between the socket
listener and the device which determines the supported IP tunnel header.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Change-Id: I887a107657059adeb14ae425576ae7ea9018f762
2024-02-15 15:41:42 +01:00
Pablo Neira Ayuso 38b5e239d6 gtp-link: add IPv6 support
Update tool to allow to specify family that is used for the outer network
header in GTP tunnels.

./gtp-link add gtp0 ip 			# IPv4 GGSN
./gtp-link add gtp0 ip --sgsn		# IPv4 SGSN
./gtp-link add gtp0 ip6 		# IPv6 GGSN
./gtp-link add gtp0 ip6 --sgsn		# IPv6 SGSN

Change-Id: I201c32a1bf9a2ab7a228287590bc7ec19c4997b9
2024-02-15 15:14:08 +01:00
Oliver Smith 6954da78fb tools/gtp-link: add --sgsn to usage
Change-Id: I995754812b8418757a8df9ab2a3c208d61f16a8c
2022-09-07 15:48:16 +02:00
Harald Welte 3bf55c32be Add support for SGSN role via IFLA_GTP_ROLE
This patch corresponds to a Linux kernel patch extending the kernel GTP
to also cover the SGSN role, not just the GGSN role.  In order to keep
the API/behavior compatible, gtp_dev_create() will continue to create
GGSN-side tunnels, while a new gtp_dev_create_sgsn() is introduced to
create SGSN-side tunnels.

Signed-off-by: Harald Welte <laforge@gnumonks.org>
2017-03-24 15:39:17 +01:00
Harald Welte a7a4df366b gtl-link.c: Actually use libgtpnl, don't hand-coded netlink msg
The command line tool should use libgtpnl, rather than replicating code
for generating a netlink message.
2017-03-24 15:39:17 +01:00
Pablo Neira Ayuso 50826a5667 tools: gtp-link: bind to GTP UDP sockets
So we can fully test packet decapsulation without a full blown openggsn
setup by injecting packets and using this simple tool.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:19:49 +02:00
Pablo Neira Ayuso 7b30c5526a tools: silence compilation warnings
CC       gtp-link.o
gtp-link.c: In function ‘main’:
gtp-link.c:48:40: warning: unused variable ‘flags’ [-Wunused-variable]
  unsigned int seq, portid, change = 0, flags = 0;
                                        ^
gtp-link.c:48:28: warning: unused variable ‘change’ [-Wunused-variable]
  unsigned int seq, portid, change = 0, flags = 0;
                            ^
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:16:59 +02:00
Pablo Neira Ayuso 18c9c768f1 tools: gtp-link: rename file now that we support deletion command
Better name for what this simple tool does.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:16:59 +02:00