9
0
Fork 0
Commit Graph

84 Commits

Author SHA1 Message Date
Harald Welte 6045efb642 sgsnemu: Fix gengetopt package name
gengetopt by default picks the program name from PACKAGE (autotools),
which is openggsn and is obviously wrong in case of sgsnemu.

After this patch, "sgsnemu --help" no longer shows "openggsn" but
"sgsnemu" at the top of the help text.

Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37
2017-09-24 10:55:26 +08:00
Harald Welte 078bc097fc sgsnemu: Re-generate cmdline.[ch] using gengetopt
This will replace the manual additions to cmdline.[ch] with
auto-generated code from gengetopt.  We need to fix-up the RAT Type in
sgsnemu.c as the manually-added code diverged from what gengetopt
generates.

Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c
2017-09-24 10:47:50 +08:00
Harald Welte 3cce289e4b sgsnemu: Fix up gengetopt file for --norecovery
In commit 3a4c67b4bf we introduced the
--norecovery command line option, but this was apparently done by
manually editing the C source code rather than adding it to the .ggo
and letting gengetopt do its magic.  Let's fix this up.

Change-Id: I1698280a699b17cea65651c3736ef149aba7e432
2017-09-24 10:47:50 +08:00
Harald Welte b2a9aae35a sgsnemu: Fix up gengetopt file for RAI
In commit 41af5691ef we introduced the
--rai command line options, but this was apparently done by
manually editing the C source code rather than adding it to the .ggo
and letting gengetopt do its magic.  Let's fix this up.

Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644
2017-09-24 10:47:50 +08:00
Harald Welte 9523482193 sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisv
In commit 944dce3e66 we introduced various
command line options, but this was apparently done by manually editing
the C source code rather than adding it to the .ggo and letting
gengetopt do its magic.  Let's fix this up.

Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a
2017-09-24 10:47:50 +08:00
Harald Welte 74aa8b701c sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008
In commit 11a398fbc3 we introduced the
--qose{1,2,3,4} command line options, but this was apparently done by
manually editing the C source code rather than adding it to the .ggo
and letting gengetopt do its magic.  Let's fix this up.

Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20
2017-09-24 10:47:50 +08:00
Harald Welte 15ed792154 sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supported
It seems like modern gengetopt no longer supports 'unsigned int'
argument types, and we need to use 'int' instead.  tested with 2.22.6

Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e
2017-09-24 10:47:50 +08:00
Harald Welte 1b6e8e7b5e Remove __sun__ code that is unmaintained
We haven nobody maintaining this platform, let's remove it.

In fact, only Linux and FreeBSD are part of the jenkins build tests,
so even Apple/MacOS is up for disposal.  However, as it's more
popular, let's keep the code.

Change-Id: Id6b8179259bacade52c39f96e688f828eff164ac
2017-09-05 23:13:14 +02:00
Harald Welte a0d281db1c IPv6 support for user IP
This patch enables the use of IPv6 PDP contexts.  The phone will
have to request an IPv6 End-user-Address, and the GGSN will have
to be configured for an IPv6 pool.

The outer transport-layer IP between SGSN and GGSN must still be
IPv4, it is not modified by this patch

Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774
2017-08-09 22:09:34 +02:00
Harald Welte 63ebccdfe3 lib/tun.h: Remove non-endian-safe redefinition of IP header
We can simply use 'struct iphdr' from netinet/ip.h to achieve
the same goal (and be portable).

Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32
2017-08-09 22:09:34 +02:00
Harald Welte d12eab9c4e ippool: Add IPv6 support to IP pool implementation
Extend the IP pool implementation to be able to manage both pools
of 32bit addresses (IPv4) as well as pools of 128bit addresses (IPv6)

Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8
2017-08-09 22:08:57 +02:00
bjovan a8f71eb24e Code formatted to be in line with formatting rules.
Change-Id: I546dc0a8d814527b9a96943a52f2f6b700285167
2017-02-27 09:56:28 +01:00
Ruben Undheim cc077ae0bc Description: Fix some typos in the man pages and in the binary 2016-05-24 23:31:47 +02:00
Andreas Schultz 10abfba949 convert literal APN name to protocol encoded version before use
The definition of the APN field format in GTPv1 is hidden in a chain
of documents.

3GPP TS 29.060 (the GTPv1-C specification) Section 7.7.30:

> The Access Point Name contains a logical name (see 3GPP TS 23.060 [4]).
> It is coded as in the value part defined in 3GPP TS 24.008

3GPP TS 24.008 Section 10.5.6.1:

> The value part is defined in 3GPP TS 23.003.

3GPP TS 23.003 Section 9.1:

> The APN consists of one or more labels. Each label is coded as a one
> octet length field followed by that number of octets coded as 8 bit
> ASCII characters

This converts a literal APN (e.g. Label1.Label2.Label3) to a structured
field (e.g. \006Label1\006Label2\006Label3)

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
2015-11-13 17:16:03 +01:00
Neels Hofmeyr 041824dfc8 sgsnemu: improve an error message 2015-11-02 14:27:44 +01:00
Holger Hans Peter Freyther 9c7fd8edc4 logging: Switch to using libosmocore logging for all the code 2014-12-04 16:51:15 +01:00
Holger Hans Peter Freyther e071e30937 build: Remove subdir-objects as it breaks make distclean
We are not using this option in any of our projects and it is breaking
make distclean. Remove the option for now.

make[2]: Entering directory `/openggsn-0.91/_build/ggsn'
Makefile:307: ../lib/.deps/getopt.Po: No such file or directory
Makefile:308: ../lib/.deps/getopt1.Po: No such file or directory
make[2]: *** No rule to make target `../lib/.deps/getopt1.Po'.  Stop.
2012-11-06 13:59:59 +01:00
Harald Welte bed35df298 Convert all code to Linux coding style
After so many years of silence, we don't expect the original author to
return to the project.  To make things a bit simpler for us, we convert
the coding style to what we are used to (Linux style).

The conversion was made using the 'Lindent' script which is part of the
Linux kernel.
2011-11-02 13:06:18 +01:00
Harald Welte 3a4c67b4bf optionally do not send recovery with sgsnemu
According to 3GPP TS 29.060 recovery is optional, add command line option --norecovery to remove this field in sgsnemu

Signed-off-by: Yann BONNAMY <yann_bonnamy@yahoo.fr>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
2011-10-07 18:45:54 +02:00
Harald Welte 41af5691ef Add optional RAI Field
Routing Area Information is an optional Field described in 3GPP TS 29.060 7.7.3
it can be added with command line option rai, in the dot separated format MCC.MNC.LAC.RAC
example :  --rai 208.10.65535.255

Signed-off-by: Yann BONNAMY <yann_bonnamy@yahoo.fr>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
2011-10-07 18:42:34 +02:00
Yann BONNAMY 11a398fbc3 sgsnemu support for QoS as defined in 3GPP TS 24.008
this patch allows to tweak any bit of the QoS field of the Create PDP context generated by sgsnemu , aligned with 10.5.6.5 of 3GPP TS 24.008 V10.0.0 (2010-09)

QoS field can be extended to "lenght 12" with option --qose1, as seen in real life on UMTS networks.
extension to lenght 13, 15 and 17 can be done with option --qose2, --qose3, --qose4, never seen IRL but allows to test 3GPP compliance of GGSN.

Signed-off-by: Yann BONNAMY <yann_bonnamy@yahoo.fr>
2011-10-07 18:34:56 +02:00
Harald Welte 6fc42401b9 properly build a library for the content of the lib directory 2011-05-10 17:44:39 +02:00
Yann BONNAMY 944dce3e66 Add support for GTP IE's from 3GPP R7
This adds support for the followng new GTP Information Elements:
	RAT_TYPE, USER_LOC, MS_TZ, IMEI_SV

Furthermore, it allows to specify those fields as sgsnemu command line
arguments.
2010-10-29 17:07:44 +02:00
Emmanuel Bretelle 2a103687b6 Move common sgsnemu/ggsn files to directory "lib"
Some files like in sgsnemu and ggsn directory where exactly the same.
They are now moved to the same directory for easier maintenance

Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +02:00
Emmanuel Bretelle 2a7cad57ef Fixe compilation warning
Relevant output of make:

sgsnemu.c: In function ‘process_options’:
sgsnemu.c:443: warning: pointer targets in passing argument 1 of
‘strncpy’ differ in signedness
/usr/include/bits/string3.h:120: note: expected ‘char * __restrict__’
but argument is of type ‘unsigned char *’

Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +02:00
Harald Welte 841dd49086 fix 'make distcheck': add lookup.h to Makefile.am 2010-05-24 11:02:33 +02:00
Harald Welte 1b3e577017 Use newer gengetopt which also frees memory
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811521&group_id=68956&atid=522957
2010-05-04 11:13:56 +02:00
Harald Welte f54a1f4d43 Fix various compiler warnings throughout the code
Mostly signed/unsigned and typecasting issues

Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811517&group_id=68956&atid=522957
2010-05-04 11:08:38 +02:00
Harald Welte c5ef88ce71 remove autotools-generated files
All those will be re-generated by "autoreconf -i" anyway, so
there's no point in keeping them in the repository.

Also, the 'bootstrap' script is no longer working with recent
autotools versions anyway.
2010-05-04 10:48:23 +02:00
jjako 9f26b95f30 Fixed APN bug 2005-03-14 22:03:05 +00:00
jjako acba8e6c62 Added new version of autotools 2005-03-14 21:53:10 +00:00
jjako e31b2401ab 0.84 release 2004-12-30 23:07:42 +00:00
jjako 3544abfaad 0.84 2004-12-30 20:32:34 +00:00
jjako c49cb30222 Added lookup.c 2004-12-30 16:40:17 +00:00
jjako ada9ffaf9e QA on ippool 2004-12-30 16:39:11 +00:00
jjako bd937b7290 Minor fix 2004-12-30 16:22:42 +00:00
jjako 163b455be8 Fixed delete route on freebsd et. al. 2004-12-30 15:33:58 +00:00
jjako 0fe0df0079 qos length bugfix and apple support plus header cleanup 2004-09-17 11:30:40 +00:00
jjako 77edc82781 Improved configure script under Solaris 2004-09-10 17:19:31 +00:00
jjako c3213960d4 Hash table bugfix and improved logging 2004-09-09 20:23:50 +00:00
jjako 1a51df7111 Added selmode 2004-07-20 08:30:21 +00:00
jjako 7e051d37bb Charging option 2004-05-27 20:06:36 +00:00
jjako b62c3dd3c4 Fix on PPP PCO length and charging characteristics required flag. 2004-05-27 18:51:55 +00:00
jjako c6762cfc27 Solaris tun interface 2004-04-28 14:52:58 +00:00
jjako 1f1586458f Added IP address alias capability for FreeBSD 2004-02-05 20:39:57 +00:00
jjako 409b855839 tun.c cleanup and support for setting multiple addresses on FreeBSD 2004-02-04 22:57:41 +00:00
jjako 3cfb81cee9 Lookup in ippool made static 2004-01-29 09:13:55 +00:00
jjako 1ea6634851 Added FreeBSD route capability 2004-01-28 09:27:34 +00:00
jjako 243bfe643f FreeBSD port 2004-01-26 23:06:05 +00:00
jjako d48c5ff86b Fixed long constant warning on FreeBSD 2004-01-26 22:25:40 +00:00