blob: c20514032550cd062fdf8d3bccd76cd89700eda6 [file] [log] [blame]
Harald Weltea082a692017-07-15 15:58:13 +02001/* Encoding/Decoding routines for GSM System Information messages
2 * according to 3GPP TS 44.018 Version 12.3.0 Release 12 */
3
4/* (C) 2017 by Harald Welte <laforge@gnumonks.org> */
5
6module GSM_Types {
7
8 import from General_Types all;
9 import from Osmocom_Types all;
10
Harald Weltebdc5dbd2017-07-16 00:00:43 +020011 type integer GsmArfcn (0..1023);
12 type integer UmtsArfcn (0..16383);
13 type integer UmtsScramblingCode (0..511);
Harald Welted2e342f2017-07-16 07:34:13 +020014 const integer GsmMaxFrameNumber := 26*51*2048;
15 type integer GsmFrameNumber (0..GsmMaxFrameNumber);
16 type integer GsmRxLev (0..63);
17 type integer GsmTsc (0..7) with { variant "FIELDLENGTH(8)" };
18 type uint32_t GsmTmsi;
Harald Weltebdc5dbd2017-07-16 00:00:43 +020019
Harald Weltea082a692017-07-15 15:58:13 +020020 /* Table 10.4.1 of Section 10.4 / 3GPP TS 44.018 */
21 type enumerated RrMessageType {
22 ADDITIONAL_ASSIGNMENT ('00111011'B),
23 IMMEDIATE_ASSIGNMENT ('00111111'B),
24 IMMEDIATE_ASSIGNMENT_EXTENDED ('00111001'B),
25 IMMEDIATE_ASSIGNMENT_REJECT ('00111010'B),
26 IMMEDIATE_PACKET_ASSIGNMENT ('01101001'B),
27
28 CIPHERING_MODE_COMMAND ('00110101'B),
29 CIPHERING_MODE_COMPLETE ('00110010'B),
30
31 CONFIGURATION_CHANGE_COMMAND ('00110000'B),
32 CONFIGURATION_CHANGE_ACK ('00110001'B),
33 CONFIGURATION_CHANGE_REJECT ('00110011'B),
34
35 ASSIGNMENT_COMMAND ('00101110'B),
36 ASSIGNMENT_COMPLETE ('00101001'B),
37 ASSIGNMENT_FAILURE ('00101111'B),
38 HANDOVER_COMMAND ('00101011'B),
39 HANDOVER_COMPLETE ('00101100'B),
40 HANDOVER_FAILURE ('00101000'B),
41 PHYSICAL_INFORMATION ('00101101'B),
42
43 CHANNEL_RELEASE ('00001101'B),
44 PARTIAL_RELEASE ('00001010'B),
45 PARTIAL_RELEASE_COMPLETE ('00001111'B),
46
47 PAGING_REQUEST_TYPE_1 ('00100001'B),
48 PAGING_REQUEST_TYPE_2 ('00100010'B),
49 PAGING_REQUEST_TYPE_3 ('00100100'B),
50 PAGING_RESPONSE ('00100111'B),
51 NOTIFICATION_NCH ('00100000'B),
52 NOTIFICATION_RESPOSNE ('00100110'B),
53
54 SYSTEM_INFORMATION_TYPE_8 ('00011000'B),
55 SYSTEM_INFORMATION_TYPE_1 ('00011001'B),
56 SYSTEM_INFORMATION_TYPE_2 ('00011010'B),
57 SYSTEM_INFORMATION_TYPE_3 ('00011011'B),
58 SYSTEM_INFORMATION_TYPE_4 ('00011100'B),
59 SYSTEM_INFORMATION_TYPE_5 ('00011101'B),
60 SYSTEM_INFORMATION_TYPE_6 ('00011110'B),
61 SYSTEM_INFORMATION_TYPE_7 ('00011111'B),
62 SYSTEM_INFORMATION_TYPE_2bis ('00000010'B),
63 SYSTEM_INFORMATION_TYPE_2ter ('00000011'B),
64 SYSTEM_INFORMATION_TYPE_2quater ('00000111'B),
65 SYSTEM_INFORMATION_TYPE_5bis ('00000101'B),
66 SYSTEM_INFORMATION_TYPE_5ter ('00000110'B),
67 SYSTEM_INFORMATION_TYPE_9 ('00000100'B),
68 SYSTEM_INFORMATION_TYPE_13 ('00000000'B),
69
70 SYSTEM_INFORMATION_TYPE_16 ('00111101'B),
71 SYSTEM_INFORMATION_TYPE_17 ('00111110'B),
72
73 CHANNEL_MODE_MODIFY ('00010000'B),
74 RR_STATUS ('00010010'B),
75 CHANNEL_MODE_MODIFY_ACKNOWLEDGE ('00010111'B),
76 FREQUENCY_REDEFINITION ('00010100'B),
77 MEASUREMENT_REPORT ('00010101'B),
78 CLASSMARK_CHANGE ('00010110'B),
79 CLASSMARK_ENQUIRY ('00010011'B),
80 EXTENDED_MEASUREMENT_REPORT ('00110110'B),
81 EXTENDED_MEASUREMENT_ORDER ('00110111'B),
82 GPRS_SUSPENSION_REQUEST ('00110100'B),
83 //MBMS_ANNOUNCEMENT ('00010110'B), duplicate?
84 //SERVICE_INFORMATION ('00110110'B), duplicate?
85
86 APPLICATION_INFORMATION ('00111000'B),
87
88 SYSTEM_INFORMATION_TYPE_14 ('00000001'B),
89 SYSTEM_INFORMATION_TYPE_15 ('01000011'B),
90 SYSTEM_INFORMATION_TYPE_18 ('01000000'B),
91 SYSTEM_INFORMATION_TYPE_19 ('01000001'B),
92 SYSTEM_INFORMATION_TYPE_20 ('01000010'B),
93 SYSTEM_INFORMATION_TYPE_13alt ('01000100'B),
94 SYSTEM_INFORMATION_TYPE_2n ('01000101'B),
95 SYSTEM_INFORMATION_TYPE_21 ('01000110'B),
96 SYSTEM_INFORMATION_TYPE_22 ('01000111'B),
97 SYSTEM_INFORMATION_TYPE_23 ('01001111'B),
98
99 DTM_ASSIGNMENT_FAILURE ('01001000'B),
100 DTM_REJECT ('01001001'B),
101 DTM_REQUEST ('01001010'B),
102 PACKET_ASSIGNMENT ('01001011'B),
103 DTM_ASSIGNMENT_COMMAND ('01001100'B),
104 DTM_INFORMATION ('01001101'B),
105 PACKET_INFORMATION ('01001110'B),
106
107 UTRAN_CLASSMARK_CHANGE ('01100000'B),
108 CDMA2000_CLASSMARK_CHANGE ('01100010'B),
109 INTERSYS_TO_UTRAN_HO_CMD ('01100011'B),
110 INTERSYS_TO_CDMA2000_HO_CMD ('01100100'B),
111 GERAN_IU_MODE_CLASSMARK_CHG ('01100101'B),
112 INTERSYS_TO_EUTRAN_HO_CMD ('01100110'B)
113 } with { variant "FIELDLENGTH(8)" };
114
Harald Welted2e342f2017-07-16 07:34:13 +0200115 type octetstring RestOctets with { variant "PADDING(yes), PADDING_PATTERN('00101011'B)" };
116 type hexstring GsmBcdString with { variant "HEXORDER(low)" };
117 type GsmBcdString BcdMccMnc with { variant "FIELDLENGTH(6)" };
118
119 type record L2PseudoLength {
120 uint6_t l2_plen,
121 BIT2 zero_one
122 } with { variant "" };
123
124 template L2PseudoLength t_L2Pseudolength(template uint6_t len) := {
125 l2_plen := len,
126 zero_one := '01'B
127 };
128
129 type record RrHeader {
130 L2PseudoLength l2_plen,
131 uint4_t skip_indicator,
132 uint4_t rr_protocol_discriminator,
133 RrMessageType message_type
134 } with { variant "" };
135
136 template RrHeader t_RrHeader(RrMessageType msg_type, template uint6_t len) := {
137 l2_plen := t_L2Pseudolength(len),
138 skip_indicator := 0,
139 rr_protocol_discriminator := 6,
140 message_type := msg_type
141 };
142
143 type record RrL3Header {
144 uint4_t skip_indicator,
145 uint4_t rr_protocol_discriminator,
146 RrMessageType message_type
147 } with { variant "" };
148
149 type record MaioHsn {
150 } with { variant "" };
151
152 /* TS 24.008 10.5.1.2 */
153 type uint4_t CipheringKeySeqNr (0..7);
154
155 /* 24.008 10.5.1.3 */
156 type record LocationAreaIdentification {
157 BcdMccMnc mcc_mnc,
158 uint16_t lac
159 } with { variant "" };
160
161 /* TS 24.008 10.5.1.4 */
162 type enumerated MobileIdentityType {
163 MI_TYPE_NONE (0),
164 MI_TYPE_IMSI,
165 MI_TYPE_IMEI,
166 MI_TYPE_IMEISV,
167 MI_TYPE_TMSI,
168 MI_TYPE_TMGI
169 } with { variant "FIELDLENGTH(3)" };
170
171 type record MobileIdentityBCD {
172 MobileIdentityType mi_type (MI_TYPE_IMSI, MI_TYPE_IMEI, MI_TYPE_IMEISV),
173 boolean odd,
174 hexstring digits
175 } with { variant "" };
176
177 type record MobileIdentityTMSI {
Harald Welted2e342f2017-07-16 07:34:13 +0200178 BIT4 pad ('1111'B),
Harald Welte57a31502017-07-16 21:03:47 +0200179 boolean odd (false),
180 MobileIdentityType mi_type (MI_TYPE_TMSI),
Harald Welted2e342f2017-07-16 07:34:13 +0200181 GsmTmsi tmsi
182 } with { variant "" };
183
Harald Welte57a31502017-07-16 21:03:47 +0200184 type record MobileIdentityNone {
185 BIT4 pad ('1111'B),
186 boolean odd (false),
187 MobileIdentityType mi_type (MI_TYPE_NONE)
188 } with { variant "" };
189
Harald Welted2e342f2017-07-16 07:34:13 +0200190 type union MobileIdentity {
191 MobileIdentityBCD bcd,
Harald Welte57a31502017-07-16 21:03:47 +0200192 MobileIdentityTMSI tmsi,
193 MobileIdentityNone unused
Harald Welted2e342f2017-07-16 07:34:13 +0200194 } with { variant "TAG(bcd, mi_type = MI_TYPE_IMSI;
195 bcd, mi_type = MI_TYPE_IMEI;
196 bcd, mi_type = MI_TYPE_IMEISV;
Harald Welte57a31502017-07-16 21:03:47 +0200197 tmsi, mi_type = MI_TYPE_TMSI;
198 unused, mi_type = MI_TYPE_NONE)" };
Harald Welted2e342f2017-07-16 07:34:13 +0200199
200 type record MobileIdentityLV {
201 uint8_t len,
202 MobileIdentity mi
203 } with { variant (len) "LENGTHTO(mi)" };
204
205 type record MobileIdentityTLV {
206 uint8_t tag,
207 uint8_t len,
208 MobileIdentity mi
209 } with { variant (len) "LENGTHTO(mi)" };
210
211 /* TS 24.008 10.5.1.5 */
212 type record MsClassmark1 {
213 BIT1 spare,
214 uint2_t rev_level,
215 boolean es_ind,
216 boolean a51,
217 uint3_t rf_pwr_cap
218 } with { variant "" };
219
220 /* TS 24.008 10.5.1.6 */
221 type record MsClassmark2 {
222 BIT1 spare,
223 uint2_t rev_level,
224 boolean es_ind,
225 boolean a51,
226 uint3_t rf_pwr_cap,
227 BIT1 spare1,
228 boolean ps_cap,
229 uint2_t ss_screen_ind,
230 boolean sm_cap,
231 boolean vbs,
232 boolean vgcs,
233 boolean fc,
234 boolean cm3,
235 BIT1 spare2,
236 boolean lcsva_cap,
237 boolean ucs2,
238 boolean solsa,
239 boolean cmsp,
240 boolean a53,
241 boolean a52
242 } with { variant "" };
243 type record MsClassmark2LV {
244 uint8_t len,
245 MsClassmark2 cm2
246 } with { variant (len) "LENGTHTO(cm2)" };
247
248
Harald Welted2e342f2017-07-16 07:34:13 +0200249 /* 44.018 10.5.2.5 */
250 type record ChannelDescription {
Harald Weltead091b62017-07-16 21:03:17 +0200251 RslChannelNr chan_nr,
Harald Welted2e342f2017-07-16 07:34:13 +0200252 uint3_t tsc,
253 boolean h,
254 uint12_t arfcn optional,
255 MaioHsn maio_hsn optional
Harald Weltead091b62017-07-16 21:03:17 +0200256 } with { variant (arfcn) "PRESENCE(h = false)"
257 variant (maio_hsn) "PRESENCE(h = true)" };
258
259 type record ChannelDescriptionTV {
260 OCT1 iei,
261 ChannelDescription v
262 } with { variant "" };
Harald Welted2e342f2017-07-16 07:34:13 +0200263
264 /* 10.5.2.8 */
265 type enumerated ChannelNeeded {
266 CHAN_NEED_ANY (0),
267 CHAN_NEED_SDCCH (1),
268 CHAN_NEED_TCH_F (2),
269 CHAN_NEED_TCH_H (3)
270 } with { variant "FIELDLENGTH(2)" };
271 type record ChannelNeeded12 {
272 ChannelNeeded second,
273 ChannelNeeded first
274 } with { variant "" };
275
276 /* 10.5.2.21 */
277 type record MobileAllocation {
278 uint8_t len,
279 bitstring ma
280 } with { variant (len) "LENGTHTO(ma)" };
281
282 /* 10.5.2.25a */
283 type OCT3 PacketChannelDescription;
284
285 /* 10.5.2.25b */
286 type record DedicatedModeOrTbf {
287 BIT1 spare,
288 boolean tma,
289 boolean downlink,
290 boolean tbf
291 } with { variant "" };
292
293 /* 10.5.2.26 */
294 type enumerated PageMode {
295 PAGE_MODE_NORMAL,
296 PAGE_MODE_EXTENDED,
297 PAGE_MODE_REORGANIZATION,
298 PAGE_MODE_SAME_AS_BEFORE
299 } with { variant "FIELDLENGTH(4)" };
300
301 /* 10.5.2.30 */
302 type record RequestReference {
303 bitstring ra length(8),
304 uint5_t t1p,
305 uint6_t t3,
Harald Weltec3286cc2017-07-16 21:04:34 +0200306 uint5_t t2
Harald Welted2e342f2017-07-16 07:34:13 +0200307 } with { variant "" };
308
Harald Weltec3286cc2017-07-16 21:04:34 +0200309 template RequestReference t_RequestReference(template bitstring ra, template uint5_t t1p, template uint6_t t3, template uint5_t t2) := {
310 ra := ra,
311 t1p := t1p,
312 t3 := t3,
313 t2 := t2
314 }
315
316 /* compute the expected request reference for given RA + FN */
317 function f_compute_ReqRef(uint8_t ra, GsmFrameNumber fn) return RequestReference {
318 var RequestReference req_ref := { ra := int2bit(ra, 8) };
319 req_ref.t1p := (fn / 1326) mod 32;
320 req_ref.t2 := fn mod 26;
321 req_ref.t3 := fn mod 51;
322 return req_ref
323 }
324
Harald Welted2e342f2017-07-16 07:34:13 +0200325 /* 10.5.2.40 */
326 type integer TimingAdvance (0..219);
327
328 /* 10.5.2.43 */
329 type uint8_t WaitIndication;
330
331 /* 10.5.2.76 */
332 type record FeatureIndicator {
333 BIT2 spare,
334 boolean cs_ir,
335 boolean ps_ir
336 } with { variant "" };
337
338
339 /* 9.1.18 */
340 type record ImmediateAssignment {
341 DedicatedModeOrTbf ded_or_tbf,
342 PageMode page_mode,
343 ChannelDescription chan_desc optional,
344 PacketChannelDescription pkt_chan_desc optional,
345 RequestReference req_ref,
346 TimingAdvance timing_advance,
347 MobileAllocation mobile_allocation
348 } with { variant (chan_desc) "PRESENCE(ded_or_tbf.tbf = false)"
349 variant (pkt_chan_desc) "PRESENCE(ded_or_tbf.tbf = true)" };
350
351 /* 9.1.20 */
352 type record ReqRefWaitInd {
353 RequestReference req_ref,
354 WaitIndication wait_ind
355 } with { variant "" };
356 type record length(4) of ReqRefWaitInd ReqRefWaitInd4;
357 type record ImmediateAssignmentReject {
358 FeatureIndicator feature_ind,
359 PageMode page_mode,
360 ReqRefWaitInd4 payload
361 } with { variant "" };
362
363 /* 9.1.22 */
364 type record PagingRequestType1 {
365 ChannelNeeded12 chan_needed,
366 PageMode page_mode,
367 MobileIdentityLV mi1,
368 MobileIdentityTLV mi2 optional,
369 RestOctets rest_octets
370 } with { variant "TAG(mi2, tag = 23)" };
371
372 /* 9.1.23 */
373 type record PagingRequestType2 {
374 ChannelNeeded12 chan_needed,
375 PageMode page_mode,
376 GsmTmsi mi1,
377 GsmTmsi mi2,
378 MobileIdentityTLV mi3 optional,
379 RestOctets rest_octets
380 } with { variant "TAG(mi3, tag = 23)" };
381
382 /* 9.1.24 */
383 type record length(4) of GsmTmsi GsmTmsi4;
384 type record PagingRequestType3 {
385 ChannelNeeded12 chan_needed,
386 PageMode page_mode,
387 GsmTmsi4 mi,
388 RestOctets rest_octets
389 } with { variant "" };
390
391
392 type union RrUnion {
393/*
394 SystemInformationType1 si1,
395 SystemInformationType2 si2,
396 SystemInformationType2bis si2bis,
397 SystemInformationType2ter si2ter,
398 SystemInformationType3 si3,
399 SystemInformationType4 si4,
400 SystemInformationType5 si5,
401 SystemInformationType5bis si5bis,
402 SystemInformationType5ter si5ter,
403 SystemInformationType6 si6,
404*/
405 ImmediateAssignment imm_ass,
406 ImmediateAssignmentReject imm_ass_rej,
407 PagingRequestType1 pag_req_1,
408 PagingRequestType2 pag_req_2,
409 PagingRequestType3 pag_req_3,
410 octetstring other
411 } with { variant "" };
412
413 /* Special RR Message on BCCH / CCCH Dowlink */
414
415 type record GsmRrMessage {
416 RrHeader header,
417 RrUnion payload
418 } with { variant (payload) "CROSSTAG(
419/*
420 si1, header.message_type = SYSTEM_INFORMATION_TYPE_1;
421 si2, header.message_type = SYSTEM_INFORMATION_TYPE_2;
422 si2bis, header.message_type = SYSTEM_INFORMATION_TYPE_2bis;
423 si2ter, header.message_type = SYSTEM_INFORMATION_TYPE_2ter;
424 si3, header.message_type = SYSTEM_INFORMATION_TYPE_3;
425 si4, header.message_type = SYSTEM_INFORMATION_TYPE_4;
426 si5, header.message_type = SYSTEM_INFORMATION_TYPE_5;
427 si5bis, header.message_type = SYSTEM_INFORMATION_TYPE_5bis;
428 si5ter, header.message_type = SYSTEM_INFORMATION_TYPE_5ter;
429 si6, header.message_type = SYSTEM_INFORMATION_TYPE_6;
430*/
431 imm_ass, header.message_type = IMMEDIATE_ASSIGNMENT;
432 imm_ass_rej, header.message_type = IMMEDIATE_ASSIGNMENT_REJECT;
433 pag_req_1, header.message_type = PAGING_REQUEST_TYPE_1;
434 pag_req_2, header.message_type = PAGING_REQUEST_TYPE_2;
435 pag_req_3, header.message_type = PAGING_REQUEST_TYPE_3;
436 other, OTHERWISE;
437 )" };
438
Harald Welte0b1e5b82017-07-16 18:53:17 +0200439 external function enc_GsmRrMessage(in GsmRrMessage msg) return octetstring
440 with { extension "prototype(convert) encode(RAW)" };
441 external function dec_GsmRrMessage(in octetstring stream) return GsmRrMessage
442 with { extension "prototype(convert) decode(RAW)" };
443
Harald Welted2e342f2017-07-16 07:34:13 +0200444 /* Normal L3 Message on Dedicated Channel */
445
446 /* 9.1.25 Paging Response */
447 type record PagingResponse {
448 uint4_t spare_half_octet,
449 CipheringKeySeqNr cksn,
450 MsClassmark2LV cm2,
451 MobileIdentityLV mi,
452 uint8_t addl_upd_par optional
453 } with { variant "" };
454
455 type union RrL3Union {
456 PagingResponse paging_response,
457 octetstring other
458 };
459
460 type record GsmRrL3Message {
461 RrL3Header header,
462 RrL3Union payload
463 } with { variant (payload) "CROSSTAG(
464 paging_response, header.message_type = PAGING_RESPONSE;
465
466 other, OTHERWISE;
467 )" }
468
Harald Welte0c8d5c02017-07-16 18:53:58 +0200469 /* TS 48.058 9.3.1 Channel Number IE */
470 type enumerated RslChanNr0 {
471 RSL_CHAN_NR_INVALID ('00'H),
472 RSL_CHAN_NR_Bm_ACCH ('01'H),
473 RSL_CHAN_NR_BCCH ('10'H),
474 RSL_CHAN_NR_RACH ('11'H),
475 RSL_CHAN_NR_PCH_AGCH ('12'H)
476 } with { variant "FIELDLENGTH(5)" };
477
478 type record RslChanNr2 {
479 BIT4 tag ('0001'B),
480 uint1_t sub_chan
481 } with { variant "FIELDLENGTH(5)" };
482
483 type record RslChanNr4 {
484 BIT3 tag ('001'B),
485 uint2_t sub_chan
486 } with { variant "FIELDLENGTH(5)" };
487
488 type record RslChanNr8 {
489 BIT2 tag ('01'B),
490 uint3_t sub_chan
491 } with { variant "FIELDLENGTH(5)" };
492
493 type union RslChanNrU {
494 RslChanNr0 ch0,
495 RslChanNr2 lm,
496 RslChanNr4 sdcch4,
497 RslChanNr8 sdcch8
498 } with {
499 variant "TAG(lm, tag = '0001'B;
500 sdcch4, tag = '001'B;
501 sdcch8, tag = '01'B;
502 ch0, OTHERWISE)"
503 variant "FIELDLENGTH(5)"
504 };
505
506 type record RslChannelNr {
507 RslChanNrU u,
508 uint3_t tn
509 } with { variant "FIELDLENGTH(8)" };
510
511 template RslChannelNr t_RslChanNr0(template uint3_t tn, template RslChanNr0 cht) := {
512 u := { ch0 := cht },
513 tn := tn
514 }
515
516 template RslChannelNr t_RslChanNr_RACH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_RACH);
517 template RslChannelNr t_RslChanNr_BCCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_BCCH);
518 template RslChannelNr t_RslChanNr_PCH_AGCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_PCH_AGCH);
519 template RslChannelNr t_RslChanNr_Bm(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_Bm_ACCH);
520 template RslChannelNr t_RslChanNr_Lm(template uint3_t tn, uint1_t sub_slot) := {
521 u := { lm := { tag := '0001'B, sub_chan := sub_slot } },
522 tn := tn
523 }
524 template RslChannelNr t_RslChanNr_SDCCH4(template uint3_t tn, template uint2_t sub_slot) := {
525 u := { sdcch4 := { tag := '001'B, sub_chan := sub_slot } },
526 tn := tn
527 }
528 template RslChannelNr t_RslChanNr_SDCCH8(template uint3_t tn, template uint3_t sub_slot) := {
529 u := { sdcch8 := { tag := '01'B, sub_chan := sub_slot } },
530 tn := tn
531 }
Harald Welted2e342f2017-07-16 07:34:13 +0200532
Harald Welteb33e7272017-07-16 21:04:12 +0200533 /* TS 48.058 9.3.2 Link ID */
534 type enumerated RslLinkIdC {
535 FACCH_SDCCH (0),
536 SACCH (1)
537 } with { variant "FIELDLENGTH(2)" };
538
539 type enumerated RslSapi0Prio {
540 SAPI0_PRIO_NORMAL (0),
541 SAPI0_PRIO_HIGH (1),
542 SAPI0_PRIO_LOW (2)
543 } with { variant "FIELDLENGTH(2)" };
544
545 type uint3_t GsmSapi;
546
547 type record RslLinkId {
548 RslLinkIdC c,
549 boolean na,
550 RslSapi0Prio prio,
551 GsmSapi sapi
552 } with { variant "" };
553
554 template RslLinkId tr_RslLinkId := {
555 c := ?,
556 na := ?,
557 prio := ?,
558 sapi := ?
559 };
560
561 template RslLinkId tr_RslLinkID_DCCH(template GsmSapi sapi) modifies tr_RslLinkId := {
562 c := FACCH_SDCCH,
563 na := false,
564 sapi := sapi
565 };
566
567 template RslLinkId tr_RslLinkID_SACCH(template GsmSapi sapi) modifies tr_RslLinkId := {
568 c := SACCH,
569 na := false,
570 sapi := sapi
571 };
572
573 template RslLinkId ts_RslLinkID_DCCH(GsmSapi sapi) := {
574 c := FACCH_SDCCH,
575 na := false,
576 prio := SAPI0_PRIO_NORMAL,
577 sapi := sapi
578 };
579
Harald Weltecb5d1fb2017-07-17 21:00:15 +0200580 template RslLinkId ts_RslLinkID_SACCH(GsmSapi sapi) := {
581 c := SACCH,
582 na := false,
583 prio := SAPI0_PRIO_NORMAL,
584 sapi := sapi
Harald Welteb33e7272017-07-16 21:04:12 +0200585 };
586
Harald Weltea082a692017-07-15 15:58:13 +0200587} with { encode "RAW"; variant "FIELDORDER(msb)" }