aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
AgeCommit message (Collapse)AuthorFilesLines
2015-12-12indicate the GSM 04.08 channel mode in 'show lchan'Harald Welte1-0/+16
2015-11-20vty: Print NCC/BCC and not just integer value of BSICHarald Welte1-1/+2
2015-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte2-27/+8
This fixes a bug in the following circumstances: * BSIC is set to 0 in the config file * No TSC is explicitly specified at the BST level in the config file In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our default initialization value. The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3 bits of the BSIC. Having configuration options for both the BSIC _and_ the TSC at the BTS level therefore makes no sense, as it only adds ways in which users can configure non-oprational configurations. So we remove the bts->tsc member, and keep only the ts->tsc members that allow us to configure a timeslot-specific TSC that's different from the BTS TSC (= BCC).
2015-11-02stats: Enable stats for sgsn, gbproxy, nitb, bsc, natJacob Erlbeck1-0/+2
This commit initialises and enables the stats subsystem for the given binaries. Sponsored-by: On-Waves ehf
2015-10-02amr: Attempt to unbreak the AMR support in the BSCHolger Hans Peter Freyther1-1/+1
The signature of mr_config and the BSC implementation didn't match and the compiler was warning about it: osmo_bsc_api.c:530:2: warning: initialization from incompatible pointer type .mr_config = bsc_mr_config, ^ osmo_bsc_api.c:530:2: warning: (near initialization for ‘bsc_handler.mr_config’) Change the mr_config again and provide an implementation that will set the ms and bts data structure. It would be better to put the size outside of the IE but I am not going to change it right now. It would also be nice to either move the AMR setting into the "nitb" structure or have the msc data be used _after_ the bts settings. This needs to be cleaned up in the next step. Manually verified by placing a MO call and checking that both the channel mode modify and the mode modify request contain the multi rate config with the rate mr config (length two bytes, version 1, icmi==1, no start mode being set).
2015-10-02amr: Kill more duplication and let the code work one of the modesHolger Hans Peter Freyther1-34/+25
2015-10-02amr: Instead of putting ms/bts into the same struct.. use it twiceHolger Hans Peter Freyther3-38/+24
This way a lot of if/else can just be killed by the caller deciding which of the two instances to use. I have copied both branches to new files, replace bts for ms in one of them and ran diff on it. There is no difference.
2015-10-02amr: Remove some code duplication in preparationHolger Hans Peter Freyther2-15/+18
Merge two copies into a local static helper function. The format of the message will change and then it is easier to modify it in one place than in two. Sadly the original patch was merged before this clean-up so do the clean-up as second step. Conflicts: openbsc/src/libbsc/abis_rsl.c openbsc/src/libbsc/gsm_04_08_utils.c
2015-09-22Add full AMR multirate IE support with VTY config for MS and BTS sideAndreas Eversberg6-38/+459
2015-09-04system_information.c: Distinguish two previously identical log msgsHarald Welte1-2/+2
2015-09-04Fix neighbor channel list generation for 1900 MHz PCS bandHarald Welte1-3/+3
In the 1900 MHz PCS band, we always generated neighbor cell lists consisting of only a single neighbor cell, rather than al the configured BTSs.
2015-08-17Send RADIO LINK TIMEOUT value via OML attribute to BTSAndreas Eversberg1-0/+4
The same radio link timeout value is used for BTS and MS side.
2015-08-17Add option to set RADIO LINK TIMEOUT value via VTYAndreas Eversberg2-3/+17
2015-08-03paging: Go through all BTS to stop pagingHolger Hans Peter Freyther1-16/+9
As the comment says we should not rely that the paging occurs on the current LAC. We might page at more BTS. Walk all the BTS to stop paging. No callbacks will be issued by this stop operation.
2015-08-03paging: In case paging failed stop it everywhereHolger Hans Peter Freyther1-1/+3
In case we can't page on a BTS then stop it everywhere. The callers of paging_request assume that this is kind of an atomic operation and we should help with that.
2015-07-01bsc: Check for the rand and then generate a resHolger Hans Peter Freyther1-1/+6
Check if the NAT has sent 16 bytes of RAND and if a key has been configured in the system and then generate a result using milenage. The milenage res will be sent and noth the four byte GSM SRES derivation.
2015-07-01bsc/nat: Fix the structure of the identity request messageHolger Hans Peter Freyther1-2/+15
Unfortunately the basic structure of the response is broken. There is a two byte length followed by data. The concept of a 'tag' happens to be the first byte of the data. This means we want to write strlen of the token, then we want to write the NUL and then we need to account for the tag in front. Introduce a flag if the new or old format should be used. This will allow to have new BSCs talk to old NATs without an additional change. In the long run we can clean that up.
2015-06-20bts: Arfcn can never be smaller than 0Holger Hans Peter Freyther1-2/+1
Remove the condition because it can never be true. Fixes: Coverity CID#1307793
2015-06-19Fix GSM900 ARFCN range checkMichael McTernan1-2/+2
Allow ARFCN 0 to be used in GSM900 band.
2015-06-02libbsc: Move SIs update/generation for a BTS into a separate function.Alexander Chemeris2-14/+26
The code to do that doesn't belong to the control interface, so abstract it out to a separate function gsm_bts_set_system_infos(). [hfreyther: Fix the coding style...]
2015-04-29sub: Remove paging requests before dispatchingHolger Hans Peter Freyther1-4/+10
The dispatching might lead to the removal of more paging requests and makes "request" invalid. Remove it before calling the callback.
2015-04-04bts: "Repair" broken channels if we receive the release ackHolger Hans Peter Freyther1-3/+14
We had issues with odd behavior on the nanoBTS which lead to the introduction of the "broken" state. On busy multi BTS cells (e.g. rhizomatica) with wifi backhaul the timeout we set to wait for a RF Channe Release ACK is sometimes too little and channels are marked broken that look to be okay (besides the still to be determined delay). In case of a sysmoBTS we now know that we can change the state of a broken channel back to normal in case we do receive the right response. Manually verified using the Smalltalk BTS code PackageLoader fileInPackage: 'FakeBTS' bts := FakeBTS.BTS new. bts btsId: '1903/0/0'. bts connect: 'localhost'. bts waitForBTSReady. test := FakeBTS.OpenBSCTest new. test bts: bts. test requireAnyChannel ... wait for NITB output <0004> abis_rsl.c:223 (bts=0,trx=0,ts=0,ss=0) Timeout during deactivation! Marked as broken. ... process pending messages stdin next <0004> abis_rsl.c:735 (bts=0,trx=0,ts=0,ss=0) CHAN REL ACK for broken channel. Releasing it. So the channel went from broken to unallocated.
2015-02-10ctrl: Implement a global result for rf_locked0.14.0Holger Hans Peter Freyther1-2/+27
Create a one stop command to give a statement for the entire network. This can be used to check the policy and the state of the entire network.
2015-02-10ctrl: Add a command to check how many bts are configuredHolger Hans Peter Freyther1-0/+10
This can be used to query how many bts are configured to check if all of them are locked or not.
2015-02-10nitb: Move the rf-lock commands from osmo-bsc to libbscHolger Hans Peter Freyther1-0/+83
The bts.0.rf-state and rf_locked command have been moved from the osmo-bsc binary to libbsc. All tests continue to pass.
2015-02-07nokia: Allow to set the reset time for the nokia btsSipos Csaba2-4/+23
2015-01-31bsc/nitb: Allow to set the GPRS mode through the ctrl commandHolger Hans Peter Freyther2-11/+44
Create a control command to read and modify the gprs mode. Use the get_string_value to indicate if the value was found or not. This is useful for the ctrl interface where I didn't want to replicate "none", "gprs" and "egprs". Share code to verify that a BTS supports the mode. Related: SYS#591
2015-01-31ctrl/bsc: Fix copy and paste error and update textHolger Hans Peter Freyther1-0/+2
30f1f376383df3ae8d85e96542bf14d174c25d89 introduced new channel combinations but had a copy and paste error in the description. The jenkins system didn't run the external tests so this issue and others were not noticed until now. Fix the copy and paste and update the test result.
2015-01-31rsl: Remove unused code for channel activationHolger Hans Peter Freyther1-35/+0
The code has been unused for a long time. Let's remove it.
2015-01-27nitb: Allow the network to decide if a subscriber should be createdHolger Hans Peter Freyther1-0/+2
2015-01-05RSL: Change "... is back in operation" to an INFO level messageHarald Welte1-1/+1
2015-01-05Don't return an error to caller if we are out of lchan on CHAN RQDHarald Welte1-1/+1
This is a normal situation under high load: The BTS is out of resources and the BSC cannot allocate any dedicated channel. We may send an IMM ASS REJECT back to the MS. All well within normal parameters, not an error that needs to be reported back to the caller, who propagates it all the way up to libosmo-abis.
2015-01-02logging: Only compare the subscr addressHolger Hans Peter Freyther2-22/+1
Move the "logging filter imsi IMSI" into the BTS/NITB code to allow to set the gsm_subscriber and only compare it. This way we simply compare the subscriber address and don't have to care if the subscriber data is still valid.
2015-01-02logging: Set the context for paging requests as well.Holger Hans Peter Freyther1-0/+11
2015-01-02lchan: Remember why a channel is broken using static stringsHolger Hans Peter Freyther3-9/+22
Remember why a channel is being marked as broken. So we can maybe understand what happend.
2015-01-01smscb: Prepare to fill in the info for CBCH in SI4Holger Hans Peter Freyther2-3/+3
Pass the number of bytes the rest octet for si4 should fill.
2015-01-01chan_alloc: remove ts_alloc() and ts_free()Harald Welte1-106/+1
The idea of ts_alloc()/ts_free() dates back to the very early days of OpenBSC, where we didn't yet have a fixed PCHAN type assigned for every lchan in a BTS. However, ever since, PCHAN types (channel combinations) are configured by OML in a certain way, and we only allocate LCHANs inside PCHANs of a matching type. There should be no PCHANs with type GSM_PCHAN_NONE, unless those that you don't want to use for administraive reasons or the like.
2015-01-01Fix most compiler warnings with gcc-4.9.2Harald Welte1-2/+3
2015-01-01chan_alloc: Fix missing break statementHarald Welte1-0/+1
Fixes: Coverity CID 1261354
2015-01-01chan_alloc.c: Don't remove SDCCH/8 without CBCHHarald Welte1-0/+1
In commit 30f1f376383df3ae8d85e96542bf14d174c25d89 we wanted to add support for SDCCH/8+CBCH, not replace the existing SDCCH/8 with the new CBCH-enabled configuration.
2014-12-30libbsc/system_information.c: Fix off-by-one error in si4 generation with ↵Daniel Willmann1-3/+3
CBCH enabled ==25637==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff3f587c43 at pc 0x5bf591 bp 0x7fff3f587630 sp 0x7fff3f587628 READ of size 4 at 0x7fff3f587c43 thread T0 #0 0x5bf590 in tv_fixed_put /home/alphaone/local/osmo-asan/include/osmocom/gsm/tlv.h:237 #1 0x5b7e14 in generate_si4 /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/system_information.c:607 #2 0x5b488b in gsm_generate_si /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/system_information.c:882 #3 0x4cb247 in gsm_bts_trx_set_system_infos /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/bsc_init.c:166 #4 0x4d3c26 in bootstrap_rsl /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/bsc_init.c:272 #5 0x4ced44 in inp_sig_cb /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/bsc_init.c:316 #6 0x7f4f15b563d7 in osmo_signal_dispatch /home/alphaone/scm/osmo/libosmocore/src/signal.c:105 #7 0x7f4f156c0e3f in e1inp_int_snd_event (/home/alphaone/local/osmo-asan/lib/libosmoabis.so.4+0x17e3f) #8 0x7f4f156be7e5 in e1inp_event (/home/alphaone/local/osmo-asan/lib/libosmoabis.so.4+0x157e5) #9 0x583a6a in ipaccess_sign_link /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/bts_ipaccess_nanobts.c:675 #10 0x7f4f156e63b0 in handle_ts1_read (/home/alphaone/local/osmo-asan/lib/libosmoabis.so.4+0x3d3b0) #11 0x7f4f156e4f4e in ipaccess_fd_cb (/home/alphaone/local/osmo-asan/lib/libosmoabis.so.4+0x3bf4e) #12 0x7f4f15b540b6 in osmo_select_main /home/alphaone/scm/osmo/libosmocore/src/select.c:160 #13 0x43c656 in main /home/alphaone/scm/osmo/openbsc/openbsc/src/osmo-nitb/bsc_hack.c:355 #14 0x7f4f1462e4bc (/lib64/libc.so.6+0x224bc) #15 0x43b6cc (/home/alphaone/local/osmo-asan/bin/osmo-nitb+0x43b6cc) Address 0x7fff3f587c43 is located in stack of thread T0 at offset 483 in frame #0 0x5b712f in generate_si4 /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/system_information.c:580 This frame has 8 object(s): [32, 40) '' [96, 104) '' [160, 164) 'rc' [224, 232) 'si4' [288, 296) 'cbch_lchan' [352, 360) 'restoct' [416, 420) 'l2_plen' [480, 483) 'cd' HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow /home/alphaone/local/osmo-asan/include/osmocom/gsm/tlv.h:237 tv_fixed_put
2014-12-30move gsm_bts_get_cbch() to gsm_data_shared() as its needed in osmo-btsHarald Welte1-22/+1
2014-12-30Add basic support for CBCH / SMS-CB (Cell Brroadcast)Harald Welte4-14/+117
We can now configure the pyisical channel types for CBCH either in the CCCH+SDCCH4 or in the SDCCH8 chanel combination. Depending on whether a CBCH exists on the BTS, we also generate the SI4 with matching CBCH channel description to notify the phones of the existance of the CBCH. There is now a VTY command how a SMS-CB message can be sent to a given BTS. We do not yet have any logic at all for actual scheduling of multiple CBCH RSL messages towards one or multiple BTSs yet, though.
2014-12-18ho: Copy the multirate config to the new lchanHolger Hans Peter Freyther1-0/+1
The new lchan will be in speech mode already but for AMR we will need to provide a working multirate config in the channel activation, otherwise the channel act might be nacked. Copy the config from the current lchan into the new lchan. The abis code simply added the mrconf if the speech mode was amr. Before this commit the invalidate mrconf with all zeroes was copied/sent.
2014-12-17ho: Make sure the timer is always stoppedHolger Hans Peter Freyther1-14/+16
In case of a ho_chan_activ_nack (sent due another bug inside both sysmobts and openbsc) the code would not stop the timer but free the datastructure. This can lead to a clear segfault when the timer has expired. Create a "free" function which is responsible to detach the handover structure, stop the timer (which is idempotent) and free the structure.
2014-12-17bts: When one link drops.. check what needs to be droppedHolger Hans Peter Freyther1-0/+16
In case a BTS is dropped, iterate over the list of BTS and check if a dependency is now missing and then drop the BTS. This check could lead to check of 256*256 checks (e.g. all BTS on each other in the chain and the master is being dropped). The performance aspect of it doesn't matter for our usecase. We expect to have pairs of BTS right now.
2014-12-17bts: Add some simple dependency between different BTSHolger Hans Peter Freyther2-0/+70
E.g. for the sysmoBTS2050 we have the requirement that the first board connects before the second due clocking. The easiest point to enforce this is the BSC. Add a simple bitmask based system to allow to express dependencies for IP based systems.
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck4-4/+12
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2014-12-05ctrl: Allow to query if the OML link is connected or notHolger Hans Peter Freyther1-0/+27
Related: SYS#798
2014-12-05ctrl: Add command to get the current load of a BTSHolger Hans Peter Freyther1-0/+53
Add a command and test to see the current channel load and available channels per BTS. Related: SYS#798