AgeCommit message (Collapse)AuthorFilesLines
2016-05-09Merge branch 'master' into sysmocom/iu, with tweakssysmocom/iu_orig_historyNeels Hofmeyr81-2128/+1735
Numerous manual adjustments are included to make sense on the sysmocom/iu branch: * gsm_04_08_gprs.h has moved to libosmocore on the master branch, but sysmocom/iu has added some entries. Until it is clear whether to move the additions to libosmocore as well, keep gsm_04_08_gprs.h on sysmocom/iu with merely the additions. * Thus, keep using the old gsm_04_08_gprs.[hc] from openbsc in the Makefiles, but only where the sysmocom/iu additions are needed. * In openbsc's gsm_04_08_gprs.h, * include the libosmocore gsm_04_08_gprs.h, * use '#pragma once' instead of #ifndef and * add a TODO comment about moving the rest to libosmocore. * Apply the addition of an osmo_auth_vector to gsm_auth_tuple: in the Iu auth vector hacks, use the gsm_auth_tuple.vec instead of a local struct. See iu_hack__get_hardcoded_auth_tuple() and gsm48_rx_gmm_att_req(). * In the si2q tests, pass NULL as ctx to gsm_network_init(). * In cscn_main.c, add a debug log that was originally added to osmo-nitb. * openbsc/.gitignore: keep only one addition of 'writtenconfig' Conflicts: openbsc/include/openbsc/gprs_sgsn.h openbsc/include/openbsc/gsm_04_08_gprs.h openbsc/src/gprs/gsm_04_08_gprs.c openbsc/src/libmsc/gsm_04_08.c openbsc/src/osmo-cscn/cscn_main.c openbsc/tests/gsm0408/Makefile.am
2016-05-06sgsn_test: Adapt test case to now-existing InsertSubscriberDataHarald Welte1-2/+2
We recently implementd InsertSubscriberData in the SGSN, adapt the test to reflect that.
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-05-04gprs: Update mm_ctx ra_id from ue_ctxDaniel Willmann1-0/+5
2016-05-04libiu: Keep current ra_id in ue_conn_ctxDaniel Willmann2-0/+2
2016-05-04libiu: Also get routing area code if present in InitialUE MessageDaniel Willmann1-0/+4
2016-05-04libiu: Fix memory leaks on receive and transmitDaniel Willmann1-3/+9
The ranap_handle_* functions generate a msgb and pass it on to the receive callback. After processing the message the msgb needs to be freed again. iu_tx() takes a msgb and uses ranap_new_msg_dt() to generate a new msgb from it. The old msgb needs to be freed.
2016-05-04gprs: Track PMM statesDaniel Willmann3-4/+22
For Iu mode it is important to know when the UE is in PMM-IDLE mode since the SGSN will need to page the UE if there is data for it.
2016-05-04IuCS: upon sec mode compl, check that a sec op is pendingNeels Hofmeyr1-0/+8
Safety check: discard Security Mode Complete messages when there is no security operation pending.
2016-05-04msc: fix: two missing security operation releasesNeels Hofmeyr2-0/+2
When receiving authentication response or security mode complete messages, actually release the security operation stored with the subscriber conn.
2016-05-04msc: ignore cb retval on auth/sec mode rxNeels Hofmeyr2-8/+8
Just return 0 regardless of the security callback's return value when receiving authentication response or security mode complete messages.
2016-05-04IuCS: properly clean up conn on releaseNeels Hofmeyr2-3/+3
Don't call msc_subscr_con_free() directly, instead use gsm0408_clear_request(), which properly cleans up all pending operations before freeing the connection.
2016-05-04gsm0408_clear_request(): actually free the released connNeels Hofmeyr1-0/+2
By having conn->in_release == 1, calling msc_release_connection() has no effect and thus never frees the conn. So, after all pending requests have been discarded, also discard and free the unused connection.
2016-05-04gsm04_08_clear_request(): release loc with arg release=0Neels Hofmeyr1-1/+1
In gsm04_08_clear_request(), in_release == 1 anyway and msc_release_connection() would exit immediately without any effect. Don't confuse the reader by passing release=1 arg.
2016-05-04cosmetic: move subscr_conn alloc&free to gsm_04_08.cNeels Hofmeyr2-27/+27
Subscriber conn stuff doesn't really belong in gsm_subscriber.c. (I moved because I thought it would call some static functions in gsm_04_08.c, which ended up not being the case; anyway, it makes more sense to stay in gsm_04_08.c.)
2016-05-04msc subscr: add paging timeoutNeels Hofmeyr2-0/+29
In NITB, the paging timeout would be handled from the BSC side. In IuCS, we need to invalidate the paging request from libmsc alone, so add a paging timer to gsm_subscriber. Possibly, the HNB-GW should respond with a paging failure and libmsc could trigger on that, nevertheless libmsc should not rely on a failure message to expire pending pagings.
2016-05-04subscr_paging_dispatch(): add assertionsNeels Hofmeyr1-0/+5
Make sure that subscr and conn are valid: * a subscr must always be present. * on success, a conn must be present and the subscr must match the conn's subscr. Also check the hooknum.
2016-05-04gitignore dir for python config testsNeels Hofmeyr1-0/+1
2016-05-04comment tweakNeels Hofmeyr1-1/+1
2016-05-04debug log for SMSNeels Hofmeyr2-1/+9
2016-05-04debug log tweaks for pagingNeels Hofmeyr3-10/+18
2016-05-04Revert "subscr_paging_dispatch(): use conn->subscr instead of separate param"Neels Hofmeyr1-3/+3
This reverts commit 6f4e83beb05b7e4fd615504a7bf6a71afe15064d, but note: this is not a 1:1 revert since the subscr_paging_sec_cb() semantics have changed. In subscr_paging_dispatch(), the separate subscr parameter is needed in cases where paging expired and there is no conn available. For subscr_paging_sec_cb(), a conn must always be available. Hence it avoids any duplicity by only passing the conn and deriving the subscr from that. Callers of subscr_paging_sec_cb() pass NULL as param, so pass conn->subscr when calling subscr_paging_dispatch() from subscr_paging_sec_cb().
2016-05-02cosmetic: IuCS loggingNeels Hofmeyr4-4/+5
2016-05-02add enum iu_event_type to string conversionNeels Hofmeyr2-0/+15
2016-05-02comments and debug log for paging responseNeels Hofmeyr1-1/+18
2016-05-02msc_paging_request(): remove unused parametersNeels Hofmeyr1-4/+2
The network is known from subscr; the type is not applicable after MSCSPLIT; cbfn and data are obsoleted by explicit subscr_rx_paging_response().
2016-05-02msc_paging_request(): make staticNeels Hofmeyr1-1/+1
it is never called outside of gsm_subscriber.c
2016-05-02msc: paging: use gsm_subscriber API to add Integrity Protection for IuCSNeels Hofmeyr1-22/+1
During peliminary paging response testing, I introduced some code duplication. Remove that and instead call the code that was there before 63b99ced83773d923 ("add preliminary paging response handling, incomplete"). By calling the gsm_subscriber API, the connection is also secured and hence Integrity Protection is enabled for IuCS.
2016-05-02cosmetic: msc: handle_paging_resp() tweaksNeels Hofmeyr1-7/+7
Tweak debug logging, use paging category DPAG. Change the order of arguments to make more sense in the causal relationship.
2016-05-02paging: actually verify subscriber authorizationNeels Hofmeyr1-1/+8
Before this, any paging response would be accepted by the CN, without checking the database whether the subscriber is in fact authorized. The probability that a subscriber would be able to take unauthorized action is slim, nevertheless checking authorization status with the database should happen before we accept a connection.
2016-05-02paging: change subscr_paging_cb() into subscr_rx_paging_response()Neels Hofmeyr2-10/+7
Remove one layer of callback indirection in paging. When a paging response arrives, we always want to first secure the connection, thus a fixed subscr_rx_paging_response() function is more appropriate and avoids having to store a cbfn. The actual actions to be taken upon successful paging are of course still in callback functions stored with each subscriber.
2016-05-02Allow paging even though is_paging is falseNeels Hofmeyr1-2/+5
It doesn't really hurt to see whether we have paging responses queued for a given subscriber. Possibly a subscriber replied with a paging response later than we assumed the paging to be valid.
2016-05-02cosmetic: subscr_paging_dispatch() comments/indentNeels Hofmeyr1-9/+0
2016-05-02subscr_paging_dispatch(): use conn->subscr instead of separate paramNeels Hofmeyr1-3/+3
2016-05-02cosmetic: subscr_paging_dispatch() comments/indentNeels Hofmeyr1-7/+2
2016-05-02add comments on MSCSPLIT and pagingNeels Hofmeyr4-0/+12
2016-05-02gsm_04_08 mscsplit: subscr_request_channel() -> subscr_request_conn()Neels Hofmeyr5-9/+8
Rename subscr_request_channel() to _conn() and remove the channel_type arg. The "channel" is a term from closely tied MSC+BSC code, after separation we shall call it a "connection", i.e. over IuCS or A. The channel_type arg is already unused from a previous MSCSPLIT commit.
2016-05-02gsm_04_08: factor out subscr authorization checkNeels Hofmeyr3-27/+36
Add function subscr_authorized(), absorbing the guts of static authorize_subscriber() from gsm_04_08.c, except the parts specific to Location Updating. subscr_authorized() is a check that is to be added to validation of a paging response.
2016-05-02cscn: (re-)add SMPP initializationNeels Hofmeyr1-7/+9
Remove legacy code from the original NITB version -- the SMPP init functions have since been refactored in 1b0e5540dba697c9cf213e4f0aebc4baaf1618cb. Add SMPP initialization in the refactored version: call the alloc_init before reading config file, and call start with the global network struct after config is read.
2016-05-01Support raw IPv4 address in RAB Assignment ResponseHarald Welte1-1/+19
There are different Iu dialects in terms of encoding the transport layer address inside RAB Assignment req + resp. Let's be liberal in what we accept, and simply use the length as an indicator of the format. Wireshark uses similar heuristics.
2016-05-01RAB Assignment Response: Handle TEID changesHarald Welte1-2/+16
When the RNC confirms the RAB Assignment, it can each time indicate a new TEID for the GTP-U endpoint on the RNC side. We need to update our information about the PDP context and include that in the UPDATE PDP CONTEXT that we're sending towards the GGSN. This is similar to updating the RNC-side IP address of the GTP endpoint.
2016-05-01iu_rab_act_ps: Use GGSN-side TEI in RAB Assignment RequesetHarald Welte1-3/+3
When we send the RAB Assignment Request to the RNC, we need to tell it the GGSN-side TEI for data, not "our" (SGSN side) TEID. In the RAB-Assignment.req we inform the RNC of the TEID on the GGSN side, and in the RAB-Assignment.resp the RNC informs us of the TEID on the RNC side.
2016-05-01Identify PDP context by RAB ID, not TEIHarald Welte3-22/+2
When receiving an RAB-Assignment response from the RNC, we should use the RAB ID (=NSAPI) to resolve the PDP context. We cannot use the TEID, as the TEID chosen by the RNC for this RAB has no relationship to the TEID we were using for the RAB-Assignment request. TEIDs are local to each of the peer, like UDP port numbers.
2016-05-01libiu: Fix missing break statements in switch in cn_ranap_handle_co()Harald Welte1-0/+2
2016-05-01SGSN: Use PDP Context NSAPI as RAB IDHarald Welte4-16/+2
As Dieter has pointed out, the RANAP spec requires the RAB ID to be equal to the NSAPI of the PDP context for which it is established.
2016-05-01Fix parsing of auto-generated config fileHarald Welte1-1/+1
When starting with empty config file, saving it by 'write file', and then re-starting osmo-cscn, it would complain: Error occurred during reading below line: long name Osmocom Circuit-Switched Core Network The problem is that the vty parser is configured to expect a single token and not a list of tokens here, but we initialize the default value with multiple words (which are treated as separate token).
2016-04-29osmo_oap_decode(): Use common argument orderingHarald Welte4-7/+7
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 Welte5-22/+22
this is in preparation of moving related code to libosmocore.