Commit Graph

69 Commits

Author SHA1 Message Date
Pau Espin 7048fc66bf tests: Introduce paging_test
Add unit test env to easily test several paging scenarios.

Change-Id: Iab61bf6a6eece5f439a19f7a5a0dc068a808ae8a
2022-05-03 11:03:00 +02:00
Pau Espin f3044b585e tests: Order tests alphabetically
Change-Id: Ic7507c90854a1c953f4c016b1b0e569bca570b37
2022-05-03 08:10:58 +00:00
Pau Espin 9cf719889d Bump version: → 1.8.0
Change-Id: Ibd4f22f268aa5ec3c1b7839e334ffad69f2e50a9
2021-11-16 17:21:59 +01:00
Neels Hofmeyr d13ef633d2 move time_cc to libosmocore osmo_time_cc
Related: SYS#4878
Depends: Iabb17a08e6e1a86f168cdb008fba05ecd4776bdd (libosmocore)
Change-Id: Ica9f908a1a30f334a24c59471affa11225117e12
2021-11-16 12:06:53 +01:00
Neels Hofmeyr e0458c2e00 add time_cc API: cumlative counter for time, reported as rate_ctr
This is a candidate for adding to libosmocore (as osmo_time_cc), but
let's first use this in osmo-bsc to make sure that it works as intended.

I started out expecting to be done with this in half an hour, but I
found out that accumulating elapsed time to an integer counter has a
staggering amount of complexity to it, and a million pitfalls.

The intended use is to report allAvailableSDCCHAllocated and
allAvailableTCHAllocated performance indicators in OsmoBSC. Hopefully
this will also be generally useful elsewhere, to be worth the effort.

Related: SYS#4878
Change-Id: Icdd36f27cb54b2e1b940c9e6404ba9dd3692a310
2021-11-10 13:27:43 +00:00
Oliver Smith 2e9237734e Revert "Turn some compiler warnings into errors"
Do not turn some compiler warnings into errors by default. This patch
was added before --enable-werror was available.

We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

This reverts commit 34f012639d.

Related: OS#5289
Change-Id: I6b143b803349b97e783c586615d7f2ed4e1ff058
2021-11-04 10:38:05 +01:00
Harald Welte 0ed69da597 remove obsolete dependency on libosmo-sccp
We only use libosmo-sigtran these days, so we can remove the depdency
to the old libosmo-sccp from osmo-bsc.  We don't use LIBOSMO_SCCP_*
variables in any, nor do we #include <osmocom/sccp/...>
anywhere [anymore].

Change-Id: Ie478016ffb6e767ba10968c1ee2ab98db15a45a3
Related: OS#2601
2021-02-23 20:18:50 +01:00
Pau Espin 6505f692d4 Bump version: → 1.7.0
Change-Id: I0afcb06f8a7466f98cac26ff939a3813d4add1cc
2021-02-23 18:43:04 +01:00
Oliver Smith e66e7c32f7 set -std=gnu11
Change-Id: I61ee711de5303691c2f8881b66d4614d11850be2
2021-01-28 09:28:52 +00:00
Daniel Willmann 47899f1695 Require python3 for ext_tests
The python scripts already use #!/usr/bin/env python3 so it was pure
coincidence that the tests are working.

Change-Id: Id5745d5ff5ff1072ccfbf9ad50b2d67f3ea95583
2020-11-09 10:58:21 +00:00
Pau Espin da5b2f8094 Support setting rt-prio and cpu-affinity mask through VTY
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
Change-Id: Ie68883666657fc8faa76e2422335c0ceb98c5a88
2020-08-20 08:40:17 +00:00
Pau Espin deaa6fd624 Introduce support for ACC subset rotation
See updated documentation section in manuals/chapters/bts.adoc regarding
an explanation on how the system works.

Related: SYS#4911
Change-Id: I952c9eeae02809c7184078c655574ec817902e06
2020-07-29 20:09:47 +00:00
Pau Espin 911d076f0f Fix trailing whitespace
Change-Id: Id57b953cbeea4ac5c384c0b77cff079c13248a0e
2020-07-20 12:21:29 +02:00
Neels Hofmeyr 5cda1d01b4 drop IMSI filter and libfilter completely
Filtering by IMSI in osmo-bsc is a legacy use case with questionable
usefulness. Remove.

Do not keep deprecated VTY commands: those could be dangerous, since
(presumably non-existing) users might assume that the filtering would still be
in place. Rather fail to start osmo-bsc for config with an IMSI ACL.

The IMSI filtering did, if present, provide the logging with an IMSI to print
for the bsc_subscriber. TMSIs should have ended up in logging likewise, which
has never been implemented. The proper way to learn the IMSI would be by the
Common Id message from the MSC. Furthermore, the upcoming MSC pooling feature
will extract the mobile identity again, and will hence make sure that both IMSI
and TMSI identities, as available, end up in the bsc_subscriber and will be
logged again.

So long, IMSI ACL, and thanks for all the fish.

Change-Id: I89727af5387e8360362e995fdee959883c37d89a
2020-05-27 01:56:06 +02:00
Oliver Smith 700a5a384c contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build with
CentOS 8 etc.

Related: OS#4550
Change-Id: I4b87cb0d80bda7bbfda600310aee24a814f97f3f
2020-05-20 08:53:13 +00:00
Eric Wild 93920fa41b fix libtool issue with clang and sanitizer
As pointed out at
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC`)

Change-Id: If71654d87b375b4b882ab527e89353cd035f695b
2020-04-11 01:17:17 +02:00
Pau Espin a1362ce8c2 Bump version: → 1.6.0
Change-Id: I21556570e35d662bb902d5c1afc911b82d5eb1e6
2020-01-03 18:24:51 +01:00
Pau Espin 3c9485751c Bump version: → 1.5.0
Change-Id: I4b73d0a83b1ed1a4dfd17066182820da5e401c9b
2019-08-07 20:42:06 +02:00
Eric Wild 50dc3517e6 turn -Werror=null-dereference into a warning
There is unfortunately no way to suppres this witha pragma,
and gcc 9 uncovers quite a few new instaces with enabled LTO that can't/won't be fixed

Related: OS#4123
Change-Id: I571a85b6ea53af7661248afd84e61cf34b7b5641
2019-07-23 09:36:54 +00:00
Pau Espin ed1dcbb551 Add flag to enable/disable build of ipaccess related utils
Change-Id: Iff70dc46c77b2ac58351ad9a91caf3f524c6fd89
2019-03-14 17:07:45 +01:00
Oliver Smith 686deafa48 build manuals included from osmo-gsm-manuals.git
Moved to doc/manuals/, with full commit history, in preceding merge commit.
Now incorporate in local the build system.

Build with:

$ autoreconf -fi
$ ./configure --enable-manuals
$ make

Shared files from osmo-gsm-manuals.git are found automatically if
- the repository is checked out in ../osmo-gsm-manuals; or
- if it osmo-gsm-manuals was installed with "make install"; or

Related: OS#3385
Change-Id: I92c0f771d4ffc2b0401d26e25cb0b3817e6f95ea
2018-11-27 17:33:29 +01:00
Pau Espin d58ddb2c4e Install systemd services with autotools
Change-Id: I015ac3fbe5adc551b76bac5c15ad93d30d0d2b6e
2018-09-13 13:58:26 +00:00
Pau Espin 08d02dd510 Bump version: → 1.3.0
Change-Id: Ic8f12e8a6e3a98f7c69920b27d08a5e7e3eebc31
2018-07-27 19:25:05 +02:00
Philipp Maier 844876f8d5 codec_pref: move match_codec_pref() to separate c-file and add unit-test
At the moment there are three sources that may advertise a list of
supported audio codec/rate settings. There is the MS that advertises
advertises a speech codec list and the MSC that sends a channel type
information element over A and there are also settings in the bsc
configuration file that may restrict the codec/rate types that are
allowed to use.

The function match_codec_pref() looks at all of the three buckets and
selects a codec that satisfies all three. This is already a somewhat
complicated process, overit is very isolated, so lets give it its own

Due to the lack of unit-tests it is very hard to make changes here so
lets add also unit-test to make sure that regressions are catched early.

- Put match_codec_pref() and all its helper functions into a separate
- Add a unit test.

Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29
Related: OS#3361
2018-07-22 06:16:11 +00:00
Neels Hofmeyr 958f259f95 dissolve libbsc: move all to src/osmo-bsc, link .o files
Move all of libbsc/ into osmo-bsc/, and separate/move some implementations to
allow linking from utils/* and ipaccess/* without pulling in unccessary

Some utilities use gsm_network and gsm_bts structs, which already include data
structures for fairly advanced uses. Move initialization that only osmo-bsc
needs into new bsc_network_init() and bsc_bts_alloc_register() functions, so
that the leaner tools can use the old gsm_* versions without the need to link
everything (e.g. handover and lchan alloc code).

In some instances, there need to be stubs if to cut off linking "just before
the RSL level" and prevent dependencies from creeping in.
- abis_rsl_rcvmsg(): the only program currently interpreting RSL messages is
  osmo-bsc, the utils are merely concerned with OML, if at all.
- paging_flush_bts(): ip.access nanobts models call this when the RSL link is
  dropped. Only osmo-bsc actually needs to do anything there.
- on_gsm_ts_init(): the mechanism to trigger timeslot initialization is related
  to OML, while this action to take on init would pull in RSL dependencies.
utils/ and ipaccess/ each have a stubs.c file to implement these stubs. Tests
implement stubs inline where required.

From src/utils/, src/ipaccess/ and tests/*/, link in .o files from osmo-bsc/.
In order for this to work, the osmo-bsc subdir must be built before the other
source trees. (An alternative would be to include the .c files as sources, but
that would re-compile them in every source tree. Not a large burden really, but
unless linking .o files gives problems, let's have the quicker build.)

Minor obvious cleanups creep in with this patch, I will not bother to name them
individually now unless code review asks me to.


1) libbsc has been separate to use it for osmo-nitb and osmo-bsc in the old
openbsc.git. This is no longer required, and spreading over libbsc and osmo-bsc
is distracting.

2) Recently, ridiculous linking requirements have made adding new functions
cumbersome, because libbsc has started depending on osmo-bsc/*.c
implementations: on gscon FSM and bssap functions. For example, neither
bs11_config nor ipaccess-config nor bts_test need handover_cfg or BSSMAP
message composition. It makes no sense to link the entire osmo-bsc to it, nor
do we want to keep adding stubs to each linking realm.

Change-Id: I36a586726f5818121abe54d25654819fc451d3bf
2018-06-07 19:09:06 +02:00
Neels Hofmeyr 2583b62205 tests: remove channel_test
Rationale: channel_test is trivial and useless, probably only exists as a
legacy from openbsc.git.

- it tests two printf()s of "(bts=45,trx=0,ts=3,ss=4)", hardly useful.
- it tests ts_subslots() behavior for dyn ts, which will soon be replaced by a
  most trivial mapping that does no longer need complex dyn ts state
  evaluation (when introducing the new timeslot FSM to handle dyn TS switchover).

Change-Id: Ib2232da8e7fa964b92492d7b778320401dc97703
2018-06-07 17:05:41 +00:00
Neels Hofmeyr 5cb01655c5 tests: remove bssap_test

- All it does is compose four Paging Requests and feed it into the osmo-bsc
  bssap_udt, and expects the cell identifier to be decoded properly.
- To do so it employs a comparatively huge linking effort. This linking effort
  is becoming annoying in my ongoing work and is just not worth it.
- We have comprehensive cell identifier tests in ttcn3, verifying that the
  proper cells are paged, and that actually for *all* cell identifier types.

Change-Id: I07cf23b66de36cfa1142a11b9f85e9c0190ee314
2018-06-07 17:05:41 +00:00
Harald Welte 1c9b8b1917 remove remaining bits of osmo-bsc_nat
osmo-bsc_nat is too heavily tied into legacy SCCPlite code, as it
is not using libosmo-sigtran/osmo_ss7 so far.  It's also full of
customer-specific code and it's shared use of some libbsc code here
has been complicating osmo-bsc development.

The current plan is to continue to use osmo-bsc_nat from openbsc.git
for those legacy users that need it, and not use osmo-bsc_nat in
new 3GPP AoIP setups.  Should we ever get a strong demand for an AoIP
based bsc_nat, we can still revisit this later.

Change-Id: Ia05dc76336a64a7f08962843b9a7cc19f2c83387
2018-05-27 17:48:49 +02:00
Pau Espin 1b11bc808f Bump version: → 1.2.0
Change-Id: Ie6ad5c769dd11c79b2bfd0d19f0feda8416e09cd
2018-05-03 18:40:12 +02:00
Philipp Maier 65df74dc5a cosmetic: Add note about libosmo-legacy-mgcp to
Change-Id: Ia496bd9ec02c0028aa541a798b1358a68ad18e21
Closes: OS#3226
2018-05-02 15:16:03 +02:00
Neels Hofmeyr 1bb555439d configure: add --enable-werror
Provide a sane means of adding the -Werror compiler flag.

Currently, some of our add -Werror by passing 'CFLAGS="-Werror"',
but that actually *overwrites* all the other CFLAGS we might want to have set.

Maintain these exceptions from -Werror:
a) deprecation (allow upstream to mark deprecation without breaking builds);
b) "#warning" pragmas (allow to remind ourselves of errors without breaking

As a last configure step before generating the output files, print the complete

Change-Id: I8cf0f135131c348d0b43f25b1d444af5827f148d
2018-03-13 00:01:17 +00:00
Neels Hofmeyr 909e972787 HO: Implement load based handover, as handover_decision_2.c
Change-Id: Ie597eae82722baf32546331e443dd9d94f1f25e6
2018-02-19 17:11:47 +01:00
Neels Hofmeyr d23ce86c25 drop libcommon-cs completely
Change-Id: I07d4a48af3154ee4d904686f230a51b8b8a94ff9
2018-02-14 12:55:45 +01:00
Neels Hofmeyr 421059a2c0 drop libcommon completely, move remaining files to libbsc
Move gsm_data.c and handover_cfg.c to libbsc, where they belong.

This leaves libcommon utterly empty, drop it.

Change-Id: I6178061fa30c7e1a4c22c29d3c8f508b1033569f
2018-02-14 12:54:38 +01:00
Max f93b31a5a7 Remove obsolete ./configure option
The '--enable-vty-tests' is just alias to '--enable-external-tests'

Change-Id: I9492d8e988b464aa41f572611cbf2461bb8be3eb
2018-01-02 12:53:11 +01:00
Max 0bd729f3ad Add optional profiling support
This facilitates the use of programs like uftrace. It's disabled by
default due to associated overhead.

Change-Id: Ia5a48a38962fc99446887a34008c40efd8344d9b
2017-12-28 14:33:53 +01:00
Max ad1e3cdd6c Migrate from OpenSSL to osmo_get_rand_id()
This avoids potential licensing incompatibility and makes integration of
Debian packaging patches easier.

The libosmocore version requirements are fine already but for jenkins
tests to pass we have to have Ic77866ce65acf524b768882c751a4f9c0635740b
merged into libosmocore master.

Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2
Related: OS#1694
2017-12-27 11:10:59 +00:00
Harald Welte d9956d91ba Remove dead code left over from NITB split
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-19 17:53:13 +00:00
Max f8dc526207 Remove unneeded .py scripts
The has been moved to osmo-python-tests as osmo_ipa - use it for
vty and ctrl tests instead of local copy. The and
are not BSC-specific: leftovers from repository split which are now
available in osmo-python-tests as well.

Change-Id: Ia4285b18b152b070c148228604d1e61a8adedba1
2017-12-19 18:08:46 +01:00
Pau Espin 7e78681f0f tests: Fix selection of python version
According to documentation (and personal experience), AM_PATH_PYTHON
selects the highest version of python, no matter if major version is
different, which means if both python2 and 3 are available, 3 will be
chosen an PYTHON will point to "/.../python" which is python3. Apparently,
the macro cannot be easily used to pick highest python2 version.

As {vty,ctrl} require python2 and are incompatible with
python3, let's instead rely on the system having a "python2" binary
available, which is the case in most distros.

Change-Id: Id22e157d1bee453babdfa7ed04c506390b0f17bb
2017-11-24 12:55:15 +01:00
Neels Hofmeyr 17b773acd1 add --enable-sanitize config option
Change-Id: Ie6888cc29b9815d3dc7aa6673599a0d6cb010e6b
2017-11-18 10:17:25 +00:00
Harald Welte f04e9c2f36 Require libosmo-mgcp-client-dev >= 1.2.0
We recently started to use some symbols that were not available in
libosmo-mgcp-client-dev 1.0.0 or even 1.1.0.  Let's depend on a newly
tagged version of libosmo-mgcp-client.

Change-Id: Ic5d3add1c69181aabbdb684a01a6ba7bcea1fe2c
2017-11-11 23:24:16 +00:00
Philipp Maier 39c609b7c9 mgcp: use osmo-mgw to switch RTP streams
osmo-bsc currently negotiates the RTP stream directly with the
BTS and reports back the RTP IP/Port on the BTS. This works fine
for a single BTS, but for Handover the port/ip pointing to the
MSC side must not change, so an entity in between the BTSs and
the MSC is required.

Integrate the mgcp-client and use osmo-mgw to switch the RTP

Depends: osmo-mgw Ib5fcc72775bf72b489ff79ade36fb345d8d20736
Depends: osmo-mgw I44b338b09de45e1675cedf9737fa72dde72e979a
Depends: osmo-mgw I29c5e2fb972896faeb771ba040f015592487fcbe

Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a
2017-11-07 20:57:51 +00:00
Neels Hofmeyr 9eb208fcfb bssap: paging: page entire BSS for unimplemented cell id list
3GPP TS § 08.08 defines various types of Cell Identifier List IEs, but we only
implement "entire BSS" and "one LAC". If the MSC sends a Cell Identifier List
that we don't implement, it is best for interoperability to page the entire BSS
and post a log message instead of rejecting the paging altogether. Apart from
resource management, it is not harmful to page more than the MSC requested; if
use of resources becomes an issue, the log message will guide towards the
solution of providing an actually implemented Cell Identifier List IE.

Upon IE length that is other than we expect, log the error, but also fall back
to paging the entire BSS. Overall message length correctness has been checked

The particular case observed is that a Huwaei MSC sends a LAI for Cell
Identifier List (MCC+MNC in bcd, followed by a LAC), parsing of which we may
want to add later.

Improve logging: identify the subscriber that is being paged.

Coding style: use a switch() statement to clarify flow and provide a place to
add more implementations later.

Add regression test bssap_test.c: fabricates BSSAP Paging messages with the two
implemented Cell Identifier List IEs as well as the unimplemented LAI
identifier, verify the resulting paging LAC in wrapped function and stderr.

Change-Id: Ie934c5d229140a89763bf2efff86d6a3766cd351
2017-11-07 04:08:44 +01:00
Harald Welte b069f6548c Depend on latest versions of libosmo-*
We are using quite a number of symbols that are definitely *not*
yet present in the respective library versions that we stated as
dependency. Rather than figuring this out individually, simply
require the latest releases.

Change-Id: Iecda06d206c24390bb10f3a8f8a70ef3036381e2
2017-10-28 13:14:24 +02:00
Max e1ceb6f767 Remove pkg-config file
It wasn't used anyway because OsmoBTS relied on OpenBSC only. As of
ec33b0397f5d71248c5834513d4be7b9b0e46366 in OsmoBTS it does not need any
shared includes anymore.

Change-Id: Ia689c7f2163dd23e429ee9d17177345b5c9470c7
2017-10-10 12:30:04 +00:00
Neels Hofmeyr c01647914b move include/openbsc to include/osmocom/bsc
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
2017-09-06 16:26:13 +02:00
Neels Hofmeyr 1e87a69689 rename openbsc.pc to osmo-bsc.pc
Change-Id: I99ab9fea01c11841437b587dffd4e1fff17a291f
2017-09-06 16:25:08 +02:00
Harald Welte 630df7d608 Package is now called osmo-bsc, not openbsc
Change-Id: I85511946316a34877080ac55553c5b88e34bd1be
2017-09-03 22:58:22 +02:00
Harald Welte 664d256a74 Remove check for GMTOFF
this was from NITB days and now in osmo-msc.git

Change-Id: I337201ec2c2457100b229b5df2cbabbcb801236f
2017-09-03 22:58:22 +02:00