Commit Graph

14 Commits

Author SHA1 Message Date
Pau Espin 0cdd0abd53 cbsp: Add enum and value string for Cause
Change-Id: I35592bb4fff2e7b442d0e0cd537b66687862baf2
2022-06-09 18:17:43 +02:00
Oliver Smith 04bfb7165b treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2021-12-14 12:44:03 +01:00
Harald Welte fcbf3470b9 CBSP: Fix encoding of warning period
The warning period encoding was wrong, resulting in way too short
warning periods being encoded than intended/specified by the caller.

Change-Id: Idf3cae48a6ab45550d7bbd937bb49a0e1a4e8aed
2021-02-22 10:06:12 +01:00
Harald Welte 48f22b0e87 CBSP: fix encoding/decoding of keep-alive repetition period
Even though the value is only between 0..120s, they didn't encode
it 1:1 in the uint8_t, but 3GPP chose to use the same encoding
as for the warning period (which has a much larger range).

Let's fix this in our implementation.

Before this patch, osmo-cbc wanted to send 30s keep-alive repetition
period, but a spec-compliant receiver actually decoded this as 80s.

Change-Id: I04baa6b6b99b092fa0512b3b6138a363c7f3a13d
2021-02-22 09:58:00 +01:00
Harald Welte 886e742935 cbsp: Fix parsing DCS in decode of WRITE-REPLACE
The encoder generates the DCS IE, but the decoder forgot to parse it :/

Change-Id: I05d489f91a2cc5df372e8e695126659eedac9485
2021-01-03 14:18:58 +01:00
Harald Welte fdd71c822a cbsp: Fix osmo_cbsp_recv_buffered() for KEEP-ALIVE-COMPLETE
We used to suppress/drop any "zero length" messages, but we didn't
include the header when computing the length.  However, in CBSP there
are messages (at least KEEP-ALIVE-COMPLETE) which only consist of the
header without any information elements.  We cannot simply drop such
messages.

This also fixes the return value of osmo_cbsp_recv_buffered() to be
the total number of received octets (including the header).

Change-Id: Ib620128a167cb77f061ee57e8f8ad707b96b1c0d
2021-01-03 14:18:58 +01:00
Harald Welte 64b9407c4e cbsp: Fix encoding of "ETWS Warning Security Info" IE
This is a fixed-length Tag-Value IE.  Our decoder already parsed
it correctly, but the encoder encoded it as TLV, which is wrong.

Change-Id: I7e1d7eab8b8e51acd9a24c38e2d3d30bbf00847a
2021-01-03 14:18:58 +01:00
Neels Hofmeyr b19b533e36 comment: mention spec reference in cbsp.[ch]
Change-Id: I1217883a85b4ddd20e9646c7e80ba18950e09713
2020-08-25 13:34:04 +02:00
Harald Welte e674c44c30 cbsp: Fix decoding of WRITE-REPLACE payload
The user length is the first IE *in* the fixed-length TV, make sure
cbsp_dec_write_repl() respects that.

Change-Id: I864cafac2466a89a4bd9644bc73363fff2babd03
2019-09-01 22:32:24 +02:00
Harald Welte 3097bcec58 cbsp: Remove printf() statement from early development/debugging
Change-Id: I6916e2330e004f20a22f273147fa6288d18b5d0d
2019-08-31 21:27:57 +02:00
Harald Welte f221003044 cbsp: Fix endless loop iteration when decoding cell list IEs
The CBSP code assumed that gsm0808_decode_cell_id_u() would return
the number of bytes it has consumed/parsed.  But it actually always
returns '0', whcih makes us run in an endless loop :(

Change-Id: I5758af4ec11a827d4b888a3a16c4ec22de90a7d6
2019-08-31 21:27:57 +02:00
Harald Welte c30d8be919 cbsp.c: Remove dead code
Change-Id: I0888fbad0f9094ec1b31e2cceecfc9cd372399bd
Closes: CID#202057
2019-07-21 07:59:42 +02:00
Harald Welte f72155a3a4 cbsp: Introduce osmo_cbsp_errstr
Rather than having the encoder/decoder library print some log
messages in case of encoding/decoding errors, let's provide something
akin to 'errno', but with a string instead of a numeric error code.

The 'osmo_cbsp_errstr' global variable (if set) contains a
human-readable string describing the most recent encoding/decoding error.

It exists separately for each thread and hence can be used safely in
multi-threaded environments.

Change-Id: Id9a5a595a76ba278647aee9470ded213d8464103
2019-07-20 12:11:28 +02:00
Harald Welte 07958e44ec CBSP (Cell Broadcast Service Protocol; 3GPP TS 48.049) support
This introduces definitions as well as a parser+encoder for the
Cell Broadcast Service Protocol (CBSP) as specified in 3GPP TS 48.049.

CBSP is used on the interface between CBC and BSC.

Related: OS#3537
Change-Id: I5b7ae08f67e415967b60ac4b824db9e22ca00935
2019-07-20 12:11:28 +02:00