<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17549">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tests/RLCMACTest: Several fixes and improvements to RAcap tests<br><br>It was recently discovered that the Racap value used for testRAcap was<br>actually malformed (it was taken from a TTCN3 test). It had the presence<br>bit for "EGPRS multislot class" set but no struct was put after it.<br><br>So let's move that malformed value to a new test named<br>testMalformedRAcap(). Since it doesn't make sense trying to re-encode or<br>do similar things with an initially malformed value, let's drop all<br>those parts in this new test.<br><br>For the old testRAcap() test, use a new bitstream this time with the<br>"EGPRS multoslot class" struct set inside (class 3).<br><br>Change-Id: I1e7f8d8866695732ee24a79d8b54d660fd4f22d5<br>---<br>M tests/rlcmac/RLCMACTest.cpp<br>M tests/rlcmac/RLCMACTest.err<br>M tests/rlcmac/RLCMACTest.ok<br>3 files changed, 91 insertions(+), 40 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp</span><br><span>index e62d6e4..6529d4d 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.cpp</span><br><span>+++ b/tests/rlcmac/RLCMACTest.cpp</span><br><span>@@ -219,12 +219,79 @@</span><br><span> </span><br><span> void testRAcap(void *test_ctx)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("*** %s ***\n", __func__);</span><br><span style="color: hsl(120, 100%, 40%);">+        MS_Radio_Access_capability_t data;</span><br><span style="color: hsl(120, 100%, 40%);">+        memset(&data, 0, sizeof(data));</span><br><span style="color: hsl(120, 100%, 40%);">+        bitvec *bv_dec = bitvec_alloc(23, test_ctx);</span><br><span style="color: hsl(120, 100%, 40%);">+        bitvec *bv_enc = bitvec_alloc(23, test_ctx);</span><br><span style="color: hsl(120, 100%, 40%);">+        unsigned int len_dec, len_enc;</span><br><span style="color: hsl(120, 100%, 40%);">+        int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+MS RA capability 1</span><br><span style="color: hsl(120, 100%, 40%);">+    0001 .... = Access Technology Type: GSM E --note that GSM E covers GSM P (1)</span><br><span style="color: hsl(120, 100%, 40%);">+    .... 0011  011. .... = Length in bits: 0x1b (27)</span><br><span style="color: hsl(120, 100%, 40%);">+    ...0 01.. RF Power Capability, GMSK Power Class: Not specified (1)</span><br><span style="color: hsl(120, 100%, 40%);">+    A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (0)</span><br><span style="color: hsl(120, 100%, 40%);">+    .... ...1 = Controlled early Classmark Sending: Implemented</span><br><span style="color: hsl(120, 100%, 40%);">+    0... .... = Pseudo Synchronisation: Not Present</span><br><span style="color: hsl(120, 100%, 40%);">+    .0.. .... = Voice Group Call Service: no VGCS capability or no notifications wanted</span><br><span style="color: hsl(120, 100%, 40%);">+    ..0. .... = Voice Broadcast Service: no VBS capability or no notifications wanted</span><br><span style="color: hsl(120, 100%, 40%);">+    ...1 .... = Multislot capability struct: Present</span><br><span style="color: hsl(120, 100%, 40%);">+        HSCSD multislot class: Bits are not available (0)</span><br><span style="color: hsl(120, 100%, 40%);">+        SMS_VALUE (Switch-Measure-Switch): Bits are not available (0)</span><br><span style="color: hsl(120, 100%, 40%);">+        ECSD multislot class: Bits are not available (0)</span><br><span style="color: hsl(120, 100%, 40%);">+        DTM GPRS Multi Slot Class: Bits are not available (0)</span><br><span style="color: hsl(120, 100%, 40%);">+    .... ..00  011. .... = GPRS multislot class: Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:3 Tta:3 Ttb:2 Tra:3 Trb:1 Type:1 (3)</span><br><span style="color: hsl(120, 100%, 40%);">+    ...0 .... = GPRS Extended Dynamic Allocation Capability: Not Implemented</span><br><span style="color: hsl(120, 100%, 40%);">+    .... ...0  0011 .... = EGPRS multislot class: Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:3 Tta:3 Ttb:2 Tra:3 Trb:1 Type:1 (3)</span><br><span style="color: hsl(120, 100%, 40%);">+    .... 0... = EGPRS Extended Dynamic Allocation Capability: Not Implemented</span><br><span style="color: hsl(120, 100%, 40%);">+*/</span><br><span style="color: hsl(120, 100%, 40%);">+        bitvec_unhex(bv_dec, "1365146230");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("=== Test decoding of MS RA Capability ===\n");</span><br><span style="color: hsl(120, 100%, 40%);">+        rc = decode_gsm_ra_cap(bv_dec, &data);</span><br><span style="color: hsl(120, 100%, 40%);">+        OSMO_ASSERT(rc == 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Make sure there's 1 value (currently fails due to failed decoding) */</span><br><span style="color: hsl(120, 100%, 40%);">+        OSMO_ASSERT(data.Count_MS_RA_capability_value == 1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Make sure GPRS / EGPRS multislot class is parsed correctly */</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("GPRS multislot class = %u\n", Decoding::get_ms_class_by_capability(&data));</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("EGPRS multislot class = %u\n", Decoding::get_egprs_ms_class_by_capability(&data));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Test encoding of decoded MS RA Capability */</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("=== Test encoding of MS RA Capability ===\n");</span><br><span style="color: hsl(120, 100%, 40%);">+        rc = encode_gsm_ra_cap(bv_enc, &data);</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("encode_gsm_ra_cap() returns %d\n", rc);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bv_dec->cur_bit = 4;</span><br><span style="color: hsl(120, 100%, 40%);">+        len_dec = bitvec_get_uint(bv_dec, 7);</span><br><span style="color: hsl(120, 100%, 40%);">+        bv_enc->cur_bit = 4;</span><br><span style="color: hsl(120, 100%, 40%);">+        len_enc = bitvec_get_uint(bv_enc, 7);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* NOTE: vector2 is expected to be different because there is actually no</span><br><span style="color: hsl(120, 100%, 40%);">+         * way to distinguish between NULL and 0 in MS_Radio_Access_capability_t.</span><br><span style="color: hsl(120, 100%, 40%);">+         * The difference is in length indicator: 27 bits vs 65 bits. */</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("vector1 (len_ind=%u) = %s\n", len_dec, osmo_hexdump(bv_dec->data, bv_dec->data_len));</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("vector2 (len_ind=%u) = %s\n", len_enc, osmo_hexdump(bv_enc->data, bv_enc->data_len));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Mangle the length indicator (set it to 21) */</span><br><span style="color: hsl(120, 100%, 40%);">+        unsigned int writeIndex = 4;</span><br><span style="color: hsl(120, 100%, 40%);">+        rc = bitvec_write_field(bv_dec, &writeIndex, 21, 7);</span><br><span style="color: hsl(120, 100%, 40%);">+        OSMO_ASSERT(rc == 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Make sure decoding attempt fails */</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("=== Test decoding of a malformed vector (short length indicator) ===\n");</span><br><span style="color: hsl(120, 100%, 40%);">+        rc = decode_gsm_ra_cap(bv_dec, &data);</span><br><span style="color: hsl(120, 100%, 40%);">+        printf("decode_gsm_ra_cap() returns %d\n", rc);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+void testMalformedRAcap(void *test_ctx)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span>  printf("*** %s ***\n", __func__);</span><br><span>  MS_Radio_Access_capability_t data;</span><br><span>   memset(&data, 0, sizeof(data));</span><br><span>  bitvec *bv_dec = bitvec_alloc(23, test_ctx);</span><br><span style="color: hsl(0, 100%, 40%);">-    bitvec *bv_enc = bitvec_alloc(23, test_ctx);</span><br><span style="color: hsl(0, 100%, 40%);">-    unsigned int len_dec, len_enc;</span><br><span>       int rc;</span><br><span> /*</span><br><span>        MS RA capability 1</span><br><span>@@ -239,48 +306,26 @@</span><br><span>       ...1 .... = Multislot capability struct: Present</span><br><span>             .... ..00  011. .... = GPRS multislot class: Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:3 Tta:3 Ttb:2 Tra:3 Trb:1 Type:1 (3)</span><br><span>            ...0 .... = GPRS Extended Dynamic Allocation Capability: Not Implemented</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        It doesn't show up in wireshark's tree above because specific parser is</span><br><span style="color: hsl(120, 100%, 40%);">+       used, but this RA Cap bitstream has Exist_EGPRS_multislot_class = 1 but</span><br><span style="color: hsl(120, 100%, 40%);">+       it provides no struct with the expected data (malformed, generated</span><br><span style="color: hsl(120, 100%, 40%);">+    erroneusly through TTCN3). The CSN.1 dceoder should ideally return an</span><br><span style="color: hsl(120, 100%, 40%);">+ error here, but it doesn't (it returns a >0 value which we convert to 0</span><br><span style="color: hsl(120, 100%, 40%);">+        in decode_gsm_ra_cap()).</span><br><span> */</span><br><span>       bitvec_unhex(bv_dec, "13a5146200");</span><br><span> </span><br><span>    printf("=== Test decoding of MS RA Capability ===\n");</span><br><span>     rc = decode_gsm_ra_cap(bv_dec, &data);</span><br><span style="color: hsl(120, 100%, 40%);">+    printf("decode_gsm_ra_cap() returns %d\n", rc);</span><br><span>    OSMO_ASSERT(rc == 0);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-       /* Make sure there's 1 value (currently fails due to failed decoding) */</span><br><span style="color: hsl(120, 100%, 40%);">+  /* For sake of completeness, check if the decoder could find 1 value</span><br><span style="color: hsl(120, 100%, 40%);">+    before failing to decode it */</span><br><span>     OSMO_ASSERT(data.Count_MS_RA_capability_value == 1);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        /* Make sure GPRS / EGPRS multislot class is parsed correctly */</span><br><span style="color: hsl(0, 100%, 40%);">-        printf("GPRS multislot class = %u\n", Decoding::get_ms_class_by_capability(&data));</span><br><span style="color: hsl(0, 100%, 40%);">-       printf("EGPRS multislot class = %u\n", Decoding::get_egprs_ms_class_by_capability(&data));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        /* Test encoding of decoded MS RA Capability */</span><br><span style="color: hsl(0, 100%, 40%);">- printf("=== Test encoding of MS RA Capability ===\n");</span><br><span style="color: hsl(0, 100%, 40%);">-        rc = encode_gsm_ra_cap(bv_enc, &data);</span><br><span style="color: hsl(0, 100%, 40%);">-      printf("encode_gsm_ra_cap() returns %d\n", rc);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       bv_dec->cur_bit = 4;</span><br><span style="color: hsl(0, 100%, 40%);">- len_dec = bitvec_get_uint(bv_dec, 7);</span><br><span style="color: hsl(0, 100%, 40%);">-   bv_enc->cur_bit = 4;</span><br><span style="color: hsl(0, 100%, 40%);">- len_enc = bitvec_get_uint(bv_enc, 7);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   /* NOTE: vector2 is expected to be different because there is actually no</span><br><span style="color: hsl(0, 100%, 40%);">-        * way to distinguish between NULL and 0 in MS_Radio_Access_capability_t.</span><br><span style="color: hsl(0, 100%, 40%);">-        * The difference is in length indicator: 29 bits vs 65 bits. */</span><br><span style="color: hsl(0, 100%, 40%);">-        printf("vector1 (len_ind=%u) = %s\n", len_dec, osmo_hexdump(bv_dec->data, bv_dec->data_len));</span><br><span style="color: hsl(0, 100%, 40%);">-   printf("vector2 (len_ind=%u) = %s\n", len_enc, osmo_hexdump(bv_enc->data, bv_enc->data_len));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   /* Mangle the length indicator (set it to 21) */</span><br><span style="color: hsl(0, 100%, 40%);">-        unsigned int writeIndex = 4;</span><br><span style="color: hsl(0, 100%, 40%);">-    rc = bitvec_write_field(bv_dec, &writeIndex, 21, 7);</span><br><span style="color: hsl(0, 100%, 40%);">-        OSMO_ASSERT(rc == 0);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   /* Make sure decoding attempt fails */</span><br><span style="color: hsl(0, 100%, 40%);">-  printf("=== Test decoding of a malformed vector (short length indicator) ===\n");</span><br><span style="color: hsl(0, 100%, 40%);">-     rc = decode_gsm_ra_cap(bv_dec, &data);</span><br><span style="color: hsl(0, 100%, 40%);">-      printf("decode_gsm_ra_cap() returns %d\n", rc);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    bitvec_free(bv_dec);</span><br><span style="color: hsl(0, 100%, 40%);">-    bitvec_free(bv_enc);</span><br><span> }</span><br><span> </span><br><span> int main(int argc, char *argv[])</span><br><span>@@ -300,5 +345,6 @@</span><br><span>      testRlcMacUplink(ctx);</span><br><span>       testCsnLeftAlignedVarBmpBounds(ctx);</span><br><span>         testRAcap(ctx);</span><br><span style="color: hsl(120, 100%, 40%);">+       testMalformedRAcap(ctx);</span><br><span>     talloc_free(ctx);</span><br><span> }</span><br><span>diff --git a/tests/rlcmac/RLCMACTest.err b/tests/rlcmac/RLCMACTest.err</span><br><span>index 13418ee..4434d9b 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.err</span><br><span>+++ b/tests/rlcmac/RLCMACTest.err</span><br><span>@@ -32,8 +32,10 @@</span><br><span> DCSN1 INFO csnStreamDecoder (type=2): PayloadType = 1 | spare = 0 | R = 0 | MESSAGE_TYPE = 2 | DOWNLINK_TFI = 20 |  : Ack_Nack_Description | FINAL_ACK_INDICATION = 1 | STARTING_SEQUENCE_NUMBER = 1 | RECEIVED_BLOCK_BITMAP[0] = 0 | RECEIVED_BLOCK_BITMAP[1] = 0 | RECEIVED_BLOCK_BITMAP[2] = 0 | RECEIVED_BLOCK_BITMAP[3] = 0 | RECEIVED_BLOCK_BITMAP[4] = 0 | RECEIVED_BLOCK_BITMAP[5] = 0 | RECEIVED_BLOCK_BITMAP[6] = 0 | RECEIVED_BLOCK_BITMAP[7] = 1 | : End Ack_Nack_Description | Exist_Channel_Request_Description = 1 |  : Channel_Request_Description | PEAK_THROUGHPUT_CLASS = 0 | RADIO_PRIORITY = 0 | RLC_MODE = 0 | LLC_PDU_TYPE = 1 | RLC_OCTET_COUNT = 18 | : End Channel_Request_Description |  : Channel_Quality_Report | C_VALUE = 40 | RXQUAL = 1 | SIGN_VAR = 0 | Slot[0].Exist = 0 | Slot[1].Exist = 0 | Slot[2].Exist = 0 | Slot[3].Exist = 0 | Slot[4].Exist = 0 | Slot[5].Exist = 0 | Slot[6].Exist = 0 | Slot[7].Exist = 0 | : End Channel_Quality_Report | Exist_AdditionsR99 = 1 |  : AdditionsR99 | Exist_PFI = 0 | : End AdditionsR99 | Padding = 3|43|43|43|43|43|</span><br><span> DCSN1 INFO csnStreamEncoder (type=2): PayloadType = 1 | spare = 0 | R = 0 | MESSAGE_TYPE = 2 | DOWNLINK_TFI = 20 |  : Ack_Nack_Description | FINAL_ACK_INDICATION = 1 | STARTING_SEQUENCE_NUMBER = 1 | RECEIVED_BLOCK_BITMAP[0] = 0 | RECEIVED_BLOCK_BITMAP[1] = 0 | RECEIVED_BLOCK_BITMAP[2] = 0 | RECEIVED_BLOCK_BITMAP[3] = 0 | RECEIVED_BLOCK_BITMAP[4] = 0 | RECEIVED_BLOCK_BITMAP[5] = 0 | RECEIVED_BLOCK_BITMAP[6] = 0 | RECEIVED_BLOCK_BITMAP[7] = 1 |  : End Ack_Nack_Description | Exist_Channel_Request_Description = 1 |  : Channel_Request_Description | PEAK_THROUGHPUT_CLASS = 0 | RADIO_PRIORITY = 0 | RLC_MODE = 0 | LLC_PDU_TYPE = 1 | RLC_OCTET_COUNT = 18 |  : End Channel_Request_Description |  : Channel_Quality_Report | C_VALUE = 40 | RXQUAL = 1 | SIGN_VAR = 0 | Slot[0].Exist = 0 | Slot[1].Exist = 0 | Slot[2].Exist = 0 | Slot[3].Exist = 0 | Slot[4].Exist = 0 | Slot[5].Exist = 0 | Slot[6].Exist = 0 | Slot[7].Exist = 0 |  : End Channel_Quality_Report | Exist_AdditionsR99 = 1 |  : AdditionsR99 | Exist_PFI = 0 |  : End AdditionsR99 | Padding = 3|43|43|43|43|43|</span><br><span> DCSN1 INFO csnStreamDecoder (type=8): PayloadType = 1 | spare = 0 | R = 0 | MESSAGE_TYPE = 8 | DOWNLINK_TFI = 0 | MS_OUT_OF_MEMORY = 0 | Exist_EGPRS_ChannelQualityReport = 1 |  : EGPRS_ChannelQualityReport |  : EGPRS_BEP_LinkQualityMeasurements | Exist_MEAN_CV_BEP_GMSK = 0 | Exist_MEAN_CV_BEP_8PSK = 1 | MEAN_BEP_8PSK = 31 | CV_BEP_8PSK = 7 | : End EGPRS_BEP_LinkQualityMeasurements | C_VALUE = 58 |  : EGPRS_TimeslotLinkQualityMeasurements | Exist_BEP_MEASUREMENTS = 0 | Exist_INTERFERENCE_MEASUREMENTS = 0 | : End EGPRS_TimeslotLinkQualityMeasurements | : End EGPRS_ChannelQualityReport | Exist_ChannelRequestDescription = 1 |  : ChannelRequestDescription | PEAK_THROUGHPUT_CLASS = 6 | RADIO_PRIORITY = 0 | RLC_MODE = 0 | LLC_PDU_TYPE = 1 | RLC_OCTET_COUNT = 62 | : End ChannelRequestDescription | Exist_PFI = 0 | Exist_ExtensionBits = 0 |  : EGPRS_AckNack | Desc = 0 |  : Desc | FINAL_ACK_INDICATION = 0 | BEGINNING_OF_WINDOW = 1 | END_OF_WINDOW = 1 | STARTING_SEQUENCE_NUMBER = 1187 | Exist_CRBB = 0 | URBB = 127 | URBB = 255 | URBB = 255 | URBB = 238 | URBB = 0 | URBB = 0 | URBB = 0 | URBB = 0 | URBB = 0 | URBB = 0 | URBB = 0 | URBB = 0 | URBB = 0 |  : End Desc | : End EGPRS_AckNack | Padding = </span><br><span style="color: hsl(0, 100%, 40%);">-DCSN1 INFO csnStreamDecoder (RAcap): MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 1 | u.Content length = 29 | offset = 4 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 |  : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | EGPRS_multislot_class = 0 | EGPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_DTM_GPRS_multislot_class = 0 | : End Multislot_capability | Exist_Eight_PSK_Power_Capability = 0 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = NULL | UMTS_FDD_Radio_Access_Technology_Capability = NULL | UMTS_384_TDD_Radio_Access_Technology_Capability = NULL | CDMA2000_Radio_Access_Technology_Capability = NULL | UMTS_128_TDD_Radio_Access_Technology_Capability = NULL | GERAN_Feature_Package_1 = NULL | Modulation_based_multislot_class_support = NULL | GMSK_MultislotPowerProfile = NULL | EightPSK_MultislotProfile = NULL | MultipleTBF_Capability = NULL | DownlinkAdvancedReceiverPerformance = NULL | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = NULL | DTM_EnhancementsCapability = NULL | PS_HandoverCapability = NULL | DTM_Handover_Capability = NULL | FlexibleTimeslotAssignment = NULL | GAN_PS_HandoverCapability = NULL | RLC_Non_persistentMode = NULL | ReducedLatencyCapability = NULL | UplinkEGPRS2 = NULL | DownlinkEGPRS2 = NULL | EUTRA_FDD_Support = NULL | EUTRA_TDD_Support = NULL | GERAN_To_EUTRAN_supportInGERAN_PTM = NULL | PriorityBasedReselectionSupport = NULL | MS_RA_capability_value } | </span><br><span style="color: hsl(0, 100%, 40%);">-DRLCMACDATA NOTICE Got 143 remaining bits unhandled by decoder at the end of bitvec</span><br><span style="color: hsl(0, 100%, 40%);">-DCSN1 INFO csnStreamEncoder (RAcap): MS_RA_capability_value { | u.Content = 1 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 |  : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | EGPRS_multislot_class = 0 | EGPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_DTM_GPRS_multislot_class = 0 |  : End Multislot_capability | Exist_Eight_PSK_Power_Capability = 0 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = 0 | UMTS_FDD_Radio_Access_Technology_Capability = 0 | UMTS_384_TDD_Radio_Access_Technology_Capability = 0 | CDMA2000_Radio_Access_Technology_Capability = 0 | UMTS_128_TDD_Radio_Access_Technology_Capability = 0 | GERAN_Feature_Package_1 = 0 | Exist_Extended_DTM_multislot_class = 0 | Modulation_based_multislot_class_support = 0 | Exist_HighMultislotCapability = 0 | Exist_GERAN_lu_ModeCapability = 0 | GMSK_MultislotPowerProfile = 0 | EightPSK_MultislotProfile = 0 | MultipleTBF_Capability = 0 | DownlinkAdvancedReceiverPerformance = 0 | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = 0 | DTM_EnhancementsCapability = 0 | Exist_DTM_GPRS_HighMultislotClass = 0 | PS_HandoverCapability = 0 | DTM_Handover_Capability = 0 | Exist_DownlinkDualCarrierCapability_r7 = 0 | FlexibleTimeslotAssignment = 0 | GAN_PS_HandoverCapability = 0 | RLC_Non_persistentMode = 0 | ReducedLatencyCapability = 0 | UplinkEGPRS2 = 0 | DownlinkEGPRS2 = 0 | EUTRA_FDD_Support = 0 | EUTRA_TDD_Support = 0 | GERAN_To_EUTRAN_supportInGERAN_PTM = 0 | PriorityBasedReselectionSupport = 0 | u.Content length = 65 | MS_RA_capability_value } | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (RAcap): MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 1 | u.Content length = 27 | offset = 4 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 |  : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | EGPRS_multislot_class = 3 | EGPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_DTM_GPRS_multislot_class = 0 | : End Multislot_capability | COMPACT_Interference_Measurement_Capability = NULL | Revision_Level_Indicator = NULL | UMTS_FDD_Radio_Access_Technology_Capability = NULL | UMTS_384_TDD_Radio_Access_Technology_Capability = NULL | CDMA2000_Radio_Access_Technology_Capability = NULL | UMTS_128_TDD_Radio_Access_Technology_Capability = NULL | GERAN_Feature_Package_1 = NULL | Modulation_based_multislot_class_support = NULL | GMSK_MultislotPowerProfile = NULL | EightPSK_MultislotProfile = NULL | MultipleTBF_Capability = NULL | DownlinkAdvancedReceiverPerformance = NULL | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = NULL | DTM_EnhancementsCapability = NULL | PS_HandoverCapability = NULL | DTM_Handover_Capability = NULL | FlexibleTimeslotAssignment = NULL | GAN_PS_HandoverCapability = NULL | RLC_Non_persistentMode = NULL | ReducedLatencyCapability = NULL | UplinkEGPRS2 = NULL | DownlinkEGPRS2 = NULL | EUTRA_FDD_Support = NULL | EUTRA_TDD_Support = NULL | GERAN_To_EUTRAN_supportInGERAN_PTM = NULL | PriorityBasedReselectionSupport = NULL | MS_RA_capability_value } | </span><br><span style="color: hsl(120, 100%, 40%);">+DRLCMACDATA NOTICE Got 145 remaining bits unhandled by decoder at the end of bitvec</span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamEncoder (RAcap): MS_RA_capability_value { | u.Content = 1 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 |  : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | EGPRS_multislot_class = 3 | EGPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_DTM_GPRS_multislot_class = 0 |  : End Multislot_capability | Exist_Eight_PSK_Power_Capability = 0 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = 0 | UMTS_FDD_Radio_Access_Technology_Capability = 0 | UMTS_384_TDD_Radio_Access_Technology_Capability = 0 | CDMA2000_Radio_Access_Technology_Capability = 0 | UMTS_128_TDD_Radio_Access_Technology_Capability = 0 | GERAN_Feature_Package_1 = 0 | Exist_Extended_DTM_multislot_class = 0 | Modulation_based_multislot_class_support = 0 | Exist_HighMultislotCapability = 0 | Exist_GERAN_lu_ModeCapability = 0 | GMSK_MultislotPowerProfile = 0 | EightPSK_MultislotProfile = 0 | MultipleTBF_Capability = 0 | DownlinkAdvancedReceiverPerformance = 0 | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = 0 | DTM_EnhancementsCapability = 0 | Exist_DTM_GPRS_HighMultislotClass = 0 | PS_HandoverCapability = 0 | DTM_Handover_Capability = 0 | Exist_DownlinkDualCarrierCapability_r7 = 0 | FlexibleTimeslotAssignment = 0 | GAN_PS_HandoverCapability = 0 | RLC_Non_persistentMode = 0 | ReducedLatencyCapability = 0 | UplinkEGPRS2 = 0 | DownlinkEGPRS2 = 0 | EUTRA_FDD_Support = 0 | EUTRA_TDD_Support = 0 | GERAN_To_EUTRAN_supportInGERAN_PTM = 0 | PriorityBasedReselectionSupport = 0 | u.Content length = 65 | MS_RA_capability_value } | </span><br><span> DRLCMACDATA ERROR Failed to encode MS RA Capability IE: not enough bits in the output buffer (rc=107)</span><br><span> DCSN1 INFO csnStreamDecoder (RAcap): MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 1 | u.Content length = 21 | offset = 4 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 |  : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | DCSN1 ERROR csnStreamDecoder: error NEED_MORE BITS TO UNPACK (-5) at EGPRS_multislot_class (idx 31): End Multislot_capability | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (RAcap): MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 1 | u.Content length = 29 | offset = 4 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 |  : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | EGPRS_multislot_class = 0 | EGPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_DTM_GPRS_multislot_class = 0 | : End Multislot_capability | Exist_Eight_PSK_Power_Capability = 0 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = NULL | UMTS_FDD_Radio_Access_Technology_Capability = NULL | UMTS_384_TDD_Radio_Access_Technology_Capability = NULL | CDMA2000_Radio_Access_Technology_Capability = NULL | UMTS_128_TDD_Radio_Access_Technology_Capability = NULL | GERAN_Feature_Package_1 = NULL | Modulation_based_multislot_class_support = NULL | GMSK_MultislotPowerProfile = NULL | EightPSK_MultislotProfile = NULL | MultipleTBF_Capability = NULL | DownlinkAdvancedReceiverPerformance = NULL | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = NULL | DTM_EnhancementsCapability = NULL | PS_HandoverCapability = NULL | DTM_Handover_Capability = NULL | FlexibleTimeslotAssignment = NULL | GAN_PS_HandoverCapability = NULL | RLC_Non_persistentMode = NULL | ReducedLatencyCapability = NULL | UplinkEGPRS2 = NULL | DownlinkEGPRS2 = NULL | EUTRA_FDD_Support = NULL | EUTRA_TDD_Support = NULL | GERAN_To_EUTRAN_supportInGERAN_PTM = NULL | PriorityBasedReselectionSupport = NULL | MS_RA_capability_value } | </span><br><span style="color: hsl(120, 100%, 40%);">+DRLCMACDATA NOTICE Got 143 remaining bits unhandled by decoder at the end of bitvec</span><br><span>diff --git a/tests/rlcmac/RLCMACTest.ok b/tests/rlcmac/RLCMACTest.ok</span><br><span>index 89e07ec..ffcaeb3 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.ok</span><br><span>+++ b/tests/rlcmac/RLCMACTest.ok</span><br><span>@@ -134,10 +134,13 @@</span><br><span> *** testRAcap ***</span><br><span> === Test decoding of MS RA Capability ===</span><br><span> GPRS multislot class = 3</span><br><span style="color: hsl(0, 100%, 40%);">-EGPRS multislot class = 0</span><br><span style="color: hsl(120, 100%, 40%);">+EGPRS multislot class = 3</span><br><span> === Test encoding of MS RA Capability ===</span><br><span> encode_gsm_ra_cap() returns -5</span><br><span style="color: hsl(0, 100%, 40%);">-vector1 (len_ind=29) = 13 a5 14 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(0, 100%, 40%);">-vector2 (len_ind=65) = 18 25 14 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(120, 100%, 40%);">+vector1 (len_ind=27) = 13 65 14 62 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(120, 100%, 40%);">+vector2 (len_ind=65) = 18 25 14 62 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span> === Test decoding of a malformed vector (short length indicator) ===</span><br><span> decode_gsm_ra_cap() returns -5</span><br><span style="color: hsl(120, 100%, 40%);">+*** testMalformedRAcap ***</span><br><span style="color: hsl(120, 100%, 40%);">+=== Test decoding of MS RA Capability ===</span><br><span style="color: hsl(120, 100%, 40%);">+decode_gsm_ra_cap() returns 0</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17549">change 17549</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-pcu/+/17549"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I1e7f8d8866695732ee24a79d8b54d660fd4f22d5 </div>
<div style="display:none"> Gerrit-Change-Number: 17549 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>