Commit Graph

767 Commits

Author SHA1 Message Date
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
Yann BONNAMY ad18ccb9df RAI fix
fix ggsn handling of create pdp context when RAI is included and Recovery field is absent

Signed-off-by: Yann BONNAMY <yann_bonnamy@yahoo.fr>
2011-10-07 18:34:02 +02:00
Isabelle Kraemer fe50409675 GTP: Fix bug in update PDP context procedure
I use OpenGGSN to create/update/delete PDP context and I found a bug
in the implementation: when the sgsnemu sends an "update PDP context"
request, it receives back a "create PDP context" response. Below is
the correction I made, I hope it helps.
2011-07-29 16:41:38 +02:00
Harald Welte f5cbbc9558 debian: add openggsn example config files 2011-05-13 21:14:40 +02:00
Harald Welte 142af72b13 debian packaging: add missing openggsn.install file 2011-05-13 21:10:52 +02:00
Harald Welte 38c8f6da35 remove autotools-generated INSTALL file 2011-05-10 17:45:07 +02:00
Harald Welte 6fc42401b9 properly build a library for the content of the lib directory 2011-05-10 17:44:39 +02:00
Harald Welte b502255b8f debian: update to source format git 2011-05-10 17:44:20 +02:00
Harald Welte 629e986ea4 libgtp: introduce cb_recovery() callback
The cb_recovery() callback enables the user application to detect
a change in the restart counter and thus start the appropriate
recovery procedures.
2010-12-24 20:58:09 +01: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 87490d7fa9 IFNAMSIZ includes terminating 0
http://www.delorie.com/gnu/docs/glibc/libc_308.html
thus reverting devname to IFNAMSIZ
and making sure (*tun)->devname[IFNAMSIZ-1] = 0;

Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +02:00
Emmanuel Bretelle 4e56c83be2 fixed compilation warning against gcc-4.4
* Change arguments of tun_gifindex from:
int tun_gifindex(struct tun_t *this, int *index)
to
int tun_gifindex(struct tun_t *this, __u32 *index)
solves:
../lib/tun.c: In function ‘tun_addaddr’:
../lib/tun.c:265: warning: pointer targets in passing argument 2 of
‘tun_gifindex’ differ in signedness
../lib/tun.c:88: note: expected ‘int *’ but argument is of type ‘__u32
*’

* handle system return code and returns -1 if system failed
solves:
../lib/tun.c: In function ‘tun_runscript’:
../lib/tun.c:895: warning: ignoring return value of ‘system’, declared
with attribute warn_unused_result

* do not dereference a pointer cast and use it as an lvalue
see
http://www.mail-archive.com/svn-commits@lists.digium.com/msg50931.html
solves:
../lib/tun.c: In function ‘tun_route’:
../lib/tun.c:533: warning: dereferencing pointer ‘({anonymous})’ does
break strict-aliasing rules
../lib/tun.c:533: note: initialized from here
../lib/tun.c:534: warning: dereferencing pointer ‘({anonymous})’ does
break strict-aliasing rules
../lib/tun.c:534: note: initialized from here
../lib/tun.c:535: warning: dereferencing pointer ‘({anonymous})’ does
break strict-aliasing rules
../lib/tun.c:535: note: initialized from here
../lib/tun.c: In function ‘tun_setaddr’:
../lib/tun.c:435: warning: dereferencing pointer ‘({anonymous})’ does
break strict-aliasing rules
../lib/tun.c:435: note: initialized from here
../lib/tun.c:452: warning: dereferencing pointer ‘({anonymous})’ does
break strict-aliasing rules
../lib/tun.c:452: note: initialized from here
../lib/tun.c:465: warning: dereferencing pointer ‘({anonymous})’ does
break strict-aliasing rules
../lib/tun.c:465: note: initialized from here

Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +02:00
Emmanuel Bretelle 91384a4cb0 Do not exceed 80 characters per line
Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +02:00
Emmanuel Bretelle eaaf50095b Set tun devname to IFNAMESIZ+1 to avoid warning
Relevant output from make:

../lib/tun.c: In function ‘tun_new’:
../lib/tun.c:688: warning: array subscript is above array bounds

Caused by assignement:
(*tun)->devname[IFNAMSIZ] = 0;
while devname defined as:
char devname[IFNAMSIZ];

Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +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
Emmanuel Bretelle 68521860e0 Fixed compile warning,exit if cant daemonize
Relevant output of make:

ggsn.c: In function ‘main’:
ggsn.c:436: warning: ignoring return value of ‘freopen’, declared with
attribute warn_unused_result
ggsn.c:437: warning: ignoring return value of ‘freopen’, declared with
attribute warn_unused_result
ggsn.c:438: warning: ignoring return value of ‘freopen’, declared with
attribute warn_unused_result
ggsn.c:439: warning: ignoring return value of ‘daemon’, declared with
attribute warn_unused_result

Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +02:00
Emmanuel Bretelle 111e054543 Fix warning on unused fscanf return code
Relevant output of make:

gtp.c: In function ‘log_restart’:
gtp.c:697: warning: ignoring return value of ‘fscanf’, declared with
attribute warn_unused_result

Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20 11:04:51 +02:00
Harald Welte 1e9b27b70e debian: add init script for OpenGGSN 2010-08-26 13:26:07 +02:00
Harald Welte a3f42e0738 debian: libgtp has architecture 'any' not 'all' 2010-08-25 12:56:25 +02:00
Harald Welte e916809a32 import debian packaging info 2010-08-24 15:23:33 +02:00
Harald Welte 76f044da09 bump version number to 0.91 2010-08-24 11:19:36 +02:00
Harald Welte dc3744fda0 Extend 'struct pdp_t' with a void *priv pointer for application use 2010-06-03 05:52:10 +02:00
Harald Welte 47122e78fc Bump version number to 0.90 2010-05-24 11:02:56 +02:00
Harald Welte 841dd49086 fix 'make distcheck': add lookup.h to Makefile.am 2010-05-24 11:02:33 +02:00
Harald Welte a1bd7367d4 [libgtp] Fix GTPIE parsing segfault on 64bit architectures
Pointers are not always 4 bytes in size...
2010-05-16 00:35:39 +02:00
Harald Welte 7b3347b083 [libgtp] add comments with references to the GTP specification sections 2010-05-15 12:18:46 +02:00
Harald Welte cc9f083be0 sgsnemu: delete pdp context - teardown must be before NSAPI
in front of Cisco and Alcatel GGSN's, we meet the following error :

5 packets transmitted
Disconnecting PDP context #0
openggsn[24940]: gtp.c: 2417: Unexpected cause value received: 193. Packet from 172.29.5.130:2123, length: 14, content: 32 15 00 06 00 00 00 01 04 02 00 00 01 c1

it is because in the sgsnemu requests packet, the teardown field is after the NSAPI field :

No. Time Source Destination Protocol Info
24 10.940094 172.21.5.1 172.29.5.130 GTP Delete PDP context request

Frame 24 (58 bytes on wire, 58 bytes captured)
Ethernet II, Src: HewlettP_55:23:8d (00:11:0a:55:23:8d), Dst: Alcatel-_f6:8e:32 (00:d0:95:f6:8e:32)
Internet Protocol, Src: 172.21.5.1 (172.21.5.1), Dst: 172.29.5.130 (172.29.5.130)
User Datagram Protocol, Src Port: gtp-control (2123), Dst Port: gtp-control (2123)
GPRS Tunneling Protocol
Flags: 0x32
Message Type: Delete PDP context request (0x14)
Length: 8
TEID: 0x00000739
Sequence number: 0xbc02
N-PDU Number: 0x00
Next extension header type: No more extension headers (0x00)
[--- end of GTP header, beginning of extension headers ---]
NSAPI: 0
Teardown Indicator: True
[Response In: 25]

Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=2865662&group_id=68956&atid=522957
2010-05-04 11:16:09 +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 5701b0f647 GGSN: free the ippool memory before exit
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811518&group_id=68956&atid=522957
2010-05-04 11:12:23 +02:00
Harald Welte 6cc28f8405 add compiler-generated output to .gitignore 2010-05-04 11:11:11 +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 5d064ecb84 GGSN: Fix select() error case, we need to FD_ZERO() again
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811515&group_id=68956&atid=522957
2010-05-04 11:04:54 +02:00
Harald Welte c3dcba0fa6 Fix GGSN signal handling
In order te exit gracefully (closing the tun devices), we install a SIGINT
handler and note its occurrence in a global variable.

This fix is from http://sourceforge.net/tracker/index.php?func=detail&aid=1811513&group_id=68956&atid=522957
2010-05-04 11:02:54 +02:00
Harald Welte e67556e96f [SECURITY] Fix GTPIE parsing DoS
This is taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811511&group_id=68956&atid=522957 and http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg402969.html and addresses a DoS:

The problem lies in the parsing of information elements in GTP messages, which
is implemented in the gtpie_decaps function of gtp/gtpie.c file.

The implementation has a bug that does not check if there are too many
information elements in the message thus causing the software to loop
infinitely in the while-loop.

In addition, handling routine for the error situation had to be implemented
outside the while-loop.
2010-05-04 10:59:23 +02:00
Harald Welte dd69266b10 remove config.h.in and ltmain.sh as it is autogenerated, too 2010-05-04 10:56:40 +02:00
Harald Welte 4e10d9e341 add .gitignore file for autoconf-generated stuff 2010-05-04 10:51:49 +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 a24c7ec4b7 0.84 2004-12-30 23:37:18 +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 d37c136bcb Added Polish man pages 2004-10-24 21:30:25 +00:00
jjako 0fe0df0079 qos length bugfix and apple support plus header cleanup 2004-09-17 11:30:40 +00:00
jjako 12f9e6e263 QoS length bugfiz 2004-09-17 10:28:25 +00:00