libosmogsm  1.0.1
Osmocom GSM library
gsm_04_08.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <stdint.h>
7 #include <stdbool.h>
8 
9 #include <osmocom/core/utils.h>
10 #include <osmocom/core/endian.h>
11 
12 struct gsm_lchan;
13 
14 /* Chapter 10.5.1.5 */
16 #if OSMO_IS_LITTLE_ENDIAN
17  uint8_t pwr_lev:3,
18  a5_1:1,
19  es_ind:1,
20  rev_lev:2,
21  spare:1;
22 #elif OSMO_IS_BIG_ENDIAN
23 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
24  uint8_t spare:1, rev_lev:2, es_ind:1, a5_1:1, pwr_lev:3;
25 #endif
26 } __attribute__ ((packed));
27 
28 /* Chapter 10.5.1.6 */
30 #if OSMO_IS_LITTLE_ENDIAN
31  uint8_t pwr_lev:3,
32  a5_1:1,
33  es_ind:1,
34  rev_lev:2,
35  spare:1;
36  uint8_t fc:1,
37  vgcs:1,
38  vbs:1,
39  sm_cap:1,
40  ss_scr:2,
41  ps_cap:1,
42  spare2:1;
43  uint8_t a5_2:1,
44  a5_3:1,
45  cmsp:1,
46  solsa:1,
47  spare3:1,
48  lcsva_cap:1,
49  spare4:1,
50  cm3:1;
51 #elif OSMO_IS_BIG_ENDIAN
52 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
53  uint8_t spare:1, rev_lev:2, es_ind:1, a5_1:1, pwr_lev:3;
54  uint8_t spare2:1, ps_cap:1, ss_scr:2, sm_cap:1, vbs:1, vgcs:1, fc:1;
55  uint8_t cm3:1, spare4:1, lcsva_cap:1, spare3:1, solsa:1, cmsp:1, a5_3:1, a5_2:1;
56 #endif
57 } __attribute__ ((packed));
58 
59 /* Chapter 10.5.2.1b.3 */
60 #if OSMO_IS_LITTLE_ENDIAN == 1
61 struct gsm48_range_1024 {
62 #if OSMO_IS_LITTLE_ENDIAN
63  uint8_t w1_hi:2,
64  f0:1,
65  form_id:5;
66  uint8_t w1_lo;
67  uint8_t w2_hi;
68  uint8_t w3_hi:7,
69  w2_lo:1;
70  uint8_t w4_hi:6,
71  w3_lo:2;
72  uint8_t w5_hi:6,
73  w4_lo:2;
74  uint8_t w6_hi:6,
75  w5_lo:2;
76  uint8_t w7_hi:6,
77  w6_lo:2;
78  uint8_t w8_hi:6,
79  w7_lo:2;
80  uint8_t w9:7,
81  w8_lo:1;
82  uint8_t w11_hi:1,
83  w10:7;
84  uint8_t w12_hi:2,
85  w11_lo:6;
86  uint8_t w13_hi:3,
87  w12_lo:5;
88  uint8_t w14_hi:4,
89  w13_lo:4;
90  uint8_t w15_hi:5,
91  w14_lo:3;
92  uint8_t w16:6,
93  w15_lo:2;
94 #elif OSMO_IS_BIG_ENDIAN
95 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
96  uint8_t form_id:5, f0:1, w1_hi:2;
97  uint8_t w1_lo;
98  uint8_t w2_hi;
99  uint8_t w2_lo:1, w3_hi:7;
100  uint8_t w3_lo:2, w4_hi:6;
101  uint8_t w4_lo:2, w5_hi:6;
102  uint8_t w5_lo:2, w6_hi:6;
103  uint8_t w6_lo:2, w7_hi:6;
104  uint8_t w7_lo:2, w8_hi:6;
105  uint8_t w8_lo:1, w9:7;
106  uint8_t w10:7, w11_hi:1;
107  uint8_t w11_lo:6, w12_hi:2;
108  uint8_t w12_lo:5, w13_hi:3;
109  uint8_t w13_lo:4, w14_hi:4;
110  uint8_t w14_lo:3, w15_hi:5;
111  uint8_t w15_lo:2, w16:6;
112 #endif
113 } __attribute__ ((packed));
114 #else
116 #if OSMO_IS_LITTLE_ENDIAN
117  uint8_t form_id:5,
118  f0:1,
119  w1_hi:2;
120  uint8_t w1_lo;
121  uint8_t w2_hi;
122  uint8_t w2_lo:1,
123  w3_hi:7;
124  uint8_t w3_lo:2,
125  w4_hi:6;
126  uint8_t w4_lo:2,
127  w5_hi:6;
128  uint8_t w5_lo:2,
129  w6_hi:6;
130  uint8_t w6_lo:2,
131  w7_hi:6;
132  uint8_t w7_lo:2,
133  w8_hi:6;
134  uint8_t w8_lo:1,
135  w9:7;
136  uint8_t w10:7,
137  w11_hi:1;
138  uint8_t w11_lo:6,
139  w12_hi:2;
140  uint8_t w12_lo:5,
141  w13_hi:3;
142  uint8_t w13_lo:4,
143  w14_hi:4;
144  uint8_t w14_lo:3,
145  w15_hi:5;
146  uint8_t w15_lo:2,
147  w16:6;
148 #elif OSMO_IS_BIG_ENDIAN
149 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
150  uint8_t w1_hi:2, f0:1, form_id:5;
151  uint8_t w1_lo;
152  uint8_t w2_hi;
153  uint8_t w3_hi:7, w2_lo:1;
154  uint8_t w4_hi:6, w3_lo:2;
155  uint8_t w5_hi:6, w4_lo:2;
156  uint8_t w6_hi:6, w5_lo:2;
157  uint8_t w7_hi:6, w6_lo:2;
158  uint8_t w8_hi:6, w7_lo:2;
159  uint8_t w9:7, w8_lo:1;
160  uint8_t w11_hi:1, w10:7;
161  uint8_t w12_hi:2, w11_lo:6;
162  uint8_t w13_hi:3, w12_lo:5;
163  uint8_t w14_hi:4, w13_lo:4;
164  uint8_t w15_hi:5, w14_lo:3;
165  uint8_t w16:6, w15_lo:2;
166 #endif
167 } __attribute__ ((packed));
168 #endif
169 
170 /* Chapter 10.5.2.1b.4 */
171 #if OSMO_IS_LITTLE_ENDIAN == 1
172 struct gsm48_range_512 {
173 #if OSMO_IS_LITTLE_ENDIAN
174  uint8_t orig_arfcn_hi:1,
175  form_id:7;
176  uint8_t orig_arfcn_mid;
177  uint8_t w1_hi:7,
178  orig_arfcn_lo:1;
179  uint8_t w2_hi:6,
180  w1_lo:2;
181  uint8_t w3_hi:6,
182  w2_lo:2;
183  uint8_t w4_hi:6,
184  w3_lo:2;
185  uint8_t w5:7,
186  w4_lo:1;
187  uint8_t w7_hi:1,
188  w6:7;
189  uint8_t w8_hi:2,
190  w7_lo:6;
191  uint8_t w9_hi:4,
192  w8_lo:4;
193  uint8_t w10:6,
194  w9_lo:2;
195  uint8_t w12_hi:2,
196  w11:6;
197  uint8_t w13_hi:4,
198  w12_lo:4;
199  uint8_t w14:6,
200  w13_lo:2;
201  uint8_t w16_hi:2,
202  w15:6;
203  uint8_t w17:5,
204  w16_lo:3;
205 #elif OSMO_IS_BIG_ENDIAN
206 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
207  uint8_t form_id:7, orig_arfcn_hi:1;
208  uint8_t orig_arfcn_mid;
209  uint8_t orig_arfcn_lo:1, w1_hi:7;
210  uint8_t w1_lo:2, w2_hi:6;
211  uint8_t w2_lo:2, w3_hi:6;
212  uint8_t w3_lo:2, w4_hi:6;
213  uint8_t w4_lo:1, w5:7;
214  uint8_t w6:7, w7_hi:1;
215  uint8_t w7_lo:6, w8_hi:2;
216  uint8_t w8_lo:4, w9_hi:4;
217  uint8_t w9_lo:2, w10:6;
218  uint8_t w11:6, w12_hi:2;
219  uint8_t w12_lo:4, w13_hi:4;
220  uint8_t w13_lo:2, w14:6;
221  uint8_t w15:6, w16_hi:2;
222  uint8_t w16_lo:3, w17:5;
223 #endif
224 } __attribute__ ((packed));
225 #else
227 #if OSMO_IS_LITTLE_ENDIAN
228  uint8_t form_id:7,
229  orig_arfcn_hi:1;
230  uint8_t orig_arfcn_mid;
231  uint8_t orig_arfcn_lo:1,
232  w1_hi:7;
233  uint8_t w1_lo:2,
234  w2_hi:6;
235  uint8_t w2_lo:2,
236  w3_hi:6;
237  uint8_t w3_lo:2,
238  w4_hi:6;
239  uint8_t w4_lo:1,
240  w5:7;
241  uint8_t w6:7,
242  w7_hi:1;
243  uint8_t w7_lo:6,
244  w8_hi:2;
245  uint8_t w8_lo:4,
246  w9_hi:4;
247  uint8_t w9_lo:2,
248  w10:6;
249  uint8_t w11:6,
250  w12_hi:2;
251  uint8_t w12_lo:4,
252  w13_hi:4;
253  uint8_t w13_lo:2,
254  w14:6;
255  uint8_t w15:6,
256  w16_hi:2;
257  uint8_t w16_lo:3,
258  w17:5;
259 #elif OSMO_IS_BIG_ENDIAN
260 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
261  uint8_t orig_arfcn_hi:1, form_id:7;
262  uint8_t orig_arfcn_mid;
263  uint8_t w1_hi:7, orig_arfcn_lo:1;
264  uint8_t w2_hi:6, w1_lo:2;
265  uint8_t w3_hi:6, w2_lo:2;
266  uint8_t w4_hi:6, w3_lo:2;
267  uint8_t w5:7, w4_lo:1;
268  uint8_t w7_hi:1, w6:7;
269  uint8_t w8_hi:2, w7_lo:6;
270  uint8_t w9_hi:4, w8_lo:4;
271  uint8_t w10:6, w9_lo:2;
272  uint8_t w12_hi:2, w11:6;
273  uint8_t w13_hi:4, w12_lo:4;
274  uint8_t w14:6, w13_lo:2;
275  uint8_t w16_hi:2, w15:6;
276  uint8_t w17:5, w16_lo:3;
277 #endif
278 } __attribute__ ((packed));
279 #endif
280 
281 /* Chapter 10.5.2.1b.5 */
282 #if OSMO_IS_LITTLE_ENDIAN == 1
283 struct gsm48_range_256 {
284 #if OSMO_IS_LITTLE_ENDIAN
285  uint8_t orig_arfcn_hi:1,
286  form_id:7;
287  uint8_t orig_arfcn_mid;
288  uint8_t w1_hi:7,
289  orig_arfcn_lo:1;
290  uint8_t w2:7,
291  w1_lo:1;
292  uint8_t w4_hi:1,
293  w3:7;
294  uint8_t w5_hi:3,
295  w4_lo:5;
296  uint8_t w6_hi:5,
297  w5_lo:3;
298  uint8_t w8_hi:1,
299  w7:6,
300  w6_lo:1;
301  uint8_t w9_hi:4,
302  w8_lo:4;
303  uint8_t w11_hi:2,
304  w10:5,
305  w9_lo:1;
306  uint8_t w12:5,
307  w11_lo:3;
308  uint8_t w14_hi:3,
309  w13:5;
310  uint8_t w16_hi:1,
311  w15:5,
312  w14_lo:2;
313  uint8_t w18_hi:1,
314  w17:4,
315  w16_lo:3;
316  uint8_t w20_hi:1,
317  w19:4,
318  w18_lo:3;
319  uint8_t spare:1,
320  w21:4,
321  w20_lo:3;
322 #elif OSMO_IS_BIG_ENDIAN
323 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
324  uint8_t form_id:7, orig_arfcn_hi:1;
325  uint8_t orig_arfcn_mid;
326  uint8_t orig_arfcn_lo:1, w1_hi:7;
327  uint8_t w1_lo:1, w2:7;
328  uint8_t w3:7, w4_hi:1;
329  uint8_t w4_lo:5, w5_hi:3;
330  uint8_t w5_lo:3, w6_hi:5;
331  uint8_t w6_lo:1, w7:6, w8_hi:1;
332  uint8_t w8_lo:4, w9_hi:4;
333  uint8_t w9_lo:1, w10:5, w11_hi:2;
334  uint8_t w11_lo:3, w12:5;
335  uint8_t w13:5, w14_hi:3;
336  uint8_t w14_lo:2, w15:5, w16_hi:1;
337  uint8_t w16_lo:3, w17:4, w18_hi:1;
338  uint8_t w18_lo:3, w19:4, w20_hi:1;
339  uint8_t w20_lo:3, w21:4, spare:1;
340 #endif
341 } __attribute__ ((packed));
342 #else
344 #if OSMO_IS_LITTLE_ENDIAN
345  uint8_t form_id:7,
346  orig_arfcn_hi:1;
347  uint8_t orig_arfcn_mid;
348  uint8_t orig_arfcn_lo:1,
349  w1_hi:7;
350  uint8_t w1_lo:1,
351  w2:7;
352  uint8_t w3:7,
353  w4_hi:1;
354  uint8_t w4_lo:5,
355  w5_hi:3;
356  uint8_t w5_lo:3,
357  w6_hi:5;
358  uint8_t w6_lo:1,
359  w7:6,
360  w8_hi:1;
361  uint8_t w8_lo:4,
362  w9_hi:4;
363  uint8_t w9_lo:1,
364  w10:5,
365  w11_hi:2;
366  uint8_t w11_lo:3,
367  w12:5;
368  uint8_t w13:5,
369  w14_hi:3;
370  uint8_t w14_lo:2,
371  w15:5,
372  w16_hi:1;
373  uint8_t w16_lo:3,
374  w17:4,
375  w18_hi:1;
376  uint8_t w18_lo:3,
377  w19:4,
378  w20_hi:1;
379  uint8_t w20_lo:3,
380  w21:4,
381  spare:1;
382 #elif OSMO_IS_BIG_ENDIAN
383 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
384  uint8_t orig_arfcn_hi:1, form_id:7;
385  uint8_t orig_arfcn_mid;
386  uint8_t w1_hi:7, orig_arfcn_lo:1;
387  uint8_t w2:7, w1_lo:1;
388  uint8_t w4_hi:1, w3:7;
389  uint8_t w5_hi:3, w4_lo:5;
390  uint8_t w6_hi:5, w5_lo:3;
391  uint8_t w8_hi:1, w7:6, w6_lo:1;
392  uint8_t w9_hi:4, w8_lo:4;
393  uint8_t w11_hi:2, w10:5, w9_lo:1;
394  uint8_t w12:5, w11_lo:3;
395  uint8_t w14_hi:3, w13:5;
396  uint8_t w16_hi:1, w15:5, w14_lo:2;
397  uint8_t w18_hi:1, w17:4, w16_lo:3;
398  uint8_t w20_hi:1, w19:4, w18_lo:3;
399  uint8_t spare:1, w21:4, w20_lo:3;
400 #endif
401 } __attribute__ ((packed));
402 #endif
403 
404 /* Chapter 10.5.2.1b.6 */
405 #if OSMO_IS_LITTLE_ENDIAN == 1
406 struct gsm48_range_128 {
407 #if OSMO_IS_LITTLE_ENDIAN
408  uint8_t orig_arfcn_hi:1,
409  form_id:7;
410  uint8_t orig_arfcn_mid;
411  uint8_t w1:7,
412  orig_arfcn_lo:1;
413  uint8_t w3_hi:2,
414  w2:6;
415  uint8_t w4_hi:4,
416  w3_lo:4;
417  uint8_t w6_hi:2,
418  w5:5,
419  w4_lo:1;
420  uint8_t w7:5,
421  w6_lo:3;
422  uint8_t w9:4,
423  w8:4;
424  uint8_t w11:4,
425  w10:4;
426  uint8_t w13:4,
427  w12:4;
428  uint8_t w15:4,
429  w14:4;
430  uint8_t w18_hi:2,
431  w17:3,
432  w16:3;
433  uint8_t w21_hi:1,
434  w20:3,
435  w19:3,
436  w18_lo:1;
437  uint8_t w23:3,
438  w22:3,
439  w21_lo:2;
440  uint8_t w26_hi:2,
441  w25:3,
442  w24:3;
443  uint8_t spare:1,
444  w28:3,
445  w27:3,
446  w26_lo:1;
447 #elif OSMO_IS_BIG_ENDIAN
448 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
449  uint8_t form_id:7, orig_arfcn_hi:1;
450  uint8_t orig_arfcn_mid;
451  uint8_t orig_arfcn_lo:1, w1:7;
452  uint8_t w2:6, w3_hi:2;
453  uint8_t w3_lo:4, w4_hi:4;
454  uint8_t w4_lo:1, w5:5, w6_hi:2;
455  uint8_t w6_lo:3, w7:5;
456  uint8_t w8:4, w9:4;
457  uint8_t w10:4, w11:4;
458  uint8_t w12:4, w13:4;
459  uint8_t w14:4, w15:4;
460  uint8_t w16:3, w17:3, w18_hi:2;
461  uint8_t w18_lo:1, w19:3, w20:3, w21_hi:1;
462  uint8_t w21_lo:2, w22:3, w23:3;
463  uint8_t w24:3, w25:3, w26_hi:2;
464  uint8_t w26_lo:1, w27:3, w28:3, spare:1;
465 #endif
466 } __attribute__ ((packed));
467 #else
469 #if OSMO_IS_LITTLE_ENDIAN
470  uint8_t form_id:7,
471  orig_arfcn_hi:1;
472  uint8_t orig_arfcn_mid;
473  uint8_t orig_arfcn_lo:1,
474  w1:7;
475  uint8_t w2:6,
476  w3_hi:2;
477  uint8_t w3_lo:4,
478  w4_hi:4;
479  uint8_t w4_lo:1,
480  w5:5,
481  w6_hi:2;
482  uint8_t w6_lo:3,
483  w7:5;
484  uint8_t w8:4,
485  w9:4;
486  uint8_t w10:4,
487  w11:4;
488  uint8_t w12:4,
489  w13:4;
490  uint8_t w14:4,
491  w15:4;
492  uint8_t w16:3,
493  w17:3,
494  w18_hi:2;
495  uint8_t w18_lo:1,
496  w19:3,
497  w20:3,
498  w21_hi:1;
499  uint8_t w21_lo:2,
500  w22:3,
501  w23:3;
502  uint8_t w24:3,
503  w25:3,
504  w26_hi:2;
505  uint8_t w26_lo:1,
506  w27:3,
507  w28:3,
508  spare:1;
509 #elif OSMO_IS_BIG_ENDIAN
510 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
511  uint8_t orig_arfcn_hi:1, form_id:7;
512  uint8_t orig_arfcn_mid;
513  uint8_t w1:7, orig_arfcn_lo:1;
514  uint8_t w3_hi:2, w2:6;
515  uint8_t w4_hi:4, w3_lo:4;
516  uint8_t w6_hi:2, w5:5, w4_lo:1;
517  uint8_t w7:5, w6_lo:3;
518  uint8_t w9:4, w8:4;
519  uint8_t w11:4, w10:4;
520  uint8_t w13:4, w12:4;
521  uint8_t w15:4, w14:4;
522  uint8_t w18_hi:2, w17:3, w16:3;
523  uint8_t w21_hi:1, w20:3, w19:3, w18_lo:1;
524  uint8_t w23:3, w22:3, w21_lo:2;
525  uint8_t w26_hi:2, w25:3, w24:3;
526  uint8_t spare:1, w28:3, w27:3, w26_lo:1;
527 #endif
528 } __attribute__ ((packed));
529 #endif
530 
531 /* Chapter 10.5.2.1b.7 */
533 #if OSMO_IS_LITTLE_ENDIAN
534  uint8_t orig_arfcn_hi:1,
535  form_id:7;
536  uint8_t orig_arfcn_mid;
537  uint8_t rrfcn1_7:7,
538  orig_arfcn_lo:1;
539  uint8_t rrfcn8_111[13];
540 #elif OSMO_IS_BIG_ENDIAN
541 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
542  uint8_t form_id:7, orig_arfcn_hi:1;
543  uint8_t orig_arfcn_mid;
544  uint8_t orig_arfcn_lo:1, rrfcn1_7:7;
545  uint8_t rrfcn8_111[13];
546 #endif
547 } __attribute__ ((packed));
548 
549 /* Chapter 10.5.2.5 */
551  uint8_t chan_nr;
552  union {
553  struct {
554 #if OSMO_IS_LITTLE_ENDIAN
555  uint8_t maio_high:4,
556  h:1,
557  tsc:3;
558  uint8_t hsn:6,
559  maio_low:2;
560 #elif OSMO_IS_BIG_ENDIAN
561 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
562  uint8_t tsc:3, h:1, maio_high:4;
563  uint8_t maio_low:2, hsn:6;
564 #endif
565  } __attribute__ ((packed)) h1;
566  struct {
567 #if OSMO_IS_LITTLE_ENDIAN
568  uint8_t arfcn_high:2,
569  spare:2,
570  h:1,
571  tsc:3;
572  uint8_t arfcn_low;
573 #elif OSMO_IS_BIG_ENDIAN
574 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
575  uint8_t tsc:3, h:1, spare:2, arfcn_high:2;
576  uint8_t arfcn_low;
577 #endif
578  } __attribute__ ((packed)) h0;
579  } __attribute__ ((packed));
580 } __attribute__ ((packed));
581 
582 /* Chapter 10.5.2.20 */
584 #if OSMO_IS_LITTLE_ENDIAN
585  uint8_t rxlev_full:6,
586  dtx_used:1,
587  ba_used:1;
588  uint8_t rxlev_sub:6,
589  meas_valid:1,
590  spare:1;
591  uint8_t no_nc_n_hi:1,
592  rxqual_sub:3,
593  rxqual_full:3,
594  spare2:1;
595  uint8_t rxlev_nc1:6,
596  no_nc_n_lo:2;
597  uint8_t bsic_nc1_hi:3,
598  bcch_f_nc1:5;
599  uint8_t rxlev_nc2_hi:5,
600  bsic_nc1_lo:3;
601  uint8_t bsic_nc2_hi:2,
602  bcch_f_nc2:5,
603  rxlev_nc2_lo:1;
604  uint8_t rxlev_nc3_hi:4,
605  bsic_nc2_lo:4;
606  uint8_t bsic_nc3_hi:1,
607  bcch_f_nc3:5,
608  rxlev_nc3_lo:2;
609  uint8_t rxlev_nc4_hi:3,
610  bsic_nc3_lo:5;
611  uint8_t bcch_f_nc4:5,
612  rxlev_nc4_lo:3;
613  uint8_t rxlev_nc5_hi:2,
614  bsic_nc4:6;
615  uint8_t bcch_f_nc5_hi:4,
616  rxlev_nc5_lo:4;
617  uint8_t rxlev_nc6_hi:1,
618  bsic_nc5:6,
619  bcch_f_nc5_lo:1;
620  uint8_t bcch_f_nc6_hi:3,
621  rxlev_nc6_lo:5;
622  uint8_t bsic_nc6:6,
623  bcch_f_nc6_lo:2;
624 #elif OSMO_IS_BIG_ENDIAN
625 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
626  uint8_t ba_used:1, dtx_used:1, rxlev_full:6;
627  uint8_t spare:1, meas_valid:1, rxlev_sub:6;
628  uint8_t spare2:1, rxqual_full:3, rxqual_sub:3, no_nc_n_hi:1;
629  uint8_t no_nc_n_lo:2, rxlev_nc1:6;
630  uint8_t bcch_f_nc1:5, bsic_nc1_hi:3;
631  uint8_t bsic_nc1_lo:3, rxlev_nc2_hi:5;
632  uint8_t rxlev_nc2_lo:1, bcch_f_nc2:5, bsic_nc2_hi:2;
633  uint8_t bsic_nc2_lo:4, rxlev_nc3_hi:4;
634  uint8_t rxlev_nc3_lo:2, bcch_f_nc3:5, bsic_nc3_hi:1;
635  uint8_t bsic_nc3_lo:5, rxlev_nc4_hi:3;
636  uint8_t rxlev_nc4_lo:3, bcch_f_nc4:5;
637  uint8_t bsic_nc4:6, rxlev_nc5_hi:2;
638  uint8_t rxlev_nc5_lo:4, bcch_f_nc5_hi:4;
639  uint8_t bcch_f_nc5_lo:1, bsic_nc5:6, rxlev_nc6_hi:1;
640  uint8_t rxlev_nc6_lo:5, bcch_f_nc6_hi:3;
641  uint8_t bcch_f_nc6_lo:2, bsic_nc6:6;
642 #endif
643 } __attribute__ ((packed));
644 
645 /* Chapter 10.5.2.21aa */
647 #if OSMO_IS_LITTLE_ENDIAN
648  uint8_t smod : 2,
649  spare: 1,
650  icmi : 1,
651  nscb : 1,
652  ver : 3;
653  uint8_t m4_75 : 1,
654  m5_15 : 1,
655  m5_90 : 1,
656  m6_70 : 1,
657  m7_40 : 1,
658  m7_95 : 1,
659  m10_2 : 1,
660  m12_2 : 1;
661 #elif OSMO_IS_BIG_ENDIAN
662 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
663  uint8_t ver:3, nscb:1, icmi:1, spare:1, smod:2;
664  uint8_t m12_2:1, m10_2:1, m7_95:1, m7_40:1, m6_70:1, m5_90:1, m5_15:1, m4_75:1;
665 #endif
666 } __attribute__((packed));
667 
668 /* Chapter 10.5.2.28(a) */
670 #if OSMO_IS_LITTLE_ENDIAN
671  uint8_t power_level:5,
672  spare:2,
673  atc:1;
674 #elif OSMO_IS_BIG_ENDIAN
675 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
676  uint8_t atc:1, spare:2, power_level:5;
677 #endif
678 } __attribute__((packed));
679 
680 /* Chapter 10.5.2.29 */
682 #if OSMO_IS_LITTLE_ENDIAN
683  uint8_t re :1,
684  cell_bar :1,
685  tx_integer :4,
686  max_trans :2;
687  uint8_t t2; /* ACC 8-15 barred flags */
688  uint8_t t3; /* ACC 0-7 barred flags */
689 #elif OSMO_IS_BIG_ENDIAN
690 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
691  uint8_t max_trans:2, tx_integer:4, cell_bar:1, re:1;
692  uint8_t t2;
693  uint8_t t3;
694 #endif
695 } __attribute__ ((packed));
696 
697 /*
698  * Mark an Access Control Class as barred.
699  * \param[in] rach_control A Rach Control Information Element.
700  * \param[in] acc Access Control Class number (0 - 15) which shall be barred.
701  */
702 static inline void gsm48_barr_acc(struct gsm48_rach_control *rach_control, unsigned int acc)
703 {
704  OSMO_ASSERT(acc >= 0 && acc <= 15);
705  if (acc >= 8)
706  rach_control->t2 |= (1 << (acc - 8));
707  else
708  rach_control->t3 |= (1 << (acc));
709 }
710 
711 /*
712  * Mark an Access Control Class as allowed.
713  * \param[in] rach_control A Rach Control Information Element.
714  * \param[in] acc Access Control Class number (0 - 15) which shall be allowed.
715  */
716 static inline void gsm48_allow_acc(struct gsm48_rach_control *rach_control, unsigned int acc)
717 {
718  OSMO_ASSERT(acc >= 0 && acc <= 15);
719  if (acc >= 8)
720  rach_control->t2 &= ~(1 << (acc - 8));
721  else
722  rach_control->t3 &= ~(1 << (acc));
723 }
724 
725 /*
726  * Indicate whether an Access Control Class is barred.
727  * \param[in] rach_control A Rach Control Information Element.
728  * \param[in] acc Access Control Class number (0 - 15).
729  * \returns true if the Access Control class is barred, false otherwise
730  */
731 static inline bool gsm48_acc_is_barred(struct gsm48_rach_control *rach_control, unsigned int acc)
732 {
733  OSMO_ASSERT(acc >= 0 && acc <= 15);
734  if (acc >= 8)
735  return (rach_control->t2 & (1 << (acc - 8))) != 0;
736  return (rach_control->t3 & (1 << (acc))) != 0;
737 }
738 
739 /* Chapter 10.5.2.30 */
741 #if OSMO_IS_LITTLE_ENDIAN
742  uint8_t ra;
743  uint8_t t3_high:3,
744  t1:5;
745  uint8_t t2:5,
746  t3_low:3;
747 #elif OSMO_IS_BIG_ENDIAN
748 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
749  uint8_t ra;
750  uint8_t t1:5, t3_high:3;
751  uint8_t t3_low:3, t2:5;
752 #endif
753 } __attribute__ ((packed));
754 
755 /* Chapter 10.5.2.38 */
757 #if OSMO_IS_LITTLE_ENDIAN
758  uint8_t t3_high:3,
759  t1:5;
760  uint8_t t2:5,
761  t3_low:3;
762 #elif OSMO_IS_BIG_ENDIAN
763 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
764  uint8_t t1:5, t3_high:3;
765  uint8_t t3_low:3, t2:5;
766 #endif
767 } __attribute__ ((packed));
768 
769 /* Chapter 10.5.2.39 */
771 #if OSMO_IS_LITTLE_ENDIAN
772  uint8_t si:2,
773  rot:1,
774  nci:1,
775  sync_ie:4;
776 #elif OSMO_IS_BIG_ENDIAN
777 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
778  uint8_t sync_ie:4, nci:1, rot:1, si:2;
779 #endif
780 } __attribute__((packed));
781 
782 /*
783  * Chapter 9.1.5/9.1.6
784  *
785  * For 9.1.6 the chan_desc has the meaning of 10.5.2.5a
786  */
789  uint8_t mode;
790 } __attribute__ ((packed));
791 
801 };
802 
803 extern const struct value_string gsm48_chan_mode_names[];
804 static inline const char *gsm48_chan_mode_name(enum gsm48_chan_mode val)
807 /* Chapter 9.1.2 */
809  /* Semantic is from 10.5.2.5a */
811  uint8_t power_command;
812  uint8_t data[0];
813 } __attribute__((packed));
815 /* Chapter 9.1.13 */
817  /* Semantic is from 10.5.2.5a */
819  uint8_t mob_alloc_len;
820  uint8_t mob_alloc[0];
821 } __attribute__((packed));
822 
823 /* Chapter 9.1.13b GPRS suspension request */
825  uint32_t tlli;
826  uint8_t ra_id[6];
827  uint8_t cause;
828  uint8_t options[0];
829 } __attribute__ ((packed));
830 
831 /* Chapter 10.5.2.2 */
833 #if OSMO_IS_LITTLE_ENDIAN
834  uint8_t bcc:3,
835  ncc:3,
836  arfcn_hi:2;
837  uint8_t arfcn_lo;
838 #elif OSMO_IS_BIG_ENDIAN
839 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
840  uint8_t arfcn_hi:2, ncc:3, bcc:3;
841  uint8_t arfcn_lo;
842 #endif
843 } __attribute__((packed));
844 
845 /* Chapter 9.1.15 */
846 struct gsm48_ho_cmd {
849  uint8_t ho_ref;
850  uint8_t power_command;
851  uint8_t data[0];
852 } __attribute__((packed));
853 
854 /* Chapter 9.1.18 */
856  uint8_t l2_plen;
857  uint8_t proto_discr;
858  uint8_t msg_type;
859  uint8_t page_mode;
862  uint8_t timing_advance;
863  uint8_t mob_alloc_len;
864  uint8_t mob_alloc[0];
865 } __attribute__ ((packed));
866 
867 /* Chapter 9.1.25 */
869 #if OSMO_IS_LITTLE_ENDIAN
870  uint8_t spare:4,
871  key_seq:4;
872  uint32_t classmark2;
873  uint8_t mi_len;
874  uint8_t mi[0];
875 #elif OSMO_IS_BIG_ENDIAN
876 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
877  uint8_t key_seq:4, spare:4;
878  uint32_t classmark2;
879  uint8_t mi_len;
880  uint8_t mi[0];
881 #endif
882 } __attribute__ ((packed));
883 
884 /* Chapter 10.5.1.3 */
886  uint8_t digits[3]; /* BCD! */
887  uint16_t lac;
888 } __attribute__ ((packed));
889 
890 /* Section 9.2.2 */
892 #if OSMO_IS_LITTLE_ENDIAN
893  uint8_t key_seq:4,
894  spare:4;
895  uint8_t rand[16];
896 #elif OSMO_IS_BIG_ENDIAN
897 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
898  uint8_t spare:4, key_seq:4;
899  uint8_t rand[16];
900 #endif
901 } __attribute__ ((packed));
902 
903 /* Section 9.2.3 */
905  uint8_t sres[4];
906 } __attribute__ ((packed));
907 
908 /* Section 9.2.15 */
910 #if OSMO_IS_LITTLE_ENDIAN
911  uint8_t type:4,
912  key_seq:4;
913  struct gsm48_loc_area_id lai;
914  struct gsm48_classmark1 classmark1;
915  uint8_t mi_len;
916  uint8_t mi[0];
917 #elif OSMO_IS_BIG_ENDIAN
918 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
919  uint8_t key_seq:4, type:4;
920  struct gsm48_loc_area_id lai;
921  struct gsm48_classmark1 classmark1;
922  uint8_t mi_len;
923  uint8_t mi[0];
924 #endif
925 } __attribute__ ((packed));
926 
927 /* Section 10.1 */
928 struct gsm48_hdr {
929  uint8_t proto_discr;
930  uint8_t msg_type;
931  uint8_t data[0];
932 } __attribute__ ((packed));
933 
934 /* Section 9.1.3x System information Type header */
936 #if OSMO_IS_LITTLE_ENDIAN
937  uint8_t l2_plen;
938  uint8_t rr_protocol_discriminator :4,
939  skip_indicator:4;
940  uint8_t system_information;
941 #elif OSMO_IS_BIG_ENDIAN
942 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
943  uint8_t l2_plen;
944  uint8_t skip_indicator:4, rr_protocol_discriminator:4;
945  uint8_t system_information;
946 #endif
947 } __attribute__ ((packed));
948 
949 /* Section 10.5.2.4 Cell Selection Parameters */
951 #if OSMO_IS_LITTLE_ENDIAN
952  uint8_t ms_txpwr_max_ccch:5, /* GSM 05.08 MS-TXPWR-MAX-CCCH */
953  cell_resel_hyst:3; /* GSM 05.08 CELL-RESELECT-HYSTERESIS */
954  uint8_t rxlev_acc_min:6, /* GSM 05.08 RXLEV-ACCESS-MIN */
955  neci:1,
956  acs:1;
957 #elif OSMO_IS_BIG_ENDIAN
958 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
959  uint8_t cell_resel_hyst:3, ms_txpwr_max_ccch:5;
960  uint8_t acs:1, neci:1, rxlev_acc_min:6;
961 #endif
962 } __attribute__ ((packed));
963 
964 /* 3GPP TS 44.018 Section 10.5.2.11 Control Channel Description */
966 #if OSMO_IS_LITTLE_ENDIAN
967  uint8_t ccch_conf :3,
968  bs_ag_blks_res :3,
969  att :1,
970  mscr :1;
971  uint8_t bs_pa_mfrms : 3,
972  spare_1 :2,
973  cbq3 :2,
974  spare_2 :1;
975  uint8_t t3212;
976 #elif OSMO_IS_BIG_ENDIAN
977 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
978  uint8_t mscr:1, att:1, bs_ag_blks_res:3, ccch_conf:3;
979  uint8_t spare_2:1, cbq3:2, spare_1:2, bs_pa_mfrms:3;
980  uint8_t t3212;
981 #endif
982 } __attribute__ ((packed));
983 
988 };
989 
990 /* Cell Options for SI6, SACCH (10.5.2.3a.2) or SI3, BCCH (Table 10.5.2.3.1),
991  3GPP TS 44.018 */
993 #if OSMO_IS_LITTLE_ENDIAN
994  uint8_t radio_link_timeout:4,
995  dtx:2,
996  pwrc:1,
997  /* either DN-IND or top bit of DTX IND */
998  d:1;
999 #elif OSMO_IS_BIG_ENDIAN
1000 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1001  uint8_t d:1, pwrc:1, dtx:2, radio_link_timeout:4;
1002 #endif
1003 } __attribute__ ((packed));
1004 
1005 /* Section 9.2.9 CM service request */
1007 #if OSMO_IS_LITTLE_ENDIAN
1008  uint8_t cm_service_type : 4,
1009  cipher_key_seq : 4;
1010  /* length + 3 bytes */
1011  uint32_t classmark;
1012  uint8_t mi_len;
1013  uint8_t mi[0];
1014  /* optional priority level */
1015 #elif OSMO_IS_BIG_ENDIAN
1016 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1017  uint8_t cipher_key_seq:4, cm_service_type:4;
1018  uint32_t classmark;
1019  uint8_t mi_len;
1020  uint8_t mi[0];
1021 #endif
1022 } __attribute__ ((packed));
1023 
1024 /* Section 9.1.31 System information Type 1 */
1028  struct gsm48_rach_control rach_control;
1029  uint8_t rest_octets[0]; /* NCH position on the CCCH */
1030 } __attribute__ ((packed));
1031 
1032 /* Section 9.1.32 System information Type 2 */
1035  uint8_t bcch_frequency_list[16];
1036  uint8_t ncc_permitted;
1037  struct gsm48_rach_control rach_control;
1038 } __attribute__ ((packed));
1039 
1040 /* Section 9.1.33 System information Type 2bis */
1043  uint8_t bcch_frequency_list[16];
1044  struct gsm48_rach_control rach_control;
1045  uint8_t rest_octets[0];
1046 } __attribute__ ((packed));
1047 
1048 /* Section 9.1.34 System information Type 2ter */
1052  uint8_t rest_octets[0];
1053 } __attribute__ ((packed));
1054 
1055 /* Section 9.1.34a System information Type 2quater */
1058  uint8_t rest_octets[0];
1059 } __attribute__ ((packed));
1060 
1061 /* Section 9.1.35 System information Type 3 */
1064  uint16_t cell_identity;
1069  struct gsm48_rach_control rach_control;
1070  uint8_t rest_octets[0];
1071 } __attribute__ ((packed));
1072 
1073 /* Section 9.1.36 System information Type 4 */
1078  struct gsm48_rach_control rach_control;
1079  /* optional CBCH conditional CBCH... followed by
1080  mandantory SI 4 Reset Octets
1081  */
1082  uint8_t data[0];
1083 } __attribute__ ((packed));
1084 
1085 /* Section 9.1.37 System information Type 5 */
1087 #if OSMO_IS_LITTLE_ENDIAN
1088  uint8_t rr_protocol_discriminator :4,
1089  skip_indicator:4;
1090  uint8_t system_information;
1091  uint8_t bcch_frequency_list[16];
1092 #elif OSMO_IS_BIG_ENDIAN
1093 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1094  uint8_t skip_indicator:4, rr_protocol_discriminator:4;
1095  uint8_t system_information;
1096  uint8_t bcch_frequency_list[16];
1097 #endif
1098 } __attribute__ ((packed));
1099 
1100 /* Section 9.1.38 System information Type 5bis */
1102 #if OSMO_IS_LITTLE_ENDIAN
1103  uint8_t rr_protocol_discriminator :4,
1104  skip_indicator:4;
1105  uint8_t system_information;
1106  uint8_t bcch_frequency_list[16];
1107 #elif OSMO_IS_BIG_ENDIAN
1108 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1109  uint8_t skip_indicator:4, rr_protocol_discriminator:4;
1110  uint8_t system_information;
1111  uint8_t bcch_frequency_list[16];
1112 #endif
1113 } __attribute__ ((packed));
1114 
1115 /* Section 9.1.39 System information Type 5ter */
1117 #if OSMO_IS_LITTLE_ENDIAN
1118  uint8_t rr_protocol_discriminator :4,
1119  skip_indicator:4;
1120  uint8_t system_information;
1121  uint8_t bcch_frequency_list[16];
1122 #elif OSMO_IS_BIG_ENDIAN
1123 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1124  uint8_t skip_indicator:4, rr_protocol_discriminator:4;
1125  uint8_t system_information;
1126  uint8_t bcch_frequency_list[16];
1127 #endif
1128 } __attribute__ ((packed));
1129 
1130 /* Section 9.1.40 System information Type 6 */
1132 #if OSMO_IS_LITTLE_ENDIAN
1133  uint8_t rr_protocol_discriminator :4,
1134  skip_indicator:4;
1135  uint8_t system_information;
1136  uint16_t cell_identity;
1137  struct gsm48_loc_area_id lai;
1138  struct gsm48_cell_options cell_options;
1139  uint8_t ncc_permitted;
1140  uint8_t rest_octets[0];
1141 #elif OSMO_IS_BIG_ENDIAN
1142 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1143  uint8_t skip_indicator:4, rr_protocol_discriminator:4;
1144  uint8_t system_information;
1145  uint16_t cell_identity;
1146  struct gsm48_loc_area_id lai;
1147  struct gsm48_cell_options cell_options;
1148  uint8_t ncc_permitted;
1149  uint8_t rest_octets[0];
1150 #endif
1151 } __attribute__ ((packed));
1152 
1153 /* Section 9.1.43a System Information type 13 */
1156  uint8_t rest_octets[0];
1157 } __attribute__ ((packed));
1158 
1159 /* Section 9.2.12 IMSI Detach Indication */
1162  uint8_t mi_len;
1163  uint8_t mi[0];
1164 } __attribute__ ((packed));
1165 
1166 /* Section 9.1.1 */
1168  /* Semantic is from 10.5.2.5 */
1170  uint8_t data[0];
1171 } __attribute__((packed));
1172 
1173 /* Section 9.1.3 */
1175  uint8_t rr_cause;
1176 } __attribute__((packed));
1177 
1178 /* Section 9.1.4 */
1180  uint8_t rr_cause;
1181 } __attribute__((packed));
1182 
1183 /* Section 9.1.3 */
1185  uint8_t rr_cause;
1186  uint8_t data[0];
1187 } __attribute__((packed));
1188 
1189 /* Section 9.1.4 */
1191  uint8_t rr_cause;
1192 } __attribute__((packed));
1193 
1194 /* Section 9.1.7 */
1196  uint8_t rr_cause;
1197  uint8_t data[0];
1198 } __attribute__((packed));
1199 
1200 /* Section 9.1.9 */
1202 #if OSMO_IS_LITTLE_ENDIAN
1203  uint8_t sc:1,
1204  alg_id:3,
1205  cr:1,
1206  spare:3;
1207 #elif OSMO_IS_BIG_ENDIAN
1208 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1209  uint8_t spare:3, cr:1, alg_id:3, sc:1;
1210 #endif
1211 } __attribute__((packed));
1212 
1213 /* Section 9.1.11 */
1215  uint8_t cm2_len;
1217  uint8_t data[0];
1218 } __attribute__((packed));
1219 
1220 /* Section 9.1.19 */
1222  uint8_t l2_plen;
1223  uint8_t proto_discr;
1224  uint8_t msg_type;
1225  uint8_t page_mode;
1232  uint8_t mob_alloc_len;
1233  uint8_t mob_alloc[0];
1234 } __attribute__ ((packed));
1235 
1236 /* Section 9.1.20 */
1238  uint8_t l2_plen;
1239  uint8_t proto_discr;
1240  uint8_t msg_type;
1241  uint8_t page_mode;
1243  uint8_t wait_ind1;
1245  uint8_t wait_ind2;
1247  uint8_t wait_ind3;
1249  uint8_t wait_ind4;
1250  uint8_t rest[0];
1251 } __attribute__ ((packed));
1252 
1253 /* Section 9.1.22 */
1255 #if OSMO_IS_LITTLE_ENDIAN
1256  uint8_t l2_plen;
1257  uint8_t proto_discr;
1258  uint8_t msg_type;
1259  uint8_t pag_mode:2,
1260  spare:2,
1261  cneed1:2,
1262  cneed2:2;
1263  uint8_t data[0];
1264 #elif OSMO_IS_BIG_ENDIAN
1265 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1266  uint8_t l2_plen;
1267  uint8_t proto_discr;
1268  uint8_t msg_type;
1269  uint8_t cneed2:2, cneed1:2, spare:2, pag_mode:2;
1270  uint8_t data[0];
1271 #endif
1272 } __attribute__((packed));
1273 
1274 /* Section 9.1.23 */
1276 #if OSMO_IS_LITTLE_ENDIAN
1277  uint8_t l2_plen;
1278  uint8_t proto_discr;
1279  uint8_t msg_type;
1280  uint8_t pag_mode:2,
1281  spare:2,
1282  cneed1:2,
1283  cneed2:2;
1284  uint32_t tmsi1;
1285  uint32_t tmsi2;
1286  uint8_t data[0];
1287 #elif OSMO_IS_BIG_ENDIAN
1288 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1289  uint8_t l2_plen;
1290  uint8_t proto_discr;
1291  uint8_t msg_type;
1292  uint8_t cneed2:2, cneed1:2, spare:2, pag_mode:2;
1293  uint32_t tmsi1;
1294  uint32_t tmsi2;
1295  uint8_t data[0];
1296 #endif
1297 } __attribute__((packed));
1298 
1299 /* Section 9.1.24 */
1301 #if OSMO_IS_LITTLE_ENDIAN
1302  uint8_t l2_plen;
1303  uint8_t proto_discr;
1304  uint8_t msg_type;
1305  uint8_t pag_mode:2,
1306  spare:2,
1307  cneed1:2,
1308  cneed2:2;
1309  uint32_t tmsi1;
1310  uint32_t tmsi2;
1311  uint32_t tmsi3;
1312  uint32_t tmsi4;
1313  uint8_t cneed3:2,
1314  cneed4:2,
1315  spare2:4;
1316  uint8_t rest[0];
1317 #elif OSMO_IS_BIG_ENDIAN
1318 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1319  uint8_t l2_plen;
1320  uint8_t proto_discr;
1321  uint8_t msg_type;
1322  uint8_t cneed2:2, cneed1:2, spare:2, pag_mode:2;
1323  uint32_t tmsi1;
1324  uint32_t tmsi2;
1325  uint32_t tmsi3;
1326  uint32_t tmsi4;
1327  uint8_t spare2:4, cneed4:2, cneed3:2;
1328  uint8_t rest[0];
1329 #endif
1330 } __attribute__((packed));
1331 
1332 /* Section 9.1.25 */
1334 #if OSMO_IS_LITTLE_ENDIAN
1335  uint8_t key_seq:3,
1336  spare:5;
1337  uint8_t cm2_len;
1338  struct gsm48_classmark2 cm2;
1339  uint8_t data[0];
1340 #elif OSMO_IS_BIG_ENDIAN
1341 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
1342  uint8_t spare:5, key_seq:3;
1343  uint8_t cm2_len;
1344  struct gsm48_classmark2 cm2;
1345  uint8_t data[0];
1346 #endif
1347 } __attribute__((packed));
1348 
1349 /* Section 9.1.29 */
1351  uint8_t rr_cause;
1352 } __attribute__((packed));
1353 
1354 /* Section 10.2 + GSM 04.07 12.2.3.1.1 + 3GPP TS 24.007 11.2.3.1.1 */
1355 #define GSM48_PDISC_GROUP_CC 0x00
1356 #define GSM48_PDISC_BCAST_CC 0x01
1357 #define GSM48_PDISC_PDSS1 0x02 /* 04.07 only */
1358 #define GSM48_PDISC_CC 0x03
1359 #define GSM48_PDISC_PDSS2 0x04 /* 04.07 only */
1360 #define GSM48_PDISC_GTTP 0x04 /* 24.007 only */
1361 #define GSM48_PDISC_MM 0x05
1362 #define GSM48_PDISC_RR 0x06
1363 #define GSM48_PDISC_MM_GPRS 0x08
1364 #define GSM48_PDISC_SMS 0x09
1365 #define GSM48_PDISC_SM_GPRS 0x0a
1366 #define GSM48_PDISC_NC_SS 0x0b
1367 #define GSM48_PDISC_LOC 0x0c
1368 #define GSM48_PDISC_EXTEND 0x0e
1369 #define GSM48_PDISC_TEST 0x0f /* as per 11.10, 04.14 */
1370 #define GSM48_PDISC_MASK 0x0f
1371 
1372 extern const struct value_string gsm48_pdisc_names[];
1373 static inline const char *gsm48_pdisc_name(uint8_t val)
1374 { return get_value_string(gsm48_pdisc_names, val); }
1375 
1376 bool gsm48_hdr_gmm_cipherable(const struct gsm48_hdr *hdr);
1377 
1378 static inline uint8_t gsm48_hdr_pdisc(const struct gsm48_hdr *hdr)
1379 {
1380  /*
1381  * 3GPP TS 24.007 version 12.0.0 Release 12,
1382  * 11.2.3.1.1 Protocol discriminator
1383  */
1384  uint8_t pdisc = hdr->proto_discr & GSM48_PDISC_MASK;
1385  if (pdisc == GSM48_PDISC_EXTEND)
1386  return hdr->proto_discr;
1387  return pdisc;
1388 }
1389 
1390 static inline uint8_t gsm48_hdr_trans_id(const struct gsm48_hdr *hdr)
1391 {
1392  /*
1393  * 3GPP TS 24.007 version 12.0.0 Release 12,
1394  * 11.2.3.1.3 Transaction identifier
1395  */
1396  return (hdr->proto_discr & 0xf0) >> 4;
1397 }
1398 
1399 #define GSM48_TA_INVALID 220
1400 
1406 static inline bool gsm48_ta_is_valid(uint8_t ta)
1407 {
1408  return (ta < 64);
1409 }
1410 
1411 static inline uint8_t gsm48_hdr_trans_id_flip_ti(const struct gsm48_hdr *hdr)
1412 {
1413  return gsm48_hdr_trans_id(hdr) ^ 0x08;
1414 }
1415 
1416 static inline uint8_t gsm48_hdr_trans_id_no_ti(const struct gsm48_hdr *hdr)
1417 {
1418  return gsm48_hdr_trans_id(hdr) & 0x07;
1419 }
1420 
1421 static inline uint8_t gsm48_hdr_msg_type_r98(const struct gsm48_hdr *hdr)
1422 {
1423  /*
1424  * 3GPP TS 24.007 version 12.0.0 Release 12,
1425  * 11.2.3.2.1 Message type octet (when accessing Release 98 and older
1426  * networks only)
1427  */
1428  switch (gsm48_hdr_pdisc(hdr)) {
1429  case GSM48_PDISC_MM:
1430  case GSM48_PDISC_CC:
1431  case GSM48_PDISC_NC_SS:
1432  case GSM48_PDISC_GROUP_CC:
1433  case GSM48_PDISC_BCAST_CC:
1434  case GSM48_PDISC_LOC:
1435  return hdr->msg_type & 0x3f;
1436  default:
1437  return hdr->msg_type;
1438  }
1439 }
1440 
1441 static inline uint8_t gsm48_hdr_msg_type_r99(const struct gsm48_hdr *hdr)
1442 {
1443  /*
1444  * 3GPP TS 24.007 version 12.0.0 Release 12,
1445  * 11.2.3.2.2 Message type octet (when accessing Release 99 and newer
1446  * networks)
1447  */
1448  switch (gsm48_hdr_pdisc(hdr)) {
1449  case GSM48_PDISC_MM:
1450  case GSM48_PDISC_CC:
1451  case GSM48_PDISC_NC_SS:
1452  return hdr->msg_type & 0x3f;
1453  case GSM48_PDISC_GROUP_CC:
1454  case GSM48_PDISC_BCAST_CC:
1455  case GSM48_PDISC_LOC:
1456  return hdr->msg_type & 0x3f;
1457  default:
1458  return hdr->msg_type;
1459  }
1460 }
1461 
1462 void gsm48_set_dtx(struct gsm48_cell_options *op, enum gsm48_dtx_mode full,
1463  enum gsm48_dtx_mode half, bool is_bcch);
1464 
1465 #define gsm48_hdr_msg_type gsm48_hdr_msg_type_r99
1466 
1467 /* Section 10.4 */
1468 #define GSM48_MT_RR_INIT_REQ 0x3c
1469 #define GSM48_MT_RR_ADD_ASS 0x3b
1470 #define GSM48_MT_RR_IMM_ASS 0x3f
1471 #define GSM48_MT_RR_IMM_ASS_EXT 0x39
1472 #define GSM48_MT_RR_IMM_ASS_REJ 0x3a
1473 #define GSM48_MT_RR_DTM_ASS_FAIL 0x48
1474 #define GSM48_MT_RR_DTM_REJECT 0x49
1475 #define GSM48_MT_RR_DTM_REQUEST 0x4A
1476 #define GSM48_MT_RR_PACKET_ASS 0x4B
1477 
1478 #define GSM48_MT_RR_CIPH_M_CMD 0x35
1479 #define GSM48_MT_RR_CIPH_M_COMPL 0x32
1480 
1481 #define GSM48_MT_RR_CFG_CHG_CMD 0x30
1482 #define GSM48_MT_RR_CFG_CHG_ACK 0x31
1483 #define GSM48_MT_RR_CFG_CHG_REJ 0x33
1484 
1485 #define GSM48_MT_RR_ASS_CMD 0x2e
1486 #define GSM48_MT_RR_ASS_COMPL 0x29
1487 #define GSM48_MT_RR_ASS_FAIL 0x2f
1488 #define GSM48_MT_RR_HANDO_CMD 0x2b
1489 #define GSM48_MT_RR_HANDO_COMPL 0x2c
1490 #define GSM48_MT_RR_HANDO_FAIL 0x28
1491 #define GSM48_MT_RR_HANDO_INFO 0x2d
1492 #define GSM48_MT_RR_HANDO_INFO 0x2d
1493 #define GSM48_MT_RR_DTM_ASS_CMD 0x4c
1494 
1495 #define GSM48_MT_RR_CELL_CHG_ORDER 0x08
1496 #define GSM48_MT_RR_PDCH_ASS_CMD 0x23
1497 
1498 #define GSM48_MT_RR_CHAN_REL 0x0d
1499 #define GSM48_MT_RR_PART_REL 0x0a
1500 #define GSM48_MT_RR_PART_REL_COMP 0x0f
1501 
1502 #define GSM48_MT_RR_PAG_REQ_1 0x21
1503 #define GSM48_MT_RR_PAG_REQ_2 0x22
1504 #define GSM48_MT_RR_PAG_REQ_3 0x24
1505 #define GSM48_MT_RR_PAG_RESP 0x27
1506 #define GSM48_MT_RR_NOTIF_NCH 0x20
1507 #define GSM48_MT_RR_NOTIF_FACCH 0x25 /* (Reserved) */
1508 #define GSM48_MT_RR_NOTIF_RESP 0x26
1509 #define GSM48_MT_RR_PACKET_NOTIF 0x4e
1510 #define GSM48_MT_RR_UTRAN_CLSM_CHG 0x60
1511 #define GSM48_MT_RR_CDMA2K_CLSM_CHG 0x62
1512 #define GSM48_MT_RR_IS_TO_UTRAN_HANDO 0x63
1513 #define GSM48_MT_RR_IS_TO_CDMA2K_HANDO 0x64
1514 
1515 #define GSM48_MT_RR_SYSINFO_8 0x18
1516 #define GSM48_MT_RR_SYSINFO_1 0x19
1517 #define GSM48_MT_RR_SYSINFO_2 0x1a
1518 #define GSM48_MT_RR_SYSINFO_3 0x1b
1519 #define GSM48_MT_RR_SYSINFO_4 0x1c
1520 #define GSM48_MT_RR_SYSINFO_5 0x1d
1521 #define GSM48_MT_RR_SYSINFO_6 0x1e
1522 #define GSM48_MT_RR_SYSINFO_7 0x1f
1523 
1524 #define GSM48_MT_RR_SYSINFO_2bis 0x02
1525 #define GSM48_MT_RR_SYSINFO_2ter 0x03
1526 #define GSM48_MT_RR_SYSINFO_2quater 0x07
1527 #define GSM48_MT_RR_SYSINFO_5bis 0x05
1528 #define GSM48_MT_RR_SYSINFO_5ter 0x06
1529 #define GSM48_MT_RR_SYSINFO_9 0x04
1530 #define GSM48_MT_RR_SYSINFO_13 0x00
1531 
1532 #define GSM48_MT_RR_SYSINFO_16 0x3d
1533 #define GSM48_MT_RR_SYSINFO_17 0x3e
1534 
1535 #define GSM48_MT_RR_SYSINFO_18 0x40
1536 #define GSM48_MT_RR_SYSINFO_19 0x41
1537 #define GSM48_MT_RR_SYSINFO_20 0x42
1538 
1539 #define GSM48_MT_RR_CHAN_MODE_MODIF 0x10
1540 #define GSM48_MT_RR_STATUS 0x12
1541 #define GSM48_MT_RR_CHAN_MODE_MODIF_ACK 0x17
1542 #define GSM48_MT_RR_FREQ_REDEF 0x14
1543 #define GSM48_MT_RR_MEAS_REP 0x15
1544 #define GSM48_MT_RR_CLSM_CHG 0x16
1545 #define GSM48_MT_RR_CLSM_ENQ 0x13
1546 #define GSM48_MT_RR_EXT_MEAS_REP 0x36
1547 #define GSM48_MT_RR_EXT_MEAS_REP_ORD 0x37
1548 #define GSM48_MT_RR_GPRS_SUSP_REQ 0x34
1549 #define GSM48_MT_RR_DTM_INFO 0x4d
1550 
1551 #define GSM48_MT_RR_VGCS_UPL_GRANT 0x09
1552 #define GSM48_MT_RR_UPLINK_RELEASE 0x0e
1553 #define GSM48_MT_RR_UPLINK_FREE 0x0c
1554 #define GSM48_MT_RR_UPLINK_BUSY 0x2a
1555 #define GSM48_MT_RR_TALKER_IND 0x11
1556 
1557 #define GSM48_MT_RR_APP_INFO 0x38
1558 
1559 /* Table 10.2/3GPP TS 04.08 */
1560 #define GSM48_MT_MM_IMSI_DETACH_IND 0x01
1561 #define GSM48_MT_MM_LOC_UPD_ACCEPT 0x02
1562 #define GSM48_MT_MM_LOC_UPD_REJECT 0x04
1563 #define GSM48_MT_MM_LOC_UPD_REQUEST 0x08
1564 
1565 #define GSM48_MT_MM_AUTH_REJ 0x11
1566 #define GSM48_MT_MM_AUTH_REQ 0x12
1567 #define GSM48_MT_MM_AUTH_RESP 0x14
1568 #define GSM48_MT_MM_AUTH_FAIL 0x1c
1569 #define GSM48_MT_MM_ID_REQ 0x18
1570 #define GSM48_MT_MM_ID_RESP 0x19
1571 #define GSM48_MT_MM_TMSI_REALL_CMD 0x1a
1572 #define GSM48_MT_MM_TMSI_REALL_COMPL 0x1b
1573 
1574 #define GSM48_MT_MM_CM_SERV_ACC 0x21
1575 #define GSM48_MT_MM_CM_SERV_REJ 0x22
1576 #define GSM48_MT_MM_CM_SERV_ABORT 0x23
1577 #define GSM48_MT_MM_CM_SERV_REQ 0x24
1578 #define GSM48_MT_MM_CM_SERV_PROMPT 0x25
1579 #define GSM48_MT_MM_CM_REEST_REQ 0x28
1580 #define GSM48_MT_MM_ABORT 0x29
1581 
1582 #define GSM48_MT_MM_NULL 0x30
1583 #define GSM48_MT_MM_STATUS 0x31
1584 #define GSM48_MT_MM_INFO 0x32
1585 
1586 /* Table 10.3/3GPP TS 04.08 */
1587 #define GSM48_MT_CC_ALERTING 0x01
1588 #define GSM48_MT_CC_CALL_CONF 0x08
1589 #define GSM48_MT_CC_CALL_PROC 0x02
1590 #define GSM48_MT_CC_CONNECT 0x07
1591 #define GSM48_MT_CC_CONNECT_ACK 0x0f
1592 #define GSM48_MT_CC_EMERG_SETUP 0x0e
1593 #define GSM48_MT_CC_PROGRESS 0x03
1594 #define GSM48_MT_CC_ESTAB 0x04
1595 #define GSM48_MT_CC_ESTAB_CONF 0x06
1596 #define GSM48_MT_CC_RECALL 0x0b
1597 #define GSM48_MT_CC_START_CC 0x09
1598 #define GSM48_MT_CC_SETUP 0x05
1599 
1600 #define GSM48_MT_CC_MODIFY 0x17
1601 #define GSM48_MT_CC_MODIFY_COMPL 0x1f
1602 #define GSM48_MT_CC_MODIFY_REJECT 0x13
1603 #define GSM48_MT_CC_USER_INFO 0x10
1604 #define GSM48_MT_CC_HOLD 0x18
1605 #define GSM48_MT_CC_HOLD_ACK 0x19
1606 #define GSM48_MT_CC_HOLD_REJ 0x1a
1607 #define GSM48_MT_CC_RETR 0x1c
1608 #define GSM48_MT_CC_RETR_ACK 0x1d
1609 #define GSM48_MT_CC_RETR_REJ 0x1e
1610 
1611 #define GSM48_MT_CC_DISCONNECT 0x25
1612 #define GSM48_MT_CC_RELEASE 0x2d
1613 #define GSM48_MT_CC_RELEASE_COMPL 0x2a
1614 
1615 #define GSM48_MT_CC_CONG_CTRL 0x39
1616 #define GSM48_MT_CC_NOTIFY 0x3e
1617 #define GSM48_MT_CC_STATUS 0x3d
1618 #define GSM48_MT_CC_STATUS_ENQ 0x34
1619 #define GSM48_MT_CC_START_DTMF 0x35
1620 #define GSM48_MT_CC_STOP_DTMF 0x31
1621 #define GSM48_MT_CC_STOP_DTMF_ACK 0x32
1622 #define GSM48_MT_CC_START_DTMF_ACK 0x36
1623 #define GSM48_MT_CC_START_DTMF_REJ 0x37
1624 #define GSM48_MT_CC_FACILITY 0x3a
1625 
1626 extern const struct value_string gsm48_rr_msgtype_names[];
1627 extern const struct value_string gsm48_mm_msgtype_names[];
1628 extern const struct value_string gsm48_cc_msgtype_names[];
1629 const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type);
1630 
1631 /* FIXME: Table 10.4 / 10.4a (GPRS) */
1632 
1633 /* Section 10.5.3.3 CM service type */
1643 };
1644 
1645 extern const struct value_string osmo_cm_service_type_names[];
1646 static inline const char *osmo_cm_service_type_name(enum osmo_cm_service_type val)
1648 
1649 /* Section 10.5.2.26, Table 10.5.64 */
1650 #define GSM48_PM_MASK 0x03
1651 #define GSM48_PM_NORMAL 0x00
1652 #define GSM48_PM_EXTENDED 0x01
1653 #define GSM48_PM_REORG 0x02
1654 #define GSM48_PM_SAME 0x03
1655 
1656 /* Chapter 10.5.3.5 / Table 10.5.93 */
1657 #define GSM48_LUPD_NORMAL 0x0
1658 #define GSM48_LUPD_PERIODIC 0x1
1659 #define GSM48_LUPD_IMSI_ATT 0x2
1660 #define GSM48_LUPD_RESERVED 0x3
1661 
1662 extern const struct value_string osmo_lu_type_names[];
1663 static inline const char *osmo_lu_type_name(uint8_t lu_type)
1664 { return get_value_string(osmo_lu_type_names, lu_type); }
1665 
1666 /* Table 10.5.4 */
1667 #define GSM_MI_TYPE_MASK 0x07
1668 #define GSM_MI_TYPE_NONE 0x00
1669 #define GSM_MI_TYPE_IMSI 0x01
1670 #define GSM_MI_TYPE_IMEI 0x02
1671 #define GSM_MI_TYPE_IMEISV 0x03
1672 #define GSM_MI_TYPE_TMSI 0x04
1673 #define GSM_MI_ODD 0x08
1674 
1675 #define GSM48_IE_MOBILE_ID 0x17 /* 10.5.1.4 */
1676 #define GSM48_IE_NAME_LONG 0x43 /* 10.5.3.5a */
1677 #define GSM48_IE_NAME_SHORT 0x45 /* 10.5.3.5a */
1678 #define GSM48_IE_UTC 0x46 /* 10.5.3.8 */
1679 #define GSM48_IE_NET_TIME_TZ 0x47 /* 10.5.3.9 */
1680 #define GSM48_IE_LSA_IDENT 0x48 /* 10.5.3.11 */
1681 #define GSM48_IE_NET_DST 0x49 /* 10.5.3.12 [24.008] */
1682 
1683 #define GSM48_IE_BEARER_CAP 0x04 /* 10.5.4.5 */
1684 #define GSM48_IE_CAUSE 0x08 /* 10.5.4.11 */
1685 #define GSM48_IE_CC_CAP 0x15 /* 10.5.4.5a */
1686 #define GSM48_IE_ALERT 0x19 /* 10.5.4.26 */
1687 #define GSM48_IE_FACILITY 0x1c /* 10.5.4.15 */
1688 #define GSM48_IE_PROGR_IND 0x1e /* 10.5.4.21 */
1689 #define GSM48_IE_AUX_STATUS 0x24 /* 10.5.4.4 */
1690 #define GSM48_IE_NOTIFY 0x27 /* 10.5.4.20 */
1691 #define GSM48_IE_KPD_FACILITY 0x2c /* 10.5.4.17 */
1692 #define GSM48_IE_SIGNAL 0x34 /* 10.5.4.23 */
1693 #define GSM48_IE_CONN_BCD 0x4c /* 10.5.4.13 */
1694 #define GSM48_IE_CONN_SUB 0x4d /* 10.5.4.14 */
1695 #define GSM48_IE_CALLING_BCD 0x5c /* 10.5.4.9 */
1696 #define GSM48_IE_CALLING_SUB 0x5d /* 10.5.4.10 */
1697 #define GSM48_IE_CALLED_BCD 0x5e /* 10.5.4.7 */
1698 #define GSM48_IE_CALLED_SUB 0x6d /* 10.5.4.8 */
1699 #define GSM48_IE_REDIR_BCD 0x74 /* 10.5.4.21a */
1700 #define GSM48_IE_REDIR_SUB 0x75 /* 10.5.4.21b */
1701 #define GSM48_IE_LOWL_COMPAT 0x7c /* 10.5.4.18 */
1702 #define GSM48_IE_HIGHL_COMPAT 0x7d /* 10.5.4.16 */
1703 #define GSM48_IE_USER_USER 0x7e /* 10.5.4.25 */
1704 #define GSM48_IE_SS_VERS 0x7f /* 10.5.4.24 */
1705 #define GSM48_IE_MORE_DATA 0xa0 /* 10.5.4.19 */
1706 #define GSM48_IE_CLIR_SUPP 0xa1 /* 10.5.4.11a */
1707 #define GSM48_IE_CLIR_INVOC 0xa2 /* 10.5.4.11b */
1708 #define GSM48_IE_REV_C_SETUP 0xa3 /* 10.5.4.22a */
1709 #define GSM48_IE_REPEAT_CIR 0xd1 /* 10.5.4.22 */
1710 #define GSM48_IE_REPEAT_SEQ 0xd3 /* 10.5.4.22 */
1711 
1712 /* Section 10.5.4.11 / Table 10.5.122 */
1713 #define GSM48_CAUSE_CS_GSM 0x60
1714 
1715 /* Section 9.1.2 / Table 9.3 */
1716 /* RR elements */
1717 #define GSM48_IE_VGCS_TARGET 0x01
1718 //#define GSM48_IE_VGCS_T_MODE_I 0x01
1719 #define GSM48_IE_FRQSHORT_AFTER 0x02
1720 #define GSM48_IE_MUL_RATE_CFG 0x03 /* 10.5.2.21aa */
1721 #define GSM48_IE_FREQ_L_AFTER 0x05
1722 #define GSM48_IE_MSLOT_DESC 0x10
1723 #define GSM48_IE_CHANMODE_2 0x11
1724 #define GSM48_IE_FRQSHORT_BEFORE 0x12
1725 //#define GSM48_IE_FRQSHORT_BEFOR 0x12
1726 #define GSM48_IE_CHANMODE_3 0x13
1727 #define GSM48_IE_CHANMODE_4 0x14
1728 #define GSM48_IE_CHANMODE_5 0x15
1729 #define GSM48_IE_CHANMODE_6 0x16
1730 #define GSM48_IE_CHANMODE_7 0x17
1731 #define GSM48_IE_CHANMODE_8 0x18
1732 #define GSM48_IE_CHANDESC_2 0x64
1733 #define GSM48_IE_MA_AFTER 0x72
1734 #define GSM48_IE_START_TIME 0x7c
1735 #define GSM48_IE_FREQ_L_BEFORE 0x19
1736 //#define GSM48_IE_FRQLIST_BEFORE 0x19
1737 #define GSM48_IE_CH_DESC_1_BEFORE 0x1c
1738 //#define GSM48_IE_CHDES_1_BEFORE 0x1c
1739 #define GSM48_IE_CH_DESC_2_BEFORE 0x1d
1740 //#define GSM48_IE_CHDES_2_BEFORE 0x1d
1741 #define GSM48_IE_F_CH_SEQ_BEFORE 0x1e
1742 //#define GSM48_IE_FRQSEQ_BEFORE 0x1e
1743 #define GSM48_IE_CLASSMARK3 0x20
1744 #define GSM48_IE_MA_BEFORE 0x21
1745 #define GSM48_IE_RR_PACKET_UL 0x22
1746 #define GSM48_IE_RR_PACKET_DL 0x23
1747 #define GSM48_IE_CELL_CH_DESC 0x62
1748 #define GSM48_IE_CHANMODE_1 0x63
1749 #define GSM48_IE_CHDES_2_AFTER 0x64
1750 #define GSM48_IE_MODE_SEC_CH 0x66
1751 #define GSM48_IE_F_CH_SEQ_AFTER 0x69
1752 #define GSM48_IE_MA_AFTER 0x72
1753 #define GSM48_IE_BA_RANGE 0x73
1754 #define GSM48_IE_GROUP_CHDES 0x74
1755 #define GSM48_IE_BA_LIST_PREF 0x75
1756 #define GSM48_IE_MOB_OVSERV_DIF 0x77
1757 #define GSM48_IE_REALTIME_DIFF 0x7b
1758 #define GSM48_IE_START_TIME 0x7c
1759 #define GSM48_IE_TIMING_ADVANCE 0x7d
1760 #define GSM48_IE_GROUP_CIP_SEQ 0x80
1761 #define GSM48_IE_CIP_MODE_SET 0x90
1762 #define GSM48_IE_GPRS_RESUMPT 0xc0
1763 #define GSM48_IE_SYNC_IND 0xd0
1764 /* System Information 4 (types are equal IEs above) */
1765 #define GSM48_IE_CBCH_CHAN_DESC 0x64
1766 #define GSM48_IE_CBCH_MOB_AL 0x72
1767 
1768 /* Additional MM elements */
1769 #define GSM48_IE_LOCATION_AREA 0x13
1770 #define GSM48_IE_AUTN 0x20
1771 #define GSM48_IE_AUTH_RES_EXT 0x21
1772 #define GSM48_IE_AUTS 0x22
1773 #define GSM48_IE_PRIORITY_LEV 0x80
1774 #define GSM48_IE_FOLLOW_ON_PROC 0xa1
1775 #define GSM48_IE_CTS_PERMISSION 0xa2
1776 
1777 /* Section 10.5.4.21 / Table 10.5.127 */
1778 
1787 };
1788 
1789 /* Section 10.5.4.23 / Table 10.5.130 */
1802 };
1803 
1804 /* Section 10.5.4.11 / Table 10.5.122 */
1810 };
1811 
1819  /* not defined */
1822 };
1823 
1824 /* 3GPP TS 44.018 10.5.2.31 RR Cause / Table 10.5.70 */
1843 };
1844 
1845 /* Section 10.5.4.11 CC Cause / Table 10.5.123 */
1896 };
1897 
1898 extern const struct value_string gsm48_cc_cause_names[];
1899 static inline const char *gsm48_cc_cause_name(enum gsm48_cc_cause val)
1900 { return get_value_string(gsm48_cc_cause_names, val); }
1901 
1902 /* Annex G, GSM specific cause values for mobility management */
1927 
1928  /* according to G.6 Additional cause codes for GMM */
1935 };
1936 
1937 extern const struct value_string gsm48_reject_value_names[];
1938 static inline const char *gsm48_reject_value_name(enum gsm48_reject_value val)
1940 
1961 };
1962 
1963 /* Chapter 11.3 */
1964 #define GSM48_T301 180, 0
1965 #define GSM48_T303 30, 0
1966 #define GSM48_T305 30, 0
1967 #define GSM48_T306 30, 0
1968 #define GSM48_T308 10, 0 /* no spec default */
1969 #define GSM48_T310 30, 0 /* no spec default */
1970 #define GSM48_T313 30, 0 /* no spec default */
1971 #define GSM48_T323 30, 0
1972 #define GSM48_T331 30, 0 /* no spec default */
1973 #define GSM48_T333 30, 0 /* no spec default */
1974 #define GSM48_T334 25, 0 /* min 15s */
1975 #define GSM48_T338 30, 0 /* no spec default */
1976 #define GSM48_T303_MS 30, 0
1977 #define GSM48_T305_MS 30, 0
1978 #define GSM48_T308_MS 30, 0
1979 #define GSM48_T310_MS 30, 0
1980 #define GSM48_T313_MS 30, 0
1981 #define GSM48_T323_MS 30, 0
1982 #define GSM48_T332_MS 30, 0
1983 #define GSM48_T335_MS 30, 0
1984 
1985 /* Chapter 5.1.2.2 */
1986 #define GSM_CSTATE_NULL 0
1987 #define GSM_CSTATE_INITIATED 1
1988 #define GSM_CSTATE_MM_CONNECTION_PEND 2 /* see 10.5.4.6 */
1989 #define GSM_CSTATE_MO_CALL_PROC 3
1990 #define GSM_CSTATE_CALL_DELIVERED 4
1991 #define GSM_CSTATE_CALL_PRESENT 6
1992 #define GSM_CSTATE_CALL_RECEIVED 7
1993 #define GSM_CSTATE_CONNECT_REQUEST 8
1994 #define GSM_CSTATE_MO_TERM_CALL_CONF 9
1995 #define GSM_CSTATE_ACTIVE 10
1996 #define GSM_CSTATE_DISCONNECT_REQ 12
1997 #define GSM_CSTATE_DISCONNECT_IND 12
1998 #define GSM_CSTATE_RELEASE_REQ 19
1999 #define GSM_CSTATE_MO_ORIG_MODIFY 26
2000 #define GSM_CSTATE_MO_TERM_MODIFY 27
2001 #define GSM_CSTATE_CONNECT_IND 28
2002 
2003 #define SBIT(a) (1 << a)
2004 #define ALL_STATES 0xffffffff
2005 
2006 /* Table 10.5.3/3GPP TS 04.08: Location Area Identification information element */
2007 #define GSM_LAC_RESERVED_DETACHED 0x0
2008 #define GSM_LAC_RESERVED_ALL_BTS 0xfffe
2009 
2010 /* GSM 04.08 Bearer Capability: Information Transfer Capability */
2018 };
2019 
2020 /* GSM 04.08 Bearer Capability: Transfer Mode */
2024 };
2025 
2026 /* GSM 04.08 Bearer Capability: Coding Standard */
2029 };
2030 
2031 /* GSM 04.08 Bearer Capability: Radio Channel Requirements */
2036 };
2037 
2038 /* GSM 04.08 Bearer Capability: Rate Adaption */
2044 };
2045 
2046 /* GSM 04.08 Bearer Capability: Signalling access protocol */
2054 };
2055 
2056 /* GSM 04.08 Bearer Capability: User Rate */
2065 };
2066 
2067 /* GSM 04.08 Bearer Capability: Parity */
2074 };
2075 
2076 /* GSM 04.08 Bearer Capability: Intermediate Rate */
2080 };
2081 
2082 /* GSM 04.08 Bearer Capability: Transparency */
2088 };
2089 
2090 /* GSM 04.08 Bearer Capability: Modem Type */
2101 };
2102 
2115 };
2116 
2117 #define GSM48_TMSI_LEN 5
2118 #define GSM48_MID_TMSI_LEN (GSM48_TMSI_LEN + 2)
2119 #define GSM48_MI_SIZE 32
2120 
2121 /* 3GPP TS 24.008 ยง 10.5.5.15 Routing area identification */
2122 struct gsm48_ra_id {
2123  uint8_t digits[3]; /* MCC + MNC BCD digits */
2124  uint16_t lac; /* Location Area Code */
2125  uint8_t rac; /* Routing Area Code */
2126 } __attribute__ ((packed));
2127 
2128 #define GSM48_CELL_CHAN_DESC_SIZE 16
2129 
2130 #define GSM_MACBLOCK_LEN 23
2131 #define GSM_MACBLOCK_PADDING 0x2b
2132 
2133 /* Table 10.5.118 / 3GPP TS 24.008 Section 10.5.4.7 */
2140  /* reserved */
2141 };
2142 
2143 /* Table 10.5.118 / 3GPP TS 24.008 Section 10.5.4.7 */
2152  /* reserved */
2153 };
Definition: gsm_04_08.h:808
gsm48_bcap_parity
Definition: gsm_04_08.h:2068
uint16_t lac
Definition: gsm_04_08.h:887
Definition: gsm_04_08.h:1797
Definition: gsm_04_08.h:2070
Definition: gsm_04_08.h:1201
Definition: gsm_04_08.h:794
Definition: gsm_04_08.h:1871
uint8_t msg_type
Definition: gsm_04_08.h:807
Definition: gsm_04_08.h:1174
Definition: gsm_04_08.h:2136
uint8_t mi[0]
Definition: gsm_04_08.h:807
Definition: gsm_04_08.h:928
gsm48_bcap_rrq
Definition: gsm_04_08.h:2032
Definition: gsm_04_08.h:1854
Definition: gsm_04_08.h:1932
Definition: gsm_04_08.h:1883
Definition: gsm_04_08.h:1857
Definition: gsm_04_08.h:1923
Definition: gsm_04_08.h:2139
Definition: gsm_04_08.h:2138
gsm48_numbering_plan
Definition: gsm_04_08.h:2144
Definition: gsm_04_08.h:1904
Definition: gsm_04_08.h:1796
Definition: gsm_04_08.h:1873
gsm48_bcap_sig_access
Definition: gsm_04_08.h:2047
uint8_t type
Definition: gsm_08_08.h:469
static int32_t smod(int32_t n, int32_t m)
Definition: gsm48_ie.c:797
uint8_t wait_ind4
Definition: gsm_04_08.h:1249
Definition: gsm_04_08.h:1880
Definition: gsm_04_08.h:1786
Definition: gsm_04_08.h:824
Definition: gsm_04_08.h:1831
Definition: gsm_04_08.h:1809
Definition: gsm_04_08.h:1860
enum gsm48_chan_mode __attribute__
Definition: gsm_04_08.h:1875
gsm48_chan_mode
Definition: gsm_04_08.h:792
Definition: gsm_04_08.h:846
Definition: gsm_04_08.h:1350
uint8_t l2_plen
Definition: gsm_04_08.h:805
Definition: gsm_04_08.h:756
Definition: gsm_04_08.h:1908
Definition: gsm_04_08.h:1131
Definition: gsm_04_08.h:1943
Definition: gsm_04_08.h:1851
gsm48_rr_cause
Definition: gsm_04_08.h:1825
void gsm48_set_dtx(struct gsm48_cell_options *op, enum gsm48_dtx_mode full, enum gsm48_dtx_mode half, bool is_bcch)
Set DTX mode in Cell Options IE (3GPP TS 44.018)
Definition: gsm48.c:591
Definition: gsm_04_08.h:1876
Definition: gsm_04_08.h:1890
Definition: gsm_04_08.h:800
Definition: gsm_04_08.h:2078
uint8_t mob_alloc_len
Definition: gsm_04_08.h:1232
const char * get_value_string(const struct value_string *vs, uint32_t val)
Definition: gsm_04_08.h:1784
Definition: gsm_04_08.h:1869
Definition: gsm_04_08.h:1920
Definition: gsm_04_08.h:793
Definition: gsm_04_08.h:1799
Definition: gsm_04_08.h:1056
gsm48_bcap_user_rate
Definition: gsm_04_08.h:2057
Definition: gsm_04_08.h:1835
Definition: gsm_04_08.h:798
Definition: gsm_04_08.h:1945
uint8_t rr_cause
Definition: gsm_04_08.h:1180
uint8_t ho_ref
Definition: gsm_04_08.h:849
Definition: gsm_04_08.h:1828
Definition: gsm_04_08.h:1888
Definition: gsm_04_08.h:1800
Definition: gsm_04_08.h:1795
uint8_t wait_ind1
Definition: gsm_04_08.h:1243
Definition: gsm_04_08.h:1951
Definition: gsm_04_08.h:2150
Definition: gsm_04_08.h:1955
static uint8_t gsm48_hdr_msg_type_r99(const struct gsm48_hdr *hdr)
Definition: gsm_04_08.h:1441
Definition: gsm_04_08.h:1826
Definition: gsm_04_08.h:935
gsm48_reject_value
Definition: gsm_04_08.h:1903
Definition: gsm_04_08.h:1930
Definition: gsm_04_08.h:1853
Definition: gsm_04_08.h:1006
Definition: gsm_04_08.h:1859
Definition: gsm_04_08.h:1879
Definition: gsm_04_08.h:2072
Definition: gsm_04_08.h:1841
Definition: gsm_04_08.h:1813
Definition: gsm_04_08.h:1953
gsm48_bcap_tmod
Definition: gsm_04_08.h:2021
Definition: gsm_04_08.h:532
Definition: gsm_04_08.h:1855
Definition: gsm_04_08.h:1905
uint8_t ext_bcch_frequency_list[16]
Definition: gsm_04_08.h:806
bool gsm48_hdr_gmm_cipherable(const struct gsm48_hdr *hdr)
Checks is particular message is cipherable in A/Gb mode according to 3GPP TS 24.008 ยง 4...
Definition: gsm48.c:477
static bool gsm48_acc_is_barred(struct gsm48_rach_control *rach_control, unsigned int acc)
Definition: gsm_04_08.h:731
gsm48_bcap_modem_type
Definition: gsm_04_08.h:2091
uint8_t proto_discr
Definition: gsm_04_08.h:929
Definition: gsm_04_08.h:1868
Definition: gsm_04_08.h:1839
Definition: gsm_04_08.h:1848
Definition: gsm_04_08.h:1913
uint8_t options[0]
Definition: gsm_04_08.h:808
Definition: gsm_04_08.h:1801
Definition: gsm_04_08.h:1300
Definition: gsm_04_08.h:1882
#define GSM48_PDISC_BCAST_CC
Definition: gsm_04_08.h:1356
Definition: gsm_04_08.h:2043
gsm48_signal_val
Definition: gsm_04_08.h:1790
uint8_t mode
Definition: gsm_04_08.h:789
Definition: gsm_04_08.h:2092
Definition: gsm_04_08.h:2086
#define OSMO_ASSERT(exp)
Definition: gsm_04_08.h:2052
Definition: gsm_04_08.h:1793
Definition: gsm_04_08.h:1958
uint8_t ra_id[6]
Definition: gsm_04_08.h:806
uint8_t wait_ind3
Definition: gsm_04_08.h:1247
static void gsm48_allow_acc(struct gsm48_rach_control *rach_control, unsigned int acc)
Definition: gsm_04_08.h:716
Definition: gsm_04_08.h:987
Definition: gsm_04_08.h:2014
uint8_t page_mode
Definition: gsm_04_08.h:1241
Definition: gsm_04_08.h:2063
Definition: gsm_04_08.h:1818
Definition: gsm_04_08.h:2149
Definition: gsm_04_08.h:2147
gsm48_dtx_mode
Definition: gsm_04_08.h:984
Definition: gsm_04_08.h:1806
Definition: gsm_04_08.h:2049
#define GSM48_PDISC_CC
Definition: gsm_04_08.h:1358
uint8_t mob_alloc_len
Definition: gsm_04_08.h:819
const struct value_string gsm48_mm_msgtype_names[]
TS 04.08 MM Message Type names.
Definition: gsm48.c:915
Definition: gsm_04_08.h:681
Definition: gsm_04_08.h:1086
uint8_t timing_advance1
Definition: gsm_04_08.h:1228
Definition: gsm_04_08.h:1049
Definition: gsm_04_08.h:1893
uint8_t cell_channel_description[16]
Definition: gsm_04_08.h:806
Definition: gsm_04_08.h:816
Definition: gsm_04_08.h:29
uint8_t rr_cause
Definition: gsm_04_08.h:1196
gsm48_cc_cause
Definition: gsm_04_08.h:1846
Definition: gsm_04_08.h:1842
Definition: gsm_04_08.h:1887
#define GSM48_PDISC_NC_SS
Definition: gsm_04_08.h:1366
Definition: gsm_04_08.h:1866
Definition: gsm_04_08.h:1838
Definition: gsm_04_08.h:1874
Definition: gsm_04_08.h:2035
struct gsm48_req_ref req_ref3
Definition: gsm_04_08.h:813
const struct value_string gsm48_cc_msgtype_names[]
TS 04.08 CC Message Type names.
Definition: gsm48.c:945
static const char * gsm48_pdisc_name(uint8_t val)
Definition: gsm_04_08.h:1373
Definition: gsm_04_08.h:343
uint8_t proto_discr
Definition: gsm_04_08.h:1239
Definition: gsm_04_08.h:1921
Definition: gsm_04_08.h:2122
Definition: gsm_04_08.h:2073
static uint8_t gsm48_hdr_trans_id_no_ti(const struct gsm48_hdr *hdr)
Definition: gsm_04_08.h:1416
uint8_t proto_discr
Definition: gsm_04_08.h:1223
Definition: gsm_04_08.h:2017
Definition: gsm_04_08.h:2061
Definition: gsm_04_08.h:2135
struct gsm48_req_ref req_ref
Definition: gsm_04_08.h:810
uint8_t page_mode
Definition: gsm_04_08.h:859
gsm48_bcap_coding
Definition: gsm_04_08.h:2027
struct gsm48_chan_desc chan_desc2
Definition: gsm_04_08.h:812
Definition: gsm_04_08.h:2099
Definition: gsm_04_08.h:1116
static uint8_t gsm48_hdr_trans_id(const struct gsm48_hdr *hdr)
Definition: gsm_04_08.h:1390
Definition: gsm_04_08.h:950
Definition: gsm_04_08.h:1254
const struct value_string gsm48_rr_msgtype_names[]
TS 04.08 RR Message Type names.
Definition: gsm48.c:822
Definition: gsm_04_08.h:1792
Definition: gsm_04_08.h:1190
Definition: gsm_04_08.h:799
Definition: gsm_04_08.h:1867
gsm48_bcap_ra
Definition: gsm_04_08.h:2039
Definition: gsm_04_08.h:1635
Definition: gsm_04_08.h:1195
#define GSM48_PDISC_MM
Definition: gsm_04_08.h:1361
GSM HR V4 (OHR AMR-WB)
Definition: gsm_04_08.h:2112
struct gsm48_cell_desc cell_desc
Definition: gsm_04_08.h:805
Definition: gsm_04_08.h:2094
Definition: gsm_04_08.h:1816
Definition: gsm_04_08.h:1914
struct gsm48_req_ref req_ref4
Definition: gsm_04_08.h:815
Definition: gsm_04_08.h:1909
Definition: gsm_04_08.h:1837
Definition: gsm_04_08.h:1836
uint8_t ncc_permitted
Definition: gsm_04_08.h:1036
uint32_t tlli
Definition: gsm_04_08.h:825
uint8_t mi_len
Definition: gsm_04_08.h:806
uint8_t rr_cause
Definition: gsm_04_08.h:1191
Definition: gsm_04_08.h:1820
static uint8_t gsm48_hdr_trans_id_flip_ti(const struct gsm48_hdr *hdr)
Definition: gsm_04_08.h:1411
Definition: gsm_04_08.h:1957
Definition: gsm_04_08.h:2071
Definition: gsm_04_08.h:1815
struct gsm48_control_channel_descr control_channel_desc
Definition: gsm_04_08.h:808
const struct value_string osmo_lu_type_names[]
Definition: gsm48.c:1140
GSM HR V6 (OHR AMR)
Definition: gsm_04_08.h:2114
Definition: gsm_04_08.h:855
Definition: gsm_04_08.h:1892
uint8_t proto_discr
Definition: gsm_04_08.h:806
Definition: gsm_04_08.h:1956
Definition: gsm_04_08.h:2098
GSM FR V5 (FR AMR-WB)
Definition: gsm_04_08.h:2113
struct gsm48_cell_options cell_options
Definition: gsm_04_08.h:809
Definition: gsm_04_08.h:2064
Definition: gsm_04_08.h:1807
Definition: gsm_04_08.h:1827
Definition: gsm_04_08.h:740
Definition: gsm_04_08.h:1642
Definition: gsm_04_08.h:2087
Definition: gsm_04_08.h:583
Definition: gsm_04_08.h:2042
Definition: gsm_04_08.h:1954
Definition: gsm_04_08.h:1934
Definition: gsm_04_08.h:1640
Definition: gsm_04_08.h:909
Definition: gsm_04_08.h:1946
uint8_t power_command
Definition: gsm_04_08.h:850
Definition: gsm_04_08.h:1782
Definition: gsm_04_08.h:1781
struct gsm48_rach_control rach_control
Definition: gsm_04_08.h:807
Definition: gsm_04_08.h:1865
Definition: gsm_04_08.h:2028
Definition: gsm_04_08.h:1033
Definition: gsm_04_08.h:1863
Definition: gsm_04_08.h:1924
Definition: gsm_04_08.h:1881
Definition: gsm_04_08.h:226
Definition: gsm_04_08.h:1891
Definition: gsm_04_08.h:1911
Definition: gsm_04_08.h:885
Definition: gsm_04_08.h:2062
Definition: gsm_04_08.h:1074
Definition: gsm_04_08.h:15
Definition: gsm_04_08.h:1821
uint8_t digits[3]
Definition: gsm_04_08.h:805
Definition: gsm_04_08.h:2085
Definition: gsm_04_08.h:1926
uint8_t timing_advance2
Definition: gsm_04_08.h:1231
uint8_t bcch_frequency_list[16]
Definition: gsm_04_08.h:806
uint8_t msg_type
Definition: gsm_04_08.h:930
Definition: gsm_04_08.h:1864
Definition: gsm_04_08.h:1833
Definition: gsm_04_08.h:1906
Definition: gsm_04_08.h:2137
Definition: gsm_04_08.h:1918
Definition: gsm_04_08.h:2097
chreq_type
Definition: gsm_04_08.h:1941
gsm48_bcap_itcap
Definition: gsm_04_08.h:2011
Definition: gsm_04_08.h:1639
const struct value_string gsm48_reject_value_names[]
Definition: gsm48.c:1087
Definition: gsm_04_08.h:1933
Definition: gsm_04_08.h:2151
struct gsm48_chan_desc chan_desc
Definition: gsm_04_08.h:732
Definition: gsm_04_08.h:1910
uint8_t wait_ind2
Definition: gsm_04_08.h:1245
uint8_t page_mode
Definition: gsm_04_08.h:1225
static const char * osmo_lu_type_name(uint8_t lu_type)
Definition: gsm_04_08.h:1663
struct gsm48_classmark2 cm2
Definition: gsm_04_08.h:806
#define GSM48_PDISC_LOC
Definition: gsm_04_08.h:1367
Definition: gsm_04_08.h:1275
const char * gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type)
Compose a string naming the message type for given protocol.
Definition: gsm48.c:1056
#define GSM48_PDISC_MASK
Definition: gsm_04_08.h:1370
uint8_t cause
Definition: gsm_04_08.h:827
GSM FR V4 (OFR AMR-WB)
Definition: gsm_04_08.h:2111
static const char * gsm48_reject_value_name(enum gsm48_reject_value val)
Definition: gsm_04_08.h:1938
Definition: gsm_04_08.h:1791
Definition: gsm_04_08.h:2060
Definition: gsm_04_08.h:985
uint8_t data[0]
Definition: gsm_04_08.h:808
Definition: gsm_04_08.h:2022
uint8_t mob_alloc[0]
Definition: gsm_04_08.h:808
Definition: gsm_04_08.h:1794
Definition: gsm_04_08.h:1877
Definition: gsm_04_08.h:2040
static const char * osmo_cm_service_type_name(enum osmo_cm_service_type val)
Definition: gsm_04_08.h:1646
gsm48_bcap_interm_rate
Definition: gsm_04_08.h:2077
Definition: gsm_04_08.h:1184
Definition: gsm_04_08.h:1852
Definition: gsm_04_08.h:1780
Definition: gsm_04_08.h:2041
Definition: gsm_04_08.h:669
uint8_t l2_plen
Definition: gsm_04_08.h:856
uint8_t timing_advance
Definition: gsm_04_08.h:862
uint8_t rest_octets[0]
Definition: gsm_04_08.h:808
Definition: gsm_04_08.h:1960
Definition: gsm_04_08.h:1179
Definition: gsm_04_08.h:115
Definition: gsm_04_08.h:1948
uint16_t cell_identity
Definition: gsm_04_08.h:1064
Definition: gsm_04_08.h:797
Definition: gsm_04_08.h:2093
Definition: gsm_04_08.h:1912
struct gsm48_system_information_type_header header
Definition: gsm_04_08.h:805
Definition: gsm_04_08.h:1929
Definition: gsm_04_08.h:1862
Definition: gsm_04_08.h:796
gsm48_bcap_transp
Definition: gsm_04_08.h:2083
GSM HR V1 (GSM HR)
Definition: gsm_04_08.h:2107
uint8_t rac
Definition: gsm_04_08.h:2125
const struct value_string osmo_cm_service_type_names[]
Definition: gsm48.c:1148
uint8_t msg_type
Definition: gsm_04_08.h:1240
Definition: gsm_04_08.h:1942
const struct value_string gsm48_chan_mode_names[]
Definition: gsm48.c:397
Definition: gsm_04_08.h:1025
Definition: gsm_04_08.h:1834
Definition: gsm_04_08.h:1167
uint8_t l2_plen
Definition: gsm_04_08.h:1222
uint8_t msg_type
Definition: gsm_04_08.h:1224
Definition: gsm_04_08.h:891
static const char * gsm48_cc_cause_name(enum gsm48_cc_cause val)
Definition: gsm_04_08.h:1899
uint8_t mi_len
Definition: gsm_04_08.h:1162
uint8_t rr_cause
Definition: gsm_04_08.h:1175
Definition: gsm_04_08.h:1884
struct gsm48_req_ref req_ref2
Definition: gsm_04_08.h:813
Definition: gsm_04_08.h:1850
Definition: gsm_04_08.h:1849
Definition: gsm_04_08.h:1062
Definition: gsm_04_08.h:1798
Definition: gsm_04_08.h:1878
Definition: gsm_04_08.h:2016
Definition: gsm_04_08.h:965
gsm48_progress_desc
Definition: gsm_04_08.h:1779
#define GSM48_PDISC_EXTEND
Definition: gsm_04_08.h:1368
Definition: gsm_04_08.h:904
Definition: gsm_04_08.h:1886
Definition: gsm_04_08.h:1919
Definition: gsm_04_08.h:1817
uint8_t msg_type
Definition: gsm_04_08.h:858
Definition: gsm_04_08.h:1847
Definition: gsm_04_08.h:1949
Definition: gsm_04_08.h:2146
uint16_t lac
Definition: gsm_04_08.h:2124
Definition: gsm_04_08.h:2050
Definition: gsm_04_08.h:468
Definition: gsm_04_08.h:1952
Definition: gsm_04_08.h:2023
Definition: gsm_04_08.h:770
uint8_t rr_cause
Definition: gsm_04_08.h:1185
osmo_cm_service_type
Definition: gsm_04_08.h:1634
Definition: gsm_04_08.h:868
uint8_t mob_alloc_len
Definition: gsm_04_08.h:863
Definition: gsm_04_08.h:1830
Definition: gsm_04_08.h:2059
uint8_t sres[4]
Definition: gsm_04_08.h:805
Definition: gsm_04_08.h:1870
gsm48_cause_loc
Definition: gsm_04_08.h:1812
Definition: gsm_04_08.h:2013
Definition: gsm_04_08.h:1840
Definition: gsm_04_08.h:1922
Definition: gsm_04_08.h:787
Definition: gsm_04_08.h:1889
Definition: gsm_04_08.h:1154
Definition: gsm_04_08.h:1858
Definition: gsm_04_08.h:986
Definition: gsm_04_08.h:2084
uint16_t cell_identity
Definition: gsm_04_08.h:806
Definition: gsm_04_08.h:1636
static const char * gsm48_chan_mode_name(enum gsm48_chan_mode val)
Definition: gsm_04_08.h:804
struct gsm48_classmark1 classmark1
Definition: gsm_04_08.h:805
Definition: gsm_04_08.h:1637
Definition: gsm_04_08.h:2069
Definition: gsm_04_08.h:2148
Definition: gsm_04_08.h:1101
uint8_t cm2_len
Definition: gsm_04_08.h:805
Definition: gsm_04_08.h:1333
Definition: gsm_04_08.h:2053
Definition: gsm_04_08.h:646
gsm48_type_of_number
Definition: gsm_04_08.h:2134
uint8_t cm2_len
Definition: gsm_04_08.h:1215
uint8_t ncc_permitted
Definition: gsm_04_08.h:807
Definition: gsm_04_08.h:1917
const struct value_string gsm48_pdisc_names[]
TS 04.08 Protocol Descriptor names.
Definition: gsm48.c:803
const struct value_string gsm48_cc_cause_names[]
TS 04.08 10.5..4.11 Call Control Cause Values.
Definition: gsm48.c:988
Definition: gsm_04_08.h:1041
gsm48_cause_coding
Definition: gsm_04_08.h:1805
GSM FR V3 (FR AMR)
Definition: gsm_04_08.h:2109
Definition: gsm_04_08.h:1160
gsm48_bcap_speech_ver
GSM 04.08 Bearer Capability: Speech Version Indication (See also 3GPP TS 24.008, Table 10...
Definition: gsm_04_08.h:2105
uint8_t chan_nr
Definition: gsm_04_08.h:551
Definition: gsm_04_08.h:1641
Definition: gsm_04_08.h:2051
Definition: gsm_04_08.h:2100
struct gsm48_loc_area_id lai
Definition: gsm_04_08.h:807
GSM FR V2 (GSM EFR)
Definition: gsm_04_08.h:2108
Definition: gsm_04_08.h:1814
Definition: gsm_04_08.h:1950
Definition: gsm_04_08.h:1931
Definition: gsm_04_08.h:1895
Definition: gsm_04_08.h:1856
#define GSM48_PDISC_GROUP_CC
Definition: gsm_04_08.h:1355
uint8_t power_command
Definition: gsm_04_08.h:807
struct gsm48_chan_desc chan_desc1
Definition: gsm_04_08.h:809
GSM HR V3 (HR_AMR)
Definition: gsm_04_08.h:2110
struct gsm48_req_ref req_ref1
Definition: gsm_04_08.h:810
Definition: gsm_04_08.h:1944
Definition: gsm_04_08.h:2012
struct gsm48_cell_sel_par cell_sel_par
Definition: gsm_04_08.h:810
Definition: gsm_04_08.h:1221
Definition: gsm_04_08.h:1829
Definition: gsm_04_08.h:2058
Definition: gsm_04_08.h:992
Definition: gsm_04_08.h:1947
Definition: gsm_04_08.h:1785
Definition: gsm_04_08.h:1832
Definition: gsm_04_08.h:1885
static bool gsm48_ta_is_valid(uint8_t ta)
Check if TA is valid according to 3GPP TS 44.018 ยง 10.5.2.40.
Definition: gsm_04_08.h:1406
uint8_t rest[0]
Definition: gsm_04_08.h:817
Definition: gsm_04_08.h:1872
Definition: gsm_04_08.h:1783
Definition: gsm_04_08.h:1907
Definition: gsm_04_08.h:795
uint8_t l2_plen
Definition: gsm_04_08.h:1238
Definition: gsm_04_08.h:832
Definition: gsm_04_08.h:2034
Definition: gsm_04_08.h:2079
Definition: gsm_04_08.h:1915
Definition: gsm_04_08.h:550
Definition: gsm_04_08.h:1638
Definition: gsm_04_08.h:1808
Definition: gsm_04_08.h:1925
static void gsm48_barr_acc(struct gsm48_rach_control *rach_control, unsigned int acc)
Definition: gsm_04_08.h:702
Definition: gsm_04_08.h:2095
Definition: gsm_04_08.h:1959
uint8_t proto_discr
Definition: gsm_04_08.h:857
Definition: gsm_04_08.h:1916
Definition: gsm_04_08.h:2015
static uint8_t gsm48_hdr_pdisc(const struct gsm48_hdr *hdr)
Definition: gsm_04_08.h:1378
Definition: gsm_04_08.h:2048
Definition: gsm_04_08.h:2096
Definition: gsm_04_08.h:1214
Definition: gsm_04_08.h:1894
static uint8_t gsm48_hdr_msg_type_r98(const struct gsm48_hdr *hdr)
Definition: gsm_04_08.h:1421
Definition: gsm_04_08.h:2145
Definition: gsm_04_08.h:1237
uint8_t rr_cause
Definition: gsm_04_08.h:1351
GSM FR V1 (GSM FR)
Definition: gsm_04_08.h:2106
Definition: gsm_04_08.h:2033
Definition: gsm_04_08.h:1861