Commit Graph

20 Commits

Author SHA1 Message Date
Pau Espin 641206ad5e cosmetic: gtpie.c: Fix trailing whitespace
Change-Id: I552e3b5f694e1b49fe5e21fa4023e4a24ffc2784
2021-05-03 17:24:30 +02:00
Harald Welte f6c5f9524f gtpie_{encaps,encaps2}(): RAI is a fixe 6-byte length field, not 8 bytes
gtpie_decaps() always had this right, but the encapsulation functions
treated it as 8-byte fixed length IE.

I hope we had a chance to convert all of this to the normal libosmogsm
tlv_parser one day.  This would have one description table for all TLV
types which then is used from encoder and decoder.

Change-Id: I48471f2735511806ac424b5ffc1929e85bb156f3
2017-10-14 07:59:07 +02:00
Harald Welte bc41c8d581 gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 Release 11
Change-Id: I6ab7bfb31f93f52f9f6b1b5880dcb2c232bba794
2017-10-14 07:49:15 +02:00
Harald Welte 89e1abcb18 Allow Common flags 0x94 and ignore them in PDP activation
extended from https://github.com/osmocom/openggsn/pull/2

Change-Id: I31b3e4b378e74bb5a0a2f54af6d2a15b629876cf
2017-10-14 07:43:58 +02:00
Harald Welte a964027344 gtpie_decaps: const-ify pointer to input packet data
Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671
2017-10-13 16:36:43 +02:00
Harald Welte c5150cecc5 gtpie: Add doxygen API documentation
libgtp should have proper API documentation, let's start with the
gtpie.[ch] parts.

Change-Id: I97df5bd3c8dcc5c97a114c8c6abadabf33147b05
2017-10-13 16:36:43 +02:00
Harald Welte 02af9b3ca2 gtpie_tlv() gtpie_tv0(): const-ify read-only input argument
Change-Id: Ide487e34884c8356694246f43c3f1f562357304c
2017-10-13 16:36:43 +02:00
Harald Welte 632e843e5f Rename OpenGGSN to OsmoGGSN
Osmocom has maintained this program since about 7 years now, while
the original author / copyright holder has completely disappeared.

With the introduction of Osmocom-style CTRL and VTY interfaces,
the way how the program is used and configured has substantially
changed.  In order to avoid confusion in terms of configuration file
format etc, let's rename it to OsmoGGSN.

Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d
2017-09-06 09:17:15 +02:00
BJovke 03dbafb000 Add 'Bearer Control Mode' IE
This IE is known to be sent by a Cisco GGSN, and was added in
ETSI TS 129 060 V7.17.0 (2011-10) /
3GPP TS 29.060 version 7.17.0 Release 7

See https://lists.osmocom.org/pipermail/osmocom-net-gprs/2016-September/000711.html
Subject "sgsnemu failing to create PDP context with Cisco GGSN"
Tue Sep 13 08:00:37 UTC 2016

Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
2016-09-15 13:53:13 +02:00
Pablo Neira Ayuso 0eaa5b8e6c gtp: fix several compilation warnings
CC       gtpie.lo
gtpie.c: In function 'gtpie_encaps':
gtpie.c:437:22: warning: variable 'm' set but not used [-Wunused-but-set-variable]
  union gtpie_member *m;
                      ^
gtpie.c: In function 'gtpie_encaps2':
gtpie.c:537:22: warning: variable 'm' set but not used [-Wunused-but-set-variable]
  union gtpie_member *m;
                      ^

lookup.c: In function ‘lookup’:
lookup.c:40:24: warning: typedef ‘ub1’ locally defined but not used [-Wunused-local-typedefs]
  typedef unsigned char ub1; /* unsigned 1-byte quantities */
                        ^

Still one compilation warning left in cmdline.c, but that code
is autogenerated.
2016-05-12 17:02:34 +02: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
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
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
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 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 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
jjako 0fe0df0079 qos length bugfix and apple support plus header cleanup 2004-09-17 11:30:40 +00:00
jjako b7b93fc78f Rename u_int to uint 2004-01-09 11:56:48 +00:00
jjako 08d331db63 First attempt at a GTP1 implementation 2003-10-13 20:33:30 +00:00
jjako 52c2414f6c Initial revision 2002-12-16 13:33:51 +00:00