AgeCommit message (Collapse)AuthorFilesLines
2017-03-09move to libbsc: gsm_bts_neighbor() -- TODO really?Neels Hofmeyr3-23/+21
Change-Id: I63d4835dc7aabdf176e0ca634a6a4ca527612693
2017-03-09gsm0408_test: use NULL for root ctx -- TODO really?Neels Hofmeyr1-2/+2
2017-03-09gsm_04_08: remove apply_codec_restrictions() -- TODO really?Neels Hofmeyr1-28/+0
This function is wrongly placed on the MSC level. Unfortunately I cannot remember the very plausible details that hwelte had back in the days to argue for this change. (Refactoring an old commit that fails to explain in more detail.) Change-Id: I82623847e652a59a921d2fb142b77cf22420a746
2017-03-09move to libmsc: osmo_stats_vty_add_cmds() -- todo MSCSPLITNeels Hofmeyr2-1/+2
2017-03-09include msc_ifaces.h in gsm_04_08.cNeels Hofmeyr1-0/+2
Change-Id: I11be1bdfe6993f89b34319e7d1526c729d6e0cde
2017-03-09complete IuCS paging implementationNeels Hofmeyr2-32/+82
Add paging timeout to struct gsm_subscriber. Previously, paging timeout was implemented only on BSC level, where each request has its own timeout value. The MSC will still send individual requests to BSC or RNC level, where they timeout individually. However, the MSC must also have an own timeout to be sure to discard stale pagings that the BSC or RNC never replied for. Add handle_paging_resp(), copying the few libmsc relevant parts of gsm48_handle_paging_resp().
2017-03-09paging: add todo comments for paging and mscsplitNeels Hofmeyr2-0/+7
Change-Id: I7e72c9db2837ea5edf45f6037cb0288a264d492c
2017-03-09paging: 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.
2017-03-09paging: change subscr_paging_cb() into subscr_rx_paging_response()Neels Hofmeyr2-26/+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. Remove paging_request_stop() call from subscr_paging_dispatch(), which stops paging on all BTSs, which is not the responsibility of libmsc. Change-Id: Ic2c785c9cc48b2c2c6557cbe1060d25afa89e38d
2017-03-09Iu auth wipNeels Hofmeyr1-0/+25
Change-Id: I44effcca80dc6850178174dc957bcd5608b0ae14
2017-03-09subscr_request_channel() -> subscr_request_conn()Neels Hofmeyr3-6/+10
Change-Id: Ife8e10b240693a8d369139881774f1892044aa65
2017-03-09move subscr_request to gsm_subscriber.hNeels Hofmeyr2-17/+14
Change-Id: Idbbd39b0e068da17aafa97e315143509c69c50ea
2017-03-09add gsm_encr to subscr_connNeels Hofmeyr1-0/+1
Change-Id: Id5797cd1f1bfa2cca2d3fbabc1981aa75546421b
2017-03-09osmo-nitb becomes osmo-mscNeels Hofmeyr8-98/+374
Change-Id: I3787050b524954d8a4dd13495c458f3ee293807b
2017-03-09remove unneccessary linking from some testsNeels Hofmeyr3-4/+0
The recent shifts and cuts have made some library linking for bsc, channel and db tests unnecessary.
2017-03-09cut off libbsc paging, pending paging in libmscNeels Hofmeyr4-1/+19
Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. In osmo-nitb, paging is done on BSC level and MSC level "at the same time". When the new MSC is fully operational, paging will be controlled separately on the MSC level, and the BSC (RNC) level will be instructed over an IuCS or A-interface to negotiate paging with the MS (UE). This MSC level paging does not yet exist and will be added in subsequent commits. Change-Id: I8b6920ddc54fc3f2876a59664e6722666d8a8a4a
2017-03-09libmsc: duplicate gsm0808 / gsm48 functions (towards BSC)Neels Hofmeyr4-6/+59
In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment relatd to msc_gsm0808_tx_cipher_mode() in two places. Change-Id: I5b276853d3af71f5e3f0a031fd17b4fff0580020
2017-03-09Use new msc_tx_dtap() instead of gsm0808_submit_dtap()Neels Hofmeyr4-8/+10
Aim: msc_tx_dtap() shall redirect to IuCS or A interfaces depending on subscr conn. Change-Id: I30d961f16eb7b9c0ab9cc3f43198098d3f1a909f
2017-03-09add libiudummy, to avoid linking Iu deps in testsNeels Hofmeyr6-0/+56
Change-Id: I4a66c4122011dbc87c6fcb336ab0461b86522c98
2017-03-09move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi() -- TODO ↵Neels Hofmeyr2-24/+24
move to libfilter instead? Change-Id: I00ca0caf8224de029f53f4dedb1146e3cf7650ec
2017-03-09msc_compl_l3(): publish in .h, tweak return valueNeels Hofmeyr2-10/+20
Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c Change-Id: If24007445899e9c75553a0dbf843ada3566b3380
2017-03-09add msc vty, remove nitb vtyNeels Hofmeyr4-10/+177
Change-Id: I8f8980d6cfbf26f1b0e0197939833e55dbe521fb
2017-03-09add iucs.[hc]Neels Hofmeyr4-0/+206
Change-Id: I88e981f4c31393a98ae8d61176c65c9251a6f28b
2017-03-09add DIUCS debug log constantNeels Hofmeyr2-0/+6
Change-Id: Id347a3024fa495a1ab680db7320648d933a4018b
2017-03-09gsm0408_loc_upd_rej(): remove bts use (used only for debug log)Neels Hofmeyr1-4/+2
Change-Id: I3ac38f4b701ad8308470573260fa91a4b04c2f18
2017-03-09gsm_04_08, gsm_subscriber: decouple lac from btsNeels Hofmeyr2-3/+2
The idea is to not have a direct pointer to a bts struct (into BSC land), but a LAC to resolve the BSC or RNC depending on the appropriate A or IuCS interface. subscr_update(): remove bts arg, add lac arg. Pass conn->lac to gsm48_generate_lai() instead of bts->location_area_code. Change-Id: I9f2b298a785bf4b2a1b3fcdd91b8256106b2d9de
2017-03-09move t3212 to network level (periodic lu)Neels Hofmeyr4-8/+12
Set the T3212 default value in struct gsm_network and take that value when creating a BTS. Adjust VTY accordingly. Change-Id: Ifb730f9d0106fe195adc30459a39290a07313b50
2017-03-09libmsc: iucs dev: disable large parts of the codeNeels Hofmeyr5-0/+91
Change-Id: I3ef6ca26150b6102a0fa22a88a60d9a442d640b4
2017-03-09Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication.Neels Hofmeyr6-0/+141
Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). Change-Id: Idf8020a30562426e8f939706bf5c2188d5a09798
2017-03-09don't use lchan in libmscNeels Hofmeyr2-12/+12
Change-Id: Ic7ed7faa2bcc7aae799f41ed4abc2c001bfb61b7
2017-03-09gsm_04_08.c: Don't set msg->lchan nor msg->dstHarald Welte1-34/+0
the BSC-side of the API behind gsm0808_submit_dtap() is doing this resolving again anyway. So let's avoid doing it twice, and avoid having more dependency of the MSC down into the lchan details. Conflicts: openbsc/src/libmsc/gsm_04_08.c Change-Id: I14254be68ee1a48e9f1ce968233414d86c6ba9d5
2017-03-09vlr: fix: don't send CM Service Accept after Ciphering CommandNeels Hofmeyr3-11/+12
Ciphering Mode Command is an implicit CM Service Accept, if we're sending both we're confusing the MS. Change-Id: I3a04debe9b01c086e7f44b6139cb8796fcc71d38 Conflicts: openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.c openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err
2017-03-09fix: vlr: clear last_tuple when receiving auth tuplesNeels Hofmeyr3-6/+21
When receiving more than one auth tuple during AUTS resync, the VLR would go on to send the second tuple instead of the first. The unit test didn't catch that because its fake HLR message contained only one tuple. Adjust the test to send two tuples to catch this error. Fix the code to clear vlr_subscr->last_tuple whenever new auth tuples are received. Change-Id: I1f84e7d2619aa8d9a0dcdfb50745feeb040264b9
2017-03-09gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr8-15/+29
Before, each GSUP client would contact the HLR with an identical unit id, i.e. "SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by the wrong client. Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC" and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages. Todo: also set some values instead of the zeros. Change-Id: I3f8d6dd47c7013920e2a4bde006ed77afd974e80
2017-03-09SI3: indicate R99+ MSC to GSM MS to enable UMTS AKANeels Hofmeyr1-0/+3
Change-Id: Iaf11218327f139e8cabfbc5f9916505c66eadbd8
2017-03-09vlr: get SMS working, by SMS recipient MSISDN round-robinNeels Hofmeyr12-59/+463
The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Change-Id: I1acf9debb6ba9164e6edcfd5bc5e48e8c98f2b01
2017-03-09msc_vlr tests: add tests to reject concurrenct connsNeels Hofmeyr9-112/+2006
Change-Id: I5c04b1cf0ad302c35968e0f8dfb122997f3f7bf1
2017-03-09Add msc_vlr test suite for MSC+VLR end-to-end testsNeels Hofmeyr33-4/+12976
Change-Id: Ic073f3a069a7f5e7e421e0e56140f069ee9b10b8
2017-03-09Use libvlr in libmsc (large refactoring)Neels Hofmeyr61-3543/+1627
Original libvlr code is by Harald Welte <>, polished and tweaked by Neels Hofmeyr <>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. TODO: This commit may be split in several smaller changes before merging to master. Related: OS#1592 Change-Id: I702ba504ce2de93507312c28eca8d11f09f4ee8b
2017-03-09Add libvlr implementationHarald Welte17-0/+5394
Original libvlr code is by Harald Welte <>, polished and tweaked by Neels Hofmeyr <>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. Related: OS#1592 Change-Id: I3f75de5f0cc2ff77f276fd39832dd3621309c4b9
2017-03-09Introduce subscriber_connection ref-countingHarald Welte8-20/+64
This introduces a reference count for gsm_subscriber_connection. Every user of the connection needs to hold a reference until done. Once the reference count dorps to zero, the connection is cleared towards the BSC (which subsequently will clear any logical channels associated with it). Related: OS#1592 Change-Id: I8c05e6c81f246ff8b5bf91312f80410b1a85f15e
2017-03-09logging: auth request: use hexdump without spaces for RAND, AUTNNeels Hofmeyr1-2/+2
Change-Id: I656d8619a1adc93e2f627f4e1ba21512a7374279
2017-03-08add struct bsc_subscr, separating libbsc from gsm_subscriberNeels Hofmeyr30-115/+615
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC subscriber: struct bsc_subscr. Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no longer have a backpointer to gsm_network (used to be via subscr->group). Create a separate logging filter for the new BSC subscriber. The implementation of adjusting the filter context is added in libbsc to not introduce bsc_subscr_get/_put() dependencies to libcommon. During Paging Response, fetch a bsc_subscr from the mobile identity, like we do for the gsm_subscriber. It looks like a duplication now, but will make sense for the VLR as well as for future MSC split patches. Naming: it was requested to not name the new struct bsc_sub, because 'sub' is too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast to type, relatively short, unambiguous, and the naming is consistent. Add bsc_subscr unit test. Related: OS#1592, OS#1594 Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-03-07Add MS time. offset to gsm_lchanMax1-0/+6
Add MS TIMING OFFSET (3GPP TS 48.058 § 8.4.8) and P offset (3GPP TS 45.010 § 1.2) which can be used to compute MS TO from known TA. This will be used by osmo-bts (see I4dfe5c48834a083e757d5de3236a02e15a238b28) to provide MS TO as part of RSL MEASUREMENT RESULT. Change-Id: I8bda57c8d6c15bbb803eca708931556dae118a00 Related: OS#1574
2017-03-05vty tests: close msc socket after nat_msc_testNeels Hofmeyr1-23/+27
Change-Id: Ib64cf8690627803e1b4a8497ea63f1e766960478
2017-03-05sgsn: fix problem with leading-zero-IMSIsPhilipp Maier1-2/+11
When the IMSI ACL is maintained via the VTY, users may enter IMSIs without leading zeros. Especially in test environments, where MCC=001 and MNC=01 is common, it is likely that someone enters the corresponding IMSI (001010000000001) without the two zeros at the beginning. This patch fixes the problem by sanitizing the IMSI, eventually missing zeros in the beginning will be automatically added. Change-Id: I56ba0da61978bbdce71d0e320166c52b20b42517
2017-03-02vty tests: allow picking specific tests to run by nameNeels Hofmeyr1-0/+5
Depends: osmo-python-tests change-id I92f90c334169f31920c63dd5c5ac8dac215065e6 Change-Id: I849455e0423e1a63d6890aef7f9c6075ad53a920
2017-03-02Fix potential segfault in sgsn_libgtp.cMax1-3/+5
* print pdp->address instead of mm->imsi if mm is NULL * print mm->imsi in debug log (move it below NULL check) Change-Id: I4fbf5a54019a46612fbc528d61120182738f9205
2017-03-02subscriber conn: add indicator for originating RANNeels Hofmeyr3-1/+10
Add via_ran to gsm_subscriber_connection to indicate whether a conn is coming in via 2G/GERAN/A-Interface or 3G/UTRAN/Iu-Interface. Prepares for Iu, but also for libvlr to decide between GSM or UMTS Auth. Until actual Iu support is merged to master, this indicator will aid VLR unit testing. At some point we may also add RAN_GERAN_IU; it's not on the agenda yet, but to clearly distinguish the names if we want to add it, explicitly name the ones we have RAN_GERAN_A and RAN_UTRAN_IU. Change-Id: I93b870522f725170e4265a5543f6b680383d7465
2017-03-02fix: gprs_gmm, gprs_llc_vty: two unterminated value_string arraysNeels Hofmeyr2-0/+2
Change-Id: Icc4163ac4f962fe88bbebeb3310a557ba0834e84