Commit Graph

227 Commits

Author SHA1 Message Date
Pau Espin 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 311673c365 Bump version: 0.4.1.7-7fbd-dirty → 0.4.2
Change-Id: I49749d1d5809d18a7c0c81fb7316791fad81b5cc
2023-09-12 17:08:38 +02:00
Pau Espin 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 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 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 43439c785f Bump version: 0.4.0.5-1d9d-dirty → 0.4.1
Change-Id: I78551978b0c5b3906cc46c119c6c9a6229d1e8e7
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 d5c0b73f00 Bump version: 0.3.0.93-65d3 → 0.4.0
Change-Id: I8a7e8830dba3193419e4854588a98d1572747344
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 13152304f7 cbsp: Store content of received Cell Id from Failed List
Change-Id: I10d2627cb5ef327fd57c22480a4e7d9a464930f0
2022-08-04 14:17:48 +02:00
Pau Espin 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 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 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 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 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 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 20705a0877 cbsp/sbcap: Fix memleak in error condition (tx without link)
Change-Id: I95f6ab4e642529afc583b0747450b83af1e8f32e
2022-08-01 10:54:02 +02:00
Pau Espin 041ae3246d sbcap: Fix NULL pointer dereference
Related: Coverity CID#275347
Change-Id: I9ae1cad4ce4e3fe6cfd67ac6058fb7345a3dd49e
2022-08-01 10:49:12 +02:00
Pau Espin 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 0b8a08b698 cbc_main: Enable logging of fsm timeouts
Change-Id: I6ffbfbc8eddb3efff0b6401223b9b5563cf83b51
2022-07-29 17:55:33 +02:00
Pau Espin d24c3dfba0 Split smscb_peer_fsm into CBSP and SBcAP specific FSMs
This further simplifies tracking of events and simplifies and clears
code on each of the FSMs.

Change-Id: I0fd00b60cdc6bc6a088be1336d849548ca89c847
2022-07-29 14:54:26 +02:00
Pau Espin c190939f0c Split event list for smscb_message_fsm and smscb_peer_fsm
It really doesn't make sense to share the event list betwen those for
several reasons.
First, because ech of those FSM relate to different things:
* smscb_message_fsm: Handling/scheduling of 1 smscb towards all peers
* smscb_peer_fsm: Handling/scheduling of 1 smscb towards 1 peer.

The former has higher level interface used by the REST
API, plus some mid level interface used by smscb_peer_fsm.
The later has a mid level interface used by smscb_message_fsm to
interact, and a lower level interface used by the SBcAP/CBSP links to
talk to.

Furthermore, this makes it a lot easier understanding which events are
sent from one to another FSM.

Change-Id: I909474d1ff4ec7ed20aff0981da47074397df6cb
2022-07-29 14:49:30 +02:00
Pau Espin cb99991127 Introduce logging category smscb
The smscb_message_fsm is totally independent of CBSP.

Change-Id: I6e686747ddde9540ff3f765ef461bfca812615ba
2022-07-29 14:49:30 +02:00
Pau Espin e6e878a2fc sbcap: Improve handling of WriteReplaceWarnResponse
If cause != accepted, submit a NACK to the upper layers.
In that case, in the upper layers we don't want to parse the PDU IE
"Unknown Tracking Area List" since it shouldn't be there. 3GPP TS
29.168 4.3.4.3.6 states:
"""
This IE shall only be included if the Cause IE indicates Message accepted, which means the MME will proceed with the
request for Tracking Areas that are known to the MME. The Cause IE indicating Tracking area not valid is used when
all Tracking Areas in the Request are invalid.
"""

Change-Id: I0a4d5bdbb6c4fd3870a4f4ebf226668b70fea06a
2022-07-29 14:49:30 +02:00
Pau Espin d8a537aca8 sbcap: Store reported failed TAIs from WriteReplaceResponse in cbc_message_peer
Change-Id: I37b08aa374c1097d2871bf69a7bb7893f32bccd3
2022-07-29 14:49:30 +02:00
Pau Espin 4a9d22e5a0 sbcap: Request and handle Write Replace Warning Indication
Change-Id: I563e7d1c999f14b8197bb41e85b7bcf6262fe2a0
2022-07-29 14:49:30 +02:00
Pau Espin 1429377005 Move ASN1C enc/dec logging to its own category
ASN1C encoding/decoding can get really verbose. Furthermore, it should
only be enabled under really specific conditions, so it makes sense to
have it under its own category.

Change-Id: Ia4cbae2395532d9b5b7b9177a7d0f31bf777d751
2022-07-29 14:49:30 +02:00
Pau Espin bc21b3ae81 Move cbc_cell_id2str() and make it public
It will be used later on to log whenever new cell ids are added to a
message_peer.

Change-Id: I74ccbbc810a2fa76fb2999a7588b3f67d4d21e03
2022-07-29 14:49:30 +02:00
Pau Espin ab8b8402a4 sbcap: Log info about messages received and trasmitted
Change-Id: Ifd1eca79bf4fac63de8066cd6a18004138d51d04
2022-07-29 14:49:26 +02:00
Pau Espin e416069cf6 sbcap: Fix typo in comment
Change-Id: I6d519cb80a90e2a7e80e4608c713996f94043f21
2022-07-27 13:42:17 +02:00
Pau Espin e67faef4ec Move sbcap_as_find_ie() to libsbcap
This function is generic and can be (will be) used in more places.

Change-Id: Ib0c7fa12a8f6faa4271e4132ca5a5c656e717400
2022-07-27 13:42:17 +02:00
Pau Espin 745a2d6600 sbcap: Tx Error ind if Rx ProcedureCode is unknown
Change-Id: I3ee760b98d87f179917acbc369f56d72d0db571d
2022-07-27 13:42:17 +02:00
Pau Espin b093e6708d sbcap: Improve logging on non-implemented PWS Restart/Failure Ind
Change-Id: I0085ac40a7676d9c3626a9da38d02d3b1b2cf6b4
2022-07-27 13:42:17 +02:00
Pau Espin 66625de21c sbcap: Improve logging of rx Error Indication
Change-Id: I63871a57f219a98f8191e6ee4787fc33edb21528
2022-07-27 13:42:06 +02:00
Pau Espin 6db8c13fea sbcap: Drop unused events
Those events doesn't exist in SBc-AP.

Change-Id: Ie4843ed5debbd4282df487ada9596b4d75f4b46c
2022-07-26 14:33:47 +02:00
Pau Espin 3f9d78e2a3 sbcap: Send Error Indication if decoding rx msg fails
Change-Id: I444290f3d697e7485e04eaa38acd8fc3623e0eab
2022-07-26 14:33:47 +02:00
Pau Espin 692243baf5 sbcap: Fix typo in sbcap_cause_vals
Change-Id: I519a86e5292c39bf1ad502c587838e7b62a0e64f
2022-07-26 14:33:47 +02:00
Pau Espin 9ce5d4bad7 Rename functions generating CBSP/SBc-AP Write-Replace request
Previous naming is misleading, as it seems to indicate the function is
used to generate any kind of message, which is wrong.

Change-Id: Ib0228c64bbf104accdbbebb6076004a6a1f44c6f
2022-07-26 14:33:43 +02:00
Pau Espin 7beca6fda0 Rearrange cbc_message and cbsp message code
Move code from message_handling containing both code for generic
cbc_message and specific cbsp_message into thers files. The former are
moved to cbc_message.c and the later to cbsp_msg.c, similar to what's
already done for SBc-AP messages.

Change-Id: Ie4082e40f23170cfd6c573fbbb7beb8c6226b6e6
2022-07-26 10:01:05 +02:00