Commit Graph

1436 Commits

Author SHA1 Message Date
Pau Espin d0fc9e80fe Remove dash from name used in VTY cmd prompt
Others projects don't contain a dash in there, and it seems to cause
problems with TTCN3 VTY expectations.

Change-Id: I3430abb5fc622dec293457466e760de95fa3a05c
2019-12-02 11:14:26 +00:00
Harald Welte 3a61b920f2 manual: Add missing documentation for '-i' command line option
Change-Id: Iec0f2ecd610e63baba46a63d3e1a0979a9d8c5a8
2019-12-01 14:32:54 +00:00
Harald Welte f6d282822e manual: Fix documentation missing "-D" command line option
Change-Id: I2fd0b6f52ddc6931f413921b45d9756cb1fe456d
2019-12-01 14:32:54 +00:00
Harald Welte c925ccccfc manual: Fix copy+paste error
Change-Id: I27744628edeca6895f50f84c6f2f04c2e6e2de0b
2019-12-01 14:32:54 +00:00
Vadim Yanitskiy 657a4c0ccd VTY: cosmetic: use osmo_talloc_replace_string()
Change-Id: Id09c7d24b48ddecfa96404c3e75330465a11f830
2019-11-30 20:17:25 +07:00
Vadim Yanitskiy fc75cc0ecf VTY: add warning about changing PCU socket path at run-time
Change-Id: I7cee2d782bd3dfc2cc8d2febc16dca905dcc294e
2019-11-30 20:17:21 +07:00
Pau Espin 1e6eb30f51 Clarify (M)CS related VTY attributes
Some are used to control (M)CS values for downlink while some do it for
uplink. Let's make clear which one is used for what. Take the chance to
document the fields a bit better than they were.

Some more information about the origin of cs_downgrade_threshold can be
found in the commit introducing it: 70b96aa232.

Related: OS#4286
Change-Id: I4e890e924b094a1937fbd3794de96704cf0421a8
2019-11-28 17:11:56 +01:00
Pau Espin 1d8497ba6a doc: vty: Update osmo-pcu_vty_reference.xml
Change-Id: I287893cabf0468f0c110eb751eb887f58ff238c0
2019-11-28 17:09:09 +01:00
Vadim Yanitskiy ffebd24456 PTCCH: properly handle RACH.ind for PCU_IF_SAPI_PTCCH
Change-Id: I482d60a46b9d253dfe0b16140eac9fea6420b30c
Related: OS#1545
2019-11-23 17:42:45 +07:00
Vadim Yanitskiy 17954da56c pcuif_proto.h: extend RACH.ind with TRX / TS numbers
Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.

Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.

Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).

Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.

Change-Id: If209001885ffb14b64a8e808df3700d85a4b2ef9
Related: OS#1545
2019-11-17 02:58:35 +07:00
Vadim Yanitskiy 78f58618f3 PTCCH: properly handle RTS.req for PCU_IF_SAPI_PTCCH
Change-Id: Ib204acce1a7e33f6651b9da2a7b4a9b9ae461093
Related: OS#1545
2019-11-17 02:58:31 +07:00
Vadim Yanitskiy bd0dac3783 PTCCH: implement basic message codec and API
Change-Id: Id79e95aafdde4a71977c64385fce48b729a51ca9
Related: OS#1545
2019-11-17 02:35:18 +07:00
Vadim Yanitskiy 0bf622e057 gprs_bssgp_destroy(): fix memleak and NULL-pointer dereference
So far there was a memory leak, because free()ing 'the_pcu.bctx'
would cause ASAN to complain. And that's reasonable, because it
needs to be freed properly. Moreover, 'the_pcu.bctx' may simply
be uninitialized in some cases, e.g. when OsmoPCU is terminated
before connecting to the SGSN.

Let's use the new bssgp_bvc_ctx_free() from libosmogb.

Change-Id: I274e79e1746c7678b81720ec11e8a564befe38ba
Depends: Ia78979379dbdccd6e4628c16f00d0c06d9212172
2019-11-10 09:04:21 +00:00
Vadim Yanitskiy fd734de4d1 GprsMs::update_cs_ul(): clarify the meaning of old_link_qual
Change-Id: Iad703a573621c64613b9b8c229079dc63fcaeb9e
2019-11-08 06:20:55 +07:00
Vadim Yanitskiy 87b6e7dbed tests/tbf: suspend warnings about the link quality measurements
Share a single instance of 'pcu_l1_meas' between all unit tests,
set initial measurement values in main(). This way we can get
rid of the following warnings:

  Unable to update UL (M)CS CS-X because we don't have link quality measurements.

Change-Id: I1c82076df6cd0833d243e1e6afb140bae3bd2ec9
Fixes: OS#3828
2019-11-08 04:44:07 +07:00
Vadim Yanitskiy ce27d1e126 BSSGP: properly print BVCI for signalling messages (BVCI=0)
Change-Id: I4ac0f48d2e62cd0545e8a1e1b26c9e43ef5e8dde
2019-11-08 04:18:46 +07:00
Vadim Yanitskiy ef444142c8 BSSGP: do not reject SUSPEND ACK / NACK messages
Both BSSGP SUSPEND ACK and NACK messages use BVCI=0 (signaling),
which always exists. Claiming that BVCI=0 is unknown is wrong.

Instead of adding both BSSGP_PDUT_SUSPEND_{ACK,NACK} to the 'if'
statement, let's rather avoid rejection for all BVCI=0 messages,
as there may be other unlisted message types.

Change-Id: I780657c1e8f67e0bef0e92a31db7ba61b57d7ec4
Related: OS#4111
2019-11-08 04:11:20 +07:00
Pau Espin 05bca3524a Fix assertion hit upon CCCH Paging Request
Recent commit added an assertion to check for buffer boundaries and it
actually gets hit.
One of the 2 code paths calling pcu_l1if_tx_pch() was passing a buffer
of 23 bytes while one of maximum 22 is expected (because plen is not set
in the buffer but set inside pcu_l1if_tx_pch()).
So it seems before the assert, that code path was actually writing 1
byte outside the boundaries of data buffer, since bitvec_pack() uses
data_len field of bitvec.

Related: OS#4228
Fixes: 8dc09e73d0
Change-Id: I84c5dfd4d5580e9d4c00ed21887cb51bd9abbd2e
2019-10-16 14:36:28 +02:00
Alexander Couzens b3b0c49d1c encoding: fix space, tabs
Change-Id: I80ac88f50bfedfd2b86d548883313b5a187b1e8f
2019-10-09 17:14:17 +00:00
Vadim Yanitskiy cef2f843b4 VTY: fix command 'show tbf all': properly filter TBFs
For a long time the VTY command to show all active TBFs was broken.
The TBF filtering (by allocation origin) logic allows one to show
TBFs allocated on CCCH, PACCH, or on both of them. In the latter
case we have been checking whether a TBF was allocated on both
logical channels at the same time.

Let's fix this by passing a flag-mask instead of boolean arguments.
To be able to use GPRS_RLCMAC_FLAG_* definitions from "tbf.h", let's
exclude them from "#ifdef __cplusplus ... #endif" block.

Change-Id: I1c9f401368af880a97d32905c4cce0da481ffc21
2019-10-09 22:00:54 +07:00
Vadim Yanitskiy afbf189ef2 VTY: refactor pcu_vty_show_ms_all(): use show_ms()
Change-Id: I72aa1a1de22602a3ad2a4d19604ae0935c88c750
2019-10-09 20:26:47 +07:00
Pau Espin d752d7cebe pcu_l1_if.cpp: Replace value 23 with libosmocore's GSM_MACBLOCK_LEN
Change-Id: Ieec3dd028fffa1a735afaaf3f93da0a1202d122a
2019-10-07 21:04:19 +02:00
Pau Espin 8dc09e73d0 pcu_l1_if.cpp: Imm Assign PCH: clarify size of different items
Change-Id: I32876858e3e93951e965b0fc7875c95c1f36f3ac
2019-10-07 21:04:19 +02:00
Pau Espin f681f07cd0 pcu_l1_if.cpp: Drop unneeded byte in Imm Ass PCH buffer
paging group is 3 bytes and imm assign with plen prepended is 23 bytes,
so there's 1 extra byte not needed and makes code confusing.

Change-Id: Id7835e5aa1506505ff54e019b38f30111f79b5dc
2019-10-07 21:04:19 +02:00
Pau Espin 2ccb6aef89 pcu_l1_if.cpp: Fix GSMTAP Imm Assign PCH wrong encoding
Wireshark expects to receive the plen in order to decode it.

Fixes: 58543709e4
Change-Id: I91d1354689300b949760cdbaee03294eab958e12
2019-10-07 18:26:10 +02:00
Pau Espin 58543709e4 Log AGCH and PCH blocks using GSMTAP
Change-Id: I4d62f98801af1b0a290d3dd35bd213ccf3151035
2019-10-01 10:38:55 +02:00
Pau Espin 1ec211f57f Log RACH Requests using GSMTAP
Change-Id: Ib686a49e8c630808c30bede5810cd65fc045954a
2019-09-30 20:15:54 +02:00
Pau Espin 1879442443 vty: Fix osmo_tdef timers not listed in write config
Change-Id: I5c7ae18919e4b016505aa01eea6694d8a3f5df5f
2019-09-26 18:25:35 +02:00
Pau Espin f4c77e686a tbf_dl.cpp: Remove dup call to tbf_update_ms_class() in state GPRS_RLCMAC_WAIT_RELEASE
tbf_update_ms_class() is already called two lines above in the common
path.

Fixes: 409efa1ec8
Change-Id: Icbe3805c72a5c77366215be55128b586e5a00fb7
2019-09-26 14:43:22 +02:00
Pau Espin ad586a9fe4 tbf_dl: Setup m_llc_timer in constructor using osmocom API
Change-Id: I3e761b319326e33ab1d56c4fb30cafe3b0f96c29
2019-09-26 14:43:22 +02:00
Pau Espin bddf1ad7f6 Move tbf_{dl,ul} child constructors to respective .cpp files
Fixes: 9d1cdb1f69
Change-Id: Id258589d46de42ad4e27889bc396f930b7f94b79
2019-09-26 14:43:22 +02:00
Pau Espin 9d1cdb1f69 Move out tbf subclasses from tbf.h to their own headers
It's a good start towards clearing current mess between parent and the 2
children classes.

Change-Id: Ibc22ea2e02609af7ee058b8bc15df2115d4c6f60
2019-09-25 17:50:06 +02:00
Pau Espin 488aa29083 cosmetic: fix whitespace
Change-Id: I45bbe4d3c69d573aaff010d16f338c7ec3eaf08a
2019-09-25 17:50:06 +02:00
Pau Espin e13cdc503e pdch.cpp: Use pcu_l1_meas previously filled by lower layers
Otherwise, a new meas object is allocated in the stack in upper layers
which doesn't contain the link_qual information (have_link_qual=0),
outputting following error:

osmo-pcu/src/gprs_ms.cpp:644 Unable to update UL (M)CS CS-2 because we don't have link quality measurements.

Change-Id: I1980ca325c8d65f3f6310fa697dd810eec7ab077
2019-09-25 13:52:31 +02:00
Pau Espin 812d466bbd pdch.cpp: Refactor bitvec param passing in rcv_control_block
Move code in rcv_block_gprs() only needed for rcv_control_block() into
the later. This way rcv_block_gprs() is simplified and shows similar
code paths with regards to rcv_data_block().
It can now be seen that the main difference between both is the meas
param no being passed in the control case.

Change-Id: I2a0133463edced93c72ccc743a0cf00d1d6922cf
2019-09-25 13:35:13 +02:00
Oliver Smith 04797b1e35 configure.ac: set C and C++ dialects
Make sure that the compiler always assumes the same C dialect, to
prevent unexpected compiler errors when building with older compilers
(on other Linux distrubtions like in OBS, or in docker).

Use gnu89 and gnu++03, because that is what the code currently compiles
with.

Related: https://lists.osmocom.org/pipermail/openbsc/2019-September/013030.html
Related: OS#3598
Change-Id: Ia57ba101627e3cc0babeca82631e207a3e2e0960
2019-09-18 14:28:43 +02:00
Oliver Smith 2beb1b85e0 tests/app_info: fix compiling with older g++
Do not use C++11 extended initializers to prevent the following error.

AppInfoTest.cpp:109:54: error: extended initializer lists only available with -std=c++11 or -std=gnu++11
  pcu_prim.u.app_info_req = {0, 15, {0xff, 0x00, 0xff}};

I ran into this when modifying the gerrit build verification job to
build with docker (which still uses GCC-4.9).

Related: OS#4204
Change-Id: I307cd87af88e86804a90d6466e9cc3909bfe701f
2019-09-18 13:58:42 +02:00
Pau Espin 2b5c629055 Use osmo_tdef to implement dl-tbf-idle-time
Change-Id: I5e4f0d2f90e643600b7752525d6c2830856c9d3b
2019-09-17 11:11:04 +02:00
Pau Espin 63700ead34 Use osmo_tdef to implement ms-idle-time
This commit would also remove the option from config_write_pcu() since
it's automatically filled in by osmo_tdef, but there was actually a bug
because that param was never printed when saving the config...

Change-Id: Id8e70b0f44ef2f7e20ecdb3fd8ca93ae2a05b9a3
2019-09-17 11:05:45 +02:00
Pau Espin 474dc77894 tests: TbfTest: Unify stderr and stdout to ease debugging
osmo-pcu code is really verbose, and since log lines printing start and
end of tests are sent to a different file, it's really difficult to
understand which test outputs what.

Change-Id: I3e887158e2c9585c360d44f12f995f55861170f2
2019-09-16 14:21:21 +00:00
Pau Espin 38cfa734f4 Use osmo_tdef to implement T3190
Change-Id: I0c767c526398d98ca47ef98fdaccfc23af11fb0d
2019-09-16 14:21:21 +00:00
Pau Espin 5211d9deca Use osmo_tdef for BSSGP T1 and T2
Change-Id: I477e5b702c8b956136d93fc1cee01991233e381f
2019-09-16 14:21:21 +00:00
Oliver Smith cfb6321b88 Forward ETWS Primary Notification to MS
Receive an Application Information Request from the BTS via PCU
interface. Construct a Packet Application Information message from it
(3GPP TS 44.060 11.2.47) and send it to all MS with active TBF.

The TTCN-3 test infrastructure to test this feature is not quite ready
yet, so I've added C unit tests instead.

Related: OS#4048
Change-Id: Ie35959f833f46bde5f2126314b6f96763f863b36
2019-09-14 15:28:43 +00:00
Pau Espin 5360ef5447 bts.cpp: Fix osmo_tdef initialization on older g++ compilers
Fixing errrors spotted:
bts.cpp:78:1: error: uninitialized const member 'osmo_tdef::T'
 };
 ^
bts.cpp:78:1: error: uninitialized const member 'osmo_tdef::default_val'
bts.cpp:78:1: error: uninitialized const member 'osmo_tdef::unit'
bts.cpp:84:1: error: uninitialized const member 'osmo_tdef::T'
 };
 ^
bts.cpp:84:1: error: uninitialized const member 'osmo_tdef::default_val'
bts.cpp:84:1: error: uninitialized const member 'osmo_tdef::unit'

Change-Id: I2dfecf22516f52cc19e0a0442e70dbc4dbc61336
2019-09-13 12:42:38 +02:00
Alexander Couzens e46d8dcaab tbf_dl: add comments to the scheduler
Change-Id: Ib037f9fda30472313c7a82effb1e925c6abebbe5
2019-09-12 16:49:21 +00:00
Pau Espin 28f160e76c Introduce osmo_tdef infra and timer VTY commands
This will allow for configuration of some of the timers by the user,
and allow him to inspect current values being used.
It will be also useful for TTCN3 tests which may want to test some of
the timers without having to wait for lots of time.

Timers are splitted into 2 groups: BTS controlled ones and PCU controlled
ones. The BTS controlled ones are read-only by the user (hence no
"timer" VTY command is provided to change them).

TbfTest.err output changes due to timers being set up correctly as a
consequence of changes. Other application such as pcu_emu.cpp and
pcu_main.cpp had to previosuly set the initial values by hand (and did
so), but apparently TbfTest.c was missing that part, which is now fixed
for free.

Depends: libosmocore.git Id56a1226d724a374f04231df85fe5b49ffd2c43c
Change-Id: I5cfb9ef01706124be262d4536617b9edb4601dd5
2019-09-12 14:17:07 +02:00
Oliver Smith 45fdc44d68 tbf_dl: make preemptive retransmission optional
Since [1], OsmoPCU already starts to retransmit downlink blocks before
the MS has had a chance to receive them and/or send the related
acknowledgement in uplink. Make this optional with the new VTY option
"no dl-tbf-preemptive-retransmission".

[1] e25b5b91f6 ("tbf: Only create dummy frames if necessary")
Related: OS#2408
Change-Id: Id08aed513d4033aa0d4324c6ce07cbb2852f2f92
2019-09-11 06:16:29 +00:00
Oliver Smith 37ae22ab13 doc: update generated VTY reference
Change-Id: I6243a2856df9db0f06e704e51e87113f9b57bb36
2019-09-11 06:16:29 +00:00
Pau Espin a8892a69b3 Use proper API osmo_timer_setup() to set up timer struct
Change-Id: Idd2b0c5247870bee3b3c3e460a6731ee50a47404
2019-09-05 16:21:49 +02:00
Pau Espin ef1fe58e19 cosmetic: tbf: Rename T and N arrays
Those namings my collide with usual osmocom "T" variable name associated
to a timer number, which will be added in following patches.

Change-Id: Ic2b5068a4882e4a043bf81496be30a378fdb9a09
2019-09-05 14:40:26 +02:00