aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
AgeCommit message (Collapse)AuthorFilesLines
2018-11-29Re-introduce support for IPA-encapsulated MGCPlaforge/mgcp-ipaHarald Welte5-20/+166
Old osmo-bsc-sccplite already supported this, but in the migration over to libosmo-sigtran and to real 3GPP AoIP, this functionality got lost. We now crate a UDP proxy socket. Any MGCP commands received via IPA from MSC (or rather: bsc_nat) are retransmitted to the MGW via UDP on this socket. Any responses back from the MGW received on the UDP socket are retransmitted back to MSC/bsc_nat as MGCP inside the IPA multiplex. Closes: OS#2536 Change-Id: I38ad8fa645c08900e0e1f1b4b96136bc6d96b3ab
2018-11-28bsc: lchan_select: Avoid returning a TCH/H lchan when TCH/F is requestedPau Espin Pedrol1-16/+1
If BTS is configured to have only TCH/F_PDCH and TCH/H and a call is resolved to require TCH/F, don't return the TCH/H which have no use, but instead let it allocate the TCH/F_PDCH. 20181128185013783 DRLL <0000> lchan_select.c:159 (bts=0) lchan_select_by_type(TCH_F) 20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4,state=IN_USE) is != TCH/F 20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=1,pchan=SDCCH8,state=UNUSED) is != TCH/F 20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=2,pchan=TCH/H,state=UNUSED) is != TCH/F 20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=3,pchan=TCH/H,state=UNUSED) is != TCH/F 20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=4,pchan=TCH/H,state=UNUSED) is != TCH/F 20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=5,pchan=TCH/H,state=UNUSED) is != TCH/F 20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=6,pchan_on_init=TCH/F_PDCH,pchan=PDCH,state=PDCH) is != TCH/F 20181128185013784 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=7,pchan_on_init=TCH/F_PDCH,pchan=PDCH,state=PDCH) is != TCH/F 20181128185013784 DRLL <0000> lchan_select.c:71 looking for lchan TCH/H: (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4,state=IN_USE) is != TCH/H 20181128185013784 DRLL <0000> lchan_select.c:71 looking for lchan TCH/H: (bts=0,trx=0,ts=1,pchan=SDCCH8,state=UNUSED) is != TCH/H 20181128185013784 DRLL <0000> lchan_select.c:86 looking for lchan TCH/H: (bts=0,trx=0,ts=2,pchan=TCH/H,state=UNUSED) ss=0 is available 20181128185013784 DCHAN <0010> lchan_select.c:253 lchan(0-0-2-TCH_H-0)[0x6120000066a0]{UNUSED}: (type=TCH_H) Selected Change-Id: I9a73beb0432fab16d5430e5b40d470694e09b189
2018-11-28cosmetic: bsc: timeslot_fsm: Clean uneeded scope bracketsPau Espin Pedrol1-5/+4
Change-Id: I5140f98e23b8c8d16ce0cca0be66297aaf0b5653
2018-11-27send Immediate Assignment Reject only before Immediate AssignmentNeels Hofmeyr1-3/+12
Set flag lchan->activate.immediate_assignment_sent to true when sending, and omit a reject after that. lchan->activate gets completely zeroed in lchan_reset(), which sets that flag back to false whenever an lchan becomes inactive. Related: OS#3709 Change-Id: I9ad094d272254d7aee9b0a676201d4ed8cd727ca
2018-11-23vty: add command to show TRX selectivelyMax1-4/+46
Add following commands showing only TRX with appropriate RSL link status: * show trx connected * show trx disconnected This simplifies troubleshooting of complex setup with multiple BTS with several TRX each. Change-Id: I48866ce311a3e2c63235f60a497efe97bbd05a4a
2018-11-22LCLS: add bts-loop variantMax3-8/+53
Add LCLS variant where the loop is closed on BTS level instead of MGW. The main difference is the handling of connection-related messages (we use IPA RSL instead of MGCP), the configuration and correlation logic remains the same. Change-Id: I7e8379f31037f2c48da69a01919701919a3066a2 Related: OS#3659
2018-11-22RSL: restructure MDCX functionsMax1-6/+18
In preparation for upcoming LCLS changes we have to split IPA RSL MDCX generation into separate function with the ability to set destination explicitly instead of just using the value from lchan which will be used in follow-up patches. Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8 Related: OS#3659
2018-11-21gsm0408_rcvmsg: Release lchan if L3 fails to completePau Espin Pedrol1-1/+6
gscon_release_lchans stub is added to gsm0408_test.c to make linker happy. Change-Id: I1743f9d5cd0fdbc0fb9afe7bcc0271c897915210
2018-11-21abis_nm: Introduce new signal S_NM_GET_ATTR_REPPau Espin Pedrol1-2/+7
This signal can be used for tools willing to request and parse Attribute Response and do something with the information. ipaccess-config tool will use this signal in later patch Change-Id Ida416a969a3309868d6f4e50f34b34f224c32dd6. Related: OS#3624 Change-Id: I9a121bbfe1b96904d4e16845abc90bb6ef20d2c9
2018-11-20bsc: vty: Verify and warn on invalid arfcn passedPau Espin Pedrol1-1/+31
Related: OS#3063 Depends: libosmocore Change-Id I780d452dcebce385469e32ef2fd844df6033393a Change-Id: Ib001501bf37289e824a1f72b62afde23892e88d2
2018-11-20bsc: band_compatible: Return band non-compatible for invalid arfcnPau Espin Pedrol1-1/+6
Before libosmocore Change-Id I780d452dcebce385469e32ef2fd844df6033393a, it avoids stating arfcn 886-954 are compatible when operating under DC1800. After that Change-Id, avoids aborting the program due to unexpected behaviour. Related: OS#3063 Depends: libosmocore Change-Id I780d452dcebce385469e32ef2fd844df6033393a Change-Id: Ibf5d5ab50b6fc6597244eeedcd27d2ce245278a3
2018-11-20bsc: Enable force-combined-si on nanoBTS by defaultPau Espin Pedrol4-4/+15
Some nanoBTS firmwares (if not all) are known to not work properly with SI2ter. If BSC enables SI2ter through RSL, SI3 bit announcing SI2ter available will be forwarded by nanoBTS to MS, but will still only send SI2 message instead of expected SI2ter during TC=5 (see GSM 05.02 sec 6.3.4 "Mapping of BCCH data"). As a result, some MS won't allow registering to the network. To avoid this kind of scenario, enable force-combined-si by default on nanoBTS while still allowing to overwrite the feature through VTY. Other BTS models are kept with force-combined-si disabled by default as usually, since they seems to be working fine when SI2ter is enabled. Related: OS#3063 Change-Id: Ide6e8967de0eedc9e2bcaf4414aaa537b009d72d
2018-11-20bsc: si: Fix SI2ter L2 pseudo lengthPau Espin Pedrol1-1/+1
3GPP TS 04.08 V7.21.0, section "9.1.34 System information type 2ter" states: """ This message has a L2 pseudo length of 18. This message may be sent by the network with either a L2 pseudo length of 18 or some other value. A mobile station that does not ignore this message shall not discard the message due to a received L2 pseudo length different from 18. """ Change-Id: I45cb217ebdf89b82b0f37f38eef7a1e3a651f541
2018-11-20bsc: si: Fix SI2bis L2 pseudo lengthPau Espin Pedrol1-1/+1
3GPP TS 04.08 V7.21.0, section "9.1.33 System information type 2bis" states: "This message has a L2 pseudo length of 21.". Change-Id: I623c64c446c0973e939e9f1cba0a4d4d2f4f7237
2018-11-20bsc: Prefix log string with related SI type during call to list_arfcnPau Espin Pedrol1-4/+4
SI2 and SI5 "same band" strings already contain the prefix. Change-Id: Ie466abedce630ef0a8e7a8021383a1a612a0da8a
2018-11-19unlink socket path correctly in rf_create_socket()cid188836Stefan Sperling1-1/+5
In commit 65c62e50335b500ac9e4658530ca5a1b4f5328d8 a call to unlink() was erroneously moved up. Since then unlink() has been called with an uninitialized path variable. The problem went unnoticed because the return value of unlink() was never checked. Ensure that unlink() is called with an initialized argument and verify success of the unlink() operation if the socket exists. Related: CID#188836 Change-Id: Ia0c873da305cbb47aef0562f61ec21057363f294 Fixes: 65c62e50335b500ac9e4658530ca5a1b4f5328d8
2018-11-19LCLS: make config and control redable in 'sh conns'Max1-2/+4
Display LCLS config and control state as text in "show conns" command. Change-Id: Ibc2525d453e3aa845fe6f3a98f908c2b6b49f1f0 Related: OS#3659
2018-11-18LCLS: move mode check into separate functionMax1-8/+25
Before closing or breaking the loop in LCLS we do preliminary checks. To facilitate adding new LCLS modes it's restructured as follows: * move check into dedicated static function * explicitly check for MGW mode in endpoint check * check for mode mismatch Change-Id: I32ba232ad802625d97a0ad9d0511edc6ac7f251c Related: OS#3659
2018-11-18LCLS: explicitly check for mode before closing the loopMax1-11/+13
Change-Id: Ie91cc70de20ade2bfa3a1a108c731341f5e739bb Related: OS#3659
2018-11-18add missing 'break' in switch statementStefan Sperling1-0/+2
Coverity points out that abis_nm_rcvmsg_sw() contains a switch statement with suspicious looking missing break statements. It is unclear to me if the code intends to process some types of messages in more than one state, or of all messages which affect a particular state already appear in the state's corresponding switch block. Can someone else tell what is supposed to happen here? If this code is falling through intentionally, I will suggest a patch adding /* fallthrough */ comments for clarity. Change-Id: I1ea4221fadf30074156e9d17d94a5cb065242584 Related: CID#57703 Related: CID#57704
2018-11-18always directly send BSSMAP Clear RequestNeels Hofmeyr1-1/+8
When a gscon wants to send a BSSMAP Clear Request, it makes no sense to do it conditionally depending on the current conn state. Just send it: don't call gscon_sigtran_send(), directly go for osmo_bsc_sigtran_send(). In particular, if an incoming inter-BSC handover ends in failure, the gscon state is still ST_INIT, but if the MSC fails to give us a Clear Command, we may want to ask with a BSSMAP Clear Request. Change-Id: I39fae24260a4bb7a6af704ebe760f93fff566536
2018-11-18osmo-bsc: gsm_timers_vty: Set global T_defs during vty_initPau Espin Pedrol1-0/+1
Otherwise any use of functions in gsm_timers_vty.c will fail because g_vty_T_defs is never set (so it is NULL). Change-Id: Ieeb27fdb06c965fa6b70aeb0f3b3f5169b1f2012
2018-11-18check return value of gsm48_multirate_config()Stefan Sperling1-6/+21
Check the return value of gsm48_multirate_config() in function lchan_set_single_amr_mode(). This prevents an invalid AMR mode from being configured for a logical channel. Because the VTY parsier limits the AMR mode range to 0-7 this is just a theoretical issue. However, this fact is beyond the understanding of a static code analyzer, and the absence of error handling was indeed setting a bad example. Change-Id: I61153a44e8b7a38332bf38718397be9b339d5f25 Related: CID#188940
2018-11-18LCLS: tighten GCR checkMax1-13/+14
Use stricter checks for received Global Call Reference. Change-Id: I9690e1b2d14e41471413bb35eb22fa6c4c4d67fd Related: OS#2487
2018-11-18bsc: gsm0808: Fix return code in bsc_compl_l3Pau Espin Pedrol1-1/+1
complete_layer3 returns true if everything succeeded, false otherwise. However, its caller bsc_compl_l3 returns unix style (0 sucess, negative error). This commit has no real effect since only caller of bsc_compl_l3 never checks return code, but will check it in the future. Change-Id: I722696c3f6402288b51d6fcf51f478b3b0c9f0f0
2018-11-16bsc: vty: Use enum value in neighbor-list checkPau Espin Pedrol1-1/+1
Change-Id: I7c0b42bfed749f18b8ab2331475f3da35b02f456
2018-11-16bsc: bts_alloc: Use enum value during neigh_list_manual_mode initializationPau Espin Pedrol1-1/+1
Change-Id: I6a4325d45de143d32db55df8e84282cc64800c9f
2018-11-15show dynamic timeslot details in 'show timeslot' vty commandStefan Sperling1-29/+34
The 'show lchan' command already shows details about timeslot state, indicating whether a channel is currently being switched to a different channel type. However, this information was not shown by 'show timeslot' yet. There are TTCN3 BSC tests which use 'show timeslot' and are seeing sporadic failures when 'show timeout' is invoked during a channel type transition. With this change, VTY sessions recorded in pcap files for these tests will contain information about the current channel type transition state. Change-Id: Ib854945756fb54c0e1c7d4212ea7b8746eec0db5 Related: OS#3690
2018-11-14coverity: gscon_forget_lchan: squelch forward-nullNeels Hofmeyr1-5/+3
conn->fi should actually never be NULL, they are allocated and discarded simultaneously. So check its null from the start and remove some conditions below, to remove the coverity warning. Related: CID 189671 Change-Id: I62354aa998832131c86535f39a29294000114adc
2018-11-14lchan: set cause for 4 instances of release_in_error = trueNeels Hofmeyr2-0/+4
Make sure some RSL cause is set. Change-Id: I372ade9fc58919fbf858ce14caab8a0a22dbb083
2018-11-14cosmetic: abis_rsl.c: drop uneccesary bracesNeels Hofmeyr1-2/+2
Change-Id: I20a7b160321cf86179cdcece71c8158e76ba4a1b
2018-11-14cosmetic: lchan: introduce sub-struct lchan->release.*Neels Hofmeyr3-37/+38
Put all lchan release related flags and settings in a sub-struct named 'release' to better indicate what those fields are for. There is no functional change. Change-Id: Icfddc6010e5d7c309f1a7ed3526b5b635ffeaf11
2018-11-14lchan release: always Deact SACCHNeels Hofmeyr8-28/+27
If an lchan is being released and had a SACCH active, there is no reason to omit the Deact SACCH message ever. All of the callers that passed do_deact_sacch = false did so for no good reason. Drop the do_deact_sacch flag everywhere and, when the lchan type matches and SAPI[0] is still active, simply always send a Deact SACCH message. The do_deact_sacch flag was carried over from legacy code, by me, mainly because I never really understood why it was there. I do hope I'm correct now, asserting that having this flag makes no sense. Change-Id: Id3301df059582da2377ef82feae554e94fa42035
2018-11-14lchan: release in error: fix missing messages / eventsNeels Hofmeyr1-12/+18
In the case where there is a release in error and we skip immediately to the RF Release state, send all of Deact SACCH, RR Release messages and also signal the lchan_rtp_fsm as appropriate. Move that code to static lchan_do_release() and call from both lchan_fsm_wait_rll_rtp_released_onenter() in the normal case, as well as lchan_release() when skipping that. When releasing in error, but we're already in LCHAN_ST_WAIT_RLL_RTP_RELEASED, those messages have already been sent and we can skip them. Change-Id: I648a9826ce56b611359f81462ca03e4ab4c736aa
2018-11-14abis_rsl.c: drop unused enum sacch_deactNeels Hofmeyr1-5/+0
Change-Id: I8a1542e92373d2773699744e7b64a08667a4b0f5
2018-11-14fix: send RR Release (e.g. after BSSMAP Clear Cmd)Neels Hofmeyr8-27/+28
After commit [1], the code makes sure to disassociate lchan and conn before invoking the lchan release. However, we only send RR Release if a conn is present, which clearly is nonsense after [1]. [1] commit 8b818a01b00ea3daad4ad58c162ac52b4f08a5cb "subscr conn: properly forget lchan before release" Change-Id: I4fd582b41ba4599af704d670af83651d2450b1db Manage sending of RR Release via a flag, set during invoking lchan release. Add do_rr_release arg to lchan_release(), gscon_release_lchans(). In lchan_fsm.c, send RR Release only if do_rr_release was passed true; do not care whether a conn is still associated (because it won't ever be since [1]). That way we can intelligently decide what release process makes sense (whether the lchan terminates the subscriber connection or whether the connection goes on at another lchan), and still disassociate lchan and conn early. BTW, this problem wasn't caught by the stock OsmoBSC TTCN3 tests, because the f_expect_chan_rel() don't care whether an RR Release happens or not. This is being fixed by Ibc64058f1e214bea585f4e8dcb66f3df8ead3845. So far this patch should fix BSC_Tests_LCLS.TC_lcls_connect_clear. Related: OS#3413 Change-Id: I666b3b4f45706d898d664d380bd0fd2b018be358
2018-11-09dbug log: verbosely detach conn<->lchanNeels Hofmeyr2-3/+38
When reading the log of OS#3686, I wished for explicit logging of when exactly an lchan disassociates from a conn. Here is the debug logging I would have liked to see. I'm not sure whether we really need to merge this patch... Change-Id: I97558b899e7f2578ba98287e7352dc072d02ce44
2018-11-09lchan: rf release: make sure conn is NULLNeels Hofmeyr1-1/+3
lchan_fsm_wait_rf_release_ack_onenter() calls gscon_forget_lchan(). At the point where the conn has no lchan, the lchan must not have a conn. Make sure that conn is NULL after gscon_forget_lchan(). I hope this fixes OS#3686, it is the only situation I could find where the disassociation is potentially one-sided. I get the feeling that this should be hardcoded in gscon_forget_lchan(), but I dimly remember other situations that are less trivial, where it doesn't necessarily make sense to forget reciprocically. So only fixing this one now. Related: OS#3686 Change-Id: If0c6e495e419b9dbb44443c3fc3f54dd4b714aa5
2018-11-09lchan_fsm_cleanup: drop redundant 'forget_lchan' callNeels Hofmeyr1-2/+0
Right below this call, we invoke lchan_reset(), and the first thing it does is gscon_forget_lchan(). Drop this redundant invocation. Change-Id: I503efceb6d34c8df0cdfef3dfc83fa1e61271c47
2018-11-09abis_nm: parse_attr_resp_info_unreported: Fix offset calculationPau Espin Pedrol1-1/+1
See following specs for related information: * 3GPP TS 52.021 §8.11.3 Get Attribute Response * 3GPP TS 52.021 §9.4.64 Get Attribute Response Info Related: OS#3624 Change-Id: Ie61d70bc28427d5d879638516a36f590ce98bdc7
2018-11-09abis_nm: Support parsing nanoBTS format for Get Attributes InfoPau Espin Pedrol1-1/+9
Spec compliant format is defined in: * 3GPP TS 52.021 §8.11.3 "Get Attribute Response" * 3GPP TS 52.021 §9.4.64 "Get Attribute Response Info". On nanoBTS, however, reported attribute list is provided directly inside/after the foh header instead of being enveloped inside the Get Attributes Response Info. Furthermore, The Get Attributes Response Info can still appear and be at any position in the reported attribute list, and it only contains the unreported attribute ID list inside. Change-Id: I81a613d53bddf432a79fa5cb0bf9d847b4bdee37
2018-11-09abis_nm: Add support to parse OML IP and Unit Id in Get AttributesPau Espin Pedrol1-0/+47
Change-Id: Ia05e0b8fe3e28aaf2b2253d018f0614e83e23caa
2018-11-09abis_nm: Add support to parse some nanoBTS Attribute Response attributesPau Espin Pedrol1-1/+2
nanoBTS actually supports regular formatting. There are a few differences with spec though: * The attributes are listed directly in the message instead of being inside the Get Attributes Response Info after the unsupported attribute ID list. * The Get Attributes Response Info can be at any position in the attribute list, and it only contains the unsupported attribute ID list. As a result, parsing is currently split into 3 main parts or functions: * Parsing regular (per spec) Get Attributes Response Info attr and get a pointer to the list of attributes. * A function that parses the list of attributes, called directly in case of nanoBTS, and called by the former parser of Get Attributes Response Info for regular (per spec) OML endpoints. * A function to parse the unsupported attribute ID list, also used in the first function to get a pointer to the list of attributes. Related: OS#3624 Change-Id: I52e9f177c14fec1ec3f5c4ddb244594409008357
2018-11-09abis_nm: Allow sending and receiving Get Attributes (Response) against nanoBTSPau Espin Pedrol1-2/+5
* Allow sending Get Attributes message in abis_nm_get_attr. * Don't try to decode Get Attribute Response Info for nanoBTS, since it uses a different formatting than the one defined in specs. Related: OS#3624 Change-Id: I53d01e73791cf5450aa34b1ac8f051730e3a70f9
2018-11-09abis_nm: Split reported attr list parsing from Attribute Response Info into ↵Pau Espin Pedrol1-54/+42
its own func nanoBTS uses same format for the attribute list from Attribute Response Info, but without using the later as an evelope. By splitting we can later reuse the code handling the Attribute list. While at it, take the chance to remove functions parse_attr_resp_info_* which expect TLVs following an specific order, which is not mandatory. Related: OS#3624 Change-Id: Iec7a6e4d27639d0e5adc0d9a01cd3c3e7a46f558
2018-11-09abis_nm: Split handling of Attribute Response Info into its own funcPau Espin Pedrol1-12/+19
In future commits, nanoBTS support will be added, which implements its own format not exactly equal to specs Attribute Response Info. Related: OS#3624 Change-Id: I346dacc58faac70e6d224ca49484f9211cb8a046
2018-11-09abis_nm: Rename m_id_len to ease review of forthcoming patchesPau Espin Pedrol1-6/+6
This function will be merged into another using a "len" variable. This change makes diffs easier to follow in future patches. Change-Id: I1be03e31901ccf284e31237a04bb7448d1f22c07
2018-11-09gsm_data: make cgi_for_msc available for other modulesPhilipp Maier2-16/+16
The function cgi_for_msc() provides an easy way to get a cell global id for an msc/bts combination. This function is currently statically defined in gsm_08_08.c. Lets move it to gsm_data.c and make it publicly available. Change-Id: I301fac6e83a429ae59b5c586aa283ad7ba54053d Related: OS#3645
2018-11-09re-order condition checks for clarityStefan Sperling1-10/+9
Coverity points out that conditional checks in set_net_timezone() depend on each other: The value of 'override' depends on 'hourstr' being non-NULL. Nest these conditional checks such that this dependency becomes obvious. No functional change. Change-Id: I10dece1e1d9e039fb9f03be89b3a202cb077b026 Related: CID#148208
2018-11-08LCLS: expand logging to print the name of the mode in useMax3-8/+11
Change-Id: I56b57936ae82984e84896228da5a83115a78bbd7 Related: OS#3659