blob: b966865d7b0f861b1aa16b9a4dec8d9a407dc7b2 [file] [log] [blame]
Harald Weltec8a0b932012-08-24 21:27:26 +02001Test `CSD 9600/V.110/transparent' passed
2Test `Speech, all codecs' passed
Vadim Yanitskiy95fc8ea2022-07-03 05:41:02 +07003Test `Speech, without octet 3a' failed
Holger Hans Peter Freythercd252e32013-07-03 09:56:53 +02004Simple TMSI encoding test....passed
Maxd55d7d42018-02-15 11:27:18 +01005Simple IMSI encoding test....passed: [10] 17 08 99 10 07 00 00 00 64 02
Neels Hofmeyr49686282018-12-05 21:32:21 +01006
7Testing Mobile Identity conversions
8- IMSI 123456789012345
9 -> MI-TLV-hex='17081932547698103254'
10 -> MI-str="123456789012345" rc=16
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010011 -> MI-name="IMSI-123456789012345"
Neels Hofmeyr49686282018-12-05 21:32:21 +010012- IMSI 12345678901234
13 -> MI-TLV-hex='170811325476981032f4'
14 -> MI-str="12345678901234" rc=15
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010015 -> MI-name="IMSI-12345678901234"
Neels Hofmeyr49686282018-12-05 21:32:21 +010016- IMSI 423423
17 -> MI-TLV-hex='1704413224f3'
18 -> MI-str="423423" rc=7
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010019 -> MI-name="IMSI-423423"
Neels Hofmeyr49686282018-12-05 21:32:21 +010020- unknown 0x9 423423
Harald Weltea13fb752020-06-16 08:44:42 +020021 -> MI-TLV-hex='1704413224f3'
22 -> MI-str="423423" rc=7
23 -> MI-name="IMSI-423423"
Neels Hofmeyr49686282018-12-05 21:32:21 +010024- IMSI 4234235
25 -> MI-TLV-hex='170449322453'
26 -> MI-str="4234235" rc=8
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010027 -> MI-name="IMSI-4234235"
Neels Hofmeyr49686282018-12-05 21:32:21 +010028- IMSI 4234235
29 -> MI-TLV-hex='170449322453'
Neels Hofmeyr627e0112018-12-05 21:32:40 +010030 -> MI-str="423" rc=4
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010031 -> MI-name="IMSI-4234235"
Neels Hofmeyr49686282018-12-05 21:32:21 +010032- IMEI 123456789012345
33 -> MI-TLV-hex='17081a32547698103254'
34 -> MI-str="123456789012345" rc=16
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010035 -> MI-name="IMEI-123456789012345"
Neels Hofmeyr49686282018-12-05 21:32:21 +010036- IMEI 98765432109876
37 -> MI-TLV-hex='170892785634129078f6'
38 -> MI-str="98765432109876" rc=15
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010039 -> MI-name="IMEI-98765432109876"
Neels Hofmeyr49686282018-12-05 21:32:21 +010040- IMEI 987654321098765
41 -> MI-TLV-hex='17089a78563412907856'
42 -> MI-str="987654321098765" rc=16
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010043 -> MI-name="IMEI-987654321098765"
Harald Welte13177712019-01-20 13:41:26 +010044- IMEI-SV 9876543210987654
45 -> MI-TLV-hex='17099378563412907856f4'
46 -> MI-str="9876543210987654" rc=17
47 -> MI-name="IMEI-SV-9876543210987654"
48- IMEI-SV 9876543210987654
49 -> MI-TLV-hex='17099378563412907856f4'
50 -> MI-str="9876543210987654" rc=17
51 -> MI-name="IMEI-SV-9876543210987654"
Neels Hofmeyr49686282018-12-05 21:32:21 +010052- TMSI 305419896
53 -> MI-TLV-hex='1705f412345678'
54 -> MI-str="305419896" rc=9
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010055 -> MI-name="TMSI-0x12345678"
Neels Hofmeyr49686282018-12-05 21:32:21 +010056- TMSI 12648430
57 -> MI-TLV-hex='1705f400c0ffee'
58 -> MI-str="12648430" rc=8
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010059 -> MI-name="TMSI-0x00C0FFEE"
Neels Hofmeyr49686282018-12-05 21:32:21 +010060- TMSI 0
61 -> MI-TLV-hex='1705f400000000'
62 -> MI-str="0" rc=1
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010063 -> MI-name="TMSI-0x00000000"
Neels Hofmeyr49686282018-12-05 21:32:21 +010064- TMSI 305419896
65 -> MI-TLV-hex='1705f412345678'
66 -> MI-str="3054" rc=9
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010067 -> MI-name="TMSI-0x12345678"
Neels Hofmeyr49686282018-12-05 21:32:21 +010068- NONE 123
Harald Weltea13fb752020-06-16 08:44:42 +020069 -> MI-TLV-hex='17021832'
Neels Hofmeyr49686282018-12-05 21:32:21 +010070 -> MI-str="" rc=1
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010071 -> MI-name="unknown"
Neels Hofmeyr49686282018-12-05 21:32:21 +010072- NONE 1234
Harald Weltea13fb752020-06-16 08:44:42 +020073 -> MI-TLV-hex='17031032f4'
Neels Hofmeyr49686282018-12-05 21:32:21 +010074 -> MI-str="" rc=1
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010075 -> MI-name="unknown"
Neels Hofmeyr49686282018-12-05 21:32:21 +010076- unknown 0x8 1234
Harald Weltea13fb752020-06-16 08:44:42 +020077 -> MI-TLV-hex='17031032f4'
Neels Hofmeyr49686282018-12-05 21:32:21 +010078 -> MI-str="" rc=1
Neels Hofmeyr02fd83d2019-01-05 00:38:54 +010079 -> MI-name="unknown"
Neels Hofmeyr49686282018-12-05 21:32:21 +010080
81Decoding zero length Mobile Identities
82- MI type: IMSI
83 - writing to zero-length string:
Neels Hofmeyr627e0112018-12-05 21:32:40 +010084 rc=0
85 nothing written
Neels Hofmeyr49686282018-12-05 21:32:21 +010086 - writing to 1-byte-length string:
87 rc=1
Neels Hofmeyr627e0112018-12-05 21:32:40 +010088 returned empty string
Neels Hofmeyr49686282018-12-05 21:32:21 +010089 - decode zero-length mi:
Neels Hofmeyr627e0112018-12-05 21:32:40 +010090 rc=1
91 returned empty string
Neels Hofmeyr49686282018-12-05 21:32:21 +010092- MI type: TMSI
93 - writing to zero-length string:
Neels Hofmeyrea2a0ab2018-12-05 23:30:08 +010094 rc=0
95 nothing written
Neels Hofmeyr49686282018-12-05 21:32:21 +010096 - writing to 1-byte-length string:
97 rc=1
98 returned empty string
99 - decode zero-length mi:
100 rc=1
101 returned empty string
102- MI type: NONE
103 - writing to zero-length string:
Neels Hofmeyrea2a0ab2018-12-05 23:30:08 +0100104 rc=0
105 nothing written
Neels Hofmeyr49686282018-12-05 21:32:21 +0100106 - writing to 1-byte-length string:
107 rc=1
108 returned empty string
109 - decode zero-length mi:
110 rc=1
111 returned empty string
112- MI type: IMSI | GSM_MI_ODD
113 - writing to zero-length string:
Neels Hofmeyr627e0112018-12-05 21:32:40 +0100114 rc=0
115 nothing written
Neels Hofmeyr49686282018-12-05 21:32:21 +0100116 - writing to 1-byte-length string:
117 rc=1
Neels Hofmeyr627e0112018-12-05 21:32:40 +0100118 returned empty string
Neels Hofmeyr49686282018-12-05 21:32:21 +0100119 - decode zero-length mi:
Neels Hofmeyr627e0112018-12-05 21:32:40 +0100120 rc=1
121 returned empty string
Neels Hofmeyr49686282018-12-05 21:32:21 +0100122- MI type: TMSI | GSM_MI_ODD
123 - writing to zero-length string:
Neels Hofmeyrea2a0ab2018-12-05 23:30:08 +0100124 rc=0
125 nothing written
Neels Hofmeyr49686282018-12-05 21:32:21 +0100126 - writing to 1-byte-length string:
127 rc=1
128 returned empty string
129 - decode zero-length mi:
130 rc=1
131 returned empty string
132- MI type: NONE | GSM_MI_ODD
133 - writing to zero-length string:
Neels Hofmeyrea2a0ab2018-12-05 23:30:08 +0100134 rc=0
135 nothing written
Neels Hofmeyr49686282018-12-05 21:32:21 +0100136 - writing to 1-byte-length string:
137 rc=1
138 returned empty string
139 - decode zero-length mi:
140 rc=1
141 returned empty string
142
Neels Hofmeyr83025bf2020-05-26 02:45:23 +0200143test_struct_mobile_identity()
Neels Hofmeyra7f97b92022-08-23 18:35:40 +0200144LU with IMSI 901700000004620: rc == 0, mi = IMSI-901700000004620 ok
145LU with TMSI 0x0980ad8a: rc == 0, mi = TMSI-0x0980AD8A ok
146LU with invalid MI type: rc != 0 ok
147LU with truncated IMSI MI: rc != 0 ok
148LU with too short IMSI MI (12345): rc != 0 ok
149LU with just long enough IMSI MI 123456: rc == 0, mi = IMSI-123456 ok
150LU with max length IMSI MI 123456789012345: rc == 0, mi = IMSI-123456789012345 ok
151LU with just too long IMSI MI 1234567890123456: rc != 0 ok
152LU with truncated TMSI MI: rc != 0 ok
153LU with odd length TMSI: rc != 0 ok
154LU with too long TMSI MI: rc != 0 ok
155LU with too short TMSI: rc != 0 ok
156CM Service Request with IMSI 123456: rc == 0, mi = IMSI-123456 ok
157CM Service Request with TMSI 0x5a42e404: rc == 0, mi = TMSI-0x5A42E404 ok
158CM Service Request with shorter CM2, with IMSI 123456: rc == 0, mi = IMSI-123456 ok
159CM Service Request with longer CM2, with IMSI 123456: rc == 0, mi = IMSI-123456 ok
160CM Service Request with shorter CM2, with TMSI 0x00000000: rc == 0, mi = TMSI-0x00000000 ok
161CM Service Request with invalid MI type: rc != 0 ok
162CM Service Request with truncated IMSI MI: rc != 0 ok
163CM Service Request with truncated TMSI MI: rc != 0 ok
164CM Service Request with odd length TMSI: rc != 0 ok
165CM Service Request with too long TMSI MI: rc != 0 ok
166CM Service Request with too short TMSI: rc != 0 ok
167CM Service Reestablish Request with TMSI 0x5a42e404: rc == 0, mi = TMSI-0x5A42E404 ok
168Paging Response with IMSI 1234567: rc == 0, mi = IMSI-1234567 ok
169Paging Response with TMSI 0xb48883de: rc == 0, mi = TMSI-0xB48883DE ok
170Paging Response with TMSI, with unused nibble not 0xf: rc != 0 ok
171Paging Response with too short IMEI (1234567): rc != 0 ok
172Paging Response with IMEI 123456789012345: rc == 0, mi = IMEI-123456789012345 ok
173Paging Response with IMEI 12345678901234 (no Luhn checksum): rc == 0, mi = IMEI-12345678901234 ok
174Paging Response with IMEISV 1234567890123456: rc == 0, mi = IMEI-SV-1234567890123456 ok
175Paging Response with too short IMEISV 123456789012345: rc != 0 ok
176Paging Response with too long IMEISV 12345678901234567: rc != 0 ok
177Paging Response with IMSI 123456789012345 and flipped ODD bit: rc != 0 ok
178IMSI-Detach with IMSI 901700000004620: rc == 0, mi = IMSI-901700000004620 ok
179IMSI-Detach with TMSI 0x0980ad8a: rc == 0, mi = TMSI-0x0980AD8A ok
180IMSI-Detach with invalid MI type: rc != 0 ok
181IMSI-Detach with truncated IMSI MI: rc != 0 ok
182IMSI-Detach with too short IMSI MI (12345): rc != 0 ok
183IMSI-Detach with just long enough IMSI MI 123456: rc == 0, mi = IMSI-123456 ok
184IMSI-Detach with max length IMSI MI 123456789012345: rc == 0, mi = IMSI-123456789012345 ok
185IMSI-Detach with just too long IMSI MI 1234567890123456: rc != 0 ok
186IMSI-Detach with truncated TMSI MI: rc != 0 ok
187IMSI-Detach with odd length TMSI: rc != 0 ok
188IMSI-Detach with too long TMSI MI: rc != 0 ok
189IMSI-Detach with too short TMSI: rc != 0 ok
190Identity Response with IMSI 901700000004620: rc == 0, mi = IMSI-901700000004620 ok
191Identity Response with IMEI 123456789012345: rc == 0, mi = IMEI-123456789012345 ok
192Identity Response with IMEISV 9876543210987654: rc == 0, mi = IMEI-SV-9876543210987654 ok
Neels Hofmeyr83025bf2020-05-26 02:45:23 +0200193
Vadim Yanitskiyaa0683d2019-05-25 23:14:00 +0700194BSD number encoding / decoding test
195- Running test: regular 9-digit MSISDN
196 - Encoding ASCII (buffer limit=0) '123456789'...
197 - Expected: (rc=6) '0521436587f9'
198 - Actual: (rc=6) '0521436587f9'
199 - Decoding HEX (buffer limit=0) '0521436587f9'...
200 - Expected: (rc=0) '123456789'
201 - Actual: (rc=0) '123456789'
202- Running test: regular 6-digit MSISDN with optional header (LHV)
203 - Encoding ASCII (buffer limit=0) '123456'...
Vadim Yanitskiy1dc82642019-05-27 00:53:54 +0700204 - Expected: (rc=8) '07ffffffff214365'
205 - Actual: (rc=8) '07ffffffff214365'
Vadim Yanitskiyaa0683d2019-05-25 23:14:00 +0700206 - Decoding HEX (buffer limit=0) '07deadbeef214365'...
207 - Expected: (rc=0) '123456'
208 - Actual: (rc=0) '123456'
209- Running test: long 15-digit (maximum) MSISDN
210 - Encoding ASCII (buffer limit=0) '123456789012345'...
211 - Expected: (rc=9) '0821436587092143f5'
212 - Actual: (rc=9) '0821436587092143f5'
213 - Decoding HEX (buffer limit=0) '0821436587092143f5'...
214 - Expected: (rc=0) '123456789012345'
215 - Actual: (rc=0) '123456789012345'
216- Running test: long 15-digit (maximum) MSISDN, limited buffer
217 - Encoding ASCII (buffer limit=9) '123456789012345'...
218 - Expected: (rc=9) '0821436587092143f5'
219 - Actual: (rc=9) '0821436587092143f5'
220 - Decoding HEX (buffer limit=16) '0821436587092143f5'...
221 - Expected: (rc=0) '123456789012345'
Vadim Yanitskiy2cd1dda2019-05-26 00:14:16 +0700222 - Actual: (rc=0) '123456789012345'
Vadim Yanitskiyaa0683d2019-05-25 23:14:00 +0700223- Running test: to be truncated 20-digit MSISDN
224 - Encoding ASCII (buffer limit=9) '12345678901234567890'...
225 - Expected: (rc=-5) ''
226 - Actual: (rc=-5) ''
227 - Decoding HEX (buffer limit=16) '0a21436587092143658709'...
Vadim Yanitskiy71940872019-05-26 00:49:57 +0700228 - Expected: (rc=-28) '123456789012345'
229 - Actual: (rc=-28) '123456789012345'
Vadim Yanitskiyaa0683d2019-05-25 23:14:00 +0700230- Running test: LV incorrect length
231 - Decoding HEX (buffer limit=0) '05214365'...
Vadim Yanitskiye4799f52019-05-26 00:55:20 +0700232 - Expected: (rc=-22) '(none)'
233 - Actual: (rc=-22) '(none)'
Vadim Yanitskiyaa0683d2019-05-25 23:14:00 +0700234- Running test: empty input buffer
235 - Encoding ASCII (buffer limit=0) ''...
236 - Expected: (rc=1) '00'
237 - Actual: (rc=1) '00'
238 - Decoding HEX (buffer limit=0) ''...
239 - Expected: (rc=-5) '(none)'
240 - Actual: (rc=-5) '(none)'
Oliver Smith186f8782019-06-06 16:11:32 +0200241- Running test: decoding buffer is one byte too small (OS#4049)
242 - Decoding HEX (buffer limit=4) '022143'...
243 - Expected: (rc=-28) '123'
244 - Actual: (rc=-28) '123'
Vadim Yanitskiyaa0683d2019-05-25 23:14:00 +0700245
Maxf1ad60e2018-01-05 14:19:33 +0100246Constructed RA:
Neels Hofmeyrc38b32d2018-02-20 15:13:18 +0100247077-121-666-5
248MCC+MNC in BCD: 70 17 21
Neels Hofmeyrdbb25132018-02-20 15:12:23 +0100249077-121-666-5 (3-digit MNC)
Max99377c22017-08-30 19:17:50 +0200250RA test...passed
Maxf1ad60e2018-01-05 14:19:33 +0100251Constructed RA:
Neels Hofmeyrc38b32d2018-02-20 15:13:18 +0100252084-98-11-89
253MCC+MNC in BCD: 80 f4 89
254084-98-11-89
Max99377c22017-08-30 19:17:50 +0200255RA test...passed
Neels Hofmeyrb9fd7eb2018-02-20 15:14:03 +0100256Constructed RA:
257000-00-0-0
258MCC+MNC in BCD: 00 f0 00
259000-00-0-0
260RA test...passed
261Constructed RA:
Neels Hofmeyr6c7b3e22018-02-20 22:20:42 +0100262000-000-0-0 (3-digit MNC)
263MCC+MNC in BCD: 00 00 00
264000-000-0-0 (3-digit MNC)
265RA test...passed
266Constructed RA:
Neels Hofmeyrb9fd7eb2018-02-20 15:14:03 +0100267999-999-65535-255
268MCC+MNC in BCD: 99 99 99
Neels Hofmeyrdbb25132018-02-20 15:12:23 +0100269999-999-65535-255 (3-digit MNC)
Neels Hofmeyrb9fd7eb2018-02-20 15:14:03 +0100270RA test...passed
Neels Hofmeyr6c7b3e22018-02-20 22:20:42 +0100271Constructed RA:
272001-02-23-42
273MCC+MNC in BCD: 00 f1 20
274001-02-23-42
275RA test...passed
276Constructed RA:
277001-002-23-42 (3-digit MNC)
278MCC+MNC in BCD: 00 21 00
279001-002-23-42 (3-digit MNC)
280RA test...passed
281Constructed RA:
282012-34-56-78
283MCC+MNC in BCD: 10 f2 43
284012-34-56-78
285RA test...passed
286Constructed RA:
287012-034-23-42 (3-digit MNC)
288MCC+MNC in BCD: 10 42 30
289012-034-23-42 (3-digit MNC)
290RA test...passed
291Constructed RA:
292123-456-23-42
293MCC+MNC in BCD: 21 63 54
294123-456-23-42 (3-digit MNC)
295RA test...passed
296Constructed RA:
297123-456-23-42 (3-digit MNC)
298MCC+MNC in BCD: 21 63 54
299123-456-23-42 (3-digit MNC)
300RA test...passed
Neels Hofmeyrd5a577b2018-02-20 21:48:07 +0100301- gsm48_generate_lai() from 077-121-666-0
302 Encoded 70 17 21 02 9a
303 gsm48_decode_lai() gives 077-121-666-0
304 passed
Neels Hofmeyr4566f4e2018-02-20 22:19:56 +0100305- gsm48_generate_lai2() from 077-121-666
306 Encoded 70 17 21 02 9a
307 gsm48_decode_lai2() gives 077-121-666 (3-digit MNC)
308 passed
Neels Hofmeyrd5a577b2018-02-20 21:48:07 +0100309- gsm48_generate_lai() from 084-98-11-0
310 Encoded 80 f4 89 00 0b
311 gsm48_decode_lai() gives 084-98-11-0
312 passed
Neels Hofmeyr4566f4e2018-02-20 22:19:56 +0100313- gsm48_generate_lai2() from 084-98-11
314 Encoded 80 f4 89 00 0b
315 gsm48_decode_lai2() gives 084-98-11
316 passed
Neels Hofmeyrd5a577b2018-02-20 21:48:07 +0100317- gsm48_generate_lai() from 000-00-0-0
318 Encoded 00 f0 00 00 00
319 gsm48_decode_lai() gives 000-00-0-0
320 passed
Neels Hofmeyr4566f4e2018-02-20 22:19:56 +0100321- gsm48_generate_lai2() from 000-00-0
322 Encoded 00 f0 00 00 00
323 gsm48_decode_lai2() gives 000-00-0
324 passed
Neels Hofmeyr6c7b3e22018-02-20 22:20:42 +0100325- gsm48_generate_lai() from 000-000-0-0 (3-digit MNC)
326 Encoded 00 f0 00 00 00
327 gsm48_decode_lai() gives 000-00-0-0
328 passed
329- gsm48_generate_lai2() from 000-000-0 (3-digit MNC)
330 Encoded 00 00 00 00 00
331 gsm48_decode_lai2() gives 000-000-0 (3-digit MNC)
332 passed
Neels Hofmeyrd5a577b2018-02-20 21:48:07 +0100333- gsm48_generate_lai() from 999-999-65535-0
334 Encoded 99 99 99 ff ff
335 gsm48_decode_lai() gives 999-999-65535-0
336 passed
Neels Hofmeyr4566f4e2018-02-20 22:19:56 +0100337- gsm48_generate_lai2() from 999-999-65535
338 Encoded 99 99 99 ff ff
339 gsm48_decode_lai2() gives 999-999-65535 (3-digit MNC)
340 passed
Neels Hofmeyr6c7b3e22018-02-20 22:20:42 +0100341- gsm48_generate_lai() from 001-02-23-0
342 Encoded 00 f1 20 00 17
343 gsm48_decode_lai() gives 001-02-23-0
344 passed
345- gsm48_generate_lai2() from 001-02-23
346 Encoded 00 f1 20 00 17
347 gsm48_decode_lai2() gives 001-02-23
348 passed
349- gsm48_generate_lai() from 001-002-23-0 (3-digit MNC)
350 Encoded 00 f1 20 00 17
351 gsm48_decode_lai() gives 001-02-23-0
352 passed
353- gsm48_generate_lai2() from 001-002-23 (3-digit MNC)
354 Encoded 00 21 00 00 17
355 gsm48_decode_lai2() gives 001-002-23 (3-digit MNC)
356 passed
357- gsm48_generate_lai() from 012-34-56-0
358 Encoded 10 f2 43 00 38
359 gsm48_decode_lai() gives 012-34-56-0
360 passed
361- gsm48_generate_lai2() from 012-34-56
362 Encoded 10 f2 43 00 38
363 gsm48_decode_lai2() gives 012-34-56
364 passed
365- gsm48_generate_lai() from 012-034-23-0 (3-digit MNC)
366 Encoded 10 f2 43 00 17
367 gsm48_decode_lai() gives 012-34-23-0
368 passed
369- gsm48_generate_lai2() from 012-034-23 (3-digit MNC)
370 Encoded 10 42 30 00 17
371 gsm48_decode_lai2() gives 012-034-23 (3-digit MNC)
372 passed
373- gsm48_generate_lai() from 123-456-23-0
374 Encoded 21 63 54 00 17
375 gsm48_decode_lai() gives 123-456-23-0
376 passed
377- gsm48_generate_lai2() from 123-456-23
378 Encoded 21 63 54 00 17
379 gsm48_decode_lai2() gives 123-456-23 (3-digit MNC)
380 passed
381- gsm48_generate_lai() from 123-456-23-0 (3-digit MNC)
382 Encoded 21 63 54 00 17
383 gsm48_decode_lai() gives 123-456-23-0
384 passed
385- gsm48_generate_lai2() from 123-456-23 (3-digit MNC)
386 Encoded 21 63 54 00 17
387 gsm48_decode_lai2() gives 123-456-23 (3-digit MNC)
388 passed
Neels Hofmeyr8d423942023-06-08 00:35:41 +0200389==test_osmo_routing_area_id()==
390RA ID: 077-121-666-5osmo_routing_area_id_encode_buf(): 70 17 21 02 9a 05 rc=6
391osmo_routing_area_id_decode(): 077-121-666-5 (3-digit MNC) rc=6
392ok
393RA ID: 084-98-11-89osmo_routing_area_id_encode_buf(): 80 f4 89 00 0b 59 rc=6
394osmo_routing_area_id_decode(): 084-98-11-89 rc=6
395ok
396RA ID: 000-00-0-0osmo_routing_area_id_encode_buf(): 00 f0 00 00 00 00 rc=6
397osmo_routing_area_id_decode(): 000-00-0-0 rc=6
398ok
399RA ID: 000-000-0-0 (3-digit MNC)osmo_routing_area_id_encode_buf(): 00 00 00 00 00 00 rc=6
400osmo_routing_area_id_decode(): 000-000-0-0 (3-digit MNC) rc=6
401ok
402RA ID: 999-999-65535-255osmo_routing_area_id_encode_buf(): 99 99 99 ff ff ff rc=6
403osmo_routing_area_id_decode(): 999-999-65535-255 (3-digit MNC) rc=6
404ok
405RA ID: 001-02-23-42osmo_routing_area_id_encode_buf(): 00 f1 20 00 17 2a rc=6
406osmo_routing_area_id_decode(): 001-02-23-42 rc=6
407ok
408RA ID: 001-002-23-42 (3-digit MNC)osmo_routing_area_id_encode_buf(): 00 21 00 00 17 2a rc=6
409osmo_routing_area_id_decode(): 001-002-23-42 (3-digit MNC) rc=6
410ok
411RA ID: 012-34-56-78osmo_routing_area_id_encode_buf(): 10 f2 43 00 38 4e rc=6
412osmo_routing_area_id_decode(): 012-34-56-78 rc=6
413ok
414RA ID: 012-034-23-42 (3-digit MNC)osmo_routing_area_id_encode_buf(): 10 42 30 00 17 2a rc=6
415osmo_routing_area_id_decode(): 012-034-23-42 (3-digit MNC) rc=6
416ok
417RA ID: 123-456-23-42osmo_routing_area_id_encode_buf(): 21 63 54 00 17 2a rc=6
418osmo_routing_area_id_decode(): 123-456-23-42 (3-digit MNC) rc=6
419ok
420RA ID: 123-456-23-42 (3-digit MNC)osmo_routing_area_id_encode_buf(): 21 63 54 00 17 2a rc=6
421osmo_routing_area_id_decode(): 123-456-23-42 (3-digit MNC) rc=6
422ok
Philipp Maiere36be562020-11-12 11:33:54 +0100423=====cm3_1=====
424mult_band_supp=06
425a5_bits=00
426assoc_radio_cap_1=04
427assoc_radio_cap_2=01
428
429r_support.present=0
430r_support.r_gsm_assoc_radio_cap=00
431
432hscsd_mult_slot_cap.present=0
433hscsd_mult_slot_cap.mslot_class=00
434
435ucs2_treatment=0
436extended_meas_cap=0
437
438ms_meas_cap.present=0
439ms_meas_cap.sms_value=00
440ms_meas_cap.sm_value=00
441
442ms_pos_method_cap.present=1
443ms_pos_method_cap.method=01
444
445ecsd_multislot_cap.present=0
446ecsd_multislot_cap.mslot_class=00
447
448psk8_struct.present=1
449psk8_struct.mod_cap=1
450psk8_struct.rf_pwr_cap_1.present=1
451psk8_struct.rf_pwr_cap_1.value=02
452psk8_struct.rf_pwr_cap_2.present=1
453psk8_struct.rf_pwr_cap_2.value=02
454
455gsm_400_bands_supp.present=0
456gsm_400_bands_supp.value=00
457gsm_400_bands_supp.assoc_radio_cap=00
458
459gsm_850_assoc_radio_cap.present=1
460gsm_850_assoc_radio_cap.value=04
461
462gsm_1900_assoc_radio_cap.present=0
463gsm_1900_assoc_radio_cap.value=00
464
465umts_fdd_rat_cap=0
466umts_tdd_rat_cap=0
467cdma200_rat_cap=0
468
469dtm_gprs_multislot_cap.present=0
470dtm_gprs_multislot_cap.mslot_class=00
471dtm_gprs_multislot_cap.single_slot_dtm=0
472dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.present=0
473dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.mslot_class=00
474
475single_band_supp.present=0
476single_band_supp.value=0
477
478gsm_750_assoc_radio_cap.present=0
479gsm_750_assoc_radio_cap.value=00
480
481umts_1_28_mcps_tdd_rat_cap=0
482geran_feature_package=1
483
484extended_dtm_gprs_multislot_cap.present=0
485extended_dtm_gprs_multislot_cap.mslot_class=00
486extended_dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.present=0
487extended_dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.mslot_class=00
488
489high_multislot_cap.present=0
490high_multislot_cap.value=00
491
492geran_feature_package_2=0
493gmsk_multislot_power_prof=00
494psk8_multislot_power_prof=00
495
496t_gsm_400_bands_supp.present=0
497t_gsm_400_bands_supp.value=00
498t_gsm_400_bands_supp.assoc_radio_cap=00
499
500dl_advanced_rx_perf=01
501dtm_enhancements_cap=1
502
503dtm_gprs_high_multislot_cap.present=0
504dtm_gprs_high_multislot_cap.mslot_class=00
505dtm_gprs_high_multislot_cap.offset_required=0
506dtm_gprs_high_multislot_cap.dtm_egprs_high_multislot_cap.present=0
507dtm_gprs_high_multislot_cap.dtm_egprs_high_multislot_cap.mslot_class=00
508
509repeated_acch_capability=1
510
511gsm_710_assoc_radio_cap.present=0
512gsm_710_assoc_radio_cap.value=00
513
514t_gsm_810_assoc_radio_cap.present=0
515t_gsm_810_assoc_radio_cap.value=00
516
517ciphering_mode_setting_cap=0
518add_pos_cap=0
519e_utra_fdd_supp=0
520e_utra_tdd_supp=0
521e_utra_meas_rep_supp=0
522prio_resel_supp=1
523utra_csg_cells_rep=0
524vamos_level=01
525tighter_capability=01
526sel_ciph_dl_sacch=0
527cs_ps_srvcc_geran_utra=00
528cs_ps_srvcc_geran_eutra=00
529geran_net_sharing=0
530e_utra_wb_rsrq_meas_supp=0
531er_band_support=0
532utra_mult_band_ind_supp=0
533e_utra_mult_band_ind_supp=0
534extended_tsc_set_cap_supp=0
535extended_earfcn_val_range=0
536
537=====cm3_2=====
538mult_band_supp=05
539a5_bits=05
540assoc_radio_cap_1=05
541assoc_radio_cap_2=05
542
543r_support.present=0
544r_support.r_gsm_assoc_radio_cap=00
545
546hscsd_mult_slot_cap.present=1
547hscsd_mult_slot_cap.mslot_class=0a
548
549ucs2_treatment=1
550extended_meas_cap=0
551
552ms_meas_cap.present=1
553ms_meas_cap.sms_value=05
554ms_meas_cap.sm_value=05
555
556ms_pos_method_cap.present=0
557ms_pos_method_cap.method=00
558
559ecsd_multislot_cap.present=1
560ecsd_multislot_cap.mslot_class=0a
561
562psk8_struct.present=1
563psk8_struct.mod_cap=0
564psk8_struct.rf_pwr_cap_1.present=1
565psk8_struct.rf_pwr_cap_1.value=01
566psk8_struct.rf_pwr_cap_2.present=0
567psk8_struct.rf_pwr_cap_2.value=00
568
569gsm_400_bands_supp.present=1
570gsm_400_bands_supp.value=01
571gsm_400_bands_supp.assoc_radio_cap=05
572
573gsm_850_assoc_radio_cap.present=0
574gsm_850_assoc_radio_cap.value=00
575
576gsm_1900_assoc_radio_cap.present=1
577gsm_1900_assoc_radio_cap.value=05
578
579umts_fdd_rat_cap=0
580umts_tdd_rat_cap=1
581cdma200_rat_cap=0
582
583dtm_gprs_multislot_cap.present=1
584dtm_gprs_multislot_cap.mslot_class=01
585dtm_gprs_multislot_cap.single_slot_dtm=0
586dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.present=1
587dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.mslot_class=01
588
589single_band_supp.present=0
590single_band_supp.value=0
591
592gsm_750_assoc_radio_cap.present=1
593gsm_750_assoc_radio_cap.value=05
594
595umts_1_28_mcps_tdd_rat_cap=0
596geran_feature_package=1
597
598extended_dtm_gprs_multislot_cap.present=0
599extended_dtm_gprs_multislot_cap.mslot_class=00
600extended_dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.present=0
601extended_dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.mslot_class=00
602
603high_multislot_cap.present=1
604high_multislot_cap.value=01
605
606geran_feature_package_2=1
607gmsk_multislot_power_prof=01
608psk8_multislot_power_prof=01
609
610t_gsm_400_bands_supp.present=0
611t_gsm_400_bands_supp.value=00
612t_gsm_400_bands_supp.assoc_radio_cap=00
613
614dl_advanced_rx_perf=01
615dtm_enhancements_cap=0
616
617dtm_gprs_high_multislot_cap.present=1
618dtm_gprs_high_multislot_cap.mslot_class=02
619dtm_gprs_high_multislot_cap.offset_required=1
620dtm_gprs_high_multislot_cap.dtm_egprs_high_multislot_cap.present=0
621dtm_gprs_high_multislot_cap.dtm_egprs_high_multislot_cap.mslot_class=00
622
623repeated_acch_capability=1
624
625gsm_710_assoc_radio_cap.present=0
626gsm_710_assoc_radio_cap.value=00
627
628t_gsm_810_assoc_radio_cap.present=1
629t_gsm_810_assoc_radio_cap.value=05
630
631ciphering_mode_setting_cap=0
632add_pos_cap=1
633e_utra_fdd_supp=0
634e_utra_tdd_supp=0
635e_utra_meas_rep_supp=0
636prio_resel_supp=0
637utra_csg_cells_rep=0
638vamos_level=00
639tighter_capability=00
640sel_ciph_dl_sacch=0
641cs_ps_srvcc_geran_utra=00
642cs_ps_srvcc_geran_eutra=00
643geran_net_sharing=0
644e_utra_wb_rsrq_meas_supp=0
645er_band_support=0
646utra_mult_band_ind_supp=0
647e_utra_mult_band_ind_supp=0
648extended_tsc_set_cap_supp=0
649extended_earfcn_val_range=0
650
651=====cm3_3=====
652mult_band_supp=02
653a5_bits=0a
654assoc_radio_cap_1=0a
655assoc_radio_cap_2=00
656
657r_support.present=1
658r_support.r_gsm_assoc_radio_cap=02
659
660hscsd_mult_slot_cap.present=1
661hscsd_mult_slot_cap.mslot_class=0a
662
663ucs2_treatment=1
664extended_meas_cap=0
665
666ms_meas_cap.present=1
667ms_meas_cap.sms_value=05
668ms_meas_cap.sm_value=05
669
670ms_pos_method_cap.present=0
671ms_pos_method_cap.method=00
672
673ecsd_multislot_cap.present=1
674ecsd_multislot_cap.mslot_class=0a
675
676psk8_struct.present=1
677psk8_struct.mod_cap=0
678psk8_struct.rf_pwr_cap_1.present=1
679psk8_struct.rf_pwr_cap_1.value=01
680psk8_struct.rf_pwr_cap_2.present=0
681psk8_struct.rf_pwr_cap_2.value=00
682
683gsm_400_bands_supp.present=1
684gsm_400_bands_supp.value=01
685gsm_400_bands_supp.assoc_radio_cap=05
686
687gsm_850_assoc_radio_cap.present=0
688gsm_850_assoc_radio_cap.value=00
689
690gsm_1900_assoc_radio_cap.present=1
691gsm_1900_assoc_radio_cap.value=05
692
693umts_fdd_rat_cap=0
694umts_tdd_rat_cap=1
695cdma200_rat_cap=0
696
697dtm_gprs_multislot_cap.present=1
698dtm_gprs_multislot_cap.mslot_class=01
699dtm_gprs_multislot_cap.single_slot_dtm=0
700dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.present=1
701dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.mslot_class=01
702
703single_band_supp.present=0
704single_band_supp.value=0
705
706gsm_750_assoc_radio_cap.present=1
707gsm_750_assoc_radio_cap.value=05
708
709umts_1_28_mcps_tdd_rat_cap=0
710geran_feature_package=1
711
712extended_dtm_gprs_multislot_cap.present=0
713extended_dtm_gprs_multislot_cap.mslot_class=00
714extended_dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.present=0
715extended_dtm_gprs_multislot_cap.dtm_egprs_multislot_cap.mslot_class=00
716
717high_multislot_cap.present=1
718high_multislot_cap.value=01
719
720geran_feature_package_2=1
721gmsk_multislot_power_prof=01
722psk8_multislot_power_prof=01
723
724t_gsm_400_bands_supp.present=0
725t_gsm_400_bands_supp.value=00
726t_gsm_400_bands_supp.assoc_radio_cap=00
727
728dl_advanced_rx_perf=01
729dtm_enhancements_cap=0
730
731dtm_gprs_high_multislot_cap.present=1
732dtm_gprs_high_multislot_cap.mslot_class=02
733dtm_gprs_high_multislot_cap.offset_required=1
734dtm_gprs_high_multislot_cap.dtm_egprs_high_multislot_cap.present=0
735dtm_gprs_high_multislot_cap.dtm_egprs_high_multislot_cap.mslot_class=00
736
737repeated_acch_capability=1
738
739gsm_710_assoc_radio_cap.present=0
740gsm_710_assoc_radio_cap.value=00
741
742t_gsm_810_assoc_radio_cap.present=1
743t_gsm_810_assoc_radio_cap.value=04
744
745ciphering_mode_setting_cap=0
746add_pos_cap=0
747e_utra_fdd_supp=0
748e_utra_tdd_supp=0
749e_utra_meas_rep_supp=0
750prio_resel_supp=0
751utra_csg_cells_rep=0
752vamos_level=00
753tighter_capability=00
754sel_ciph_dl_sacch=0
755cs_ps_srvcc_geran_utra=00
756cs_ps_srvcc_geran_eutra=00
757geran_net_sharing=0
758e_utra_wb_rsrq_meas_supp=0
759er_band_support=0
760utra_mult_band_ind_supp=0
761e_utra_mult_band_ind_supp=0
762extended_tsc_set_cap_supp=0
763extended_earfcn_val_range=0
764
Stefan Sperlingfdf8b7b2018-07-27 12:19:15 +0200765Element is: 2 => freqs[i] = 121
766Element is: 2 => freqs[i] = 1
767Element is: 0 => freqs[i] = 68
768w[0]=122
769w[1]=2
770w[2]=69
771w[3]=204
772w[4]=75
773w[5]=66
774w[6]=60
775w[7]=70
776w[8]=83
777w[9]=3
778w[10]=24
779w[11]=67
780w[12]=54
781w[13]=64
782w[14]=70
783w[15]=9
784Range512: 89 4b 2a 95 65 95 55 2c a9 55 aa 55 6a 95 59 55
785Range test 0: range 511, num ARFCNs 12
786range=511, arfcns_used=11, f0=1, f0_included=1
787chan_list = 88 00 98 34 85 36 7c 50 22 dc 5e ec 00 00 00 00
788Decoded freqs 12 (expected 12)
789Decoded: 1 12 31 51 57 91 97 98 113 117 120 125
790Range test 1: range 511, num ARFCNs 17
791range=511, arfcns_used=16, f0=1, f0_included=1
792chan_list = 88 00 82 7f 01 3f 7e 04 0b ff ff fc 10 41 07 e0
793Decoded freqs 17 (expected 17)
794Decoded: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
795Range test 2: range 511, num ARFCNs 18
796range=511, arfcns_used=17, f0=1, f0_included=1
797chan_list = 88 00 82 7f 01 7f 7e 04 0b ff ff fc 10 41 07 ff
798Decoded freqs 18 (expected 18)
799Decoded: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
800Range test 3: range 511, num ARFCNs 18
801range=511, arfcns_used=17, f0=1, f0_included=1
802chan_list = 88 00 94 3a 44 32 d7 2a 43 2a 13 94 e5 38 39 f6
803Decoded freqs 18 (expected 18)
804Decoded: 1 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 417 511
805Range test 4: range 511, num ARFCNs 6
806range=511, arfcns_used=5, f0=1, f0_included=1
807chan_list = 88 00 8b 3c 88 b9 6b 00 00 00 00 00 00 00 00 00
808Decoded freqs 6 (expected 6)
809Decoded: 1 17 31 45 58 79
810Range test 5: range 511, num ARFCNs 6
811range=511, arfcns_used=5, f0=10, f0_included=1
812chan_list = 88 05 08 fc 88 b9 6b 00 00 00 00 00 00 00 00 00
813Decoded freqs 6 (expected 6)
814Decoded: 10 17 31 45 58 79
815Range test 6: range 1023, num ARFCNs 17
816range=1023, arfcns_used=16, f0=0, f0_included=1
817chan_list = 84 71 e4 ab b9 58 05 cb 39 17 fd b0 75 62 0f 2f
818Decoded freqs 17 (expected 17)
819Decoded: 0 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 1023
820Range test 7: range 1023, num ARFCNs 16
821range=1023, arfcns_used=16, f0=0, f0_included=0
822chan_list = 80 71 e4 ab b9 58 05 cb 39 17 fd b0 75 62 0f 2f
823Decoded freqs 16 (expected 16)
824Decoded: 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 1023
825Random range test: range 127, max num ARFCNs 29
826Random range test: range 255, max num ARFCNs 22
827Random range test: range 511, max num ARFCNs 18
828Random range test: range 1023, max num ARFCNs 16
Pau Espin Pedrol1dac8752022-04-26 17:32:33 +0200829rach_tx_integer_raw2val(0x00): 3 slots used to spread transmission
830rach_tx_integer_raw2val(0x01): 4 slots used to spread transmission
831rach_tx_integer_raw2val(0x02): 5 slots used to spread transmission
832rach_tx_integer_raw2val(0x03): 6 slots used to spread transmission
833rach_tx_integer_raw2val(0x04): 7 slots used to spread transmission
834rach_tx_integer_raw2val(0x05): 8 slots used to spread transmission
835rach_tx_integer_raw2val(0x06): 9 slots used to spread transmission
836rach_tx_integer_raw2val(0x07): 10 slots used to spread transmission
837rach_tx_integer_raw2val(0x08): 11 slots used to spread transmission
838rach_tx_integer_raw2val(0x09): 12 slots used to spread transmission
839rach_tx_integer_raw2val(0x0a): 14 slots used to spread transmission
840rach_tx_integer_raw2val(0x0b): 16 slots used to spread transmission
841rach_tx_integer_raw2val(0x0c): 20 slots used to spread transmission
842rach_tx_integer_raw2val(0x0d): 25 slots used to spread transmission
843rach_tx_integer_raw2val(0x0e): 32 slots used to spread transmission
844rach_tx_integer_raw2val(0x0f): 50 slots used to spread transmission