blob: 8b095728ea85baff30589df639780a54f8983a95 [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 }
1107 }
1108}
1109
1110template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := {
1111 elementIdentifier := '5E'O,
1112 lengthIndicator := 0, /* overwritten */
1113 numberingPlanIdentification := '0000'B,
1114 typeOfNumber := '000'B, /* unknown */
1115 ext1 := '0'B,
1116 digits := digits
1117}
1118
Harald Welte812f7a42018-01-27 00:49:18 +01001119template CalledPartyBCD_Number tr_Called(template hexstring digits) := {
1120 elementIdentifier := '5E'O,
1121 lengthIndicator := ?,
1122 numberingPlanIdentification := ?,
1123 typeOfNumber := ?,
1124 ext1 := ?,
1125 digits := digits
1126}
1127
Stefan Sperling26d57be2018-11-12 17:03:26 +01001128private function f_pad_digits(hexstring digits) return hexstring {
1129 if (lengthof(digits) mod 2 != 0) {
1130 /* Add trailing nibble of 1-bit padding, like the CallingPartyBCD_Number encoder would do.
1131 * Otherwise our template won't match the data received (see OS#2930). */
1132 return digits & 'F'H;
1133 }
1134 return digits;
1135}
1136
Harald Welte812f7a42018-01-27 00:49:18 +01001137template CallingPartyBCD_Number tr_Calling(template hexstring digits) := {
1138 elementIdentifier := '5C'O,
1139 lengthIndicator := ?,
1140 oct3 := ?,
Stefan Sperling26d57be2018-11-12 17:03:26 +01001141 digits := f_pad_digits(valueof(digits))
Harald Welte812f7a42018-01-27 00:49:18 +01001142}
1143
Harald Welte4b2b3a62018-01-26 10:32:39 +01001144type integer SpeechVer;
1145
1146template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := {
1147 speechVersionIndication := int2bit(ver-1,3) & suffix,
1148 spare1_1 := '0'B,
1149 cTM_or_Spare := '0'B,
1150 coding := '0'B,
1151 extension_octet_3a_3b := '0'B
1152}
1153
1154template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B);
1155template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B);
1156
Harald Welted748a052018-01-22 02:59:24 +01001157template (value) BearerCapability_TLV ts_Bcap_voice := {
1158 elementIdentifier := '04'O,
1159 lengthIndicator := 0, /* overwritten */
1160 octet3 := {
1161 informationTransferCapability := '000'B,
1162 transferMode := '0'B,
1163 codingStandard := '0'B,
1164 radioChannelRequirement := '11'B, /* FR preferred */
1165 extension_octet_3 := '0'B, /* overwritten */
Harald Welte4b2b3a62018-01-26 10:32:39 +01001166 speech_aux_3a_3b := {
1167 valueof(ts_SpeechAuxHR(3)),
1168 valueof(ts_SpeechAuxFR(3)),
1169 valueof(ts_SpeechAuxFR(2)),
1170 valueof(ts_SpeechAuxFR(1)),
1171 valueof(ts_SpeechAuxHR(1))
1172 }
Harald Welted748a052018-01-22 02:59:24 +01001173 },
1174 octet4 := omit,
1175 octet5 := omit,
1176 octet6 := omit,
1177 octet7 := omit
1178}
1179
1180template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := {
1181 discriminator := '0011'B,
1182 tiOrSkip := {
1183 transactionId := {
1184 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001185 tiFlag := c_TIF_ORIG,
Harald Welted748a052018-01-22 02:59:24 +01001186 tIExtension := omit
1187 }
1188 },
1189 msgs := {
1190 cc := {
1191 setup_MS_NW := {
1192 messageType := '000101'B,
1193 nsd := '00'B,
1194 bcRepeatIndicator := omit,
1195 bearerCapability1 := bcap,
1196 bearerCapability2 := omit,
1197 facility := omit,
1198 callingPartySubAddress := omit,
1199 calledPartyBCD_Number := ts_Called(called),
1200 calledPartySubAddress := omit,
1201 llc_RepeatIndicator := omit,
1202 lowLayerCompatibility1 := omit,
1203 lowLayerCompatibility2 := omit,
1204 hlc_RepeatIndicator := omit,
1205 highLayerCompatibility1 := omit,
1206 highLayerCompatibility2 := omit,
1207 user_user := omit,
1208 ss_VersionIndicator := omit,
1209 clir_Suppression := omit,
1210 clir_Invocation := omit,
1211 cC_Capabilities := omit,
1212 facility_ccbs1 := omit,
1213 facility_ccbs2 := omit,
1214 streamIdentifier := omit,
1215 supportedCodecs := omit,
1216 redial := omit
1217 }
1218 }
1219 }
1220}
1221
Harald Welte45164da2018-01-24 12:51:27 +01001222template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := {
1223 discriminator := '0011'B,
1224 tiOrSkip := {
1225 transactionId := {
1226 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001227 tiFlag := c_TIF_ORIG,
Harald Welte45164da2018-01-24 12:51:27 +01001228 tIExtension := omit
1229 }
1230 },
1231 msgs := {
1232 cc := {
1233 emergencySetup := {
1234 messageType := '001110'B,
1235 nsd := '00'B,
1236 bearerCapability := bcap,
1237 streamIdentifier := omit,
1238 supportedCodecs := omit,
1239 emergencyCategory := omit
1240 }
1241 }
1242 }
1243}
1244
1245
Harald Welted748a052018-01-22 02:59:24 +01001246template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := {
1247 discriminator := '0011'B,
1248 tiOrSkip := {
1249 transactionId := {
1250 tio := int2bit(tid, 3),
1251 tiFlag := ?,
1252 tIExtension := omit
1253 }
1254 },
1255 msgs := {
1256 cc := {
1257 callProceeding := {
1258 messageType := '000010'B,
1259 nsd := '00'B,
1260 repeatIndicator := *,
1261 bearerCapability1 := *,
1262 bearerCapability2 := *,
1263 facility := *,
1264 progressIndicator := *,
1265 priorityGranted := *,
1266 networkCCCapabilities := *
1267 }
1268 }
1269 }
1270}
1271
1272template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := {
1273 discriminator := '0011'B,
1274 tiOrSkip := {
1275 transactionId := {
1276 tio := int2bit(tid, 3),
1277 tiFlag := ?,
1278 tIExtension := omit
1279 }
1280 },
1281 msgs := {
1282 cc := {
1283 alerting_NW_MS := {
1284 messageType := '000001'B,
1285 nsd := '00'B,
1286 facility := *,
1287 progressIndicator := *,
1288 user_user := *
1289 }
1290 }
1291 }
1292}
1293
Harald Welte33ec09b2018-02-10 15:34:46 +01001294template PDU_ML3_MS_NW ts_ML3_MO_CC_ALERTING(integer tid) := {
1295 discriminator := '0011'B,
1296 tiOrSkip := {
1297 transactionId := {
1298 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001299 tiFlag := c_TIF_REPL,
Harald Welte33ec09b2018-02-10 15:34:46 +01001300 tIExtension := omit
1301 }
1302 },
1303 msgs := {
1304 cc := {
1305 alerting_MS_NW := {
1306 messageType := '000001'B,
1307 nsd := '00'B,
1308 facility := omit,
1309 user_user := omit,
1310 ss_VersionIndicator := omit
1311 }
1312 }
1313 }
1314}
1315
1316template PDU_ML3_MS_NW ts_ML3_MT_CC_ALERTING(integer tid) := {
1317 discriminator := '0011'B,
1318 tiOrSkip := {
1319 transactionId := {
1320 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001321 tiFlag := c_TIF_REPL,
Harald Welte33ec09b2018-02-10 15:34:46 +01001322 tIExtension := omit
1323 }
1324 },
1325 msgs := {
1326 cc := {
1327 alerting_MS_NW := {
1328 messageType := '000001'B,
1329 nsd := '00'B,
1330 facility := omit,
1331 user_user := omit,
1332 ss_VersionIndicator := omit
1333 }
1334 }
1335 }
1336}
1337
1338template PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT(integer tid) := {
1339 discriminator := '0011'B,
1340 tiOrSkip := {
1341 transactionId := {
1342 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001343 tiFlag := c_TIF_REPL,
Harald Welte33ec09b2018-02-10 15:34:46 +01001344 tIExtension := omit
1345 }
1346 },
1347 msgs := {
1348 cc := {
1349 connect_MS_NW := {
1350 messageType := '000111'B,
1351 nsd := '00'B,
1352 facility := omit,
1353 connectedSubAddress := omit,
1354 user_user := omit,
1355 ss_VersionIndicator := omit,
1356 streamIdentifier := omit
1357 }
1358 }
1359 }
1360}
1361
Harald Welte4017d552018-01-26 21:40:05 +01001362template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := {
1363 discriminator := '0011'B,
1364 tiOrSkip := {
1365 transactionId := {
1366 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001367 tiFlag := c_TIF_REPL,
Harald Welte4017d552018-01-26 21:40:05 +01001368 tIExtension := omit
1369 }
1370 },
1371 msgs := {
1372 cc := {
1373 connect_NW_MS := {
1374 messageType := '000111'B,
1375 nsd := '00'B,
1376 facility := *,
1377 progressIndicator := *,
1378 connectedNumber := *,
1379 connectedSubAddress := *,
1380 user_user := *
1381 }
1382 }
1383 }
1384}
1385
1386template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := {
1387 discriminator := '0011'B,
1388 tiOrSkip := {
1389 transactionId := {
1390 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001391 tiFlag := c_TIF_ORIG,
Harald Welte4017d552018-01-26 21:40:05 +01001392 tIExtension := omit
1393 }
1394 },
1395 msgs := {
1396 cc := {
1397 connectAck := {
1398 messageType := '001111'B,
1399 nsd := '00'B
1400 }
1401 }
1402 }
1403}
1404
Daniel Willmann8b084372018-02-04 13:35:26 +01001405template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_START_DTMF(integer tid, charstring number) := {
1406 discriminator := '0011'B,
1407 tiOrSkip := {
1408 transactionId := {
1409 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001410 tiFlag := c_TIF_ORIG,
Daniel Willmann8b084372018-02-04 13:35:26 +01001411 tIExtension := omit
1412 }
1413 },
1414 msgs := {
1415 cc := {
1416 startDTMF := {
1417 messageType := '110101'B,
1418 nsd := '00'B,
1419 keypadFacility := {
1420 elementIdentifier := '2C'O,
1421 keypadInformation := int2bit(char2int(number), 7),
1422 spare_1 := '0'B
1423 }
1424 }
1425 }
1426 }
1427}
1428
Harald Welte2bb825f2018-01-22 11:31:18 +01001429template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := {
1430 discriminator := '0011'B,
1431 tiOrSkip := {
1432 transactionId := {
1433 tio := int2bit(tid, 3),
1434 tiFlag := ?,
1435 tIExtension := omit
1436 }
1437 },
1438 msgs := {
1439 cc := {
1440 disconnect_NW_MS := {
1441 messageType := '100101'B,
1442 nsd := '00'B,
1443 cause := ?,
1444 facility := *,
1445 progressIndicator := *,
1446 user_user := *,
1447 allowedActions := *
1448 }
1449 }
1450 }
1451}
1452
1453template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := {
1454 discriminator := '0011'B,
1455 tiOrSkip := {
1456 transactionId := {
1457 tio := int2bit(tid, 3),
1458 tiFlag := ?,
1459 tIExtension := omit
1460 }
1461 },
1462 msgs := {
1463 cc := {
1464 release_NW_MS := {
1465 messageType := '101101'B,
1466 nsd := '00'B,
1467 cause := ?,
1468 secondCause := *,
1469 facility := *,
1470 user_user := *
1471 }
1472 }
1473 }
1474}
Harald Welted748a052018-01-22 02:59:24 +01001475
Harald Welte33ec09b2018-02-10 15:34:46 +01001476template PDU_ML3_MS_NW ts_ML3_MO_CC_RELEASE(integer tid, BIT1 tid_remote, BIT7 cause) := {
1477 discriminator := '0011'B,
1478 tiOrSkip := {
1479 transactionId := {
1480 tio := int2bit(tid, 3),
1481 tiFlag := tid_remote,
1482 tIExtension := omit
1483 }
1484 },
1485 msgs := {
1486 cc := {
1487 release_MS_NW := {
1488 messageType := '101101'B,
1489 nsd := '00'B,
1490 cause := ts_ML3_Cause(cause),
1491 secondCause := omit,
1492 facility := omit,
1493 user_user := omit,
1494 ss_VersionIndicator := omit
1495 }
1496 }
1497 }
1498}
1499
1500
Neels Hofmeyr2ca1ab42019-03-08 03:45:43 +01001501template (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 +01001502 discriminator := '0011'B,
1503 tiOrSkip := {
1504 transactionId := {
1505 tio := int2bit(tid, 3),
Neels Hofmeyr2ca1ab42019-03-08 03:45:43 +01001506 tiFlag := tid_remote,
Harald Welteb71901a2018-01-26 19:16:05 +01001507 tIExtension := omit
1508 }
1509 },
1510 msgs := {
1511 cc := {
1512 releaseComplete_MS_NW := {
1513 messageType := '101010'B,
1514 nsd := '00'B,
1515 cause := omit,
1516 facility := omit,
1517 user_user := omit,
1518 ss_VersionIndicator := omit
1519 }
1520 }
1521 }
1522}
1523
Harald Welte33ec09b2018-02-10 15:34:46 +01001524template PDU_ML3_NW_MS tr_ML3_MT_CC_REL_COMPL(integer tid) := {
1525 discriminator := '0011'B,
1526 tiOrSkip := {
1527 transactionId := {
1528 tio := int2bit(tid, 3),
1529 tiFlag := ?,
1530 tIExtension := omit
1531 }
1532 },
1533 msgs := {
1534 cc := {
1535 releaseComplete_NW_MS := {
1536 messageType := '101010'B,
1537 nsd := '00'B,
1538 cause := *,
1539 facility := *,
1540 user_user := *
1541 }
1542 }
1543 }
1544}
1545
1546
Harald Welteb71901a2018-01-26 19:16:05 +01001547
Harald Welte77a8eba2018-01-22 21:22:32 +01001548template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := {
1549 discriminator := '0101'B,
1550 tiOrSkip := {
1551 skipIndicator := '0000'B
1552 },
1553 msgs := {
1554 mm := {
1555 authenticationRequest := {
1556 messageType := '010010'B,
1557 nsd := '00'B,
1558 cipheringKeySequenceNumber := ?,
1559 spare2_4 := ?,
1560 authenticationParRAND := rand,
1561 authenticationParAUTN := *
1562 }
1563 }
1564 }
1565}
1566
Harald Welte0cedf2c2018-10-28 23:28:35 +01001567template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ_3G(template OCT16 rand := ?, template OCT16 autn) := {
1568 discriminator := '0101'B,
1569 tiOrSkip := {
1570 skipIndicator := '0000'B
1571 },
1572 msgs := {
1573 mm := {
1574 authenticationRequest := {
1575 messageType := '010010'B,
1576 nsd := '00'B,
1577 cipheringKeySequenceNumber := ?,
1578 spare2_4 := ?,
1579 authenticationParRAND := rand,
1580 authenticationParAUTN := {
1581 elementIdentifier := '20'O,
1582 lengthIndicator := ?,
1583 autnValue := autn
1584 }
1585 }
1586 }
1587 }
1588}
1589
Harald Welte77a8eba2018-01-22 21:22:32 +01001590template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := {
1591 discriminator := '0101'B,
1592 tiOrSkip := {
1593 skipIndicator := '0000'B
1594 },
1595 msgs := {
1596 mm := {
1597 authenticationResponse := {
1598 messageType := '010100'B,
1599 nsd := '00'B,
1600 authenticationParSRES := sres,
1601 authenticationParSRESext := omit
1602 }
1603 }
1604 }
1605}
1606
1607template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := {
1608 discriminator := '0101'B,
1609 tiOrSkip := {
1610 skipIndicator := '0000'B
1611 },
1612 msgs := {
1613 mm := {
1614 authenticationResponse := {
1615 messageType := '010100'B,
1616 nsd := '00'B,
1617 authenticationParSRES := sres,
1618 authenticationParSRESext := {
1619 elementIdentifier := '21'O,
1620 lengthIndicator := 0, /* overwritten */
1621 valueField := res
1622 }
1623 }
1624 }
1625 }
1626}
Harald Weltecb6cc332018-01-21 13:59:08 +01001627
Harald Welte812f7a42018-01-27 00:49:18 +01001628template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid,
1629 template BearerCapability_TLV bcap := omit) := {
1630 discriminator := '0011'B,
1631 tiOrSkip := {
1632 transactionId := {
1633 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001634 tiFlag := c_TIF_REPL, /* response from destination */
Harald Welte812f7a42018-01-27 00:49:18 +01001635 tIExtension := omit
1636 }
1637 },
1638 msgs := {
1639 cc := {
1640 callConfirmed := {
1641 messageType := '001000'B,
1642 nsd := '00'B,
1643 repeatIndicator := omit,
1644 bearerCapability1 := bcap,
1645 bearerCapability2 := omit,
1646 cause := omit,
1647 cC_Capabilities := omit,
1648 streamIdentifier := omit,
1649 supportedCodecs := omit
1650 }
1651 }
1652 }
1653}
1654
1655
1656template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *,
1657 template hexstring calling := *,
1658 template BearerCapability_TLV bcap := *) := {
1659 discriminator := '0011'B,
1660 tiOrSkip := {
1661 transactionId := {
1662 tio := int2bit(tid, 3),
Harald Welte51affb62018-04-09 14:17:45 +02001663 tiFlag := c_TIF_ORIG, /* from originator */
Harald Welte812f7a42018-01-27 00:49:18 +01001664 tIExtension := omit
1665 }
1666 },
1667 msgs := {
1668 cc := {
1669 setup_NW_MS := {
1670 messageType := '000101'B,
1671 nsd := '00'B,
1672 bcRepeatIndicator := *,
1673 bearerCapability1 := bcap,
1674 bearerCapability2 := *,
1675 facility := *,
1676 progressIndicator := *,
1677 signal := *,
1678 callingPartyBCD_Number := tr_Calling(calling) ifpresent,
1679 callingPartySubAddress := *,
1680 calledPartyBCD_Number := tr_Called(called) ifpresent,
1681 calledPartySubAddress := *,
1682 redirectingPartyBCDNumber := *,
1683 redirectingPartySubaddress := *,
1684 llc_RepeatIndicator := *,
1685 lowLayerCompatibility1 := *,
1686 lowLayerCompatibility2 := *,
1687 hlc_RepeatIndicator := *,
1688 highLayerCompatibility1 := *,
1689 highLayerCompatibility2 := *,
1690 user_user := *,
1691 priority := *,
1692 alert := *,
1693 networkCCCapabilities := *,
1694 causeofNoCli := *,
1695 backupBearerCapacity := *
1696 }
1697 }
1698 }
1699}
1700
Harald Welte38575a72018-02-15 20:41:37 +01001701/***********************************************************************
Harald Welte53603962018-05-28 11:13:09 +02001702 * Supplementary Services
1703 ***********************************************************************/
1704
1705private template (value) Facility_TLV ts_FacTLV(OCTN facility) := {
1706 elementIdentifier := '1C'O,
1707 lengthIndicator := lengthof(facility),
1708 facilityInformation := facility
1709}
1710private template Facility_TLV tr_FacTLV(template OCTN facility) := {
1711 elementIdentifier := '1C'O,
1712 lengthIndicator := ?,
1713 facilityInformation := facility
1714}
1715
1716private template (value) Facility_LV ts_FacLV(OCTN facility) := {
1717 lengthIndicator := lengthof(facility),
1718 facilityInformation := facility
1719}
1720private template Facility_LV tr_FacLV(template OCTN facility) := {
1721 lengthIndicator := ?,
1722 facilityInformation := facility
1723}
1724
Vadim Yanitskiy03198132018-05-29 03:35:16 +07001725private function f_facility_or_omit(template (omit) OCTN facility)
1726return template (omit) Facility_TLV {
1727 if (istemplatekind(facility, "omit")) {
1728 return omit;
1729 } else {
1730 return ts_FacTLV(valueof(facility));
1731 }
1732}
1733private function f_facility_or_wc(template OCTN facility)
1734return template Facility_TLV {
1735 if (istemplatekind(facility, "*")) {
1736 return *;
1737 } else if (istemplatekind(facility, "?")) {
1738 return ?;
Vadim Yanitskiy52f8b6e2018-06-19 17:32:46 +07001739 } else if (istemplatekind(facility, "omit")) {
1740 return omit;
Vadim Yanitskiy03198132018-05-29 03:35:16 +07001741 } else {
1742 return tr_FacTLV(facility);
1743 }
1744}
1745
Harald Welte53603962018-05-28 11:13:09 +02001746template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_REGISTER(
1747 uint3_t tid, BIT1 ti_flag,
1748 OCTN facility,
1749 template (omit) SS_VersionIndicator ss_ver := omit
1750) := {
1751 discriminator := '1011'B,
1752 tiOrSkip := {
1753 transactionId := {
1754 tio := int2bit(tid, 3),
1755 tiFlag := ti_flag,
1756 tIExtension := omit
1757 }
1758 },
1759 msgs := {
1760 ss := {
1761 register := {
1762 messageType := '111011'B,
1763 nsd := '00'B,
1764 facility := ts_FacTLV(facility),
1765 ss_version := ss_ver
1766 }
1767 }
1768 }
1769}
1770template PDU_ML3_MS_NW tr_ML3_MO_SS_REGISTER(
1771 template uint3_t tid, template BIT1 ti_flag,
1772 template OCTN facility,
1773 template SS_VersionIndicator ss_ver := omit
1774) := {
1775 discriminator := '1011'B,
1776 tiOrSkip := {
1777 transactionId := {
1778 tio := f_tid_or_wc(tid),
1779 tiFlag := ti_flag,
1780 tIExtension := omit
1781 }
1782 },
1783 msgs := {
1784 ss := {
1785 register := {
1786 messageType := '111011'B,
1787 nsd := '00'B,
1788 facility := tr_FacTLV(facility),
1789 ss_version := ss_ver
1790 }
1791 }
1792 }
1793}
1794
1795template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_REGISTER(
1796 uint3_t tid, BIT1 ti_flag,
1797 OCTN facility
1798) := {
1799 discriminator := '1011'B,
1800 tiOrSkip := {
1801 transactionId := {
1802 tio := int2bit(tid, 3),
1803 tiFlag := ti_flag,
1804 tIExtension := omit
1805 }
1806 },
1807 msgs := {
1808 ss := {
1809 register := {
1810 messageType := '111011'B,
1811 nsd := '00'B,
1812 facility := ts_FacTLV(facility)
1813 }
1814 }
1815 }
1816}
1817template PDU_ML3_NW_MS tr_ML3_MT_SS_REGISTER(
1818 template uint3_t tid, template BIT1 ti_flag,
1819 template OCTN facility
1820) := {
1821 discriminator := '1011'B,
1822 tiOrSkip := {
1823 transactionId := {
1824 tio := f_tid_or_wc(tid),
1825 tiFlag := ti_flag,
1826 tIExtension := omit
1827 }
1828 },
1829 msgs := {
1830 ss := {
1831 register := {
1832 messageType := '111011'B,
1833 nsd := '00'B,
1834 facility := tr_FacTLV(facility)
1835 }
1836 }
1837 }
1838}
1839
1840template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_FACILITY(
1841 uint3_t tid, BIT1 ti_flag,
1842 OCTN facility
1843) := {
1844 discriminator := '1011'B,
1845 tiOrSkip := {
1846 transactionId := {
1847 tio := int2bit(tid, 3),
1848 tiFlag := ti_flag,
1849 tIExtension := omit
1850 }
1851 },
1852 msgs := {
1853 ss := {
1854 facility := {
1855 messageType := '111010'B,
1856 nsd := '00'B,
1857 facility := ts_FacLV(facility)
1858 }
1859 }
1860 }
1861}
1862template PDU_ML3_MS_NW tr_ML3_MO_SS_FACILITY(
1863 template uint3_t tid, template BIT1 ti_flag,
1864 template OCTN facility
1865) := {
1866 discriminator := '1011'B,
1867 tiOrSkip := {
1868 transactionId := {
1869 tio := f_tid_or_wc(tid),
1870 tiFlag := ti_flag,
1871 tIExtension := omit
1872 }
1873 },
1874 msgs := {
1875 ss := {
1876 facility := {
1877 messageType := '111010'B,
1878 nsd := '00'B,
1879 facility := tr_FacLV(facility)
1880 }
1881 }
1882 }
1883}
1884
1885template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_FACILITY(
1886 uint3_t tid, BIT1 ti_flag,
1887 OCTN facility
1888) := {
1889 discriminator := '1011'B,
1890 tiOrSkip := {
1891 transactionId := {
1892 tio := int2bit(tid, 3),
1893 tiFlag := ti_flag,
1894 tIExtension := omit
1895 }
1896 },
1897 msgs := {
1898 ss := {
1899 facility := {
1900 messageType := '111010'B,
1901 nsd := '00'B,
1902 facility := ts_FacLV(facility)
1903 }
1904 }
1905 }
1906}
1907template PDU_ML3_NW_MS tr_ML3_MT_SS_FACILITY(
1908 template uint3_t tid, template BIT1 ti_flag,
1909 template OCTN facility
1910) := {
1911 discriminator := '1011'B,
1912 tiOrSkip := {
1913 transactionId := {
1914 tio := f_tid_or_wc(tid),
1915 tiFlag := ti_flag,
1916 tIExtension := omit
1917 }
1918 },
1919 msgs := {
1920 ss := {
1921 facility := {
1922 messageType := '111010'B,
1923 nsd := '00'B,
1924 facility := tr_FacLV(facility)
1925 }
1926 }
1927 }
1928}
1929
Vadim Yanitskiy03198132018-05-29 03:35:16 +07001930template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_RELEASE_COMPLETE(
1931 uint3_t tid, BIT1 ti_flag,
1932 template (omit) ML3_Cause_TLV cause := omit,
1933 template (omit) OCTN facility := omit
1934) := {
1935 discriminator := '1011'B,
1936 tiOrSkip := {
1937 transactionId := {
1938 tio := int2bit(tid, 3),
1939 tiFlag := ti_flag,
1940 tIExtension := omit
1941 }
1942 },
1943 msgs := {
1944 ss := {
1945 releaseComplete_MS_NW := {
1946 messageType := '101010'B,
1947 nsd := '00'B,
1948 cause := cause,
1949 facility := f_facility_or_omit(facility)
1950 }
1951 }
1952 }
1953}
1954template PDU_ML3_MS_NW tr_ML3_MO_SS_RELEASE_COMPLETE(
1955 template uint3_t tid, template BIT1 ti_flag,
1956 template ML3_Cause_TLV cause := *,
1957 template OCTN facility := *
1958) := {
1959 discriminator := '1011'B,
1960 tiOrSkip := {
1961 transactionId := {
1962 tio := f_tid_or_wc(tid),
1963 tiFlag := ti_flag,
1964 tIExtension := omit
1965 }
1966 },
1967 msgs := {
1968 ss := {
1969 releaseComplete_MS_NW := {
1970 messageType := '101010'B,
1971 nsd := '00'B,
1972 cause := cause,
1973 facility := f_facility_or_wc(facility)
1974 }
1975 }
1976 }
1977}
1978
1979template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_RELEASE_COMPLETE(
1980 uint3_t tid, BIT1 ti_flag,
1981 template (omit) ML3_Cause_TLV cause := omit,
1982 template (omit) OCTN facility := omit
1983) := {
1984 discriminator := '1011'B,
1985 tiOrSkip := {
1986 transactionId := {
1987 tio := int2bit(tid, 3),
1988 tiFlag := ti_flag,
1989 tIExtension := omit
1990 }
1991 },
1992 msgs := {
1993 ss := {
1994 releaseComplete_NW_MS := {
1995 messageType := '101010'B,
1996 nsd := '00'B,
1997 cause := cause,
1998 facility := f_facility_or_omit(facility)
1999 }
2000 }
2001 }
2002}
2003template PDU_ML3_NW_MS tr_ML3_MT_SS_RELEASE_COMPLETE(
2004 template uint3_t tid, template BIT1 ti_flag,
2005 template ML3_Cause_TLV cause := *,
2006 template OCTN facility := *
2007) := {
2008 discriminator := '1011'B,
2009 tiOrSkip := {
2010 transactionId := {
2011 tio := f_tid_or_wc(tid),
2012 tiFlag := ti_flag,
2013 tIExtension := omit
2014 }
2015 },
2016 msgs := {
2017 ss := {
2018 releaseComplete_NW_MS := {
2019 messageType := '101010'B,
2020 nsd := '00'B,
2021 cause := cause,
2022 facility := f_facility_or_wc(facility)
2023 }
2024 }
2025 }
2026}
2027
Harald Welte53603962018-05-28 11:13:09 +02002028/***********************************************************************
Harald Welte38575a72018-02-15 20:41:37 +01002029 * GPRS Mobility Management
2030 ***********************************************************************/
2031
2032template (value) MSNetworkCapabilityV ts_GMM_MsNetCapV := {
2033 gea1bit := '1'B,
2034 smCapabilitiesviaDedicatedChannels := '1'B,
2035 smCapabilitiesviaGPRSChannels := '0'B,
2036 ucs2Support := '1'B,
2037 ssScreeningIndicator := '01'B,
2038 solSACapability := omit,
2039 revisionLevelIndicatior := omit,
2040 pFCFeatureMode := omit,
2041 extendedGEAbits := omit,
2042 lcsVAcapability := omit,
2043 pSInterRATHOtoUTRANIuModeCapability := omit,
2044 pSInterRATHOtoEUTRANS1ModeCapability := omit,
2045 eMMCombinedProceduresCapability := omit,
2046 iSRSupport := omit,
2047 sRVCCtoGERANUTRANCapability := omit,
2048 ePCCapability := omit,
2049 nFCapability := omit,
2050 gERANNertworkSharingCapability := omit,
2051 spare_octets := omit
2052};
2053
2054template (value) MSNetworkCapabilityLV ts_GMM_MsNetCapLV := {
2055 lengthIndicator := 0, /* overwritten */
2056 msNetworkCapabilityV := ts_GMM_MsNetCapV
2057};
2058
2059type enumerated GprsAttachType {
2060 GPRS_ATT_T_GPRS,
2061 GPRS_ATT_T_GPRS_IMSI_COMBINED
2062};
2063
2064function ts_GMM_AttachType(boolean combined := false, boolean follow_on_pending := false)
2065return AttachTypeV {
2066 var AttachTypeV att;
2067 if (combined) {
2068 att.attachType := '011'B;
2069 } else {
2070 att.attachType := '001'B;
2071 }
2072 att.for_l3 := bool2bit(combined);
2073 return att;
2074}
2075
2076type enumerated GprsUpdateType {
2077 GPRS_UPD_T_RA ('000'B),
2078 GPRS_UPD_T_RA_LA_COMBINED ('001'B),
2079 GPRS_UPD_T_RA_LA_COMBINED_IMSI_ATT ('010'B),
2080 GPRS_UPD_T_PERIODIC ('011'B)
2081};
2082
2083/* 10.5.5.18 Update Type */
2084template UpdateTypeV ts_GMM_UpdateType(GprsUpdateType upd_t, boolean combined := false,
2085 boolean follow_on_pending := false) := {
2086 valueField := int2bit(enum2int(upd_t), 3),
2087 for_l3 := bool2bit(combined)
2088}
2089
2090template (value) DRXParameterV ts_DrxParameterV := {
2091 splitPGCycleCode := '00'O, /* no DRX */
2092 nonDRXTimer := '000'B, /* no non-DRX mode */
2093 splitOnCCCH := '0'B, /* not supported */
2094 cnSpecificDRXCycleLength := '0000'B /* SI value used */
2095};
2096
Harald Welte38575a72018-02-15 20:41:37 +01002097template (value) MSRadioAccessCapabilityLV ts_MS_RaCapa := {
2098 lengthIndicator := 0, /* overwritten */
2099 msRadioAccessCapabilityV := {
2100 ts_RaCapRec('0001'B) /* E-GSM */
2101 }
2102}
2103
2104template (value) PDU_L3_MS_SGSN
2105 ts_GMM_ATTACH_REQ(MobileIdentityLV mi_lv, RoutingAreaIdentificationV old_ra,
2106 boolean combined := false, boolean follow_on_pending := false,
2107 template (omit) MobileStationClassmark2_TLV cm2_tlv,
2108 template (omit) MobileStationClassmark3_TLV cm3_tlv
2109 ) := {
2110 discriminator := '0000'B, /* overwritten */
2111 tiOrSkip := {
2112 skipIndicator := '0000'B
2113 },
2114 msgs := {
2115 gprs_mm := {
2116 attachRequest := {
2117 messageType := '00000000'B, /* overwritten */
2118 msNetworkCapability := ts_GMM_MsNetCapLV,
2119 attachType := valueof(ts_GMM_AttachType(combined, follow_on_pending)),
2120 gprsCKSN := { '111'B, '0'B },
2121 drxParam := ts_DrxParameterV,
2122 mobileIdentity := mi_lv,
2123 oldRoutingAreaID := old_ra,
2124 msRACap := ts_MS_RaCapa,
2125 ptmsiSignature := omit, /* TODO */
2126 reqGPRStimer := omit,
2127 tmsiStatus := omit,
2128 pC_LCSCapability := omit,
2129 mobileStationClassmark2 := cm2_tlv,
2130 mobileStationClassmark3 := cm3_tlv,
2131 supportedCodecs := omit,
2132 uENetworkCapability := omit,
2133 additionalMobileIdentity := omit,
2134 routingAreaIdentification2 := omit,
2135 voiceDomainandUEsUsageSetting := omit,
2136 deviceProperties := omit,
2137 p_TMSI_Type := omit,
2138 mS_NetworkFeatureSupport := omit,
2139 oldLocationAreaIdentification := omit,
2140 additionalUpdateType := omit,
2141 tMSIBasedNRIcontainer := omit,
2142 t3324 := omit,
2143 t3312_ExtendedValue := omit,
2144 extendedDRXParameters := omit
2145 }
2146 }
2147 }
2148}
2149
Harald Welteb0386df2018-02-16 18:14:28 +01002150private function tr_MI_TMSI_TLV(template OCT4 tmsi) return template MobileIdentityTLV {
2151 if (istemplatekind(tmsi, "*")) {
2152 return *;
2153 } else if (istemplatekind(tmsi, "?")) {
2154 return ?;
2155 } else {
2156 var template MobileIdentityTLV mi := {
2157 elementIdentifier := '0011000'B,
2158 spare1 := '0'B,
2159 mobileIdentityLV := {
2160 lengthIndicator := 4,
2161 mobileIdentityV := {
2162 typeOfIdentity := '100'B,
2163 oddEvenInd_identity := {
2164 tmsi_ptmsi := {
2165 oddevenIndicator := '1'B,
2166 fillerDigit := '1111'B,
2167 octets := tmsi
2168 }
2169 }
2170 }
2171 }
2172 };
2173 return mi;
2174 }
2175}
2176
2177template PDU_L3_SGSN_MS tr_GMM_ATTACH_ACCEPT(template BIT3 res := ?,
2178 template RoutingAreaIdentificationV ra := ?,
2179 template OCT4 ptmsi := *) := {
2180 discriminator := '1000'B,
2181 tiOrSkip := {
2182 skipIndicator := '0000'B
2183 },
2184 msgs := {
2185 gprs_mm := {
2186 attachAccept := {
2187 messageType := '00000010'B,
2188 attachResult := { res, ? },
2189 forceToStandby := ?,
2190 updateTimer := ?,
2191 radioPriority := ?,
2192 radioPriorityTOM8 := ?,
2193 routingAreaIdentification := ra,
2194 ptmsiSignature := *,
2195 readyTimer := *,
2196 allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi),
2197 msIdentity := *,
2198 gmmCause := *,
2199 t3302 := *,
2200 cellNotification := *,
2201 equivalentPLMNs := *,
2202 networkFeatureSupport := *,
2203 emergencyNumberList := *,
2204 requestedMSInformation := *,
2205 t3319 := *,
2206 t3323 := *,
2207 t3312_ExtendedValue := *,
2208 additionalNetworkFeatureSupport := *,
2209 t3324 := *,
2210 extendedDRXParameters := *
2211 }
2212 }
2213 }
2214}
Harald Welte38575a72018-02-15 20:41:37 +01002215
Harald Welte5b7c8122018-02-16 21:48:17 +01002216template PDU_L3_SGSN_MS tr_GMM_ATTACH_REJECT(template OCT1 cause) := {
2217 discriminator := '1000'B,
2218 tiOrSkip := {
2219 skipIndicator := '0000'B
2220 },
2221 msgs := {
2222 gprs_mm := {
2223 attachReject := {
2224 messageType := '00000100'B,
2225 gmmCause := {
2226 causeValue := cause
2227 },
2228 t3302 := *,
2229 t3346 := *
2230 }
2231 }
2232 }
2233}
2234
2235
Harald Welte38575a72018-02-15 20:41:37 +01002236template (value) PDU_L3_MS_SGSN ts_GMM_ATTACH_COMPL := {
2237 discriminator := '0000'B, /* overwritten */
2238 tiOrSkip := {
2239 skipIndicator := '0000'B
2240 },
2241 msgs := {
2242 gprs_mm := {
2243 attachComplete := {
2244 messageType := '00000000'B, /* overwritten */
2245 interRATHandoverInformation := omit,
2246 eUTRANinterRATHandoverInformation := omit
2247 }
2248 }
2249 }
2250}
2251
2252template (value) PDU_L3_MS_SGSN
2253 ts_GMM_RAU_REQ(MobileIdentityLV mi_lv, GprsUpdateType upd_type,
2254 RoutingAreaIdentificationV old_ra,
2255 boolean follow_on_pending := false,
2256 template (omit) MobileStationClassmark2_TLV cm2_tlv,
Alexander Couzensbfcb3202019-09-03 12:34:21 +02002257 template (omit) MobileStationClassmark3_TLV cm3_tlv,
2258 template (omit) OCT4 p_tmsi := omit
Harald Welte38575a72018-02-15 20:41:37 +01002259 ) := {
2260 discriminator := '0000'B, /* overwritten */
2261 tiOrSkip := {
2262 skipIndicator := '0000'B
2263 },
2264 msgs := {
2265 gprs_mm := {
2266 routingAreaUpdateRequest := {
2267 messageType := '00000000'B, /* overwritten */
2268 updateType := ts_GMM_UpdateType(upd_type, follow_on_pending),
2269 gprsCKSN := { '111'B, '0'B },
2270 oldRoutingAreaId := old_ra,
2271 msRACap := ts_MS_RaCapa,
2272 oldPTMSISignature := omit, /* TODO */
2273 readyTimerValue := omit,
2274 drxParameter := omit,
2275 tmsiStatus := omit,
Alexander Couzensbfcb3202019-09-03 12:34:21 +02002276 ptmsi := ts_MI_TMSI_TLV(p_tmsi),
Harald Welte38575a72018-02-15 20:41:37 +01002277 mSNetworkCapability := omit,
2278 pdpContextStatus := omit, /* TODO */
2279 pC_LCSCapability := omit,
Harald Welte04683d02018-02-16 22:43:45 +01002280 mBMS_ContextStatus := omit,
Harald Welte38575a72018-02-15 20:41:37 +01002281 uENetworkCapability := omit,
2282 additionalMobileIdentity := omit,
2283 oldRoutingAreaIdentification2 := omit,
2284 mobileStationClassmark2 := cm2_tlv,
2285 mobileStationClassmark3 := cm3_tlv,
2286 supportedCodecs := omit,
2287 voiceDomainUEUsageSetting := omit,
2288 p_TMSI_Type := omit,
2289 deviceProperties := omit,
2290 mS_NetworkFeatureSupport := omit,
2291 oldLocationAreaIdentification := omit,
2292 additionalUpdateType := omit,
2293 tMSIBasedNRIcontainer := omit,
2294 t3324 := omit,
2295 t3312_ExtendedValue := omit,
2296 extendedDRXParameters := omit
2297 }
2298 }
2299 }
2300}
2301
Harald Welte04683d02018-02-16 22:43:45 +01002302template PDU_L3_SGSN_MS tr_GMM_RAU_REJECT(template OCT1 cause := ?) := {
2303 discriminator := '1000'B,
2304 tiOrSkip := {
2305 skipIndicator := '0000'B
2306 },
2307 msgs := {
2308 gprs_mm := {
2309 routingAreaUpdateReject := {
2310 messageType := '00001011'B,
2311 gmmCause := {
2312 causeValue := cause
2313 },
2314 forceToStandby := ?,
2315 spare := '0000'B,
2316 t3302 := *,
2317 t3346 := *
2318 }
2319 }
2320 }
2321}
2322
Harald Welte91636de2018-02-17 10:16:14 +01002323template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?,
2324 template RoutingAreaIdentificationV ra := ?,
2325 template OCT4 ptmsi := *) := {
2326 discriminator := '1000'B,
2327 tiOrSkip := {
2328 skipIndicator := '0000'B
2329 },
2330 msgs := {
2331 gprs_mm := {
2332 routingAreaUpdateAccept := {
2333 messageType := '00001001'B,
2334 forceToStandby := ?,
2335 updateResult := { res, ? },
2336 raUpdateTimer := ?,
2337 routingAreaId := ra,
2338 ptmsiSignature := *,
2339 allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi),
2340 msIdentity := *,
2341 receiveNPDUNumbers := *,
2342 readyTimer := *,
2343 gmmCause := *,
2344 t3302 := *,
2345 cellNotification := *,
2346 equivalentPLMNs := *,
2347 pdpContextStatus := *,
2348 networkFeatureSupport := *,
2349 emergencyNumberList := *,
2350 mBMS_ContextStatus := *,
2351 requestedMSInformation := *,
2352 t3319 := *,
2353 t3323 := *,
2354 t3312_ExtendedValue := *,
2355 additionalNetworkFeatureSupport := *,
2356 t3324 := *,
2357 extendedDRXParameters := *
2358 }
2359 }
2360 }
2361}
Harald Welte04683d02018-02-16 22:43:45 +01002362
Harald Welte38575a72018-02-15 20:41:37 +01002363template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := {
2364 discriminator := '0000'B, /* overwritten */
2365 tiOrSkip := {
2366 skipIndicator := '0000'B
2367 },
2368 msgs := {
2369 gprs_mm := {
2370 routingAreaUpdateComplete := {
2371 messageType := '00000000'B, /* overwritten */
2372 receiveNPDUNumbers := omit,
2373 interRATHandoverInformation := omit,
2374 eUTRANinterRATHandoverInformation := omit
2375 }
2376 }
2377 }
2378}
2379
2380template (value) PDU_L3_MS_SGSN ts_GMM_PTMSI_REALL_COMPL := {
2381 discriminator := '0000'B, /* overwritten */
2382 tiOrSkip := {
2383 skipIndicator := '0000'B
2384 },
2385 msgs := {
2386 gprs_mm := {
2387 p_TMSIReallocationComplete := {
2388 messageType := '00000000'B /* overwritten */
2389 }
2390 }
2391 }
2392}
2393
2394template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_CIPH_COMPL(ACReferenceNumberV ref, OCT4 res) := {
2395 discriminator := '0000'B, /* overwritten */
2396 tiOrSkip := {
2397 skipIndicator := '0000'B
2398 },
2399 msgs := {
2400 gprs_mm := {
2401 authenticationAndCipheringResponse := {
2402 messageType := '00000000'B, /* overwritten */
2403 acReferenceNumber := ref,
2404 spare := '0000'B,
2405 authenticationParResp := {
2406 elementIdentifier := '22'O,
2407 valueField := res
2408 },
2409 imeisv := omit,
2410 authenticationRespParExt := omit
2411 }
2412 }
2413 }
2414}
2415
Harald Welteb0386df2018-02-16 18:14:28 +01002416template PDU_L3_SGSN_MS tr_GMM_ID_REQ(template BIT3 id_type := ?) := {
2417 discriminator := '1000'B,
2418 tiOrSkip := {
2419 skipIndicator := '0000'B
2420 },
2421 msgs := {
2422 gprs_mm := {
2423 identityRequest := {
2424 messageType := '00010101'B,
2425 identityType := { id_type, '0'B },
2426 forceToStandby := ?
2427 }
2428 }
2429 }
2430}
2431
Harald Welte38575a72018-02-15 20:41:37 +01002432template (value) PDU_L3_MS_SGSN ts_GMM_ID_RESP(MobileIdentityLV mi_lv) := {
2433 discriminator := '0000'B, /* overwritten */
2434 tiOrSkip := {
2435 skipIndicator := '0000'B
2436 },
2437 msgs := {
2438 gprs_mm := {
2439 identityResponse := {
2440 messageType := '00000000'B, /* overwritten */
2441 mobileIdentity := mi_lv
2442 }
2443 }
2444 }
2445}
2446
Harald Welteb0386df2018-02-16 18:14:28 +01002447template PDU_L3_SGSN_MS tr_GMM_AUTH_REQ(template OCT16 rand := ?, template BIT3 ciph_alg := ?) := {
2448 discriminator := '1000'B,
2449 tiOrSkip := {
2450 skipIndicator := '0000'B
2451 },
2452 msgs := {
2453 gprs_mm := {
2454 authenticationAndCipheringRequest := {
2455 messageType := '00010010'B,
2456 cipheringAlgorithm := { ciph_alg, '0'B },
2457 imeisvRequest := ?,
2458 forceToStandby := ?,
2459 acReferenceNumber := ?,
2460 authenticationParameterRAND := {
2461 elementIdentifier := '21'O,
2462 randValue := rand
2463 },
2464 cipheringKeySequenceNumber := *,
2465 authenticationParameterAUTN := *
2466 }
2467 }
2468 }
2469}
2470
2471template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_RESP_2G(BIT4 ac_ref, OCT4 sres) := {
2472 discriminator := '1000'B,
2473 tiOrSkip := {
2474 skipIndicator := '0000'B
2475 },
2476 msgs := {
2477 gprs_mm := {
2478 authenticationAndCipheringResponse := {
2479 messageType := '00010011'B,
2480 acReferenceNumber := { valueField := ac_ref },
2481 spare := '0000'B,
2482 authenticationParResp := {
2483 elementIdentifier := '22'O,
2484 valueField := sres
2485 },
2486 imeisv := omit,
2487 authenticationRespParExt := omit
2488 }
2489 }
2490 }
2491}
2492
Alexander Couzens15faf922018-09-04 15:16:26 +02002493template PDU_L3_MS_SGSN ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC(octetstring auts) := {
2494 discriminator := '1000'B,
2495 tiOrSkip := {
2496 skipIndicator := '0000'B
2497 },
2498 msgs := {
2499 gprs_mm := {
2500 authenticationAndCipheringFailure := {
2501 messageType := '00011100'B,
2502 gmmCause := {
2503 causeValue := '15'O /* GMM_CAUSE_SYNC_FAIL 10.5.3.2.2 */
2504 },
2505 authenticationFailureParam := {
2506 elementIdentifier := '30'O,
2507 lengthIndicator := 14,
2508 valueField := auts
2509 }
2510 }
2511 }
2512 }
2513}
2514
Harald Welteb0386df2018-02-16 18:14:28 +01002515
Harald Welte38575a72018-02-15 20:41:37 +01002516const BIT3 c_GMM_DTT_MO_GPRS := '001'B;
2517const BIT3 c_GMM_DTT_MO_IMSI := '010'B;
2518const BIT3 c_GMM_DTT_MO_GPRS_IMSI_COMBINED := '011'B;
2519
Alexander Couzensb6ab4562018-05-17 02:59:22 +02002520const BIT3 c_GMM_DTT_MT_REATTACH_REQUIRED := '001'B;
2521const BIT3 c_GMM_DTT_MT_REATTACH_NOT_REQUIRED := '010'B;
2522const BIT3 c_GMM_DTT_MT_IMSI_DETACH := '011'B;
2523
Harald Welte6abb9fe2018-02-17 15:24:48 +01002524template (value) DetachTypeV ts_GMM_DetType(BIT3 dtt, boolean power_off := false) := {
Harald Welte38575a72018-02-15 20:41:37 +01002525 detachType := dtt,
Harald Welte6abb9fe2018-02-17 15:24:48 +01002526 powerOffFlag := bool2bit(power_off)
Harald Welte38575a72018-02-15 20:41:37 +01002527}
2528
Harald Welte6abb9fe2018-02-17 15:24:48 +01002529function ts_PtmsiSigTV(template (omit) OCT3 val) return template (omit) P_TMSISignatureTV {
2530 var template (omit) P_TMSISignatureTV ret;
2531 if (istemplatekind(val, "omit")) {
2532 return omit;
2533 } else {
2534 ret := {
2535 elementIdentifier := '19'O,
2536 valueField := valueof(val)
2537 }
2538 return ret;
2539 }
2540}
2541
2542function ts_PtmsiSigTLV(template (omit) OCT3 val) return template (omit) P_TMSISignature2TLV {
2543 var template (omit) P_TMSISignature2TLV ret;
2544 if (istemplatekind(val, "omit")) {
2545 return omit;
2546 } else {
2547 ret := {
2548 elementIdentifier := '19'O,
2549 lengthIndicator := 3,
2550 valueField := valueof(val)
2551 }
2552 return ret;
2553 }
2554}
2555
2556template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS,
2557 boolean power_off := false,
2558 template (omit) OCT4 p_tmsi := omit,
2559 template (omit) OCT3 p_tmsi_sig := omit) := {
Harald Welte38575a72018-02-15 20:41:37 +01002560 discriminator := '0000'B, /* overwritten */
2561 tiOrSkip := {
2562 skipIndicator := '0000'B
2563 },
2564 msgs := {
2565 gprs_mm := {
2566 detachRequest_MS_SGSN := {
2567 messageType := '00000000'B, /* overwritten */
Harald Welte6abb9fe2018-02-17 15:24:48 +01002568 detachType := valueof(ts_GMM_DetType(dtt, power_off)),
Harald Welte38575a72018-02-15 20:41:37 +01002569 spare := '0000'B,
Harald Welte6abb9fe2018-02-17 15:24:48 +01002570 ptmsi := ts_MI_TMSI_TLV(p_tmsi),
2571 ptmsiSignature := ts_PtmsiSigTLV(p_tmsi_sig)
2572 }
2573 }
2574 }
2575}
2576
2577template PDU_L3_SGSN_MS tr_GMM_DET_ACCEPT_MT := {
2578 discriminator := '1000'B,
2579 tiOrSkip := {
2580 skipIndicator := '0000'B
2581 },
2582 msgs := {
2583 gprs_mm := {
2584 detachAccept_SGSN_MS := {
2585 messageType := '00000110'B,
2586 forceToStandby := ?,
2587 spare := '0000'B
Harald Welte38575a72018-02-15 20:41:37 +01002588 }
2589 }
2590 }
2591}
Harald Welte812f7a42018-01-27 00:49:18 +01002592
Alexander Couzensd62fba52018-05-22 16:08:39 +02002593template PDU_L3_SGSN_MS tr_GMM_DET_REQ_MT(
2594 template BIT3 dtt := *,
2595 template BIT3 forceToStandby := ?,
Alexander Couzensd8604ab2018-05-29 15:46:06 +02002596 template OCT1 cause := *) := {
Harald Welte835b15f2018-02-18 14:39:11 +01002597 discriminator := '1000'B,
2598 tiOrSkip := {
2599 skipIndicator := '0000'B
2600 },
2601 msgs := {
2602 gprs_mm := {
2603 detachRequest_SGSN_MS := {
2604 messageType := '00000101'B,
Alexander Couzensd62fba52018-05-22 16:08:39 +02002605 detachType := { dtt, ? },
2606 forceToStandby := { forceToStandby, '0'B },
2607 gmmCause := {
2608 elementIdentifier := '25'O,
2609 causeValue := { cause }
2610 }
2611 }
2612 }
2613 }
2614}
2615
2616template PDU_L3_MS_SGSN ts_GMM_DET_ACCEPT_MO := {
2617 discriminator := '0000'B, /* overwritten */
2618 tiOrSkip := {
2619 skipIndicator := '0000'B
2620 },
2621 msgs := {
2622 gprs_mm := {
2623 detachAccept_MS_SGSN := {
2624 messageType := '00000000'B
Harald Welte835b15f2018-02-18 14:39:11 +01002625 }
2626 }
2627 }
2628}
Harald Welteeded9ad2018-02-17 20:57:34 +01002629
2630function ts_ApnTLV(template (omit) octetstring apn) return template (omit) AccessPointNameTLV {
2631 if (istemplatekind(apn, "omit")) {
2632 return omit;
2633 } else {
2634 var template (omit) AccessPointNameTLV ret := {
2635 elementIdentifier := '28'O,
2636 lengthIndicator := 0, /* overwritten */
2637 accessPointNameValue := apn
2638 }
2639 return ret;
2640 }
2641}
2642
2643function ts_PcoTLV(template (omit) ProtocolConfigOptionsV pco)
2644 return template (omit) ProtocolConfigOptionsTLV {
2645 if (istemplatekind(pco, "omit")) {
2646 return omit;
2647 } else {
2648 var template (omit) ProtocolConfigOptionsTLV ret := {
2649 elementIdentifier := '27'O,
2650 lengthIndicator := 0, /* overwritten */
2651 protocolConfigOptionsV := pco
2652 }
2653 return ret;
2654 }
2655}
2656
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002657function ts_TearDownIndicatorTV(in template (omit) boolean ind)
2658 return template (omit) TearDownIndicatorTV {
2659 if (istemplatekind(ind, "omit")) {
2660 return omit;
2661 } else {
2662 var template (omit) TearDownIndicatorTV ret := {
2663 tearDownIndicatorV := {
2664 tdi_flag := bool2bit(valueof(ind)),
2665 spare := '000'B
2666 },
2667 elementIdentifier := '1001'B
2668 }
2669 return ret;
2670 }
2671}
2672
Harald Welteeded9ad2018-02-17 20:57:34 +01002673template (value) PDU_L3_MS_SGSN ts_SM_ACT_PDP_REQ(BIT3 tid, BIT4 nsapi, BIT4 sapi, QoSV qos,
2674 PDPAddressV addr,
2675 template (omit) octetstring apn := omit,
2676 template (omit) ProtocolConfigOptionsV pco := omit
2677 ) := {
2678 discriminator := '0000'B, /* overwritten */
2679 tiOrSkip := {
2680 transactionId := {
2681 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002682 tiFlag := c_TIF_ORIG,
Harald Welteeded9ad2018-02-17 20:57:34 +01002683 tIExtension := omit
2684 }
2685 },
2686 msgs := {
2687 gprs_sm := {
2688 activatePDPContextRequest := {
2689 messageType := '00000000'B, /* overwritten */
2690 requestedNSAPI := { nsapi, '0000'B },
2691 requestedLLCSAPI := { sapi, '0000'B },
2692 requestedQoS := {
2693 lengthIndicator := 0, /* overwritten */
2694 qoSV := qos
2695 },
2696 requestedPDPaddress := {
2697 lengthIndicator := 0, /* overwritten */
2698 pdpAddressV := addr
2699 },
2700 accessPointName := ts_ApnTLV(apn),
2701 protocolConfigOpts := ts_PcoTLV(pco),
2702 requestType := omit,
2703 deviceProperties := omit,
2704 nBIFOM_Container := omit
2705 }
2706 }
2707 }
2708}
2709
2710template PDU_L3_SGSN_MS tr_SM_ACT_PDP_REJ(template BIT3 tid := ?, template OCT1 cause := ?) := {
2711 discriminator := '1010'B,
2712 tiOrSkip := {
2713 transactionId := {
2714 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002715 tiFlag := c_TIF_REPL,
Harald Welteeded9ad2018-02-17 20:57:34 +01002716 tIExtension := omit
2717 }
2718 },
2719 msgs := {
2720 gprs_sm := {
2721 activatePDPContextReject := {
Harald Welte4aacdd82018-02-18 21:24:05 +01002722 messageType := '01000011'B,
Harald Welteeded9ad2018-02-17 20:57:34 +01002723 smCause := cause,
2724 protocolConfigOpts := *,
2725 backOffTimer := *,
2726 reAttemptIndicator := *,
2727 nBIFOM_Container := *
2728 }
2729 }
2730 }
2731}
2732
2733template PDU_L3_SGSN_MS tr_SM_ACT_PDP_ACCEPT(template BIT3 tid := ?, template BIT4 sapi := ?,
2734 template QoSV qos := ?)
2735:= {
2736 discriminator := '1010'B,
2737 tiOrSkip := {
2738 transactionId := {
2739 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002740 tiFlag := c_TIF_REPL,
Harald Welteeded9ad2018-02-17 20:57:34 +01002741 tIExtension := omit
2742 }
2743 },
2744 msgs := {
2745 gprs_sm := {
2746 activatePDPContextAccept := {
2747 messageType := '01000010'B,
2748 negotiatedLLCSAPI := { sapi, '0000'B },
2749 negotiatedQoS := {
2750 lengthIndicator := ?,
2751 qoSV := qos
2752 },
2753 radioPriority := ?,
2754 spare := '0000'B,
2755 pdpAddress := *,
2756 protocolConfigOpts := *,
2757 packetFlowID := *,
2758 sMCause2 := *,
2759 connectivityType := *,
2760 wLANOffloadIndication := *,
2761 nBIFOM_Container := *
2762 }
2763 }
2764 }
2765}
2766
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002767template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause,
2768 template (omit) boolean tdown := omit,
Harald Welte6f203162018-02-18 22:04:55 +01002769 template (omit) ProtocolConfigOptionsV pco := omit
2770 ) := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002771 discriminator := '1010'B,
Harald Welte6f203162018-02-18 22:04:55 +01002772 tiOrSkip := {
2773 transactionId := {
2774 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002775 tiFlag := c_TIF_ORIG,
Harald Welte6f203162018-02-18 22:04:55 +01002776 tIExtension := omit
2777 }
2778 },
2779 msgs := {
2780 gprs_sm := {
2781 deactivatePDPContextRequest := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002782 messageType := '01000110'B,
Harald Welte6f203162018-02-18 22:04:55 +01002783 smCause := cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002784 tearDownIndicator := ts_TearDownIndicatorTV(tdown),
Harald Welte6f203162018-02-18 22:04:55 +01002785 protocolConfigOpts := ts_PcoTLV(pco),
2786 mBMSprotocolConfigOptions := omit,
2787 t3396 := omit,
2788 wLANOffloadIndication := omit,
2789 nBIFOM_Container := omit
2790 }
2791 }
2792 }
2793}
2794
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002795template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause,
2796 template (omit) boolean tdown := omit,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002797 template (omit) ProtocolConfigOptionsV pco := omit
2798 ) := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002799 discriminator := '1010'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002800 tiOrSkip := {
2801 transactionId := {
2802 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002803 tiFlag := c_TIF_REPL,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002804 tIExtension := omit
2805 }
2806 },
2807 msgs := {
2808 gprs_sm := {
2809 deactivatePDPContextRequest := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002810 messageType := '01000110'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002811 smCause := cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002812 tearDownIndicator := ts_TearDownIndicatorTV(tdown),
Harald Welte57b9b7f2018-02-18 22:28:13 +01002813 protocolConfigOpts := ts_PcoTLV(pco),
2814 mBMSprotocolConfigOptions := omit,
2815 t3396 := omit,
2816 wLANOffloadIndication := omit,
2817 nBIFOM_Container := omit
2818 }
2819 }
2820 }
2821}
2822
2823template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002824 template (omit) boolean tdown := omit,
2825 template (omit) ProtocolConfigOptionsV pco := omit
2826 ) := {
2827 discriminator := '1010'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002828 tiOrSkip := {
2829 transactionId := {
2830 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002831 tiFlag := c_TIF_REPL,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002832 tIExtension := omit
2833 }
2834 },
2835 msgs := {
2836 gprs_sm := {
2837 deactivatePDPContextRequest := {
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002838 messageType := '01000110'B,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002839 smCause := cause,
Pau Espin Pedrol67e47dd2018-07-13 15:07:43 +02002840 tearDownIndicator := ts_TearDownIndicatorTV(tdown),
2841 protocolConfigOpts := ts_PcoTLV(pco),
Harald Welte57b9b7f2018-02-18 22:28:13 +01002842 mBMSprotocolConfigOptions := *,
2843 t3396 := *,
2844 wLANOffloadIndication := *,
2845 nBIFOM_Container := *
2846 }
2847 }
2848 }
2849}
2850
Harald Welte6f203162018-02-18 22:04:55 +01002851template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?)
2852:= {
2853 discriminator := '1010'B,
2854 tiOrSkip := {
2855 transactionId := {
2856 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002857 tiFlag := c_TIF_REPL,
Harald Welte6f203162018-02-18 22:04:55 +01002858 tIExtension := omit
2859 }
2860 },
2861 msgs := {
2862 gprs_sm := {
2863 deactivatePDPContextAccept := {
2864 messageType := '01000111'B,
2865 protocolConfigOpts := *,
2866 mBMSprotocolConfigOptions := *,
2867 nBIFOM_Container := *
2868 }
2869 }
2870 }
2871}
2872
Harald Welte57b9b7f2018-02-18 22:28:13 +01002873template PDU_L3_MS_SGSN tr_SM_DEACT_PDP_ACCEPT_MO(template BIT3 tid := ?)
2874:= {
2875 discriminator := '1010'B,
2876 tiOrSkip := {
2877 transactionId := {
2878 tio := tid,
Pau Espin Pedrol55cb2ce2020-04-22 17:08:09 +02002879 tiFlag := c_TIF_ORIG,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002880 tIExtension := omit
2881 }
2882 },
2883 msgs := {
2884 gprs_sm := {
2885 deactivatePDPContextAccept := {
2886 messageType := '01000111'B,
2887 protocolConfigOpts := *,
2888 mBMSprotocolConfigOptions := *,
2889 nBIFOM_Container := *
2890 }
2891 }
2892 }
2893}
2894
2895template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_ACCEPT_MO(BIT3 tid)
2896:= {
2897 discriminator := '1010'B,
2898 tiOrSkip := {
2899 transactionId := {
2900 tio := tid,
Harald Welte51affb62018-04-09 14:17:45 +02002901 tiFlag := c_TIF_ORIG,
Harald Welte57b9b7f2018-02-18 22:28:13 +01002902 tIExtension := omit
2903 }
2904 },
2905 msgs := {
2906 gprs_sm := {
2907 deactivatePDPContextAccept := {
2908 messageType := '01000111'B,
2909 protocolConfigOpts := omit,
2910 mBMSprotocolConfigOptions := omit,
2911 nBIFOM_Container := omit
2912 }
2913 }
2914 }
2915}
2916
Harald Welteeded9ad2018-02-17 20:57:34 +01002917
2918
Harald Weltee5695f52018-02-16 14:46:15 +01002919private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring {
2920 var integer suffix_len := tot_len - lengthof(prefix);
2921 var charstring suffix_ch := int2str(suffix);
2922 var integer pad_len := suffix_len - lengthof(suffix_ch);
2923
2924 return prefix & int2hex(0, pad_len) & str2hex(suffix_ch);
2925}
2926
2927function f_gen_imei(integer suffix) return hexstring {
Oliver Smith745ed952019-07-05 14:08:17 +02002928 return f_concat_pad(14, '49999'H, suffix);
Harald Weltee5695f52018-02-16 14:46:15 +01002929}
2930
2931function f_gen_imsi(integer suffix) return hexstring {
2932 return f_concat_pad(15, '26242'H, suffix);
2933}
2934
2935function f_gen_msisdn(integer suffix) return hexstring {
2936 return f_concat_pad(12, '49123'H, suffix);
2937}
2938
Harald Welte7484fc42018-02-24 14:09:45 +01002939external function enc_MobileIdentityLV(in MobileIdentityLV si) return octetstring
2940 with { extension "prototype(convert) encode(RAW)" };
Harald Weltee5695f52018-02-16 14:46:15 +01002941
Vadim Yanitskiy322c7932020-01-01 23:03:47 +01002942external function dec_MobileIdentityV(in octetstring mi) return MobileIdentityV
2943 with { extension "prototype(convert) decode(RAW)" };
2944
Harald Weltecb6cc332018-01-21 13:59:08 +01002945
Harald Weltef45efeb2018-04-09 18:19:24 +02002946
2947/* SMS TPDU Layer */
2948
2949template (value) TPDU_RP_DATA_MS_SGSN ts_SMS_SUBMIT(OCT1 msg_ref, template (value) TP_DA dst_addr,
2950 template (value) OCT1 pid, template (value) OCT1 dcs,
2951 integer length_ind, octetstring user_data) := {
2952 sMS_SUBMIT := {
2953 tP_MTI := '01'B, /* SUBMIT */
2954 tP_RD := '1'B, /* reject duplicates */
2955 tP_VPF := '00'B, /* not present */
2956 tP_SRR := '0'B, /* no status report requested */
2957 tP_UDHI := '0'B, /* no user data header in UD */
2958 tP_RP := '0'B, /* no reply path */
2959 tP_MR := msg_ref,
2960 tP_DA := dst_addr,
2961 tP_PID := pid,
2962 tP_DCS := dcs,
2963 tP_VP := omit,
2964 tP_UDL_UD := {
2965 tP_LengthIndicator := length_ind,
2966 tP_UD := user_data
2967 }
2968 }
2969}
2970
2971template TPDU_RP_DATA_SGSN_MS tr_SMS_DELIVER(template TP_OA src_addr := ?,
2972 template octetstring user_data := ?,
2973 template OCT1 pid := ?, template OCT1 dcs := ?,
2974 template BIT1 mms := ?
2975 ) := {
2976 sMS_DELIVER := {
2977 tP_MTI := '00'B, /* DELIVER */
2978 tP_MMS := mms, /* more messages to send */
2979 tP_LP := ?, /* ?!? */
2980 tP_Spare := '0'B,
2981 tP_SRI := '0'B, /* status report indication */
2982 tP_UDHI := '0'B, /* no user data header in UD */
2983 tP_RP := '0'B, /* no reply path */
2984 tP_OA := src_addr,
2985 tP_PID := pid,
2986 tP_DCS := dcs,
2987 tP_SCTS := ?,
2988 tP_UDL_UD := {
2989 tP_LengthIndicator := ?,
2990 tP_UD := user_data
2991 }
2992 }
2993}
2994
2995/* RP Layer */
2996
2997private function ts_RpOrig(template (omit) RP_NumberingPlan_and_NumberDigits rp_orig)
2998return RP_OriginatorAddressLV {
2999 var RP_OriginatorAddressLV ret;
3000 if (istemplatekind(rp_orig, "omit")) {
3001 ret := { 0, omit };
3002 } else {
3003 ret := { 0, valueof(rp_orig) };
3004 }
3005 return ret;
3006}
3007
3008private function ts_RpDst(template (omit) RP_NumberingPlan_and_NumberDigits rp_dst)
3009return RP_DestinationAddressLV {
3010 var RP_DestinationAddressLV ret;
3011 if (istemplatekind(rp_dst, "omit")) {
3012 ret := { 0, omit };
3013 } else {
3014 ret := { 0, valueof(rp_dst) };
3015 }
3016 return ret;
3017}
3018
3019template (value) RPDU_MS_SGSN ts_RP_DATA_MO(OCT1 msg_ref,
3020 template (omit) RP_NumberingPlan_and_NumberDigits rp_orig,
3021 template (omit) RP_NumberingPlan_and_NumberDigits rp_dst,
3022 template (value) TPDU_RP_DATA_MS_SGSN tpdu) := {
3023 rP_DATA_MS_SGSN := {
3024 rP_MTI := '000'B,
3025 rP_Spare := '00000'B,
3026 rP_MessageReference := msg_ref,
3027 rP_OriginatorAddress := ts_RpOrig(rp_orig),
3028 rP_DestinationAddress := ts_RpDst(rp_dst),
3029 rP_User_Data := {
3030 rP_LengthIndicator := 0, /* overwritten */
3031 rP_TPDU := tpdu
3032 }
3033 }
3034}
3035
3036template RPDU_SGSN_MS tr_RP_DATA_MT(template OCT1 msg_ref,
3037 template RP_NumberingPlan_and_NumberDigits rp_orig,
3038 template RP_NumberingPlan_and_NumberDigits rp_dst,
3039 template TPDU_RP_DATA_SGSN_MS tpdu) := {
3040 rP_DATA_SGSN_MS := {
3041 rP_MTI := '001'B,
3042 rP_Spare := '00000'B,
3043 rP_MessageReference := msg_ref,
3044 rP_OriginatorAddress := { ?, rp_orig },
3045 rP_DestinationAddress := { ?, rp_dst },
3046 rP_User_Data := {
3047 rP_LengthIndicator := ?,
3048 rP_TPDU := tpdu
3049 }
3050
3051 }
3052}
3053
3054template (value) RPDU_MS_SGSN ts_RP_ACK_MO(OCT1 msg_ref) := {
3055 rP_ACK_MS_SGSN := {
3056 rP_MTI := '010'B,
3057 rP_Spare := '00000'B,
3058 rP_MessageReference := msg_ref,
3059 rP_User_Data := omit /* FIXME: report */
3060 }
3061}
3062
3063template RPDU_SGSN_MS tr_RP_ACK_MT(template OCT1 msg_ref) := {
3064 rP_ACK_SGSN_MS := {
3065 rP_MTI := '011'B,
3066 rP_Spare := '00000'B,
3067 rP_MessageReference := msg_ref,
3068 rP_User_Data := omit /* FIXME: report */
3069 }
3070}
3071
3072template (value) RPDU_MS_SGSN ts_RP_ERROR_MO(OCT1 msg_ref, uint7_t cause) := {
3073 rP_ERROR_MS_SGSN := {
3074 rP_MTI := '100'B,
3075 rP_Spare := '00000'B,
3076 rP_Message_Reference := msg_ref,
3077 rP_CauseLV := {
3078 rP_LengthIndicator := 0, /* overwritten */
3079 rP_CauseV := {
3080 causeValue := int2bit(cause, 7),
3081 ext := '0'B
3082 },
3083 rP_diagnisticField := omit
3084 },
3085 rP_User_Data := omit /* FIXME: report */
3086 }
3087}
3088
3089private function f_cause_or_wc(template uint7_t cause) return template BIT7 {
3090 if (istemplatekind(cause, "?")) {
3091 return ?;
3092 } else if (istemplatekind(cause, "*")) {
3093 return *;
3094 } else {
3095 return int2bit(valueof(cause), 7);
3096 }
3097}
3098
3099template RPDU_SGSN_MS tr_RP_ERROR_MT(template OCT1 msg_ref, template uint7_t cause) := {
3100 rP_ERROR_SGSN_MS := {
3101 rP_MTI := '101'B,
3102 rP_Spare := '00000'B,
3103 rP_Message_Reference := msg_ref,
3104 rP_CauseLV := {
Vadim Yanitskiye9e93012020-01-15 12:35:17 +07003105 rP_LengthIndicator := ?,
Harald Weltef45efeb2018-04-09 18:19:24 +02003106 rP_CauseV := {
3107 causeValue := f_cause_or_wc(cause),
3108 ext := '0'B
3109 },
3110 rP_diagnisticField := omit
3111 },
3112 rP_User_Data := omit /* FIXME: report */
3113 }
3114}
3115
3116
3117template (value) RPDU_MS_SGSN ts_RP_SMMA_MO(OCT1 msg_ref) := {
3118 rP_SMMA := {
3119 rP_MTI := '110'B,
3120 rP_Spare := '00000'B,
3121 rP_MessageReference := msg_ref
3122 }
3123}
3124
3125
3126
3127
3128/* CP Layer */
3129
3130template (value) L3_SMS_MS_SGSN ts_CP_DATA_MO(template (value) RPDU_MS_SGSN rpdu) := {
3131 cP_DATA := {
3132 cP_messageType := '00000001'B,
3133 cP_User_Data := {
3134 lengthIndicator := 0, /* overwritten */
3135 cP_RPDU := rpdu
3136 }
3137 }
3138}
3139
3140template (value) L3_SMS_MS_SGSN ts_CP_ACK_MO := {
3141 cP_ACK := {
3142 cP_messageType := '00000100'B
3143 }
3144}
3145
3146template (value) L3_SMS_MS_SGSN ts_CP_ERROR_MO(OCT1 cause) := {
3147 cP_ERROR := {
3148 cP_messageType := '00010000'B,
3149 cP_Cause := {
3150 causeValue := cause
3151 }
3152 }
3153}
3154
3155template L3_SMS_SGSN_MS tr_CP_DATA_MT(template RPDU_SGSN_MS rpdu) := {
3156 cP_DATA := {
3157 cP_messageType := '00000001'B,
3158 cP_User_Data := {
3159 lengthIndicator := ?,
3160 cP_RPDU := rpdu
3161 }
3162 }
3163}
3164
3165template L3_SMS_SGSN_MS tr_CP_ACK_MT := {
3166 cP_ACK := {
3167 cP_messageType := '00000100'B
3168 }
3169}
3170
3171template L3_SMS_SGSN_MS tr_CP_ERROR_MT(template OCT1 cause) := {
3172 cP_ERROR := {
3173 cP_messageType := '00010000'B,
3174 cP_Cause := {
3175 causeValue := cause
3176 }
3177 }
3178}
3179
3180/* L3 Wrapper */
3181
3182template (value) PDU_ML3_MS_NW ts_ML3_MO_SMS(uint3_t tid, BIT1 ti_flag,
3183 template (value) L3_SMS_MS_SGSN sms_mo) := {
3184 discriminator := '1001'B,
3185 tiOrSkip := {
3186 transactionId := {
3187 tio := int2bit(tid, 3),
3188 tiFlag := ti_flag,
3189 tIExtension := omit
3190 }
3191 },
3192 msgs := {
3193 sms := sms_mo
3194 }
3195}
3196
3197private function f_tid_or_wc(template uint3_t tid) return template BIT3 {
3198 var template BIT3 ret;
3199 if (istemplatekind(tid, "*")) {
3200 return *;
3201 } else if (istemplatekind(tid, "?")) {
3202 return ?;
3203 } else {
3204 return int2bit(valueof(tid), 3);
3205 }
3206}
3207
3208template PDU_ML3_NW_MS tr_ML3_MT_SMS(template uint3_t tid, template BIT1 ti_flag,
3209 template L3_SMS_SGSN_MS sms_mt) := {
3210 discriminator := '1001'B,
3211 tiOrSkip := {
3212 transactionId := {
3213 tio := f_tid_or_wc(tid),
3214 tiFlag := ti_flag,
3215 tIExtension := omit
3216 }
3217 },
3218 msgs := {
3219 sms := sms_mt
3220 }
3221}
3222
Philipp Maier9b690e42018-12-21 11:50:03 +01003223template PDU_ML3_NW_MS tr_ML3_MT_MM_Info := {
3224 discriminator := '0101'B,
3225 tiOrSkip := {
3226 skipIndicator := '0000'B
3227 },
3228 msgs := {
3229 mm := {
3230 mMInformation := {
3231 messageType := '110010'B,
3232 nsd := '00'B,
3233 fullNetworkName := *,
3234 shortNetworkName := *,
3235 localtimeZone := *,
3236 univTime := *,
3237 lSAIdentity := *,
3238 networkDST := *
3239 }
3240 }
3241 }
3242}
Harald Weltef45efeb2018-04-09 18:19:24 +02003243
3244
3245
Harald Weltec76f29f2017-11-22 12:46:46 +01003246}