aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-06-08HO: introduce T7, T8, T101 timersNeels Hofmeyr3-1/+20
Will be used in upcoming inter-BSC handover. Change-Id: If9ecccc793426d214019f299b19d6ffa5a186546
2018-06-08cosmetic: gscon: drop odd use of OSMO_STRINGIFYNeels Hofmeyr1-14/+14
Do not invoke OSMO_STRINGIFY() with arbitrary names, just quote instead. The idea was that OSMO_STRINGIFY() avoids typos by ensuring well-defined names are stringified, but this highlights that OSMO_STRINGIFY() is in fact usable with completely arbitrary arguments and actually lacks the validation part :/ Change-Id: I458cd2cd0d6ddb0e6db3bb8d546a20336ae8c5f1
2018-06-08doc: charts: illustrate new plan for ts and lchansNeels Hofmeyr12-465/+1097
Add lchan and timeslot FSM charts to illustrate planning of how osmo-bsc should handle lchan assignment and release. Modify assignment, handover, lchan-release charts according to the new plan. Change-Id: I18d60de5ee932c962aad0a532965a55d570bb936
2018-06-08doc: add ms-channel-request.mscNeels Hofmeyr2-0/+64
Change-Id: Iab22b8ae85a1a54d2f4002733e6068356368101b
2018-06-08doc: add lchan-release.mscNeels Hofmeyr2-0/+150
Change-Id: Ibcf2326cbc5a5f3f249ae15564825c83b5a063c8
2018-06-08doc: tweak msc charts on Assignment/Handover: act_timerNeels Hofmeyr2-2/+17
Change-Id: I6205e43c227652432548c5c99bed5a197c095da2
2018-06-08cosmetic: handover_test: add IMSI to subscr for loggingNeels Hofmeyr1-1/+11
Change-Id: I52fa8f3183c93ed362d8252d20daf00c60a117c8
2018-06-08store subscriber identity on pagingNeels Hofmeyr1-0/+1
Another small step towards being aware of the subscriber identity. Any connection initiated by paging will subsequently log the subscriber's identity -- of course not necessarily the IMSI, if paging was done by TMSI. This is only for Paging, not the Paging Response; for that see, L3 Complete. Related: OS#2969 Change-Id: I0ab7bedfe693bb4e42a04fb0585b94a730ff2d9b
2018-06-08try to pick up subsrc IMSI on l3-complNeels Hofmeyr1-1/+16
This is a tiny step towards being aware of a connection's subscriber identity. Iff the Layer 3 Complete message contains an IMSI, associate a bsc_subscr with the conn, so that subsequent logging and possibly meas_feed contains the IMSI. For any L3 Complete using TMSI, this has no effect whatsoever. Related: OS#2969 Change-Id: I3b696a0c0932e3abcb682ba231db65755d8c27a6
2018-06-08gscon: put subscriber a little laterNeels Hofmeyr1-6/+6
Keep the bsc_subscr associated with the conn as long as possible, to benefit logging, which then contains the subscriber identity (if any). Change-Id: Ifa528b58842a02509bfe0af6915c64bd67058bcd
2018-06-08cosmetic: bsc_subscr_alloc: log initial getNeels Hofmeyr2-3/+5
Instead of silently setting the use count to 1, instead increment with an explicit bsc_subsct_get(), which then logs the event along with the place that created the subscriber. Change-Id: Ia72f8010b7b2e1ca44e3b005c0f2c05f3eeae8d5
2018-06-08cosmetic: penalty timers: constify, tweak docNeels Hofmeyr2-10/+15
Change-Id: I28addc9a16a4c81978290303d368f630a8334228
2018-06-08use libosmocore's gsm0808_permitted_speech(), gsm0808_chosen_channel()Neels Hofmeyr1-84/+7
The guts of bssap_speech_from_lchan() and lchan_to_chosen_channel() have been moved to libosmocore; call those instead. The return value of bssap_speech_from_lchan() used to be -1 on error, now the error value is 0. The only caller did not handle -1 properly, but fed it directly to a uint8_t. On gsm0808_chosen_channel() error, log the error. Proper handling is missing. Fixing the error handling in send_ass_compl() is a separate issue: currently it is limited to logging, there is no way to return an error yet, nor any actions to take on error. Depends: Icca23940791f97fa64dbc3f2734270b99f9550c1 (libosmocore) Change-Id: Ib5c940a9dae11c5e26d4b47fa9d95fef889ad2f6
2018-06-08log: assignment: add two logs on unexpected lchan releaseNeels Hofmeyr1-0/+3
Change-Id: Ib61125ebc41e55dc4a6595db8c8559c62b3ed2c0
2018-06-08log: fix logging in rsl_rx_chan_act_nack()Neels Hofmeyr1-6/+9
In each code path within rsl_rx_chan_act_nack(), do separate logging of the NACK to ensure proper termination of each log line. When receiving a Chan Act NACK, we possibly mixed a LOGP() within an unterminated other LOGP() that had not been ended with a LOGPC() yet. Change-Id: Icd2772b21ef3a2ff5af11b7c92dff0ecb4d87ff0
2018-06-08assignment: signal assignment failure on chan act nackNeels Hofmeyr2-3/+5
When the BTS responds with a Chan Act NACK, i.e. the lchan could not be activated, immediately signal Assignment Failure to the MSC (in handle_chan_nack()). In handle_chan_nack(), adjust log: instead of waiting for timeout, we now signal Assignment Failure. Drop misleading logging from bsc_assign_fail(): instead of transmitting the Assignment Failure message, it actually signals an FSM event. Leave logging of that to the FSM logging. Change-Id: Ib204b4a5272f9b7b60ca5f932cd8a4c857316270
2018-06-07cosmetic: gscon: undup code: add common assignment_failed()Neels Hofmeyr1-36/+33
Call one common function to signal Assignment Failure and transition back to ST_ACTIVE. Change-Id: I1ce10a3ead286cdb6ad529fc293b6cecd151cc9a
2018-06-07cosmetic: magic number: use RSL_ACT_ constant for chan actNeels Hofmeyr1-1/+1
Change-Id: I64ac2a17634f18322828ee2aa2284b0513130488
2018-06-07remove struct bsc_apiNeels Hofmeyr7-198/+86
struct bsc_api was used to provide an abstract API for both osmo-bsc and osmo-msc, between BSC and MSC. That's no longer needed, so get rid of it, to prevent code turbulences it creates for no reason. Change-Id: I3fd5888c63a0b4f95520a498320aa105a6d60579
2018-06-07dissolve libbsc: move all to src/osmo-bsc, link .o filesNeels Hofmeyr75-843/+997
Move all of libbsc/ into osmo-bsc/, and separate/move some implementations to allow linking from utils/* and ipaccess/* without pulling in unccessary dependencies. Some utilities use gsm_network and gsm_bts structs, which already include data structures for fairly advanced uses. Move initialization that only osmo-bsc needs into new bsc_network_init() and bsc_bts_alloc_register() functions, so that the leaner tools can use the old gsm_* versions without the need to link everything (e.g. handover and lchan alloc code). In some instances, there need to be stubs if to cut off linking "just before the RSL level" and prevent dependencies from creeping in. - abis_rsl_rcvmsg(): the only program currently interpreting RSL messages is osmo-bsc, the utils are merely concerned with OML, if at all. - paging_flush_bts(): ip.access nanobts models call this when the RSL link is dropped. Only osmo-bsc actually needs to do anything there. - on_gsm_ts_init(): the mechanism to trigger timeslot initialization is related to OML, while this action to take on init would pull in RSL dependencies. utils/ and ipaccess/ each have a stubs.c file to implement these stubs. Tests implement stubs inline where required. From src/utils/, src/ipaccess/ and tests/*/, link in .o files from osmo-bsc/. In order for this to work, the osmo-bsc subdir must be built before the other source trees. (An alternative would be to include the .c files as sources, but that would re-compile them in every source tree. Not a large burden really, but unless linking .o files gives problems, let's have the quicker build.) Minor obvious cleanups creep in with this patch, I will not bother to name them individually now unless code review asks me to. Rationale: 1) libbsc has been separate to use it for osmo-nitb and osmo-bsc in the old openbsc.git. This is no longer required, and spreading over libbsc and osmo-bsc is distracting. 2) Recently, ridiculous linking requirements have made adding new functions cumbersome, because libbsc has started depending on osmo-bsc/*.c implementations: on gscon FSM and bssap functions. For example, neither bs11_config nor ipaccess-config nor bts_test need handover_cfg or BSSMAP message composition. It makes no sense to link the entire osmo-bsc to it, nor do we want to keep adding stubs to each linking realm. Change-Id: I36a586726f5818121abe54d25654819fc451d3bf
2018-06-07bsc_test: drop "scan to MSC" code pathNeels Hofmeyr1-7/+0
The TEST_SCAN_TO_MSC is completely unused, but still the code linked bsc_scan_bts_msg() for the unused code path. This is unlikely to ever be expanded. Remove TEST_SCAN_TO_MSC and reduce linking requirements. (I am this close to dropping the test entirely to avoid continuous linking annoyance, but ok, since nothing else tests timezones AFAIK, keeping it.) Change-Id: I27521950432e412f919cde811c9473557d0ec25e
2018-06-07tests: remove channel_testNeels Hofmeyr6-165/+0
Rationale: channel_test is trivial and useless, probably only exists as a legacy from openbsc.git. - it tests two printf()s of "(bts=45,trx=0,ts=3,ss=4)", hardly useful. - it tests ts_subslots() behavior for dyn ts, which will soon be replaced by a most trivial mapping that does no longer need complex dyn ts state evaluation (when introducing the new timeslot FSM to handle dyn TS switchover). Change-Id: Ib2232da8e7fa964b92492d7b778320401dc97703
2018-06-07tests: remove bssap_testNeels Hofmeyr7-247/+0
Rationale: - All it does is compose four Paging Requests and feed it into the osmo-bsc bssap_udt, and expects the cell identifier to be decoded properly. - To do so it employs a comparatively huge linking effort. This linking effort is becoming annoying in my ongoing work and is just not worth it. - We have comprehensive cell identifier tests in ttcn3, verifying that the proper cells are paged, and that actually for *all* cell identifier types. Change-Id: I07cf23b66de36cfa1142a11b9f85e9c0190ee314
2018-06-07increment 'paging responded' counter for active paging onlyStefan Sperling1-8/+12
Only count paging responses which can be mapped to an active paging. Unsolicited paging responses which do not correspond to an active paging would increment the 'paging response' counter. This means the number of paging attempts could be smaller than the number of paging responses, which can look confusing in the 'show statistics' VTY command. Change-Id: I7cfc7c29fb7570d41e3ac23cca17f5b98b303506 Related: OS#66
2018-06-05Reject ASSIGNMENT REQ with CIC but no AoIP transp addr in AoIP caseHarald Welte1-8/+25
If we receive a BSSMAP ASSIGNMENT REQ for a speech channel containing only a CIC but no AoIP transport layer address, then that's illegal and must be rejected. In Change-Id If362a0084de452727cd063063dfb645eca2f9beb we re-introduced accepting CIC-only ASSIGNMENT REQ, but we failed to verify that this actually only happens over a SCCPlite A interface. This fixes the BSC_Tests.TC_assignment_cic_only testcase. Change-Id: Ia6e3897edca48b9f838ea69939d9b8be7185abf8
2018-06-03LCLS: add VTY config to enable/disable LCLS on per-MSC basisHarald Welte3-0/+34
The user might not want to enable LCLS support for administrative reasons. So let's keep it disabled by default, until somebody explicitly enables it with "lcls-mode mgw-loop". In the future, we may want to introduce a "lcls-mode bts-loop" where we don't loop at the BSC-colocated MGW, but where we instruct the BTSs to feed the RTP directly to each other. This would require a falt/transparent IP routing between the BTSs in the RAN. Change-Id: Ied7985056c8cd182bf16119007a08cc5be14459b Related: OS#1602
2018-06-02Add initial 3GPP LCLS support to OsmoBSCHarald Welte11-1/+981
This code contains the following code: * receive/parse/interpret LCLS specific BSSMAP IEs and PDUs * osmo_fsm handling the various states and their transitions * call leg correlation (finding the other subscr_conn with same GCR) * communication between the two call-leg LCLS FSMs * detection of supported / unsupported LCLS configurations * display of GCR / LCLS information in "show conns" * switch the media streams locally using MDCX to the MGW Closes: OS#1602 Change-Id: I614fade62834def5cafc94c4d2578cd747a3f9f7
2018-06-02VTY: Print some more information in "show conns"Harald Welte1-2/+13
We now print information such as * SCCP connection ID * MSC number * handover decision2 fail count * channel mode (SIGN/SPEECH) * MGW endpoint * secondary lchan (if any, e.g. during assignment) * don't crash if conn->lchan == NULL Change-Id: I2f8000844afc9da93ca39976399e5f76a45530de
2018-05-30abis_rsl: rsl_rx_chan_rqd: Format bts log string as in everywhere elsePau Espin Pedrol1-3/+3
Change-Id: I7928d78e2ce3e6eca545455d08bc89ca67e01f9f
2018-05-30abis_rsl.c: Fix whitespacePau Espin Pedrol1-8/+8
Change-Id: I67659275beda1b6a89bdf11eb0231438b0c8b912
2018-05-30chan_alloc: Print bts nr on chan alloc failurePau Espin Pedrol1-3/+3
Also change format of related debug message to match similar format than gsm_ts_and_pchan_name(). Change-Id: Id4f875944c40fd862fc63feec82216c45d2e41c2
2018-05-28doc: add msc charts on Assignment/Handover internalsNeels Hofmeyr3-0/+357
In doc/, add two message sequence charts with lots of implementation specifics, to clarify the current code state. Mark various problems in red notes. This chart and others should help to illustrate future code changes as I go along refactoring handover, lchan allocation and adding inter-BSC handover. Change-Id: I20999e938441d4fed2d37462b262b74a696f616d
2018-05-28acc_ramp: Increase log level of some messagesPau Espin Pedrol1-4/+4
Right now, it's impossible to see any ACC Ramping information unless RSL category is set to DEBUG. Barring and Allowing Access Control Class is an important event which should be printed in most cases. Increase log levels of messages printed during some error conditions to be handled as errors. Change-Id: I5404e91fe7c0b3209e8033594e659387bbc924d6
2018-05-27move 'extern struct gsm_network *bsc_gsmnet" to header fileHarald Welte8-20/+8
It's not a good idea to keep extern declarations copied over half a dozen C files. Let's move it to a header. Change-Id: I6f643f1393ba0955d9c0cf1cf78d5c604e7b9451
2018-05-27Remove 'struct bsc_msc_connection' + fix IPA-encapsulated CTRLHarald Welte16-506/+182
The bsc_msc_connection dates back to the old pre-libosmo-sigtran days, and 90% of the field members weren't used at all (even the new sigtran specific ones!). Let's merge what remains into struct bsc_msc_data. As a side effect, the already dysfunctional "dest A.B.C.D" VTY command has been removed from the MSC node. There's quite a bit of fall-out in the CTRL interface, which was the code with strongest ties to bsc_msc_connection. This was resolved by properly porting CTRL handling over to libosmo-sigtran, meaning that an IPA/SCCPlite connected MSC can now again send CTRL GET/SET commands, and can also receive those selective few TRAPs that old osmo-bsc-sccplite also sent to its MSC[s]. Change-Id: I6b7354f3b23a26bb4eab12213ca3d3b614c8154f Related: OS#2012
2018-05-27remove remaining bits of osmo-bsc_natHarald Welte39-10806/+2
osmo-bsc_nat is too heavily tied into legacy SCCPlite code, as it is not using libosmo-sigtran/osmo_ss7 so far. It's also full of customer-specific code and it's shared use of some libbsc code here has been complicating osmo-bsc development. The current plan is to continue to use osmo-bsc_nat from openbsc.git for those legacy users that need it, and not use osmo-bsc_nat in new 3GPP AoIP setups. Should we ever get a strong demand for an AoIP based bsc_nat, we can still revisit this later. Change-Id: Ia05dc76336a64a7f08962843b9a7cc19f2c83387
2018-05-25bsc: Don't create MSC-side MGCP connection in IPA/SCCPlite caseHarald Welte1-9/+19
In IPA/SCCPlite, the MSC is handling MGCP to the BSC-MGW directly and the BSC only takes care of the BTS-side MGCP connection. We achieve this by transitioning directly from WAIT_MDCX_BTS into ACTIVE in this case. Change-Id: I96179b4324b976bded36023a8ccbdc007b6b3e05 Related: OS#2544
2018-05-25bsc: Don't include AoIP IEs in ASSIGNMENT COMPLETE over SCCPliteHarald Welte1-6/+12
Change-Id: I6ace15f368b5ba6e5c8845ea21d17dd3a7a15be7
2018-05-25bsc: Don't reject ASSIGNMENT for Audio in IPA/SCCPlite caseHarald Welte1-13/+1
Change-Id: If362a0084de452727cd063063dfb645eca2f9beb
2018-05-25bsc: Use correct MGCP endpoint name for IPA/SCCPliteHarald Welte1-1/+20
In IPA/SCCPlite, we have to use the CIC to construct the MGCP endpoint name instead of the usual dynamic endpoint allocation. Change-Id: I03e2cdbc8e40169e52df3720c40b66734e880525
2018-05-25bsc: Add mgcp_port_to_cic() to determine CIC from RTP PortHarald Welte2-13/+22
Also: Move mgcp_timeslot_to_port() next to it, as they are more or less the inverse transformation of each other. Change-Id: Ica908e2bb8fc4e59e0d146b428c93a9efc385688
2018-05-25vty: Permit selection of other ASP protocol than M3UAHarald Welte4-1/+21
We used to have hard-coded M3UA. Let's allow the user to configure this per MSC using a new "asp-protocol (m3ua|sua|ipa)" VTY command. For SUA this should just work 1:1 without any trouble. For IPA, this of course only changes the underlying transport without reflecting the various differences in terms of BSSMAP ASSIGNMENT, MGCP handling, etc. Change-Id: I0800c709e574cedd7f5dd98be81c78782245cd13 Related: OS#2544
2018-05-25bsc: Fix check for MSC-side FSM allocation failureHarald Welte1-1/+1
In gscon_fsm_wait_mdcx_bts() we try to allocate conn->user_plane.fi_msc but then check whether conn->user_plane.fi_bts is set, possibly due to a copy+paste error. Let's fix that. Change-Id: I1f515910f67492257866791588f32b350fadf815
2018-05-24fix misaligned memory write access in abis_nm_ipaccess_rsl_connect()Stefan Sperling1-1/+1
Use memcpy() to avoid unaligned access, instead of writing through a pointer cast to uint32_t. Problem spotted by address sanitizer: abis_nm.c:2802:24: runtime error: store to misaligned address 0x7ffc95396706 for type 'uint32_t', which requires 4 byte alignment 0x7ffc95396706: note: pointer points here 81 0b bb 80 00 00 00 00 ed 79 28 56 00 00 e0 9c 00 00 a0 61 00 00 ... ^ Related: OS#3196 Change-Id: I8e591a56ae522b371da01ea968151a7e6fa24bb9
2018-05-23gscon: remove dead codePhilipp Maier2-45/+1
The state ST_WAIT_MODE_MODIFY_ACK can never be reached by the current FSM model. - Remove ST_WAIT_MODE_MODIFY_ACK and all related code Change-Id: Iacaae2ee50ca1956066b7dce4517bbc9c2b0897e Related: OS#2762
2018-05-23cosmetic: logging and ordering in handle_ass_compl()Neels Hofmeyr1-18/+20
* Check the message length once at the start, before any other actions. * Use only one local gsm48_hdr pointer. * Read the cause value once near the top, re-use it. * Log "ASSIGNMENT COMPLETE" always, not only during handover. * Fully initialize local struct lchan_signal_data. Change-Id: Idcfd932d3dfb0b621ed6d8c4f92c0231abcdcec8
2018-05-23cosmetic: define TCH_F_PDCH_PENDING_MASK as actual bitwise orNeels Hofmeyr1-2/+1
Change-Id: I5266d6e1ea0ea89c66fa481136c31e2f84bcb313
2018-05-23cosmetic: bsc_dyn_ts.c: make local functions staticNeels Hofmeyr1-2/+2
Change-Id: Iee47b4ffefedf9532e11f17d5f9b603fc8872cb9
2018-05-23abis_rsl.h: drop unused rsl_chan_activate() declarationNeels Hofmeyr1-6/+0
Change-Id: I28a48dc9a1719793d369468aa9a4bdcf460d201c
2018-05-23bsc_api.c: actually log with contextNeels Hofmeyr2-43/+58
bsc_api.c notoriously lacks log context. Provide gsm_lchan_name() and/or bsc_subscr_name() in roughly a million instances, using new LOGPLCHAN macro. Add LOGPLCHAN() to gsm_data.h, to encourage use of it in other .c files. Change-Id: If469defcc6fe8950dac5df61db3f39d297893318