Commit Graph

7442 Commits

Author SHA1 Message Date
Neels Hofmeyr a4e71a6f9c compl l3: separate paging handling from bsc_scan_bts_msg()
bsc_scan_bts_msg() essentially updates the MS power class for LU and CM
Service, and also stops the paging and counts the response for a Paging
Response. Separate that.

Reduce code dup by one common parse_power_cap() function for both LU and CM
Service.

Call handle_page_resp() separately.

(Upcoming patches will add more reasons to read the gsm48_hdr's pdisc and mtype
in bsc_compl_l3().)

Change-Id: If14284494c74a396fabebd79da8079342e65dcc2
2020-10-07 10:19:58 +00:00
Neels Hofmeyr c065ea01d1 gscon_bssmap_clear(): guard against NULL msc
Change-Id: I95b16cebb6ff78649f72a09b5d6c7c7e403233fa
2020-10-07 10:19:58 +00:00
Alexander Couzens c58a384c75 bsc_vty: parse the return code to make coverity happy
The missing return code isn't a problem atm because remote.af is checked
and remote.af is only set when osmo_Sockaddr_str_from_sockaddr() returns success.
However check the return code to be safe also in the future.

Found-by: Coverity
Fixes: CID#214863
Change-Id: I621360cab1e12c22248e33d62a9929995053ce04
2020-10-07 00:58:54 +02:00
Alexander Couzens c47d80a89b bsc_vty: cfg_bts_gprs_nsvc_rip: add missing breaks
Found-by: Coverity
Fixes: CID#214862
Change-Id: I0966bfd3948fef4dd2a4465aae0927bff6437e43
2020-10-07 00:58:45 +02:00
Alexander Couzens 62af292f38 pcuif_proto: version 10: add support for IPv6 NSVCs
Introduce a address_type in the NSVC configuration pass the given
protocol. The remote_ip is network byte order, the default
encoding for in_addr and in6_addr.

Related: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973
Related: SYS#4915
Change-Id: I740be0a401612bb5ed4e8ccd7f4be8176b936449
2020-10-05 14:06:26 +00:00
Alexander Couzens 97d3978dd0 pcuif_proto: version 10: add frequency hopping parameters
Related: SYS#4868, OS#4546, OS#4547
Change-Id: I5540fae66a116cbb25ec75b35145c36137146ffd
2020-10-05 14:06:26 +00:00
Alexander Couzens 2f9df96eba oml: encode IPv6 NSVC using the new OML attribute NM_ATT_OSMO_NS_LINK_CFG
The old IE NM_ATT_IPACC_NS_LINK_CFG didn't support IPv6 NSVC.

Depends: Ic261bc43a07fa741b97a9c6ec5a9ed6f5ecae588 (libosmocore)
Depends: I9e279bb20940c66eea5196f281184cb4f8a5cc5f (libosmocore)
Change-Id: I6529876a3c1116a79dd624312243d8ae48a41fe2
2020-10-05 14:06:26 +00:00
Pau Espin 37474b2b38 ipa oml: tx OPSTART after unlocking, not before
According to TS 12.21, when adminsitratively Locking an object, in
general it should go into operative state Disabled. We don't really
implement it this way right now, but keep it this way consistent in all
objects.
Furthermore, TS 12.21. Figure 2 describes vaguely that unlock procedure
is done around same time where object attributes are set, which is
before OPSTART.

Change-Id: Icd4b3bb467f23c9ddfa56f6b6f8a55da1e574ab8
2020-10-05 08:47:20 +00:00
Alexander Couzens 5fa725314d pcuif_proto: protocol 9: add missing fields
The protocol 9 was extended (compatible) with
* app info request
* suspend request (ETWS)
* rach indition (add fields ts / trx)

Only copy the relevant parts but no implementation.

Related: OS#4766, OS#4767, OS#4768
Change-Id: Ia81310326b093a8e473b6c69045304667b3b60f1
2020-10-03 18:42:05 +00:00
Alexander Couzens 9bdc6e4d7a pcu_sock: use tn as variable name to improve readability
Same as used in osmo-bts

Change-Id: I5c8cf0e2d29fa4999983293401294ee0a94bfa30
2020-10-03 18:24:17 +00:00
Neels Hofmeyr d712451d5d remove unused signature gsm48_handle_paging_resp()
Change-Id: Ib221e34afe08d87e43ac7ddc73d6894bbe36dc4b
2020-10-03 07:38:41 +00:00
Neels Hofmeyr 71def15b05 log MSC nr for opening new A conn
Change-Id: Ie2df767197947b2d5ffeb882dc0827914975df88
2020-10-03 07:38:41 +00:00
Neels Hofmeyr 1559b129ee tests: add missing *.vty to EXTRA_DIST
Change-Id: If29eb737040826d387b6a1aaa246cd867ad97cdd
2020-10-03 07:38:41 +00:00
Pau Espin f875783b8d cosmetic: tests/ctrl_test_runner.py: Fix trailing whitespace
Change-Id: Id4b0ddc72e6f0e080ac7deeba30aa9acf25a0fc0
2020-10-02 19:31:43 +02:00
Pau Espin 946d679ca3 abis_nm: Remove duplicated log line
Change-Id: I52ff3c7457ca9985bb4936a6ec48abe0aee07e71
2020-10-02 19:31:43 +02:00
Pau Espin beac3d2c98 abis_nm: Log no state change detected
Change-Id: I15695b18ad7b31c2f9579813b76ecee36cce4ede
2020-10-02 19:31:43 +02:00
Pau Espin d2313548e7 abis_nm: Log Rx Change Administrative State ACK
Change-Id: I165138634b1fdb982197afdac6d2d00a4d1e4074
2020-09-30 12:44:33 +02:00
Vadim Yanitskiy f680938279 vty: fix unreacheable code / wrong check in lchan_act_all_trx()
Change-Id: If7d8a108a147980d26b71836343d20b1b0b95579
Fixes: CID#214277
2020-09-28 11:47:11 +07:00
Pau Espin 68fc19f5da bssap: Use new DTAP DLCI helper fields from libosmocore
This is the only place where the entire dtap header is passed, where
the split between SAPI and CHAN is done. Other places in osmo-bsc pass
around a link_id integer containing everything, so leaving that out of
the scope for this patch.

The gsm0406_dlci_sapi_name() API was introduced in libosmocore 1.3.0,
and osmo-bsc currently requires libosmocore 1.4.0, so it means we are
not further restricting libosmocore dependency here by using it.

Change-Id: Ib72e2bda46e39d1075e4270ac5fa51df2f418164
2020-09-23 13:50:25 +02:00
Alexander Couzens 9a701d7e70 abis_nm: abis_nm_perform_test: fix a potential null deref
gcc 10.2.0 warns msgb can be a deref because nm_msgb_alloc() can fail with null.

Change-Id: I4b0e4cd15046272e026cd74c14cbf2972ef6a070
2020-09-21 18:41:58 +02:00
Pau Espin 1a7e3ccef1 oml: Fix premature Opstart to Radio Carrier
During the A-bis/OML bootstrapping, osmo-bsc sends Opstart to the
Radio Carrier MO twice.  The first Opstart is triggered by the
State Changed Event Report, originated by the Radio Carrier itself.
The second is triggered by Software Activated Report.

According to 3GPP TS 12.21, figure 2, we shall send it only once,
after the "Attribute setting" step.  Therefore, the first Opstart
is premature, and we shall not send it.

Related: SYS#5063, OS#4755
Change-Id: If69393551117266ecb726d8961153560b2b3cc59
2020-09-20 09:56:49 +00:00
Philipp Maier 77189b535b bsc_vty: fix wrong else-if statement
Related: CID#214331
Change-Id: I1b0f324a66757278f7c95d25a5192d4234432a6b
2020-09-18 16:05:18 +02:00
Oliver Smith 3b3a6ba6eb lchan_fsm, lchan_rtp_fsm: make all timers configurable
Choose saner timer numbers before exposing to the user config.

Related: SYS#4897
Change-Id: I637fcdde93c11158de46157d494c060bb36bdcfb
2020-09-18 08:47:49 +00:00
Neels Hofmeyr 638eb99286 clean up timer definitions: introduce groups, move some T to X
Backwards compatibly, introduce timer groups in OsmoBSC, and move some
non-specified T timers to new X timers:

T993111 -> X3111
T993210 -> X3210
T999 -> X4

Why X4? because there already is an X3 used elsewhere in Osmocom, and I find
it less confusing if X-numbers don't repeat across programs. See
https://osmocom.org/projects/cellular-infrastructure/wiki/List_of_Timer_numbers

Drop unused timers from g_mgw_tdefs. Only X2427 has an actual effect.
(libosmo-mgcp-client recently moved T2427001 to X2427.)

Put libosmo-mgcp-client related timers to the 'mgw' group, like in osmo-msc.
This makes the MGCP timeout configurable for the first time.

Keep previous timer commands as DEFUN_HIDDEN, and also translate the moved T
timers to X timers on-the-fly. All previous VTY commands still work, and new
'timer [(net|mgw)] ...' commands are added. timer.vty shows this.

Remove the "_OPTIONAL" from the legacy "timer" and "show timer" commands, so
that they don't ambiguously overload the new "timer [(net|mgw)] ..." commands.

Related: OS#4539
Related: If097f52701fd81f29bcca1d252f4fb4fca8a04f7 (osmo-mgw)
Change-Id: I4beec47502afa193dee343869c4be55dc6a4b536
2020-09-18 08:47:49 +00:00
Philipp Maier 9d71f9619a bsc_vty: fix manual channel activation
The manual channel activation work in a very hackish way by sending the
CHANNAL ACTIVATION message manually using rsl_tx_chan_activ(). This
means the channel activation is not under FSM control. Also switchover
of dynamic channels does not work.

The lchan_fsm supports an activ_for in its activation info struct. The
header files define a "FOR_VTY" enum value there. However, the lchan_fsm
is not yet prepared to handle this. Lets update the lchan_fsm so that
FOR_VTY is supported and change bsc_vty to use lchan_activate() instead
of calling rsl_tx_chan_activ() directly. This will give us real channel
activation under FSM control.

Change-Id: Iffc57b7a5b7bdde06d392267791fd908e80bbb5d
Related: SYS#4910
2020-09-17 23:07:55 +00:00
Alexander Couzens e62f6a7e9d osmo-bsc: fix a crash when receiving a RACH LOAD IND with 0
Change-Id: Ia395d4ec70107688856ef0cd5daa6124a7da834b
2020-09-17 15:36:52 +00:00
Vadim Yanitskiy 127aeddab9 generate_ma_for_ts(): simplify MA bit-mask computation
Instead of maintaining two variables and re-calculating the bit
position on each iteration, let's use the existing field of the
bit-vector: set it to the first LSB and decrement in the loop.

Change-Id: I1b226a2d5867434c33ae04a0b971dbfd16c4688f
Related: SYS#4868, OS#4545
2020-09-17 15:28:34 +00:00
Vadim Yanitskiy c221b3b7b6 abis_nm: improve logging message in abis_nm_get_attr()
Change-Id: I10ef08e7d01ed27e05ef30c0bb876c0197a30500
2020-09-17 10:32:21 +00:00
Vadim Yanitskiy d3a7eb16b1 abis_nm: use LOGPFOH()/DEBUGPFOH() in parse_attr_resp_info_unreported()
Change-Id: Ib0c95c6c52122de06fa164f7a5fcb09ec7ad384a
2020-09-17 10:32:21 +00:00
Neels Hofmeyr 1eaa821e3e add timer.vty
Before transitioning some unspecified T timers to X timers, and to introduce
timer groups, first add this timer VTY test. Changes here will illustrate that
the legacy commands will still work and redirect to new timer definitions.

Related: OS#4539
Change-Id: Ie1bc635e16dc9a4040d063e1d9a51cdc76d9d1f2
2020-09-16 21:56:08 +00:00
Neels Hofmeyr 689b0e4e61 drop unused Tdef for 992427
Change-Id: I22a18662392545ba69f48e7fd8474c7c06d529cb
2020-09-16 21:56:08 +00:00
Neels Hofmeyr aa826cdcd7 drop bsc_subscr.lac
It does not make sense to set the bsc_subscr's LAC from a Paging Request,
especially since the paging code has loops that possibly kick off several
pagings.

At this point, there remains no code setting bsub->lac anywhere. We could set
it during rx of Complete Layer 3, but since there is no use for it besides a
vty dump, let's just drop the bsub->lac completely, and the vty dump of it.

Change-Id: Id017bd494d329b6fc254d7135b4074ac2b224d66
2020-09-16 21:54:52 +00:00
Neels Hofmeyr e60254118c dissolve bsc_grace_paging_request()
RF-locking: simply ask bsc_grace_allow_new_connection() at the start of
page_subscriber(). Before this patch, we would log an INFO of "Paging request
failed" when RF-locked, for each BTS. Instead log "RF-locked". (An upcoming
patch will introduce a LOG_PAGING() macro that will trivially add more log
context there, so not bothering now.)

Drop LAC condition: since Stefan introduced page_subscriber() starting 2018
Ic3c62ff0fccea586794ea4b3c275a0685cc9326e, matching a requested LAC to a
specific BTS is done *before* calling page_subscriber().

BTW: the msc->core_lac (config 'core-location-area-code') has not had an effect
on Paging maybe ever. I opened OS#4751.

Change-Id: Ic8696414a1db8f4b1be502d6434599f684746ed6
2020-09-16 21:54:52 +00:00
Vadim Yanitskiy f072fbad3e abis_nm: use DEBUGPFOH() in abis_nm_rx_sw_act_req()
Change-Id: Ib148a451edee88350f09895a85a9d1bc03f3ac00
2020-09-15 20:42:17 +00:00
Vadim Yanitskiy 1df9f5bba8 abis_nm: use btstype2str() in abis_nm_rcvmsg_manuf()
Change-Id: I6858480fb8343a4862601ef48ff1778c4e4b0275
2020-09-15 20:42:17 +00:00
Vadim Yanitskiy c5849457e0 abis_nm: abis_nm_get_ts(): use LOGPFOH() instead of generic LOGP()
Change-Id: I510506a5b2c9493d3473dd2b0fcb16a90aeb8c21
2020-09-15 20:42:17 +00:00
Vadim Yanitskiy 86f5cdd26a abis_nm: LOGPFOH()/DEBUGPFOH(): remove redundant context info
Change-Id: I3531a0da3c64aea8bf4df5ffa1d8768f7e70c87b
2020-09-15 20:42:17 +00:00
Vadim Yanitskiy 35f4212e58 abis_nm: fix msgb memleak in _abis_nm_sendmsg()
Change-Id: I8e9c5d32e9bc43c760cb71efb8cab4982a305f0e
2020-09-15 20:42:17 +00:00
Vadim Yanitskiy 5715237911 abis_nm: fix erroneous use of LOGPC() instead of LOGP()
Change-Id: I8b6f791e423d1f7fcdabcaaaab48fc9586c1dc7b
2020-09-15 20:42:17 +00:00
Alexander Couzens 380831e678 gsm 04.08: correct calculate the Cell Selection Indicator after release of all TCH and SDCCH
When the measurement bandwidth was added the calculation of the maximum
length wasn't increased.

Fixes: 27a887f666 ("gsm 04.08: encode the LTE neighbors measurement bandwindth in Channel Release")
Change-Id: Ic8132fd988140c34b8e0fd8349f4518fcbaecc31
2020-09-15 11:47:11 +02:00
Philipp Maier f150c25615 bsc_vty: improve manual activation of lchans (debug / labtest)
The VTY already has a method available to activate lchans manually,
however, this method does not support proper activation of signalling
channels. Also additional commands to activate multiple lchans at once
are helpful to make labtesting simpler and more efficient.

Change-Id: I66b874736c8c456eb82ccc26d5209987d8ed706c
Related: SYS#4910
2020-09-14 13:06:47 +02:00
Vadim Yanitskiy 68f1025273 vty: clarify NM state owner printed by 'show trx N' command
Change-Id: Ib17d1e98cfa1f293cf76cd9614722b6dec538960
2020-09-11 20:27:20 +07:00
Philipp Maier fcc5ffb96d abis_rsl: fix memleak in rach dos reduction function
The function reduce_rach_dos() only removes the tossed channel requests
from the list, but does not free them.

Change-Id: I0a62fc897c07e118dd637b156b6f2822c44db731
Related: OS#4549
2020-09-11 14:47:26 +02:00
Philipp Maier 3c6e86adce abis_rsl: inform user when expired channel requests get tossed
At the moment expired channel requests are dropped silently, however, it
might help to know when this happens - not only for debugging.

Change-Id: Ib49df551a4cd7d5652e85c8ce29ef132385d4ae4
Related: OS#4549
2020-09-11 14:38:54 +02:00
Philipp Maier 1482ec4813 abis_rsl.c: flush channel request queue on RSL bootstrap
When RSL link is bootstrapped the BSC should clear the channel request
queue.

Change-Id: Iefb333817033e8d376184b58d89b186d875b968f
Related: OS#4549
2020-09-11 14:38:54 +02:00
Alexander Couzens 27a887f666 gsm 04.08: encode the LTE neighbors measurement bandwindth in Channel Release
Encoding missing measurement bandwidth of LTE neighbors in Channel Release
(Cell selection indicator after release of all TCH and SDCCH value part).
The measurement bandwidth was encoded in the neighbors description transmitted in
SI2quater while missing in the Channel Release which would overwrite the
SI2quater measurement bandwidth.

Change-Id: I4847d840ba9d5ac56bd00e4f405dc47792008c0d
2020-09-10 20:23:11 +02:00
Alexander Couzens cdfd687af4 gsm_data: always set spare bits in channel description
The spare bits were never encoded even when the spec says it must be 00.
Most caller of _chan_desc_fill_tail() initialized the struct with memset(),
but not all.
The SI4 did not initialize it.

Change-Id: Ib03d6d2cdadc49e49aa94917d17f81ef3c83f11c
2020-09-10 08:43:58 +00:00
Vadim Yanitskiy 0098b5ce74 abis_om2000: check result of gsm_bts_trx_set_system_infos()
Ensure that osmo-bsc would not continue to work as usual, if for
some reason we cannot encode or send System Information messages.

Introduce transitional state OM2K_TRX_S_SEND_SI, from where we
can generate and send System Information messages.  Otherwise
it's confusing if we fail to do something when we're already
in state OM2K_TRX_S_DONE.

Change-Id: Ia6df539d0914c57ea80fdb29882832678b47f267
2020-09-09 11:29:06 +00:00
Pau Espin f087c1ebd4 lchan_rtp_fsm: Deferr IPACC MDCX after BTS side MGCP MDCX
This is needed to be able to force MGW to provide an IPv4 address during
MDCX, since IPACC protocol on the BTS side only supports IPv4, but one
may need IPv6 side at the same time on the core side.
By moving the IPACC MDCX request to a later step, the BSC gains
knowledge of the local address on each side (BTS, MGW), and if they
don't match (ie. BTS uses IPv4 and MGW uses IPv6), it can then get MGW
to offer an IPv4 address during MGCP MDCX containing the BTS IPv4
address. At that point, the MGW can see the mismatch and provide an IPv4
address in the MGCP MDCX ACK, which can then finally be communicated to
the BTS during IPACC MDCX phase.

Previous order:
BSC -> MGW: CRCX
BSC <- MGW: CRCX ACK		(get MGW local IP addr)
BSC -> BTS: IPACC CRCX
BSC <- BTS: IPACC CRCX ACK 	(get BTS local IP addr)
BSC -> BTS: IPACC MDCX 		(set MGW IP addr)
BSC <- BTS: IPACC MDCX ACK
BSC -> MGW: MDCX 		(set BTS IP addr)
BSC <- MGW: MDCX ACK

New order:
BSC -> MGW: CRCX
BSC <- MGW: CRCX ACK 		(get MGCP local IPv6 addr)
BSC -> BTS: IPACC CRCX
BSC <- BTS: IPACC CRCX ACK 	(get BTS local IPv4 addr)
BSC -> MGW: MDCX 		(set BTS IPv4 addr)
BSC <- MGW: MDCX ACK 		(here MGW changes its local addr to IPv4)
BSC -> BTS: IPACC MDCX 		(set MGW IPv4 addr)
BSC <- BTS: IPACC MDCX ACK

Change-Id: I4de5ea5c94c1482c9cb0b6386997a942edc60e32
2020-09-09 12:39:14 +02:00
Vadim Yanitskiy 422b751ac8 fix bootstrap_rsl(): check result of gsm_bts_trx_set_system_infos()
Ensure that osmo-bsc would not continue to work as usual, if for
some reason we cannot encode or send System Information messages.

Change-Id: I7d3458fb10760e33411f2074a6b2df1c257438d5
2020-09-08 20:19:18 +00:00