blob: 051195feeb017931ce39f584b8099994517e22a2 [file] [log] [blame]
Harald Weltea013e682018-06-18 19:49:39 +02001module RANAP_Templates {
2
3import from General_Types all;
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01004import from Misc_Helpers all;
5import from Native_Functions all;
Harald Weltea013e682018-06-18 19:49:39 +02006
7import from RANAP_IEs all;
8import from RANAP_CommonDataTypes all;
9import from RANAP_Constants all;
10import from RANAP_Containers all;
11import from RANAP_PDU_Contents all;
12import from RANAP_PDU_Descriptions all;
13
14template (value) Cause ts_RanapCause_om_intervention := { misc := 113 };
15
16/*****************************************************************************************************
17 * Reset
18 *****************************************************************************************************/
19
20template (value) RANAP_PDU
21ts_RANAP_Reset(template (value) Cause cause, template (value) CN_DomainIndicator dom,
22 template (omit) Reset.protocolExtensions exts := omit) := {
23 initiatingMessage := {
24 procedureCode := id_Reset,
25 criticality := reject,
26 value_ := {
27 Reset := {
28 protocolIEs := {
29 {
30 id := id_Cause,
31 criticality := ignore,
32 value_ := {
33 cause := cause
34 }
35 }, {
36 id := id_CN_DomainIndicator,
37 criticality := reject,
38 value_ := {
39 cN_DomainIndicator := dom
40 }
41 }
42 },
43 protocolExtensions := exts
44 }
45 }
46 }
47}
48template RANAP_PDU
49tr_RANAP_Reset(template Cause cause := ?, template CN_DomainIndicator dom := ?,
50 template Reset.protocolExtensions exts := *) := {
51 initiatingMessage := {
52 procedureCode := id_Reset,
53 criticality := reject,
54 value_ := {
55 Reset := {
56 protocolIEs := {
57 {
58 id := id_Cause,
59 criticality := ignore,
60 value_ := {
61 cause := cause
62 }
63 }, {
64 id := id_CN_DomainIndicator,
65 criticality := reject,
66 value_ := {
67 cN_DomainIndicator := dom
68 }
69 }, *
70 },
71 protocolExtensions := exts
72 }
73 }
74 }
75}
76
77template (value) RANAP_PDU
78ts_RANAP_ResetAck(template (value) CN_DomainIndicator dom,
79 template (omit) ResetAcknowledge.protocolExtensions exts := omit) := {
80 successfulOutcome := {
81 procedureCode := id_Reset,
82 criticality := reject,
83 value_ := {
84 ResetAcknowledge := {
85 protocolIEs := {
86 {
87 id := id_CN_DomainIndicator,
88 criticality := reject,
89 value_ := {
90 cN_DomainIndicator := dom
91 }
92 }
93 },
94 protocolExtensions := exts
95 }
96 }
97 }
98}
99template RANAP_PDU
100tr_RANAP_ResetAck(template CN_DomainIndicator dom := ?,
101 template ResetAcknowledge.protocolExtensions exts := *) := {
102 successfulOutcome := {
103 procedureCode := id_Reset,
104 criticality := reject,
105 value_ := {
106 ResetAcknowledge := {
107 protocolIEs := {
108 {
109 id := id_CN_DomainIndicator,
110 criticality := reject,
111 value_ := {
112 cN_DomainIndicator := dom
113 }
114 }, *
115 },
116 protocolExtensions := exts
117 }
118 }
119 }
120}
121
122/*****************************************************************************************************
123 * Security Mode Control
124 *****************************************************************************************************/
125
126template (value) RANAP_PDU
127ts_RANAP_SecurityModeCmd(template (value) PermittedIntegrityProtectionAlgorithms uia_algs,
128 template (value) IntegrityProtectionKey uia_key,
129 template (value) KeyStatus key_sts,
130 template (omit) SecurityModeCommand.protocolExtensions exts := omit) := {
131 initiatingMessage := {
132 procedureCode := id_SecurityModeControl,
133 criticality := reject,
134 value_ := {
135 securityModeCommand := {
136 protocolIEs := {
137 {
138 id := id_IntegrityProtectionInformation,
139 criticality := reject,
140 value_ := {
141 integrityProtectionInformation := {
142 permittedAlgorithms := uia_algs,
143 key := uia_key,
144 iE_Extensions := omit
145 }
146 }
147 }, {
148 id := id_KeyStatus,
149 criticality := reject,
150 value_ := {
151 keyStatus := key_sts
152 }
153 }
154 },
155 protocolExtensions := exts
156 }
157 }
158 }
159}
160template RANAP_PDU
161tr_RANAP_SecurityModeCmd(template PermittedIntegrityProtectionAlgorithms uia_algs,
162 template IntegrityProtectionKey uia_key,
163 template KeyStatus key_sts,
164 template SecurityModeCommand.protocolExtensions exts := *) := {
165 initiatingMessage := {
166 procedureCode := id_SecurityModeControl,
167 criticality := reject,
168 value_ := {
169 securityModeCommand := {
170 protocolIEs := {
171 {
172 id := id_IntegrityProtectionInformation,
173 criticality := reject,
174 value_ := {
175 integrityProtectionInformation := {
176 permittedAlgorithms := uia_algs,
177 key := uia_key,
178 iE_Extensions := *
179 }
180 }
181 }, {
182 id := id_KeyStatus,
183 criticality := reject,
184 value_ := {
185 keyStatus := key_sts
186 }
187 }
188 },
189 protocolExtensions := exts
190 }
191 }
192 }
193}
194
195template (value) RANAP_PDU
196ts_RANAP_SecurityModeCmdEnc(template (value) PermittedIntegrityProtectionAlgorithms uia_algs,
197 template (value) IntegrityProtectionKey uia_key,
198 template (value) KeyStatus key_sts,
199 template (value) PermittedEncryptionAlgorithms uea_algs,
200 template (value) EncryptionKey uea_key,
201 template (omit) SecurityModeCommand.protocolExtensions exts := omit) := {
202 initiatingMessage := {
203 procedureCode := id_SecurityModeControl,
204 criticality := reject,
205 value_ := {
206 securityModeCommand := {
207 protocolIEs := {
208 {
209 id := id_IntegrityProtectionInformation,
210 criticality := reject,
211 value_ := {
212 integrityProtectionInformation := {
213 permittedAlgorithms := uia_algs,
214 key := uia_key,
215 iE_Extensions := omit
216 }
217 }
218 }, {
219 id := id_EncryptionInformation,
220 criticality := ignore,
221 value_ := {
222 encryptionInformation := {
223 permittedAlgorithms := uea_algs,
224 key := uea_key,
225 iE_Extensions := omit
226 }
227 }
228 }, {
229 id := id_KeyStatus,
230 criticality := reject,
231 value_ := {
232 keyStatus := key_sts
233 }
234 }
235 },
236 protocolExtensions := exts
237 }
238 }
239 }
240}
241template RANAP_PDU
242tr_RANAP_SecurityModeCmdEnc(template PermittedIntegrityProtectionAlgorithms uia_algs,
243 template IntegrityProtectionKey uia_key,
244 template KeyStatus key_sts,
245 template PermittedEncryptionAlgorithms uea_algs,
246 template EncryptionKey uea_key,
247 template SecurityModeCommand.protocolExtensions exts := *) := {
248 initiatingMessage := {
249 procedureCode := id_SecurityModeControl,
250 criticality := reject,
251 value_ := {
252 securityModeCommand := {
253 protocolIEs := {
254 {
255 id := id_IntegrityProtectionInformation,
256 criticality := reject,
257 value_ := {
258 integrityProtectionInformation := {
259 permittedAlgorithms := uia_algs,
260 key := uia_key,
261 iE_Extensions := *
262 }
263 }
264 }, {
265 id := id_EncryptionInformation,
266 criticality := ignore,
267 value_ := {
268 encryptionInformation := {
269 permittedAlgorithms := uea_algs,
270 key := uea_key,
271 iE_Extensions := *
272 }
273 }
274 }, {
275 id := id_KeyStatus,
276 criticality := reject,
277 value_ := {
278 keyStatus := key_sts
279 }
280 }
281 },
282 protocolExtensions := exts
283 }
284 }
285 }
286}
287
288template (value) RANAP_PDU
289ts_RANAP_SecurityModeComplete(template (value) IntegrityProtectionAlgorithm uia_alg,
290 template (omit) SecurityModeComplete.protocolExtensions exts := omit) := {
291 successfulOutcome := {
292 procedureCode := id_SecurityModeControl,
293 criticality := reject,
294 value_ := {
295 securityModeComplete := {
296 protocolIEs := {
297 {
298 id := id_ChosenIntegrityProtectionAlgorithm,
299 criticality := reject,
300 value_ := {
301 chosenIntegrityProtectionAlgorithm := uia_alg
302 }
303 }
304 },
305 protocolExtensions := exts
306 }
307 }
308 }
309}
310template RANAP_PDU
311tr_RANAP_SecurityModeComplete(template IntegrityProtectionAlgorithm uia_alg,
312 template SecurityModeComplete.protocolExtensions exts := *) := {
313 successfulOutcome := {
314 procedureCode := id_SecurityModeControl,
315 criticality := reject,
316 value_ := {
317 securityModeComplete := {
318 protocolIEs := {
319 {
320 id := id_ChosenIntegrityProtectionAlgorithm,
321 criticality := reject,
322 value_ := {
323 chosenIntegrityProtectionAlgorithm := uia_alg
324 }
325 }
326 },
327 protocolExtensions := exts
328 }
329 }
330 }
331}
332
333template (value) RANAP_PDU
334ts_RANAP_SecurityModeCompleteEnc(template (value) IntegrityProtectionAlgorithm uia_alg,
335 template (value) EncryptionAlgorithm uea_alg,
336 template (omit) SecurityModeComplete.protocolExtensions exts := omit) := {
337 successfulOutcome := {
338 procedureCode := id_SecurityModeControl,
339 criticality := reject,
340 value_ := {
341 securityModeComplete := {
342 protocolIEs := {
343 {
344 id := id_ChosenIntegrityProtectionAlgorithm,
345 criticality := reject,
346 value_ := {
347 chosenIntegrityProtectionAlgorithm := uia_alg
348 }
349 }, {
350 id := id_ChosenEncryptionAlgorithm,
351 criticality := ignore,
352 value_ := {
353 chosenEncryptionAlgorithm := uea_alg
354 }
355 }
356 },
357 protocolExtensions := exts
358 }
359 }
360 }
361}
362template RANAP_PDU
363tr_RANAP_SecurityModeCompleteEnc(template IntegrityProtectionAlgorithm uia_alg,
364 template EncryptionAlgorithm uea_alg,
365 template SecurityModeComplete.protocolExtensions exts := *) := {
366 successfulOutcome := {
367 procedureCode := id_SecurityModeControl,
368 criticality := reject,
369 value_ := {
370 securityModeComplete := {
371 protocolIEs := {
372 {
373 id := id_ChosenIntegrityProtectionAlgorithm,
374 criticality := reject,
375 value_ := {
376 chosenIntegrityProtectionAlgorithm := uia_alg
377 }
378 }, {
379 id := id_ChosenEncryptionAlgorithm,
380 criticality := ignore,
381 value_ := {
382 chosenEncryptionAlgorithm := uea_alg
383 }
384 }
385 },
386 protocolExtensions := exts
387 }
388 }
389 }
390}
391
392template (value) RANAP_PDU
393ts_RANAP_SecurityModeReject(template (value) Cause cause,
394 template (omit) SecurityModeReject.protocolExtensions exts := omit) := {
395 unsuccessfulOutcome := {
396 procedureCode := id_SecurityModeControl,
397 criticality := reject,
398 value_ := {
399 securityModeReject := {
400 protocolIEs := {
401 {
402 id := id_Cause,
403 criticality := ignore,
404 value_ := {
405 cause := cause
406 }
407 }
408 },
409 protocolExtensions := exts
410 }
411 }
412 }
413}
414template RANAP_PDU
415tr_RANAP_SecurityModeReject(template Cause cause,
416 template SecurityModeReject.protocolExtensions exts := *) := {
417 unsuccessfulOutcome := {
418 procedureCode := id_SecurityModeControl,
419 criticality := reject,
420 value_ := {
421 securityModeReject := {
422 protocolIEs := {
423 {
424 id := id_Cause,
425 criticality := ignore,
426 value_ := {
427 cause := cause
428 }
429 }
430 },
431 protocolExtensions := exts
432 }
433 }
434 }
435}
436
437
438
439/*****************************************************************************************************
440 * Iu Release Request
441 *****************************************************************************************************/
442
443template (value) RANAP_PDU
444ts_RANAP_IuReleaseRequest(template (value) Cause cause,
445 template (omit) Iu_ReleaseRequest.protocolExtensions exts := omit) := {
446 initiatingMessage := {
447 procedureCode := id_Iu_ReleaseRequest,
448 criticality := ignore,
449 value_ := {
450 iu_ReleaseRequest := {
451 protocolIEs := {
452 {
453 id := id_Cause,
Daniel Willmanncd8b71c2022-02-22 16:47:44 +0100454 criticality := ignore,
Harald Weltea013e682018-06-18 19:49:39 +0200455 value_ := {
456 cause := cause
457 }
458 }
459 },
460 protocolExtensions := exts
461 }
462 }
463 }
464}
465template RANAP_PDU
466tr_RANAP_IuReleaseRequest(template Cause cause,
467 template Iu_ReleaseRequest.protocolExtensions exts := *) := {
468 initiatingMessage := {
469 procedureCode := id_Iu_ReleaseRequest,
470 criticality := ignore,
471 value_ := {
472 iu_ReleaseRequest := {
473 protocolIEs := {
474 {
475 id := id_Cause,
Daniel Willmanncd8b71c2022-02-22 16:47:44 +0100476 criticality := ignore,
Harald Weltea013e682018-06-18 19:49:39 +0200477 value_ := {
478 cause := cause
479 }
480 }
481 },
482 protocolExtensions := exts
483 }
484 }
485 }
486}
487
488/*****************************************************************************************************
489 * RAB Release
490 *****************************************************************************************************/
491
Daniel Willmannfc5e17a2022-01-28 11:42:40 +0100492template (value) RAB_ID
493t_RAB_id(integer rab_id) := int2bit(rab_id, 8);
494
495template (value) TransportLayerAddress ts_RAB_TLA4(OCT4 ip) := hex2bit('350001'H & oct2hex(ip) & '00000000000000000000000000'H);
496template (value) TransportLayerAddress ts_RAB_TLA6(OCT16 ip) := hex2bit('350000'H & oct2hex(ip) & '00'H);
497function f_ts_RAB_TLA(charstring addr) return template (value) TransportLayerAddress {
498 if (f_addr_is_ipv6(addr)) {
499 var OCT16 ip6 := f_inet6_addr(addr);
500 return ts_RAB_TLA6(ip6);
501 } else {
502 var OCT4 ip4 := f_inet_addr(addr);
503 return ts_RAB_TLA4(ip4);
504 }
505}
506
507template (value) BindingID
508t_RAB_binding_port(integer prt) := int2oct(prt, 2) & '0000'O;
509
Harald Weltea013e682018-06-18 19:49:39 +0200510template (value) RANAP_PDU
511ts_RANAP_RabReleaseRequest(template (value) RAB_ID rab_id, template (value) Cause cause,
512 template (omit) RAB_ReleaseRequest.protocolExtensions exts := omit) := {
513 initiatingMessage := {
514 procedureCode := id_RAB_ReleaseRequest,
515 criticality := ignore,
516 value_ := {
517 rAB_ReleaseRequest := {
518 protocolIEs := {
519 {
520 id := id_RAB_ReleaseList,
521 criticality := ignore,
522 value_ := {
523 rAB_ReleaseList := {{
524 {
525 id := id_RAB_ReleaseItem,
526 criticality := ignore,
527 value_ := {
528 rAB_ReleaseItem := {
529 rAB_ID := rab_id,
530 cause := cause,
531 iE_Extensions := omit
532 }
533 }
534 }
535 }}
536 }
537 }
538 },
539 protocolExtensions := exts
540 }
541 }
542 }
543}
544template RANAP_PDU
Daniel Willmannfc5e17a2022-01-28 11:42:40 +0100545tr_RANAP_RabReleaseRequest(template (present) RAB_ID rab_id, template Cause cause,
Harald Weltea013e682018-06-18 19:49:39 +0200546 template RAB_ReleaseRequest.protocolExtensions exts := *) := {
547 initiatingMessage := {
548 procedureCode := id_RAB_ReleaseRequest,
549 criticality := ignore,
550 value_ := {
551 rAB_ReleaseRequest := {
552 protocolIEs := {
553 {
554 id := id_RAB_ReleaseList,
555 criticality := ignore,
556 value_ := {
557 rAB_ReleaseList := {{
558 {
559 id := id_RAB_ReleaseItem,
560 criticality := ignore,
561 value_ := {
562 rAB_ReleaseItem := {
563 rAB_ID := rab_id,
564 cause := cause,
565 iE_Extensions := *
566 }
567 }
568 }
569 }}
570 }
571 }
572 },
573 protocolExtensions := exts
574 }
575 }
576 }
577}
578
579
580/*****************************************************************************************************
581 * Iu Release
582 *****************************************************************************************************/
583
584template (value) RANAP_PDU
585ts_RANAP_IuReleaseCommand(template (value) Cause cause,
586 template (omit) Iu_ReleaseCommand.protocolExtensions exts := omit) := {
587 initiatingMessage := {
588 procedureCode := id_Iu_Release,
589 criticality := reject,
590 value_ := {
591 iu_ReleaseCommand := {
592 protocolIEs := {
593 {
594 id := id_Cause,
595 criticality := ignore,
596 value_ := {
597 cause := cause
598 }
599 }
600 },
601 protocolExtensions := exts
602 }
603 }
604 }
605}
606template RANAP_PDU
607tr_RANAP_IuReleaseCommand(template Cause cause,
608 template Iu_ReleaseCommand.protocolExtensions exts := *) := {
609 initiatingMessage := {
610 procedureCode := id_Iu_Release,
611 criticality := reject,
612 value_ := {
613 iu_ReleaseCommand := {
614 protocolIEs := {
615 {
616 id := id_Cause,
617 criticality := ignore,
618 value_ := {
619 cause := cause
620 }
621 }
622 },
623 protocolExtensions := exts
624 }
625 }
626 }
627}
628
629template (value) RANAP_PDU
630ts_RANAP_IuReleaseComplete(template (omit) Iu_ReleaseComplete.protocolIEs ies := {},
631 template (omit) Iu_ReleaseComplete.protocolExtensions exts := omit) := {
632 successfulOutcome := {
633 procedureCode := id_Iu_Release,
634 criticality := reject,
635 value_ := {
636 iu_ReleaseComplete := {
637 protocolIEs := ies,
638 protocolExtensions := exts
639 }
640 }
641 }
642}
643template RANAP_PDU
644tr_RANAP_IuReleaseComplete(template Iu_ReleaseComplete.protocolIEs ies := *,
645 template Iu_ReleaseComplete.protocolExtensions exts := *) := {
646 successfulOutcome := {
647 procedureCode := id_Iu_Release,
648 criticality := reject,
649 value_ := {
650 iu_ReleaseComplete:= {
651 protocolIEs := ies,
652 protocolExtensions := exts
653 }
654 }
655 }
656}
657
658/*****************************************************************************************************
659 * Paging
660 *****************************************************************************************************/
661
662template (value) RANAP_PDU
663ts_RANAP_Paging(template (value) CN_DomainIndicator dom, template (value) IMSI imsi,
Harald Weltea013e682018-06-18 19:49:39 +0200664 template (omit) Paging.protocolExtensions exts := omit) := {
665 initiatingMessage := {
666 procedureCode := id_Paging,
667 criticality := ignore,
668 value_ := {
669 paging := {
670 protocolIEs := {
671 {
672 id := id_CN_DomainIndicator,
673 criticality := ignore,
674 value_ := {
675 cN_DomainIndicator := dom
676 }
677 }, {
678 id := id_PermanentNAS_UE_ID,
679 criticality := ignore,
680 value_ := {
681 permanentNAS_UE_ID := {
682 iMSI := imsi
683 }
684 }
685 }
686 },
687 protocolExtensions := exts
688 }
689 }
690 }
691}
692template RANAP_PDU
693tr_RANAP_Paging(template CN_DomainIndicator dom, template IMSI imsi,
694 template Paging.protocolExtensions exts := *) := {
695 initiatingMessage := {
696 procedureCode := id_Paging,
697 criticality := ignore,
698 value_ := {
699 paging := {
700 protocolIEs := {
701 {
702 id := id_CN_DomainIndicator,
703 criticality := ignore,
704 value_ := {
705 cN_DomainIndicator := dom
706 }
707 }, {
708 id := id_PermanentNAS_UE_ID,
709 criticality := ignore,
710 value_ := {
711 permanentNAS_UE_ID := {
712 iMSI := imsi
713 }
714 }
715 }, *
716 },
717 protocolExtensions := exts
718 }
719 }
720 }
721}
722
Neels Hofmeyrb1bf16d2023-06-27 02:10:04 +0200723template (value) TemporaryUE_ID ts_RANAP_TemporaryUE_ID_TMSI(octetstring tmsi) := {
724 tMSI := tmsi
725}
726
727template (value) RANAP_PDU
728ts_RANAP_Paging_temp_id(template (value) CN_DomainIndicator dom, template (value) IMSI imsi,
729 template (value) TemporaryUE_ID temp_id,
730 template (omit) Paging.protocolExtensions exts := omit) := {
731 initiatingMessage := {
732 procedureCode := id_Paging,
733 criticality := ignore,
734 value_ := {
735 paging := {
736 protocolIEs := {
737 {
738 id := id_CN_DomainIndicator,
739 criticality := ignore,
740 value_ := {
741 cN_DomainIndicator := dom
742 }
743 }, {
744 id := id_PermanentNAS_UE_ID,
745 criticality := ignore,
746 value_ := {
747 permanentNAS_UE_ID := {
748 iMSI := imsi
749 }
750 }
751 }, {
752 id := id_TemporaryUE_ID,
753 criticality := ignore,
754 value_ := {
755 temporaryUE_ID := temp_id
756 }
757 }
758 },
759 protocolExtensions := exts
760 }
761 }
762 }
763}
Harald Weltea013e682018-06-18 19:49:39 +0200764
765
766/*****************************************************************************************************
767 * Common ID
768 *****************************************************************************************************/
769
770template (value) RANAP_PDU
771ts_RANAP_CommonId(template (value) IMSI imsi,
772 template (omit) CommonID.protocolExtensions exts := omit) := {
773 initiatingMessage := {
774 procedureCode := id_CommonID,
775 criticality := ignore,
776 value_ := {
777 commonID := {
778 protocolIEs := {
779 {
780 id := id_PermanentNAS_UE_ID,
781 criticality := ignore,
782 value_ := {
783 permanentNAS_UE_ID := {
784 iMSI := imsi
785 }
786 }
787 }
788 },
789 protocolExtensions := exts
790 }
791 }
792 }
793}
794template RANAP_PDU
795tr_RANAP_CommonId(template IMSI imsi,
796 template CommonID.protocolExtensions exts := *) := {
797 initiatingMessage := {
798 procedureCode := id_CommonID,
799 criticality := ignore,
800 value_ := {
801 commonID := {
802 protocolIEs := {
803 {
804 id := id_PermanentNAS_UE_ID,
805 criticality := ignore,
806 value_ := {
807 permanentNAS_UE_ID := {
808 iMSI := imsi
809 }
810 }
811 }
812 },
813 protocolExtensions := exts
814 }
815 }
816 }
817}
818
819/*****************************************************************************************************
820 * Initial UE Message
821 *****************************************************************************************************/
822
823template (value) RANAP_PDU
824ts_RANAP_initialUE_CS(template (value) LAI lai, template (value) SAI sai,
825 template (value) NAS_PDU nas,
826 template (value) IuSignallingConnectionIdentifier sigc_id,
827 template (value) GlobalRNC_ID grnc_id,
828 template (omit) InitialUE_Message.protocolExtensions exts := omit) := {
829 initiatingMessage := {
830 procedureCode := id_InitialUE_Message,
831 criticality := ignore,
832 value_ := {
833 initialUE_Message := {
834 protocolIEs := {
835 {
836 id := id_CN_DomainIndicator,
837 criticality := ignore,
838 value_ := {
839 cN_DomainIndicator := cs_domain
840 }
841 }, {
842 id := id_LAI,
843 criticality := ignore,
844 value_ := {
845 lAI := lai
846 }
847 }, {
848 id := id_SAI,
849 criticality := ignore,
850 value_ := {
851 sAI := sai
852 }
853 }, {
854 id := id_NAS_PDU,
855 criticality := ignore,
856 value_ := {
857 nAS_PDU := nas
858 }
859 }, {
860 id := id_IuSigConId,
861 criticality := ignore,
862 value_ := {
863 iuSignallingConnectionIdentifier := sigc_id
864 }
865 }, {
866 id := id_GlobalRNC_ID,
867 criticality := ignore,
868 value_ := {
869 globalRNC_ID := grnc_id
870 }
871 }
872 },
873 protocolExtensions := exts
874 }
875 }
876 }
877}
878template RANAP_PDU
879tr_RANAP_initialUE_CS(template LAI lai, template SAI sai,
880 template NAS_PDU nas,
881 template IuSignallingConnectionIdentifier sigc_id,
882 template GlobalRNC_ID grnc_id,
883 template InitialUE_Message.protocolExtensions exts := *) := {
884 initiatingMessage := {
885 procedureCode := id_InitialUE_Message,
886 criticality := ignore,
887 value_ := {
888 initialUE_Message := {
889 protocolIEs := {
890 {
891 id := id_CN_DomainIndicator,
892 criticality := ignore,
893 value_ := {
894 cN_DomainIndicator := cs_domain
895 }
896 }, {
897 id := id_LAI,
898 criticality := ignore,
899 value_ := {
900 lAI := lai
901 }
902 }, {
903 id := id_SAI,
904 criticality := ignore,
905 value_ := {
906 sAI := sai
907 }
908 }, {
909 id := id_NAS_PDU,
910 criticality := ignore,
911 value_ := {
912 nAS_PDU := nas
913 }
914 }, {
915 id := id_IuSigConId,
916 criticality := ignore,
917 value_ := {
918 iuSignallingConnectionIdentifier := sigc_id
919 }
920 }, {
921 id := id_GlobalRNC_ID,
922 criticality := ignore,
923 value_ := {
924 globalRNC_ID := grnc_id
925 }
926 }
927 },
928 protocolExtensions := exts
929 }
930 }
931 }
932}
933
934template (value) RANAP_PDU
935ts_RANAP_initialUE_PS(template (value) LAI lai, template (value) RAC rac, template (value) SAI sai,
936 template (value) NAS_PDU nas,
937 template (value) IuSignallingConnectionIdentifier sigc_id,
938 template (value) GlobalRNC_ID grnc_id,
939 template (omit) InitialUE_Message.protocolExtensions exts := omit) := {
940 initiatingMessage := {
941 procedureCode := id_InitialUE_Message,
942 criticality := ignore,
943 value_ := {
944 initialUE_Message := {
945 protocolIEs := {
946 {
947 id := id_CN_DomainIndicator,
948 criticality := ignore,
949 value_ := {
950 cN_DomainIndicator := ps_domain
951 }
952 }, {
953 id := id_LAI,
954 criticality := ignore,
955 value_ := {
956 lAI := lai
957 }
958 }, {
959 id := id_RAC,
960 criticality := ignore,
961 value_ := {
962 rAC := rac
963 }
964 }, {
965 id := id_SAI,
966 criticality := ignore,
967 value_ := {
968 sAI := sai
969 }
970 }, {
971 id := id_NAS_PDU,
972 criticality := ignore,
973 value_ := {
974 nAS_PDU := nas
975 }
976 }, {
977 id := id_IuSigConId,
978 criticality := ignore,
979 value_ := {
980 iuSignallingConnectionIdentifier := sigc_id
981 }
982 }, {
983 id := id_GlobalRNC_ID,
984 criticality := ignore,
985 value_ := {
986 globalRNC_ID := grnc_id
987 }
988 }
989 },
990 protocolExtensions := exts
991 }
992 }
993 }
994}
995template RANAP_PDU
996tr_RANAP_initialUE_PS(template LAI lai, template RAC rac, template SAI sai,
997 template NAS_PDU nas,
998 template IuSignallingConnectionIdentifier sigc_id,
999 template GlobalRNC_ID grnc_id,
1000 template InitialUE_Message.protocolExtensions exts := *) := {
1001 initiatingMessage := {
1002 procedureCode := id_InitialUE_Message,
1003 criticality := ignore,
1004 value_ := {
1005 initialUE_Message := {
1006 protocolIEs := {
1007 {
1008 id := id_CN_DomainIndicator,
1009 criticality := ignore,
1010 value_ := {
1011 cN_DomainIndicator := ps_domain
1012 }
1013 }, {
1014 id := id_LAI,
1015 criticality := ignore,
1016 value_ := {
1017 lAI := lai
1018 }
1019 }, {
1020 id := id_RAC,
1021 criticality := ignore,
1022 value_ := {
1023 rAC := rac
1024 }
1025 }, {
1026 id := id_SAI,
1027 criticality := ignore,
1028 value_ := {
1029 sAI := sai
1030 }
1031 }, {
1032 id := id_NAS_PDU,
1033 criticality := ignore,
1034 value_ := {
1035 nAS_PDU := nas
1036 }
1037 }, {
1038 id := id_IuSigConId,
1039 criticality := ignore,
1040 value_ := {
1041 iuSignallingConnectionIdentifier := sigc_id
1042 }
1043 }, {
1044 id := id_GlobalRNC_ID,
1045 criticality := ignore,
1046 value_ := {
1047 globalRNC_ID := grnc_id
1048 }
1049 }
1050 },
1051 protocolExtensions := exts
1052 }
1053 }
1054 }
1055}
1056
1057/*****************************************************************************************************
1058 * Direct Transfer
1059 *****************************************************************************************************/
1060
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001061private function f_gen_ts_dt_ies(template (value) NAS_PDU nas,
1062 template (omit) SAPI sapi,
1063 template (value) DirectTransfer.protocolIEs opt_ies)
1064return DirectTransfer.protocolIEs {
1065 var DirectTransfer.protocolIEs ies := {
1066 /* NAS PDU is mandatory */
1067 {
1068 id := id_NAS_PDU,
1069 criticality := ignore,
1070 value_ := {
1071 nAS_PDU := valueof(nas)
1072 }
1073 }
1074 };
1075
1076 /* Optional IEs, e.g. LAI, RAC, SAI */
1077 ies := ies & valueof(opt_ies);
1078
1079 /* Optional SAPI is the last IE */
1080 if (isvalue(sapi)) {
1081 ies := ies & {{
1082 id := id_SAPI,
1083 criticality := ignore,
1084 value_ := {
1085 sAPI := valueof(sapi)
1086 }
1087 }};
1088 }
1089
1090 return ies;
1091}
1092
1093private function f_gen_tr_dt_ies(template NAS_PDU nas,
1094 template SAPI sapi,
1095 template DirectTransfer.protocolIEs opt_ies)
1096return template DirectTransfer.protocolIEs {
1097 var template DirectTransfer.protocolIEs ies := {
1098 /* NAS PDU is mandatory */
1099 {
1100 id := id_NAS_PDU,
1101 criticality := ignore,
1102 value_ := {
1103 nAS_PDU := nas
1104 }
1105 }
1106 };
1107
1108 /* Optional IEs start from index 1 */
1109 var integer idx := 1;
1110
1111 /* Optional IEs, e.g. LAI, RAC, SAI */
1112 if (istemplatekind(opt_ies, "*")) {
1113 ies[idx] := *;
1114 idx := idx + 1;
1115 } else if (not istemplatekind(opt_ies, "omit")) {
1116 for (var integer i := 0; i < lengthof(opt_ies); i := i + 1) {
1117 ies[idx] := opt_ies[idx];
1118 idx := idx + 1;
1119 }
1120 }
1121
1122 /* Optional SAPI is the last IE */
1123 if (istemplatekind(sapi, "*")) {
1124 ies[idx] := *;
1125 } else if (not istemplatekind(sapi, "omit")) {
1126 ies[idx] := {
1127 id := id_SAPI,
1128 criticality := ignore,
1129 value_ := {
1130 sAPI := sapi
1131 }
1132 };
1133 }
1134
1135 return ies;
1136}
1137
Harald Weltea013e682018-06-18 19:49:39 +02001138template (value) RANAP_PDU
1139ts_RANAP_DirectTransfer(template (value) NAS_PDU nas,
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001140 template (omit) SAPI sapi := omit,
1141 template (value) DirectTransfer.protocolIEs ies := {},
Harald Weltea013e682018-06-18 19:49:39 +02001142 template (omit) DirectTransfer.protocolExtensions exts := omit) := {
1143 initiatingMessage := {
1144 procedureCode := id_DirectTransfer,
1145 criticality := ignore,
1146 value_ := {
1147 directTransfer := {
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001148 protocolIEs := f_gen_ts_dt_ies(nas, sapi, ies),
Harald Weltea013e682018-06-18 19:49:39 +02001149 protocolExtensions := exts
1150 }
1151 }
1152 }
1153}
1154template RANAP_PDU
1155tr_RANAP_DirectTransfer(template NAS_PDU nas,
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001156 template SAPI sapi := *,
1157 template DirectTransfer.protocolIEs ies := *,
Harald Weltea013e682018-06-18 19:49:39 +02001158 template DirectTransfer.protocolExtensions exts := *) := {
1159 initiatingMessage := {
1160 procedureCode := id_DirectTransfer,
1161 criticality := ignore,
1162 value_ := {
1163 directTransfer := {
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001164 protocolIEs := f_gen_tr_dt_ies(nas, sapi, ies),
Harald Weltea013e682018-06-18 19:49:39 +02001165 protocolExtensions := exts
1166 }
1167 }
1168 }
1169}
1170
1171
1172/*****************************************************************************************************
1173 * RAB Assignment Request
1174 *****************************************************************************************************/
1175
1176template (value) RAB_Parameters ts_RabParams := {
1177 trafficClass := conversational,
1178 rAB_AsymmetryIndicator := symmetric_bidirectional,
1179 maxBitrate := { 12200 },
1180 guaranteedBitRate := { 12200 },
1181 deliveryOrder := delivery_order_requested,
1182 maxSDU_Size := 244,
1183 sDU_Parameters := {
1184 {
1185 sDU_ErrorRatio := { mantissa := 1, exponent := 5, iE_Extensions := omit },
1186 residualBitErrorRatio := { mantissa := 1, exponent := 6, iE_Extensions := omit },
1187 deliveryOfErroneousSDU := yes,
1188 sDU_FormatInformationParameters := {
1189 {
1190 subflowSDU_Size := 81,
1191 rAB_SubflowCombinationBitRate := omit,
1192 iE_Extensions := omit
1193 }, {
1194 subflowSDU_Size := 39,
1195 rAB_SubflowCombinationBitRate := omit,
1196 iE_Extensions := omit
1197 }
1198 },
1199 iE_Extensions := omit
1200 }, {
1201 sDU_ErrorRatio := omit,
1202 residualBitErrorRatio := { mantissa := 1, exponent := 3, iE_Extensions := omit },
1203 deliveryOfErroneousSDU := no_error_detection_consideration,
1204 sDU_FormatInformationParameters := {
1205 {
1206 subflowSDU_Size := 103,
1207 rAB_SubflowCombinationBitRate := omit,
1208 iE_Extensions := omit
1209 }, {
1210 subflowSDU_Size := 0,
1211 rAB_SubflowCombinationBitRate := omit,
1212 iE_Extensions := omit
1213 }
1214 },
1215 iE_Extensions := omit
1216 }, {
1217 sDU_ErrorRatio := omit,
1218 residualBitErrorRatio := { mantissa := 5, exponent := 3, iE_Extensions := omit },
1219 deliveryOfErroneousSDU := no_error_detection_consideration,
1220 sDU_FormatInformationParameters := {
1221 {
1222 subflowSDU_Size := 60,
1223 rAB_SubflowCombinationBitRate := omit,
1224 iE_Extensions := omit
1225 }, {
1226 subflowSDU_Size := 0,
1227 rAB_SubflowCombinationBitRate := omit,
1228 iE_Extensions := omit
1229 }
1230 },
1231 iE_Extensions := omit
1232 }
1233 },
1234 transferDelay := 80,
1235 trafficHandlingPriority := omit,
1236 allocationOrRetentionPriority := {
1237 priorityLevel := 15,
1238 pre_emptionCapability := shall_not_trigger_pre_emption,
1239 pre_emptionVulnerability := pre_emptable,
1240 queuingAllowed := queueing_not_allowed,
1241 iE_Extensions := omit
1242 },
1243 sourceStatisticsDescriptor := omit,
1244 relocationRequirement := omit,
1245 iE_Extensions := omit
1246}
1247
1248template (value) UserPlaneInformation ts_UserPlaneInfo := {
1249 userPlaneMode := support_mode_for_predefined_SDU_sizes,
1250 uP_ModeVersions := '0000000000000010'B,
1251 iE_Extensions := omit
1252}
1253
1254template (value) TransportLayerInformation ts_TLI(template (value) TransportLayerAddress tla,
1255 template (value) BindingID binding_id) := {
1256 transportLayerAddress := tla,
1257 iuTransportAssociation := {
1258 bindingID := binding_id
1259 },
1260 iE_Extensions := omit
1261}
1262template TransportLayerInformation tr_TLI(template TransportLayerAddress tla,
1263 template BindingID binding_id) := {
1264 transportLayerAddress := tla,
1265 iuTransportAssociation := {
1266 bindingID := binding_id
1267 },
1268 iE_Extensions := *
1269}
1270
1271template (value) RAB_SetupOrModifyList ts_RAB_SML(template (value) RAB_ID rab_id,
1272 template (value) TransportLayerAddress tla,
1273 template (value) BindingID binding_id) := { {
1274 {
1275 id := id_RAB_SetupOrModifyItem,
1276 firstCriticality := reject,
1277 firstValue := {
1278 rAB_SetupOrModifyItemFirst := {
1279 rAB_ID := rab_id,
1280 nAS_SynchronisationIndicator := omit,
1281 rAB_Parameters := ts_RabParams,
1282 userPlaneInformation := ts_UserPlaneInfo,
1283 transportLayerInformation := ts_TLI(tla, binding_id),
1284 service_Handover := omit,
1285 iE_Extensions := omit
1286 }
1287 },
1288 secondCriticality := ignore,
1289 secondValue := {
1290 rAB_SetupOrModifyItemSecond := {
1291 pDP_TypeInformation := omit,
1292 dataVolumeReportingIndication := omit,
1293 dl_GTP_PDU_SequenceNumber := omit,
1294 ul_GTP_PDU_SequenceNumber := omit,
1295 dl_N_PDU_SequenceNumber := omit,
1296 ul_N_PDU_SequenceNumber := omit,
1297 iE_Extensions := omit
1298 }
1299 }
1300 }
1301} }
Daniel Willmann95263ca2022-02-15 09:55:18 +01001302template RAB_SetupOrModifyList tr_RAB_SML(template (present) RAB_ID rab_id,
Harald Weltea013e682018-06-18 19:49:39 +02001303 template TransportLayerAddress tla,
1304 template BindingID binding_id) := { {
1305 {
1306 id := id_RAB_SetupOrModifyItem,
1307 firstCriticality := reject,
1308 firstValue := {
1309 rAB_SetupOrModifyItemFirst := {
1310 rAB_ID := rab_id,
1311 nAS_SynchronisationIndicator := *,
1312 rAB_Parameters := ts_RabParams,
1313 userPlaneInformation := ts_UserPlaneInfo,
1314 transportLayerInformation := tr_TLI(tla, binding_id),
1315 service_Handover := *,
1316 iE_Extensions := *
1317 }
1318 },
1319 secondCriticality := ignore,
1320 secondValue := {
1321 rAB_SetupOrModifyItemSecond := {
1322 pDP_TypeInformation := omit,
1323 dataVolumeReportingIndication := omit,
1324 dl_GTP_PDU_SequenceNumber := omit,
1325 ul_GTP_PDU_SequenceNumber := omit,
1326 dl_N_PDU_SequenceNumber := omit,
1327 ul_N_PDU_SequenceNumber := omit,
1328 iE_Extensions := omit
1329 }
1330 }
1331 }
1332} }
1333
Neels Hofmeyra56e8fd2022-05-08 01:16:55 +02001334template (value) TransportLayerInformation ts_TLI_ps(template (value) TransportLayerAddress tla,
1335 template (value) GTP_TEI gtp_tei) := {
1336 transportLayerAddress := tla,
1337 iuTransportAssociation := {
1338 gTP_TEI := gtp_tei
1339 },
1340 iE_Extensions := omit
1341}
1342template TransportLayerInformation tr_TLI_ps(template TransportLayerAddress tla,
1343 template (value) GTP_TEI gtp_tei) := {
1344 transportLayerAddress := tla,
1345 iuTransportAssociation := {
1346 gTP_TEI := gtp_tei
1347 },
1348 iE_Extensions := *
1349}
1350
1351template (value) RAB_SetupOrModifyList ts_RAB_SML_ps(template (value) RAB_ID rab_id,
1352 template (value) TransportLayerAddress tla,
1353 template (value) GTP_TEI gtp_tei) := { {
1354 {
1355 id := id_RAB_SetupOrModifyItem,
1356 firstCriticality := reject,
1357 firstValue := {
1358 rAB_SetupOrModifyItemFirst := {
1359 rAB_ID := rab_id,
1360 nAS_SynchronisationIndicator := omit,
1361 rAB_Parameters := ts_RabParams,
1362 userPlaneInformation := ts_UserPlaneInfo,
1363 transportLayerInformation := ts_TLI_ps(tla, gtp_tei),
1364 service_Handover := omit,
1365 iE_Extensions := omit
1366 }
1367 },
1368 secondCriticality := ignore,
1369 secondValue := {
1370 rAB_SetupOrModifyItemSecond := {
1371 pDP_TypeInformation := omit,
1372 dataVolumeReportingIndication := omit,
1373 dl_GTP_PDU_SequenceNumber := omit,
1374 ul_GTP_PDU_SequenceNumber := omit,
1375 dl_N_PDU_SequenceNumber := omit,
1376 ul_N_PDU_SequenceNumber := omit,
1377 iE_Extensions := omit
1378 }
1379 }
1380 }
1381} }
1382template RAB_SetupOrModifyList tr_RAB_SML_ps(template (present) RAB_ID rab_id,
1383 template TransportLayerAddress tla,
1384 template (value) GTP_TEI gtp_tei) := { {
1385 {
1386 id := id_RAB_SetupOrModifyItem,
1387 firstCriticality := reject,
1388 firstValue := {
1389 rAB_SetupOrModifyItemFirst := {
1390 rAB_ID := rab_id,
1391 nAS_SynchronisationIndicator := *,
1392 rAB_Parameters := ts_RabParams,
1393 userPlaneInformation := ts_UserPlaneInfo,
1394 transportLayerInformation := tr_TLI_ps(tla, gtp_tei),
1395 service_Handover := *,
1396 iE_Extensions := *
1397 }
1398 },
1399 secondCriticality := ignore,
1400 secondValue := {
1401 rAB_SetupOrModifyItemSecond := {
1402 pDP_TypeInformation := omit,
1403 dataVolumeReportingIndication := omit,
1404 dl_GTP_PDU_SequenceNumber := omit,
1405 ul_GTP_PDU_SequenceNumber := omit,
1406 dl_N_PDU_SequenceNumber := omit,
1407 ul_N_PDU_SequenceNumber := omit,
1408 iE_Extensions := omit
1409 }
1410 }
1411 }
1412} }
1413
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01001414template (value) RAB_SetupOrModifiedList ts_RAB_SMdL(template (value) RAB_ID rab_id,
1415 template (value) TransportLayerAddress tla,
1416 template (value) BindingID binding_id) := { {
1417 {
1418 id := id_RAB_SetupOrModifiedItem,
1419 criticality := ignore,
1420 value_ := {
1421 rAB_SetupOrModifiedItem := {
1422 rAB_ID := rab_id,
1423 transportLayerAddress := tla,
1424 iuTransportAssociation := {
1425 bindingID := binding_id
1426 },
1427 dl_dataVolumes := omit,
1428 iE_Extensions := omit
1429 }
1430 }
1431 }
1432} }
1433
Neels Hofmeyra56e8fd2022-05-08 01:16:55 +02001434template (value) RAB_SetupOrModifiedList ts_RAB_SMdL_ps(template (value) RAB_ID rab_id,
1435 template (value) TransportLayerAddress tla,
1436 template (value) GTP_TEI gtp_tei) := { {
1437 {
1438 id := id_RAB_SetupOrModifiedItem,
1439 criticality := ignore,
1440 value_ := {
1441 rAB_SetupOrModifiedItem := {
1442 rAB_ID := rab_id,
1443 transportLayerAddress := tla,
1444 iuTransportAssociation := {
1445 gTP_TEI := gtp_tei
1446 },
1447 dl_dataVolumes := omit,
1448 iE_Extensions := omit
1449 }
1450 }
1451 }
1452} }
1453
Daniel Willmann95263ca2022-02-15 09:55:18 +01001454template RAB_SetupOrModifiedList tr_RAB_SMdL(template (present) RAB_ID rab_id,
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01001455 template TransportLayerAddress tla,
1456 template BindingID binding_id) := { {
1457 {
1458 id := id_RAB_SetupOrModifiedItem,
1459 criticality := ignore,
1460 value_ := {
1461 rAB_SetupOrModifiedItem := {
1462 rAB_ID := rab_id,
1463 transportLayerAddress := tla,
1464 iuTransportAssociation := {
1465 bindingID := binding_id
1466 },
1467 dl_dataVolumes := *,
1468 iE_Extensions := *
1469 }
1470 }
1471 }
1472} }
Harald Weltea013e682018-06-18 19:49:39 +02001473
Philipp Maier6289ea82022-02-09 15:30:11 +01001474template (value) RAB_FailedList ts_RAB_FL(template (value) RAB_ID rab_id,
1475 template (value) Cause cause) := { {
1476 {
1477 id := id_RAB_FailedItem,
1478 criticality := ignore,
1479 value_ := {
1480 rAB_FailedItem := {
1481 rAB_ID := rab_id,
1482 cause := cause,
1483 iE_Extensions := omit
1484 }
1485 }
1486 }
1487} }
1488
1489template RAB_FailedList tr_RAB_FL(template RAB_ID rab_id,
1490 template Cause cause) := { {
1491 {
1492 id := id_RAB_FailedItem,
1493 criticality := ignore,
1494 value_ := {
1495 rAB_FailedItem := {
1496 rAB_ID := rab_id,
1497 cause := cause,
1498 iE_Extensions := *
1499 }
1500 }
1501 }
1502} }
1503
Daniel Willmann9e789be2022-02-22 13:30:51 +01001504template (value) RAB_ReleaseList ts_RAB_RL(template (value) RAB_ID rab_id,
1505 template (value) Cause cause) := { {
1506 {
1507 id := id_RAB_ReleaseItem,
1508 criticality := ignore,
1509 value_ := {
1510 rAB_ReleaseItem := {
1511 rAB_ID := rab_id,
1512 cause := cause,
1513 iE_Extensions := omit
1514 }
1515 }
1516 }
1517} }
1518
1519template RAB_ReleaseList tr_RAB_RL(template (present) RAB_ID rab_id,
1520 template Cause cause := ?) := { {
1521 {
1522 id := id_RAB_ReleaseItem,
1523 criticality := ignore,
1524 value_ := {
1525 rAB_ReleaseItem := {
1526 rAB_ID := rab_id,
1527 cause := cause,
1528 iE_Extensions := *
1529 }
1530 }
1531 }
1532} }
1533
1534
1535function
1536ts_RANAP_RabAssReq(template (omit) RAB_SetupOrModifyList rab_sml := omit,
1537 template (omit) RAB_ReleaseList rab_rl := omit,
1538 template (omit) RAB_AssignmentRequest.protocolExtensions exts := omit) return template RANAP_PDU {
1539 var template RANAP_PDU ret;
1540 var template RAB_AssignmentRequest.protocolIEs protocolIEs := {};
1541 var integer ie_pos := 0;
1542
1543 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml;
1544 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl;
1545
1546 /* RAB-SetupOrModifyList */
1547 if (istemplatekind(rab_sml, "value")) {
1548 protocolIEs_rab_sml := {
1549 {
1550 id := id_RAB_SetupOrModifyList,
1551 criticality := ignore,
1552 value_ := {
1553 rAB_SetupOrModifyList := rab_sml
1554 }
1555 }
1556 };
1557 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1558 ie_pos := ie_pos + 1;
1559 }
1560
1561 /* RAB-ReleaseList */
1562 if (istemplatekind(rab_rl, "value")) {
1563 protocolIEs_rab_rl := {
1564 {
1565 id := id_RAB_ReleaseList,
1566 criticality := ignore,
1567 value_ := {
1568 rAB_ReleaseList := rab_rl
1569 }
1570 }
1571 };
1572 protocolIEs[ie_pos] := protocolIEs_rab_rl[0];
1573 ie_pos := ie_pos + 1;
1574 }
1575
1576
1577 ret.initiatingMessage := {
Harald Weltea013e682018-06-18 19:49:39 +02001578 procedureCode := id_RAB_Assignment,
1579 criticality := reject,
1580 value_ := {
1581 rAB_AssignmentRequest := {
Daniel Willmann9e789be2022-02-22 13:30:51 +01001582 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001583 protocolExtensions := exts
1584 }
1585 }
1586 }
Daniel Willmann9e789be2022-02-22 13:30:51 +01001587
1588 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001589}
Daniel Willmann9e789be2022-02-22 13:30:51 +01001590
1591function
1592tr_RANAP_RabAssReq(template RAB_SetupOrModifyList rab_sml := omit,
1593 template RAB_ReleaseList rab_rl := omit,
1594 template RAB_AssignmentRequest.protocolExtensions exts := *) return template RANAP_PDU {
1595 var template RANAP_PDU ret;
1596 var template RAB_AssignmentRequest.protocolIEs protocolIEs := {};
1597 var integer ie_pos := 0;
1598
1599 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml;
1600 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl;
1601
1602 /* RAB-SetupOrModifyList */
1603 if (not istemplatekind(rab_sml, "omit")) {
1604 protocolIEs_rab_sml := {
1605 {
1606 id := id_RAB_SetupOrModifyList,
1607 criticality := ignore,
1608 value_ := {
1609 rAB_SetupOrModifyList := rab_sml
1610 }
1611 }
1612 };
1613 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1614 ie_pos := ie_pos + 1;
1615 }
1616
1617 /* RAB-ReleaseList */
1618 if (not istemplatekind(rab_rl, "omit")) {
1619 protocolIEs_rab_rl := {
1620 {
1621 id := id_RAB_ReleaseList,
1622 criticality := ignore,
1623 value_ := {
1624 rAB_ReleaseList := rab_rl
1625 }
1626 }
1627 };
1628 protocolIEs[ie_pos] := protocolIEs_rab_rl[0];
1629 ie_pos := ie_pos + 1;
1630 }
1631
1632
1633 ret.initiatingMessage := {
Harald Weltea013e682018-06-18 19:49:39 +02001634 procedureCode := id_RAB_Assignment,
1635 criticality := reject,
1636 value_ := {
1637 rAB_AssignmentRequest := {
Daniel Willmann9e789be2022-02-22 13:30:51 +01001638 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001639 protocolExtensions := exts
1640 }
1641 }
1642 }
Daniel Willmann9e789be2022-02-22 13:30:51 +01001643
1644 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001645}
1646
Philipp Maier6289ea82022-02-09 15:30:11 +01001647function
1648ts_RANAP_RabAssResp(template (omit) RAB_SetupOrModifiedList rab_sml := omit,
1649 template (omit) RAB_FailedList rab_fl := omit,
1650 template (omit) RAB_AssignmentResponse.protocolExtensions exts := omit) return template RANAP_PDU {
1651 var template RANAP_PDU ret;
1652 var template RAB_AssignmentResponse.protocolIEs protocolIEs := {};
1653 var integer ie_pos := 0;
Harald Weltea013e682018-06-18 19:49:39 +02001654
Philipp Maier6289ea82022-02-09 15:30:11 +01001655 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml;
1656 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
1657
1658 /* RAB-SetupOrModifiedList */
1659 if (istemplatekind(rab_sml, "value")) {
1660 protocolIEs_rab_sml := {
1661 {
1662 id := id_RAB_SetupOrModifiedList,
1663 criticality := ignore,
1664 value_ := {
1665 rAB_SetupOrModifiedList := rab_sml
1666 }
1667 }
1668 }
1669
1670 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1671 ie_pos := ie_pos + 1;
1672 }
1673
1674 /* TODO: RAB-ReleasedList */
1675 /* TODO: RAB-QueuedList */
1676
1677 /* RAB-FailedList */
1678 if (istemplatekind(rab_fl, "value")) {
1679 protocolIEs_rab_fl := {
1680 {
1681 id := id_RAB_FailedList,
1682 criticality := ignore,
1683 value_ := {
1684 rAB_FailedList := rab_fl
1685 }
1686 }
1687 }
1688
1689 protocolIEs[ie_pos] := protocolIEs_rab_fl[0];
1690 ie_pos := ie_pos + 1;
1691 }
1692
1693 /* TODO: RAB-ReleaseFailedList */
1694
1695 ret.outcome := {
Harald Weltea013e682018-06-18 19:49:39 +02001696 procedureCode := id_RAB_Assignment,
1697 criticality := reject,
1698 value_ := {
1699 rAB_AssignmentResponse := {
Philipp Maier6289ea82022-02-09 15:30:11 +01001700 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001701 protocolExtensions := exts
1702 }
1703 }
1704 }
Philipp Maier6289ea82022-02-09 15:30:11 +01001705
1706 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001707}
Philipp Maier6289ea82022-02-09 15:30:11 +01001708
1709function
1710tr_RANAP_RabAssResp(template RAB_SetupOrModifiedList rab_sml := omit,
1711 template RAB_FailedList rab_fl := omit,
1712 template RAB_AssignmentResponse.protocolExtensions exts := *) return template RANAP_PDU {
1713 var template RANAP_PDU ret;
1714 var template RAB_AssignmentResponse.protocolIEs protocolIEs := {};
1715 var integer ie_pos := 0;
1716
1717 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml;
1718 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
1719
1720 /* RAB-SetupOrModifiedList */
1721 if (not istemplatekind(rab_sml, "omit")) {
1722 protocolIEs_rab_sml := {
1723 {
1724 id := id_RAB_SetupOrModifiedList,
1725 criticality := ignore,
1726 value_ := {
1727 rAB_SetupOrModifiedList := rab_sml
1728 }
1729 }
1730 }
1731
1732 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1733 ie_pos := ie_pos + 1;
1734 }
1735
1736 /* TODO: RAB-ReleasedList */
1737 /* TODO: RAB-QueuedList */
1738
1739 /* RAB-FailedList */
1740 if (not istemplatekind(rab_fl, "omit")) {
1741 protocolIEs_rab_fl := {
1742 {
1743 id := id_RAB_FailedList,
1744 criticality := ignore,
1745 value_ := {
1746 rAB_FailedList := rab_fl
1747 }
1748 }
1749 }
1750
1751 protocolIEs[ie_pos] := protocolIEs_rab_fl[0];
1752 ie_pos := ie_pos + 1;
1753 }
1754
1755 /* TODO: RAB-ReleaseFailedList */
1756
1757 protocolIEs[ie_pos] := *;
1758
1759 ret.outcome := {
Harald Weltea013e682018-06-18 19:49:39 +02001760 procedureCode := id_RAB_Assignment,
1761 criticality := reject,
1762 value_ := {
1763 rAB_AssignmentResponse := {
Philipp Maier6289ea82022-02-09 15:30:11 +01001764 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001765 protocolExtensions := exts
1766 }
1767 }
1768 }
Philipp Maier6289ea82022-02-09 15:30:11 +01001769
1770 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001771}
1772
Harald Weltea013e682018-06-18 19:49:39 +02001773/*****************************************************************************************************
1774 *
1775 *****************************************************************************************************/
1776
1777/* extract the L3 (NAS) from a given RANAP message */
1778function f_ranap_extract_l3(RANAP_PDU ranap) return template (omit) octetstring
1779{
1780 var integer i;
1781
1782 if (match(ranap, tr_RANAP_initialUE_CS(?, ?, ?, ?, ?)) or
1783 match(ranap, tr_RANAP_initialUE_PS(?, ?, ?, ?, ?, ?)) ) {
1784 var InitialUE_Message.protocolIEs ies := ranap.initiatingMessage.value_.initialUE_Message.protocolIEs;
1785 for (i := 0; i < lengthof(ies); i := i+1) {
1786 if (ies[i].id == id_NAS_PDU) {
1787 return ies[i].value_.nAS_PDU;
1788 }
1789 }
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001790 } else if (match(ranap, tr_RANAP_DirectTransfer(?))) {
Harald Weltea013e682018-06-18 19:49:39 +02001791 var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs;
1792 for (i := 0; i < lengthof(ies); i := i+1) {
1793 if (ies[i].id == id_NAS_PDU) {
1794 return ies[i].value_.nAS_PDU;
1795 }
1796 }
1797 } else {
1798 /* relocationInformation not supported yet*/
1799 }
1800 return omit;
1801}
1802
1803function f_ranap_extract_sapi(RANAP_PDU ranap) return template (omit) SAPI
1804{
1805 var integer i;
1806
1807 /* InitialUE message has no SAPI */
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001808 if (match(ranap, tr_RANAP_DirectTransfer(?, omit))) {
Harald Weltea013e682018-06-18 19:49:39 +02001809 var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs;
1810 for (i := 0; i < lengthof(ies); i := i+1) {
1811 if (ies[i].id == id_SAPI) {
1812 return ies[i].value_.sAPI;
1813 }
1814 }
1815 }
1816 return omit;
1817}
1818
1819
1820}