aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
AgeCommit message (Collapse)AuthorFilesLines
2013-09-18bsc: Add vty command for setting Access control classes.Ivan Kluchnikov1-0/+54
2013-09-16vty: Cosmetic change to the writing of the bts->modelHolger Hans Peter Freyther1-8/+16
Based on the feedback of Peter from the mailinglist, move the writing code to a new method and return early if there is no bts->model.
2013-09-11ctrl: Remember last 'rf_locked' control commandJacob Erlbeck2-0/+5
This stores the last SET rf_locked control command along with a timestamp. The 'show network' vty command is extended to show this information. Ticket: OW#659
2013-09-11vty: Hide unconfigured BTS on 'write'Jacob Erlbeck1-4/+6
This prevents the application from crashing when there is a half configured BTS (e.g. by using the command 'bts 1' when there isn't a BTS 1) and the 'write' command is used.
2013-09-04bsc_msc: Fix possible null pointer dereferenceHolger Hans Peter Freyther1-3/+1
In case the allocation of con is failing, do not attempt to print con->name as this will be a null pointer dereference. Fixes: Coverity CID 1076318
2013-09-03bsc_msc: Stop the re-connect timer in case the msc is lostHolger Hans Peter Freyther1-0/+1
It was possible to cause a crash by enabling and disabling the MSC connection. The enabling lead to scheduling a connection and the second call was not stopping the timer.
2013-09-03bsc_msc: Add a name field to the MSC Connection to differentiate linksHolger Hans Peter Freyther1-17/+33
Assign a static name to a MSC Connection and use it. In case there are multiple connections we can now more easily identify them. This is only used for the NAT right now, the BSC could start to name the various MSC connections too.
2013-09-02vty: Use generic 'end' and 'exit' commandsJacob Erlbeck3-16/+6
Add bsc_install_default() and replace all install_default() This patch adds bsc_install_default() which calls install_default() and add 'exit' and 'end'. All other calls to install_default() are replaced by calls to bsc_install_default(). Since 'exit' and 'end' are now added automatically to each node, the explicit registrations of these commands are removed by this patch, too. The related tests succeed now without work-arounds (except for the 'config' node itself which is part of libosmocore).
2013-09-02nanobts: Fix initialization of two concurrent BTS.Holger Hans Peter Freyther1-15/+51
It was possible that the wrong NSEI information was sent to the BTS. This is because patch_nm_tables is not called before sending the data to the BTS. This will break when two BTS connect more or less at the same time. Stop using the arrays directly and instead introduce a method that will patch the table and return the data and length. This makes sure that all users patch the table before we send the data to the BTS. I bootstrapped a sysmoBTS and I can bring up rsl. The device is running with a dummy load so I couldn't do more verification.
2013-07-27expiration: Allow to disable the periodic location updating procedureHolger Hans Peter Freyther1-2/+21
Disable the periodic LU using "no periodic location update" VTY command. In that case set the expire_lu to 0 which will then be translated to a NULL in the database layer. This leads to a bit of copy and paste in the db_sync_subscriber method but I don't see how we could easily use 'datetime(%i, 'unixepoch')' and 'NULL' at the same time. Change the query to find expired queries to check for NOT NULL and the time being in the past. This means if there are still old subscribers in the database they might not be expired. One would need to execute a query like "UPATE Subscriber SET expire_lu = 0 WHERE expire_lu is null". The same applies when disabling the periodic LU. One would need to update the database by hand. Manual tests executed/passed: 1.) periodic LU enabled: * use gst LUTest.st to do a LU * UPDATE Subscriber SET expire_lu=datetime('now'); * observe the subscriber being expired (it was) 2.) periodic LU disabled: * use gst LUTest.st to do a LU * verify that the expire_lu is NULL in the database
2013-07-27misc: Fix compilation warningsHolger Hans Peter Freyther1-2/+2
bsc_api.c:417:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat] bsc_api.c: In function ‘handle_ass_fail’: bsc_api.c:458:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat] db.c: In function ‘db_sync_subscriber’: db.c:785:3: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘time_t’ [-Wformat] osmo_msc.c: In function ‘msc_release_connection’: osmo_msc.c:145:20: warning: unused variable ‘trans’ [-Wunused-variable] smpp_smsc.c: In function ‘link_accept_cb’: smpp_smsc.c:891:24: warning: assignment from incompatible pointer type [enabled by default] smpp_smsc.c:271:1: warning: ‘esme_by_system_id’ defined but not used [-Wunused-function] smpp_openbsc.c: In function ‘smpp_openbsc_init’: smpp_openbsc.c:545:2: warning: implicit declaration of function ‘smpp_vty_init’ [-Wimplicit-function-declaration] osmo_bsc_ctrl.c: In function ‘verify_bts_loc’: osmo_bsc_ctrl.c:340:19: warning: variable ‘height’ set but not used [-Wunused-but-set-variable smpp_mirror.c: In function ‘main’: smpp_mirror.c:297:2: warning: implicit declaration of function ‘osmo_init_logging’ [-Wimplicit-function-declaration]
2013-07-14nitb: The subscr->imsi is an array will never be NULLHolger Hans Peter Freyther1-2/+1
Array compared against 0 (NO_EFFECT) array_null: Comparing an array to null is not useful: "subscr->imsi" Fixes: Coverity CID 1040716
2013-07-03hsl: Remove the support for the HSL bts from OpenBSCHolger Hans Peter Freyther9-397/+4
The support has been implemented for an old model, we were told that newer versions would be made incompatible with OpenBSC. Ther are various warnings in the code and coverity has found some new ones. Just remove the code as we don't know of anyone using this code.
2013-06-30nanobts: Do not crash on an invalid TRX numberHolger Hans Peter Freyther1-1/+1
In case the specified trx number is not configured, do not crash but return NULL from the function. The libosmo-abis library should close the connection for us then.
2013-06-24bsc_vty: Print human-readable string version of NM ADM STATEHarald Welte1-2/+3
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-05-29vty: Print the state of all GPRS OML objects in show btsHolger Hans Peter Freyther1-0/+8
For debugging GB-proxy/IPA issues it is nice to see the state of the OML objects.
2013-05-02channels: Mark channels as broken that time out on activation/releaseHolger Hans Peter Freyther1-4/+27
A channel that fails to send an ACK/NACK/REL within the four second timeout is now marked as broken. In case the release comes in late it will be ignored. The lchan should already been freed and for now we don't want to trust the channel. In the future we might want to send a "release" for a channel that got activated ack late and just set the state to none on a channel that is released acked late. The late ACK and REL has been tested with two manual tests using the fakebts. The channels remained blocked even after having received the ACK message here. The NACK case has not been manually tested.
2013-04-29ipaccess: Remove the ipaccess_gsmnet and assume there is a bsc_gsmnetHolger Hans Peter Freyther1-4/+3
Assume that there is a bsc_gsmnet and modify the ipaccess-config to provide this symbol. If a bsc_gsmmnet is not available when linked the linker will complain and fail. E.g. give an error like this: ../../src/libbsc/libbsc.a(bts_ipaccess_nanobts.o): In function `ipaccess_sign_link_up': src/libbsc/bts_ipaccess_nanobts.c:550: undefined reference to `bsc_gsmnet'
2013-04-29sysmobts: Make the nanoBTS NM code work for the sysmobtsHolger Hans Peter Freyther1-2/+2
Use the is_ipaccess_bts method to check if this is either is nanoBTS or sysmoBTS. The sysmobts type can now be used to bootstrap a bts.
2013-04-29sysmobts: Initialize the NM signal handler only once in a mixed networkHolger Hans Peter Freyther1-1/+2
Make sure that the bts_ipa_nm_sig_cb is only installed once. In a nanoBTS + sysmoBTS network the _start method will be called for each mode leading to the handler being registered twice. Make sure that there is only one handler registered by unregistering a previously installed handler. The osmo_signal_unregister_handler will remove 0 or 1 handlers per invocation and we only add one handler in this file so it is always balanced.
2013-04-29sysmobts: Avoid a crash when trying to look-up a BTSHolger Hans Peter Freyther2-26/+13
The nanoBTS code is trying to find a struct gsm_bts based on the ipaccess_gsmnet and the ipaccess_unit data. The pointer is not initialized in the case of a sysmoBTS leading to a classic NULL pointer dereference. Move the feature init into the _init method. This way we can re-use the start code of the nanoBTS. This ensures that the ipaccess_gsmnet pointer is properly initialized and that the signal handlers are installed.
2013-03-17Add VTY option to set GPRS network-control-order to enable MS measurementsAndreas Eversberg2-0/+24
In order to enable GPRS downlink measurements at mobile, the network-control-order must be set to nc1.
2013-03-12IPA: Allow RSL connection to different IP address as OMLHarald Welte2-1/+31
This patch adds a new VTY command "ip.access rsl-ip A.B.C.D" at the BTS level. If you set this IP address, the BTS will be instructed to establish the RSL link to the indiciated IP address, rather than using the same as for the OML link (default). Use "ip.access rsl-ip 0" to disable the feature.
2013-03-10si: Another round of PCS related fixesHolger Hans Peter Freyther2-4/+21
Inside the SI1 rest_octets we will need to indicate if the ARFCN is band 1800 or 1900. If the BTS is either 850 or 1900 we assume we are running a PCS network, otherwise it is a DCS network. The band indicator is not documented in GSM 04.08 but it is in the GSM 05.14 version 6.1.0 Release 1997.
2013-03-09rsl: Properly initialize the cm structure with memsetHolger Hans Peter Freyther1-1/+1
abis_rsl.c:332:23: warning: 'memset' call operates on objects of type 'struct rsl_ie_chan_mode' while the size is based on a different type 'struct rsl_ie_chan_mode *' [-Wsizeof-pointer-memaccess] memset(cm, 0, sizeof(cm)); ~~ ^~ abis_rsl.c:332:23: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(cm, 0, sizeof(cm)); ^~ 1 warning generated.
2013-03-08bsc_vty: Prevent printing -1 as unsigned integer for timeslot TSCHarald Welte1-1/+2
2013-03-03bsc: Stop "show paging" from crashing before the first pagingHolger Hans Peter Freyther1-0/+3
The paging structure is still initialized lazily and we attempt to traverse it before it is ready. The crash was discovered by Katerina. Removing the lazy initialization will take a bit of work as the gsm_data_shared is used by the osmo-bts and the OpenBSC but paging is different.
2013-03-03vty: Document some previously undocumented parametersHolger Hans Peter Freyther1-2/+2
Katerina pointed out that some nodes are not fully documented and proposed some messages. The token/timeout messages were correct, I have modified the other messages. I removed the full-stop from the PING/PONG documentation as we are normally not using a full sentence.
2013-02-08Fix of IMMIDIATE ASSIGNMENT REJECT messageAndreas Eversberg1-2/+5
The message was corrupt at several points. They are fixed now and successfully tested. A default T3122 timer value of 10 is defined by default now. If set to 0, the reject message will not be sent. Note that when using existing configs with T3122 value set to 0.
2013-02-07add some more docbook snippetsHarald Welte1-0/+9
2013-01-28bsc: Allow to page a BTS that is excluded from the RF lockHolger Hans Peter Freyther1-12/+23
The RF lock excluded BTS was not paged at all. Now forward the paging message to the handler and call a function that will check if this LAC can be paged right now. Introduce a new paging method that allows to page on a dedicated bts, refactor the code to use this method for paging.
2013-01-28bts: Allow to exclude a BTS from the global RF lock handlingHolger Hans Peter Freyther2-3/+52
Some BTS might be in locations where they can run all the time, allow to exclude them from the global lock handling.
2013-01-17si: Deal with DCS1800 and PCS1900 have overlapping ARFCN rangesHolger Hans Peter Freyther1-3/+23
For PCS1900 the SI1 does not contain the ARFCN of the serving cell. This is because the arfcn2band method will return GSM_BAND_1800 and not GSM_BAND_1900. The academic fix would be to set the ARFCN_PCS bit but this would require increasing the bitvector sizes from 1024/8 to (0x8000 + 1024) / 8. This would increase the storage size for each bitvector by three. It is not possible to have DCS1800 and PCS1900 in one network so we can avoid increasing the memory usage and check if the ARFCN resolved to 1800 and then check if the BTS is a 1900 BTS and then claim that this is compatible.
2013-01-17si: Share the ARFCN selection condition between the two statementsHolger Hans Peter Freyther1-30/+37
This makes reading the condition more easy and allows me to fix it for GSM1900 more easily and I can remove one level of indention.
2013-01-16rsl: Properly parse the RLM cause from the error indicationHolger Hans Peter Freyther1-3/+13
The code predates the TLV parser and we were parsing the RLM from the wrong offset. In general we were using the length of the TLV which happened to be equal to the T200 indication. After consulting the RLM cuases not every of them should generate a BSC_RLLR_IND_ERR_IND as these are forwarded to the MSC as a SAPI reject right now. TLV parsing now generates this due a bug in the osmo-bts code: abis_rsl.c:1605 (bts=0,trx=0,ts=2,ss=0) SAPI=0 <0000> abis_rsl.c:1547 (bts=0,trx=0,ts=2,ss=0) ERROR INDICATION cause=Fraeme not implemented
2013-01-15osmo-bsc: Add VTY command show positionDaniel Willmann1-0/+7
2013-01-15bsc: Auto RF Off in case of missing MSC connectionHolger Hans Peter Freyther1-0/+53
For short IP failures we want the RF to stay up and wait for the re-connect but in case the A-link is gone too long it is good to switch off the RF and wait for commands to enable it again.
2013-01-15bsc: Use the BSC RF CTRL to change the RF state of the TRXsHolger Hans Peter Freyther1-3/+7
Use the delayed scheduling feature of the osmo_bsc_rf class to avoid crashing the site controller of the nanoBTS.
2013-01-15bsc: Do not re-start the grace timer when we are in the grace periodHolger Hans Peter Freyther1-0/+5
2013-01-08si: Do not schedule SI1 to SI4 on the second TRXAndreas Eversberg1-3/+5
2013-01-08abis: Fix the verification of BCCH/SDCCH8 on TRX != 0 for the BS11Holger Hans Peter Freyther1-1/+1
The SDCCH8 is only allowed on trx 0 if there is no BCCH/SDCCH4 on it.
2013-01-07audio: Make the BSC handle the new mr_config request of the BSC APIHolger Hans Peter Freyther1-0/+6
Handle the mr_config request and set the AMR multirate config for the given MSC. Initialize the mr_config with the AMR5.9 default we have been using until now.
2013-01-01Stricter limits for T3212 (location update period)Daniel Willmann1-4/+3
libcommon: Default to 30min location update period libbsc: Limit VTY value for periodic update and disallow the value 0 According to GSM 04.08 Table 10.5.33 "The value 0 is used for infinite timeout value i.e. periodic updating shall not be used within the cell." This was the default value until now, but the code that deals with expiring inactive subscribers in the next commit can't handle that case so this remains a TODO for now.
2013-01-01libbsc: Make argument optional in some 'show' commandsSylvain Munaut1-6/+6
The actual command implementation was already for this, but some bad vty parsing prevented optional range arguments from working properly. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-29libbsc: With the new SAPI states we don't need sacch_deact anymoreDaniel Willmann1-1/+0
2012-12-26handover: Fix the handover signalling for IP based BTSesHolger Hans Peter Freyther1-26/+9
This was reported by Kevin when he was testing handover. The problem is the order of the signal handlers for S_ABISIP_CRCX_ACK. Right now the handover signal handler is called before the one inside the libmsc gsm_04_08.c. This means S_HANDOVER_ACK is signalled _before_ there is a rtp socket created for the channel. The result is that the MDCX will never be sent and the called will not be properly switched _after_ the handover detection. I do not want to play with the order of signal handlers, remove the CRCX ack handling from the handover_logic.c and force the NITB (and later the BSC) to check if the lchan is involved with a handover and do the switching in there. This means right now we do what two signal handlers did in one. Reproduced and tested with the FakeBTS Handover test. Log message: <0004> abis_rsl.c:1954 (bts=1,trx=0,ts=3,ss=0) IPAC_CRCX_ACK ... <000c> gsm_04_08.c:1400 no RTP socket for new_lchan <001a> rtp_proxy.c:533 rtp_socket_create(): success <001a> rtp_proxy.c:615 rtp_socket_bind(rs=0x48703c8, IP=0.0.0.0): ...
2012-12-26gsm: Do not attempt to release SAPI=0 if it was never allocatedHolger Hans Peter Freyther2-0/+24
In case of handover (but probably on RACH) we would send a RLL for SAPI=0 even if this SAPI was never established. After we have released all SAPI>0 locally check that SAPI=0 is established and if not release the rf channel directly.
2012-12-26libbsc: Fix DL QUAL decoding from measurement reportsSylvain Munaut1-2/+2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-25gsm_subscriber: change subscr_bsc_active_subscriber to pluralJan Luebbe1-5/+5
This was requested by Holger Freyther <zecke@selfish.org>.