aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2018-05-18show all global counters of osmo-bsc in vtyStefan Sperling1-3/+3
The 'show statistics' VTY command was not showing all counters maintained by osmo-bsc. Instead of printing just two counters related to paging, print all available counters in a generic way. Adjust descriptions of some counters for nicer display. After startup (all counters are zero) is now looks like this: OsmoBSC# show statistics handover:attempted: 0 Received handover attempts. handover:no_channel: 0 Sent no channel available responses. handover:timeout: 0 Timeouts of timer T3103. handover:completed: 0 Received handover completed. handover:failed: 0 Received HO FAIL messages. paging:attempted: 0 Paging attempts for a subscriber. paging:detached: 0 Paging request send failures because no responsible BTS was found. paging:responded: 0 Paging attempts with successful response. OsmoBSC# Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655 Related: OS#3245
2018-05-17a_reset: cleanup + remove dead codePhilipp Maier2-30/+8
The function a_reset_free() is not used anywhere at the code. The reason for this is that a BSC instance is never cleared once it is started up. Also the timer number is not according to the spec. - Remove a_reset_free() - Fix timer identification number (T4) - use fi->priv to hold context info - Fix sourcecode formatting Change-Id: I72095d52304c520e383755eee6c889bce492cbd4 Related: OS#3102
2018-05-10dyn TS: init only when both RSL and the Channel OM are establishedNeels Hofmeyr1-0/+7
Recent Icf6e25ff068e8a2600562d52726ead65e864ec02 changed the dyn_ts_init() hook from bootstrap_rsl() to the Channel OPSTART ACK, but this is not sufficient. Now RBS2k never calls dyn_ts_init(), and we may need to wait for RSL: Dyn TS should actually be initialized only when *both* OML opstart and RSL link are established. To that end, introduce a generalized API to query OML and RSL status and to trigger a timeslot init at the appropriate time. Add gsm_ts_check_init() to be called both when RSL and OML opstart are established: trigger gsm_ts_init() only when both are given. Add gsm_bts_trx_ts->initialized flag to mark whether initialization has already taken place. Add gsm_bts_mark_all_ts_uninitialized() to conveniently clear this flag for all TS in a BTS. Add gsm_bts_model.oml_is_ts_ready() callback so that each BTS implementation can return the OML status of a timeslot in its own OML implementation. Actually, currently all BTS models that need this init mechanism store the TS' OML status in ts->mo.nm_state. While we would in practice correctly init dyn TS by just looking at ts->mo.nm_state, semantically, the decision whether the TS is ready is up to the BTS models' specific OML implementations. From bootstrap_rsl(), call gsm_ts_check_init(), in case the TS OML Opstart has happened before RSL is established -- applies to all BTS models. For all BTS models: - call gsm_{bts,trx}_mark_all_ts_uninitialized() when OM is torn down, to make sure the TS init mechanism will work a second time. For all BTS models supporting dyn TS, i.e. osmo-bts, nanobts and RBS2k: - implement oml_is_ts_ready(). - call gsm_ts_check_init() when a Channel OM is taken into operation. Any BTS models that don't set oml_is_ts_ready() will see a ts init as soon as RSL is bootstrapped (incidentally, the old dyn TS behavior before recent Icf6e25ff068e8a2600562d52726ead65e864ec02). This firstly fixes dyn TS for RBS2k by re-adding the initial switch to PDCH, and furthermore does so only after both OML TS opstart and RSL are through. This fixes the ttcn3-bsc-tests around dyn TS, since for the osmo-bts-virtual, the RSL is established only after OML opstart on the TS, which was broken by Icf6e25ff068e8a2600562d52726ead65e864ec02. Nokia Site and Siemens BS11 practically do not require this init mechanism, since all that happens there so far is dyn TS init, and these BTS models do not support dyn TS of any kind. A future patch may add oml_is_ts_ready(). Related: OS#3205 Change-Id: I99f29d2ba079f6f4b77f0af12d9784588d2f56b3
2018-05-05dyn ts, bts_ipaccess_nanobts.c: init PDCH on Chan OPSTART ACKNeels Hofmeyr1-0/+1
Sending PDCH activation upon RSL bootstrap is too early. Introduce OPSTART ACK handling to call dyn_ts_init() only when the dynamic timeslot is indeed ready to receive a PDCH activation. Related: OS#3205 Change-Id: Icf6e25ff068e8a2600562d52726ead65e864ec02
2018-05-04resurrect meas_feed.c: vty, vty-testNeels Hofmeyr1-3/+5
At this point, meas-feed is usable again, however, osmo-bsc is not able to include the IMSI in every report like osmo-nitb did. In consequence, the meas-vis and meas-web tools are unable to handle the current measurement reports: these so far use the IMSI to list reports, and all reports without an IMSI are collapsed onto the same line, swapping values. So though osmo-bsc now sends usable measurement reports via meas-feed, two avenues to improve should be pursued: OS#3192: the visualization tools should use bts,ts,ss numbers, not IMSI. OS#2969: osmo-bsc should always know a mobile identity. Related: OS#2968 Change-Id: I186c7a995dd2b81746c32a58b55da64ed195a1ce
2018-04-23gsm_data_shared.h: Remove unused enum gsm_paging_eventPau Espin Pedrol1-7/+0
Change-Id: I13f30177a4840d68e3d374861fb9c76e9842be2e
2018-04-11ensure that acc_ramp_init() is only called onceStefan Sperling1-2/+14
There are plans to register signal handlers in acc_ramp_init(). Once we do that, the acc_ramp_init() function should only be called once to avoid duplicate signal handlers on the handler list. However, the acc_ramp_init() function currently serves a dual-purpose: 1) Initialize the acc_ramp structure for a bts 2) Enable or disable ACC ramping Add new functions to support use case 2, and call acc_ramp_init() just once while reading the configuration file. The VTY commands which enable/disable ACC ramping use the new APIs instead. Also, rename acc_ramp_start() to acc_ramp_trigger() and tweak its semantics so that it can always be called regardless of what the current configuration settings are. This prepares us for triggering ACC ramping upon events other than "RSL link-up". Change-Id: Ia25bff85d9e5c277da76bffa11d31972e9fdc323 Related: OS2591
2018-04-11bsc_nat: Drop redundant ccon ptr in bsc_cmd_listPau Espin Pedrol1-3/+0
It can be obtained from cmd field, so no need to store it in pending. This way we simplify the ad-hoc struct bsc_cmd_list. Change-Id: I6de64fc128ad623ca30b9e6cebebaff8de18f95d
2018-04-02cosmetic: remove dead codePhilipp Maier1-7/+0
There is a lot of dead code in osmo_bsc_msc.c that used to handle the IPA multiplexed SSCP lite A interface. - remove portions of the dead code - remove IPA Ping related VTY commands Change-Id: I5cf3fec31cc774c902f3cfe6d16fb85ef301694a
2018-03-22vty: drop unused vty definitions (*_NODE, msc_*)Neels Hofmeyr1-14/+0
Change-Id: I2a6516756bada8cc9375422e4f93891ab8d65ca5
2018-03-22bssmap: State correct speech codec in ASSIGNMENT COMPLETEHarald Welte2-9/+1
Correctly compute the TS 48.008 "speech mode" (codec) for AMR on TCH/F. There are way too many different ways how to express a given voice codec. There are two different schemes in TS 48.008 alone, plus one on TS 48.058 and one in 04.08 / 44.018. Let's avoid unneeded conversion (that we might get wrong) and avoid storing information in a sub-struct of the lchan if we can simply derive it from the lchan at the time we need it. Also, move BSSAP related encoding/conversion functions closer to the user (osmo_bsc_bssap), rather than in libbsc. Without this patch, TCH/F with AMR was erroneously reported as TCH/H with AMR in the BSSMAP ASSIGNMENT COMPLETE. After this patch, it's reported correctly. Change-Id: I6feebfae77fdc93a7ce333a25dd9b9267c5a4a2e Related: OS#3094 Related: OS#3095 Related: OS#3096
2018-03-22cosmetic: fix typoPhilipp Maier1-1/+1
Change-Id: I36ed82dcb6010b331fe247a60f373d8e2e8a4bfc Related: OS#2823
2018-03-22cosmetic: remove unused enum membersPhilipp Maier1-6/+0
The enum gscon_fsm_event has three unused members. - remove GSCON_EV_RR_HO_ACC, GSCON_EV_RR_HO_COMPL, GSCON_EV_RR_HO_FAIL Change-Id: I301f7160b9ec8380849f9c9906b41c121a54f49f Related: OS#2823
2018-03-22cosmetic: abis_nm: use osmo_cell_global_id, parse 3-digit MNCNeels Hofmeyr1-8/+1
Instead of a local redefinition, use osmo_cell_global_id. This change is cosmetic because the decoded PLMN is currently actually never used. Change-Id: I38ac98a4d25159cfd4f686efbfbaf8f00625a6d8
2018-03-17RR: Send RR STATUS in case of unsupported/unknown messageHarald Welte1-0/+3
This fixes BSC_Tests.TC_err_84_unknown_msg Related: OS#2903 Change-Id: I7ecb48971c6a162c7f4c749d128c31d0dbc4916f
2018-03-16introduce an osmo_fsm for gsm_subscriber_connectionHarald Welte8-87/+114
In the current implementation of osmo-bsc, the subscriber connection is not handled (very) statefully. However, there is some state keeping in the code that handles the mgcp connection, but there are still to much loose ends which allow odd situations to happen, which then lead severe error situations (see also closes tags at the end) This commit adds a number of improvements to fix those problems. - Use an osmo-fsm to control the gsm_subscriber_connection state and make sure that certain operations can only take place at certain states (e.g let connection oriented SCCP traffic only pass when an SCCP connection actually exists. Remove the old osmo_bsc_mgcp.c code. Use the recently developed MGCP client FSM to handle the MGCP connections. Also make sure that stuff that already works does not break. This in particular refers to the internal handover capability and the respective unit-tests. See also OS#2823, OS#2768 and OS#2898 - Fix logic to permit assignment to a signalling channel. (OS#2762) - Introduce T993210 to release lchan + subscr_conn if MSC fails to respond The GSM specs don't have an explicit timer for this, so let's introdcue a custom timer (hence starting with 99). This timeout catches the following situation: * we send a SCCP CR with COMPL_L3_INFO from the MS to the MSC, * the MSC doesn't respond (e.g. SCCP routing failure, program down, ...) The MS is supposed to timeout with T3210, 3220 or 3230. But the BSC shouldn't trust the MS but have some timer on its own. SCCP would have a timer T(conn est), but that one is specified to be 1-2min and hence rather long. See also: OS#2775 - Terminate bsc_subscr_conn_fsm on SCCP N-DISC.ind from MSC If the MSC is disconnecting the SCCP channel, we must terminate the FSM which in turn will release all lchan's and other state. This makes TC_chan_rel_hard_rlsd pass, see also OS#2731 As a side-effect, this fixes TC_chan_act_ack_est_ind_refused(), where the MSC is answering with CREF to our CR/COMPL_L3. - Release subscriber connection on RLL RELEASE IND of SAPI0 on main DCCH The subscriber connection isn't really useful for anything after the SAPI0 main signalling link has been released. We could try to re-establish, but our best option is probably simply releasing the subscriber_conn and anything related to it. This will make TC_chan_rel_rll_rel_ind pass, see also OS#2730 This commit has been tested using the BSC_Tests TTCN3 testsuit and the following tests were passed: TC_chan_act_noreply TC_chan_act_ack_noest TC_chan_act_ack_est_ind_noreply TC_chan_act_ack_est_ind_refused TC_chan_act_nack TC_chan_exhaustion TC_ctrl TC_chan_rel_conn_fail TC_chan_rel_hard_clear TC_chan_rel_hard_rlsd TC_chan_rel_a_reset TC_rll_est_ind_inact_lchan TC_rll_est_ind_inval_sapi1 TC_rll_est_ind_inval_sapi3 TC_rll_est_ind_inval_sacch TC_assignment_cic_only TC_assignment_csd TC_assignment_ctm TC_assignment_fr_a5_0 TC_assignment_fr_a5_1_codec_missing TC_assignment_fr_a5_1 TC_assignment_fr_a5_3 TC_assignment_fr_a5_4 TC_paging_imsi_nochan TC_paging_tmsi_nochan TC_paging_tmsi_any TC_paging_tmsi_sdcch TC_paging_tmsi_tch_f TC_paging_tmsi_tch_hf TC_paging_imsi_nochan_cgi TC_paging_imsi_nochan_lac_ci TC_paging_imsi_nochan_ci TC_paging_imsi_nochan_lai TC_paging_imsi_nochan_lac TC_paging_imsi_nochan_all TC_paging_imsi_nochan_plmn_lac_rnc TC_paging_imsi_nochan_rnc TC_paging_imsi_nochan_lac_rnc TC_paging_imsi_nochan_lacs TC_paging_imsi_nochan_lacs_empty TC_paging_imsi_a_reset TC_paging_counter TC_rsl_drop_counter TC_classmark TC_unsol_ass_fail TC_unsol_ass_compl TC_unsol_ho_fail TC_err_82_short_msg TC_ho_int Authors: Harald Welte <laforge@gnumonks.org> Philipp Maier <pmaier@sysmocom.de> Neels Hofmeyr <neels@hofmeyr.de> Closes: OS#2730 Closes: OS#2731 Closes: OS#2762 Closes: OS#2768 Closes: OS#2775 Closes: OS#2823 Closes: OS#2898 Closes: OS#2936 Change-Id: I68286d26e2014048b054f39ef29c35fef420cc97
2018-03-12gsm_data: use feature list from libosmocorePhilipp Maier1-31/+1
In order to avoid code duplication the feature list (bit masks) and the desciptive value strings as well as the function to set and get the feature bits have been moved to libosmocore. - use feature list functionality provided by libosmocore Depends: libosmocore Change-Id Id0c35aef11aa49aa40abe7deef1f9dbd12210776 Change-Id: I3e80517539cc5d0e5d8189d434a5e3cc0fdea1a0
2018-03-11pcu_if: implement support for 3-digit MNCNeels Hofmeyr1-2/+4
Add the mnc_3_digits member to the info_ind. Instead of changing to e.g. osmo_plmn_id, add the flag separately, and instead of bool use a uint8_t, to not raise any struct packing issues and clarify the flag's size beyond any doubt. Bump the PCU interface version to 9. This is one part of the three identical pcuif_proto.h patches: - I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts) - I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu) - I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc) Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore) Change-Id: I78f30aef7aa224b2e9db54c3a844d8f520b3aee0
2018-03-07implement support for 3-digit MNC with leading zerosNeels Hofmeyr2-5/+15
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout the code base to be able to handle an MNC < 100 that has three digits (leading zeros). The changes to abis_test and gsm0408_test show that this code now handles 3-digit MNC correctly, by not dropping the leading zero as 0xf in the encoded PLMN. Re-implement CTRL commands 'mcc', 'mnc' and 'mcc-mnc-apply' to preserve the presence of the third digit of the MNC. Always reply with all leading zeros. Adjust the expected results in ctrl_test_runner.py, to show that it works. In VTY and CTRL, the parsing of MCC and MNC is inherently made stricter by use of osmo_{mcc,mnc}_from_str() -- they will no longer allow surplus characters and detect errno returned by strtol() (in contrast to atoi()). Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore), Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore), I020a4f11791c61742a3d795f782805f7b7e8733e (libosmocore) Change-Id: I8e722103344186fde118b26d8353db95a4581daa
2018-03-05cosmetic: bsc_network_init(): imply default 001-01 PLMNNeels Hofmeyr1-3/+1
All callers pass mcc=1, mnc=1, so just have it as default. (Prepare for net->country_code etc to be replaced by net->plmn) Change-Id: Ic16bc0bab3f2d4721e86a1a04f9d9f988d777df2
2018-03-05gsm48_ra_id_by_bts(): struct gsm48_ra_id* instead of bufNeels Hofmeyr1-1/+1
Move from using deprecated gsm48_construct_ra(), which uses a buf, to gsm48_encode_ra(), which uses a gsm48_ra_id argument. Pass struct gsm48_ra_id around instead of a buf. struct gsm48_ra_id is the "encoded" representation of the bytes in a typical MCC-MNC-LAC-RAC (04.08 Routing Area Id IE, 3GPP TS 24.008 ยง 10.5.5.15). Using the struct spares using magic numbers for byte offsets. In the process, fix a sanitizer warning for unaligned access by using memcpy() instead of pointer assignment: osmo-bsc/src/libbsc/abis_nm.c:2857:27: runtime error: store to misaligned address 0x7ffe8e0d6695 for type 'uint16_t', which requires 2 byte alignment Note that (besides removing a now unnecessary cast) the gsm0408_test and abis_test tests of RAI / CGI encoding remain stable, which indicates that the new code is still correct. Change-Id: I0d3908fb8ca1e2e669d257b5d59b40675fa85d06
2018-02-28pcuif_proto.h: add features of version 7 (txt indication)Alexander Couzens1-1/+16
The txt indication has been introduced with version 7, but forgotten to sync back to this repo. Change-Id: Iafef7dae8b84f659a1aca1677b30a38a2e5558dc
2018-02-28pcuif_proto.h: fix whitespaces and indentionAlexander Couzens1-5/+5
Change-Id: Ic676bb046a8ee254b9ee8d0d126ce79e6057cfb3
2018-02-27Add support for Access Control Class ramping.Stefan Sperling3-0/+155
Access Control Class (ACC) ramping is used to slowly make the cell available to an increasing number of MS. This avoids overload at startup time in cases where a lot of MS would discover the new cell and try to connect to it all at once. Ramping behaviour can be configured with new VTY commands: [no] access-control-class-ramping access-control-class-ramping-step-interval (<30-600>|dynamic) access-control-class-ramping-step-size (<1-10>) (The minimum and maximum values for these parameters are hard-coded, but could be changed if they are found to be inadequate.) The VTY command 'show bts' has been extended to display the current ACC ramping configuration. By default, ACC ramping is disabled. When enabled, the default behaviour is to enable one ACC per ramping step with a 'dynamic' step interval. This means the ramping interval (time between steps) is scaled to the channel load average of the BTS, i.e. the number of used vs. available channels measured over a certain amount of time. Below is an example of debug log output with ACC ramping enabled, while many 'mobile' programs are concurrently trying to connect to the network via an osmo-bts-virtual BTS. Initially, all ACCs are barred, and then only one class is allowed. Then the current BTS channel load average is consulted for scheduling the next ramping step. While the channel load average is low, ramping proceeds faster, and while it is is high, ramping proceeds slower: (bts=0) ACC RAMP: barring Access Control Class 0 (bts=0) ACC RAMP: barring Access Control Class 1 (bts=0) ACC RAMP: barring Access Control Class 2 (bts=0) ACC RAMP: barring Access Control Class 3 (bts=0) ACC RAMP: barring Access Control Class 4 (bts=0) ACC RAMP: barring Access Control Class 5 (bts=0) ACC RAMP: barring Access Control Class 6 (bts=0) ACC RAMP: barring Access Control Class 7 (bts=0) ACC RAMP: barring Access Control Class 8 (bts=0) ACC RAMP: barring Access Control Class 9 (bts=0) ACC RAMP: allowing Access Control Class 0 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average (bts=0) ACC RAMP: allowing Access Control Class 1 (bts=0) ACC RAMP: step interval set to 354 seconds based on 59% channel load average (bts=0) ACC RAMP: allowing Access Control Class 2 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average (bts=0) ACC RAMP: allowing Access Control Class 3 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average Change-Id: I0a5ac3a08f992f326435944f17e0a9171911afb0 Related: OS#2591
2018-02-19HO: vty: rename ho decision 1 vty to 'handover1' with 'handover' aliasNeels Hofmeyr1-28/+29
Handover decision 2 arguments are now configured by 'handover2 foo'. To match that scheme, rename the previously 'handover foo' args for handover decision 1 to 'handover1 foo'. For backwards compatibility, still provide aliases of the original VTY commands. Writing back the config will result in 'handover1' though. Change-Id: I7305ae7c04cc70082cd80d42b2ba32ffa399f51a
2018-02-19HO: Implement load based handover, as handover_decision_2.cNeels Hofmeyr4-0/+18
Change-Id: Ie597eae82722baf32546331e443dd9d94f1f25e6
2018-02-19HO: introduce ho decision callbacksNeels Hofmeyr1-1/+80
Instead of reacting on S_LCHAN* signals in the handover decision code, introduce callbacks for the handover decision to be invoked by handover_logic.c at the appropriate time. The rationale is explained in a comment to struct handover_decision_callbacks, quoting: " All events that are interesting for handover decision are actually communicated by S_LCHAN_* signals, so theoretically, each handover algorithm could evaluate those. However, handover_logic.c cleans up handover operation state upon receiving some of these signals. To allow a handover decision algorithm to take advantage of e.g. the struct bsc_handover before it is discarded, the handover decision event handler needs to be invoked before handover_logic.c discards the state. For example, if the handover decision wants to place a penalty timer upon a handover failure, it still needs to know which target cell the handover failed for; handover_logic.c erases that knowledge on handover failure, since it needs to clean up the lchan's handover state. The most explicit and safest way to ensure the correct order of event handling is to invoke the handover decision algorithm's actions from handover_logic.c itself, before cleaning up. This struct provides the callback functions for this purpose. For consistency, also handle signals in this way that aren't actually in danger of interference from handover_logic.c (which also saves repeated lookup of handover state for lchans). Thus, handover decision algorithms should not register any signal handler at all. " Also: - Publish struct bsc_handover to use it as argument to above callbacks. - Add enum hodec_id to struct bsc_handover, to be able to signal the appropriate hodec algorithm per event. - Add hodec_id argument to bsc_handover_start*() to be placed in the bsc_handover struct. - Publish the LOGPHO logging macros in handover.h along with struct bsc_handover, convenient for logging in callback implementations. Replace handover_decision.c's signal handler with a registered handover_decision_callbacks instance. (Upcoming handover_decision_2 will use all of the callbacks introduced here.) Change-Id: Id5b64504007fe03e0406a4b395cd0359232b77d2
2018-02-19HO: clearly mark conn penalty timer member for hodec2Neels Hofmeyr1-1/+3
The conn's penalty timers will be used only for handover decision 2, make it clear by a sub-struct. hodec2 will also initialize the penalty timer list on demand only, so no need to always initialize. Change-Id: Ie6c2bc2b10dc424dfd94a9e11a9a62f51c48aa10
2018-02-19HO: lchan: store last seen measurement report nr, tweak logNeels Hofmeyr1-0/+1
Handover decision 2 will also store the last seen mr nr for neighbor cell measurements and hence can tell whether a neighbor's measurement is outdated. Change-Id: Ic1148364597f91b5a55666c80c758b61fa56f582
2018-02-19HO: cfg: separate hodec1 from hodec2 parametersNeels Hofmeyr1-52/+112
Do not share config items between the current handover decision and the upcoming handover_decision_2. Rename current handover config items to hodec2_* and duplicate the ones relevant to handover decision algorithm 1 with name prefix of hodec1_*. I considered moving hodec2 parameters to an entirely separate .c file and struct, but that causes considerable code bloat. Rather use the nice handover_cfg net/bts level mechanism as-is, and simply prefix the names. In the VTY, the hodec1 parameters are configurable by 'handover foo 23' commands, while the hodec2 parameters are by 'handover2 foo 23'. The generic VTY commands to enable/disable handover and to choose the algorithm are still 'handover (0|1)' and 'handover algorithm (1|2)'. (Note, a subsequent commit will rename the 'handover foo' for hodec1 to 'handover1 foo' and add backwards-compat aliases.) For example, the 'window rxlev averaging 5' command now exists both for handover decision 1 and handover decision 2, and its values are independent. This is valid config: network # set up handover decision algorithm 1 # (pending rename of these items to 'handover1 ...') handover window rxlev averaging 5 handover window rxlev neighbor averaging 5 # set up handover decision algorithm 2 handover2 window rxlev averaging 7 handover2 window rxlev neighbor averaging 7 handover2 penalty-time max-distance 10 # enable handover handover 1 bts 0 handover algorithm 1 bts 1 handover algorithm 2 In this example, bts 0 uses algo 1 with rxlev averaging of 5, while bts 1 uses algorithm 2 where rxlev averaging of 7 is in effect. Change-Id: I6475b2543b18d21710a6d774b214cb484f36ec8e
2018-02-19Permit set of multiple different A5 ciphersHarald Welte1-1/+2
So far, the administrator had to pick one particular cipher which would then be used throughout all subscribers/phones. This is a bit impractical, as e.g. not all phones support A5/3. Extend the VTY command syntax in a backwards-compatible way to permit for multiple ciphers. The bit-mask of permitted ciphers from the MSC (sent in ASSIGNMENT COMMAND) is intersected with the vty-configured mask a the BSC. Finally, the best (highest) possible cipher is chosen. Change-Id: I1d1c8131855bcab2392b4f27f6216bdb2fae10e0 Closes: OS#2461
2018-02-19logging: Remove obsolete log categoriesHarald Welte1-17/+0
About half of our log categories/subsystems were inherited from OsmoNITB, and are no longer used but may confuse the user. Change-Id: I8b39429f71c0faefdf8158a82093cfb19f44809e
2018-02-19Structural reform: Get rid of osmo_bsc_sccp_conHarald Welte4-57/+58
There was always a 1:1 correspondence between gsm_subscriber_connection and osmo_bsc_sccp_con, so there's really no point in having two separate dynamically allocated data structures with pointers back and forth and another linked list around. Let's merge osmo_bsc_sccp_con into gsm_subscriber_connection for simplicity. The resulting code might not be elegant in places, but I've tried to do only the most simple changes in this patch, while further simplifications can be done in later subsequent patches. As a side-effect, this patch also fixes lchan clearing if the MSC (or the local SCCP provider) hard-disconnects the SCCP connection. Change-Id: Idd2b733477ee90d24dec369755a00f1c39c93f39
2018-02-16HO: cfg: tweak vty writeNeels Hofmeyr1-1/+2
Have expicitly named vty write functions for bts and net levels, so that it is trivial to add commands that exist only on one of each (like the upcoming congestion check timer config for hodec2). Change-Id: Ibea4c20abc50c3d655f6bbb1a643477dfc722c8e
2018-02-16HO: store speech codec list from BSSMAP Assignment in connNeels Hofmeyr1-0/+10
On BSSMAP Assignment Request received from the MSC, store the Speech Codec List in the subscr conn, so that we may evaluate available codecs during handover decision. (Will be used, e.g., by handover_decision_2.) Change-Id: I8222d73085eb777696e365c94214c05d56e6d129
2018-02-16HO: move penalty timers to own file as proper APINeels Hofmeyr3-9/+38
Separate penalty timers API from specific struct members and move to own .h/.c file, so that future code may re-use the API arbitrarily. Change-Id: Ife975a1c7c17a500b1693be620475a8bea72f86f
2018-02-16HO: add new_lchan_type arg to bsc_handover_start()Neels Hofmeyr1-1/+2
Upcoming handover_decision_2 will want to be able to handover to a differing TCH type, hence add a parameter to bsc_handover_start(); adjust current callers to pass the old lchan type. Tweak the 'bts' argument to 'new_bts'. Change-Id: I4478ebcaada00897cc38c5a299e07661139ed3c5
2018-02-14gsm_network: drop unused subscr_epxire_timerNeels Hofmeyr1-3/+0
Change-Id: I2e34ffb35e244472f8bfc993facc8d6e130f10d9
2018-02-14drop unused common.hNeels Hofmeyr3-8/+0
Change-Id: I7cf4076d7e36ae71d88e70a86d5c2d0640c1146f
2018-02-14drop libcommon-cs completelyNeels Hofmeyr4-12/+0
Change-Id: I07d4a48af3154ee4d904686f230a51b8b8a94ff9
2018-02-14common_cs.h: mv gsm_encr to gsm_data.hNeels Hofmeyr2-8/+8
This leaves common_cs.h practically empty. Leave its removal to the next patch, which removes libcommon-cs entirely (I07d4a48af3154ee4d904686f230a51b8b8a94ff9). Change-Id: Ic3233f03580aa8c0ab178dfd33e68ecab5b9f042
2018-02-14libcommon-cs: move vty bits to libbsc/bsc_vty.cNeels Hofmeyr1-4/+0
The gsm_network VTY was partly shared between libmsc and libbsc in the old openbsc.git; now osmo-bsc.git has its own copy, so merge all of it into bsc_vty.c. This leaves common_cs_vty.c practically empty; leave removal of the file to later, when we drop the entire libcommon-cs in I07d4a48af3154ee4d904686f230a51b8b8a94ff9. Note that gsmnet_from_vty() is also already declared in bsc/vty.h. Change-Id: I6f3a596f31762b48afed39a85a343c400826300f
2018-02-14libcommon_cs: move gsm48 bits to libbscNeels Hofmeyr2-6/+6
These functions were originally shared between libmsc and libbsc in the old openbsc.git; now osmo-bsc.git has its own copies, so move them into libbsc. Change-Id: Ie411c2ce8008accee54782a442d6361e50777a54
2018-02-14gsm_network: drop unused trans_listNeels Hofmeyr1-6/+0
Change-Id: I7910ce8098d5431e41409bf09429ae4221efb360
2018-02-14libcommon-cs: move gsm_network_init() into bsc_network_init()Neels Hofmeyr1-4/+0
Some part of the network init was common between libbsc and libmsc in the old openbsc.git repository. Now osmo-bsc.git is independent with its own copy of the gsm_network initialization. So move it over to libbsc. Change-Id: I8968787a5f0b078619264f0cb42349a9bc7943af
2018-02-14libcommon: join gsm_data_shared.* into gsm_data.*Neels Hofmeyr4-914/+897
The separation of gsm_data_shared.* from gsm_data.* historically allowed compiling parts of it into osmo-bts, which we have dropped since (osmo-bts has its own copy now). Even though gsm_data.* now becomes rather large by it, remove the legacy separation to get rid of the "shared" naming, which is no longer meaningful. A future patch might separate into meaningful smaller bits, if we get the time. Change-Id: Ie247bc492efb331871d970c56700595ad3f7e201
2018-02-14libcommon: eliminate socket.cNeels Hofmeyr2-15/+0
Replace calls to make_sock() with osmo_sock_init_ofd(). Shame on me for not testing every single one in practice, I hope for peer review to confirm that this should be correct... Read closely please! The IPPROTO_GRE define seems to be unused (at least in osmo-bsc.git), drop it completely. Change-Id: Ia6e4e0e1eed3328fa25b3b90be376d532ad0e56b
2018-02-14libcommon: eliminate debug.cNeels Hofmeyr1-2/+0
Provide concise log categories for each main scope. Move the complete log categories 1:1 to osmo_bsc_main.c. In bsc_nat.c, omit obviously unused log categories. In tests, omit almost all log categories, except for those explicitly tested as the expected output. Note: should any logging occur for a log category that is omitted by accident, such will end up being logged as DLGLOBAL, so it will show up and we can fix it, and it will not get lost silently. Change-Id: Ib524e49ec211662e0dfde8161495a72aa8ad76cf
2018-02-14libcommon: eliminate common_vty.cNeels Hofmeyr1-2/+0
Move bsc_vty_go_parent() to osmo_bsc_main.c and bsc_nat.c, and drop those nodes that aren't used in the respective main scope. Change-Id: I22ebb76742e9c5ab9dd608ac089a5c558aceeb36
2018-02-13Make RSL connection attempts time out.Stefan Sperling1-0/+3
If a BTS/TRX does not respond to the "IPA RSL Connect" command, pretend that the BTS has sent a NACK for the connection. To ensure that osmo_timer_del(&trx->rsl_connection_timeout) is not called before this timer is initialized with osmo_timer_setup(), the E1 layer now drops incoming RSL messages from a BTS/TRX in LOCKED administrative state. We cancel the timeout if we receive an RSL Connect ACK or NACK from the BTS, and if the underlying E1 link does down. While here, add a missing message buffer free() in bts_isdn_sign_link(). The callers do not free it. Change-Id: Ia72b65a0f15f47dcb8a6f944f6c3695a4a64b923 Related: OS#2716