aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc
AgeCommit message (Collapse)AuthorFilesLines
2017-12-19remove unused 'lac' member of 'struct gsm_subscriber_connection'Harald Welte1-1/+0
This field was used in write-pnly mode, i.e. set but never read. Change-Id: I319945538fd3e3bc5cf3b9d82533641cb8ba5256
2017-12-19Remove bogus MM INFO configurationHarald Welte3-51/+0
The network name and other MM INFO is controlled by the MSC, not the BSC. Change-Id: I1cbf72fc50cff29e7c1633ba752cbf15b4b84c58
2017-12-19Remove bogus vty config for LU reject causeHarald Welte2-5/+0
The LU reject cause (like anything MM related) is under control of OsmoMSC, not BSC. Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace6
2017-12-19Remove unused RRLP options/codecHarald Welte1-4/+0
RRLP is handled in OsmoMSC after the split from NITB, so let's remove any bogus VTY commands left over in the BSC. Change-Id: Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38
2017-12-19Remove dead code left over from NITB splitHarald Welte8-67/+9
There still is a lot of dead code that we inherited from the NITB days, let's remove more of it. libtrau will be re-introduced as part of osmo-mgw later. Change-Id: I8e0af56a158f25a4f1384d667c03eb20e72df5b8
2017-12-14debug log: log Cipher Mode info upon sending down RSL/A-bisNeels Hofmeyr1-0/+4
Change-Id: I7f7ec44887f6b40fdce8d348e9e9bd200fe0b689
2017-12-14log typo fix in gsm0808_cipher_mode()Neels Hofmeyr1-1/+1
Change-Id: I3f6d138df9ddc9c6560d04e2e8baa1f3a50a164f
2017-12-14Add new "chan:mode_modify_nack" counter to count RSL MODE MODIFY NACKHarald Welte1-0/+1
Those NACKs shouldn't happen in production, and if they do, you probably want to have a more persistent figure than a line in the log file about it. Having counters allows the user to monitor this efficiently. Change-Id: Ic82c6baaf4cb88d07bc5cdc200f8279cf130f396
2017-12-14Add a new counter "rsl:ipa_nack" to count number of IPA related NACKsHarald Welte1-0/+4
Those NACKs (CRCX/MDCX/PDCH_ACT) shouldn't happen in production, and if they do, you probably want to have a more persistent figure than a line in the log file about it. Having counters allows the user to monitor this efficiently. Change-Id: I5edf979c9a2b4c9a5a60eef9f66c26da54f2bddf
2017-12-14Add new per-BTS "rsl:unknown" counter to count unknown RSL messagesHarald Welte1-0/+9
Change-Id: I268f222140fa5783e1d19f81fbd45614aaa4b8c4
2017-12-14Add per-BTS rate_ctr for total + failed number of RSL CHAN_ACTHarald Welte1-0/+4
Change-Id: I471b598af194dee78ebaa3414b6290c72d9bbcff
2017-12-14libbsc: paging: more reasonable (and detailed) paging statisticsHarald Welte2-5/+10
Counting the number of T3113 expirations (one per subscriber per BTS) vs the number of paging attempts (Bsc global) is a ueseless figure, as you cannot relate each other. We count on the BSC level: * how many PAGING we received from the MSC (total) * how many of those were for cells/LACs we don't serve * how many of those resulted in PAGING RESPONSE We count on the BTS leve: * how many PAGING CMD we sent to the BTS (total) * how many of those we ignored as we were already paging * how many of those resulted in PAGING RESPONSE * how many were expired due to T3113 expiring Change-Id: I410bbcbb2621f95f11238f7a5da01ab438f5fee1
2017-12-13paging: paging_flush_bts: be sure pending_requests is initalizedPhilipp Maier1-0/+2
The BSSMAP reset causes the paging requests to be flushed. When this happens right after startup then calling paging_flush_bts() may be called when the list bts->paging.pending_requests is not yet initalized, which causes a segfault. Call paging_init_if_needed() to be sure that the list is inizalized (like the other functions also do) Change-Id: I42ddbfdec6f9d74d858ad13cc38b5b64061d08dc
2017-12-13fix segfault upon release paging on BSSMAP Reset: init llistNeels Hofmeyr1-1/+5
Initialize the llist head gsm_bts->paging.pending_requests at the time gsm_bts is allocated, not only at paging_init_if_needed(). The gsm_bts->paging sub-struct is invalid as long as gsm_bts->paging.bts doesn't point back to bts. Hence the recently added iteration of gsm_bts->paging.pending_requests should have checked whether bts is NULL. The llist_head pending_requests is not initialized unless paging_init_if_needed() has been called (and paging.bts is hence set). However, this fix is a safer way to prevent errors like this in general. The segfault was introduced by d382bf63e2b7e28fe41c5310c26fe584f0356897 / If3f53d3bb66ad2dc02db823cb813590c6b59c700 Related: OS#2747 Change-Id: Idfafac4e2c0e0a241a62aecbbdc22be71febf840
2017-12-12Generate SI2bis Rest OctetsMax2-1/+18
According to the spec it's an empty 1-byte element reserved for future extension but we still have to generate padding properly. Add stub function similar to the used for SI2ter and adjust test output accordingly. Related: OS#2711 Change-Id: I3c278c57880a173df3c4648c9724339d23ce94fd
2017-12-11paging: Stop all paging if MSC sends us BSSMAP RESETHarald Welte1-0/+23
When the MSC has lost its state and issues a RESET, we should not only clear all ongoing radio connections, but we should also stop any paging. There's no point in paging a subscriber if the MSC doesn't know about this paging anymore. Change-Id: If3f53d3bb66ad2dc02db823cb813590c6b59c700 Closes: OS#2736
2017-12-11paging: Remove obsolete paging call-back supportHarald Welte1-42/+15
The call-back was needed inside the NITB to determine which part (CC, SMS, ...) had triggered a given paging. A pure BSC doesn't need that feature, so let's get rid of it. The 'void *cbfn_data' is replaced with a 'struct bsc_msc_data *', as all callers use it with that type. Change-Id: I8839e8338d3ad1a91b41e687e8412fcdca3fd9ab
2017-12-11paging.c: add more documentation on what the functions actually doHarald Welte1-4/+45
This was created during code review towards some upcoming fix for OS#2736. However, it's not really related to that. Change-Id: I68d4fc8baaedd1d64cd628b2441c57ebc64ecebc
2017-12-11Generate SI2ter Rest OctetsMax2-1/+20
Previously we simply omitted SI2ter Rest Octets which is spec violation which lead to 'Malformed Packet' error in Wireshark RSL dissector. Fix this by generating empty 'no rest octets' with proper padding. Adjust test output accordingly. Change-Id: Ie4419aaaf93a462f501f8d8f7bf2677d37c58f94 Fixes: OS#2711
2017-12-10OML: expand status reporting checksMax2-0/+19
* check GPRS state: if GPRS is enabled for the BTS but NSE, CELL or both NSVC are locked than report it as degraded * check TRX usability: use already available function to check that TRX is actually usable when reporting OML status via CTRL * fix tests linking: libbsc is using gsm48_create_mm_serv_rej() which is defined in libcommon-cs but neither libbsc itself nor tests using it are actually linked against libcommon-cs Related: OS#2486 Change-Id: I9dce1d3b0cabe149a90cfca58a3fe55f8d6a72bc
2017-12-09Move many counters from BSC-global to per-BTS granularityHarald Welte3-23/+24
We used to have a lot of counters only globlly per BSC, but they're much more useful on a per-BTS level. Change-Id: I954b9dda72b83b91d46a934c221a8b3375743599
2017-11-30auth: remove obsolete VTY commandsPhilipp Maier1-3/+0
authentication (optional|required) is no longer needed, the related decisions are now made in the HLR. Change-Id: Ib6c6331cc86004c4862067031e4fcb12a6975b63
2017-11-29cosmetic: handover.h: use "#pragma once", declare structs, commentsNeels Hofmeyr1-0/+2
Use new #pragma style instead of #ifndef dance. Forward-declare all structs we're using pointers of. Move function comments to their definitions in the .c file. Change-Id: I3d43ec01897c0ef9eaf506e68d5a1ec1977f70ea
2017-11-29compiler warnings: constify in abis_nm.cNeels Hofmeyr1-4/+5
Constify in- and output arguments for Parse Attribute Response Info chain to avoid compiler warnings, and more clearly indicate const data in the first place. Change-Id: Ib7d069fe1fda69e89dfd171cd76b1ed6d6db0ceb
2017-11-29compiler warnings: drop some unused variablesNeels Hofmeyr2-4/+0
Change-Id: I840b0cd8ee3e7c521e7c9053a992deeb9ec22ff4
2017-11-29cosmetic: tighten function type signaturesMax2-9/+9
* change return type to bool * constify parameters The nm_is_running(), trx_is_usable() and ts_is_usable() always return boolean value and are always used as such anyway. The also do not change their parameters. Change-Id: I6a572fc78371c69f5308edbad0ebe15e143d0505
2017-11-29cosmetic: bsc_vty: Document bvci reserved valuesPau Espin Pedrol1-0/+1
Change-Id: I7a4374c3619cb83ef8beef594281f887d9fbf70a
2017-11-29cosmetic: bsc_vty: Fix trailing whitespacePau Espin Pedrol1-2/+2
Change-Id: I7089062285c40ec11af479c98b43d1d407397c82
2017-11-29auth: remove obsolete VTY commandsPhilipp Maier2-15/+0
Authentication is no longer done in the BSC, the variables that set the authentication policy and the IMSI regex have no longer any effect. Remove auth policy and authorized-regexp Change-Id: Ie31b921b5fd0af5501ec0c77c0f08089c10075e2
2017-11-29OML: consider administrative state when reportingMax2-2/+7
Report state as degraded if BTS or any of its TRX are administratively locked. Change-Id: Ic9ee998d972ca870ce5d039c3ed95edb6ba8b36f Related: OS#2486
2017-11-24vty: Add cmd to configure 3g Early Classmark SendingPau Espin Pedrol3-3/+30
In state prior to this patch, "3G Early Classmark Sending Restriction" bit in SI3 rest octets was always set to H, which is a sane default as the policy to send the information is then controlled by "Early Classmark Sending Control" bit in the same octet. However, it seems Quortus SoftCore can have some issues decoding the option, so let's add a vty cmd to be able to disable it for those having any issues. Related: SYS#4021 Change-Id: Ic1afe071038a3bb5871d7ff40f665c8644f801ec
2017-11-24Use type bool for boolean fields in gsm48_si_ro_infoPau Espin Pedrol1-7/+7
Change-Id: Ic0981fca96f4927717ca335be1dab00a5d17fd6c
2017-11-21bsc_init: fix Werror: define rc for 2quater with si2q_count == 0Neels Hofmeyr1-0/+1
src/libbsc/bsc_init.c: In function ‘rsl_si’: src/libbsc/bsc_init.c:153:2: error: ‘rc’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return rc; ^ Change-Id: Iedad1efcb477c77db8c741777ea076761658c7d1
2017-11-02Check OML state per-BTSMax2-9/+9
To properly decide if a given OML link is degraded we have to use BTS-specific information about MO state. * move check function into BTS-specific part * add generic wrapper Related: OS#2486 Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
2017-11-01vty: skip installing cmds now always installed by defaultNeels Hofmeyr3-6/+0
vty_install_default() and install_default() will soon be deprecated. Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Change-Id: If2edf59a687a78d6db6bc73117a27509374b0fc6
2017-10-23libbsc: Use correct printf formatting for uint64_tPau Espin Pedrol1-4/+4
unsigned long can be 32 bits on some arch/OS, while "current" field is always 64 bit because it's a uint64_t. Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5
2017-10-17bsc_api: Fix NULL secondary_lchan access in handle_ass_failPau Espin Pedrol1-2/+4
Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan@entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan@entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact@entry=0, mode=mode@entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg@entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling@entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Possible scenario in which this crash can appear: 1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN ACTIVATE msg and arms T10 timer. 2- ACTIVATE ACK is received (handle_chan_ack), which calls gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't disable/modify T10 timer. 3- T10 timeout is triggered (assignment_t10_timeout()), which sets conn->secondary_lchan = NULL 4- Immediately after, the ASSIGNMENT FAILURE message (which might have been already queued) is processed in handle_ass_fail, and then the crash occurs. This race condition is not an issue for handle_ass_compl() path because there's this check there which would trigger most probably if secondary_lchan is NULL: "if (conn->secondary_lchan != msg->lchan)" Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1
2017-10-11SI1q: fix EARFCN appenderMax1-5/+20
Previously if we ran out of space while adding EARFCN, we simply return which might result in malformed SI2q. Fix it by proper rollback of entire EARFCN. While at it, let's be paranoid and introduce extra checks against integer overflow in budget calculations. Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7 Related: OS#2357
2017-10-11ctrl: add oml-uptime commandMax3-13/+41
Expose OML link uptime available via vts's "sh bts 0" command with the new "bts.0.oml-uptime" ctrl command. To avoid code duplication, move uptime computation into separate function and use it for both. Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d Related: OS#2486
2017-10-10SI2q: fix generation for multiple UARFCNsMax2-13/+11
* fix insert routine to keep the list sorted by UARFCN * fix rest octets generator to properly account for offset * adjust test results accordingly Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Related: OS#2357
2017-10-09OML: consider RSL link stateMax5-6/+35
OML link state is available via vty ("sh bts 0" command) and ctrl ("oml-connection-state" RO variable). When showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. That's implemented via BTS model-specific functions (currently Sysmo- and Nano- BTS only) Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486
2017-10-09SI2q: cleanup UARFCN additionMax2-88/+90
* expand comments, fix typos * constify parameter * move try-add-adjust routine into separate function to facilitate further modifications * remove excessive checks and unnecessary return values * move (UARFCN, Scrambling Code) tuple uniqueness check into separate function and use it early Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Related: OS#2357
2017-10-01Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1'Harald Welte2-3/+21
In masurement reports sent by the MS, this can then be used to correlate if a given measurement report was in response to a BCCH/neighbor list received on BCCH (SI2xxx) or on dowlink SACCH (SI5xxx). Closes: OS#2525 Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a
2017-10-01libbsc: document arguments of generate_bcch_chan_list()Harald Welte1-1/+7
Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b
2017-09-27Show OML link uptime in vtyMax3-3/+29
Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600
2017-09-25Further cleanup leftovers from BSC/MSC splitMax1-1/+0
* drop unused header * fix name of jenkins test * remove dead code Change-Id: I986904864741995910b6ba92173b9f7b1b03e2f1
2017-09-23Wrap channel state assignment in macroMax2-5/+6
Previously we've used function so debug print always pointed to the same place which is not very useful. Wrap it with macro so proper file:line is printed. Also, make sure that we always change state only through this wrapper and log only when the state has changed. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321
2017-09-14SI13: drop PBCCH-related bitsMax2-44/+16
According to 3GPP TS 44.018 §1.8 the "network shall never enable PBCCH and PCCCH". Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Related: OS#2400
2017-09-08Make TRX rf locking more visibleMax3-7/+11
* log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864
2017-09-06move include/openbsc to include/osmocom/bscNeels Hofmeyr37-211/+211
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055