Commit Graph

25 Commits

Author SHA1 Message Date
Pau Espin 4f9a48fc23 RLCMAC: Fix unbound spb value in decoded egprs data blocks
That field is only present in Header Type 3 blocks.

Change-Id: Ie05576d7d7c18933dd9abcdc055cbfe1e4e54756
2021-02-05 10:14:48 +00:00
Pau Espin ff7c5baaa2 RLCMAC: Fix decoding of dl data block with no llc block header byte
The value was marked as unbound while it should be marked as omitted:

"""
dl_block := { data := { cs := CS_1 (0), mac_hdr := { mac_hdr := { payload_type := MAC_PT_RLC_DATA (0), rrbp := RRBP_Nplus13_mod_2715648 (0), rrbp_valid := false, usf := 7 }, hdr_ext := { pr := PWR_RED_0_to_3dB (0), spare := '0'B, tfi := 0, fbi := false, bsn := 0, e := true } }, blocks := { { hdr := <unbound>, payload := '0D0C8653110FFEF072972C5A790C0317299753B5'O } } } } }
"""

Change-Id: If00338729ee1b2c8a4e100495e7cfa0599a4cb8b
2021-02-05 10:14:48 +00:00
Pau Espin 68a7a49354 RLCMAC_EncDec: Implement decoding of Egprs Dl Data block HeaderType 2 and 1
Change-Id: I3b8199711e08bc128821e02c626ded1bc6aa30d7
2020-11-16 10:48:25 +01:00
Pau Espin cca530fbf4 RLCMAC_EncDEc: Fix decode of DlEgprsDataBlock without LI
Change-Id: Iec7e1a2d876abfdc911a65113cc6c9e888257c61
2020-11-16 10:48:25 +01:00
Pau Espin cb00c52b07 pcu: Specify (M)CS to use when sending UL rlcmac data blocks
Apply padding and spare bits in the encoder according to CS/MCS format.

Change-Id: I918acac81f550077daeda3374b3de9b426ff3572
2020-11-16 09:14:28 +00:00
Pau Espin a05b2bc8a3 RLCMAC_EncDec: Fix Encoding of TLLI in UlEgprsDataBlock
Change-Id: If13f36db9c86c10d7c5a6a307c430ee090b7dd06
2020-11-10 12:55:33 +00:00
Pau Espin 081b168060 RLCMAC_EncDec: Implement encoding for RlcmacUlEgprsDataHeader HeaderType 1 and 2
Change-Id: I4e0b0e0960634fd2e5f09073a1ef093200dbe707
2020-11-10 12:55:33 +00:00
Pau Espin 563bcd6cb5 RLCMAC_EncDec: Fix encoding of TI and E bits in UlEgprsDataBlock
Change-Id: I442a12a16fe0d0664c677eec10bb81e2544235aa
2020-11-10 12:55:33 +00:00
Pau Espin 5abfded61e RLCMAC_EncDec: Provide decoded (m)cs in (E)GPRS data blocks
Let's provide this information to higher layer since CS is mostly
discovered by original bitstring size which is available during
decoding.

Call the size2mcs converter in each function to avoid having to pass it
as a parameter and have it selfcontained, meaning one can simply call
decode(bitstring) from TTCN3 code and be done with it.

Change-Id: I80ed44e575cc0a11510832e5bbfc07173e7b75b8
2020-11-06 14:20:37 +01:00
Pau Espin 2456dad91e RLCMAC_EncDec.cc: Fix egprs data block encode alignment
Selftests I'm using in the pcu testsuite to verify encoding are attached
too.

Change-Id: Id0e21248853eb5fac89e863822804cfbecf3c865
2020-05-01 15:54:17 +02:00
Pau Espin 0b8e22be46 RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2
Change-Id: I4dfc994beb7d0ee5522770651150c77701c573fe
2020-04-30 20:10:17 +02:00
Pau Espin 82d22bc326 RLCMAC_EncDEc.cc: Use copied structure as other parts of the function
Change-Id: Iffe45b3d220c0f95f1fdb54e1b90f0a0cef88ee3
2020-04-30 20:09:12 +02:00
Pau Espin d3da797249 RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs Ul HdeaderType3
Change-Id: Id0f7cb29cf3a30aafdaaed2aca7d34277e3c975d
2020-04-30 20:07:01 +02:00
Pau Espin 331f52507b RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder
Change-Id: Ieb061d2914be086791e264a78ae14d3d55e10815
2020-04-30 20:05:29 +02:00
Pau Espin a2c5b6e9d9 RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and pfi uninitialized instead of omit
Change-Id: Id63ae66cd715512f12eb87fd9ff0a9f5af93d5d2
2020-04-30 20:00:02 +02:00
Pau Espin ecaeb89648 cosmetic: RLCMAC_EncDEc.cc: fix typos in comments
Change-Id: Id91ed01759c3e1e2b52f1e35b1f4198fbc052408
2020-04-30 19:58:15 +02:00
Pau Espin 372af7a116 library/RLCMAC: Add partial support for EGPRS data block encoding/decoding
* RlcmacUlBlock and RlcmacDlBlock gain a new union field "egprs_data",
  which is chosen when msg contains an egprs data block. Hence one can
  use same structure for both gprs/egprs data and simply check
  "ischosen(block.data_egprs)" to know whether it contains egprs or gprs
  data block.
* C++ code in RLCMAC_EncDec.cc takes care of encoding and decoding of
  each data header type and exposes a generic ttcn3 struct
  "UlMacDataHeader" and "DlMacDataHeader". Decoded header type can be
  found in mac_hdr.header_type. This can be used t5ogether with CPS to
  get the MCS of the message received. Similarly, the encoder will use the
  same field to know how to encode the ttcn3 structure.
* In RLCMAC_EncDec.cc order of functions has been ordered to split
  between encoding and decoding, and inside these split between Ul and
  Dl messages.
* Only encoding of UL HeaderType3 and decoding of Dl HeaderType3 is
  implemented so far in RLCMAC_EncDec.cc. However, all code is already
  arranged and functions prepared (with FIXME fprintf) to easily add the
  missing header types once needed.
* Actually only the decoding of DL HeaderType3 has been tested to work so far.
  Encoding may still be missing to octet-align the data block after the header.
  All these wil lbe fixed once a test using them exists.

Change-Id: I2bc4f877a5e17c57ffa8cf05565dc8593b45aae8
2020-04-29 09:06:34 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Harald Welte 439e546539 RLCMAC_EncDec: Fix handling of optional LlcBlockHdr
Whenever the OPTIONAL<> construct is used for a member of a record,
we have to add an extra set of parenthsis in order to avoid bogus
"has no RAW decode method" error messages.

It seems the OPTIONAL inherits from Base_Type which will print
"which has no RAW decoding method" from its RAW_decode().

Change-Id: Idfaa11db0e2db4be144800b5bccc44d0515220d7
2018-03-12 14:23:57 +00:00
Harald Welte 060e27a476 gprs_gb: working UL TBF with segmentation
Change-Id: I0f93246f02e1bee2e1e9db62af5e1e3559c415e9
2018-03-12 14:23:57 +00:00
Harald Welte acc93ab873 GSM_Types: Switch TLLI from uint32_t to OCT4
The TLLI is not really a number, but an opaque 4-byte value.

Change-Id: I0901340a2211eeeb899f312bcc60573fec11f220
2018-03-03 22:39:56 +01:00
Harald Welte 244cd8acf7 sysinfo: Fix the TC_telnet test case VTY command order 2017-08-26 09:25:20 +02:00
Harald Welte 2072ab6698 RLCMAC: enc__RlcmacUlDataBlock: fix 'omit' for PFI / TLLI
It's not sufficient to check if the value is bound; we must also make
sure that the value is not OMIT.
2017-07-31 18:33:35 +02:00
Harald Welte 78a1af6782 RLCMAC: Fix encoding/decoding of 'union' types
We must supply hand-written C++ functions for encoding/decoding
the union types.
2017-07-31 17:33:56 +02:00
Harald Welte 43e060a50d Add hand-written encoder/decoder for RLC/MAC UL/DL data blocks
Their format is simply too complex to be used with the automatic RAW
encoder/decoder.  Let's implement it by hand, using the automatic
coder whenever possible.
2017-07-30 22:38:03 +02:00