8768 Commits

Author SHA1 Message Date
Pau Espin Pedrol
2045a24042 Introduce hashtable to lookup bts by CI
Change-Id: Ia9d6a38496609fc906cc78124929e594e6a9d06e
2024-09-12 17:22:06 +02:00
Pau Espin Pedrol
469ba6a974 Introduce hashtable to lookup bts by LAC
The BTS is not added to the hashtable during allocation, because the
default LAC value is 0, which is GSM_LAC_RESERVED_DETACHED
(reserved by GSM 04.08), so it's also detached from the hashtable
(cannot be found based on a reserved value).

Related: SYS#7062
Change-Id: Id523027b49e0f58cd2c8c9b4dee619de415dbd15
2024-09-12 17:09:02 +02:00
Pau Espin Pedrol
166f7def62 tests/ctrl/osmo-bsc-neigh-test.cfg: Fix duplicate <LAC,CI> between bts1 and bts2
According to TS23.003, CI should be unique in a LAC.
Previous commit wrongly introduced a while ago a new "bts 2" with same
LAC and CI as "bts 1" in config file.

This makes current tests fails once a hashtable is added to lookup bts
by lac, since the hashtable code does prepend new bts instead of
appending them. As a result, bts 2 is returned instead of bts 1 being
previously returned.

Also change the ARFCN+BSIC since it was also duplicated. It makes not much
sense to have 2 neighbor BTS with same ARFCN+BSIC.

Fixes: 97ed3c8d97
Change-Id: I7d1ebd529e050ecb4c14b9d3523637e4c8c87e1d
2024-09-12 16:47:17 +02:00
Pau Espin Pedrol
b5a176322b gsm_bts_num(): use hashtable to lookup bts
gsm_bts_num() is mostly used to lookup bts object from its nr in VTY and
CTRL interfaces.
However, it's also used in hotter paths like pcu_rx().
It is also used during local neighbor resolution, mostly at startup or
when the VTY is re-applied from CTRL interface.

Related: SYS#7062
Change-Id: I7312da7d9aa80c6d0f2e92e9c7d20d32ce453ad1
2024-09-12 16:10:52 +02:00
Pau Espin Pedrol
6e306f47bc bts: Remove acc timers during talloc destructor
This went unnoticed because so far there's not clear way to free a BTS,
eg. through VTY.

Change-Id: I0f94d8fc775953ee98eebc4d80f825404c4f92b2
2024-09-10 18:45:26 +02:00
Pau Espin Pedrol
9d2e4f5a0e bts: Remove from net->bts_list during talloc destructor
This went unnoticed because so far there's not clear way to free a BTS,
eg. through VTY.

Change-Id: I2bb1d51541c79e417c0359830e9f095be4669867
2024-09-10 18:37:14 +02:00
Pau Espin Pedrol
ea7512d845 bts: Make sure bts_location entries in bts->loc_list are freed
This went unnoticed because so far there's not clear way to free a BTS,
eg. through VTY.

Change-Id: I4de3d56a4f1f6bd1fe880b72cdd384c2398dabc9
2024-09-10 18:26:06 +02:00
Pau Espin Pedrol
cde9bf66d4 Clarify code around bts->loc_list
In set_bts_loc():
* Comment stating the entry was appended to the list was wrong.
* location_equal() could be called with lastloc containing poisoned
  pointers (INIT_LLIST_HEAD), which is not that nice.

Change-Id: I5b706dfd3a96f5e9b61907a727ef5887338e66c6
2024-09-10 18:16:32 +02:00
Pau Espin Pedrol
dd82d94e29 bsc_vty: Use gsm_bts_num() in ho_or_as()
Change-Id: I49856a417a2be3a10c3bdf2553c52064f875ef94
2024-09-10 17:31:44 +02:00
Pau Espin Pedrol
2a0d405857 Remove unused function gsm_bts_by_lac()
Change-Id: I0b17699f15fdce7766e9ec6acf21b16ac0ab7151
2024-09-10 17:17:08 +02:00
Pau Espin Pedrol
9ca1457887 Log unsupported PCUIF for bts > 255
Since the "struct gsm_pcu_if"->bts_nr is still uint8_t, that means
only the first 256 configured BTS can properly make use of the
PCUIF interface and hence have gprs support.

This is not a major problem as long as the BTS connected to osmo-bsc
are of type osmo-bts, since usually those use a BTS co-located
osmo-pcu, hence on each one bts_nr=0.

But if we wanted to run them with osmo-bsc PCU co-located,
(eg rbs2000), then we'd need to extend the PCUIF interface.

Related: OS#6565
Related: SYS#7062
Change-Id: If5a8cd94195422989de3daa04be7ffc858c0a8eb
2024-09-10 16:27:06 +02:00
Pau Espin Pedrol
5edfec3062 pcu_info_update(): Simplify code path with early return
This makes it easy to add more checks, like done in a follow-up patch.

Change-Id: I694a0403e93af4435062f2b4534f84943007df87
2024-09-10 16:23:12 +02:00
Pau Espin Pedrol
cf7c76b13c pcu_tx_rach_ind(): Avoid forwarding chan_rqd to PCU if not expected
Change-Id: Ic12aa9842227b2d815bb91f8587c8b258d07f169
2024-09-10 16:22:48 +02:00
Pau Espin Pedrol
74d3c00061 rsl_rx_pchan_rqd(): Clean up code path
* Use early return to simplify code indentation
* use LOG_BTS macro

Change-Id: I052600d8c7b1e948947a9cd989c8ae80f3c23259
2024-09-10 16:19:33 +02:00
Pau Espin Pedrol
e931a31f7e Initial support for >256 BTS
Some users actually want to deploy osmo-bsc connected to more than 256
BTSs. Allow them to do so.

This is about increasing the integer size / maximum value of the
internal "bts->nr" ID usef eg. during VTY configuration.
The ipaccess OML bts_nr is still kept as uint8_t so nothing changes over
the wire. That's because in ipaccess OML, in general each BTS is
bts_nr=0 (bts->bts_nr) under its own ipa connection.

NOTE: This patch doesn't add support to handle >256 BTS over PCUIF,
which still keeps its (struct gsm_pcu_if)->bts_nr as uint8_t.
This is not much of a problem yet though, since the requirement to run
>256BTS is needed in a network where osmo-bts is used, and hence PCUIF
is handled at each BTS.

Related: SYS#7062
Change-Id: I607a68efeb5f4a50cce107d11d3c5126b7d8f81a
2024-09-10 14:03:50 +02:00
Pau Espin Pedrol
ee84179db5 tests/vty: Validate allocating all possible BTS
Change-Id: I91603872de1287e8f69edd05a1f485e03909b3b4
2024-09-10 14:03:50 +02:00
Pau Espin Pedrol
6fe0e28a23 Introduce typedef for bts->nr gsm_bts_nr_t
The size of bts->nr is implicitly or explicitly used or taken into
account in several places in the code.
Add a new type to make it easier to define its size and range in one
place.

This also helps in identifying fields contains an BSC-implementation
"bts_nr" vs theip.access Abis OML "bts_nr" sent over the wire, which is
always a uint8_t according to spec.

Related: SYS#7062
Change-Id: Ic0db2873fa9795024aba4399da495a0d8f7504b0
2024-09-10 14:03:50 +02:00
Pau Espin Pedrol
92dc38d1c2 Convert bts->depends_on from bitmask to llist
The amount of dependencies on each BTS is usually zero or a small
number, hence the computation cost is mostly similar regardless of using
a llist or a bitmask buffer.

Right now, even if the dependency chains are (almost) empty, the
previous code allocated (N * 256/8) bytes, where N is the amount of bts
configured.

Since we are now planning to increase the amount of bts (N) from uint8_t to
uint16_t, that means with this change we will then avoid:
* Increasing memory use to O(N * 65536/8).
* Having to adapt code operating on bitmask (size)

Related: SYS#7062
Change-Id: I59e37d6baa020aeafdffc2c3538e988effd37620
2024-09-10 14:03:41 +02:00
Pau Espin Pedrol
6bfb28ba15 bs11: Move model struct further down in the file
This is where one would usually expect it, so that private model
functions can be declared static easily, and next to the function
registering it with the core.

Change-Id: I4006d4a0df4c7e477a6c731fc55badc782448866
2024-09-09 16:47:42 +02:00
Pau Espin Pedrol
45d3cd79a4 bs11: Mark global private variables as static
Change-Id: I3e1378c0132d8b73c7a3b98c1cbf215235688494
2024-09-09 16:44:36 +02:00
Oliver Smith
d6b0969536 Bump version: 1.12.0.3-ee142 → 1.12.1
Change-Id: Id4223b6f67ef12ea54eb5af9cfff42b58eab3df9
1.12.1
2024-08-01 11:01:09 +02:00
Daniel Willmann
ee14219d4b osmo_bsc_sigtran: Don't try to decode ipaccess_head a second time
osmo_io segmentation will already parse the ipaccess_header and set
msg->data to the payload of the control command.

Depends: Id91cddf9948ca49abf092850fae3a8f17e445b45 (libosmo-netif.git)
Related: OS#6422
Change-Id: I300bbab3c0215d52bc5f6232ace5c37a6613feb7
2024-07-30 09:53:33 +02:00
Vadim Yanitskiy
8206681f74 osmo_msc_data_alloc(), doc/examples: allow all AMR modes by default
There is no reason to allow the 5.90k mode alone.  Allow them all
and let codec negotiation figure out the AMR rates to use.

Change-Id: I33e297a28bcaf8fd9ccddb20ce9ce092ab57d2e0
2024-07-29 06:52:16 +00:00
Vadim Yanitskiy
a4f2485cd5 osmo_msc_data_alloc(), doc/examples: deny emergency calls by default
It's safer to deny emergency calls by default, and thus require
osmo-bsc users to allow them manually iff such calls can actually
be routed to their local emergency services.

This reduces the risk of a situation, when a person having a real-life
emergency would be trying, for instance, to call an ambulance via a
test network, which does allow emergency calls but cannot route them.

Change-Id: I5296b3031c14a896caa33b16bf04db762b9f30bf
2024-07-29 06:52:16 +00:00
Oliver Smith
8f6f82038d Bump version: 1.11.0.92-278b-dirty → 1.12.0
Change-Id: I849e44757568c8c15e9994bf50211f3fb1381a41
1.12.0
2024-07-24 17:00:07 +02:00
Mychaela N. Falconia
278bd75809 add support for RTP extensions via TW-TS-003
Themyscira Wireless Technical Specification TW-TS-003 defines
a mechanism whereby the CN can ask the BSS (via an extension to
BSSMAP Assignment procedure) to use enhanced RTP payload formats
that are contrary to the stipulations of 3GPP TS 48.103.
However, these RTP extensions need to originate at the BTS,
hence if the BSC receives a request from the CN to use them,
it needs to validate that request against BTS capabilities,
and then actually pass it to the BTS via an Osmocom-defined
RSL IE that replicates TW-TS-003 in Abis.  Implement this logic.

Intra-BSC handovers: if ThemWi RTP extensions are used in a GSM
network that allows handovers, all deployed BTSes must have
the same capabilities with regard to these extensions, practically
meaning same or close-enough version of OsmoBTS.  OsmoBSC checks
CN-requested RTP extensions against BTS capabilities on the
initial assignment, but not on subsequent handovers.

Inter-BSC handovers: support for RTP extensions in this deployment
configuration (networks that allow such handovers) remains to be
implemented.

OsmoMGW considerations: if all deployed BTSes are native IP
OsmoBTS, as opposed to E1-based, OsmoMGW does not need to know
anything at all about ThemWi RTP extensions.  However, future
support for these RTP extensions with E1-based BTSes will require
adding a mechanism for communicating the necessary non-standard
request to OsmoMGW.

LCLS considerations: enabling ThemWi RTP extensions affects only
the uplink RTP output path in OsmoBTS and not the path from RTP
input to downlink Tx.  The latter path accepts both basic and
extended RTP formats; any ThemWi extensions in the incoming RTP
stream are harmlessly ignored.  Therefore, activation of ThemWi
RTP extensions will have no impact on LCLS operation.

Related: OS#6448
Depends: I0eccfe5ddcf44f8f20440acb01e2d4870ec0cd91 (libosmocore)
Change-Id: I2a742afff160a9a8286633bf5ae0dd4a828c7a42
2024-06-26 15:40:33 +00:00
Neels Hofmeyr
d8203d83bb silence error message for N-STATE prim
We ignore the N-STATE prim, so don't error about it.

While at it, improve the "unhandled" error message (according to code
review).

Related: SYS#6952
Change-Id: Ic353840a7b2e32c54c2732f58836776a5eddb220
2024-06-11 04:52:48 +02:00
Vadim Yanitskiy
4cb26418a2 README.md: cosmetic: fix a typo
Change-Id: Ie082518757cd4840f3d6a67861aa3fe821dad115
2024-06-05 18:34:07 +07:00
Neels Hofmeyr
b61dc8adc4 err log: output sigtran prim name instead of number
Change-Id: I14eb92a6c6d391873f0d6fc7d61205a13e635e6e
2024-06-03 16:23:36 +02:00
Alexander Couzens
e8cc2d3d6f ipaccess-config: rename build_physconf to build_physconf_arfcn_by_rxlev
It doesn't build up a generic physconf. It only build up an arfcn white list
based on a list of rxlev

Change-Id: I6e2d27c10dc9075f06070bb784369bbd1d75f88e
2024-05-31 19:09:58 +02:00
Alexander Couzens
6fdbdf80ba ipaccess-config: fix crash when doing test procedures
abis_nm_perform_test expect to have a l3 pointer set in the msg

Change-Id: I69812847d802e1893a138860fb18055ffd666698
2024-05-31 19:09:13 +02:00
Oliver Smith
3b5e7b554e debian/postinst: add checks, be verbose
Do not attempt to change permissions/ownership if the package gets
upgraded from a version higher than the next release.

Do not fail if the user deleted the config file.

Be verbose when changing permissions.

Related: OS#4107
Change-Id: I853097a13e27b2ebd0b940117c8f5f4b3ea49b9a
2024-05-14 15:20:34 +02:00
Oliver Smith
99ad68f299 contrib: remove rpm spec file
Related: https://osmocom.org/news/255
Related: OS#6446
Change-Id: Ic79cde09bf7d5e96e439b1883d3a3fe5568bdbf1
2024-05-08 14:40:56 +02:00
Oliver Smith
6c66f59314 .deb/.rpm: various fixes related to non-root
* Explicitly chown /var/lib/osmocom to osmocom:osmocom, instead of
  relying on systemd to do it when the service starts up. This does not
  work with the systemd versions in debian 10 and almalinux 8.
* deb: Use "useradd" instead of the interactive "adduser" perl script
  from Debian. This makes it consistent with how we do it in rpm, and
  avoids the dependency on "adduser".
* deb: Consistently use tabs through the file, instead of mixing tabs
  and spaces.
* deb: Remove support for the "dpkg-statoverride --list" logic. This
  seems to be a rather obscure feature to override permissions for
  certain files or directories, for which it does not seem to be a good
  idea to make the postinst script less maintainable. Something similar
  can be achieved by using your own Osmocom config file in a different
  path with different permissions.

Related: OS#4107
Change-Id: Ie34e7aa65e576cf1742a33530a6f44d2344c39d0
2024-04-26 15:08:44 +02:00
Max
1bca191188 .deb/.rpm: add osmocom user during package install
Create osmocom user & group during package installation.
Fix the configuration dir/files permission to match.

Related: OS#4107
Tweaked-By: Oliver Smith <osmith@sysmocom.de>
Change-Id: Ic64bcd8a8124fcc8c6d7ffe31d32f51b288afdcb
2024-04-24 11:51:26 +02:00
Pau Espin Pedrol
9fb31c13df cbsp_link.c: Update somo_stream read_cb2 functions to accommodate for new API param
libosmo-netif (not yet released) stream_{cli,srv} osmo_io read_cb API was
updated to provide read result status. Hence, now API users
can account for lower layer errors and act properly, like it used to
do with the previous ofd backend.

This commit partially reverts some error code paths removed in
85687bf176 when converting code to use
osmo_io osmo_stream backend.

Change-Id: I4cce5cb6ca98bc28a67dd6e927e9cdfd2312851a
Depends: libosmo-netif.git Change-Id I395c75ff1e9904757ce1d767a9ac2f779593c4c8
2024-04-17 16:13:39 +02:00
Pau Espin Pedrol
d7afb4341e lb: Log name of unhandled sigtran primitive
Change-Id: I2d71fd347af404c025fc6b13e96f1964e685db05
2024-04-16 21:32:05 +02:00
Harald Welte
829986e06a README.md Add Forum + Issue Tracker sections
Change-Id: I0e9fc221fdf78ad94de7713b62473680ee7d58c2
2024-03-23 16:47:20 +01:00
Harald Welte
8c8e920eb7 README.md: Overhaul (more links, fix markdown formatting)
Change-Id: Id1e320439c052797cb9c6cda51b65cd2b9e9a3c4
2024-03-23 16:47:20 +01:00
Harald Welte
bd3583ffbd Add funding link to github mirror
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: I754edea2ed122b6056e0fc94056ec6d509299067
2024-03-23 16:47:20 +01:00
Harald Welte
85687bf176 CBSP: Port over to use osmo_io via libosmo-netif
Change-Id: Icce412e6ee69366c7b131c9bc1d51e8d44204917
Depends: libosmocore.git Change-Id I5e922c54b3431d759b38e81e55076125c5a34008
Related: OS#5755
2024-03-04 19:16:14 +00:00
Matan Perelman
cc1ac21671 ctrl: Add lchan show to all ctrl levels
This new commands show information about logical channels:
    net.btsN.trxM.tsI.show-lchan.full
    net.btsN.trxM.show-lchan.full
    net.btsN.show-lchan.full
    net.show-lchan.full

Change-Id: I23c1a7e6f6679e3964e359fb202ffe6781a07e8a
2024-02-24 16:44:30 +02:00
Matan Perelman
a5249dd96c ctrl: Add lchan show
This new command shows information about a logical channel using
net.btsN.trxM.tsI.lchanL.show.full

Change-Id: I5432800eae452b6df71a151a7649f228704ed0da
2024-02-20 12:41:07 +02:00
Harald Welte
ea42371454 bsc_ctrl_lookup.c: Use AGPLv3, not GPLv2
I guess it must have been a mistake when introducing this file.
The entire project is under AGPLv3, it doesn't make sense to have
one single file under GPLv2.

As th entire git commit history only contains sysmocom employees,
I have the authority to re-license it even if GPLv2 was done
intentionally at the time. Let's change it.

Change-Id: I5e5385f7630b41f1c4ad9534dbb4551e597ad596
2024-02-19 20:47:27 +00:00
Harald Welte
3f1b81bcf4 Fix license header in various source code files.
IF we say "... under the terms of the GNU Affero General Public License"
then we cannot say "see the GNU General Public license" later on, that's
misleading and likely a copy+paste error somewhere.

The project license has always been AGPLv3-or-later.

Change-Id: I6b8ad5147ca76052213809e67856dcb80bff2b93
2024-02-19 20:47:27 +00:00
Matan Perelman
d399e0c927 ctrl: Add ms power
This new command allows to control MS power level for a specific
logical channel using net.btsN.trxM.tsI.lchanL.ms-power

This patch also adds a lchan node to the ctrl interface.

Depends: libosmocore.git Ibf2786f668ee7e4f5b6a9ef43f2141cd2d79b4e2
Change-Id: I6f556b66011be6126d6bac31a14101ba37f81cc4
2024-02-17 11:07:46 +02:00
Matan Perelman
6b6714ba13 ctrl: Split bts_trx_ts_ctrl from bts_trx_ctrl
Besides from making the ts ctrl interface follow the convention
of being in its own file, it will be used in the next patch to add
a ctrl interface for lchan.

Change-Id: I9840bddd4eae409bc8373912d54b6bbfc9fc1c1a
2024-02-08 20:30:51 +00:00
Matan Perelman
88c051447a ctrl: Remove unused vty includes
Change-Id: Ib464d0be9df839740a648ff6747130c18d33455d
2024-02-07 15:28:45 +00:00
Vadim Yanitskiy
a14b4a7379 abis_nm: fix -Wunused-but-set-variable (bug)
clang warns us about 'len' being set, but not used:  And this is

  abis_nm.c:2172:10: warning: variable 'len' set but not used [-Wunused-but-set-variable]
        uint8_t len = attr_len;
                ^

This is actually a bug, because in the case of NACK we append 2 more
bytes {NM_ATT_NACK_CAUSES, NM_NACK_OBJCLASS_NOTSUPP}, and we need to
pass the final length to fill_om_fom_hdr(), including those optional
two bytes.  Passing 'attr_len' (length of 'attr') is wrong.

Change-Id: I3ca8e761fdf99dd498a979ccc9d53c6c3e03e2cc
2024-02-05 14:45:09 +01:00
Pau Espin Pedrol
0368a9e815 abis_nm_sw_act_req_ack: attr_len should be unsigned
Change-Id: I5c0ba76b5cc2464c7e362a850325c94770f38397
2024-02-05 14:45:04 +01:00