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