Commit Graph

64 Commits

Author SHA1 Message Date
Pau Espin 118dd3ab17 .gitignore: Ignore new autofoo tmp files
Change-Id: Iaf853783679815e74b6b8e5f3e8631c53ed20613
2021-02-04 12:44:56 +01:00
Oliver Smith 5314ea43ac configure.ac: set -std=gnu11
Change-Id: Iea60698b4cb0f9c04a6f75cc4ca2ea5fbb84bae8
2021-01-27 17:31:54 +01:00
Pau Espin 102c81cf1b Enable parallel make in make distcheck
Related: OS#4421
Change-Id: I4fd59946c771906b5ec36e605fa8e6cbc648beec
2020-10-12 17:44:21 +02:00
Oliver Smith 01b2d940a0 contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build with
CentOS 8 etc.

Related: OS#4550
Change-Id: I5376fde96c7442eb70f49a2ce38f57a817a94f81
2020-05-19 15:19:35 +02:00
Oliver Smith 2f276eb3c6 contrib: import RPM spec
Copy the RPM spec file from:
https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly

Related: OS#4550
Change-Id: I3c9c989972cd223a46d28955edbfe4c69b7a7afb
2020-05-14 11:18:39 +02:00
Pau Espin fd3e98d334 Bump version: 1.2.0.2-d160-dirty → 1.2.1
Change-Id: Icc0dca37a88ce213f9b80598ab89570bd81cf0e7
2019-08-07 12:29:05 +02:00
Pau Espin 8639be5549 debian: Adapt package name to lib's current major version
Current LIBVERSION is 1:1:1 (current:revision:age), so major=current-age
makes it be major=0: libgtpnl0.

It can bee seen in current osmocom debian repos that libgtpnl1 package
contains libgtpnl.so.0.

Let's set package name accordingly.

Change-Id: I7d2fa50b6a17a598467f555558660ef2396c1744
2019-08-07 12:26:19 +02:00
Oliver Smith d160a73a41 contrib/jenkins.sh: run "make maintainer-clean"
Related: OS#3047
Change-Id: I20997b986b24ced9bb8d6d66a66d5ec2bafd00f2
2019-07-10 11:57:27 +02:00
Pau Espin bc71674c67 debian/rules: Don't overwrite .tarball-version
The .tarball-version file should contain the *source version* uniquely
identifying the git commit, and not the Debian package name.

With https://gerrit.osmocom.org/#/c/osmo-ci/+/10343/ there is a correct
.tarball-version file in the .tar.xz of the nightly source packages.

Related: OS#3449
Change-Id: I22dac8524ce8acb033dc9c72eab107999f49f975
2018-09-17 10:40:04 +02:00
Pau Espin f76e213543 Bump version: 1.1.0.5-b1ad-dirty → 1.2.0
Change-Id: I4b72bfb1c9c2413e84e9d8a1c5ebc19d476aada1
2018-05-02 16:37:14 +02:00
Pau Espin b1adcf72c9 configure.ac: Use git-version-gen to set VERSION
Change-Id: Id6535719321c8bb690936b5ae3ddcb9d8a9aa4d7
2018-05-02 16:36:27 +02:00
Pau Espin 392614c6ac debian/changelog: Set latest release as unstable
It was left as UNRELEASED but it was actually released (there's a tag on
it). Otherwise osmo-release.mk is fooled.

Change-Id: Iedd8311303274dd3be88a11314a61fbdd511679d
2018-05-02 16:36:26 +02:00
Pau Espin 16fa45f155 configure.ac: Depend on osmo-release.mk
The osmo-release.mk script can be found in libosmocore and it is used in
most osmocom related projects to help create new releases.

LIBVERSION is moved to src/Makefile.am since osmo-release.mk greps for
Makefile.am to find LIBVERSIOn changes. In any case, we don't need in
the global include makefile.

Change-Id: I5d163535c34369c74ece26574c8b1601bc1697b7
2018-05-02 16:36:24 +02:00
Harald Welte f86d9b40b1 Fix CTRL_ATTR_FAMILY_ID attribute size
This fixes the following kernel error message:
	netlink: 'osmo-ggsn': attribute type 1 has an invalid length.

This is due to CTRL_ATTR_FAMILY_ID being defined as a 16bit netlink
attribute, but us encoding it as u32:
	netlink/genetlink.c:    [CTRL_ATTR_FAMILY_ID]   = { .type = NLA_U16 },

let's properly encode it as 16bit and hence resolve the error message.

Change-Id: I41b2719ffc24d7a3420b5980f2a967264e606d91
Closes: OS#3216
2018-04-26 21:46:04 +02:00
Harald Welte cbcc25b2f0 Makefile: Build gtp-{link,tunnel} by default, but don't install them
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>
2018-02-16 08:21:19 +01:00
Harald Welte dd1e2f2641 Tag/Release v1.1.0
Change-Id: I18ac475c1591c4dc4c2953957a8bce8e73007251
2017-11-12 23:33:02 +09:00
Harald Welte 1ec4817dda add 'm4' subdirectory to .gitignore
Change-Id: I0207549ed00ad9c95ed64978046bb53ffe2634fe
2017-11-12 23:29:49 +09:00
Harald Welte 51c10b73fb Use release helper from libosmocore
Change-Id: I3b22a026ee61e88ed6d785182990cfcba0487bfe
Related: OS#1861
2017-11-12 23:25:00 +09:00
Harald Welte 03cb4c2d66 gtp_build_payload(): Support absent peer and SGSN address
When deleting a PDP context via "gtp-tunnel delete", we specify only
the gtp netdevice, the gtp version and the TID/TEI.  However, the
gtp_build_payload() function unconditionally created the netlink
attributes for GTPA_PEER_ADDRESS and GTPA_MS_ADDRESS, having their
addresses set to zero.  The kernel then tried to find a PDP context with
MS and PEER address of 0.0.0.0, and always failed with ENOENT.

The same problem also occurred with OsmoGGSN and OpenGGSN: PDP contexts
could be added but never removed.

The corresponding kernel change that requires this userland change
is the following commit introduced in 4.12-rc1:

commit d9e2dd122637034a0697bf268eed9233701b9dca
Author: Andreas Schultz <aschultz@tpip.net>
Date:   Thu Mar 9 17:43:00 2017 +0100

    gtp: unify genl_find_pdp and prepare for per socket lookup

Older kernels will work with libgtpnl both before and after this commit,
as they internally will simply disregard any attributes beyond TID/TEI.

Change-Id: Ie2ceb2cd6d2fb009bba01a05b5480c1ad775d619
2017-11-12 22:48:15 +09:00
Harald Welte 134d0a386d Add '--enable-sanitize' from other osmocom projects
Change-Id: Iac9ce76ce4ca5f5247bc42c16bb365d94cfde156
2017-11-12 22:48:15 +09:00
Harald Welte 66a60a13b6 Add contrib/jenkins.sh for jenkins build verification
Change-Id: I88a52f4adb08826f714bd32b1dfddd249f780c99
2017-11-12 13:47:09 +00:00
Harald Welte 4e3960c89f Add genl_socket_close() function
We've had genl_socket_open() but no corresponding genl_socket_close()
so far.  Let's fix that.
2017-11-08 16:15:59 +09:00
Harald Welte 977c233b74 Add Debian packaging information 2017-10-30 23:22:52 +01:00
Jonas Bonn 5204e01dd6 Provide declaration for struct in_addr 2017-03-24 15:39:17 +01:00
Jonas Bonn 6e9afbbc30 Rename netlink attribute
This aligns with a kernel patch that renames the netlink parameter
to emphasize that it refers to the remote peer which may be either
a GGSN or an SGSN.

The upstream kernel include file retains the legacy name as a define
but we don't need that in our internal library since we are no longer
using it anywhere.
2017-03-24 15:39:17 +01: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
Harald Welte 6d60a402b2 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 e17988ac7b add README.md file 2017-03-17 23:28:55 +01:00
junpei yoshino 345d687038 Fix look-up of GTP tunnel by TEI
I can't look tei by gtp-tunnel in GTPv1.
I write patch for libgtpnl.

head version

$./tools/gtp-tunnel add hoge v1 65535 65535 10.0.3.2 192.168.0.2
$./tools/gtp-tunnel list
version 1 tei 0/0 ms_addr 10.0.3.2 sgsn_addr 192.168.0.2

fixed version

$./tools/gtp-tunnel add hoge v1 65535 65535 10.0.3.2 192.168.0.2
$./tools/gtp-tunnel list
version 1 tei 65535/65535 ms_addr 10.0.3.2 sgsn_addr 192.168.0.2
2016-08-25 13:06:53 +09:00
Harald Welte 853753e7c6 mark as 1.0.1 after re-licensing and dist-check fix 2016-07-28 20:40:17 +02:00
Harald Welte 80c3ffafd0 fix 'make distcheck': Add internal.h to noinst_HEADERS 2016-07-28 20:39:24 +02:00
Harald Welte d2bb0bc506 Re-license the library as LGPLv2-or-later
This facilitates the use from other projects such as ASL licensed
software.  We think there is no point in others having to re-implement
the GTP specific message parsing/encoding on top of libmnl, which is
LGPL anyway.

Please note that the tools are still licensed under GPL, just the
library has been changed.
2016-07-28 20:34:45 +02: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 f69f8c7362 gtp-genl: fix wrong MS address
This displays the SGSN address where we should show the MS address
instead. And use inet_pton instead.
2016-05-10 18:16:52 +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
Pablo Neira Ayuso ee7bb1fb2e gtp: fix missing initialization of netns file descriptor
0 is a valid file descriptor and it is the default value after calloc(),
so set this -1 so we don't send it through netlink as used init_netns.

Fixes: 200b2f4 ("gtp-rtnl: and netns support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-10 18:01:48 +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
Andreas Schultz e962741554 gtp-rtnl: sync GTPA_FLOW nl attribute name from kernel to userspace
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-08 18:33:42 +02:00
Andreas Schultz 4977330369 gtp-rtnl: and netns support
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-08 18:33:40 +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 717797b885 build: link this library to libmnl
With this change, application don't need to pass to the linker -lmnl
which is the right way to make it since they don't directly refer to
mnl_* functions.
2014-03-21 13:54:53 +01:00
Pablo Neira Ayuso deb54083e2 gtp-rtnl: add gtp_dev_config function
This function allows us to set the gtp0 device configuration the route
to encapsulate all traffic that is addressed to the MS from the GGSN
2014-03-20 16:47:00 +01:00