Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 1 | /* RLCMACTest.cpp |
| 2 | * |
| 3 | * Copyright (C) 2011 Ivan Klyuchnikov |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | |
| 22 | //#include <BitVector.h> |
| 23 | #include <iostream> |
| 24 | #include <cstdlib> |
Ivan Kluchnikov | 835f91e | 2012-04-30 18:00:36 +0400 | [diff] [blame] | 25 | #include <cstring> |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 26 | #include <assert.h> |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 27 | #include "gsm_rlcmac.h" |
Max | 7426c5f | 2019-02-18 20:42:42 +0100 | [diff] [blame] | 28 | #include "gprs_rlcmac.h" |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 29 | #include "decoding.h" |
Max | 7426c5f | 2019-02-18 20:42:42 +0100 | [diff] [blame] | 30 | |
Andreas Eversberg | 138f4e6 | 2013-01-14 12:31:11 +0100 | [diff] [blame] | 31 | extern "C" { |
| 32 | extern const struct log_info gprs_log_info; |
| 33 | #include "pcu_vty.h" |
| 34 | #include <osmocom/vty/telnet_interface.h> |
| 35 | #include <osmocom/vty/logging.h> |
Aravind Sirsikar | 9f5f008 | 2016-08-30 13:20:23 +0530 | [diff] [blame] | 36 | #include <osmocom/core/utils.h> |
Max | d3a0d91 | 2019-03-05 16:15:01 +0100 | [diff] [blame] | 37 | #include <osmocom/core/msgb.h> |
Andreas Eversberg | 138f4e6 | 2013-01-14 12:31:11 +0100 | [diff] [blame] | 38 | #include <osmocom/core/application.h> |
Vadim Yanitskiy | 39a6505 | 2020-01-25 01:24:59 +0700 | [diff] [blame] | 39 | |
| 40 | #include "csn1.h" |
Andreas Eversberg | 138f4e6 | 2013-01-14 12:31:11 +0100 | [diff] [blame] | 41 | } |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 42 | using namespace std; |
| 43 | |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 44 | void *tall_pcu_ctx; |
| 45 | |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 46 | void printSizeofRLCMAC() |
| 47 | { |
Pau Espin Pedrol | 54681c3 | 2020-01-23 21:59:23 +0100 | [diff] [blame] | 48 | printf("*** %s ***\n", __func__); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 49 | cout << "sizeof RlcMacUplink_t " << sizeof(RlcMacUplink_t) << endl; |
| 50 | cout << "sizeof Packet_Cell_Change_Failure_t " << sizeof(Packet_Cell_Change_Failure_t) << endl; |
| 51 | cout << "sizeof Packet_Control_Acknowledgement_t " << sizeof(Packet_Control_Acknowledgement_t) << endl; |
| 52 | cout << "sizeof Packet_Downlink_Ack_Nack_t " << sizeof(Packet_Downlink_Ack_Nack_t) << endl; |
| 53 | cout << "sizeof EGPRS_PD_AckNack_t " << sizeof(EGPRS_PD_AckNack_t) << endl; |
| 54 | cout << "sizeof Packet_Uplink_Dummy_Control_Block_t " << sizeof(Packet_Uplink_Dummy_Control_Block_t) << endl; |
| 55 | cout << "sizeof Packet_Measurement_Report_t " << sizeof(Packet_Measurement_Report_t) << endl; |
| 56 | cout << "sizeof Packet_Resource_Request_t " << sizeof(Packet_Resource_Request_t) << endl; |
| 57 | cout << "sizeof Packet_Mobile_TBF_Status_t " << sizeof(Packet_Mobile_TBF_Status_t) << endl; |
| 58 | cout << "sizeof Packet_PSI_Status_t " << sizeof(Packet_PSI_Status_t) << endl; |
| 59 | cout << "sizeof Packet_Enh_Measurement_Report_t " << sizeof(Packet_Enh_Measurement_Report_t) << endl; |
| 60 | cout << "sizeof Packet_Cell_Change_Notification_t " << sizeof(Packet_Cell_Change_Notification_t) << endl; |
| 61 | cout << "sizeof Packet_SI_Status_t " << sizeof(Packet_SI_Status_t) << endl; |
| 62 | cout << "sizeof Additional_MS_Rad_Access_Cap_t " << sizeof(Additional_MS_Rad_Access_Cap_t) << endl; |
| 63 | cout << "sizeof Packet_Pause_t " << sizeof(Packet_Pause_t) << endl; |
| 64 | |
| 65 | cout << "sizeof RlcMacDownlink_t " << sizeof(RlcMacDownlink_t) << endl; |
| 66 | cout << "sizeof Packet_Access_Reject_t " << sizeof(Packet_Access_Reject_t) << endl; |
Holger Hans Peter Freyther | e13298d | 2013-07-28 16:45:54 +0200 | [diff] [blame] | 67 | cout << "sizeof Packet_Cell_Change_Order_t " << sizeof(Packet_Cell_Change_Order_t) << endl; |
| 68 | cout << "sizeof Packet_Downlink_Assignment_t " << sizeof(Packet_Downlink_Assignment_t) << endl; |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 69 | cout << "sizeof Packet_Neighbour_Cell_Data_t " << sizeof(Packet_Neighbour_Cell_Data_t) << endl; |
| 70 | cout << "sizeof Packet_Serving_Cell_Data_t " << sizeof(Packet_Serving_Cell_Data_t) << endl; |
| 71 | cout << "sizeof Packet_Paging_Request_t " << sizeof(Packet_Paging_Request_t) << endl; |
| 72 | cout << "sizeof Packet_PDCH_Release_t " << sizeof(Packet_PDCH_Release_t) << endl; |
| 73 | cout << "sizeof Packet_Polling_Request_t " << sizeof(Packet_Polling_Request_t) << endl; |
| 74 | cout << "sizeof Packet_Power_Control_Timing_Advance_t " << sizeof(Packet_Power_Control_Timing_Advance_t) << endl; |
| 75 | cout << "sizeof Packet_PRACH_Parameters_t " << sizeof(Packet_PRACH_Parameters_t) << endl; |
| 76 | cout << "sizeof Packet_Queueing_Notification_t " << sizeof(Packet_Queueing_Notification_t) << endl; |
| 77 | cout << "sizeof Packet_Timeslot_Reconfigure_t " << sizeof(Packet_Timeslot_Reconfigure_t) << endl; |
| 78 | cout << "sizeof Packet_TBF_Release_t " << sizeof(Packet_TBF_Release_t) << endl; |
| 79 | cout << "sizeof Packet_Uplink_Ack_Nack_t " << sizeof(Packet_Uplink_Ack_Nack_t) << endl; |
| 80 | cout << "sizeof Packet_Uplink_Assignment_t " << sizeof(Packet_Uplink_Assignment_t) << endl; |
| 81 | cout << "sizeof Packet_Cell_Change_Continue_t " << sizeof(Packet_Cell_Change_Continue_t) << endl; |
| 82 | cout << "sizeof Packet_Handover_Command_t " << sizeof(Packet_Handover_Command_t) << endl; |
| 83 | cout << "sizeof Packet_PhysicalInformation_t " << sizeof(Packet_PhysicalInformation_t) << endl; |
| 84 | cout << "sizeof Packet_Downlink_Dummy_Control_Block_t " << sizeof(Packet_Downlink_Dummy_Control_Block_t) << endl; |
| 85 | cout << "sizeof PSI1_t " << sizeof(PSI1_t) << endl; |
| 86 | cout << "sizeof PSI2_t " << sizeof(PSI2_t) << endl; |
| 87 | cout << "sizeof PSI3_t " << sizeof(PSI3_t) << endl; |
| 88 | cout << "sizeof PSI3_BIS_t " << sizeof(PSI3_BIS_t) << endl; |
| 89 | cout << "sizeof PSI4_t " << sizeof(PSI4_t) << endl; |
| 90 | cout << "sizeof PSI13_t " << sizeof(PSI13_t) << endl; |
| 91 | cout << "sizeof PSI5_t " << sizeof(PSI5_t) << endl; |
| 92 | } |
| 93 | |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 94 | void testRlcMacDownlink(void *test_ctx) |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 95 | { |
Pau Espin Pedrol | 54681c3 | 2020-01-23 21:59:23 +0100 | [diff] [blame] | 96 | printf("*** %s ***\n", __func__); |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 97 | |
| 98 | int rc; |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 99 | struct bitvec *resultVector = bitvec_alloc(23, test_ctx); |
Max | 7426c5f | 2019-02-18 20:42:42 +0100 | [diff] [blame] | 100 | bitvec_unhex(resultVector, DUMMY_VEC); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 101 | |
| 102 | std::string testData[] = { |
| 103 | "4e082500e3f1a81d080820800b2b2b2b2b2b2b2b2b2b2b", // Packet Downlink Assignment |
Saurabh Sharan | 656eed5 | 2016-03-10 14:15:29 +0530 | [diff] [blame] | 104 | "48282407a6a07422720100032b2b2b2b2b2b2b2b2b2b2b", // Packet Uplink Assignment |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 105 | "47240c00400000000000000079eb2ac9402b2b2b2b2b2b", // Packet Uplink Ack Nack |
Saurabh Sharan | bacb65b | 2016-03-10 17:24:49 +0530 | [diff] [blame] | 106 | "47283c367513ba333004242b2b2b2b2b2b2b2b2b2b2b2b", // Packet Uplink Assignment |
| 107 | "400820001a3904df0680efb3300b2b2b2b2b2b2b2b2b2b", // Packet Downlink Assignment (EGPRS) |
Saurabh Sharan | 2b09c39 | 2016-03-16 19:17:32 +0530 | [diff] [blame] | 108 | "40284f0000001009810c826f4406809dcecb2b2b2b2b2b", // Packet Uplink Assignment (EGPRS) |
Pau Espin Pedrol | 5cb002f | 2020-01-23 23:45:17 +0100 | [diff] [blame] | 109 | "4024030f2f0000000087b0042b2b2b2b2b2b2b2b2b2b2b", // Packet Uplink Ack Nack (EGPRS) |
Vadim Yanitskiy | 9b2f7c4 | 2020-02-11 21:45:19 +0700 | [diff] [blame] | 110 | "4913e00850884013a8048b2b2b2b2b2b2b2b2b2b2b2b2b", // Polling Request (malformed) |
Pau Espin Pedrol | 5cb002f | 2020-01-23 23:45:17 +0100 | [diff] [blame] | 111 | "412430007fffffffffffffffefd19c7ba12b2b2b2b2b2b", // Packet Uplink Ack Nack? |
| 112 | "41942b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b", // System Info 13? |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 113 | }; |
| 114 | |
| 115 | int testDataSize = sizeof(testData)/sizeof(testData[0]); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 116 | |
| 117 | cout << " DOWNLINK " << endl; |
| 118 | for (int i = 0; i < testDataSize; i++) |
| 119 | { |
Pau Espin Pedrol | 87bfbe4 | 2020-01-23 23:51:34 +0100 | [diff] [blame] | 120 | cout << "vector1 = " << testData[i] << endl; |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 121 | bitvec *vector = bitvec_alloc(23, test_ctx); |
Ivan Kluchnikov | 835f91e | 2012-04-30 18:00:36 +0400 | [diff] [blame] | 122 | bitvec_unhex(vector, testData[i].c_str()); |
Pau Espin Pedrol | 87bfbe4 | 2020-01-23 23:51:34 +0100 | [diff] [blame] | 123 | |
Pau Espin Pedrol | 99c437b | 2020-01-24 12:34:50 +0100 | [diff] [blame] | 124 | RlcMacDownlink_t data; |
| 125 | memset(&data, 0, sizeof(data)); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 126 | cout << "=========Start DECODE===========" << endl; |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 127 | rc = decode_gsm_rlcmac_downlink(vector, &data); |
| 128 | cout << "+++++++++Finish DECODE ("<< rc <<")++++++++++" << endl; |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 129 | cout << "=========Start ENCODE=============" << endl; |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 130 | rc = encode_gsm_rlcmac_downlink(resultVector, &data); |
| 131 | cout << "+++++++++Finish ENCODE ("<< rc <<")+++++++++++" << endl; |
Pau Espin Pedrol | 87bfbe4 | 2020-01-23 23:51:34 +0100 | [diff] [blame] | 132 | cout << "vector1 = " << osmo_hexdump(vector->data, 23) << endl; |
| 133 | cout << "vector2 = " << osmo_hexdump(resultVector->data, 23) << endl; |
Ivan Kluchnikov | 835f91e | 2012-04-30 18:00:36 +0400 | [diff] [blame] | 134 | if (memcmp(vector->data, resultVector->data, 23) == 0) |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 135 | cout << "vector1 == vector2 : TRUE" << endl; |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 136 | else |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 137 | cout << "vector1 == vector2 : FALSE" << endl; |
Max | 7426c5f | 2019-02-18 20:42:42 +0100 | [diff] [blame] | 138 | bitvec_unhex(resultVector, DUMMY_VEC); |
Ivan Kluchnikov | 835f91e | 2012-04-30 18:00:36 +0400 | [diff] [blame] | 139 | bitvec_free(vector); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 140 | } |
Andreas Eversberg | 273a222 | 2013-01-16 08:56:33 +0100 | [diff] [blame] | 141 | |
| 142 | bitvec_free(resultVector); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 146 | void testRlcMacUplink(void *test_ctx) |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 147 | { |
Pau Espin Pedrol | 54681c3 | 2020-01-23 21:59:23 +0100 | [diff] [blame] | 148 | printf("*** %s ***\n", __func__); |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 149 | |
| 150 | int rc; |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 151 | struct bitvec *resultVector = bitvec_alloc(23, test_ctx); |
Max | 7426c5f | 2019-02-18 20:42:42 +0100 | [diff] [blame] | 152 | bitvec_unhex(resultVector, DUMMY_VEC); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 153 | |
| 154 | std::string testData[] = { |
Saurabh Sharan | 656eed5 | 2016-03-10 14:15:29 +0530 | [diff] [blame] | 155 | "400e1e61d11d2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b", // Packet Uplink Dummy Control Block |
| 156 | "400b8020000000000000002480e0032b2b2b2b2b2b2b2b", // Packet Downlink Ack/Nack |
Saurabh Sharan | bacb65b | 2016-03-10 17:24:49 +0530 | [diff] [blame] | 157 | "4016713dc094270ca2ae57ef909006aa0fc0001f80222b", // Packet Resource Request |
Vadim Yanitskiy | f22163b | 2020-03-06 06:51:48 +0700 | [diff] [blame] | 158 | "401673c87f24af2632b25964200600000091000b780080", // Packet Resource Request (from keith) |
Saurabh Sharan | bacb65b | 2016-03-10 17:24:49 +0530 | [diff] [blame] | 159 | "40200ffc0021ec010b2b2b2b2b2b2b2b2b2b2b2b2b2b2b", // EPDAN |
Pau Espin Pedrol | 5cb002f | 2020-01-23 23:45:17 +0100 | [diff] [blame] | 160 | "400a9020000000000000003010012a0800132b2b2b2b2b", // Packet Downlink Ack/Nack ? |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | int testDataSize = sizeof(testData)/sizeof(testData[0]); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 164 | |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 165 | |
| 166 | cout << " UPLINK " << endl; |
| 167 | for (int i = 0; i < testDataSize; i++) |
| 168 | { |
Pau Espin Pedrol | 87bfbe4 | 2020-01-23 23:51:34 +0100 | [diff] [blame] | 169 | cout << "vector1 = " << testData[i] << endl; |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 170 | bitvec *vector = bitvec_alloc(23, test_ctx); |
Ivan Kluchnikov | 835f91e | 2012-04-30 18:00:36 +0400 | [diff] [blame] | 171 | bitvec_unhex(vector, testData[i].c_str()); |
Pau Espin Pedrol | 87bfbe4 | 2020-01-23 23:51:34 +0100 | [diff] [blame] | 172 | |
Pau Espin Pedrol | 99c437b | 2020-01-24 12:34:50 +0100 | [diff] [blame] | 173 | RlcMacUplink_t data; |
| 174 | memset(&data, 0, sizeof(data)); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 175 | cout << "=========Start DECODE===========" << endl; |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 176 | rc = decode_gsm_rlcmac_uplink(vector, &data); |
| 177 | cout << "+++++++++Finish DECODE ("<< rc << ")++++++++++" << endl; |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 178 | cout << "=========Start ENCODE=============" << endl; |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 179 | rc = encode_gsm_rlcmac_uplink(resultVector, &data); |
| 180 | cout << "+++++++++Finish ENCODE ("<< rc <<")+++++++++++" << endl; |
Pau Espin Pedrol | 87bfbe4 | 2020-01-23 23:51:34 +0100 | [diff] [blame] | 181 | cout << "vector1 = " << osmo_hexdump(vector->data, 23) << endl; |
| 182 | cout << "vector2 = " << osmo_hexdump(resultVector->data, 23) << endl; |
Ivan Kluchnikov | 835f91e | 2012-04-30 18:00:36 +0400 | [diff] [blame] | 183 | if (memcmp(vector->data, resultVector->data, 23) == 0) |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 184 | cout << "vector1 == vector2 : TRUE" << endl; |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 185 | else |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 186 | cout << "vector1 == vector2 : FALSE" << endl; |
Max | 7426c5f | 2019-02-18 20:42:42 +0100 | [diff] [blame] | 187 | bitvec_unhex(resultVector, DUMMY_VEC); |
Ivan Kluchnikov | 835f91e | 2012-04-30 18:00:36 +0400 | [diff] [blame] | 188 | bitvec_free(vector); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 189 | } |
Andreas Eversberg | 273a222 | 2013-01-16 08:56:33 +0100 | [diff] [blame] | 190 | |
| 191 | bitvec_free(resultVector); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 192 | } |
| 193 | |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 194 | void testCsnLeftAlignedVarBmpBounds(void *test_ctx) |
Aravind Sirsikar | 9f5f008 | 2016-08-30 13:20:23 +0530 | [diff] [blame] | 195 | { |
Pau Espin Pedrol | 54681c3 | 2020-01-23 21:59:23 +0100 | [diff] [blame] | 196 | printf("*** %s ***\n", __func__); |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 197 | |
Max | d3a0d91 | 2019-03-05 16:15:01 +0100 | [diff] [blame] | 198 | struct msgb *m = msgb_alloc(80, "test"); |
| 199 | static uint8_t exp[] = { 0x7f, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 200 | bitvec *vector = bitvec_alloc(23, test_ctx); |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 201 | int rc; |
Aravind Sirsikar | 9f5f008 | 2016-08-30 13:20:23 +0530 | [diff] [blame] | 202 | |
| 203 | bitvec_unhex(vector, "40200bffd161003e0e519ffffffb800000000000000000"); |
| 204 | RlcMacUplink_t data; |
Pau Espin Pedrol | 99c437b | 2020-01-24 12:34:50 +0100 | [diff] [blame] | 205 | memset(&data, 0, sizeof(data)); |
Aravind Sirsikar | 9f5f008 | 2016-08-30 13:20:23 +0530 | [diff] [blame] | 206 | |
| 207 | EGPRS_AckNack_Desc_t *urbb = |
| 208 | &data.u.Egprs_Packet_Downlink_Ack_Nack.EGPRS_AckNack.Desc; |
Pau Espin Pedrol | 5e300ce | 2020-02-03 17:18:03 +0100 | [diff] [blame] | 209 | rc = decode_gsm_rlcmac_uplink(vector, &data); |
| 210 | OSMO_ASSERT(rc == 0); |
Aravind Sirsikar | 9f5f008 | 2016-08-30 13:20:23 +0530 | [diff] [blame] | 211 | |
Max | d3a0d91 | 2019-03-05 16:15:01 +0100 | [diff] [blame] | 212 | memcpy(msgb_put(m, 13), urbb->URBB, 13); |
| 213 | if (!msgb_eq_data_print(m, exp, 13)) |
| 214 | printf("%s failed!\n", __func__); |
| 215 | msgb_free(m); |
Aravind Sirsikar | 9f5f008 | 2016-08-30 13:20:23 +0530 | [diff] [blame] | 216 | } |
| 217 | |
Vadim Yanitskiy | b47e53b | 2020-02-20 04:33:50 +0700 | [diff] [blame] | 218 | int encode_gsm_ra_cap(bitvec * vector, MS_Radio_Access_capability_t * data); |
| 219 | |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 220 | void testRAcap(void *test_ctx) |
| 221 | { |
Pau Espin Pedrol | 866bece | 2020-03-21 01:20:52 +0100 | [diff] [blame] | 222 | printf("*** %s ***\n", __func__); |
| 223 | MS_Radio_Access_capability_t data; |
| 224 | memset(&data, 0, sizeof(data)); |
| 225 | bitvec *bv_dec = bitvec_alloc(23, test_ctx); |
| 226 | bitvec *bv_enc = bitvec_alloc(23, test_ctx); |
| 227 | unsigned int len_dec, len_enc; |
| 228 | int rc; |
| 229 | /* |
| 230 | MS RA capability 1 |
| 231 | 0001 .... = Access Technology Type: GSM E --note that GSM E covers GSM P (1) |
| 232 | .... 0011 011. .... = Length in bits: 0x1b (27) |
| 233 | ...0 01.. RF Power Capability, GMSK Power Class: Not specified (1) |
| 234 | A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (0) |
| 235 | .... ...1 = Controlled early Classmark Sending: Implemented |
| 236 | 0... .... = Pseudo Synchronisation: Not Present |
| 237 | .0.. .... = Voice Group Call Service: no VGCS capability or no notifications wanted |
| 238 | ..0. .... = Voice Broadcast Service: no VBS capability or no notifications wanted |
| 239 | ...1 .... = Multislot capability struct: Present |
| 240 | HSCSD multislot class: Bits are not available (0) |
| 241 | SMS_VALUE (Switch-Measure-Switch): Bits are not available (0) |
| 242 | ECSD multislot class: Bits are not available (0) |
| 243 | DTM GPRS Multi Slot Class: Bits are not available (0) |
| 244 | .... ..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) |
| 245 | ...0 .... = GPRS Extended Dynamic Allocation Capability: Not Implemented |
| 246 | .... ...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) |
| 247 | .... 0... = EGPRS Extended Dynamic Allocation Capability: Not Implemented |
| 248 | */ |
| 249 | bitvec_unhex(bv_dec, "1365146230"); |
| 250 | |
| 251 | printf("=== Test decoding of MS RA Capability ===\n"); |
| 252 | rc = decode_gsm_ra_cap(bv_dec, &data); |
| 253 | OSMO_ASSERT(rc == 0); |
| 254 | |
| 255 | /* Make sure there's 1 value (currently fails due to failed decoding) */ |
| 256 | OSMO_ASSERT(data.Count_MS_RA_capability_value == 1); |
| 257 | |
| 258 | /* Make sure GPRS / EGPRS multislot class is parsed correctly */ |
| 259 | printf("GPRS multislot class = %u\n", Decoding::get_ms_class_by_capability(&data)); |
| 260 | printf("EGPRS multislot class = %u\n", Decoding::get_egprs_ms_class_by_capability(&data)); |
| 261 | |
| 262 | /* Test encoding of decoded MS RA Capability */ |
| 263 | printf("=== Test encoding of MS RA Capability ===\n"); |
| 264 | rc = encode_gsm_ra_cap(bv_enc, &data); |
| 265 | printf("encode_gsm_ra_cap() returns %d\n", rc); |
| 266 | |
| 267 | bv_dec->cur_bit = 4; |
| 268 | len_dec = bitvec_get_uint(bv_dec, 7); |
| 269 | bv_enc->cur_bit = 4; |
| 270 | len_enc = bitvec_get_uint(bv_enc, 7); |
| 271 | |
| 272 | /* NOTE: vector2 is expected to be different because there is actually no |
| 273 | * way to distinguish between NULL and 0 in MS_Radio_Access_capability_t. |
| 274 | * The difference is in length indicator: 27 bits vs 65 bits. */ |
| 275 | printf("vector1 (len_ind=%u) = %s\n", len_dec, osmo_hexdump(bv_dec->data, bv_dec->data_len)); |
| 276 | printf("vector2 (len_ind=%u) = %s\n", len_enc, osmo_hexdump(bv_enc->data, bv_enc->data_len)); |
| 277 | |
| 278 | /* Mangle the length indicator (set it to 21) */ |
| 279 | unsigned int writeIndex = 4; |
| 280 | rc = bitvec_write_field(bv_dec, &writeIndex, 21, 7); |
| 281 | OSMO_ASSERT(rc == 0); |
| 282 | |
| 283 | /* Make sure decoding attempt fails */ |
| 284 | printf("=== Test decoding of a malformed vector (short length indicator) ===\n"); |
| 285 | rc = decode_gsm_ra_cap(bv_dec, &data); |
| 286 | printf("decode_gsm_ra_cap() returns %d\n", rc); |
| 287 | } |
| 288 | |
| 289 | void testMalformedRAcap(void *test_ctx) |
| 290 | { |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 291 | printf("*** %s ***\n", __func__); |
| 292 | MS_Radio_Access_capability_t data; |
| 293 | memset(&data, 0, sizeof(data)); |
Vadim Yanitskiy | b47e53b | 2020-02-20 04:33:50 +0700 | [diff] [blame] | 294 | bitvec *bv_dec = bitvec_alloc(23, test_ctx); |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 295 | int rc; |
| 296 | /* |
| 297 | MS RA capability 1 |
| 298 | 0001 .... = Access Technology Type: GSM E --note that GSM E covers GSM P (1) |
Vadim Yanitskiy | 55f06c3 | 2020-02-18 05:45:15 +0700 | [diff] [blame] | 299 | .... 0011 101. .... = Length in bits: 0x1d (29) |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 300 | ...0 01.. RF Power Capability, GMSK Power Class: Not specified (1) |
| 301 | A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (0) |
| 302 | .... ...1 = Controlled early Classmark Sending: Implemented |
| 303 | 0... .... = Pseudo Synchronisation: Not Present |
| 304 | .0.. .... = Voice Group Call Service: no VGCS capability or no notifications wanted |
| 305 | ..0. .... = Voice Broadcast Service: no VBS capability or no notifications wanted |
| 306 | ...1 .... = Multislot capability struct: Present |
| 307 | .... ..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) |
| 308 | ...0 .... = GPRS Extended Dynamic Allocation Capability: Not Implemented |
Pau Espin Pedrol | 866bece | 2020-03-21 01:20:52 +0100 | [diff] [blame] | 309 | |
| 310 | It doesn't show up in wireshark's tree above because specific parser is |
| 311 | used, but this RA Cap bitstream has Exist_EGPRS_multislot_class = 1 but |
| 312 | it provides no struct with the expected data (malformed, generated |
| 313 | erroneusly through TTCN3). The CSN.1 dceoder should ideally return an |
| 314 | error here, but it doesn't (it returns a >0 value which we convert to 0 |
| 315 | in decode_gsm_ra_cap()). |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 316 | */ |
Vadim Yanitskiy | b47e53b | 2020-02-20 04:33:50 +0700 | [diff] [blame] | 317 | bitvec_unhex(bv_dec, "13a5146200"); |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 318 | |
Vadim Yanitskiy | b47e53b | 2020-02-20 04:33:50 +0700 | [diff] [blame] | 319 | printf("=== Test decoding of MS RA Capability ===\n"); |
| 320 | rc = decode_gsm_ra_cap(bv_dec, &data); |
Pau Espin Pedrol | 866bece | 2020-03-21 01:20:52 +0100 | [diff] [blame] | 321 | printf("decode_gsm_ra_cap() returns %d\n", rc); |
Vadim Yanitskiy | 55f06c3 | 2020-02-18 05:45:15 +0700 | [diff] [blame] | 322 | OSMO_ASSERT(rc == 0); |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 323 | |
Pau Espin Pedrol | 866bece | 2020-03-21 01:20:52 +0100 | [diff] [blame] | 324 | /* For sake of completeness, check if the decoder could find 1 value |
| 325 | before failing to decode it */ |
Vadim Yanitskiy | 55f06c3 | 2020-02-18 05:45:15 +0700 | [diff] [blame] | 326 | OSMO_ASSERT(data.Count_MS_RA_capability_value == 1); |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 327 | |
Pau Espin Pedrol | 2f16924 | 2020-03-20 23:59:44 +0100 | [diff] [blame] | 328 | bitvec_free(bv_dec); |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 329 | } |
| 330 | |
Pau Espin Pedrol | efad80b | 2020-03-23 14:35:26 +0100 | [diff] [blame] | 331 | /* Reproduce crash from ticket OS#4463 */ |
| 332 | void testRAcap2(void *test_ctx) |
| 333 | { |
| 334 | printf("*** %s ***\n", __func__); |
| 335 | MS_Radio_Access_capability_t data; |
| 336 | memset(&data, 0, sizeof(data)); |
| 337 | bitvec *bv_dec = bitvec_alloc(23, test_ctx); |
| 338 | int rc; |
| 339 | /* |
| 340 | MS Radio Access Capability |
| 341 | Element ID: 0x13 |
| 342 | 1... .... = ext: 1 |
| 343 | Length: 23 |
| 344 | ------------------------------------------- Hex bitstream starts here: |
| 345 | MS RA capability 1 |
| 346 | 0001 .... = Access Technology Type: GSM E --note that GSM E covers GSM P (1) |
| 347 | .... 1001 001. .... = Length in bits: 0x49 (73) |
| 348 | ...1 00.. RF Power Capability, GMSK Power Class: 2 W (33 dBm) (4) |
| 349 | A5 Bits: A5 bits follow (1) |
| 350 | A5/1: encryption algorithm available (1) |
| 351 | A5/2: encryption algorithm not available (0) |
| 352 | A5/3: encryption algorithm available (1) |
| 353 | A5/4: encryption algorithm not available (0) |
| 354 | A5/5: encryption algorithm not available (0) |
| 355 | A5/6: encryption algorithm not available (0) |
| 356 | A5/7: encryption algorithm not available (0) |
| 357 | .... ..1. = Controlled early Classmark Sending: Implemented |
| 358 | .... ...1 = Pseudo Synchronisation: Present |
| 359 | 0... .... = Voice Group Call Service: no VGCS capability or no notifications wanted |
| 360 | .0.. .... = Voice Broadcast Service: no VBS capability or no notifications wanted |
| 361 | ..1. .... = Multislot capability struct: Present |
| 362 | HSCSD multislot class: Bits are not available (0) |
| 363 | .... 0111 = SMS_VALUE (Switch-Measure-Switch): 8/4 timeslot (~1154 microseconds) (7) |
| 364 | 0001 .... = (SM_VALUE) Switch-Measure: 2/4 timeslot (~288 microseconds) (1) |
| 365 | ECSD multislot class: Bits are not available (0) |
| 366 | .... ...0 = Single Slot DTM: Not supported |
| 367 | 1... .... = DTM EGPRS Multi Slot Class: Present |
| 368 | .... .011 00.. .... = GPRS multislot class: Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:5 Tta:2 Ttb:1 Tra:2 Trb:1 Type:1 (12) |
| 369 | ..1. .... = GPRS Extended Dynamic Allocation Capability: Implemented |
| 370 | .... ..01 100. .... = EGPRS multislot class: Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:5 Tta:2 Ttb:1 Tra:2 Trb:1 Type:1 (12) |
| 371 | ...1 .... = EGPRS Extended Dynamic Allocation Capability: Implemented |
| 372 | .... .11. = DTM GPRS Multi Slot Class: Multislot class 11 supported (3) |
| 373 | .11. .... = DTM EGPRS Multi Slot Class: Multislot class 11 supported (3) |
| 374 | ...1 .... = 8PSK Power Capability Bits: Present |
| 375 | 8PSK Power Capability: Power class E2 (2) |
| 376 | .... ..0. = COMPACT Interference Measurement Capability: Not Implemented |
| 377 | .... ...1 = Revision Level Indicator: The ME is Release '99 onwards |
| 378 | 0... .... = UMTS FDD Radio Access Technology Capability: Not supported |
| 379 | .0.. .... = UMTS 3.84 Mcps TDD Radio Access Technology Capability: Not supported |
| 380 | ..0. .... = CDMA 2000 Radio Access Technology Capability: Not supported |
| 381 | ...0 .... = UMTS 1.28 Mcps TDD Radio Access Technology Capability: Not supported |
| 382 | .... 1... = GERAN Feature Package 1: Supported |
| 383 | Extended DTM EGPRS Multi Slot Class: Bits are not available (0) |
| 384 | .... ..0. = Modulation based multislot class support: Not supported |
| 385 | High Multislot Capability: Bits are not available (0) |
| 386 | 0... .... = GERAN Iu mode: Not supported |
| 387 | GMSK Multislot Power Profile: GMSK_MULTISLOT_POWER_PROFILE 3 (3) |
| 388 | 8-PSK Multislot Power Profile: 8-PSK_MULTISLOT_POWER_PROFILE 3 (3) |
| 389 | .... .0.. = Multiple TBF Capability: Not supported |
| 390 | .... ..01 = Downlink Advanced Receiver Performance: Downlink Advanced Receiver Performance - phase I supported (1) |
| 391 | 1... .... = Extended RLC/MAC Control Message Segmentation Capability: Supported |
| 392 | .1.. .... = DTM Enhancements Capability: The mobile station supports enhanced DTM CS establishment and enhanced DTM CS release procedures |
| 393 | ...0 .... = PS Handover Capability: Not supported |
| 394 | MS RA capability 2 |
| 395 | .... .011 1... .... = Access Technology Type: GSM 850 (7) |
| 396 | .010 0010 = Length in bits: 0x22 (34) |
| 397 | 100. .... RF Power Capability, GMSK Power Class: 2 W (33 dBm) (4) |
| 398 | A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (0) |
| 399 | .... 1... = Controlled early Classmark Sending: Implemented |
| 400 | .... .1.. = Pseudo Synchronisation: Present |
| 401 | .... ..0. = Voice Group Call Service: no VGCS capability or no notifications wanted |
| 402 | .... ...0 = Voice Broadcast Service: no VBS capability or no notifications wanted |
| 403 | 0... .... = Multislot capability struct: Not Present |
| 404 | .1.. .... = 8PSK Power Capability Bits: Present |
| 405 | 8PSK Power Capability: Power class E2 (2) |
| 406 | .... 0... = COMPACT Interference Measurement Capability: Not Implemented |
| 407 | .... .1.. = Revision Level Indicator: The ME is Release '99 onwards |
| 408 | .... ..0. = UMTS FDD Radio Access Technology Capability: Not supported |
| 409 | .... ...0 = UMTS 3.84 Mcps TDD Radio Access Technology Capability: Not supported |
| 410 | 0... .... = CDMA 2000 Radio Access Technology Capability: Not supported |
| 411 | .0.. .... = UMTS 1.28 Mcps TDD Radio Access Technology Capability: Not supported |
| 412 | ..1. .... = GERAN Feature Package 1: Supported |
| 413 | Extended DTM EGPRS Multi Slot Class: Bits are not available (0) |
| 414 | .... 0... = Modulation based multislot class support: Not supported |
| 415 | High Multislot Capability: Bits are not available (0) |
| 416 | .... ..0. = GERAN Iu mode: Not supported |
| 417 | GMSK Multislot Power Profile: GMSK_MULTISLOT_POWER_PROFILE 3 (3) |
| 418 | 8-PSK Multislot Power Profile: 8-PSK_MULTISLOT_POWER_PROFILE 3 (3) |
| 419 | ...0 .... = Multiple TBF Capability: Not supported |
| 420 | .... 01.. = Downlink Advanced Receiver Performance: Downlink Advanced Receiver Performance - phase I supported (1) |
| 421 | .... ..1. = Extended RLC/MAC Control Message Segmentation Capability: Supported |
| 422 | .... ...1 = DTM Enhancements Capability: The mobile station supports enhanced DTM CS establishment and enhanced DTM CS release procedures |
| 423 | .0.. .... = PS Handover Capability: Not supported |
| 424 | MS RA capability 3 |
| 425 | ...0 011. = Access Technology Type: GSM 1800 (3) |
| 426 | .... ...0 1000 10.. = Length in bits: 0x22 (34) |
| 427 | .... ..00 1... .... RF Power Capability, GMSK Power Class: 1 W (30 dBm) (1) |
| 428 | A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (0) |
| 429 | ..1. .... = Controlled early Classmark Sending: Implemented |
| 430 | ...1 .... = Pseudo Synchronisation: Present |
| 431 | .... 0... = Voice Group Call Service: no VGCS capability or no notifications wanted |
| 432 | .... .0.. = Voice Broadcast Service: no VBS capability or no notifications wanted |
| 433 | .... ..0. = Multislot capability struct: Not Present |
| 434 | .... ...1 = 8PSK Power Capability Bits: Present |
| 435 | 8PSK Power Capability: Power class E2 (2) |
| 436 | ..0. .... = COMPACT Interference Measurement Capability: Not Implemented |
| 437 | ...1 .... = Revision Level Indicator: The ME is Release '99 onwards |
| 438 | .... 0... = UMTS FDD Radio Access Technology Capability: Not supported |
| 439 | .... .0.. = UMTS 3.84 Mcps TDD Radio Access Technology Capability: Not supported |
| 440 | .... ..0. = CDMA 2000 Radio Access Technology Capability: Not supported |
| 441 | .... ...0 = UMTS 1.28 Mcps TDD Radio Access Technology Capability: Not supported |
| 442 | 1... .... = GERAN Feature Package 1: Supported |
| 443 | Extended DTM EGPRS Multi Slot Class: Bits are not available (0) |
| 444 | ..0. .... = Modulation based multislot class support: Not supported |
| 445 | High Multislot Capability: Bits are not available (0) |
| 446 | .... 0... = GERAN Iu mode: Not supported |
| 447 | GMSK Multislot Power Profile: GMSK_MULTISLOT_POWER_PROFILE 3 (3) |
| 448 | 8-PSK Multislot Power Profile: 8-PSK_MULTISLOT_POWER_PROFILE 3 (3) |
| 449 | .0.. .... = Multiple TBF Capability: Not supported |
| 450 | ..01 .... = Downlink Advanced Receiver Performance: Downlink Advanced Receiver Performance - phase I supported (1) |
| 451 | .... 1... = Extended RLC/MAC Control Message Segmentation Capability: Supported |
| 452 | .... .1.. = DTM Enhancements Capability: The mobile station supports enhanced DTM CS establishment and enhanced DTM CS release procedures |
| 453 | .... ...0 = PS Handover Capability: Not supported |
| 454 | */ |
| 455 | bitvec_unhex(bv_dec, "1933432b37159ef90879cba28c6421e72688b190879c00"); |
| 456 | |
| 457 | printf("=== Test decoding of multi-band MS RA Capability ===\n"); |
| 458 | rc = decode_gsm_ra_cap(bv_dec, &data); |
Pau Espin Pedrol | 7faa5da | 2020-03-21 00:13:33 +0100 | [diff] [blame] | 459 | printf("decode_gsm_ra_cap() returns %d\n", rc); |
| 460 | OSMO_ASSERT(rc == 0); |
| 461 | |
| 462 | /* Make sure there's 3 values */ |
Pau Espin Pedrol | efad80b | 2020-03-23 14:35:26 +0100 | [diff] [blame] | 463 | OSMO_ASSERT(data.Count_MS_RA_capability_value == 3); |
| 464 | |
| 465 | /* Make sure GPRS / EGPRS multislot class is parsed correctly */ |
| 466 | printf("GPRS multislot class = %u\n", Decoding::get_ms_class_by_capability(&data)); |
| 467 | printf("EGPRS multislot class = %u\n", Decoding::get_egprs_ms_class_by_capability(&data)); |
Pau Espin Pedrol | 7faa5da | 2020-03-21 00:13:33 +0100 | [diff] [blame] | 468 | |
Pau Espin Pedrol | efad80b | 2020-03-23 14:35:26 +0100 | [diff] [blame] | 469 | bitvec_free(bv_dec); |
| 470 | } |
| 471 | |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 472 | int main(int argc, char *argv[]) |
| 473 | { |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 474 | void *ctx = talloc_named_const(NULL, 1, "RLCMACTest"); |
Neels Hofmeyr | 42f2d61 | 2018-04-01 16:54:40 +0200 | [diff] [blame] | 475 | osmo_init_logging2(ctx, &gprs_log_info); |
Harald Welte | 570f913 | 2020-03-19 15:03:01 +0100 | [diff] [blame] | 476 | log_parse_category_mask(osmo_stderr_target, "DPCU,3:DLGLOBAL,1:DRLCMACDATA,2:DCSN1,1:"); |
Vadim Yanitskiy | 8a87f91 | 2020-02-17 01:19:10 +0700 | [diff] [blame] | 477 | |
| 478 | log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); |
| 479 | log_set_print_category_hex(osmo_stderr_target, 0); |
| 480 | log_set_print_category(osmo_stderr_target, 1); |
| 481 | log_set_print_level(osmo_stderr_target, 1); |
| 482 | log_set_use_color(osmo_stderr_target, 0); |
Andreas Eversberg | 138f4e6 | 2013-01-14 12:31:11 +0100 | [diff] [blame] | 483 | |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 484 | //printSizeofRLCMAC(); |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 485 | testRlcMacDownlink(ctx); |
| 486 | testRlcMacUplink(ctx); |
| 487 | testCsnLeftAlignedVarBmpBounds(ctx); |
Pau Espin Pedrol | cdbc5db | 2020-01-23 21:00:19 +0100 | [diff] [blame] | 488 | testRAcap(ctx); |
Pau Espin Pedrol | 866bece | 2020-03-21 01:20:52 +0100 | [diff] [blame] | 489 | testMalformedRAcap(ctx); |
Pau Espin Pedrol | efad80b | 2020-03-23 14:35:26 +0100 | [diff] [blame] | 490 | testRAcap2(ctx); |
Alexander Couzens | ccde5c9 | 2017-02-04 03:10:08 +0100 | [diff] [blame] | 491 | talloc_free(ctx); |
Ivan Kluchnikov | 487a141 | 2011-12-21 13:17:53 +0300 | [diff] [blame] | 492 | } |