Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739
|
|
It might be useful for any user of libgtp who uses libosmocore so let's
make generalized version of it available as part of installable header.
Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1
Related: SYS#3610
|
|
GTP sequence numbers on GTP-U are optional for G-PDU type messages (i.e.
user-ip messages). Let's allow the user to specify this behavior by
a new pdu_t.tx_gpdu_seq flag. The flag is enabled by default to stay
compatible with the prior behaviour.
Related: OS#2519
Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6
|
|
Let's introduce a couple of #defines that make the code much more
readable.
Change-Id: I3635d679fd54507274b46e99a02bdbbe41d7684e
|
|
Adresses two "TODO Should be avoided" comments about an extra memcpy()
before sendto() that can be replaced by a single sendmsg() call with an
iovec array: 1 record for the GTP header + 1 record for the user payload.
Change-Id: Ie332a6b15972330fcf540753898eb84ecb84fe24
|
|
in Change-Id I68ae49a765828fa681054c68bf7f5e74dbe48ad2 we introduced
a new struct member that breks ABI and API.
Change-Id: Ie631880155513b1b78d1e9dd473dc5dc50e05943
|
|
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
|
|
This is required once one wants to support multiple GSNs in a single
application.
WARNING: This breaks ABI compatibility, LIBVERSION must be adjusted
Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2
|
|
The control interface handle never belonged into libgtp in the first
place. Commit 727417dd28813c697b4820aef9f54f249e30c4b8 should not
have added this to the shared library (used by sgsnemu, osmo-sgsn, ...),
but to some private state of the GGSN.
Introducing a private context pointer at the same location will keep
ABI compatibilty.
Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5
|
|
* print destination address on sendto error
* print address length on conversion error
* log listening address
* log GTP version on PDP context errors
* fix incorrect logging message for unknown GSN peer
Related: SYS#3610
Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27
|
|
When a peer GSN receives a GPDU for an unknown PDP context, it sends
a GTP Error Indication. This Error Indication should be used to
delete the offending PDP context locally.
In GTPv1, the Error Indication contains some mandatory IEs using
which we can look up the PDP context and delete it.
The existing code only dealt with GTPv0 Error Indications which lack
those IEs and use the TEI in the header instead.
Change-Id: I3e843f9ef1d6fd7868cc992e083c0891d16b6da9
Closes: OS#2426
|
|
Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e
|
|
For some reason Max' commits introducing the CTRL/trap interface
about one year ago didn't convert the IMSI to its actual textual
representation before usign it in the CTRL interface.
Let's clean that up by properly interpreting the IMSI.
Change-Id: I8b20d2e47a29de266d93a7ddd5e6877f7e346a63
|
|
* propagate error code from gtp_new() to caller instead of always
returning -1
* on socket-related failures log explicitly which kind of socket caused
error
* log expected GTP version for unexpected packets
Change-Id: Ie07f1e4246eb178838b7df21946a08a1f60f2084
related: SYS#3610
|
|
get_seq() is called also from contexts where GTP-U is used, and GTP-U
doesn't have sequence numbers. Thus, it is perfectly normal if no
sequence number and/or no S flag in the header is present.
Change-Id: Ie19b95bbb4427e547843a019f5213a231a9f83da
|
|
The gsn_t changed the size with the addition of the ctrl pointer.
Bump the SO version to not break osmo-sgsn/ggsn on upgrade.
Call the -dev package libgtp-dev to follow the rest of Osmocom and
to ease making releases here.
Change-Id: Iac4d6d2effde1a6b2f60b1e1b49c91513d5ca8c3
|
|
* as there are muptiple flags in the field, use plural
* print the flags as hex value, not decimal. Hex is customary for bitfields.
Change-Id: Ib23d80fae32b4e9fa146d82d8f5a1dada1a3cb2b
|
|
An fopen("w") error used to omit the umask() call to reinstate the previous
umask. Also an fopen("r") at the top will never create a file and hence does
not need a umask set.
Instead, wrap the umask change and change-back tightly around the single
fopen("w") call.
Change-Id: If7d948e2f2ba47ecebba5614f18235a53b273d14
|
|
Fix errors during gsn_restart file path composition:
- possible buffer overflow because the wrong remaining length was fed to
strncat().
- missing path separator: put restart file in dir/gsn_restart instead of
../dirgsn_restart.
This assumes that the path separator is '/'.
Use talloc_asprintf() to fix all filename length problems and shorten the code.
In order to free the allocated path, add a free_filename label, and jump there
instead of returning from the fopen("w") failure branch. Also don't return from
"fclose failed" branch in order to free the path, remove the if {} braces.
Change-Id: Idf0a64ff45720aa818f2f9de1e8ba2fe2c82631b
|
|
Only generation of TRAP messages over Control Interface is supported so
far.
Note: requires corresponding version of libosmoctrl.
Change-Id: Ia76f841d2c9cd14394e9316fcd39f4060e23c898
Related: OS#1646
|
|
Change-Id: Iff0f1499660b12a47277b16a435efecb42fab038
|
|
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>
|
|
Fix an apparent typo that prevented queue iteration to find the correct item to
be removed. Instead, the first item was always returned. Calling code has been
analyzed to find that mostly this fault is not visible, since usually, the
first item is indeed the correct item to be returned. See mail thread
http://lists.osmocom.org/pipermail/osmocom-net-gprs/2016-June/000618.html
Date: Wed Jun 1 11:51:38 UTC 2016
Subject: "[PATCH] gtp/queue/queue_seqdel(): fix element check which always was true"
|
|
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.
|
|
Coverity complains about a 'Dereference before null check' on *queue.
So, push the NULL check further up.
Though I doubt that 'return EOF' is the proper way to handle allocation
failure, this patch is only about the NULL dereference.
Fixes: CID#57918
|
|
libgtp cannot understand its own update pdp request (in gtp v1)
Only require the conditional and mandatory fields for gtpv1 and not
others.
Refer to 3GPP TS 29.060 Ch. 7.3.4
|
|
pdp_getgtp1(&pdp, get_tei(pack)) works like pdp_getgtp0 for gtp0
connections.
Using get_hlen() for gtpie_decaps is used in other places to decode ies
for both version 0 and 1.
|
|
With no pdp parameter gtp_req() will send the packet to TEID 0 which is
not what we want. When trying to modify an established pdp context the
correct TEID of that context must be used.
|
|
If the file exists but can not be read the file would not be closed.
Jump to a label that will close f.
Fixes: CID#57917
|
|
Attempt to fix a bunch of compiler warnings in OpenBSC.
‘struct pdp_t’ declared inside parameter list
|
|
|
|
This seems to be a wrong search. It seems to assume that there are
no buckets. Let's just remove it before looking at it too much.
|
|
|
|
|
|
Fix: the code handles fd1u but prints fd1c.
|
|
Fix spelling dublicate -> duplicate.
This is potentially breaking API compat, but currently, no users of
gsn_t.dublicate are known.
|
|
It would print the memory location of the address buffer. Instead, print the
human readable host address and port.
The current code base supports only IPv4, and thread safety is apparently not
required, hence just use inet_ntoa(). (The IPv6 and thread capable version is 4
times longer and harder to read.)
|
|
|
|
|
|
Make libgtp depend on libosmocore and use the generic logging
infrastructure for it.
|
|
|
|
Encapsulate code to handle the teid with GTPv0.
|
|
This field needs to be in network byte order as well.
|
|
struct gtp0_header needs __attribute__((packed)) to make sure that
gcc doesn't add a hole of 4 bytes to align the 64-bits teid, resulting
in 24 bytes instead of 20 bytes. This was breaking gtpv0 in my gprs
testbed with my x86_64 laptop.
While at it, add also attribute packed to other headers just to
make sure that gcc doesn't pad the structures with holes.
|
|
This is fixing various compiler warnings:
In file included from sgsn_libgtp.c:49:0:
include/gtp.h:397:48: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:397:48: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
include/gtp.h:398:49: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:399:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
include/gtp.h:400:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
include/gtp.h:397:48: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:397:48: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
include/gtp.h:398:49: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:399:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
include/gtp.h:400:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
|
|
|
|
|
|
|
|
|
|
This makes it a bit more explicit about what is the 'user API' of the
code and what is just used internally.
|