blob: f072f7845c69cc0ad119a2c7458ba2bd452ec82b [file] [log] [blame]
Harald Weltec76f29f2017-11-22 12:46:46 +01001module L3_Templates {
2
Harald Welte35bb7162018-01-03 21:07:52 +01003/* L3 Templates, building on top of MobileL3*_Types from Ericsson.
4 *
Harald Weltef45efeb2018-04-09 18:19:24 +02005 * (C) 2017-2018 by Harald Welte <laforge@gnumonks.org>
Harald Welte35bb7162018-01-03 21:07:52 +01006 * All rights reserved.
7 *
8 * Released under the terms of GNU General Public License, Version 2 or
9 * (at your option) any later version.
Harald Welte34b5a952019-05-27 11:54:11 +020010 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
Harald Welte35bb7162018-01-03 21:07:52 +010012 */
13
Harald Weltec76f29f2017-11-22 12:46:46 +010014import from General_Types all;
Harald Welte38575a72018-02-15 20:41:37 +010015import from Osmocom_Types all;
Harald Weltec76f29f2017-11-22 12:46:46 +010016import from MobileL3_Types all;
17import from MobileL3_CommonIE_Types all;
18import from MobileL3_MM_Types all;
19import from MobileL3_RRM_Types all;
Harald Weltecb6cc332018-01-21 13:59:08 +010020import from MobileL3_CC_Types all;
Harald Welte38575a72018-02-15 20:41:37 +010021import from MobileL3_GMM_SM_Types all;
Harald Weltef45efeb2018-04-09 18:19:24 +020022import from MobileL3_SMS_Types all;
Pau Espin Pedrole8d7d162020-04-29 19:07:36 +020023import from RLCMAC_CSN1_Templates all;
Harald Weltecb6cc332018-01-21 13:59:08 +010024
Harald Welte51affb62018-04-09 14:17:45 +020025/* TS 24.007 Table 11.3 TI Flag */
26const BIT1 c_TIF_ORIG := '0'B;
27const BIT1 c_TIF_REPL := '1'B;
Harald Weltec76f29f2017-11-22 12:46:46 +010028
29type enumerated CmServiceType {
30 CM_TYPE_MO_CALL ('0001'B),
31 CM_TYPE_EMERG_CALL ('0010'B),
32 CM_TYPE_MO_SMS ('0100'B),
Harald Welte6ed6bf92018-01-24 21:09:15 +010033 CM_TYPE_SS_ACT ('1000'B),
34 CM_TYPE_VGCS ('1001'B),
35 CM_TYPE_VBS ('1010'B),
36 CM_TYPE_LCS ('1011'B)
Harald Weltec76f29f2017-11-22 12:46:46 +010037}
38
Oliver Smith32898452019-07-09 12:32:35 +020039/* TS 24.008 10.5.3.4 Identity Type */
40type enumerated CmIdentityType {
41 CM_ID_TYPE_IMSI ('001'B),
42 CM_ID_TYPE_IMEI ('010'B),
43 CM_ID_TYPE_IMEISV ('011'B),
44 CM_ID_TYPE_TMSI ('100'B),
45 CM_ID_TYPE_PTMSI_RAI_PTMSI_SIG ('101'B)
46}
47
Harald Welte33ec09b2018-02-10 15:34:46 +010048template ML3_Cause_TLV ts_ML3_Cause(BIT7 cause, BIT4 loc := '0001'B, BIT2 std := '11'B) := {
49 elementIdentifier := '08'O,
50 lengthIndicator := 0, /* overwritten */
51 oct3 := {
52 location := loc,
53 spare1_1 := '0'B,
54 codingStandard := std,
55 ext1 := '0'B,
56 recommendation := omit,
57 ext2 := omit
58 },
59 oct4 := {
60 causeValue := cause,
61 ext3 := '1'B
62 },
63 diagnostics := omit
64}
65
Harald Weltec76f29f2017-11-22 12:46:46 +010066
Vadim Yanitskiyc94c5722020-03-28 05:17:23 +070067/* 3GPP TS 24.008, section 10.5.1.4 "Mobile Identity" */
68template (value) MobileIdentityTLV ts_MI_TLV(template (value) MobileIdentityV mi) := {
69 elementIdentifier := '0010111'B,
70 spare1 := '0'B,
71 mobileIdentityLV := ts_MI_LV(mi)
72};
73template MobileIdentityTLV tr_MI_TLV(template MobileIdentityV mi) := {
74 elementIdentifier := '0010111'B,
75 spare1 := '0'B,
76 mobileIdentityLV := tr_MI_LV(mi)
77};
78
79template (value) MobileIdentityLV ts_MI_LV(template (value) MobileIdentityV mi) := {
80 lengthIndicator := 0, /* overwritten */
81 mobileIdentityV := mi
82};
83template MobileIdentityLV tr_MI_LV(template MobileIdentityV mi) := {
84 lengthIndicator := ?,
85 mobileIdentityV := mi
86};
87
88/* Universal (send & receive) template for No Identity */
89template MobileIdentityV t_MI_NoIdentity(template (present) hexstring filler := 'F'H) := {
90 typeOfIdentity := '000'B,
91 oddEvenInd_identity := {
92 no_identity := {
93 /* Always old, since length can be 1, 3, or 5 */
94 oddevenIndicator := '0'B,
95 fillerDigits := filler
96 }
97 }
98};
99
100/* Universal (send & receive) template for TMSI/P-TMSI */
101template MobileIdentityV t_MI_TMSI(template (present) OCT4 tmsi) := {
102 typeOfIdentity := '100'B,
103 oddEvenInd_identity := {
104 tmsi_ptmsi := {
105 oddevenIndicator := '0'B,
106 fillerDigit := '1111'B,
107 octets := tmsi
108 }
109 }
110};
111
112private function f_tr_MI_IMSI(template (present) hexstring digits)
113return template (present) IMSI_L3 {
114 if (istemplatekind(digits, "?")) {
115 return ?;
116 } else {
117 return f_enc_IMSI_L3(valueof(digits))
118 }
119}
120template MobileIdentityV tr_MI_IMSI(template hexstring imsi) := {
121 typeOfIdentity := '001'B,
122 oddEvenInd_identity := {
123 imsi := f_tr_MI_IMSI(imsi)
124 }
125};
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700126template (value) MobileIdentityV ts_MI_IMSI(hexstring imsi) := {
127 typeOfIdentity := '001'B,
128 oddEvenInd_identity := {
129 imsi := f_enc_IMSI_L3(imsi)
130 }
131};
Vadim Yanitskiyc94c5722020-03-28 05:17:23 +0700132
133
Oliver Smithb4bf2b22019-07-09 11:55:15 +0200134/* send template for Mobile Identity (TMSI) */
Harald Weltec76f29f2017-11-22 12:46:46 +0100135template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := {
136 lengthIndicator := 0, /* overwritten */
137 mobileIdentityV := {
138 typeOfIdentity := '000'B, /* overwritten */
139 oddEvenInd_identity := {
140 tmsi_ptmsi := {
141 oddevenIndicator := '0'B,
142 fillerDigit := '1111'B,
143 octets := tmsi
144 }
145 }
146 }
147}
148
Oliver Smithb4bf2b22019-07-09 11:55:15 +0200149/* send template for Mobile Identity (TMSI) */
Harald Welte6abb9fe2018-02-17 15:24:48 +0100150function ts_MI_TMSI_TLV(template (omit) OCT4 tmsi) return template (omit) MobileIdentityTLV {
151 var template (omit) MobileIdentityTLV ret;
152 if (istemplatekind(tmsi, "omit")) {
153 return omit;
154 } else {
155 ret := {
156 elementIdentifier := '0100011'B,
157 spare1 := '0'B,
158 mobileIdentityLV := ts_MI_TMSI_LV(valueof(tmsi))
159 }
160 return ret;
161 }
Harald Welte38575a72018-02-15 20:41:37 +0100162}
163
Harald Welteb0386df2018-02-16 18:14:28 +0100164template MobileIdentityTLV ts_MI_IMEISV_TLV(hexstring imeisv) := {
165 elementIdentifier := '0100011'B,
166 spare1 := '0'B,
167 mobileIdentityLV := ts_MI_IMEISV_LV(imeisv)
168}
169
Harald Weltec76f29f2017-11-22 12:46:46 +0100170private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 {
171 var IMSI_L3 l3;
172 var integer len := lengthof(digits);
173 if (len rem 2 == 1) { /* modulo remainder */
Harald Welte365f4ed2017-11-23 00:00:43 +0100174 l3.oddevenIndicator := '1'B;
Harald Welteae136252018-01-24 20:53:21 +0100175 l3.fillerDigit := omit;
Harald Weltec76f29f2017-11-22 12:46:46 +0100176 } else {
Harald Welte365f4ed2017-11-23 00:00:43 +0100177 l3.oddevenIndicator := '0'B;
Harald Welteae136252018-01-24 20:53:21 +0100178 l3.fillerDigit := '1111'B;
Harald Weltec76f29f2017-11-22 12:46:46 +0100179 }
180 l3.digits := digits;
181 return l3;
182}
183
Harald Welteba7b6d92018-01-23 21:32:34 +0100184private function f_enc_IMEI_L3(hexstring digits) return IMEI_L3 {
185 var IMEI_L3 l3;
186 var integer len := lengthof(digits);
Neels Hofmeyr16617812020-06-10 17:31:18 +0200187 /* IMEI_L3 is always 15 digits. That is actually a 14 digit IMEI + a Luhn checksum digit (see
188 * libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h)
189 *
190 * Here, we must not make the oddevenIndicator depend on the 'digits' parameter, because:
191 * - The IMEI_L3 template assumes always 15 digits.
192 * - The 'digits' parameter, however, may also contain less digits, 14 in the case of
193 * f_gen_imei().
194 * - The IMEI_L3 template will then fill up with zeros to make 15 digits.
195 * Hence oddevenIndicator must always indicate 'odd' == '1'B.
196 *
197 * FIXME: if the caller passes less than 15 digits, the Luhn checksum digit then ends up zero == most probably
198 * wrong.
199 */
200 l3.oddevenIndicator := '1'B;
Harald Welteba7b6d92018-01-23 21:32:34 +0100201 l3.digits := digits;
202 return l3;
203}
204
Harald Welteb0386df2018-02-16 18:14:28 +0100205private function f_enc_IMEI_SV(hexstring digits) return IMEI_SV {
206 var IMEI_SV l3;
207 var integer len := lengthof(digits);
208 if (len rem 2 == 1) { /* modulo remainder */
209 l3.oddevenIndicator := '1'B;
210 } else {
211 l3.oddevenIndicator := '0'B;
212 }
213 l3.digits := digits;
214 l3.fillerDigit := '1111'B;
215 return l3;
216}
217
Oliver Smithb4bf2b22019-07-09 11:55:15 +0200218/* send template for Mobile Identity (IMSI) */
Harald Weltec76f29f2017-11-22 12:46:46 +0100219template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := {
220 lengthIndicator := 0, /* overwritten */
221 mobileIdentityV := {
Harald Welte519db892018-02-16 18:15:22 +0100222 typeOfIdentity := '001'B,
Harald Weltec76f29f2017-11-22 12:46:46 +0100223 oddEvenInd_identity := {
224 imsi := f_enc_IMSI_L3(imsi_digits)
225 }
226 }
227}
228
Oliver Smithb4bf2b22019-07-09 11:55:15 +0200229/* send template for Mobile Identity (IMEI) */
Harald Welteba7b6d92018-01-23 21:32:34 +0100230template (value) MobileIdentityLV ts_MI_IMEI_LV(hexstring imei_digits) := {
231 lengthIndicator := 0, /* overwritten */
232 mobileIdentityV := {
Harald Welte519db892018-02-16 18:15:22 +0100233 typeOfIdentity := '010'B,
Harald Welteba7b6d92018-01-23 21:32:34 +0100234 oddEvenInd_identity := {
235 imei := f_enc_IMEI_L3(imei_digits)
236 }
237 }
238}
239
Oliver Smithb4bf2b22019-07-09 11:55:15 +0200240/* send template for Mobile Identity (IMEISV) */
Harald Welteb0386df2018-02-16 18:14:28 +0100241template (value) MobileIdentityLV ts_MI_IMEISV_LV(hexstring imei_digits) := {
242 lengthIndicator := 0, /* overwritten */
243 mobileIdentityV := {
244 typeOfIdentity := '011'B,
245 oddEvenInd_identity := {
246 imei_sv := f_enc_IMEI_SV(imei_digits)
247 }
248 }
249}
250
Harald Welteba7b6d92018-01-23 21:32:34 +0100251
Harald Weltec76f29f2017-11-22 12:46:46 +0100252/* Send template for Classmark 2 */
253template (value) MobileStationClassmark2_LV ts_CM2 := {
254 lengthIndicator := 0,
255 rf_PowerCapability := '000'B,
256 a5_1 := '0'B,
257 esind := '1'B,
258 revisionLevel := '10'B,
259 spare1_1 := '0'B,
Harald Welte898113b2018-01-31 18:32:21 +0100260 mobileStationClassmark2_oct4 := {
261 fc := '1'B,
262 vgcs := '0'B,
263 vbs := '0'B,
264 sm_Capability := '1'B,
265 ss_ScreenIndicator := '01'B,
266 ps_Capability := '1'B,
267 spare2_1 := '0'B
268 },
269 mobileStationClassmark2_oct5 := {
270 a5_2 := '0'B,
271 a5_3 := '1'B,
272 cmsp := '0'B,
273 solsa := '0'B,
274 ucs2 := '0'B,
275 lcsva_cap := '0'B,
276 spare5_7 :='0'B,
277 cm3 := '0'B
278 }
Harald Weltec76f29f2017-11-22 12:46:46 +0100279};
280
Neels Hofmeyr4f118412020-06-04 15:25:10 +0200281template LocationUpdatingType LU_Type_Normal := {
282 lut := '00'B,
283 spare1_1 := '0'B,
284 fop := '0'B
285};
286
287template LocationUpdatingType LU_Type_Periodic := {
288 lut := '01'B,
289 spare1_1 := '0'B,
290 fop := '0'B
291};
292
293template LocationUpdatingType LU_Type_IMSI_Attach := {
294 lut := '10'B,
295 spare1_1 := '0'B,
296 fop := '0'B
297};
298
299/* Send template for LOCATION UPDATING REQUEST */
300template PDU_ML3_MS_NW ts_LU_REQ(template LocationUpdatingType lu_type, MobileIdentityLV mi_lv,
301 OCT3 mcc_mnc := '123456'O) := {
302 discriminator := '0000'B, /* overwritten */
303 tiOrSkip := {
304 skipIndicator := '0000'B
305 },
306 msgs := {
307 mm := {
308 locationUpdateRequest := {
309 messageType := '000000'B, /* overwritten */
310 nsd := '00'B,
311 locationUpdatingType := lu_type,
312 cipheringKeySequenceNumber := { '000'B, '0'B },
313 locationAreaIdentification := {
314 mcc_mnc := mcc_mnc,
315 lac := '172A'O
316 },
317 mobileStationClassmark1 := ts_CM1,
318 mobileIdentityLV := mi_lv,
319 classmarkInformationType2_forUMTS := omit,
320 additionalUpdateParameterTV := omit,
321 deviceProperties := omit,
322 mS_NetworkFeatureSupport := omit
323 }
324 }
325 }
326}
327
328template PDU_ML3_NW_MS ts_LU_ACCEPT(template MobileIdentityTLV mi_tlv := omit) := {
329 discriminator := '0000'B, /* overwritten */
330 tiOrSkip := {
331 skipIndicator := '0000'B
332 },
333 msgs := {
334 mm := {
335 locationUpdateAccept := {
336 messageType := '000000'B, /* overwritten */
337 nsd := '00'B,
338 locationAreaIdentification := {
339 mcc_mnc := '123456'O,
340 lac := '172A'O
341 },
342 mobileIdentityTLV := mi_tlv,
343 followOnProceed := omit,
344 cTS_Permission := omit,
345 equivalentPLMNs := omit,
346 emergencyNumberList := omit,
347 perMS_T3212 := omit
348 }
349 }
350 }
351}
352
Harald Weltec76f29f2017-11-22 12:46:46 +0100353/* Send template for CM SERVICE REQUEST */
Harald Welte6ed6bf92018-01-24 21:09:15 +0100354template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(CmServiceType serv_type, MobileIdentityLV mi_lv) := {
Harald Weltec76f29f2017-11-22 12:46:46 +0100355 discriminator := '0000'B, /* overwritten */
356 tiOrSkip := {
357 skipIndicator := '0000'B
358 },
359 msgs := {
360 mm := {
361 cMServiceRequest := {
362 messageType := '000000'B, /* overwritten */
363 nsd := '00'B,
Harald Welte6ed6bf92018-01-24 21:09:15 +0100364 cm_ServiceType := int2bit(enum2int(serv_type), 4),
Harald Weltec76f29f2017-11-22 12:46:46 +0100365 cipheringKeySequenceNumber := { '000'B, '0'B },
366 mobileStationClassmark2 := ts_CM2,
367 mobileIdentity := mi_lv,
368 priorityLevel := omit,
369 additionalUpdateParameterTV := omit,
370 deviceProperties := omit
371 }
372 }
373 }
374}
375
Harald Welte0195ab12018-01-24 21:50:20 +0100376template (value) CipheringKeySequenceNumberV ts_CKSN(integer key_seq) := {
377 keySequence := int2bit(key_seq, 3),
378 spare := '0'B
379}
380
381/* Send template for CM RE-ESTABLISH REQUEST */
382template (value) PDU_ML3_MS_NW ts_CM_REEST_REQ(integer cksn, MobileIdentityLV mi_lv) := {
383 discriminator := '0000'B, /* overwritten */
384 tiOrSkip := {
385 skipIndicator := '0000'B
386 },
387 msgs := {
388 mm := {
389 cMReEstablReq := {
390 messageType := '101000'B, /* overwritten */
391 nsd := '00'B,
392 cipheringKeySequenceNumber := ts_CKSN(cksn),
393 spare := '0000'B,
394 mobileStationClassmark2 := ts_CM2,
395 mobileIdentityLV := mi_lv,
396 locationAreaIdentification := omit,
397 deviceProperties := omit
398 }
399 }
400 }
401}
402
403
Harald Welte6ff81902018-01-21 19:09:08 +0100404template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := {
405 discriminator := discr,
406 tiOrSkip := {
407 skipIndicator := '0000'B
408 },
409 msgs := ?
410}
411
412
413template PDU_ML3_NW_MS tr_CM_SERV_ACC := {
414 discriminator := '0101'B,
415 tiOrSkip := {
416 skipIndicator := '0000'B
417 },
418 msgs := {
419 mm := {
420 cMServiceAccept := {
421 messageType := '100001'B,
422 nsd := ?
423 }
424 }
425 }
426}
427
428
Harald Weltecb6cc332018-01-21 13:59:08 +0100429template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := {
430 discriminator := '0101'B,
431 tiOrSkip := {
432 skipIndicator := '0000'B
433 },
434 msgs := {
435 mm := {
436 cMServiceReject := {
437 messageType := '100010'B,
438 nsd := ?,
439 rejectCause := rej_cause,
440 t3246_Value := *
441 }
442 }
443 }
444}
445
Harald Welte68e495b2018-02-25 00:05:57 +0100446template PDU_ML3_NW_MS tr_PAGING_REQ1(template MobileIdentityLV mi1 := ?,
447 template MobileIdentityTLV mi2 := *) := {
448 discriminator := '0110'B,
449 tiOrSkip := {
450 skipIndicator := '0000'B
451 },
452 msgs := {
453 rrm := {
454 pagingReq_Type1 := {
455 messageType := '00100001'B,
456 pageMode := ?,
457 channelNeeded := ?,
458 mobileIdentity1 := mi1,
459 mobileIdentity2 := mi2,
460 p1RestOctets := ?
461 }
462 }
463 }
464}
465
466template PDU_ML3_NW_MS tr_PAGING_REQ2(template TMSIP_TMSI_V mi1 := ?,
467 template TMSIP_TMSI_V mi2 := ?,
468 template MobileIdentityTLV mi3 := *) := {
469 discriminator := '0110'B,
470 tiOrSkip := {
471 skipIndicator := '0000'B
472 },
473 msgs := {
474 rrm := {
475 pagingReq_Type2 := {
476 messageType := '00100010'B,
477 pageMode := ?,
478 channelNeeded := ?,
479 mobileIdentity1 := mi1,
480 mobileIdentity2 := mi2,
481 mobileIdentity3 := mi3,
482 p2RestOctets := ?
483 }
484 }
485 }
486}
487
488template PDU_ML3_NW_MS tr_PAGING_REQ3(template TMSIP_TMSI_V mi1 := ?,
489 template TMSIP_TMSI_V mi2 := ?,
490 template TMSIP_TMSI_V mi3 := ?,
491 template TMSIP_TMSI_V mi4 := ?) := {
492 discriminator := '0110'B,
493 tiOrSkip := {
494 skipIndicator := '0000'B
495 },
496 msgs := {
497 rrm := {
498 pagingReq_Type3 := {
499 messageType := '00100100'B,
500 pageMode := ?,
501 channelNeeded := ?,
502 mobileIdentity1 := mi1,
503 mobileIdentity2 := mi2,
504 mobileIdentity3 := mi3,
505 mobileIdentity4 := mi4,
506 p3RestOctets := ?
507 }
508 }
509 }
510}
511
512
513
Harald Weltec76f29f2017-11-22 12:46:46 +0100514/* Send template for PAGING RESPONSE */
515template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := {
516 discriminator := '0000'B, /* overwritten */
517 tiOrSkip := {
518 skipIndicator := '0000'B
519 },
520 msgs := {
521 rrm := {
522 pagingResponse := {
523 messageType := '00000000'B, /* overwritten */
524 cipheringKeySequenceNumber := { '000'B, '0'B },
525 spare1_4 := '0000'B,
526 mobileStationClassmark := ts_CM2,
527 mobileIdentity := mi_lv,
528 additionalUpdateParameters := omit
529 }
530 }
531 }
532}
533
Harald Welte15166142017-12-16 23:02:08 +0100534template (value) PDU_ML3_MS_NW ts_RRM_ModeModifyAck(ChannelDescription2_V desc, ChannelMode_V mode) := {
535 discriminator := '0000'B, /* overwritten */
536 tiOrSkip := {
537 skipIndicator := '0000'B
538 },
539 msgs := {
540 rrm := {
541 channelModeModifyAck := {
542 messageType := '00010111'B,
543 channelDescription := desc,
544 channelMode := mode,
545 extendedTSCSet := omit
546 }
547 }
548 }
549}
550
Harald Weltee613f962018-04-18 22:38:16 +0200551template (value) PDU_ML3_NW_MS ts_RRM_CiphModeCmd(BIT3 alg_id) := {
552 discriminator := '0000'B, /* overwritten */
553 tiOrSkip := {
554 skipIndicator := '0000'B
555 },
556 msgs := {
557 rrm := {
558 cipheringModeCommand := {
559 messageType := '00110101'B,
560 cipherModeSetting := {
561 sC := '1'B,
562 algorithmIdentifier := alg_id
563 },
564 cipherModeResponse := {
565 cR := '0'B,
566 spare := '000'B
567 }
568 }
569 }
570 }
571}
572
Harald Welte73cd2712017-12-17 00:44:52 +0100573template (value) PDU_ML3_MS_NW ts_RRM_CiphModeCompl := {
574 discriminator := '0000'B, /* overwritten */
575 tiOrSkip := {
576 skipIndicator := '0000'B
577 },
578 msgs := {
579 rrm := {
580 cipheringModeComplete := {
581 messageType := '00110010'B,
582 mobileEquipmentIdentity := omit
583 }
584 }
585 }
586}
587
Harald Welteecb254b2018-01-29 22:01:54 +0100588template (value) PDU_ML3_MS_NW ts_RRM_AssignmentComplete(OCT1 cause) := {
589 discriminator := '0000'B, /* overwritten */
590 tiOrSkip := {
591 skipIndicator := '0000'B
592 },
593 msgs := {
594 rrm := {
595 assignmentComplete := {
596 messageType := '00101001'B,
597 rR_Cause := {
598 valuePart := cause
599 }
600 }
601 }
602 }
603}
Harald Welte15166142017-12-16 23:02:08 +0100604
Harald Welte898113b2018-01-31 18:32:21 +0100605template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := {
606 discriminator := '0000'B, /* overwritten */
607 tiOrSkip := {
608 skipIndicator := '0000'B
609 },
610 msgs := {
611 rrm := {
612 assignmentFailure := {
613 messageType := '00101111'B,
614 rR_Cause := {
615 valuePart := cause
616 }
617 }
618 }
619 }
620}
621
Harald Weltefbf9b5e2018-01-31 20:41:23 +0100622template (value) PDU_ML3_MS_NW ts_RRM_HandoverFailure(OCT1 cause) := {
623 discriminator := '0000'B, /* overwritten */
624 tiOrSkip := {
625 skipIndicator := '0000'B
626 },
627 msgs := {
628 rrm := {
629 handoverFailure := {
630 messageType := '00101000'B,
631 rRCause := {
632 valuePart := cause
633 },
634 pSCause := omit
635 }
636 }
637 }
638}
Harald Welte898113b2018-01-31 18:32:21 +0100639
Harald Welte261af4b2018-02-12 21:20:39 +0100640template (value) PDU_ML3_MS_NW ts_RRM_HandoverComplete(OCT1 cause) := {
641 discriminator := '0000'B, /* overwritten */
642 tiOrSkip := {
643 skipIndicator := '0000'B
644 },
645 msgs := {
646 rrm := {
647 handoverComplete := {
648 messageType := '00101100'B,
649 rRCause := {
650 valuePart := cause
651 },
652 mobileObsservedTimeDiff := omit,
653 mobileTimeDifferenceHyperframe := omit
654 }
655 }
656 }
657}
658
Harald Welte187f7a92019-09-05 11:15:20 +0200659template (present) PDU_ML3_NW_MS tr_RR_APP_INFO(template (present) BIT4 apdu_id,
660 template (present) octetstring data,
661 template (present) APDU_Flags_V flags := ?) := {
662 discriminator := '0000'B, /* overwritten */
663 tiOrSkip := {
664 skipIndicator := '0000'B
665 },
666 msgs := {
667 rrm := {
668 applicationInformation := {
669 messageType := '00111000'B,
670 aPDU_ID := apdu_id,
671 aPDU_Flags := flags,
672 aPDU_Data := {
673 lengthIndicator := ?,
674 aPDU_DataValue := data
675 }
676 }
677 }
678 }
679}
680
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +0100681template (value) PDU_ML3_NW_MS ts_RR_HandoverCommand := {
682 discriminator := '0110'B,
683 tiOrSkip := {
684 skipIndicator := '0000'B
685 },
686 msgs := {
687 rrm := {
688 handoverCommand := {
689 messageType := '00101011'B,
690 cellDescription := {
691 bcc := '001'B,
692 ncc := '010'B,
693 BCCHArfcn_HighPart := '11'B,
694 BCCHArfcn_LowPart := '04'O
695 },
696 channelDescription2 := {
697 timeslotNumber := '110'B,
698 channelTypeandTDMAOffset := '00001'B,
699 octet3 := '00'O,
700 octet4 := '09'O
701 },
702 handoverReference := {
703 handoverReferenceValue := '00'O
704 },
705 powerCommandAndAccesstype := {
706 powerlevel := '00000'B,
707 fPC_EP := '0'B,
708 ePC_Mode := '0'B,
709 aTC := '0'B
710 },
711 synchronizationIndication := omit,
712 frequencyShortListAfterTime := omit,
713 frequencyListAfterTime := omit,
714 cellChannelDescription := omit,
715 multislotAllocation := omit,
716 modeOfChannelSet1 := omit,
717 modeOfChannelSet2 := omit,
718 modeOfChannelSet3 := omit,
719 modeOfChannelSet4 := omit,
720 modeOfChannelSet5 := omit,
721 modeOfChannelSet6 := omit,
722 modeOfChannelSet7 := omit,
723 modeOfChannelSet8 := omit,
724 descrOf2ndCh_at := omit,
725 modeOf2ndChannel := omit,
726 frequencyChannelSequence_at := omit,
727 mobileAllocation_at := omit,
728 startingTime := omit,
729 timeDifference := omit,
730 timingAdvance := omit,
731 frequencyShortListBeforeTime := omit,
732 frequencyListBeforeTime := omit,
733 descrOf1stCh_bt := omit,
734 descrOf2ndCh_bt := omit,
735 frequencyChannelSequence_bt := omit,
736 mobileAllocation_bt := omit,
737 cipherModeSetting := omit,
738 vGCS_TargetModeIndication := omit,
739 multiRateConfiguration := omit,
740 dynamicARFCN_Mapping := omit,
741 vGCS_Ciphering_Parameters := omit,
742 dedicatedServiceInformation := omit,
743 pLMNIndex := omit,
744 extendedTSCSet_afterTime := omit,
745 extendedTSCSet_beforeTime := omit
746 }
747 }
748 }
749}
750
Neels Hofmeyr0ac63152019-05-07 01:20:17 +0200751template PDU_ML3_NW_MS tr_RR_HandoverCommand := {
752 discriminator := '0110'B,
753 tiOrSkip := {
754 skipIndicator := '0000'B
755 },
756 msgs := {
757 rrm := {
758 handoverCommand := {
759 messageType := '00101011'B,
760 cellDescription := ?,
761 channelDescription2 := ?,
762 handoverReference := ?,
763 powerCommandAndAccesstype := ?,
764 synchronizationIndication := *,
765 frequencyShortListAfterTime := *,
766 frequencyListAfterTime := *,
767 cellChannelDescription := *,
768 multislotAllocation := *,
769 modeOfChannelSet1 := *,
770 modeOfChannelSet2 := *,
771 modeOfChannelSet3 := *,
772 modeOfChannelSet4 := *,
773 modeOfChannelSet5 := *,
774 modeOfChannelSet6 := *,
775 modeOfChannelSet7 := *,
776 modeOfChannelSet8 := *,
777 descrOf2ndCh_at := *,
778 modeOf2ndChannel := *,
779 frequencyChannelSequence_at := *,
780 mobileAllocation_at := *,
781 startingTime := *,
782 timeDifference := *,
783 timingAdvance := *,
784 frequencyShortListBeforeTime := *,
785 frequencyListBeforeTime := *,
786 descrOf1stCh_bt := *,
787 descrOf2ndCh_bt := *,
788 frequencyChannelSequence_bt := *,
789 mobileAllocation_bt := *,
790 cipherModeSetting := *,
791 vGCS_TargetModeIndication := *,
792 multiRateConfiguration := *,
793 dynamicARFCN_Mapping := *,
794 vGCS_Ciphering_Parameters := *,
795 dedicatedServiceInformation := *,
796 pLMNIndex := *,
797 extendedTSCSet_afterTime := *,
798 extendedTSCSet_beforeTime := *
799 }
800 }
801 }
802}
803
Harald Welte898113b2018-01-31 18:32:21 +0100804function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV {
805 if (not isvalue(cm3)) {
806 return omit;
807 }
808 var template MobileStationClassmark3_TLV ret := {
809 elementIdentifier := '20'O,
810 lengthIndicator := 0, /* overwritten */
811 valuePart := cm3
812 }
813 return ret;
814}
815
816template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2,
817 template (omit) MobileStationClassmark3_TLV cm3 := omit) := {
818 discriminator := '0110'B,
819 tiOrSkip := {
820 skipIndicator := '0000'B
821 },
822 msgs := {
823 rrm := {
824 classmarkChange := {
825 messageType := '00010110'B,
826 mobileStationClassmark2 := cm2,
827 mobileStationClassmark3 := cm3
828 }
829 }
830 }
831}
832
Neels Hofmeyr92b12b72018-09-18 14:30:23 +0200833template PDU_ML3_NW_MS tr_RRM_CM_ENQUIRY := {
834 discriminator := '0110'B,
835 tiOrSkip := {
836 skipIndicator := '0000'B
837 },
838 msgs := {
839 rrm := {
840 classmarkEnquiry := {
841 messageType := '00010011'B,
842 classmarkEnquiryMask := *
843 }
844 }
845 }
846}
847
Harald Weltee3bd6582018-01-31 22:51:25 +0100848template (value) PDU_ML3_MS_NW ts_RRM_UL_REL(OCT1 cause) := {
849 discriminator := '0110'B,
850 tiOrSkip := {
851 skipIndicator := '0000'B
852 },
853 msgs := {
854 rrm := {
855 uplinkRelease := {
856 messageType := '00001110'B,
857 rR_Cause := {
858 valuePart := cause
859 }
860 }
861 }
862 }
863}
864
865template PDU_ML3_MS_NW tr_RRM_RR_STATUS(template OCT1 cause := ?) := {
866 discriminator := '0110'B,
867 tiOrSkip := {
868 skipIndicator := '0000'B
869 },
870 msgs := {
871 rrm := {
872 rR_Status := {
873 messageType := '00010010'B,
874 rR_Cause := {
875 valuePart := cause
876 }
877 }
878 }
879 }
880}
881
Harald Welte924b6ea2019-02-04 01:05:34 +0100882template PDU_ML3_NW_MS tr_RRM_RR_RELEASE(template OCT1 cause := ?) := {
883 discriminator := '0110'B,
884 tiOrSkip := {
885 skipIndicator := '0000'B
886 },
887 msgs := {
888 rrm := {
889 channelRelease := {
890 messageType := '00001101'B,
891 rRCause := {
892 valuePart := cause
893 },
894 bARange := *,
895 groupChannelDescription := *,
896 groupCipherKeyNumber := *,
897 gPRSResumption := *,
898 bAListPref := *,
899 uTRANFrequencyList := *,
900 cellChannelDescr := *,
901 cellSelectionIndicator := *,
902 enhanced_DTM_CS_Release_Indication := *,
903 vGCS_Ciphering_Parameters := *,
904 group_Channel_Description_2 := *,
905 talkerIdentity := *,
906 talkerPriorityStatus := *,
907 vGCS_AMR_Configuration := *,
908 individual_Priorities := *
909 }
910 }
911 }
912}
Harald Weltee3bd6582018-01-31 22:51:25 +0100913
Harald Welte99787102019-02-04 10:41:36 +0100914template PDU_ML3_NW_MS tr_RRM_RR_RELEASE_CSFB(template OCT1 cause := ?) modifies tr_RRM_RR_RELEASE := {
915 msgs := {
916 rrm := {
917 channelRelease := {
918 cellSelectionIndicator := {
919 elementIdentifier := '77'O,
920 lengthIndicator := ?,
921 cellSelectionIndicatorValue := ?
922 }
923 }
924 }
925 }
926}
Harald Weltee3bd6582018-01-31 22:51:25 +0100927
Harald Weltecb6cc332018-01-21 13:59:08 +0100928template PDU_ML3_MS_NW ts_ML3_MO := {
929 discriminator := '0000'B,
930 tiOrSkip := {
931 skipIndicator := '0000'B
932 },
933 msgs := ?
934}
935
936template LocationUpdatingType ts_ML3_IE_LuType := {
937 lut := ?,
938 spare1_1 := '0'B,
939 fop := '0'B
940}
941
942template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := {
943 lut := '00'B
944}
945
946template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := {
947 lut := '01'B
948}
949
950template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := {
951 lut := '10'B
952}
953
954template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := {
955 keySequence := int2bit(cksn, 3),
956 spare := '0'B
957}
958
959template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai,
960 MobileIdentityLV mi, MobileStationClassmark1_V cm1)
961modifies ts_ML3_MO := {
962 msgs := {
963 mm := {
964 locationUpdateRequest := {
965 messageType := '001000'B,
966 nsd := '00'B, /* ? */
967 locationUpdatingType := lu_type,
968 cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0),
969 locationAreaIdentification := lai,
970 mobileStationClassmark1 := cm1,
971 mobileIdentityLV := mi,
972 classmarkInformationType2_forUMTS := omit,
973 additionalUpdateParameterTV := omit,
974 deviceProperties := omit,
975 mS_NetworkFeatureSupport := omit
976 }
977 }
978 }
979}
980
Harald Welte6ff81902018-01-21 19:09:08 +0100981template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := {
982 msgs := {
983 mm := {
984 tmsiReallocComplete := {
985 messageType := '011011'B,
986 nsd := '00'B
987 }
988 }
989 }
990}
991
992template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := {
993 discriminator := '0101'B,
994 tiOrSkip := {
995 skipIndicator := '0000'B
996 },
997 msgs := {
998 mm := {
999 locationUpdateAccept := {
1000 messageType := '000010'B,
1001 nsd := '00'B,
1002 locationAreaIdentification := ?,
1003 mobileIdentityTLV := *,
1004 followOnProceed := *,
1005 cTS_Permission := *,
1006 equivalentPLMNs := *,
1007 emergencyNumberList := *,
1008 perMS_T3212 := *
1009 }
1010 }
1011 }
1012}
1013
1014template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := {
1015 discriminator := '0101'B,
1016 tiOrSkip := {
1017 skipIndicator := '0000'B
1018 },
1019 msgs := {
1020 mm := {
1021 locationUpdateReject := {
1022 messageType := '000100'B,
1023 nsd := '00'B,
1024 rejectCause := cause,
1025 t3246_Value := *
1026 }
1027 }
1028 }
1029}
1030
Oliver Smithaf2f1f82019-07-19 12:33:12 +02001031private function f_id_type_or_any(template CmIdentityType id_type) return template bitstring {
1032 if (istemplatekind(id_type, "?")) {
1033 return ?;
1034 } else {
1035 return int2bit(enum2int(valueof(id_type)), 3);
1036 }
1037}
1038
Oliver Smith32898452019-07-09 12:32:35 +02001039template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template CmIdentityType id_type := ?) := {
Harald Welteba7b6d92018-01-23 21:32:34 +01001040 discriminator := '0101'B,
1041 tiOrSkip := {
1042 skipIndicator := '0000'B
1043 },
1044 msgs := {
1045 mm := {
1046 identityRequest := {
1047 messageType := '011000'B,
1048 nsd := '00'B,
Oliver Smithaf2f1f82019-07-19 12:33:12 +02001049 identityType := f_id_type_or_any(id_type),
Harald Welteba7b6d92018-01-23 21:32:34 +01001050 spare1_5 := ?
1051 }
1052 }
1053 }
1054}
1055
1056template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp(MobileIdentityLV mi) modifies ts_ML3_MO := {
1057 msgs := {
1058 mm := {
1059 identityResponse := {
1060 messageType := '011001'B,
1061 nsd := '00'B,
1062 mobileIdentityLV := mi,
1063 p_TMSI_TypeTV := omit,
1064 routingAreaIdentification2TLV := omit,
1065 p_TMSISignature2TLV := omit
1066 }
1067 }
1068 }
1069}
1070template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMSI(hexstring imsi) :=
1071 ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMSI_LV(imsi)));
1072template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMEI(hexstring imei) :=
1073 ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei)));
1074
1075
Neels Hofmeyr63382472018-03-01 19:57:44 +01001076template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B, BIT1 esind := '1'B) := {
Harald Welte45164da2018-01-24 12:51:27 +01001077 rf_PowerCapability := '010'B,
1078 a5_1 := a5_1_unavail,
Neels Hofmeyr63382472018-03-01 19:57:44 +01001079 esind := esind,
Harald Welte45164da2018-01-24 12:51:27 +01001080 revisionLevel := rev,
1081 spare1_1 := '0'B
1082}
1083
1084template PDU_ML3_MS_NW ts_ML3_MO_MM_IMSI_DET_Ind(MobileIdentityLV mi,
1085 template MobileStationClassmark1_V cm1 := ts_CM1)
1086modifies ts_ML3_MO := {
1087 msgs := {
1088 mm := {
1089 imsiDetachIndication := {
1090 messageType := '000001'B,
1091 nsd := '00'B,
1092 mobileStationClassmark1 := cm1,
1093 mobileIdentityLV := mi
1094 }
1095 }
1096 }
1097}
1098
Harald Welted748a052018-01-22 02:59:24 +01001099template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := {
1100 discriminator := '0011'B,
1101 tiOrSkip := {
1102 transactionId := {
Daniel Willmanndcf9eb92018-02-02 20:07:52 +01001103 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001104 tiFlag := c_TIF_ORIG,
Harald Welted748a052018-01-22 02:59:24 +01001105 tIExtension := omit
1106 }
Harald Welte9bf43cc2020-08-21 12:33:18 +02001107 },
1108 msgs := -
Harald Welted748a052018-01-22 02:59:24 +01001109}
1110
1111template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := {
1112 elementIdentifier := '5E'O,
1113 lengthIndicator := 0, /* overwritten */
1114 numberingPlanIdentification := '0000'B,
1115 typeOfNumber := '000'B, /* unknown */
1116 ext1 := '0'B,
1117 digits := digits
1118}
1119
Harald Welte812f7a42018-01-27 00:49:18 +01001120template CalledPartyBCD_Number tr_Called(template hexstring digits) := {
1121 elementIdentifier := '5E'O,
1122 lengthIndicator := ?,
1123 numberingPlanIdentification := ?,
1124 typeOfNumber := ?,
1125 ext1 := ?,
1126 digits := digits
1127}
1128
Stefan Sperling26d57be2018-11-12 17:03:26 +01001129private function f_pad_digits(hexstring digits) return hexstring {
1130 if (lengthof(digits) mod 2 != 0) {
1131 /* Add trailing nibble of 1-bit padding, like the CallingPartyBCD_Number encoder would do.
1132 * Otherwise our template won't match the data received (see OS#2930). */
1133 return digits & 'F'H;
1134 }
1135 return digits;
1136}
1137
Harald Welte812f7a42018-01-27 00:49:18 +01001138template CallingPartyBCD_Number tr_Calling(template hexstring digits) := {
1139 elementIdentifier := '5C'O,
1140 lengthIndicator := ?,
1141 oct3 := ?,
Stefan Sperling26d57be2018-11-12 17:03:26 +01001142 digits := f_pad_digits(valueof(digits))
Harald Welte812f7a42018-01-27 00:49:18 +01001143}
1144
Harald Welte4b2b3a62018-01-26 10:32:39 +01001145type integer SpeechVer;
1146
1147template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := {
1148 speechVersionIndication := int2bit(ver-1,3) & suffix,
1149 spare1_1 := '0'B,
1150 cTM_or_Spare := '0'B,
1151 coding := '0'B,
1152 extension_octet_3a_3b := '0'B
1153}
1154
1155template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B);
1156template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B);
1157
Harald Welted748a052018-01-22 02:59:24 +01001158template (value) BearerCapability_TLV ts_Bcap_voice := {
1159 elementIdentifier := '04'O,
1160 lengthIndicator := 0, /* overwritten */
1161 octet3 := {
1162 informationTransferCapability := '000'B,
1163 transferMode := '0'B,
1164 codingStandard := '0'B,
1165 radioChannelRequirement := '11'B, /* FR preferred */
1166 extension_octet_3 := '0'B, /* overwritten */
Harald Welte4b2b3a62018-01-26 10:32:39 +01001167 speech_aux_3a_3b := {
1168 valueof(ts_SpeechAuxHR(3)),
1169 valueof(ts_SpeechAuxFR(3)),
1170 valueof(ts_SpeechAuxFR(2)),
1171 valueof(ts_SpeechAuxFR(1)),
1172 valueof(ts_SpeechAuxHR(1))
1173 }
Harald Welted748a052018-01-22 02:59:24 +01001174 },
1175 octet4 := omit,
1176 octet5 := omit,
1177 octet6 := omit,
1178 octet7 := omit
1179}
1180
1181template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := {
1182 discriminator := '0011'B,
1183 tiOrSkip := {
1184 transactionId := {
1185 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001186 tiFlag := c_TIF_ORIG,
Harald Welted748a052018-01-22 02:59:24 +01001187 tIExtension := omit
1188 }
1189 },
1190 msgs := {
1191 cc := {
1192 setup_MS_NW := {
1193 messageType := '000101'B,
1194 nsd := '00'B,
1195 bcRepeatIndicator := omit,
1196 bearerCapability1 := bcap,
1197 bearerCapability2 := omit,
1198 facility := omit,
1199 callingPartySubAddress := omit,
1200 calledPartyBCD_Number := ts_Called(called),
1201 calledPartySubAddress := omit,
1202 llc_RepeatIndicator := omit,
1203 lowLayerCompatibility1 := omit,
1204 lowLayerCompatibility2 := omit,
1205 hlc_RepeatIndicator := omit,
1206 highLayerCompatibility1 := omit,
1207 highLayerCompatibility2 := omit,
1208 user_user := omit,
1209 ss_VersionIndicator := omit,
1210 clir_Suppression := omit,
1211 clir_Invocation := omit,
1212 cC_Capabilities := omit,
1213 facility_ccbs1 := omit,
1214 facility_ccbs2 := omit,
1215 streamIdentifier := omit,
1216 supportedCodecs := omit,
1217 redial := omit
1218 }
1219 }
1220 }
1221}
1222
Harald Welte45164da2018-01-24 12:51:27 +01001223template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := {
1224 discriminator := '0011'B,
1225 tiOrSkip := {
1226 transactionId := {
1227 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001228 tiFlag := c_TIF_ORIG,
Harald Welte45164da2018-01-24 12:51:27 +01001229 tIExtension := omit
1230 }
1231 },
1232 msgs := {
1233 cc := {
1234 emergencySetup := {
1235 messageType := '001110'B,
1236 nsd := '00'B,
1237 bearerCapability := bcap,
1238 streamIdentifier := omit,
1239 supportedCodecs := omit,
1240 emergencyCategory := omit
1241 }
1242 }
1243 }
1244}
1245
1246
Harald Welted748a052018-01-22 02:59:24 +01001247template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := {
1248 discriminator := '0011'B,
1249 tiOrSkip := {
1250 transactionId := {
1251 tio := int2bit(tid, 3),
1252 tiFlag := ?,
1253 tIExtension := omit
1254 }
1255 },
1256 msgs := {
1257 cc := {
1258 callProceeding := {
1259 messageType := '000010'B,
1260 nsd := '00'B,
1261 repeatIndicator := *,
1262 bearerCapability1 := *,
1263 bearerCapability2 := *,
1264 facility := *,
1265 progressIndicator := *,
1266 priorityGranted := *,
1267 networkCCCapabilities := *
1268 }
1269 }
1270 }
1271}
1272
1273template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := {
1274 discriminator := '0011'B,
1275 tiOrSkip := {
1276 transactionId := {
1277 tio := int2bit(tid, 3),
1278 tiFlag := ?,
1279 tIExtension := omit
1280 }
1281 },
1282 msgs := {
1283 cc := {
1284 alerting_NW_MS := {
1285 messageType := '000001'B,
1286 nsd := '00'B,
1287 facility := *,
1288 progressIndicator := *,
1289 user_user := *
1290 }
1291 }
1292 }
1293}
1294
Harald Welte33ec09b2018-02-10 15:34:46 +01001295template PDU_ML3_MS_NW ts_ML3_MO_CC_ALERTING(integer tid) := {
1296 discriminator := '0011'B,
1297 tiOrSkip := {
1298 transactionId := {
1299 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001300 tiFlag := c_TIF_REPL,
Harald Welte33ec09b2018-02-10 15:34:46 +01001301 tIExtension := omit
1302 }
1303 },
1304 msgs := {
1305 cc := {
1306 alerting_MS_NW := {
1307 messageType := '000001'B,
1308 nsd := '00'B,
1309 facility := omit,
1310 user_user := omit,
1311 ss_VersionIndicator := omit
1312 }
1313 }
1314 }
1315}
1316
1317template PDU_ML3_MS_NW ts_ML3_MT_CC_ALERTING(integer tid) := {
1318 discriminator := '0011'B,
1319 tiOrSkip := {
1320 transactionId := {
1321 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001322 tiFlag := c_TIF_REPL,
Harald Welte33ec09b2018-02-10 15:34:46 +01001323 tIExtension := omit
1324 }
1325 },
1326 msgs := {
1327 cc := {
1328 alerting_MS_NW := {
1329 messageType := '000001'B,
1330 nsd := '00'B,
1331 facility := omit,
1332 user_user := omit,
1333 ss_VersionIndicator := omit
1334 }
1335 }
1336 }
1337}
1338
1339template PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT(integer tid) := {
1340 discriminator := '0011'B,
1341 tiOrSkip := {
1342 transactionId := {
1343 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001344 tiFlag := c_TIF_REPL,
Harald Welte33ec09b2018-02-10 15:34:46 +01001345 tIExtension := omit
1346 }
1347 },
1348 msgs := {
1349 cc := {
1350 connect_MS_NW := {
1351 messageType := '000111'B,
1352 nsd := '00'B,
1353 facility := omit,
1354 connectedSubAddress := omit,
1355 user_user := omit,
1356 ss_VersionIndicator := omit,
1357 streamIdentifier := omit
1358 }
1359 }
1360 }
1361}
1362
Harald Welte4017d552018-01-26 21:40:05 +01001363template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := {
1364 discriminator := '0011'B,
1365 tiOrSkip := {
1366 transactionId := {
1367 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001368 tiFlag := c_TIF_REPL,
Harald Welte4017d552018-01-26 21:40:05 +01001369 tIExtension := omit
1370 }
1371 },
1372 msgs := {
1373 cc := {
1374 connect_NW_MS := {
1375 messageType := '000111'B,
1376 nsd := '00'B,
1377 facility := *,
1378 progressIndicator := *,
1379 connectedNumber := *,
1380 connectedSubAddress := *,
1381 user_user := *
1382 }
1383 }
1384 }
1385}
1386
1387template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := {
1388 discriminator := '0011'B,
1389 tiOrSkip := {
1390 transactionId := {
1391 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001392 tiFlag := c_TIF_ORIG,
Harald Welte4017d552018-01-26 21:40:05 +01001393 tIExtension := omit
1394 }
1395 },
1396 msgs := {
1397 cc := {
1398 connectAck := {
1399 messageType := '001111'B,
1400 nsd := '00'B
1401 }
1402 }
1403 }
1404}
1405
Daniel Willmann8b084372018-02-04 13:35:26 +01001406template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_START_DTMF(integer tid, charstring number) := {
1407 discriminator := '0011'B,
1408 tiOrSkip := {
1409 transactionId := {
1410 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001411 tiFlag := c_TIF_ORIG,
Daniel Willmann8b084372018-02-04 13:35:26 +01001412 tIExtension := omit
1413 }
1414 },
1415 msgs := {
1416 cc := {
1417 startDTMF := {
1418 messageType := '110101'B,
1419 nsd := '00'B,
1420 keypadFacility := {
1421 elementIdentifier := '2C'O,
1422 keypadInformation := int2bit(char2int(number), 7),
1423 spare_1 := '0'B
1424 }
1425 }
1426 }
1427 }
1428}
1429
Harald Welte2bb825f2018-01-22 11:31:18 +01001430template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := {
1431 discriminator := '0011'B,
1432 tiOrSkip := {
1433 transactionId := {
1434 tio := int2bit(tid, 3),
1435 tiFlag := ?,
1436 tIExtension := omit
1437 }
1438 },
1439 msgs := {
1440 cc := {
1441 disconnect_NW_MS := {
1442 messageType := '100101'B,
1443 nsd := '00'B,
1444 cause := ?,
1445 facility := *,
1446 progressIndicator := *,
1447 user_user := *,
1448 allowedActions := *
1449 }
1450 }
1451 }
1452}
1453
1454template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := {
1455 discriminator := '0011'B,
1456 tiOrSkip := {
1457 transactionId := {
1458 tio := int2bit(tid, 3),
1459 tiFlag := ?,
1460 tIExtension := omit
1461 }
1462 },
1463 msgs := {
1464 cc := {
1465 release_NW_MS := {
1466 messageType := '101101'B,
1467 nsd := '00'B,
1468 cause := ?,
1469 secondCause := *,
1470 facility := *,
1471 user_user := *
1472 }
1473 }
1474 }
1475}
Harald Welted748a052018-01-22 02:59:24 +01001476
Harald Welte33ec09b2018-02-10 15:34:46 +01001477template PDU_ML3_MS_NW ts_ML3_MO_CC_RELEASE(integer tid, BIT1 tid_remote, BIT7 cause) := {
1478 discriminator := '0011'B,
1479 tiOrSkip := {
1480 transactionId := {
1481 tio := int2bit(tid, 3),
1482 tiFlag := tid_remote,
1483 tIExtension := omit
1484 }
1485 },
1486 msgs := {
1487 cc := {
1488 release_MS_NW := {
1489 messageType := '101101'B,
1490 nsd := '00'B,
1491 cause := ts_ML3_Cause(cause),
1492 secondCause := omit,
1493 facility := omit,
1494 user_user := omit,
1495 ss_VersionIndicator := omit
1496 }
1497 }
1498 }
1499}
1500
1501
Neels Hofmeyr2ca1ab42019-03-08 03:45:43 +01001502template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid, BIT1 tid_remote := '0'B) := {
Harald Welteb71901a2018-01-26 19:16:05 +01001503 discriminator := '0011'B,
1504 tiOrSkip := {
1505 transactionId := {
1506 tio := int2bit(tid, 3),
Neels Hofmeyr2ca1ab42019-03-08 03:45:43 +01001507 tiFlag := tid_remote,
Harald Welteb71901a2018-01-26 19:16:05 +01001508 tIExtension := omit
1509 }
1510 },
1511 msgs := {
1512 cc := {
1513 releaseComplete_MS_NW := {
1514 messageType := '101010'B,
1515 nsd := '00'B,
1516 cause := omit,
1517 facility := omit,
1518 user_user := omit,
1519 ss_VersionIndicator := omit
1520 }
1521 }
1522 }
1523}
1524
Harald Welte33ec09b2018-02-10 15:34:46 +01001525template PDU_ML3_NW_MS tr_ML3_MT_CC_REL_COMPL(integer tid) := {
1526 discriminator := '0011'B,
1527 tiOrSkip := {
1528 transactionId := {
1529 tio := int2bit(tid, 3),
1530 tiFlag := ?,
1531 tIExtension := omit
1532 }
1533 },
1534 msgs := {
1535 cc := {
1536 releaseComplete_NW_MS := {
1537 messageType := '101010'B,
1538 nsd := '00'B,
1539 cause := *,
1540 facility := *,
1541 user_user := *
1542 }
1543 }
1544 }
1545}
1546
1547
Harald Welteb71901a2018-01-26 19:16:05 +01001548
Harald Welte77a8eba2018-01-22 21:22:32 +01001549template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := {
1550 discriminator := '0101'B,
1551 tiOrSkip := {
1552 skipIndicator := '0000'B
1553 },
1554 msgs := {
1555 mm := {
1556 authenticationRequest := {
1557 messageType := '010010'B,
1558 nsd := '00'B,
1559 cipheringKeySequenceNumber := ?,
1560 spare2_4 := ?,
1561 authenticationParRAND := rand,
1562 authenticationParAUTN := *
1563 }
1564 }
1565 }
1566}
1567
Harald Welte0cedf2c2018-10-28 23:28:35 +01001568template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ_3G(template OCT16 rand := ?, template OCT16 autn) := {
1569 discriminator := '0101'B,
1570 tiOrSkip := {
1571 skipIndicator := '0000'B
1572 },
1573 msgs := {
1574 mm := {
1575 authenticationRequest := {
1576 messageType := '010010'B,
1577 nsd := '00'B,
1578 cipheringKeySequenceNumber := ?,
1579 spare2_4 := ?,
1580 authenticationParRAND := rand,
1581 authenticationParAUTN := {
1582 elementIdentifier := '20'O,
1583 lengthIndicator := ?,
1584 autnValue := autn
1585 }
1586 }
1587 }
1588 }
1589}
1590
Harald Welte77a8eba2018-01-22 21:22:32 +01001591template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := {
1592 discriminator := '0101'B,
1593 tiOrSkip := {
1594 skipIndicator := '0000'B
1595 },
1596 msgs := {
1597 mm := {
1598 authenticationResponse := {
1599 messageType := '010100'B,
1600 nsd := '00'B,
1601 authenticationParSRES := sres,
1602 authenticationParSRESext := omit
1603 }
1604 }
1605 }
1606}
1607
1608template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := {
1609 discriminator := '0101'B,
1610 tiOrSkip := {
1611 skipIndicator := '0000'B
1612 },
1613 msgs := {
1614 mm := {
1615 authenticationResponse := {
1616 messageType := '010100'B,
1617 nsd := '00'B,
1618 authenticationParSRES := sres,
1619 authenticationParSRESext := {
1620 elementIdentifier := '21'O,
1621 lengthIndicator := 0, /* overwritten */
1622 valueField := res
1623 }
1624 }
1625 }
1626 }
1627}
Harald Weltecb6cc332018-01-21 13:59:08 +01001628
Harald Welte812f7a42018-01-27 00:49:18 +01001629template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid,
1630 template BearerCapability_TLV bcap := omit) := {
1631 discriminator := '0011'B,
1632 tiOrSkip := {
1633 transactionId := {
1634 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001635 tiFlag := c_TIF_REPL, /* response from destination */
Harald Welte812f7a42018-01-27 00:49:18 +01001636 tIExtension := omit
1637 }
1638 },
1639 msgs := {
1640 cc := {
1641 callConfirmed := {
1642 messageType := '001000'B,
1643 nsd := '00'B,
1644 repeatIndicator := omit,
1645 bearerCapability1 := bcap,
1646 bearerCapability2 := omit,
1647 cause := omit,
1648 cC_Capabilities := omit,
1649 streamIdentifier := omit,
1650 supportedCodecs := omit
1651 }
1652 }
1653 }
1654}
1655
1656
1657template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *,
1658 template hexstring calling := *,
1659 template BearerCapability_TLV bcap := *) := {
1660 discriminator := '0011'B,
1661 tiOrSkip := {
1662 transactionId := {
1663 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001664 tiFlag := c_TIF_ORIG, /* from originator */
Harald Welte812f7a42018-01-27 00:49:18 +01001665 tIExtension := omit
1666 }
1667 },
1668 msgs := {
1669 cc := {
1670 setup_NW_MS := {
1671 messageType := '000101'B,
1672 nsd := '00'B,
1673 bcRepeatIndicator := *,
1674 bearerCapability1 := bcap,
1675 bearerCapability2 := *,
1676 facility := *,
1677 progressIndicator := *,
1678 signal := *,
1679 callingPartyBCD_Number := tr_Calling(calling) ifpresent,
1680 callingPartySubAddress := *,
1681 calledPartyBCD_Number := tr_Called(called) ifpresent,
1682 calledPartySubAddress := *,
1683 redirectingPartyBCDNumber := *,
1684 redirectingPartySubaddress := *,
1685 llc_RepeatIndicator := *,
1686 lowLayerCompatibility1 := *,
1687 lowLayerCompatibility2 := *,
1688 hlc_RepeatIndicator := *,
1689 highLayerCompatibility1 := *,
1690 highLayerCompatibility2 := *,
1691 user_user := *,
1692 priority := *,
1693 alert := *,
1694 networkCCCapabilities := *,
1695 causeofNoCli := *,
1696 backupBearerCapacity := *
1697 }
1698 }
1699 }
1700}
1701
Harald Welte38575a72018-02-15 20:41:37 +01001702/***********************************************************************
Harald Welte53603962018-05-28 11:13:09 +02001703 * Supplementary Services
1704 ***********************************************************************/
1705
1706private template (value) Facility_TLV ts_FacTLV(OCTN facility) := {
1707 elementIdentifier := '1C'O,
1708 lengthIndicator := lengthof(facility),
1709 facilityInformation := facility
1710}
1711private template Facility_TLV tr_FacTLV(template OCTN facility) := {
1712 elementIdentifier := '1C'O,
1713 lengthIndicator := ?,
1714 facilityInformation := facility
1715}
1716
1717private template (value) Facility_LV ts_FacLV(OCTN facility) := {
1718 lengthIndicator := lengthof(facility),
1719 facilityInformation := facility
1720}
1721private template Facility_LV tr_FacLV(template OCTN facility) := {
1722 lengthIndicator := ?,
1723 facilityInformation := facility
1724}
1725
Vadim Yanitskiy03198132018-05-29 03:35:16 +07001726private function f_facility_or_omit(template (omit) OCTN facility)
1727return template (omit) Facility_TLV {
1728 if (istemplatekind(facility, "omit")) {
1729 return omit;
1730 } else {
1731 return ts_FacTLV(valueof(facility));
1732 }
1733}
1734private function f_facility_or_wc(template OCTN facility)
1735return template Facility_TLV {
1736 if (istemplatekind(facility, "*")) {
1737 return *;
1738 } else if (istemplatekind(facility, "?")) {
1739 return ?;
Vadim Yanitskiy52f8b6e2018-06-19 17:32:46 +07001740 } else if (istemplatekind(facility, "omit")) {
1741 return omit;
Vadim Yanitskiy03198132018-05-29 03:35:16 +07001742 } else {
1743 return tr_FacTLV(facility);
1744 }
1745}
1746
Harald Welte53603962018-05-28 11:13:09 +02001747template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_REGISTER(
1748 uint3_t tid, BIT1 ti_flag,
1749 OCTN facility,
1750 template (omit) SS_VersionIndicator ss_ver := omit
1751) := {
1752 discriminator := '1011'B,
1753 tiOrSkip := {
1754 transactionId := {
1755 tio := int2bit(tid, 3),
1756 tiFlag := ti_flag,
1757 tIExtension := omit
1758 }
1759 },
1760 msgs := {
1761 ss := {
1762 register := {
1763 messageType := '111011'B,
1764 nsd := '00'B,
1765 facility := ts_FacTLV(facility),
1766 ss_version := ss_ver
1767 }
1768 }
1769 }
1770}
1771template PDU_ML3_MS_NW tr_ML3_MO_SS_REGISTER(
1772 template uint3_t tid, template BIT1 ti_flag,
1773 template OCTN facility,
1774 template SS_VersionIndicator ss_ver := omit
1775) := {
1776 discriminator := '1011'B,
1777 tiOrSkip := {
1778 transactionId := {
1779 tio := f_tid_or_wc(tid),
1780 tiFlag := ti_flag,
1781 tIExtension := omit
1782 }
1783 },
1784 msgs := {
1785 ss := {
1786 register := {
1787 messageType := '111011'B,
1788 nsd := '00'B,
1789 facility := tr_FacTLV(facility),
1790 ss_version := ss_ver
1791 }
1792 }
1793 }
1794}
1795
1796template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_REGISTER(
1797 uint3_t tid, BIT1 ti_flag,
1798 OCTN facility
1799) := {
1800 discriminator := '1011'B,
1801 tiOrSkip := {
1802 transactionId := {
1803 tio := int2bit(tid, 3),
1804 tiFlag := ti_flag,
1805 tIExtension := omit
1806 }
1807 },
1808 msgs := {
1809 ss := {
1810 register := {
1811 messageType := '111011'B,
1812 nsd := '00'B,
1813 facility := ts_FacTLV(facility)
1814 }
1815 }
1816 }
1817}
1818template PDU_ML3_NW_MS tr_ML3_MT_SS_REGISTER(
1819 template uint3_t tid, template BIT1 ti_flag,
1820 template OCTN facility
1821) := {
1822 discriminator := '1011'B,
1823 tiOrSkip := {
1824 transactionId := {
1825 tio := f_tid_or_wc(tid),
1826 tiFlag := ti_flag,
1827 tIExtension := omit
1828 }
1829 },
1830 msgs := {
1831 ss := {
1832 register := {
1833 messageType := '111011'B,
1834 nsd := '00'B,
1835 facility := tr_FacTLV(facility)
1836 }
1837 }
1838 }
1839}
1840
1841template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_FACILITY(
1842 uint3_t tid, BIT1 ti_flag,
1843 OCTN facility
1844) := {
1845 discriminator := '1011'B,
1846 tiOrSkip := {
1847 transactionId := {
1848 tio := int2bit(tid, 3),
1849 tiFlag := ti_flag,
1850 tIExtension := omit
1851 }
1852 },
1853 msgs := {
1854 ss := {
1855 facility := {
1856 messageType := '111010'B,
1857 nsd := '00'B,
1858 facility := ts_FacLV(facility)
1859 }
1860 }
1861 }
1862}
1863template PDU_ML3_MS_NW tr_ML3_MO_SS_FACILITY(
1864 template uint3_t tid, template BIT1 ti_flag,
1865 template OCTN facility
1866) := {
1867 discriminator := '1011'B,
1868 tiOrSkip := {
1869 transactionId := {
1870 tio := f_tid_or_wc(tid),
1871 tiFlag := ti_flag,
1872 tIExtension := omit
1873 }
1874 },
1875 msgs := {
1876 ss := {
1877 facility := {
1878 messageType := '111010'B,
1879 nsd := '00'B,
1880 facility := tr_FacLV(facility)
1881 }
1882 }
1883 }
1884}
1885
1886template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_FACILITY(
1887 uint3_t tid, BIT1 ti_flag,
1888 OCTN facility
1889) := {
1890 discriminator := '1011'B,
1891 tiOrSkip := {
1892 transactionId := {
1893 tio := int2bit(tid, 3),
1894 tiFlag := ti_flag,
1895 tIExtension := omit
1896 }
1897 },
1898 msgs := {
1899 ss := {
1900 facility := {
1901 messageType := '111010'B,
1902 nsd := '00'B,
1903 facility := ts_FacLV(facility)
1904 }
1905 }
1906 }
1907}
1908template PDU_ML3_NW_MS tr_ML3_MT_SS_FACILITY(
1909 template uint3_t tid, template BIT1 ti_flag,
1910 template OCTN facility
1911) := {
1912 discriminator := '1011'B,
1913 tiOrSkip := {
1914 transactionId := {
1915 tio := f_tid_or_wc(tid),
1916 tiFlag := ti_flag,
1917 tIExtension := omit
1918 }
1919 },
1920 msgs := {
1921 ss := {
1922 facility := {
1923 messageType := '111010'B,
1924 nsd := '00'B,
1925 facility := tr_FacLV(facility)
1926 }
1927 }
1928 }
1929}
1930
Vadim Yanitskiy03198132018-05-29 03:35:16 +07001931template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_RELEASE_COMPLETE(
1932 uint3_t tid, BIT1 ti_flag,
1933 template (omit) ML3_Cause_TLV cause := omit,
1934 template (omit) OCTN facility := omit
1935) := {
1936 discriminator := '1011'B,
1937 tiOrSkip := {
1938 transactionId := {
1939 tio := int2bit(tid, 3),
1940 tiFlag := ti_flag,
1941 tIExtension := omit
1942 }
1943 },
1944 msgs := {
1945 ss := {
1946 releaseComplete_MS_NW := {
1947 messageType := '101010'B,
1948 nsd := '00'B,
1949 cause := cause,
1950 facility := f_facility_or_omit(facility)
1951 }
1952 }
1953 }
1954}
1955template PDU_ML3_MS_NW tr_ML3_MO_SS_RELEASE_COMPLETE(
1956 template uint3_t tid, template BIT1 ti_flag,
1957 template ML3_Cause_TLV cause := *,
1958 template OCTN facility := *
1959) := {
1960 discriminator := '1011'B,
1961 tiOrSkip := {
1962 transactionId := {
1963 tio := f_tid_or_wc(tid),
1964 tiFlag := ti_flag,
1965 tIExtension := omit
1966 }
1967 },
1968 msgs := {
1969 ss := {
1970 releaseComplete_MS_NW := {
1971 messageType := '101010'B,
1972 nsd := '00'B,
1973 cause := cause,
1974 facility := f_facility_or_wc(facility)
1975 }
1976 }
1977 }
1978}
1979
1980template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_RELEASE_COMPLETE(
1981 uint3_t tid, BIT1 ti_flag,
1982 template (omit) ML3_Cause_TLV cause := omit,
1983 template (omit) OCTN facility := omit
1984) := {
1985 discriminator := '1011'B,
1986 tiOrSkip := {
1987 transactionId := {
1988 tio := int2bit(tid, 3),
1989 tiFlag := ti_flag,
1990 tIExtension := omit
1991 }
1992 },
1993 msgs := {
1994 ss := {
1995 releaseComplete_NW_MS := {
1996 messageType := '101010'B,
1997 nsd := '00'B,
1998 cause := cause,
1999 facility := f_facility_or_omit(facility)
2000 }
2001 }
2002 }
2003}
2004template PDU_ML3_NW_MS tr_ML3_MT_SS_RELEASE_COMPLETE(
2005 template uint3_t tid, template BIT1 ti_flag,
2006 template ML3_Cause_TLV cause := *,
2007 template OCTN facility := *
2008) := {
2009 discriminator := '1011'B,
2010 tiOrSkip := {
2011 transactionId := {
2012 tio := f_tid_or_wc(tid),
2013 tiFlag := ti_flag,
2014 tIExtension := omit
2015 }
2016 },
2017 msgs := {
2018 ss := {
2019 releaseComplete_NW_MS := {
2020 messageType := '101010'B,
2021 nsd := '00'B,
2022 cause := cause,
2023 facility := f_facility_or_wc(facility)
2024 }
2025 }
2026 }
2027}
2028
Harald Welte53603962018-05-28 11:13:09 +02002029/***********************************************************************
Harald Welte38575a72018-02-15 20:41:37 +01002030 * GPRS Mobility Management
2031 ***********************************************************************/
2032
2033template (value) MSNetworkCapabilityV ts_GMM_MsNetCapV := {
2034 gea1bit := '1'B,
2035 smCapabilitiesviaDedicatedChannels := '1'B,
2036 smCapabilitiesviaGPRSChannels := '0'B,
2037 ucs2Support := '1'B,
2038 ssScreeningIndicator := '01'B,
2039 solSACapability := omit,
2040 revisionLevelIndicatior := omit,
2041 pFCFeatureMode := omit,
2042 extendedGEAbits := omit,
2043 lcsVAcapability := omit,
2044 pSInterRATHOtoUTRANIuModeCapability := omit,
2045 pSInterRATHOtoEUTRANS1ModeCapability := omit,
2046 eMMCombinedProceduresCapability := omit,
2047 iSRSupport := omit,
2048 sRVCCtoGERANUTRANCapability := omit,
2049 ePCCapability := omit,
2050 nFCapability := omit,
2051 gERANNertworkSharingCapability := omit,
2052 spare_octets := omit
2053};
2054
2055template (value) MSNetworkCapabilityLV ts_GMM_MsNetCapLV := {
2056 lengthIndicator := 0, /* overwritten */
2057 msNetworkCapabilityV := ts_GMM_MsNetCapV
2058};
2059
2060type enumerated GprsAttachType {
2061 GPRS_ATT_T_GPRS,
2062 GPRS_ATT_T_GPRS_IMSI_COMBINED
2063};
2064
2065function ts_GMM_AttachType(boolean combined := false, boolean follow_on_pending := false)
2066return AttachTypeV {
2067 var AttachTypeV att;
2068 if (combined) {
2069 att.attachType := '011'B;
2070 } else {
2071 att.attachType := '001'B;
2072 }
2073 att.for_l3 := bool2bit(combined);
2074 return att;
2075}
2076
2077type enumerated GprsUpdateType {
2078 GPRS_UPD_T_RA ('000'B),
2079 GPRS_UPD_T_RA_LA_COMBINED ('001'B),
2080 GPRS_UPD_T_RA_LA_COMBINED_IMSI_ATT ('010'B),
2081 GPRS_UPD_T_PERIODIC ('011'B)
2082};
2083
2084/* 10.5.5.18 Update Type */
2085template UpdateTypeV ts_GMM_UpdateType(GprsUpdateType upd_t, boolean combined := false,
2086 boolean follow_on_pending := false) := {
2087 valueField := int2bit(enum2int(upd_t), 3),
2088 for_l3 := bool2bit(combined)
2089}
2090
2091template (value) DRXParameterV ts_DrxParameterV := {
2092 splitPGCycleCode := '00'O, /* no DRX */
2093 nonDRXTimer := '000'B, /* no non-DRX mode */
2094 splitOnCCCH := '0'B, /* not supported */
2095 cnSpecificDRXCycleLength := '0000'B /* SI value used */
2096};
2097
Harald Welte38575a72018-02-15 20:41:37 +01002098template (value) MSRadioAccessCapabilityLV ts_MS_RaCapa := {
2099 lengthIndicator := 0, /* overwritten */
2100 msRadioAccessCapabilityV := {
2101 ts_RaCapRec('0001'B) /* E-GSM */
2102 }
2103}
2104
2105template (value) PDU_L3_MS_SGSN
2106 ts_GMM_ATTACH_REQ(MobileIdentityLV mi_lv, RoutingAreaIdentificationV old_ra,
2107 boolean combined := false, boolean follow_on_pending := false,
2108 template (omit) MobileStationClassmark2_TLV cm2_tlv,
2109 template (omit) MobileStationClassmark3_TLV cm3_tlv
2110 ) := {
2111 discriminator := '0000'B, /* overwritten */
2112 tiOrSkip := {
2113 skipIndicator := '0000'B
2114 },
2115 msgs := {
2116 gprs_mm := {
2117 attachRequest := {
2118 messageType := '00000000'B, /* overwritten */
2119 msNetworkCapability := ts_GMM_MsNetCapLV,
2120 attachType := valueof(ts_GMM_AttachType(combined, follow_on_pending)),
2121 gprsCKSN := { '111'B, '0'B },
2122 drxParam := ts_DrxParameterV,
2123 mobileIdentity := mi_lv,
2124 oldRoutingAreaID := old_ra,
2125 msRACap := ts_MS_RaCapa,
2126 ptmsiSignature := omit, /* TODO */
2127 reqGPRStimer := omit,
2128 tmsiStatus := omit,
2129 pC_LCSCapability := omit,
2130 mobileStationClassmark2 := cm2_tlv,
2131 mobileStationClassmark3 := cm3_tlv,
2132 supportedCodecs := omit,
2133 uENetworkCapability := omit,
2134 additionalMobileIdentity := omit,
2135 routingAreaIdentification2 := omit,
2136 voiceDomainandUEsUsageSetting := omit,
2137 deviceProperties := omit,
2138 p_TMSI_Type := omit,
2139 mS_NetworkFeatureSupport := omit,
2140 oldLocationAreaIdentification := omit,
2141 additionalUpdateType := omit,
2142 tMSIBasedNRIcontainer := omit,
2143 t3324 := omit,
2144 t3312_ExtendedValue := omit,
2145 extendedDRXParameters := omit
2146 }
2147 }
2148 }
2149}
2150
Harald Welteb0386df2018-02-16 18:14:28 +01002151private function tr_MI_TMSI_TLV(template OCT4 tmsi) return template MobileIdentityTLV {
2152 if (istemplatekind(tmsi, "*")) {
2153 return *;
2154 } else if (istemplatekind(tmsi, "?")) {
2155 return ?;
2156 } else {
2157 var template MobileIdentityTLV mi := {
2158 elementIdentifier := '0011000'B,
2159 spare1 := '0'B,
2160 mobileIdentityLV := {
2161 lengthIndicator := 4,
2162 mobileIdentityV := {
2163 typeOfIdentity := '100'B,
2164 oddEvenInd_identity := {
2165 tmsi_ptmsi := {
2166 oddevenIndicator := '1'B,
2167 fillerDigit := '1111'B,
2168 octets := tmsi
2169 }
2170 }
2171 }
2172 }
2173 };
2174 return mi;
2175 }
2176}
2177
2178template PDU_L3_SGSN_MS tr_GMM_ATTACH_ACCEPT(template BIT3 res := ?,
2179 template RoutingAreaIdentificationV ra := ?,
2180 template OCT4 ptmsi := *) := {
2181 discriminator := '1000'B,
2182 tiOrSkip := {
2183 skipIndicator := '0000'B
2184 },
2185 msgs := {
2186 gprs_mm := {
2187 attachAccept := {
2188 messageType := '00000010'B,
2189 attachResult := { res, ? },
2190 forceToStandby := ?,
2191 updateTimer := ?,
2192 radioPriority := ?,
2193 radioPriorityTOM8 := ?,
2194 routingAreaIdentification := ra,
2195 ptmsiSignature := *,
2196 readyTimer := *,
2197 allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi),
2198 msIdentity := *,
2199 gmmCause := *,
2200 t3302 := *,
2201 cellNotification := *,
2202 equivalentPLMNs := *,
2203 networkFeatureSupport := *,
2204 emergencyNumberList := *,
2205 requestedMSInformation := *,
2206 t3319 := *,
2207 t3323 := *,
2208 t3312_ExtendedValue := *,
2209 additionalNetworkFeatureSupport := *,
2210 t3324 := *,
2211 extendedDRXParameters := *
2212 }
2213 }
2214 }
2215}
Harald Welte38575a72018-02-15 20:41:37 +01002216
Harald Welte5b7c8122018-02-16 21:48:17 +01002217template PDU_L3_SGSN_MS tr_GMM_ATTACH_REJECT(template OCT1 cause) := {
2218 discriminator := '1000'B,
2219 tiOrSkip := {
2220 skipIndicator := '0000'B
2221 },
2222 msgs := {
2223 gprs_mm := {
2224 attachReject := {
2225 messageType := '00000100'B,
2226 gmmCause := {
2227 causeValue := cause
2228 },
2229 t3302 := *,
2230 t3346 := *
2231 }
2232 }
2233 }
2234}
2235
2236
Harald Welte38575a72018-02-15 20:41:37 +01002237template (value) PDU_L3_MS_SGSN ts_GMM_ATTACH_COMPL := {
2238 discriminator := '0000'B, /* overwritten */
2239 tiOrSkip := {
2240 skipIndicator := '0000'B
2241 },
2242 msgs := {
2243 gprs_mm := {
2244 attachComplete := {
2245 messageType := '00000000'B, /* overwritten */
2246 interRATHandoverInformation := omit,
2247 eUTRANinterRATHandoverInformation := omit
2248 }
2249 }
2250 }
2251}
2252
2253template (value) PDU_L3_MS_SGSN
2254 ts_GMM_RAU_REQ(MobileIdentityLV mi_lv, GprsUpdateType upd_type,
2255 RoutingAreaIdentificationV old_ra,
2256 boolean follow_on_pending := false,
2257 template (omit) MobileStationClassmark2_TLV cm2_tlv,
Alexander Couzensbfcb3202019-09-03 12:34:21 +02002258 template (omit) MobileStationClassmark3_TLV cm3_tlv,
2259 template (omit) OCT4 p_tmsi := omit
Harald Welte38575a72018-02-15 20:41:37 +01002260 ) := {
2261 discriminator := '0000'B, /* overwritten */
2262 tiOrSkip := {
2263 skipIndicator := '0000'B
2264 },
2265 msgs := {
2266 gprs_mm := {
2267 routingAreaUpdateRequest := {
2268 messageType := '00000000'B, /* overwritten */
2269 updateType := ts_GMM_UpdateType(upd_type, follow_on_pending),
2270 gprsCKSN := { '111'B, '0'B },
2271 oldRoutingAreaId := old_ra,
2272 msRACap := ts_MS_RaCapa,
2273 oldPTMSISignature := omit, /* TODO */
2274 readyTimerValue := omit,
2275 drxParameter := omit,
2276 tmsiStatus := omit,
Alexander Couzensbfcb3202019-09-03 12:34:21 +02002277 ptmsi := ts_MI_TMSI_TLV(p_tmsi),
Harald Welte38575a72018-02-15 20:41:37 +01002278 mSNetworkCapability := omit,
2279 pdpContextStatus := omit, /* TODO */
2280 pC_LCSCapability := omit,
Harald Welte04683d02018-02-16 22:43:45 +01002281 mBMS_ContextStatus := omit,
Harald Welte38575a72018-02-15 20:41:37 +01002282 uENetworkCapability := omit,
2283 additionalMobileIdentity := omit,
2284 oldRoutingAreaIdentification2 := omit,
2285 mobileStationClassmark2 := cm2_tlv,
2286 mobileStationClassmark3 := cm3_tlv,
2287 supportedCodecs := omit,
2288 voiceDomainUEUsageSetting := omit,
2289 p_TMSI_Type := omit,
2290 deviceProperties := omit,
2291 mS_NetworkFeatureSupport := omit,
2292 oldLocationAreaIdentification := omit,
2293 additionalUpdateType := omit,
2294 tMSIBasedNRIcontainer := omit,
2295 t3324 := omit,
2296 t3312_ExtendedValue := omit,
2297 extendedDRXParameters := omit
2298 }
2299 }
2300 }
2301}
2302
Harald Welte04683d02018-02-16 22:43:45 +01002303template PDU_L3_SGSN_MS tr_GMM_RAU_REJECT(template OCT1 cause := ?) := {
2304 discriminator := '1000'B,
2305 tiOrSkip := {
2306 skipIndicator := '0000'B
2307 },
2308 msgs := {
2309 gprs_mm := {
2310 routingAreaUpdateReject := {
2311 messageType := '00001011'B,
2312 gmmCause := {
2313 causeValue := cause
2314 },
2315 forceToStandby := ?,
2316 spare := '0000'B,
2317 t3302 := *,
2318 t3346 := *
2319 }
2320 }
2321 }
2322}
2323
Harald Welte91636de2018-02-17 10:16:14 +01002324template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?,
2325 template RoutingAreaIdentificationV ra := ?,
2326 template OCT4 ptmsi := *) := {
2327 discriminator := '1000'B,
2328 tiOrSkip := {
2329 skipIndicator := '0000'B
2330 },
2331 msgs := {
2332 gprs_mm := {
2333 routingAreaUpdateAccept := {
2334 messageType := '00001001'B,
2335 forceToStandby := ?,
2336 updateResult := { res, ? },
2337 raUpdateTimer := ?,
2338 routingAreaId := ra,
2339 ptmsiSignature := *,
2340 allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi),
2341 msIdentity := *,
2342 receiveNPDUNumbers := *,
2343 readyTimer := *,
2344 gmmCause := *,
2345 t3302 := *,
2346 cellNotification := *,
2347 equivalentPLMNs := *,
2348 pdpContextStatus := *,
2349 networkFeatureSupport := *,
2350 emergencyNumberList := *,
2351 mBMS_ContextStatus := *,
2352 requestedMSInformation := *,
2353 t3319 := *,
2354 t3323 := *,
2355 t3312_ExtendedValue := *,
2356 additionalNetworkFeatureSupport := *,
2357 t3324 := *,
2358 extendedDRXParameters := *
2359 }
2360 }
2361 }
2362}
Harald Welte04683d02018-02-16 22:43:45 +01002363
Harald Welte38575a72018-02-15 20:41:37 +01002364template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := {
2365 discriminator := '0000'B, /* overwritten */
2366 tiOrSkip := {
2367 skipIndicator := '0000'B
2368 },
2369 msgs := {
2370 gprs_mm := {
2371 routingAreaUpdateComplete := {
2372 messageType := '00000000'B, /* overwritten */
2373 receiveNPDUNumbers := omit,
2374 interRATHandoverInformation := omit,
2375 eUTRANinterRATHandoverInformation := omit
2376 }
2377 }
2378 }
2379}
2380
2381template (value) PDU_L3_MS_SGSN ts_GMM_PTMSI_REALL_COMPL := {
2382 discriminator := '0000'B, /* overwritten */
2383 tiOrSkip := {
2384 skipIndicator := '0000'B
2385 },
2386 msgs := {
2387 gprs_mm := {
2388 p_TMSIReallocationComplete := {
2389 messageType := '00000000'B /* overwritten */
2390 }
2391 }
2392 }
2393}
2394
2395template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_CIPH_COMPL(ACReferenceNumberV ref, OCT4 res) := {
2396 discriminator := '0000'B, /* overwritten */
2397 tiOrSkip := {
2398 skipIndicator := '0000'B
2399 },
2400 msgs := {
2401 gprs_mm := {
2402 authenticationAndCipheringResponse := {
2403 messageType := '00000000'B, /* overwritten */
2404 acReferenceNumber := ref,
2405 spare := '0000'B,
2406 authenticationParResp := {
2407 elementIdentifier := '22'O,
2408 valueField := res
2409 },
2410 imeisv := omit,
2411 authenticationRespParExt := omit
2412 }
2413 }
2414 }
2415}
2416
Harald Welteb0386df2018-02-16 18:14:28 +01002417template PDU_L3_SGSN_MS tr_GMM_ID_REQ(template BIT3 id_type := ?) := {
2418 discriminator := '1000'B,
2419 tiOrSkip := {
2420 skipIndicator := '0000'B
2421 },
2422 msgs := {
2423 gprs_mm := {
2424 identityRequest := {
2425 messageType := '00010101'B,
2426 identityType := { id_type, '0'B },
2427 forceToStandby := ?
2428 }
2429 }
2430 }
2431}
2432
Harald Welte38575a72018-02-15 20:41:37 +01002433template (value) PDU_L3_MS_SGSN ts_GMM_ID_RESP(MobileIdentityLV mi_lv) := {
2434 discriminator := '0000'B, /* overwritten */
2435 tiOrSkip := {
2436 skipIndicator := '0000'B
2437 },
2438 msgs := {
2439 gprs_mm := {
2440 identityResponse := {
2441 messageType := '00000000'B, /* overwritten */
2442 mobileIdentity := mi_lv
2443 }
2444 }
2445 }
2446}
2447
Harald Welteb0386df2018-02-16 18:14:28 +01002448template PDU_L3_SGSN_MS tr_GMM_AUTH_REQ(template OCT16 rand := ?, template BIT3 ciph_alg := ?) := {
2449 discriminator := '1000'B,
2450 tiOrSkip := {
2451 skipIndicator := '0000'B
2452 },
2453 msgs := {
2454 gprs_mm := {
2455 authenticationAndCipheringRequest := {
2456 messageType := '00010010'B,
2457 cipheringAlgorithm := { ciph_alg, '0'B },
2458 imeisvRequest := ?,
2459 forceToStandby := ?,
2460 acReferenceNumber := ?,
2461 authenticationParameterRAND := {
2462 elementIdentifier := '21'O,
2463 randValue := rand
2464 },
2465 cipheringKeySequenceNumber := *,
2466 authenticationParameterAUTN := *
2467 }
2468 }
2469 }
2470}
2471
2472template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_RESP_2G(BIT4 ac_ref, OCT4 sres) := {
2473 discriminator := '1000'B,
2474 tiOrSkip := {
2475 skipIndicator := '0000'B
2476 },
2477 msgs := {
2478 gprs_mm := {
2479 authenticationAndCipheringResponse := {
2480 messageType := '00010011'B,
2481 acReferenceNumber := { valueField := ac_ref },
2482 spare := '0000'B,
2483 authenticationParResp := {
2484 elementIdentifier := '22'O,
2485 valueField := sres
2486 },
2487 imeisv := omit,
2488 authenticationRespParExt := omit
2489 }
2490 }
2491 }
2492}
2493
Alexander Couzens15faf922018-09-04 15:16:26 +02002494template PDU_L3_MS_SGSN ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC(octetstring auts) := {
2495 discriminator := '1000'B,
2496 tiOrSkip := {
2497 skipIndicator := '0000'B
2498 },
2499 msgs := {
2500 gprs_mm := {
2501 authenticationAndCipheringFailure := {
2502 messageType := '00011100'B,
2503 gmmCause := {
2504 causeValue := '15'O /* GMM_CAUSE_SYNC_FAIL 10.5.3.2.2 */
2505 },
2506 authenticationFailureParam := {
2507 elementIdentifier := '30'O,
2508 lengthIndicator := 14,
2509 valueField := auts
2510 }
2511 }
2512 }
2513 }
2514}
2515
Harald Welteb0386df2018-02-16 18:14:28 +01002516
Harald Welte38575a72018-02-15 20:41:37 +01002517const BIT3 c_GMM_DTT_MO_GPRS := '001'B;
2518const BIT3 c_GMM_DTT_MO_IMSI := '010'B;
2519const BIT3 c_GMM_DTT_MO_GPRS_IMSI_COMBINED := '011'B;
2520
Alexander Couzensb6ab4562018-05-17 02:59:22 +02002521const BIT3 c_GMM_DTT_MT_REATTACH_REQUIRED := '001'B;
2522const BIT3 c_GMM_DTT_MT_REATTACH_NOT_REQUIRED := '010'B;
2523const BIT3 c_GMM_DTT_MT_IMSI_DETACH := '011'B;
2524
Harald Welte6abb9fe2018-02-17 15:24:48 +01002525template (value) DetachTypeV ts_GMM_DetType(BIT3 dtt, boolean power_off := false) := {
Harald Welte38575a72018-02-15 20:41:37 +01002526 detachType := dtt,
Harald Welte6abb9fe2018-02-17 15:24:48 +01002527 powerOffFlag := bool2bit(power_off)
Harald Welte38575a72018-02-15 20:41:37 +01002528}
2529
Harald Welte6abb9fe2018-02-17 15:24:48 +01002530function ts_PtmsiSigTV(template (omit) OCT3 val) return template (omit) P_TMSISignatureTV {
2531 var template (omit) P_TMSISignatureTV ret;
2532 if (istemplatekind(val, "omit")) {
2533 return omit;
2534 } else {
2535 ret := {
2536 elementIdentifier := '19'O,
2537 valueField := valueof(val)
2538 }
2539 return ret;
2540 }
2541}
2542
2543function ts_PtmsiSigTLV(template (omit) OCT3 val) return template (omit) P_TMSISignature2TLV {
2544 var template (omit) P_TMSISignature2TLV ret;
2545 if (istemplatekind(val, "omit")) {
2546 return omit;
2547 } else {
2548 ret := {
2549 elementIdentifier := '19'O,
2550 lengthIndicator := 3,
2551 valueField := valueof(val)
2552 }
2553 return ret;
2554 }
2555}
2556
2557template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS,
2558 boolean power_off := false,
2559 template (omit) OCT4 p_tmsi := omit,
2560 template (omit) OCT3 p_tmsi_sig := omit) := {
Harald Welte38575a72018-02-15 20:41:37 +01002561 discriminator := '0000'B, /* overwritten */
2562 tiOrSkip := {
2563 skipIndicator := '0000'B
2564 },
2565 msgs := {
2566 gprs_mm := {
2567 detachRequest_MS_SGSN := {
2568 messageType := '00000000'B, /* overwritten */
Harald Welte6abb9fe2018-02-17 15:24:48 +01002569 detachType := valueof(ts_GMM_DetType(dtt, power_off)),
Harald Welte38575a72018-02-15 20:41:37 +01002570 spare := '0000'B,
Harald Welte6abb9fe2018-02-17 15:24:48 +01002571 ptmsi := ts_MI_TMSI_TLV(p_tmsi),
2572 ptmsiSignature := ts_PtmsiSigTLV(p_tmsi_sig)
2573 }
2574 }
2575 }
2576}
2577
2578template PDU_L3_SGSN_MS tr_GMM_DET_ACCEPT_MT := {
2579 discriminator := '1000'B,
2580 tiOrSkip := {
2581 skipIndicator := '0000'B
2582 },
2583 msgs := {
2584 gprs_mm := {
2585 detachAccept_SGSN_MS := {
2586 messageType := '00000110'B,
2587 forceToStandby := ?,
2588 spare := '0000'B
Harald Welte38575a72018-02-15 20:41:37 +01002589 }
2590 }
2591 }
2592}
Harald Welte812f7a42018-01-27 00:49:18 +01002593
Alexander Couzensd62fba52018-05-22 16:08:39 +02002594template PDU_L3_SGSN_MS tr_GMM_DET_REQ_MT(
2595 template BIT3 dtt := *,
2596 template BIT3 forceToStandby := ?,
Alexander Couzensd8604ab2018-05-29 15:46:06 +02002597 template OCT1 cause := *) := {
Harald Welte835b15f2018-02-18 14:39:11 +01002598 discriminator := '1000'B,
2599 tiOrSkip := {
2600 skipIndicator := '0000'B
2601 },
2602 msgs := {
2603 gprs_mm := {
2604 detachRequest_SGSN_MS := {
2605 messageType := '00000101'B,
Alexander Couzensd62fba52018-05-22 16:08:39 +02002606 detachType := { dtt, ? },
2607 forceToStandby := { forceToStandby, '0'B },
2608 gmmCause := {
2609 elementIdentifier := '25'O,
2610 causeValue := { cause }
2611 }
2612 }
2613 }
2614 }
2615}
2616
2617template PDU_L3_MS_SGSN ts_GMM_DET_ACCEPT_MO := {
2618 discriminator := '0000'B, /* overwritten */
2619 tiOrSkip := {
2620 skipIndicator := '0000'B
2621 },
2622 msgs := {
2623 gprs_mm := {
2624 detachAccept_MS_SGSN := {
2625 messageType := '00000000'B
Harald Welte835b15f2018-02-18 14:39:11 +01002626 }
2627 }
2628 }
2629}
Harald Welteeded9ad2018-02-17 20:57:34 +01002630
2631function ts_ApnTLV(template (omit) octetstring apn) return template (omit) AccessPointNameTLV {
2632 if (istemplatekind(apn, "omit")) {
2633 return omit;
2634 } else {
2635 var template (omit) AccessPointNameTLV ret := {
2636 elementIdentifier := '28'O,
2637 lengthIndicator := 0, /* overwritten */
2638 accessPointNameValue := apn
2639 }
2640 return ret;
2641 }
2642}
2643
2644function ts_PcoTLV(template (omit) ProtocolConfigOptionsV pco)
2645 return template (omit) ProtocolConfigOptionsTLV {
2646 if (istemplatekind(pco, "omit")) {
2647 return omit;
2648 } else {
2649 var template (omit) ProtocolConfigOptionsTLV ret := {
2650 elementIdentifier := '27'O,
2651 lengthIndicator := 0, /* overwritten */
2652 protocolConfigOptionsV := pco
2653 }
2654 return ret;
2655 }
2656}
2657
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002658function ts_TearDownIndicatorTV(in template (omit) boolean ind)
2659 return template (omit) TearDownIndicatorTV {
2660 if (istemplatekind(ind, "omit")) {
2661 return omit;
2662 } else {
2663 var template (omit) TearDownIndicatorTV ret := {
2664 tearDownIndicatorV := {
2665 tdi_flag := bool2bit(valueof(ind)),
2666 spare := '000'B
2667 },
2668 elementIdentifier := '1001'B
2669 }
2670 return ret;
2671 }
2672}
2673
Harald Welteeded9ad2018-02-17 20:57:34 +01002674template (value) PDU_L3_MS_SGSN ts_SM_ACT_PDP_REQ(BIT3 tid, BIT4 nsapi, BIT4 sapi, QoSV qos,
2675 PDPAddressV addr,
2676 template (omit) octetstring apn := omit,
2677 template (omit) ProtocolConfigOptionsV pco := omit
2678 ) := {
2679 discriminator := '0000'B, /* overwritten */
2680 tiOrSkip := {
2681 transactionId := {
2682 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002683 tiFlag := c_TIF_ORIG,
Harald Welteeded9ad2018-02-17 20:57:34 +01002684 tIExtension := omit
2685 }
2686 },
2687 msgs := {
2688 gprs_sm := {
2689 activatePDPContextRequest := {
2690 messageType := '00000000'B, /* overwritten */
2691 requestedNSAPI := { nsapi, '0000'B },
2692 requestedLLCSAPI := { sapi, '0000'B },
2693 requestedQoS := {
2694 lengthIndicator := 0, /* overwritten */
2695 qoSV := qos
2696 },
2697 requestedPDPaddress := {
2698 lengthIndicator := 0, /* overwritten */
2699 pdpAddressV := addr
2700 },
2701 accessPointName := ts_ApnTLV(apn),
2702 protocolConfigOpts := ts_PcoTLV(pco),
2703 requestType := omit,
2704 deviceProperties := omit,
2705 nBIFOM_Container := omit
2706 }
2707 }
2708 }
2709}
2710
2711template PDU_L3_SGSN_MS tr_SM_ACT_PDP_REJ(template BIT3 tid := ?, template OCT1 cause := ?) := {
2712 discriminator := '1010'B,
2713 tiOrSkip := {
2714 transactionId := {
2715 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002716 tiFlag := c_TIF_REPL,
Harald Welteeded9ad2018-02-17 20:57:34 +01002717 tIExtension := omit
2718 }
2719 },
2720 msgs := {
2721 gprs_sm := {
2722 activatePDPContextReject := {
Harald Welte4aacdd82018-02-18 21:24:05 +01002723 messageType := '01000011'B,
Harald Welteeded9ad2018-02-17 20:57:34 +01002724 smCause := cause,
2725 protocolConfigOpts := *,
2726 backOffTimer := *,
2727 reAttemptIndicator := *,
2728 nBIFOM_Container := *
2729 }
2730 }
2731 }
2732}
2733
2734template PDU_L3_SGSN_MS tr_SM_ACT_PDP_ACCEPT(template BIT3 tid := ?, template BIT4 sapi := ?,
2735 template QoSV qos := ?)
2736:= {
2737 discriminator := '1010'B,
2738 tiOrSkip := {
2739 transactionId := {
2740 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002741 tiFlag := c_TIF_REPL,
Harald Welteeded9ad2018-02-17 20:57:34 +01002742 tIExtension := omit
2743 }
2744 },
2745 msgs := {
2746 gprs_sm := {
2747 activatePDPContextAccept := {
2748 messageType := '01000010'B,
2749 negotiatedLLCSAPI := { sapi, '0000'B },
2750 negotiatedQoS := {
2751 lengthIndicator := ?,
2752 qoSV := qos
2753 },
2754 radioPriority := ?,
2755 spare := '0000'B,
2756 pdpAddress := *,
2757 protocolConfigOpts := *,
2758 packetFlowID := *,
2759 sMCause2 := *,
2760 connectivityType := *,
2761 wLANOffloadIndication := *,
2762 nBIFOM_Container := *
2763 }
2764 }
2765 }
2766}
2767
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002768template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause,
2769 template (omit) boolean tdown := omit,
Harald Welte6f203162018-02-18 22:04:55 +01002770 template (omit) ProtocolConfigOptionsV pco := omit
2771 ) := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002772 discriminator := '1010'B,
Harald Welte6f203162018-02-18 22:04:55 +01002773 tiOrSkip := {
2774 transactionId := {
2775 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002776 tiFlag := c_TIF_ORIG,
Harald Welte6f203162018-02-18 22:04:55 +01002777 tIExtension := omit
2778 }
2779 },
2780 msgs := {
2781 gprs_sm := {
2782 deactivatePDPContextRequest := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002783 messageType := '01000110'B,
Harald Welte6f203162018-02-18 22:04:55 +01002784 smCause := cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002785 tearDownIndicator := ts_TearDownIndicatorTV(tdown),
Harald Welte6f203162018-02-18 22:04:55 +01002786 protocolConfigOpts := ts_PcoTLV(pco),
2787 mBMSprotocolConfigOptions := omit,
2788 t3396 := omit,
2789 wLANOffloadIndication := omit,
2790 nBIFOM_Container := omit
2791 }
2792 }
2793 }
2794}
2795
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002796template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause,
2797 template (omit) boolean tdown := omit,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002798 template (omit) ProtocolConfigOptionsV pco := omit
2799 ) := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002800 discriminator := '1010'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002801 tiOrSkip := {
2802 transactionId := {
2803 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002804 tiFlag := c_TIF_REPL,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002805 tIExtension := omit
2806 }
2807 },
2808 msgs := {
2809 gprs_sm := {
2810 deactivatePDPContextRequest := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002811 messageType := '01000110'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002812 smCause := cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002813 tearDownIndicator := ts_TearDownIndicatorTV(tdown),
Harald Welte57b9b7f2018-02-18 22:28:13 +01002814 protocolConfigOpts := ts_PcoTLV(pco),
2815 mBMSprotocolConfigOptions := omit,
2816 t3396 := omit,
2817 wLANOffloadIndication := omit,
2818 nBIFOM_Container := omit
2819 }
2820 }
2821 }
2822}
2823
2824template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002825 template (omit) boolean tdown := omit,
2826 template (omit) ProtocolConfigOptionsV pco := omit
2827 ) := {
2828 discriminator := '1010'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002829 tiOrSkip := {
2830 transactionId := {
2831 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002832 tiFlag := c_TIF_REPL,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002833 tIExtension := omit
2834 }
2835 },
2836 msgs := {
2837 gprs_sm := {
2838 deactivatePDPContextRequest := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002839 messageType := '01000110'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002840 smCause := cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002841 tearDownIndicator := ts_TearDownIndicatorTV(tdown),
2842 protocolConfigOpts := ts_PcoTLV(pco),
Harald Welte57b9b7f2018-02-18 22:28:13 +01002843 mBMSprotocolConfigOptions := *,
2844 t3396 := *,
2845 wLANOffloadIndication := *,
2846 nBIFOM_Container := *
2847 }
2848 }
2849 }
2850}
2851
Harald Welte6f203162018-02-18 22:04:55 +01002852template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?)
2853:= {
2854 discriminator := '1010'B,
2855 tiOrSkip := {
2856 transactionId := {
2857 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002858 tiFlag := c_TIF_REPL,
Harald Welte6f203162018-02-18 22:04:55 +01002859 tIExtension := omit
2860 }
2861 },
2862 msgs := {
2863 gprs_sm := {
2864 deactivatePDPContextAccept := {
2865 messageType := '01000111'B,
2866 protocolConfigOpts := *,
2867 mBMSprotocolConfigOptions := *,
2868 nBIFOM_Container := *
2869 }
2870 }
2871 }
2872}
2873
Harald Welte57b9b7f2018-02-18 22:28:13 +01002874template PDU_L3_MS_SGSN tr_SM_DEACT_PDP_ACCEPT_MO(template BIT3 tid := ?)
2875:= {
2876 discriminator := '1010'B,
2877 tiOrSkip := {
2878 transactionId := {
2879 tio := tid,
Pau Espin Pedrol55cb2ce2020-04-22 17:08:09 +02002880 tiFlag := c_TIF_ORIG,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002881 tIExtension := omit
2882 }
2883 },
2884 msgs := {
2885 gprs_sm := {
2886 deactivatePDPContextAccept := {
2887 messageType := '01000111'B,
2888 protocolConfigOpts := *,
2889 mBMSprotocolConfigOptions := *,
2890 nBIFOM_Container := *
2891 }
2892 }
2893 }
2894}
2895
2896template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_ACCEPT_MO(BIT3 tid)
2897:= {
2898 discriminator := '1010'B,
2899 tiOrSkip := {
2900 transactionId := {
2901 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002902 tiFlag := c_TIF_ORIG,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002903 tIExtension := omit
2904 }
2905 },
2906 msgs := {
2907 gprs_sm := {
2908 deactivatePDPContextAccept := {
2909 messageType := '01000111'B,
2910 protocolConfigOpts := omit,
2911 mBMSprotocolConfigOptions := omit,
2912 nBIFOM_Container := omit
2913 }
2914 }
2915 }
2916}
2917
Harald Welteeded9ad2018-02-17 20:57:34 +01002918
2919
Harald Weltee5695f52018-02-16 14:46:15 +01002920private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring {
2921 var integer suffix_len := tot_len - lengthof(prefix);
2922 var charstring suffix_ch := int2str(suffix);
2923 var integer pad_len := suffix_len - lengthof(suffix_ch);
2924
2925 return prefix & int2hex(0, pad_len) & str2hex(suffix_ch);
2926}
2927
2928function f_gen_imei(integer suffix) return hexstring {
Oliver Smith745ed952019-07-05 14:08:17 +02002929 return f_concat_pad(14, '49999'H, suffix);
Harald Weltee5695f52018-02-16 14:46:15 +01002930}
2931
2932function f_gen_imsi(integer suffix) return hexstring {
2933 return f_concat_pad(15, '26242'H, suffix);
2934}
2935
2936function f_gen_msisdn(integer suffix) return hexstring {
2937 return f_concat_pad(12, '49123'H, suffix);
2938}
2939
Harald Welte7484fc42018-02-24 14:09:45 +01002940external function enc_MobileIdentityLV(in MobileIdentityLV si) return octetstring
2941 with { extension "prototype(convert) encode(RAW)" };
Harald Weltee5695f52018-02-16 14:46:15 +01002942
Vadim Yanitskiy322c7932020-01-01 23:03:47 +01002943external function dec_MobileIdentityV(in octetstring mi) return MobileIdentityV
2944 with { extension "prototype(convert) decode(RAW)" };
2945
Harald Weltecb6cc332018-01-21 13:59:08 +01002946
Harald Weltef45efeb2018-04-09 18:19:24 +02002947
2948/* SMS TPDU Layer */
2949
2950template (value) TPDU_RP_DATA_MS_SGSN ts_SMS_SUBMIT(OCT1 msg_ref, template (value) TP_DA dst_addr,
2951 template (value) OCT1 pid, template (value) OCT1 dcs,
2952 integer length_ind, octetstring user_data) := {
2953 sMS_SUBMIT := {
2954 tP_MTI := '01'B, /* SUBMIT */
2955 tP_RD := '1'B, /* reject duplicates */
2956 tP_VPF := '00'B, /* not present */
2957 tP_SRR := '0'B, /* no status report requested */
2958 tP_UDHI := '0'B, /* no user data header in UD */
2959 tP_RP := '0'B, /* no reply path */
2960 tP_MR := msg_ref,
2961 tP_DA := dst_addr,
2962 tP_PID := pid,
2963 tP_DCS := dcs,
2964 tP_VP := omit,
2965 tP_UDL_UD := {
2966 tP_LengthIndicator := length_ind,
2967 tP_UD := user_data
2968 }
2969 }
2970}
2971
2972template TPDU_RP_DATA_SGSN_MS tr_SMS_DELIVER(template TP_OA src_addr := ?,
2973 template octetstring user_data := ?,
2974 template OCT1 pid := ?, template OCT1 dcs := ?,
2975 template BIT1 mms := ?
2976 ) := {
2977 sMS_DELIVER := {
2978 tP_MTI := '00'B, /* DELIVER */
2979 tP_MMS := mms, /* more messages to send */
2980 tP_LP := ?, /* ?!? */
2981 tP_Spare := '0'B,
2982 tP_SRI := '0'B, /* status report indication */
2983 tP_UDHI := '0'B, /* no user data header in UD */
2984 tP_RP := '0'B, /* no reply path */
2985 tP_OA := src_addr,
2986 tP_PID := pid,
2987 tP_DCS := dcs,
2988 tP_SCTS := ?,
2989 tP_UDL_UD := {
2990 tP_LengthIndicator := ?,
2991 tP_UD := user_data
2992 }
2993 }
2994}
2995
2996/* RP Layer */
2997
2998private function ts_RpOrig(template (omit) RP_NumberingPlan_and_NumberDigits rp_orig)
2999return RP_OriginatorAddressLV {
3000 var RP_OriginatorAddressLV ret;
3001 if (istemplatekind(rp_orig, "omit")) {
3002 ret := { 0, omit };
3003 } else {
3004 ret := { 0, valueof(rp_orig) };
3005 }
3006 return ret;
3007}
3008
3009private function ts_RpDst(template (omit) RP_NumberingPlan_and_NumberDigits rp_dst)
3010return RP_DestinationAddressLV {
3011 var RP_DestinationAddressLV ret;
3012 if (istemplatekind(rp_dst, "omit")) {
3013 ret := { 0, omit };
3014 } else {
3015 ret := { 0, valueof(rp_dst) };
3016 }
3017 return ret;
3018}
3019
3020template (value) RPDU_MS_SGSN ts_RP_DATA_MO(OCT1 msg_ref,
3021 template (omit) RP_NumberingPlan_and_NumberDigits rp_orig,
3022 template (omit) RP_NumberingPlan_and_NumberDigits rp_dst,
3023 template (value) TPDU_RP_DATA_MS_SGSN tpdu) := {
3024 rP_DATA_MS_SGSN := {
3025 rP_MTI := '000'B,
3026 rP_Spare := '00000'B,
3027 rP_MessageReference := msg_ref,
3028 rP_OriginatorAddress := ts_RpOrig(rp_orig),
3029 rP_DestinationAddress := ts_RpDst(rp_dst),
3030 rP_User_Data := {
3031 rP_LengthIndicator := 0, /* overwritten */
3032 rP_TPDU := tpdu
3033 }
3034 }
3035}
3036
3037template RPDU_SGSN_MS tr_RP_DATA_MT(template OCT1 msg_ref,
3038 template RP_NumberingPlan_and_NumberDigits rp_orig,
3039 template RP_NumberingPlan_and_NumberDigits rp_dst,
3040 template TPDU_RP_DATA_SGSN_MS tpdu) := {
3041 rP_DATA_SGSN_MS := {
3042 rP_MTI := '001'B,
3043 rP_Spare := '00000'B,
3044 rP_MessageReference := msg_ref,
3045 rP_OriginatorAddress := { ?, rp_orig },
3046 rP_DestinationAddress := { ?, rp_dst },
3047 rP_User_Data := {
3048 rP_LengthIndicator := ?,
3049 rP_TPDU := tpdu
3050 }
3051
3052 }
3053}
3054
3055template (value) RPDU_MS_SGSN ts_RP_ACK_MO(OCT1 msg_ref) := {
3056 rP_ACK_MS_SGSN := {
3057 rP_MTI := '010'B,
3058 rP_Spare := '00000'B,
3059 rP_MessageReference := msg_ref,
3060 rP_User_Data := omit /* FIXME: report */
3061 }
3062}
3063
3064template RPDU_SGSN_MS tr_RP_ACK_MT(template OCT1 msg_ref) := {
3065 rP_ACK_SGSN_MS := {
3066 rP_MTI := '011'B,
3067 rP_Spare := '00000'B,
3068 rP_MessageReference := msg_ref,
3069 rP_User_Data := omit /* FIXME: report */
3070 }
3071}
3072
3073template (value) RPDU_MS_SGSN ts_RP_ERROR_MO(OCT1 msg_ref, uint7_t cause) := {
3074 rP_ERROR_MS_SGSN := {
3075 rP_MTI := '100'B,
3076 rP_Spare := '00000'B,
3077 rP_Message_Reference := msg_ref,
3078 rP_CauseLV := {
3079 rP_LengthIndicator := 0, /* overwritten */
3080 rP_CauseV := {
3081 causeValue := int2bit(cause, 7),
3082 ext := '0'B
3083 },
3084 rP_diagnisticField := omit
3085 },
3086 rP_User_Data := omit /* FIXME: report */
3087 }
3088}
3089
3090private function f_cause_or_wc(template uint7_t cause) return template BIT7 {
3091 if (istemplatekind(cause, "?")) {
3092 return ?;
3093 } else if (istemplatekind(cause, "*")) {
3094 return *;
3095 } else {
3096 return int2bit(valueof(cause), 7);
3097 }
3098}
3099
3100template RPDU_SGSN_MS tr_RP_ERROR_MT(template OCT1 msg_ref, template uint7_t cause) := {
3101 rP_ERROR_SGSN_MS := {
3102 rP_MTI := '101'B,
3103 rP_Spare := '00000'B,
3104 rP_Message_Reference := msg_ref,
3105 rP_CauseLV := {
Vadim Yanitskiye9e93012020-01-15 12:35:17 +07003106 rP_LengthIndicator := ?,
Harald Weltef45efeb2018-04-09 18:19:24 +02003107 rP_CauseV := {
3108 causeValue := f_cause_or_wc(cause),
3109 ext := '0'B
3110 },
3111 rP_diagnisticField := omit
3112 },
3113 rP_User_Data := omit /* FIXME: report */
3114 }
3115}
3116
3117
3118template (value) RPDU_MS_SGSN ts_RP_SMMA_MO(OCT1 msg_ref) := {
3119 rP_SMMA := {
3120 rP_MTI := '110'B,
3121 rP_Spare := '00000'B,
3122 rP_MessageReference := msg_ref
3123 }
3124}
3125
3126
3127
3128
3129/* CP Layer */
3130
3131template (value) L3_SMS_MS_SGSN ts_CP_DATA_MO(template (value) RPDU_MS_SGSN rpdu) := {
3132 cP_DATA := {
3133 cP_messageType := '00000001'B,
3134 cP_User_Data := {
3135 lengthIndicator := 0, /* overwritten */
3136 cP_RPDU := rpdu
3137 }
3138 }
3139}
3140
3141template (value) L3_SMS_MS_SGSN ts_CP_ACK_MO := {
3142 cP_ACK := {
3143 cP_messageType := '00000100'B
3144 }
3145}
3146
3147template (value) L3_SMS_MS_SGSN ts_CP_ERROR_MO(OCT1 cause) := {
3148 cP_ERROR := {
3149 cP_messageType := '00010000'B,
3150 cP_Cause := {
3151 causeValue := cause
3152 }
3153 }
3154}
3155
3156template L3_SMS_SGSN_MS tr_CP_DATA_MT(template RPDU_SGSN_MS rpdu) := {
3157 cP_DATA := {
3158 cP_messageType := '00000001'B,
3159 cP_User_Data := {
3160 lengthIndicator := ?,
3161 cP_RPDU := rpdu
3162 }
3163 }
3164}
3165
3166template L3_SMS_SGSN_MS tr_CP_ACK_MT := {
3167 cP_ACK := {
3168 cP_messageType := '00000100'B
3169 }
3170}
3171
3172template L3_SMS_SGSN_MS tr_CP_ERROR_MT(template OCT1 cause) := {
3173 cP_ERROR := {
3174 cP_messageType := '00010000'B,
3175 cP_Cause := {
3176 causeValue := cause
3177 }
3178 }
3179}
3180
3181/* L3 Wrapper */
3182
3183template (value) PDU_ML3_MS_NW ts_ML3_MO_SMS(uint3_t tid, BIT1 ti_flag,
3184 template (value) L3_SMS_MS_SGSN sms_mo) := {
3185 discriminator := '1001'B,
3186 tiOrSkip := {
3187 transactionId := {
3188 tio := int2bit(tid, 3),
3189 tiFlag := ti_flag,
3190 tIExtension := omit
3191 }
3192 },
3193 msgs := {
3194 sms := sms_mo
3195 }
3196}
3197
3198private function f_tid_or_wc(template uint3_t tid) return template BIT3 {
3199 var template BIT3 ret;
3200 if (istemplatekind(tid, "*")) {
3201 return *;
3202 } else if (istemplatekind(tid, "?")) {
3203 return ?;
3204 } else {
3205 return int2bit(valueof(tid), 3);
3206 }
3207}
3208
3209template PDU_ML3_NW_MS tr_ML3_MT_SMS(template uint3_t tid, template BIT1 ti_flag,
3210 template L3_SMS_SGSN_MS sms_mt) := {
3211 discriminator := '1001'B,
3212 tiOrSkip := {
3213 transactionId := {
3214 tio := f_tid_or_wc(tid),
3215 tiFlag := ti_flag,
3216 tIExtension := omit
3217 }
3218 },
3219 msgs := {
3220 sms := sms_mt
3221 }
3222}
3223
Philipp Maier9b690e42018-12-21 11:50:03 +01003224template PDU_ML3_NW_MS tr_ML3_MT_MM_Info := {
3225 discriminator := '0101'B,
3226 tiOrSkip := {
3227 skipIndicator := '0000'B
3228 },
3229 msgs := {
3230 mm := {
3231 mMInformation := {
3232 messageType := '110010'B,
3233 nsd := '00'B,
3234 fullNetworkName := *,
3235 shortNetworkName := *,
3236 localtimeZone := *,
3237 univTime := *,
3238 lSAIdentity := *,
3239 networkDST := *
3240 }
3241 }
3242 }
3243}
Harald Weltef45efeb2018-04-09 18:19:24 +02003244
Vadim Yanitskiy13c26f92020-07-04 21:15:26 +07003245template (value) PDU_ML3_MS_NW ts_RRM_GprsSuspReq(template (value) OCT4 tlli,
3246 template (value) RoutingAreaIdentificationV rai,
3247 template (value) OCT1 cause) := {
3248 discriminator := '0000'B, /* overwritten */
3249 tiOrSkip := {
3250 skipIndicator := '0000'B
3251 },
3252 msgs := {
3253 rrm := {
3254 gPRS_suspensionRequest := {
3255 messageType := '00110100'B,
3256 tLLI := tlli,
3257 routingAreaIdentification := rai,
3258 suspensionCause := cause,
3259 service_Support := omit
3260 }
3261 }
3262 }
3263}
3264
Harald Weltef45efeb2018-04-09 18:19:24 +02003265
3266
Harald Weltec76f29f2017-11-22 12:46:46 +01003267}