Commit Graph

18 Commits

Author SHA1 Message Date
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
Pablo Neira Ayuso 448bce4ace tools: gtp-link: allow to delete links
Add delete command, useful for testing.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:16:59 +02:00
Pablo Neira Ayuso 517be89706 tools: gtp-tunnel: restore option parsing
Andreas accidentally broke parsing, restore it.

Fixes: ba77a20 ("gtp-rtnl: Split TID handling for GTPv0 and GTPv1")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:16:59 +02:00
Pablo Neira Ayuso 9438f72cc4 tools: gtp-tunnel: simplify this by using gtp_list_tunnel()
gtp_list_tunnel() is exported through the library, so use it instead of
opencode. This is a left-over from the early stage of development of
libgtpnl.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:07:29 +02:00
Pablo Neira Ayuso 6ae67dfe2c tools: gtp-tunnel: fix wrong MS address
This displays the SGSN address where we should show the MS address
instead.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:05:23 +02:00
Pablo Neira Ayuso b9f6ffea9c include: refresh linux header copies in the tree
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:03:25 +02:00
Andreas Schultz 17c816ff84 gtp-rtnl: Split TID handling for GTPv0 and GTPv1
GTPv1 tunnel use separate 32bit Tunnel Endpoint Identifier's for each
direction while GTPv0 uses only one 64bit Tunnel IDentifier.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-08 18:33:48 +02:00
Andreas Schultz af422a432c gtp-rtnl: real_ifname is not long needed, remove it
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-08 18:33:45 +02:00
Harald Welte 51b00a6c6c Add copright headers and license files, list Pablo as author
The kernel module still only listed me as author, even though Pablo
was doing most of the work on it after my initial incomplete version.
2014-04-03 09:37:38 -04:00
Pablo Neira Ayuso b0d712b055 libgtpnl: tools: gtp-tunnel: display teid in hexadecimal
So it is displayed like in wireshark.
2014-03-20 12:56:31 +01:00
Pablo Neira Ayuso 3a7dd0a215 libgtpnl: tools: fix compilation of gtp-link-add
A typo slipped through into that file and it stopped compiling.
2014-03-18 18:30:05 +01:00
Pablo Neira Ayuso 7aa2087885 allow to specify the interface name for the GTP device
We can use this to specify 'gtp0' from openggsn, so we make sure that
it always uses the same tunnel device on creation. If it already exists,
it will return EEXIST. This is used to skip the problem of lacking
NLM_F_ECHO in the rtnetlink link interface that allows us to know the
name of the gtp device that has been dynamically allocated from the
kernel.

And, finally, I don't find any use case for having more than one tunnel
device when integrating this with openggsn.

This patch also adjusts tools/gtp-link-add.c which needs some care, since
it is not yet using any of the library functions. This tools are likely
to be useful for troubleshooting and debugging.
2014-02-24 11:41:51 +01:00
Pablo Neira Ayuso f8ca765f8b tools: gtp-tunnel: fix accidentally swapped ms_addr and sgsn_addr
The output was swapping the ms and the sgsn addresses.
2014-02-22 22:38:05 +01:00
Pablo Neira Ayuso 14506665d9 add libgtpnl
This patch adds the libgtpnl library. Harald mentioned that he wanted
that the specific code that is added is well encapsulated, so let's
start a small library to interact with the GTP kernel module via netlink
interface.

This was done a bit while in the rush, so the interfaces are not nice
at all and the tools need to be ported on top of this library.

This library will be used to integrate openggsn with the GTP kernel
module.
2014-02-20 19:41:29 +01:00