aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
AgeCommit message (Collapse)AuthorFilesLines
2016-06-13add DSUA debug constantDaniel Willmann1-0/+5
Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4
2016-06-10add DRANAP debug constantDaniel Willmann1-0/+5
Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2
2016-06-05gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULLNeels Hofmeyr1-1/+4
Add missing mmctx NULL check in gsm0408_rcv_gmm(). gsm48_tx_gmm_status() would dereference mmctx without checking, so we can't call it if mmctx == NULL. Follows up on recent e98ba82d2b07c835: "gprs_gmm.c: Don't try to de-reference NULL mmctx". Change-Id: If59efbde86c76ffe91a0b33be87273783a2a4a02
2016-06-02gprs: more conditionals for Gb specific actionsDaniel Willmann3-8/+14
Change-Id: I213d21b9ddbf19e56269defcc6aa65aca4947140
2016-06-02sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu)Daniel Willmann1-3/+10
Assert that llme is unused for non-Gb (Iu) connections, and clean up otherwise. Make sure the cleanup is left below the sgsn_mm_ctx_free() call, as the comment states. Change-Id: I891ae21afc1f4f60580b822273b5435e0e17d46f
2016-06-02gprs_gmm.c: Perform LLME operations only if we have oneHarald Welte1-5/+7
In case the GMM message did not arrive over a Gb interface, there is no LLME (and thus the associated pointer is NULL). Don't try to perform operations on a NULL LLME. Change-Id: If7f24161cd2826f8ee238d4bc1090adf555cea4e
2016-06-02gprs_gmm.c: Make TLLI handling specific to Gb interfaceHarald Welte1-36/+60
Soem of the operations we perform in the GMM layer are specific to the GPRS/EDGE radio access network and its Gb interface. Let's make them conditional to that in preparation of supporting an Iu interface. Change-Id: I3efb7c5087afe8e2331ec17bd9fac5029f4bee6c
2016-06-02gprs_gmm.c: Don't try to de-reference NULL mmctxNeels Hofmeyr1-0/+32
There was a comment in the code that certain GMM messages require a valid mmctx pointer. However, nothing actually checked if that pointer was in fact non-NULL. We plainly crashed if a MS would send us the wrong message in the wrong state. Original patch by Harald Welte, but it broke message validity checking, resulting in sgsn_test failure. This re-implements the NULL check in a different way, as explained by in-code comment. Change-Id: I7908de65bec91599f7042549b832cbbd7ae5a9a8
2016-06-02rename gsm0408_gprs_rcvmsg() to gsm0408_gprs_rcvmsg_gb()Harald Welte2-3/+3
This is the entry point for GMM from Gb. We will create a new one for Iu, so let's be explicit rather than implicit. Change-Id: I93c074bf99db041117c0dc03dc8255879845a875
2016-06-01create_pdp_conf(): factor out PDP context accept dispatch as ↵Daniel Willmann1-9/+14
send_act_pdp_cont_acc() Change-Id: Ibf60e18707ff4aa2e60291e5595386ddda8d8190
2016-06-01prepare sgsn_mm_ctx for Gb and Iu mode (UMTS)Harald Welte6-46/+47
Explicitly mark those sgsn_mm_ctx members that apply for Gb mode and (upcoming) Iu mode, respectively. Add some comments in sgsn_mm_ctx. Change-Id: Ife9b02549f284e2547f16117cf43d7a36948fc4b Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de>
2016-05-31gprs: use new uint8_t * for kv in gprs_cipher_run()Alexander Couzens1-2/+2
libosmocore changed in bf990bb8 Update internal GPRS cipher API from uint_64 to uint8_t*. Fix a warning. Change-Id: Ib5bfe1fb05c693347b11ff4faadd3fc2205ebd76
2016-05-05Add human-readable name of SGSN_AUTH_AUTHENTICATEHarald Welte1-0/+1
In commit 4adb136da63a1d3ed523ad85e12fd99fc62f5701 we introduced a new authentication state SGSN_AUTH_AUTHENTICATE, but we didn't add that to auth_state_names[] resulting in log messages printing it abut 'unknown 0x1' rather than something more useful.
2016-05-05sgsn/GSUP: Support MAP-style nested LU/ISDHarald Welte1-0/+22
The existing GSUP code expected the subscriber data to be piggy-backed onto the location update response, rather than a separate (and nested) insert subscriber data request/response phase. With this patch we should now support both the nested as well as the piggy-backed version.
2016-04-29osmo_oap_decode(): Use common argument orderingHarald Welte2-3/+3
In general, if a function generates output data like a msgb (or in this case filling an osmo_oap_message structure), the output argument precedes the source. This is what we use all over libosmo*, and it is modelled after memcpy(), where dst is the first argument, before src. Let's align osmo_oap_decode(). Intestingly, osmo_oap_encode was already correct, so the encode/decode functions used different conventions before.
2016-04-29OAP: Various coding style fixesHarald Welte1-13/+14
* we always declare stack variables at the top of the function / block * 'switch' is not a function, so there's space ahead of the opening (
2016-04-29OAP: use osmo_oap_ prefix for OAP, rather than plain oap_Harald Welte2-10/+10
this is in preparation of moving related code to libosmocore.
2016-04-29oap_message.h: Remove dependency to openbsc includeHarald Welte2-1/+2
This is a first step to moving oap_messages.h to libosmocore
2016-04-29Move osmo_gsup_messages.[ch] to libosmocoreHarald Welte3-474/+2
This requires the corresponding commit in libosmocore.
2016-04-29move utils.h functions to libosmocoreHarald Welte2-6/+7
This needs the corresponding commit in libosmocore which imports the related functions
2016-04-29osmo_gsup_messge.[ch] documentation update (doxygen)Harald Welte1-0/+10
2016-04-29gsup_messages: Add UMTS AKA related encoding/decoding supportHarald Welte1-0/+46
2016-04-29move osmo_shift_* / osmo_match_shift_* to libosmogsmHarald Welte2-174/+0
2016-04-29rename gprs_shift_*() to osmo_shift_*()Harald Welte4-47/+86
This rename is the first step of moving the associated functions into libosmocore. Also, rename gprs_match_* to osmo_match_shift_* to indicate that it is not just matching the TLV, but also shifting the data portion.
2016-04-29Rename gprs_gsup_* to osmo_gsup_*Harald Welte3-108/+108
This is a preparation to move the related code to libosmocore, whilst at the same time generalizing it from GPRS Subscriber Update Protocol to the Osmocom Generic Subscriber Update Protoco.
2016-04-29use new libosmocore gsm_23_003.h for IMEI/IMSI lengthHarald Welte3-3/+5
... rather than our private definitions everwhere. As an added benefit, gprs_gsup_messages.h is now free of any header dependencies within openbsc.
2016-04-29move gsm_04_08_gprs.h to libosmocoreHarald Welte13-152/+10
This requres the corresponding commit in libosmocore.
2016-04-29Start to use struct osmo_auth_vector from gsm_auth_tupleHarald Welte4-40/+40
Rather than having a 'private' structure for kc, sres and rand, we now finally (with 4 years delay) use osmo_auth_vector from libosmogsm, which encapsulates authentication vectors that can be either GSM triplets or UMTS quintuples or a combination of both. gsm_auth_tuple becomes a wrapper around osmo_auth_vector, adding use_count and key_seq to it. key_seq is no longer initialized inside gprs_gsup_messages.c, as there is no CKSN / key_seq inside the message anyway. If a usre of the code needs key_seq, they need to manage it themselves.
2016-04-16gtphub_unmap_header_tei(): don't dereference unmapped_tei arg if not present ↵Neels Hofmeyr1-4/+6
(CID #57687)
2016-03-1504.08: apply new transaction id inline functionsNeels Hofmeyr1-4/+4
libosmocore recently added inline functions to relieve callers from applying bitmasks and bit shifts to access the transaction id of a GSM 04.08 header. Apply these functions.
2016-03-1504.08: apply new bitmask functions, fix bitmask useNeels Hofmeyr3-6/+13
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
2016-02-25enable ctrl bind config for various programsNeels Hofmeyr2-13/+23
Add ctrl_vty_init() calls and feed the ctrl_vty_get_bind_addr() return value to ctrl_interface_setup() in the following programs: osmo-bsc osmo-bsc_nat osmo-nitb osmo-sgsn For osmo-sgsn, move the control interface setup invocation below the config parsing, so that the ctrl_vty_get_bind_addr() can return the configured address.
2016-02-25enable telnet VTY bind address config for various programsNeels Hofmeyr3-10/+24
Following the 'line vty'/'bind A.B.C.D' command added in libosmocore, use the configured address to set the telnet bind for the VTY line. It is now possible to publish the VTY on a specific local interface (including 0.0.0.0 aka "any"). Implement in all of: osmo-gbproxy osmo-gtphub osmo-sgsn osmo-bsc osmo-bsc_nat osmo-bsc_mgcp osmo-nitb In some of these main programs, move the telnet initialization below the configuration parsing. Historically, this was not a good idea for programs using bsc_init.c (aka bsc_bootstrap_network()), since they expected a gsm_network struct pointer in ((struct telnet_connection*)vty->priv)->priv, so that telnet had to be either initialized or replaced by a dummy struct. In the meantime, the gsm_network struct is not actually looked up in a priv pointer but in the static bsc_vty.c scope (bsc_gsmnet), so this limitation is mere legacy (even though said legacy is still there in an "#if 0" chunk). In the other binaries I have briefly looked at the init sequence dependencies and found no reason to initialize telnet above the config file parsing. In any case, I have tested every single one of abovementioned binaries to verify that they still parse the example config successfully and launch, allowing VTY connections on the configured address(es). I hope this suffices. In all of the above, log VTY address and port. LOGL_INFO is disabled by default in some of the logging scopes, and since it is a single log message right at program launch, I decided for the slightly more aggressive LOGL_NOTICE.
2016-02-23gtphub: tweak default logging levelNeels Hofmeyr1-1/+1
2016-02-23gtphub: include ports.h instead of redefining OSMO_VTY_PORT_GTPHUBNeels Hofmeyr1-5/+1
2016-02-22sgsn: Re-add searching for MM ctx based on TLLI / P-TMSI matchesJacob Erlbeck2-3/+48
If an MM context cannot be found based on BBSGP info and a RA UPDATE REQUEST is received, try to find an MM context with an P-TMSI from which the TLLI could have been derived. This also checks, whether the routing area matches. This is similar to the old behaviour removed by the commits "sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlli" and "sgsn: Remove tlli_foreign2local", except that this will only be done for RA UPDATE REQUESTs now. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Change handling of missing mmctx in gsm48_rx_gmm_ra_upd_reqJacob Erlbeck1-3/+15
Currently the MM context is just overwritten by a call to sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &old_ra_id) even if it has already been found by using the BSSGP info. With the changes made to sgsn_mm_ctx_by_tlli this will never find a MM context if the routing area has changed. If the routing area has not changed, the mmctx has already been found if it exists. This commit splits searching for an MM context (if it hasn't been found already) from checking, whether a found one can really be used. The actual search is removed, so that the MS will be forced to restart the attach procedure, which is less efficient but safe. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlliJacob Erlbeck1-30/+1
Currently the code also matches the TLLI against LOCAL and FOREIGN mappings of the P-TMSI, thus eventually finding MM contexts not consistent with the TLLI (both tlli and tlli_new differ). On the other hand, tlli_new is not checked at all. This commit changes the function to only look at mmctx->tlli, mmctx->tlli_new, and the routing area. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Make ra_id_equals available as gprs_ra_id_equalsJacob Erlbeck2-9/+9
The function is moved to gprs_utils.c, renamed, and made non-static to be usable in other modules, too. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Remove tlli_foreign2localJacob Erlbeck1-23/+2
Currently foreign TLLI are sometimes mapped to local TLLI in the hope that they will match. This seems to sometimes introduce inconsisties, possibly leading to a failing assertion in _bssgp_tx_dl_ud. This mapping should probably reduce the allocation of additional LLME during routing area changes. This commit removes tlli_foreign2local. Sponsored-by: On-Waves ehf
2016-01-30gsm0408: Provide unique strings for the gsm 04.08 messageHolger Hans Peter Freyther2-20/+20
At Rhizomatica we see that some GSM 04.08 messages are leaked and have no other indication if that is Call Control, SMS or something else.
2016-01-26gprs: use libgtp cflagsAlexander Huemer1-1/+1
2016-01-23gtphub: Fix use after free on failureHolger Hans Peter Freyther1-1/+3
Even if fclose fails the stream is inaccessible and the second fclose might cause memory violation. Linux manpage says: Upon successful completion 0 is returned. Otherwise, EOF is returned and errno is set to indicate the error. In either case any further access (including another call to fclose()) to the stream results in undefined behavior. Fixes: CID#57958
2016-01-22gtphub: Make the two setter static as wellHolger Hans Peter Freyther1-2/+2
Same as with the previous gtphub commit. Make these static to deal with the new semantic of inline in gcc5.
2016-01-22gtphub: Fix compilation using gcc5Holger Hans Peter Freyther1-2/+2
The semantic of inline has changed and we need to make it static to not end up with undefined references.
2015-12-14gtphub VTY: add newlines to some VTY docs' final linesNeels Hofmeyr1-8/+8
2015-12-14gtphub VTY: fix doc strings for show cmdsNeels Hofmeyr1-7/+10
2015-12-08gtphub: log: limit length of hex dumps.Neels Hofmeyr2-4/+7
The debug log prints the received/sent bytes in hex. When this data surpasses the buffer size available for the log string (4096), the log is truncated and lacks a newline character. Limit the amount of dumped bytes to 1000. Sponsored-by: On-Waves ehi
2015-12-07gtphub: add VTY show for peers and peer stats.Neels Hofmeyr1-4/+119
Sponsored-by: On-Waves ehi
2015-12-07gtphub: improve handling of restarted peer.Neels Hofmeyr1-11/+12
Handle peer restart earlier, so that all the tunnels are deleted by the restart code path, instead of the first one being deleted due to reused TEI. That caused confusing logging messages. Also, when receiving Delete confirmations from the peer that didn't restart, don't complain about unknown peer, but acknowledge and remove the half invalidated tunnel. This means that the pending delete entry from the restart code path is not needed / not used, so don't bother to add pending delete entries upon peer restart. The test test_peer_restarted_reusing_tei() hits the situation where a tunnel is removed because of a reused TEI rather than the restart counter. Adjust the test to expect the "out-of-band" delete request earlier on, and to still see the half invalidated tunnel around. Enhance the test by adding the delete response from the peer that didn't restart, and add a final tunnels_are() verification. Sponsored-by: On-Waves ehi