aboutsummaryrefslogtreecommitdiffstats
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2024-02-21tools/gtp-tunnel: pass rc of gtp_del_tunnelOliver Smith1-2/+3
Don't exit with 0 if gtp_del_tunnel fails. Change-Id: I8046a57a5831e6bdee2ac37415380ce391c79c22
2024-02-19gtp-link: close sockets on errorOliver Smith1-7/+23
Avoid resource leaks. Fixes: CID#347578, CID#347579 Change-Id: I9c437de9712ebe568528b4c9ee1e89a4ba5cd5d1
2024-02-16gtp-link: allow to specify listener addressPablo Neira Ayuso1-14/+54
gtp-link add <device> <family> [--sgsn] [<address>] Allow to specify listener address, if not specified use ANY_ADDRESS. Change-Id: I7a9b64393fd68d58c2c158c0e85c0470be007f63
2024-02-15gtp-tunnel: display i_tei in helpPablo Neira Ayuso1-1/+1
display <tid|i_tei> in help message that is printed. Change-Id: I0aa78e654f23a2b6588ac8e1e5508e798caad1a7
2024-02-15gtp: add flags to gtp_tunnel objectPablo Neira Ayuso1-2/+3
Flags tells us what fields have been set in this object. This is required by ./gtp-tunnel del otherwise, build helper function adds the MS/UE address and kernel reports ENOENT, and tunnel identifier is ignored. Update gtp-tunnel tool to set flowid to zero in the GTP version 0 case, otherwise kernel reports EINVAL since now this flag is not ever set. Change-Id: I66677ab2d4de2c459ed9987c465fce6f059d6d93
2024-02-15gtp: provide interface to set familyPablo Neira Ayuso1-2/+12
Kernel now supports for TID/I_TEI to be used in both IPv4 and IPv6 GTP tunnels. This improves dualstack support for MS/UE so GTP traffic can be identified with the same tunnel identifier. Update gtp-tunnel to specify the family, since a tunnel is now identified by the following tuple [ version, identifier, family ]. Change-Id: I584d3997ffb89cd430dfda9615a4ce0ce517ab2a
2024-02-15gtp-link: set IPv6 socket onlyPablo Neira Ayuso1-0/+5
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-15gtp-link: add IPv6 supportPablo Neira Ayuso1-32/+97
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-14tools/gtp-tunnel: pass rc of gtp_add_tunnelOliver Smith1-2/+3
Don't exit with 0 if gtp_add_tunnel fails. Change-Id: If11b1fb4487a96dcb7f24d95794fea4e36202203
2023-10-24Add IPv6 supportOliver Smith1-12/+23
Implement IPv6 in libgtpnl and the gtp-tunnel testing tool. Allow to combine: - GTPA_MS_ADDRESS and GTPA_PEER_ADDR6 - GTPA_MS_ADDR6 and GTPA_PEER_ADDRESS to specify IPv4-in-IPv6-GTP and IPv6-in-IPv4-GTP in the tunnel declaration from control plane. This patch is based on multiple patches from Pablo in OS#6123. I decided to squash them to directly implement v4-in-v6 and vice versa, instead of implementing another variant first and then changing it again. Co-developed-by: Pablo Neira Ayuso <pablo@netfilter.org> Related: OS#6096 Change-Id: If864c9170f74af52a95cbc4cdb1b866e0309306b
2023-02-03fix memleak on del_tunnel() failureNeels Janosch Hofmeyr1-0/+2
Related: CID#307542 Change-Id: Ie29840a7518435447acf48f12e81fc520308a265
2022-09-07tools/gtp-link: add --sgsn to usageOliver Smith1-1/+2
Change-Id: I995754812b8418757a8df9ab2a3c208d61f16a8c
2022-09-07tools/gtp-tunnel: fix del usageOliver Smith1-1/+1
Change-Id: Iba5afd0cdb1588def3d865900ae02773dfd654e2
2021-02-12install gtp-tunnel and gtp-link toolsGabriel Ganne1-1/+1
This eases quick setup for demonstration purposes. Change-Id: I674c463989bc1529bfe132b7ec0df7a0052169df
2018-02-16Makefile: Build gtp-{link,tunnel} by default, but don't install themHarald Welte1-2/+2
They used to be in check_programs, but then this would only build them during 'make check' which not everyone knows or is using. Change-Id: Idd2b3a66e5968686e6bbff59dbc89b7673def8dd Inspired-by: Thomas Boros <tomas.boros92@gmail.com>
2017-03-24Add support for SGSN role via IFLA_GTP_ROLEHarald Welte1-3/+9
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-24gtl-link.c: Actually use libgtpnl, don't hand-coded netlink msgHarald Welte1-55/+3
The command line tool should use libgtpnl, rather than replicating code for generating a netlink message.
2016-05-10tools: gtp-link: bind to GTP UDP socketsPablo Neira Ayuso1-1/+36
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-10tools: silence compilation warningsPablo Neira Ayuso1-1/+1
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-10tools: gtp-link: rename file now that we support deletion commandPablo Neira Ayuso2-3/+3
Better name for what this simple tool does. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10tools: gtp-link: allow to delete linksPablo Neira Ayuso1-5/+19
Add delete command, useful for testing. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10tools: gtp-tunnel: restore option parsingPablo Neira Ayuso1-0/+2
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-10tools: gtp-tunnel: simplify this by using gtp_list_tunnel()Pablo Neira Ayuso1-81/+3
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-10tools: gtp-tunnel: fix wrong MS addressPablo Neira Ayuso1-2/+2
This displays the SGSN address where we should show the MS address instead. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10include: refresh linux header copies in the treePablo Neira Ayuso2-4/+6
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-08gtp-rtnl: Split TID handling for GTPv0 and GTPv1Andreas Schultz3-78/+95
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-08gtp-rtnl: real_ifname is not long needed, remove itAndreas Schultz1-3/+2
Signed-off-by: Andreas Schultz <aschultz@tpip.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2014-04-03Add copright headers and license files, list Pablo as authorHarald Welte3-0/+66
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-03-20libgtpnl: tools: gtp-tunnel: display teid in hexadecimalPablo Neira Ayuso1-1/+1
So it is displayed like in wireshark.
2014-03-18libgtpnl: tools: fix compilation of gtp-link-addPablo Neira Ayuso1-1/+1
A typo slipped through into that file and it stopped compiling.
2014-02-24allow to specify the interface name for the GTP devicePablo Neira Ayuso1-2/+9
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-22tools: gtp-tunnel: fix accidentally swapped ms_addr and sgsn_addrPablo Neira Ayuso1-2/+2
The output was swapping the ms and the sgsn addresses.
2014-02-20add libgtpnlPablo Neira Ayuso4-0/+319
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.