aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_vty.c
AgeCommit message (Collapse)AuthorFilesLines
2017-07-12move openbsc/* to repos rootNeels Hofmeyr1-4304/+0
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
2017-06-18Add vty command "radio-link-timeout infinite" for uplink rx testingHarald Welte1-4/+25
When we are performing Rx sensitivity testing on a BTS, we want to deactivate the connection failure criterion / radio link timeout, i.e. no matter how many SACCH frames in uplink are failed to decode, the BTS should never close the channel. OsmoBTS Change-Id I736f21f6528db5c16fa80cdb905af20673797be5 covers a way how this behavior can be requested from the BTS via an OML attribute. This patch adds support to the BSC to actually set that attribute. Do not use this in production networks, as the BTS will keep open radio channels indefinitely even if the phone is gone and no longer transmitting anything. This is a pure testing feature. Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2
2017-06-15Update SI data structures and generationMax1-48/+30
To support segmented SI2quater as per 3GPP TS 44.018 we'll have to support multiple SI messages (up to 16 for SI2q) for a given type in contrast to existing 1:1 mapping: * expand storage space to hold up to 16 SI messages (spec limit) * add assertions for budget calculations * generate multiple SI2q messages * adjust SI2q-related tests * use precise check for number of SIq messages instead of approximate estimation Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Related: OS#1660
2017-06-09don't re-implement osmo_talloc_replace_string()Harald Welte1-1/+1
osmo_talloc_replace_string() was introducd into libosmocore in 2014, see commit f3c7e85d05f7b2b7bf093162b776f71b2bc6420d There's no reason for us to re-implement this as bsc_replace_string here. Change-Id: I6d2fcaabbc74730f6f491a2b2d5c784ccafc6602
2017-05-31Adjust BTS model feature checkMax1-2/+2
Rename gsm_bts_has_feature() -> gsm_btsmodel_has_feature() and adjust type signature to match gsm_btsmodel_set_feature() function and avoid confusion with upcoming functions to check/set BTS features reported over OML. Change-Id: I97abdedbef568e0c2fbd37c110f7d658cf20e100 Related: OS#1614
2017-05-29libbsc: Create pcu-socket only as specified in config fileHarald Welte1-0/+26
Since commit b4999b60d48bcbb5aa575973d068e07ab672e095 we created PCU sockets at hard-coded paths in the filesystem by default for all BTSs. This is inflexible and prevents the use of multiple BSC instances on a single filesystem, or the placement of the sockets in a more secure location than /tmp. The new approach with this patch is that * no PCU sockets are created by default * only for those BTSs where a 'pcu-socket' is configured via VTY, the socket will actually be created Change-Id: Ie9079470584777dcc31f85f9bf0808f479156ccb Closes: OS#2293
2017-05-28bsc_vty: Add command to manually issue IPAC MDCXHarald Welte1-1/+31
Using this command, one can modify the RTP stream associated with a given logical channel and (re)direct it to a specified IP:Port. Change-Id: I63e03b932038a4e2f6d51c5541b52e4a42df27bf
2017-05-27bsc_vty.c: Add command for manual [de]actiovation of logical channelsHarald Welte1-0/+119
Sometimes it is useful to manually activate (or decativate) a given logical channel from the VTY. Doing this on the BSC (rather than the BTS) ensures that the BSC knows that this timeslot / channel is allocated and there is no risk to have clashes between the BSC "owning" the resources and the BTS allocating some by itself. Change-Id: I44fc3904678eb48bd3ab1a3da8c0c265fa082e0d
2017-05-27bsc_vty.c: Further simplify vty_get_ts()Harald Welte1-6/+7
We can also move the string-to-numeric conversion inside vty_get_ts() to reduce the amount of work required in the caller. Change-Id: I2a74ed06e90e39d39f53fff39bb96df172728c0e
2017-05-27bsc_vty: Factor vty_get_ts() out of pdch_act_cmd()Harald Welte1-14/+26
Resolving a timeslot based on its numeric identities is a generally useful function, so lets' factor that out. Change-Id: Id2570232f82542487a1133be7efb1dc1eb3029a8
2017-05-15Restructure SI2quater generationMax1-3/+3
In preparation for extended SI2q messages: * add SI2q-specific accessor macro * add *_offset variables to gsm_bts struct * internalize memory check while generating rest octets - introduce budget concept (number of bits available in a given message) * internalize *arfcn_size() functions as they are not needed outside of si2q_num() anymore * change rest octets generation to work with gsm_bts struct directly * do not generate rest octets if no SI2q is necessary * adjust unit tests accordingly (cosmetic changes only to avoid regressions) Requires: I92e12e91605bdab9916a3f665705287572434f74 in libosmocore Change-Id: Ib554cf7ffc949a321571e1ae2ada1160e1b35fa6 Related: RT#8792
2017-05-09Make BTS type and variant converters shareableMax1-1/+1
* move value_string definition and corresponding functions for BTS type to shared header to make it re-usable by OsmoBTS * use consistent function naming * add similar functions for BTS variant * add enum to be used by OML Attribute Reporting to distinguish between type, variant and other info Change-Id: Ida94725a6fce968443541e3526f48f13758031fd Related: OS#1614
2017-04-28Prepare for extended SI2quater supportMax1-5/+5
Supporting SI2quater as per 3GPP TS 44.018 will require chnages to the way System Information is stored because it uses 1:n instead of 1:1 mapping between SI type and generated SI content. This should not affect other SI types though. To facilitate this transition: * convert the code to always use GSM_BTS_SI helper instead of accessing buffer directly * make helper more robust by adding extra parenthesis * add similar helper for gsm_lchan * add function estimating number of SI2quater message to hold configured number of (U|E)ARFCNs * add SI2q index/count fields and pass them to rest_octets generator explicitly * internalize buffer access in generate_si* functions Change-Id: I74e4e3cb86364cec869a1472a41b4a95af0d50dd Related: RT#8792
2017-04-26Fix MS TO measurement representationMax1-2/+1
* set proper flag when saving MS Timing Offset * use gsm_subscriber's IMSI or lchan's name if bsc_subscriber is unknown * add comments with spec reference * store/display MS Timing Offset instead of raw Timing Offset field from RSL * Compute MS Timing Offset [-63; 192] from Timing Offset field [0; 255], adjust structure gsm_meas_rep with proper type to store it Change-Id: I7e003d23a6edb714c5f17688fd6a8edac131161d Related: OS#1574
2017-04-10gsm_bts: add version and variant detailsMax1-1/+4
* add version string to gsm_bts * add PCU version string to gsm_bts * rename GSM_BTS_TYPE_OSMO_SYSMO -> GSM_BTS_OSMOBTS to avoid confusion between BTS model and variant * add variant enum to gsm_bts_model using enum with variants for each hw vendor of OsmoBTS * show connected PCU version (if available) in vty via 'show bts' This will come in handy when logging details regarding particular BTS reported via OML, see: Related: OS#1614 Change-Id: I6710d53115f34634a7b70969cc05fd5c72ff8ab2
2017-04-03VTY: add the dyn_ts_allow_tch_f optionVadim Yanitskiy1-0/+2
This option allows to enable or disable TCH/F allocation on the TCH/F_TCH/H_PDCH timeslots. Until now, source code modification was required to enable this feature. Related: OS#1778 Change-Id: Id18cab25844dc854a66b4e2713e90c3f43afa712
2017-03-08add struct bsc_subscr, separating libbsc from gsm_subscriberNeels Hofmeyr1-1/+11
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-02-24cosmetic: rename osmo_msc_data.h to bsc_msc_data.hNeels Hofmeyr1-1/+1
With the OsmoMSC program coming up, the name osmo_msc_data becomes even more confusing than it already is. Clearly indicate it as libbsc's data of a remote MSC by prefixing with bsc_. Also, the Osmocom community has in the meantime agreed to have the osmo_ prefix only in libosmocore, to avoid naming conflicts in case things are moved there. So while renaming anyway, also drop the osmo_ prefix. Change-Id: I13554563ce9289de126ba0d4cf329bafcda35607
2017-02-19Add support for extended SI2q parametersMax1-31/+71
* add vty command to set E-UTRAN_PRIORITY, THRESH_E-UTRAN_low and E-UTRAN_QRXLEVMIN according to 3GPP TS 44.018 Table 10.5.2.33b.1 * remove old command which does not support those parameters Change-Id: I36dcc79f7b7a02036e74720923d0df1a2a2db504 Fixes: RT#8792
2017-02-08vty: remove ignored logging parametersMax1-2/+2
Since ce9fec3e896571835ac5bfd2980d6836f2b29f0d libosmocore ignores parameters to log_vty_command_* functions. Hence parameter of logging_vty_add_cmds() is ignored too. As we depend on much later libosmocore version anyway, we can simplify code somewhat by removing parameters which will be ignored anyway. Change-Id: I62f752fd88f1d8fefa563648f9864c7c31f87991
2017-02-02compiler warning: bsc_vty: remove two unused varsNeels Hofmeyr1-1/+0
Added in recent commit 42def7205ba91df4bbb7e3240be0df8c26c2d63e "Implement VTY configuration to control Early Classmark Sending" Change-Id: Iaf640fa6e1f234f594fb8dc06f716d3d3e95eb2a
2017-01-26Implement VTY configuration to control Early Classmark SendingHarald Welte1-0/+24
The SI3 rest octests contain a flag that indicates if early classmark sending is allowed in this cell or not. So far we always set this to one, now it is configurable using the 'early-classmark-sending' command at the VTY node. Change-Id: Ia0b1cc5ab45673f3da70c59ae8917eba343f9862
2016-12-22bsc_vty: Fix missing break statements in switch()Harald Welte1-0/+2
Change-Id: Ifd48e8d56c845603d320748144b4d7c3c24022a0 Fixes: Coverity CID 135188 Fixes: Coverity CID 135190
2016-12-09cfg_bts_si2quater_neigh_add(): Don't call strerror() on negative valueHarald Welte1-1/+1
Change-Id: I1300eede3f22df812b7e83902327ce4cde21aa35 Fixes: Coverity CID 135185
2016-12-02move to libcommon-cs: net timezone VTY configNeels Hofmeyr1-64/+0
Leave the timezone VTY output in libbsc's config_write_net(), until the BSC/MSC separation of struct gsm_network is completed. Change-Id: I9712b2e07b4f1ab8d2e4ad40a8d771e98ed25b20
2016-12-02Move timezone settings up to network levelNeels Hofmeyr1-32/+33
Time zone used to be configurable per-BTS. In the upcoming MSC-split, no BTS structures will be available on the MSC level. To simplify, drop the ability to manage several time zones in a core network and place the time zone config on the network VTY level, i.e. in gsm_network. If we are going to re-add fine grained time zone settings, it should probably be tied to the LAC. Adjust time zone VTY config code (to be moved to libcommon-cs in subsequent commit). Adjust time zone Ctrl Interface code. Change-Id: I69848887d92990f3d6f969be80f6ef91f6bdbbe8
2016-12-02bsc vty: rename show_net_cmd to bsc_show_net_cmdNeels Hofmeyr1-2/+2
Future: there will be an MSC-land show-net-cmd, so rename to something with bsc in its name. Change-Id: Ifb86698cd57a09f03b935b6d3fcea87eff4cd397
2016-12-02move to libcommon-cs: network VTY that isn't BSC-specificNeels Hofmeyr1-192/+3
Keep only BSC specific bits of the 'network' VTY node in bsc_vty.c, move more general VTY commands to common_cs_vty.c. Add arg to common_cs_vty_init() to pass a config_write_net() function. Pass a libbsc specific config_write_net() function. Future: upcoming omso-cscn will re-use the VTY bits moved to libcommon-cs and pass a different config_write_net() function. Change-Id: I871b7b32a0c56fdce983e409cf244ec487d24e71
2016-12-02move to libcommon-cs: global vty gsm_network pointerNeels Hofmeyr1-17/+3
Move gsmnet_from_vty() and the bsc_gsmnet global to common_cs_vty.c. Rename bsc_gsmnet to vty_global_gsm_network and make it static to common_cs_vty.c, to clearly mark the global variable for VTY use only. Introduce common_cs_vty_init() to set vty_global_gsm_network. Change-Id: I26c5c47de08f899b896813d09612d5cb2f8e42d6
2016-11-03bsc_vty: include dyn TS info in vty show lchanNeels Hofmeyr1-3/+53
Extend both 'show lchan <bts> <trx> <lchan>' and 'show lchan summary' to include information on dynamic timeslots. Have one common function that prints " as foo" or " switching foo -> bar" to the vty, use it in lchan_dump_full_vty() and lchan_dump_short_vty(). In lchan_dump_short_vty(), split the vty_out call in two in order to interleave the dyn ts info right after the pchan. The summary hence looks e.g. like this for osmocom style dyn ts: BTS 0, TRX 0, Timeslot 5 TCH/F_TCH/H_PDCH as PDCH, Lchan 0, Type NONE, State ACTIVE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm or BTS 0, TRX 0, Timeslot 4 TCH/F_TCH/H_PDCH switching NONE -> PDCH, Lchan 0, Type NONE, State BROKEN UNUSABLE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm Change-Id: I3eb72ac7f0a520a8eefe171b9fb357f149aa3fda
2016-09-28Revert "bts: extend bts_chan_load to allow counting tch only"Neels Hofmeyr1-1/+1
This reverts commit 308cb0719dca3ba8eed1eff2a2124d44f34d9a28. Problems in this commit: openbsc/src/libbsc/chan_alloc.c:523: case GSM_PCHAN_TCH_F_PDCH: This is actually wrong, GSM_PCHAN_TCH_F_PDCH use ts->flags, not ts->dyn below (due to historical reasons and could be unified). 560: if (only_count_tch && !chan_is_tch(ts)) This has exactly one effect: it excludes GSM_PCHAN_TCH_F_PDCH when in PDCH mode, because for all other PDCH (plain PDCH and TCH/F_TCH/H_PDCH in PDCH mode) below ts_subslots() returns 0 and skips the for() loop. I consider this a bug in TCH/F_PDCH, to be fixed in an upcoming commit. I don't see why we need the only_count_tch argument, because this should normally only count TCH, weren't it for the TCH/F_PDCH bug. If dyn TS should be counted differently, we should do this in a different way. Change-Id: I34dbbaf53a800115e3d03bd44028cad675f3b525
2016-09-26mscsplit: bsc_vty_init(): decouple from global bsc_gsmnetNeels Hofmeyr1-1/+1
Add an explicit gsm_network pointer instead of using the bsc_gsmnet global. This allows passing a gsm_network struct from the main() scope, which helps to decouple libmsc from libbsc. Change-Id: I9e2c0d9c18d4cebb5efb71565ad84df2bc2e0251
2016-09-23bts: extend bts_chan_load to allow counting tch onlyAlexander Couzens1-1/+1
Change-Id: I86f1d502649747b6b9aefcb39081b14110e8f494
2016-09-18remove unused bsc_copyright from bsc_vty.cNeels Hofmeyr1-1/+0
Change-Id: I281791c0f57ca75ffe14431a3030811b2d224f0b
2016-09-17Modify SI 13 field for control_ack_typeMax1-0/+38
Add vty function to explicitly set use of 4xRACH type of ack message for PACKET CONTROL ACKNOWLEDGMENT. Previous hardcoded value (use RLC/MAC control block) is used as a default. This is handy for debugging issues related to Timing Advance in context of GPRS. Change-Id: Ie869ac0a82055110f1e3b875e246750c4e113336 Related: OS#1526
2016-08-29libmsc/bsc: split rate counters into bsc and msc groupAlexander Couzens1-9/+9
Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de> Change-Id: I7361033cd1eb919ec3c2ea2652f40ab8c75b2f99
2016-08-27libbsc/libmsc: convert old osmo counter into rate_ctrgsAlexander Couzens1-9/+13
rate counters support the export to statsd and can have a delta value. Change-Id: Ie749cebd53a0bb618d0e23d375885712078bf8dd
2016-07-28Modify SI 13 field to support 11 bit RACHbhargava1-0/+30
System Information 13 field EGPRS PACKET CHANNEL REQUEST is modified to support 11 bit RACH. Further VTY configuration is added to enable/disable 11 bit RACH support in EGPRS. By default 11 bit RACH support is disabled. Change-Id: I51357bec936c28a26ab9ff5d59e0e30ca3363297
2016-07-09Make random MSISDN assignment optionalMax1-0/+4
Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new optional no-extension argument for subscriber-create-on-demand vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Fixes: OS#1658 Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb
2016-06-23vty: show lchan summary: also show lchan->stateNeels Hofmeyr1-2/+5
Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97
2016-06-16dyn PDCH: TS flags: rename one, add three, as enumNeels Hofmeyr1-1/+1
Rename TS_F_PDCH_MODE to TS_F_PDCH_ACTIVE, to more accurately reflect the truth value's meaning. Add TS_F_PDCH_ACT_PENDING and TS_F_PDCH_DEACT_PENDING for sysmoBTS (and possibly other BTS implementations) to remember what to do when the PCU replies with a channel de/activation. Also add TS_F_PDCH_PENDING_MASK to test for both. Change from #define to an enum. Note: These flags are also used in the upcoming osmo-bts-sysmo dyn PDCH commits, so osmo-bts submission depends on this commit. Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3
2016-06-06Add warning for unsupported DTX configurationsMax1-2/+6
libosmo-abis do not consider DTX bits while processing TRAU frames. As I do not have equipment to test it, I'm not sure if/how non-IP BTS will work in case of DTX - warn users about it. Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Related: OS#22
2016-06-05Add regexp authorization policy for IMSIMax1-3/+26
* extend "auth policy" vty command with new option "regexp" * add vty command "authorized-regexp" for setting arbitrary POSIX regular expression * add basic vty test * add optional "regexp" argument to subscriber-create-on-demand vty command With those in place we can now set the regexp against which MS's IMSI will be matched. If IMSI match the regexp than MS is allowed to access the network. If subscriber is already marked as authorized in HLR than it'll be allowed regardless of IMSI matching. The same way we can decide whether to create subscribers on-demand basesd on IMSI regexp match. Similar to authorization this restriction can be overridden by manually creating subscriber via vty, ctrl interface or directly in HLR. Change-Id: I525f4b80676de47d1d422686da2ca012301b0129 Fixes: OS#1647
2016-05-17Move DTX settings to BTSMax1-10/+75
* Add per-BTS DTX settings * Configure Uplink and Downlink DTX separately * Deprecate global DTX option (it was never tested/used anyway) * Use libosmocore function for DTX indicator in System Information (previously it was incorrectly assigned for half-rate channels) Related: OS#22 Change-Id: I3d55168475ad47044b6238b55846ea22bdd518a4 Reviewed-on: https://gerrit.osmocom.org/40 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-04-29Adjust si2quater rangesMax1-5/+6
Change ranges of arguments for si2quater neighbor lists to proper values according to 3GPP spec.
2016-04-22Add vty check for max si2quater sizeMax1-8/+15
Explicitly check if added (U|E)ARFCN will fit into available si2quater message.
2016-04-22Add basic UARFCN supportMax1-0/+53
* add data structures, generation functions * vty interface for neightbor UARFCNs specific to SI2quater * vty test * unit test Fixes: OS#1666
2016-04-22Fix earfcn deletionMax1-2/+2
* fix typo in arg index * fix sign in error reporting * add vty test
2016-04-22Fix documentation for command parametersMax1-1/+2
2016-04-16Add basic SI2quater supportMax1-0/+71
* support for sending arbitrary static SI2quater. * vty interface for neightbor EARFCNs specific to SI2quater. * dynamic generation of SI2quater messages. * unit test for SI2quater messages. Fixes: OS#1630