Commit Graph

27 Commits

Author SHA1 Message Date
Harald Welte a7263b6474 Fix license headers.
We have licensed the code under GNU Afffero Public License,
and state that in the first paragraph as well as in the link
to the license.  However, a paragraph in the middle stated
"see the GNU General Public License", which is somewhat misleading.

Let's fix that.

Change-Id: I37e503b195fe43e1da42c080900504ca8e682e76
2024-02-17 10:21:30 +01:00
arehbein 2f6e105956 common: Fix memleak in get_smscb_block()
Fix condition `block_nr == 4`, which was never reached, by effectively
replacing
 - `4` by `msg->num_segs`, so we truly check if the current
   block is the last of this message
 - the index `block_nr` (which starts at zero) by `block_nr + 1`,
   so it is comparable to `msg->num_segs`

Related: OS#5354

Change-Id: I3dc116d6c16c80b31712b2a969f0b2a6998b03f0
2023-02-10 19:56:53 +00:00
Vadim Yanitskiy 374939f8cc cbch: cosmetic: use talloc_zero() in bts_process_smscb_cmd()
Change-Id: Ibb5090b7cd53c1a485d0b9474c6470fa5831de67
2021-12-12 19:37:32 +03:00
Harald Welte cf12cee46c cbch: Fix dangling cur_msg leading to double-free in bts_cbch_reset()
If a new default message is installed via RSL, and the old default
message is currently being transmitted, we must set cur_msg to NULL.

The old default message must be talloc_free()d unconditionally whenever
a new default message is being set.

We can do that by using the TALLOC_FREE macro.

Change-Id: Id32c2074b61cd1f09957b9d1558ffb3a7691a8e0
Related: OS#5325
2021-11-24 20:02:42 +01:00
Harald Welte 79f21c4ed1 cbch: Fix bts_smscb_state_reset() to avoid double-free
If the currently transmitted message is the default message,
bts_ss->cur_msg == bts_ss->derfault_msg.  In this case we cannot
simply talloc_free() both of them, as it would result in a boudle-free.

Change-Id: I2d3645e34d31507b012a53ffe12d14223682f808
Closes: OS#5325
Fixes: Ib01d38c59ba9fa083fcc0682009c13d2db3664fe
2021-11-24 20:02:42 +01:00
Pau Espin ae606d69a4 Reset CBCH state after BTS shutdown
Related: OS#5273
Change-Id: Ib01d38c59ba9fa083fcc0682009c13d2db3664fe
2021-10-20 16:13:03 +02:00
Martin Hauke b378fccef1 Fix common misspellings and typos
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-17 08:05:35 +00:00
Harald Welte 482564b422 cbch: Improve verbosity and extend logging; Always indicate BASIC/EXTD CBCH
Change-Id: I6c8f9fc6215b616371e46c1f4ca4e44b8c7ac096
2019-05-23 19:16:11 +00:00
Harald Welte 590b23ce3c cbch: Add counters; queue length limits and CBCH LOAD reporting
This adds the final missing part to full CBCH support:
* keep a tab on the current queue length for basic + extended CBCH
* keep rate counters about the number of sent / transmitted SMSCB
* send CBCH LOAD information via RSL to the BSC

Change-Id: I7068c7937a60a900c40439115bb84dc3ee0d061f
2019-05-23 19:16:11 +00:00
Harald Welte 0f9595f462 cbch: Keep SMSCB queue length counter
This avoids having to iterate the list to count the number of elements.

Change-Id: I72c47affeb87c9b898bc2290dc7ed113945f1805
2019-05-21 02:42:00 +02:00
Harald Welte 067824841f cbch: Support Extended CBCH
The logic for Extended CBCH are the same as for the Basic CBCH, we just
need to
* duplicate our related state
* parse the optional RSL_IE_SMSCB_CHAN_INDICATOR IE
* start to send data on the Extended CBCH (TB=4..7)

Change-Id: If2c6dc7da1e2185ab75fc957f8d305ad8db22429
Closes: OS#3535
2019-05-21 00:31:11 +02:00
Harald Welte 89bfea63c9 cbch: Fix memory leak and send error message on invalid SMSCB command
Change-Id: I411d1fb3693a2f7cf7bba3d38b1aaf276a4137ba
Related: OS#4011
2019-05-21 00:31:11 +02:00
Harald Welte 5567d71d39 cbch: Implement support for DEFAULT message
The BSC can not only send us each to-be-sent message separately, but
it can also configure a DEFAULT message, which is then to be sent
instead of the NULL message.  Let's add support for this

Change-Id: I65a79215b54155d128c26d2ca11ff9ff3ed2cdba
Closes: OS#4013
2019-05-21 00:31:11 +02:00
Harald Welte 0b682f4997 cbch: Log every RSL SMSCB COMMAND with type and number of blocks
Change-Id: I20efe0aa5a67f011d6b6bead57236366c2f45ecf
2019-05-21 00:31:11 +02:00
Harald Welte dde2f1d5cf cbch: Refactor get_smscb_block() / remove smscb_msg.next_seg
There's no need to keep around a pointer to the next segment
in a SMSCB message.  The way how the multiframe structure is
laid out (and how the tb number works), we can use the result
of a modulo-division on the frame number to determine which
of the segments/blocks inside a SMSCB message (page) we have
to transmit.

This also acts as a simplification in preparation of support
for the SMSCB DEFAULT type.

Change-Id: I48faa19fec4a0852e6112ca2faa98960c678d4c5
Related: OS#4013
2019-05-21 00:31:11 +02:00
Harald Welte 8294368b23 cbch: Implement handling of "Schedule" message
The first block of "schedule" messages must be advertised with
a special sequence number coding, see Table 1 of 3GPP TS 44.012.

Change-Id: I473edf698eba7ff5008f2fd1ec1776f0aa013858
Closes: OS#4012
2019-05-21 00:31:11 +02:00
Harald Welte 6434ba9f90 CBCH: sprinkle some OMSO_ASSERT() and guard against talloc failure
Change-Id: I85fdecbf20de83a6f925765a46b5cd14765da03e
2018-09-17 21:36:59 +02:00
Harald Welte c799c70c59 CBCH: Add FIXME comments on queue overflow/underflow handling
Change-Id: Ida97f25ab4bf7e4d0f03b13396cb37cdfe99ef40
2018-09-17 21:36:59 +02:00
Harald Welte 386c33fa84 CBCH: Use llist_first_entry_or_null() instead of reinventing it
Change-Id: I376111e71d1c7be35a8fd7e392488adc34e21941
2018-09-09 15:40:58 +00:00
Harald Welte d8cd756da4 Get rid of 'struct gsm_bts_role_bts'
gsm_bts_role_bts was introduced at a time when we still shared
gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently
needed a BTS-private structure.  Since that sharing was abandoned quite
some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away
with the bts/btsb dualism in a lot of the code.

Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
2018-03-17 13:40:03 +01:00
Neels Hofmeyr bc9c42663d fix compiler warning: printf format for sizeof()
Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175
2016-06-17 15:34:42 +00:00
Harald Welte 8fc2630dd4 SMS-CB: Clean up + centralize generation of NULL block 2014-12-30 13:45:02 +01:00
Harald Welte bd988f6ad3 SMS-CB: Use GSM412_SEQ_NULL_MSG rather than 0xf 2014-12-30 13:34:57 +01:00
Harald Welte 1e245336ec SMS-CB: use gsm412_block_type from libosmocore
.. and not our own local re-definition of the structure.
2014-12-30 13:33:54 +01:00
Harald Welte 4457c0d9ba SMS-CB: Use GSM412_ #defines from libosmocore rather than our own 2014-12-30 13:32:52 +01:00
Harald Welte 660116fb9d CBCH: Implement CBCH block segmentation and RSL_MT_SMS_BC_CMD
* CBCH load indications are not yet sent
* The queue length is not yet limited!
2014-12-30 00:32:13 +01:00
Harald Welte b15d2c9d2f Initial CBCH support
This should handle OML channel combinations with CBCH and activate the
CBCH SAPI towards the DSP correspondingly.  What is still missing is
sending any actual information over the CBCH in respons to the
PH-RTS.ind coming up from L1.
2014-12-30 00:28:31 +01:00