246 Commits

Author SHA1 Message Date
Vadim Yanitskiy
91ea92868a vty: register talloc / stats introspection commands
Change-Id: I05ecc74426f68e19a18b7111ebc39ef504735d15
2025-07-23 13:55:17 +00:00
Vadim Yanitskiy
1b402db278 vty: clarify deprecation messages
When starting osmo-cbc with an old config file, it's unclear which
commands exactly are triggering deprecation warnings.  Let's print
the actual command instead of confusing 'This function'.

Change-Id: I7d45292065950846e5e28eb2b21abcdb0707a9b3
2025-07-23 13:55:17 +00:00
Pau Espin Pedrol
c5afbd3336 sbcap: Listen on (127.0.0.1|::1) by default
Follow what's described in the User Manual:
"The default is to bind to the 3GPP standard port number 29168 for
SBc-AP at the loopback IP address 127.0.0.1 and ::1."

Change-Id: I6cb1c7031c09469e7b7c29a0733e99faea9f6615
2025-07-22 20:50:12 +02:00
Pau Espin Pedrol
da85d1f75a Set default SBcAP local host when no VTY cfg sbcap node provided
During 7fbd6aa472 a "configured" flag was
introduced which could be used to make sure the SBcAP node was
configured before "peer" node, which made sure the local IP address was
set before triggering connect() in client mode.
However, the patch didn't account for the possibility that a user may
use a config file with no "sbcap" node at all, which hence ends up with
no local address being configured and opening the listen server SBcAP
socket will fail.

Related: OS#6814
Change-Id: I48eb465fecbeebd7cd8eafb17908ba0439bb9e50
2025-07-22 20:47:21 +02:00
Oliver Smith
2c34f95a04 Generate a version.h file
Related: OS#6626
Change-Id: Ia4ccdc833b95cd60fc27e7d73b55c99c1a0a8d7d
2025-06-23 16:37:46 +02:00
Oliver Smith
1a454c9174 Fix typo osmo-bsc -> osmo-cbc
Change-Id: I3da908d250771ca13e8b3f9069fe4f781defb461
2025-05-20 14:37:23 +02:00
Pau Espin Pedrol
f25277e872 Drop unnecessary static initialization to NULL
Moreover, this callback was drepecated and is not ever called since
libosmocore.git 70ce871532ab21955e0955d7e230eae65438f047 (release 1.3.0).

See also libosmocore.git d31de237582f6fe3315d61bb9a488d4cda92654e.

Change-Id: I68ed65537eb6f33ef666a79ddef70b46c995e0e7
2025-03-04 18:10:54 +01:00
Oliver Smith
28d66aa8ec Bump version: 0.5.0.5-8018 → 0.5.1
Change-Id: Ic28678b9325bdb702ca5985a5f18b6b761e8a1c5
0.5.1
2025-02-12 14:30:50 +01:00
Pau Espin Pedrol
80184a4e41 jenkins.sh: Skip building unneeded libosmo-abis
Change-Id: Ia8d93b276ace5798778354f25c4e8980e3412413
2024-12-10 16:16:49 +01:00
Pau Espin Pedrol
cc02c15505 abis: Fix reusing link->conn while it is being destroyed
Call to osmo_stream_cli_destroy() may end up triggering disconnect_cb(),
and we don't want to attempt doing more stuff with that conn when that
happens (we were even trying to reconnect() it...).
Avoid it by marking the pointer as NULL immediatelly before calling
e1inp_sign_link_destroy().

Change-Id: I56605766af974d86610d0958f4b82e6e4ff94502
2024-11-28 16:40:48 +01:00
Pau Espin Pedrol
f4fa15cb0e cbsp_link: Log unexpected return error codes
This easies spotting the cause of close/destroy code paths.

Change-Id: Ibfd9a33798ba88e2332c00ed90709e38bb2222d7
2024-11-28 16:39:15 +01:00
Pau Espin Pedrol
16daffdc52 .gitignore: Add *~
This allows getting rid of further files like install-sh~.

Change-Id: Iad7ce44a2ecd90116376a458cc40f355d3883c53
2024-11-28 16:37:24 +01:00
Oliver Smith
3bb05bafce contrib/jenkins: libosmo-abis after libosmo-netif
Depends: libosmo-abis I079dc3999de508301dd37ed03e399356a58d3cab
Depends: libosmo-netif I13d6e88158f6d9ce017986283183ee9c2cc68cae
Change-Id: I50c399223d97434848153d983db04bb2e9ce8dda
2024-11-22 11:09:41 +01:00
Oliver Smith
637874eaf9 Bump version: 0.4.2.9-f6a2 → 0.5.0
Change-Id: I9225ec8b652e3b2dea97cb0ef8631afd0a745e5c
0.5.0
2024-07-25 09:46:02 +02:00
Vadim Yanitskiy
f6a2a6ba4f README.md: cosmetic: fix a typo
Change-Id: I37040ec0df073248289b839a9f9e34732d9ac8eb
2024-06-05 18:34:07 +07:00
Oliver Smith
bd50b41eeb 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: Ic41d3ae2478c49aed222bfa978344727c5dc92a4
2024-05-14 15:20:35 +02:00
Oliver Smith
f18c9d6f9c contrib: remove rpm spec file
Related: https://osmocom.org/news/255
Related: OS#6446
Change-Id: Ic79cde09bf7d5e96e439b1883d3a3fe5568bdbf1
2024-05-08 14:40:57 +02:00
Oliver Smith
9fad2713c3 .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: I6dd0205fb65d4ad5a79821c111865e67fb293a73
2024-04-26 15:08:44 +02:00
Max
b3743e9603 .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: Ifcc882125a22d8f2e1bfcd19622aed4e8a723e6c
2024-04-24 16:18:33 +02:00
Pau Espin Pedrol
538bc4c699 SBcAP: Update as1nc skeleton and generated code
Generated using current mouse07410/vlm_master
(12b8e555b971c745ea715cb247f39120fa15f7f0) [1]

[1] 12b8e555b9

Change-Id: I0153ecf307c99ce904ed4632422bd9d586ec3167
2024-03-25 16:07:13 +01:00
Vadim Yanitskiy
da8b98cf88 build: include debian/ into the release tarball
Change-Id: I54b092ac3c8b25a7511531253c1ec13098629b41
2024-01-26 23:32:23 +07:00
Andreas Eversberg
36a7759e39 Use uniform log format for default config files
Related: OS#6272
Change-Id: I9897bf964880f2e35a59812d319851eb6e06de68
2023-12-01 11:50:49 +01:00
Harald Welte
7ae4b6d61f cbc-apitool: Make character set configurable
osmo-cbc already supported the transmission of UCS2 characters for quite
some time.  However, the cbc-apitool didn't expose this capability so
far.

Change-Id: Ia7291238f3b0af8ff9f476fce9a7805e12821d8c
Related: OS#6028
2023-10-19 07:20:35 +00:00
Pau Espin Pedrol
311673c365 Bump version: 0.4.1.7-7fbd-dirty → 0.4.2
Change-Id: I49749d1d5809d18a7c0c81fb7316791fad81b5cc
0.4.2
2023-09-12 17:08:38 +02:00
Pau Espin Pedrol
7fbd6aa472 Catch and forbid configuring peers before configuring main protocol node
When the user enters each "peer" node, the related object is created if
not yet existing, and its updated config is applied (connect()) upon
exiting the node (cbc_peer_apply_cfg_chg()). When connect happens, it
needs to obtain the local IP address from the main protocol node
(cbsp|sbcap)", which means it must be configured beforehand, otherwise
the peers connect using the default values.

Hence, it makes no sense to configure peers if the main protocol
information has not yet been configured. The usual example configs as
well as the write-config VTY commands provide correct order of things.
Catch and forbid the user providing a config file where the peers are
configured before the main protocol nodes.

Related: OS#6154
Change-Id: I678f9e6715c85b1eb9116cc892f1a8299577c0c2
2023-08-29 17:26:56 +02:00
Oliver Smith
66221e60d6 systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: I9c0cc0779f9ddb7520a565668b7cde07c6ad55d8
2023-05-26 14:10:44 +02:00
Pau Espin Pedrol
0422a10253 README.md: Document generation of SBcAP code from ASN.1 files
Change-Id: Id6edb2dcbd39ca101110f1ca57fcd67bf08c0ef0
2023-05-16 12:33:57 +02:00
Pau Espin Pedrol
292b2e895b sbcap: Update asn1c skeleton files
Update skeleton files using newest asn1c with APER support [1],
commit 08b293e8aa342d465d26805d1d66f3595b2ce261.

This contains among others, fix to automatically disable stack overflow checks [2]
when using ASan, in order to avoid failing during unit test run.

[1] https://github.com/mouse07410/asn1c/tree/vlm_master
[2] https://github.com/mouse07410/asn1c/pull/128

Related: OS#6025
Change-Id: I385d14d4be308b991a48ce1033087f07bd1f47ea
2023-05-15 17:34:45 +02:00
Oliver Smith
a7aca0333b debian: set compat level to 10
Related: OS#5958
Change-Id: Id0f168a7d3c2ae6869121397e65ca1d0cfea30d3
2023-04-25 16:48:21 +02:00
Vadim Yanitskiy
d04fe38e73 tests: use -no-install libtool flag to avoid ./lt-* scripts
This option should be used for any executables which are used only
for testing, or for generating other files and are consequently never
installed.  By specifying this option, we are telling Libtool that
the executable it links will only ever be executed from where it is
built in the build tree.  Libtool is usually able to considerably
speed up the link process for such executables.

Change-Id: I405b5e85113e9529b4491c7eeeec71afe25ef488
2023-03-11 04:34:45 +07:00
Vadim Yanitskiy
eb82cbc249 {src,tests/sbcap}/Makefile.am: reorder libraries in LDADD
... so that locally built libraries are listed first.
Otherwise the linker may pick system-installed libs instead.

Change-Id: I3396a95d221e81f3785a5883630d261f033aa10e
2023-03-09 17:11:37 +07:00
Pau Espin Pedrol
43439c785f Bump version: 0.4.0.5-1d9d-dirty → 0.4.1
Change-Id: I78551978b0c5b3906cc46c119c6c9a6229d1e8e7
0.4.1
2023-02-07 17:39:55 +01:00
arehbein
1d9d13ce6b osmo-cbc: Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: I68f268cccc1ae00004aa63dbbf6708a581a1e705
2022-12-19 22:34:39 +01:00
Max
6e64d1079f Set working directory in systemd service file
By default systemd will execute service with root directory (or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it to 'osmocom' subdir of state directory (/var/lib for system instance) instead.

Related: OS#4821
Change-Id: I033029a6b1f2bfa259cec74b139a33b0897fcd98
2022-08-30 20:02:12 +07:00
Vadim Yanitskiy
d5ea7f765e contrib/jenkins.sh: fix 'publish' target
Executing 'maintainer-clean' before 'publish' makes the later fail:

  + make -C /build/doc/manuals publish
  make: Entering directory '/build/doc/manuals'
  make: Leaving directory '/build/doc/manuals'
  make: *** No rule to make target 'publish'.  Stop.

Execute 'maintainer-clean' after 'publish', like other projects do.

Change-Id: I16cc855ee05726938e1542f481488364c5e47a95
Fixes: I2fe0de9bcb372333da1e5c81712a511cda34858c
2022-08-30 00:08:17 +07:00
Vadim Yanitskiy
8d70759ab7 contrib/jenkins.sh: execute 'distcheck' with $PARALLEL_MAKE
Change-Id: I895c0dbfd56613a5f2f77a338e64e1cde3017d11
2022-08-28 17:36:37 +07:00
Vadim Yanitskiy
8f15c2c23d contrib/jenkins.sh: also execute maintainer-clean target
Change-Id: I2fe0de9bcb372333da1e5c81712a511cda34858c
2022-08-28 17:23:27 +07:00
Pau Espin Pedrol
d5c0b73f00 Bump version: 0.3.0.93-65d3 → 0.4.0
Change-Id: I8a7e8830dba3193419e4854588a98d1572747344
0.4.0
2022-08-08 11:42:57 +02:00
Vadim Yanitskiy
65d3c505b7 libosmo-sbcap: add -no-undefined to libosmo_sbcap_la_LDFLAGS
Make sure that there is no undefined references in shared libraries.

Change-Id: Id08bbd5ba35ef3f507f60f31a0634f921ec1db65
2022-08-05 11:47:44 +00:00
Pau Espin Pedrol
13152304f7 cbsp: Store content of received Cell Id from Failed List
Change-Id: I10d2627cb5ef327fd57c22480a4e7d9a464930f0
2022-08-04 14:17:48 +02:00
Pau Espin Pedrol
40a6158e41 cbsp: Log storing of CellId info received from peers
This is already done similarly in Sbc-AP.

Change-Id: I81ad8d40c5e2b9fbc011db795993fb7f00e99692
2022-08-04 14:07:45 +02:00
Pau Espin Pedrol
d78f13c89a sbcap: Add Concurrent-Warning-Message-Indicator IE to Write-Replace-Req
3GPP TS 23.041 9.3.32 states that the IE is always present for non-ETWS
messages and never present in ETWS messages.

Related: OS#4945
Change-Id: I4a5ac56b7e6eeb85aee07ae2ddf10fa2afbbf4ef
2022-08-02 17:58:10 +02:00
Pau Espin Pedrol
28d3a53dc5 cbsp/sbcap: Fail if trying to Tx on non-connected (connecting) link
This way upper layers know right away that the message could not be
transmitted to that peer.

Change-Id: I1d2285d18ee064fd78191765e8cb833bf5ee08a4
2022-08-02 11:48:59 +02:00
Pau Espin Pedrol
caba7fc493 cbsp/sbcap: Set link fsm id with peer's name
Otherwise the id is left unset.

Change-Id: I8a6850293cbe01c66e4fb545d646d63743ddaecb
2022-08-02 11:48:59 +02:00
Pau Espin Pedrol
cb4e11f984 cbsp: Fix heap-use-after-free closing cli conn in connecting state
if conn is not in STREAM_CLI_STATE_CONNECTED state, it won't call disconnect_cb during
osmo_stream_cli_destroy(), hence the osmo-cbc pointers holding are not
nullified correctly.

"""
20220801174147247 DCBSP NOTICE ttcn3-bsc-server: Disconnected. (cbsp_link.c:101)
20220801174147247 DCBSP NOTICE ttcn3-bsc-server: Reconnecting... (cbsp_link.c:102)
20220801174147247 DLINP INFO [WAIT_RECONNECT] osmo_stream_cli_reconnect(): retrying in 5 seconds... (stream.c:287)
20220801174152235 DCBSP DEBUG CBSP-Link[0x612000002c20]{RESET_PENDING}: Timeout of T3 (fsm.c:317)
20220801174152236 DCBSP DEBUG CBSP-Link[0x612000002c20]{RESET_PENDING}: timer_cb requested termination (fsm.c:327)
20220801174152236 DCBSP DEBUG CBSP-Link[0x612000002c20]{RESET_PENDING}: Terminating (cause = OSMO_FSM_TERM_TIMEOUT) (fsm.c:332)
=================================================================
==17==ERROR: AddressSanitizer: heap-use-after-free on address 0x6180000024f0 at pc 0x7fbd28a05d01 bp 0x7ffe247352b0 sp 0x7ffe247352a8
READ of size 4 at 0x6180000024f0 thread T0
    #0 0x7fbd28a05d00 in osmo_stream_cli_close /tmp/libosmo-netif/src/stream.c:307
    #1 0x7fbd28a0a5b3 in osmo_stream_cli_destroy /tmp/libosmo-netif/src/stream.c:714
    #2 0x55c3534a0322 in cbc_cbsp_link_close /tmp/osmo-cbc/src/cbsp_link.c:356
    #3 0x55c3534a16e1 in cbsp_link_fsm_cleanup /tmp/osmo-cbc/src/cbsp_link_fsm.c:199
    #4 0x7fbd28bf5085 in _osmo_fsm_inst_term /tmp/libosmocore/src/fsm.c:947
    #5 0x7fbd28be6881 in fsm_tmr_cb /tmp/libosmocore/src/fsm.c:332
    #6 0x7fbd28bc70ab in osmo_timers_update /tmp/libosmocore/src/timer.c:269
    #7 0x7fbd28bcba5b in _osmo_select_main /tmp/libosmocore/src/select.c:394
    #8 0x7fbd28bcbb31 in osmo_select_main /tmp/libosmocore/src/select.c:438
    #9 0x55c35348bce8 in main /tmp/osmo-cbc/src/cbc_main.c:314
    #10 0x7fbd27a4cd09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d09)
    #11 0x55c353488ce9 in _start (/usr/local/bin/osmo-cbc+0x68ce9)
"""

Change-Id: Ic13578e958345207892465644b5e1f28537c032d
2022-08-01 20:36:49 +02:00
Pau Espin Pedrol
a76d15048d *_smscb_peer_fsm: Immediately NACK if Tx of msg failed
This makes the smscb_message_fsm receive immediate notice that this peer
failed to deliver the message, avoiding need to wait for 10 seconds
timeout.

Change-Id: I1f3911accb327f3378d65902d53d86fb298fd528
2022-08-01 10:55:21 +02:00
Pau Espin Pedrol
20705a0877 cbsp/sbcap: Fix memleak in error condition (tx without link)
Change-Id: I95f6ab4e642529afc583b0747450b83af1e8f32e
2022-08-01 10:54:02 +02:00
Pau Espin Pedrol
041ae3246d sbcap: Fix NULL pointer dereference
Related: Coverity CID#275347
Change-Id: I9ae1cad4ce4e3fe6cfd67ac6058fb7345a3dd49e
2022-08-01 10:49:12 +02:00
Pau Espin Pedrol
e86af042fd Propagate error to caller when tx cbsp/sbcap Write-Replace-Req fails
Change-Id: Ie40c8e41c297398bbec48f7bb2c60cfdc703fa5d
2022-07-29 17:55:33 +02:00
Pau Espin Pedrol
0b8a08b698 cbc_main: Enable logging of fsm timeouts
Change-Id: I6ffbfbc8eddb3efff0b6401223b9b5563cf83b51
2022-07-29 17:55:33 +02:00