blob: 7fac3a4882ff329ced21a3aa1769a3ad2ea8e54c [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,
664 template (omit) TemporaryUE_ID temp_id := omit,
665 template (omit) Paging.protocolExtensions exts := omit) := {
666 initiatingMessage := {
667 procedureCode := id_Paging,
668 criticality := ignore,
669 value_ := {
670 paging := {
671 protocolIEs := {
672 {
673 id := id_CN_DomainIndicator,
674 criticality := ignore,
675 value_ := {
676 cN_DomainIndicator := dom
677 }
678 }, {
679 id := id_PermanentNAS_UE_ID,
680 criticality := ignore,
681 value_ := {
682 permanentNAS_UE_ID := {
683 iMSI := imsi
684 }
685 }
686 }
687 },
688 protocolExtensions := exts
689 }
690 }
691 }
692}
693template RANAP_PDU
694tr_RANAP_Paging(template CN_DomainIndicator dom, template IMSI imsi,
695 template Paging.protocolExtensions exts := *) := {
696 initiatingMessage := {
697 procedureCode := id_Paging,
698 criticality := ignore,
699 value_ := {
700 paging := {
701 protocolIEs := {
702 {
703 id := id_CN_DomainIndicator,
704 criticality := ignore,
705 value_ := {
706 cN_DomainIndicator := dom
707 }
708 }, {
709 id := id_PermanentNAS_UE_ID,
710 criticality := ignore,
711 value_ := {
712 permanentNAS_UE_ID := {
713 iMSI := imsi
714 }
715 }
716 }, *
717 },
718 protocolExtensions := exts
719 }
720 }
721 }
722}
723
724
725
726/*****************************************************************************************************
727 * Common ID
728 *****************************************************************************************************/
729
730template (value) RANAP_PDU
731ts_RANAP_CommonId(template (value) IMSI imsi,
732 template (omit) CommonID.protocolExtensions exts := omit) := {
733 initiatingMessage := {
734 procedureCode := id_CommonID,
735 criticality := ignore,
736 value_ := {
737 commonID := {
738 protocolIEs := {
739 {
740 id := id_PermanentNAS_UE_ID,
741 criticality := ignore,
742 value_ := {
743 permanentNAS_UE_ID := {
744 iMSI := imsi
745 }
746 }
747 }
748 },
749 protocolExtensions := exts
750 }
751 }
752 }
753}
754template RANAP_PDU
755tr_RANAP_CommonId(template IMSI imsi,
756 template CommonID.protocolExtensions exts := *) := {
757 initiatingMessage := {
758 procedureCode := id_CommonID,
759 criticality := ignore,
760 value_ := {
761 commonID := {
762 protocolIEs := {
763 {
764 id := id_PermanentNAS_UE_ID,
765 criticality := ignore,
766 value_ := {
767 permanentNAS_UE_ID := {
768 iMSI := imsi
769 }
770 }
771 }
772 },
773 protocolExtensions := exts
774 }
775 }
776 }
777}
778
779/*****************************************************************************************************
780 * Initial UE Message
781 *****************************************************************************************************/
782
783template (value) RANAP_PDU
784ts_RANAP_initialUE_CS(template (value) LAI lai, template (value) SAI sai,
785 template (value) NAS_PDU nas,
786 template (value) IuSignallingConnectionIdentifier sigc_id,
787 template (value) GlobalRNC_ID grnc_id,
788 template (omit) InitialUE_Message.protocolExtensions exts := omit) := {
789 initiatingMessage := {
790 procedureCode := id_InitialUE_Message,
791 criticality := ignore,
792 value_ := {
793 initialUE_Message := {
794 protocolIEs := {
795 {
796 id := id_CN_DomainIndicator,
797 criticality := ignore,
798 value_ := {
799 cN_DomainIndicator := cs_domain
800 }
801 }, {
802 id := id_LAI,
803 criticality := ignore,
804 value_ := {
805 lAI := lai
806 }
807 }, {
808 id := id_SAI,
809 criticality := ignore,
810 value_ := {
811 sAI := sai
812 }
813 }, {
814 id := id_NAS_PDU,
815 criticality := ignore,
816 value_ := {
817 nAS_PDU := nas
818 }
819 }, {
820 id := id_IuSigConId,
821 criticality := ignore,
822 value_ := {
823 iuSignallingConnectionIdentifier := sigc_id
824 }
825 }, {
826 id := id_GlobalRNC_ID,
827 criticality := ignore,
828 value_ := {
829 globalRNC_ID := grnc_id
830 }
831 }
832 },
833 protocolExtensions := exts
834 }
835 }
836 }
837}
838template RANAP_PDU
839tr_RANAP_initialUE_CS(template LAI lai, template SAI sai,
840 template NAS_PDU nas,
841 template IuSignallingConnectionIdentifier sigc_id,
842 template GlobalRNC_ID grnc_id,
843 template InitialUE_Message.protocolExtensions exts := *) := {
844 initiatingMessage := {
845 procedureCode := id_InitialUE_Message,
846 criticality := ignore,
847 value_ := {
848 initialUE_Message := {
849 protocolIEs := {
850 {
851 id := id_CN_DomainIndicator,
852 criticality := ignore,
853 value_ := {
854 cN_DomainIndicator := cs_domain
855 }
856 }, {
857 id := id_LAI,
858 criticality := ignore,
859 value_ := {
860 lAI := lai
861 }
862 }, {
863 id := id_SAI,
864 criticality := ignore,
865 value_ := {
866 sAI := sai
867 }
868 }, {
869 id := id_NAS_PDU,
870 criticality := ignore,
871 value_ := {
872 nAS_PDU := nas
873 }
874 }, {
875 id := id_IuSigConId,
876 criticality := ignore,
877 value_ := {
878 iuSignallingConnectionIdentifier := sigc_id
879 }
880 }, {
881 id := id_GlobalRNC_ID,
882 criticality := ignore,
883 value_ := {
884 globalRNC_ID := grnc_id
885 }
886 }
887 },
888 protocolExtensions := exts
889 }
890 }
891 }
892}
893
894template (value) RANAP_PDU
895ts_RANAP_initialUE_PS(template (value) LAI lai, template (value) RAC rac, template (value) SAI sai,
896 template (value) NAS_PDU nas,
897 template (value) IuSignallingConnectionIdentifier sigc_id,
898 template (value) GlobalRNC_ID grnc_id,
899 template (omit) InitialUE_Message.protocolExtensions exts := omit) := {
900 initiatingMessage := {
901 procedureCode := id_InitialUE_Message,
902 criticality := ignore,
903 value_ := {
904 initialUE_Message := {
905 protocolIEs := {
906 {
907 id := id_CN_DomainIndicator,
908 criticality := ignore,
909 value_ := {
910 cN_DomainIndicator := ps_domain
911 }
912 }, {
913 id := id_LAI,
914 criticality := ignore,
915 value_ := {
916 lAI := lai
917 }
918 }, {
919 id := id_RAC,
920 criticality := ignore,
921 value_ := {
922 rAC := rac
923 }
924 }, {
925 id := id_SAI,
926 criticality := ignore,
927 value_ := {
928 sAI := sai
929 }
930 }, {
931 id := id_NAS_PDU,
932 criticality := ignore,
933 value_ := {
934 nAS_PDU := nas
935 }
936 }, {
937 id := id_IuSigConId,
938 criticality := ignore,
939 value_ := {
940 iuSignallingConnectionIdentifier := sigc_id
941 }
942 }, {
943 id := id_GlobalRNC_ID,
944 criticality := ignore,
945 value_ := {
946 globalRNC_ID := grnc_id
947 }
948 }
949 },
950 protocolExtensions := exts
951 }
952 }
953 }
954}
955template RANAP_PDU
956tr_RANAP_initialUE_PS(template LAI lai, template RAC rac, template SAI sai,
957 template NAS_PDU nas,
958 template IuSignallingConnectionIdentifier sigc_id,
959 template GlobalRNC_ID grnc_id,
960 template InitialUE_Message.protocolExtensions exts := *) := {
961 initiatingMessage := {
962 procedureCode := id_InitialUE_Message,
963 criticality := ignore,
964 value_ := {
965 initialUE_Message := {
966 protocolIEs := {
967 {
968 id := id_CN_DomainIndicator,
969 criticality := ignore,
970 value_ := {
971 cN_DomainIndicator := ps_domain
972 }
973 }, {
974 id := id_LAI,
975 criticality := ignore,
976 value_ := {
977 lAI := lai
978 }
979 }, {
980 id := id_RAC,
981 criticality := ignore,
982 value_ := {
983 rAC := rac
984 }
985 }, {
986 id := id_SAI,
987 criticality := ignore,
988 value_ := {
989 sAI := sai
990 }
991 }, {
992 id := id_NAS_PDU,
993 criticality := ignore,
994 value_ := {
995 nAS_PDU := nas
996 }
997 }, {
998 id := id_IuSigConId,
999 criticality := ignore,
1000 value_ := {
1001 iuSignallingConnectionIdentifier := sigc_id
1002 }
1003 }, {
1004 id := id_GlobalRNC_ID,
1005 criticality := ignore,
1006 value_ := {
1007 globalRNC_ID := grnc_id
1008 }
1009 }
1010 },
1011 protocolExtensions := exts
1012 }
1013 }
1014 }
1015}
1016
1017/*****************************************************************************************************
1018 * Direct Transfer
1019 *****************************************************************************************************/
1020
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001021private function f_gen_ts_dt_ies(template (value) NAS_PDU nas,
1022 template (omit) SAPI sapi,
1023 template (value) DirectTransfer.protocolIEs opt_ies)
1024return DirectTransfer.protocolIEs {
1025 var DirectTransfer.protocolIEs ies := {
1026 /* NAS PDU is mandatory */
1027 {
1028 id := id_NAS_PDU,
1029 criticality := ignore,
1030 value_ := {
1031 nAS_PDU := valueof(nas)
1032 }
1033 }
1034 };
1035
1036 /* Optional IEs, e.g. LAI, RAC, SAI */
1037 ies := ies & valueof(opt_ies);
1038
1039 /* Optional SAPI is the last IE */
1040 if (isvalue(sapi)) {
1041 ies := ies & {{
1042 id := id_SAPI,
1043 criticality := ignore,
1044 value_ := {
1045 sAPI := valueof(sapi)
1046 }
1047 }};
1048 }
1049
1050 return ies;
1051}
1052
1053private function f_gen_tr_dt_ies(template NAS_PDU nas,
1054 template SAPI sapi,
1055 template DirectTransfer.protocolIEs opt_ies)
1056return template DirectTransfer.protocolIEs {
1057 var template DirectTransfer.protocolIEs ies := {
1058 /* NAS PDU is mandatory */
1059 {
1060 id := id_NAS_PDU,
1061 criticality := ignore,
1062 value_ := {
1063 nAS_PDU := nas
1064 }
1065 }
1066 };
1067
1068 /* Optional IEs start from index 1 */
1069 var integer idx := 1;
1070
1071 /* Optional IEs, e.g. LAI, RAC, SAI */
1072 if (istemplatekind(opt_ies, "*")) {
1073 ies[idx] := *;
1074 idx := idx + 1;
1075 } else if (not istemplatekind(opt_ies, "omit")) {
1076 for (var integer i := 0; i < lengthof(opt_ies); i := i + 1) {
1077 ies[idx] := opt_ies[idx];
1078 idx := idx + 1;
1079 }
1080 }
1081
1082 /* Optional SAPI is the last IE */
1083 if (istemplatekind(sapi, "*")) {
1084 ies[idx] := *;
1085 } else if (not istemplatekind(sapi, "omit")) {
1086 ies[idx] := {
1087 id := id_SAPI,
1088 criticality := ignore,
1089 value_ := {
1090 sAPI := sapi
1091 }
1092 };
1093 }
1094
1095 return ies;
1096}
1097
Harald Weltea013e682018-06-18 19:49:39 +02001098template (value) RANAP_PDU
1099ts_RANAP_DirectTransfer(template (value) NAS_PDU nas,
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001100 template (omit) SAPI sapi := omit,
1101 template (value) DirectTransfer.protocolIEs ies := {},
Harald Weltea013e682018-06-18 19:49:39 +02001102 template (omit) DirectTransfer.protocolExtensions exts := omit) := {
1103 initiatingMessage := {
1104 procedureCode := id_DirectTransfer,
1105 criticality := ignore,
1106 value_ := {
1107 directTransfer := {
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001108 protocolIEs := f_gen_ts_dt_ies(nas, sapi, ies),
Harald Weltea013e682018-06-18 19:49:39 +02001109 protocolExtensions := exts
1110 }
1111 }
1112 }
1113}
1114template RANAP_PDU
1115tr_RANAP_DirectTransfer(template NAS_PDU nas,
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001116 template SAPI sapi := *,
1117 template DirectTransfer.protocolIEs ies := *,
Harald Weltea013e682018-06-18 19:49:39 +02001118 template DirectTransfer.protocolExtensions exts := *) := {
1119 initiatingMessage := {
1120 procedureCode := id_DirectTransfer,
1121 criticality := ignore,
1122 value_ := {
1123 directTransfer := {
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001124 protocolIEs := f_gen_tr_dt_ies(nas, sapi, ies),
Harald Weltea013e682018-06-18 19:49:39 +02001125 protocolExtensions := exts
1126 }
1127 }
1128 }
1129}
1130
1131
1132/*****************************************************************************************************
1133 * RAB Assignment Request
1134 *****************************************************************************************************/
1135
1136template (value) RAB_Parameters ts_RabParams := {
1137 trafficClass := conversational,
1138 rAB_AsymmetryIndicator := symmetric_bidirectional,
1139 maxBitrate := { 12200 },
1140 guaranteedBitRate := { 12200 },
1141 deliveryOrder := delivery_order_requested,
1142 maxSDU_Size := 244,
1143 sDU_Parameters := {
1144 {
1145 sDU_ErrorRatio := { mantissa := 1, exponent := 5, iE_Extensions := omit },
1146 residualBitErrorRatio := { mantissa := 1, exponent := 6, iE_Extensions := omit },
1147 deliveryOfErroneousSDU := yes,
1148 sDU_FormatInformationParameters := {
1149 {
1150 subflowSDU_Size := 81,
1151 rAB_SubflowCombinationBitRate := omit,
1152 iE_Extensions := omit
1153 }, {
1154 subflowSDU_Size := 39,
1155 rAB_SubflowCombinationBitRate := omit,
1156 iE_Extensions := omit
1157 }
1158 },
1159 iE_Extensions := omit
1160 }, {
1161 sDU_ErrorRatio := omit,
1162 residualBitErrorRatio := { mantissa := 1, exponent := 3, iE_Extensions := omit },
1163 deliveryOfErroneousSDU := no_error_detection_consideration,
1164 sDU_FormatInformationParameters := {
1165 {
1166 subflowSDU_Size := 103,
1167 rAB_SubflowCombinationBitRate := omit,
1168 iE_Extensions := omit
1169 }, {
1170 subflowSDU_Size := 0,
1171 rAB_SubflowCombinationBitRate := omit,
1172 iE_Extensions := omit
1173 }
1174 },
1175 iE_Extensions := omit
1176 }, {
1177 sDU_ErrorRatio := omit,
1178 residualBitErrorRatio := { mantissa := 5, exponent := 3, iE_Extensions := omit },
1179 deliveryOfErroneousSDU := no_error_detection_consideration,
1180 sDU_FormatInformationParameters := {
1181 {
1182 subflowSDU_Size := 60,
1183 rAB_SubflowCombinationBitRate := omit,
1184 iE_Extensions := omit
1185 }, {
1186 subflowSDU_Size := 0,
1187 rAB_SubflowCombinationBitRate := omit,
1188 iE_Extensions := omit
1189 }
1190 },
1191 iE_Extensions := omit
1192 }
1193 },
1194 transferDelay := 80,
1195 trafficHandlingPriority := omit,
1196 allocationOrRetentionPriority := {
1197 priorityLevel := 15,
1198 pre_emptionCapability := shall_not_trigger_pre_emption,
1199 pre_emptionVulnerability := pre_emptable,
1200 queuingAllowed := queueing_not_allowed,
1201 iE_Extensions := omit
1202 },
1203 sourceStatisticsDescriptor := omit,
1204 relocationRequirement := omit,
1205 iE_Extensions := omit
1206}
1207
1208template (value) UserPlaneInformation ts_UserPlaneInfo := {
1209 userPlaneMode := support_mode_for_predefined_SDU_sizes,
1210 uP_ModeVersions := '0000000000000010'B,
1211 iE_Extensions := omit
1212}
1213
1214template (value) TransportLayerInformation ts_TLI(template (value) TransportLayerAddress tla,
1215 template (value) BindingID binding_id) := {
1216 transportLayerAddress := tla,
1217 iuTransportAssociation := {
1218 bindingID := binding_id
1219 },
1220 iE_Extensions := omit
1221}
1222template TransportLayerInformation tr_TLI(template TransportLayerAddress tla,
1223 template BindingID binding_id) := {
1224 transportLayerAddress := tla,
1225 iuTransportAssociation := {
1226 bindingID := binding_id
1227 },
1228 iE_Extensions := *
1229}
1230
1231template (value) RAB_SetupOrModifyList ts_RAB_SML(template (value) RAB_ID rab_id,
1232 template (value) TransportLayerAddress tla,
1233 template (value) BindingID binding_id) := { {
1234 {
1235 id := id_RAB_SetupOrModifyItem,
1236 firstCriticality := reject,
1237 firstValue := {
1238 rAB_SetupOrModifyItemFirst := {
1239 rAB_ID := rab_id,
1240 nAS_SynchronisationIndicator := omit,
1241 rAB_Parameters := ts_RabParams,
1242 userPlaneInformation := ts_UserPlaneInfo,
1243 transportLayerInformation := ts_TLI(tla, binding_id),
1244 service_Handover := omit,
1245 iE_Extensions := omit
1246 }
1247 },
1248 secondCriticality := ignore,
1249 secondValue := {
1250 rAB_SetupOrModifyItemSecond := {
1251 pDP_TypeInformation := omit,
1252 dataVolumeReportingIndication := omit,
1253 dl_GTP_PDU_SequenceNumber := omit,
1254 ul_GTP_PDU_SequenceNumber := omit,
1255 dl_N_PDU_SequenceNumber := omit,
1256 ul_N_PDU_SequenceNumber := omit,
1257 iE_Extensions := omit
1258 }
1259 }
1260 }
1261} }
Daniel Willmann95263ca2022-02-15 09:55:18 +01001262template RAB_SetupOrModifyList tr_RAB_SML(template (present) RAB_ID rab_id,
Harald Weltea013e682018-06-18 19:49:39 +02001263 template TransportLayerAddress tla,
1264 template BindingID binding_id) := { {
1265 {
1266 id := id_RAB_SetupOrModifyItem,
1267 firstCriticality := reject,
1268 firstValue := {
1269 rAB_SetupOrModifyItemFirst := {
1270 rAB_ID := rab_id,
1271 nAS_SynchronisationIndicator := *,
1272 rAB_Parameters := ts_RabParams,
1273 userPlaneInformation := ts_UserPlaneInfo,
1274 transportLayerInformation := tr_TLI(tla, binding_id),
1275 service_Handover := *,
1276 iE_Extensions := *
1277 }
1278 },
1279 secondCriticality := ignore,
1280 secondValue := {
1281 rAB_SetupOrModifyItemSecond := {
1282 pDP_TypeInformation := omit,
1283 dataVolumeReportingIndication := omit,
1284 dl_GTP_PDU_SequenceNumber := omit,
1285 ul_GTP_PDU_SequenceNumber := omit,
1286 dl_N_PDU_SequenceNumber := omit,
1287 ul_N_PDU_SequenceNumber := omit,
1288 iE_Extensions := omit
1289 }
1290 }
1291 }
1292} }
1293
Neels Hofmeyra56e8fd2022-05-08 01:16:55 +02001294template (value) TransportLayerInformation ts_TLI_ps(template (value) TransportLayerAddress tla,
1295 template (value) GTP_TEI gtp_tei) := {
1296 transportLayerAddress := tla,
1297 iuTransportAssociation := {
1298 gTP_TEI := gtp_tei
1299 },
1300 iE_Extensions := omit
1301}
1302template TransportLayerInformation tr_TLI_ps(template TransportLayerAddress tla,
1303 template (value) GTP_TEI gtp_tei) := {
1304 transportLayerAddress := tla,
1305 iuTransportAssociation := {
1306 gTP_TEI := gtp_tei
1307 },
1308 iE_Extensions := *
1309}
1310
1311template (value) RAB_SetupOrModifyList ts_RAB_SML_ps(template (value) RAB_ID rab_id,
1312 template (value) TransportLayerAddress tla,
1313 template (value) GTP_TEI gtp_tei) := { {
1314 {
1315 id := id_RAB_SetupOrModifyItem,
1316 firstCriticality := reject,
1317 firstValue := {
1318 rAB_SetupOrModifyItemFirst := {
1319 rAB_ID := rab_id,
1320 nAS_SynchronisationIndicator := omit,
1321 rAB_Parameters := ts_RabParams,
1322 userPlaneInformation := ts_UserPlaneInfo,
1323 transportLayerInformation := ts_TLI_ps(tla, gtp_tei),
1324 service_Handover := omit,
1325 iE_Extensions := omit
1326 }
1327 },
1328 secondCriticality := ignore,
1329 secondValue := {
1330 rAB_SetupOrModifyItemSecond := {
1331 pDP_TypeInformation := omit,
1332 dataVolumeReportingIndication := omit,
1333 dl_GTP_PDU_SequenceNumber := omit,
1334 ul_GTP_PDU_SequenceNumber := omit,
1335 dl_N_PDU_SequenceNumber := omit,
1336 ul_N_PDU_SequenceNumber := omit,
1337 iE_Extensions := omit
1338 }
1339 }
1340 }
1341} }
1342template RAB_SetupOrModifyList tr_RAB_SML_ps(template (present) RAB_ID rab_id,
1343 template TransportLayerAddress tla,
1344 template (value) GTP_TEI gtp_tei) := { {
1345 {
1346 id := id_RAB_SetupOrModifyItem,
1347 firstCriticality := reject,
1348 firstValue := {
1349 rAB_SetupOrModifyItemFirst := {
1350 rAB_ID := rab_id,
1351 nAS_SynchronisationIndicator := *,
1352 rAB_Parameters := ts_RabParams,
1353 userPlaneInformation := ts_UserPlaneInfo,
1354 transportLayerInformation := tr_TLI_ps(tla, gtp_tei),
1355 service_Handover := *,
1356 iE_Extensions := *
1357 }
1358 },
1359 secondCriticality := ignore,
1360 secondValue := {
1361 rAB_SetupOrModifyItemSecond := {
1362 pDP_TypeInformation := omit,
1363 dataVolumeReportingIndication := omit,
1364 dl_GTP_PDU_SequenceNumber := omit,
1365 ul_GTP_PDU_SequenceNumber := omit,
1366 dl_N_PDU_SequenceNumber := omit,
1367 ul_N_PDU_SequenceNumber := omit,
1368 iE_Extensions := omit
1369 }
1370 }
1371 }
1372} }
1373
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01001374template (value) RAB_SetupOrModifiedList ts_RAB_SMdL(template (value) RAB_ID rab_id,
1375 template (value) TransportLayerAddress tla,
1376 template (value) BindingID binding_id) := { {
1377 {
1378 id := id_RAB_SetupOrModifiedItem,
1379 criticality := ignore,
1380 value_ := {
1381 rAB_SetupOrModifiedItem := {
1382 rAB_ID := rab_id,
1383 transportLayerAddress := tla,
1384 iuTransportAssociation := {
1385 bindingID := binding_id
1386 },
1387 dl_dataVolumes := omit,
1388 iE_Extensions := omit
1389 }
1390 }
1391 }
1392} }
1393
Neels Hofmeyra56e8fd2022-05-08 01:16:55 +02001394template (value) RAB_SetupOrModifiedList ts_RAB_SMdL_ps(template (value) RAB_ID rab_id,
1395 template (value) TransportLayerAddress tla,
1396 template (value) GTP_TEI gtp_tei) := { {
1397 {
1398 id := id_RAB_SetupOrModifiedItem,
1399 criticality := ignore,
1400 value_ := {
1401 rAB_SetupOrModifiedItem := {
1402 rAB_ID := rab_id,
1403 transportLayerAddress := tla,
1404 iuTransportAssociation := {
1405 gTP_TEI := gtp_tei
1406 },
1407 dl_dataVolumes := omit,
1408 iE_Extensions := omit
1409 }
1410 }
1411 }
1412} }
1413
Daniel Willmann95263ca2022-02-15 09:55:18 +01001414template RAB_SetupOrModifiedList tr_RAB_SMdL(template (present) RAB_ID rab_id,
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01001415 template TransportLayerAddress tla,
1416 template 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 := *,
1428 iE_Extensions := *
1429 }
1430 }
1431 }
1432} }
Harald Weltea013e682018-06-18 19:49:39 +02001433
Philipp Maier6289ea82022-02-09 15:30:11 +01001434template (value) RAB_FailedList ts_RAB_FL(template (value) RAB_ID rab_id,
1435 template (value) Cause cause) := { {
1436 {
1437 id := id_RAB_FailedItem,
1438 criticality := ignore,
1439 value_ := {
1440 rAB_FailedItem := {
1441 rAB_ID := rab_id,
1442 cause := cause,
1443 iE_Extensions := omit
1444 }
1445 }
1446 }
1447} }
1448
1449template RAB_FailedList tr_RAB_FL(template RAB_ID rab_id,
1450 template Cause cause) := { {
1451 {
1452 id := id_RAB_FailedItem,
1453 criticality := ignore,
1454 value_ := {
1455 rAB_FailedItem := {
1456 rAB_ID := rab_id,
1457 cause := cause,
1458 iE_Extensions := *
1459 }
1460 }
1461 }
1462} }
1463
Daniel Willmann9e789be2022-02-22 13:30:51 +01001464template (value) RAB_ReleaseList ts_RAB_RL(template (value) RAB_ID rab_id,
1465 template (value) Cause cause) := { {
1466 {
1467 id := id_RAB_ReleaseItem,
1468 criticality := ignore,
1469 value_ := {
1470 rAB_ReleaseItem := {
1471 rAB_ID := rab_id,
1472 cause := cause,
1473 iE_Extensions := omit
1474 }
1475 }
1476 }
1477} }
1478
1479template RAB_ReleaseList tr_RAB_RL(template (present) RAB_ID rab_id,
1480 template Cause cause := ?) := { {
1481 {
1482 id := id_RAB_ReleaseItem,
1483 criticality := ignore,
1484 value_ := {
1485 rAB_ReleaseItem := {
1486 rAB_ID := rab_id,
1487 cause := cause,
1488 iE_Extensions := *
1489 }
1490 }
1491 }
1492} }
1493
1494
1495function
1496ts_RANAP_RabAssReq(template (omit) RAB_SetupOrModifyList rab_sml := omit,
1497 template (omit) RAB_ReleaseList rab_rl := omit,
1498 template (omit) RAB_AssignmentRequest.protocolExtensions exts := omit) return template RANAP_PDU {
1499 var template RANAP_PDU ret;
1500 var template RAB_AssignmentRequest.protocolIEs protocolIEs := {};
1501 var integer ie_pos := 0;
1502
1503 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml;
1504 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl;
1505
1506 /* RAB-SetupOrModifyList */
1507 if (istemplatekind(rab_sml, "value")) {
1508 protocolIEs_rab_sml := {
1509 {
1510 id := id_RAB_SetupOrModifyList,
1511 criticality := ignore,
1512 value_ := {
1513 rAB_SetupOrModifyList := rab_sml
1514 }
1515 }
1516 };
1517 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1518 ie_pos := ie_pos + 1;
1519 }
1520
1521 /* RAB-ReleaseList */
1522 if (istemplatekind(rab_rl, "value")) {
1523 protocolIEs_rab_rl := {
1524 {
1525 id := id_RAB_ReleaseList,
1526 criticality := ignore,
1527 value_ := {
1528 rAB_ReleaseList := rab_rl
1529 }
1530 }
1531 };
1532 protocolIEs[ie_pos] := protocolIEs_rab_rl[0];
1533 ie_pos := ie_pos + 1;
1534 }
1535
1536
1537 ret.initiatingMessage := {
Harald Weltea013e682018-06-18 19:49:39 +02001538 procedureCode := id_RAB_Assignment,
1539 criticality := reject,
1540 value_ := {
1541 rAB_AssignmentRequest := {
Daniel Willmann9e789be2022-02-22 13:30:51 +01001542 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001543 protocolExtensions := exts
1544 }
1545 }
1546 }
Daniel Willmann9e789be2022-02-22 13:30:51 +01001547
1548 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001549}
Daniel Willmann9e789be2022-02-22 13:30:51 +01001550
1551function
1552tr_RANAP_RabAssReq(template RAB_SetupOrModifyList rab_sml := omit,
1553 template RAB_ReleaseList rab_rl := omit,
1554 template RAB_AssignmentRequest.protocolExtensions exts := *) return template RANAP_PDU {
1555 var template RANAP_PDU ret;
1556 var template RAB_AssignmentRequest.protocolIEs protocolIEs := {};
1557 var integer ie_pos := 0;
1558
1559 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml;
1560 var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl;
1561
1562 /* RAB-SetupOrModifyList */
1563 if (not istemplatekind(rab_sml, "omit")) {
1564 protocolIEs_rab_sml := {
1565 {
1566 id := id_RAB_SetupOrModifyList,
1567 criticality := ignore,
1568 value_ := {
1569 rAB_SetupOrModifyList := rab_sml
1570 }
1571 }
1572 };
1573 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1574 ie_pos := ie_pos + 1;
1575 }
1576
1577 /* RAB-ReleaseList */
1578 if (not istemplatekind(rab_rl, "omit")) {
1579 protocolIEs_rab_rl := {
1580 {
1581 id := id_RAB_ReleaseList,
1582 criticality := ignore,
1583 value_ := {
1584 rAB_ReleaseList := rab_rl
1585 }
1586 }
1587 };
1588 protocolIEs[ie_pos] := protocolIEs_rab_rl[0];
1589 ie_pos := ie_pos + 1;
1590 }
1591
1592
1593 ret.initiatingMessage := {
Harald Weltea013e682018-06-18 19:49:39 +02001594 procedureCode := id_RAB_Assignment,
1595 criticality := reject,
1596 value_ := {
1597 rAB_AssignmentRequest := {
Daniel Willmann9e789be2022-02-22 13:30:51 +01001598 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001599 protocolExtensions := exts
1600 }
1601 }
1602 }
Daniel Willmann9e789be2022-02-22 13:30:51 +01001603
1604 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001605}
1606
Philipp Maier6289ea82022-02-09 15:30:11 +01001607function
1608ts_RANAP_RabAssResp(template (omit) RAB_SetupOrModifiedList rab_sml := omit,
1609 template (omit) RAB_FailedList rab_fl := omit,
1610 template (omit) RAB_AssignmentResponse.protocolExtensions exts := omit) return template RANAP_PDU {
1611 var template RANAP_PDU ret;
1612 var template RAB_AssignmentResponse.protocolIEs protocolIEs := {};
1613 var integer ie_pos := 0;
Harald Weltea013e682018-06-18 19:49:39 +02001614
Philipp Maier6289ea82022-02-09 15:30:11 +01001615 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml;
1616 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
1617
1618 /* RAB-SetupOrModifiedList */
1619 if (istemplatekind(rab_sml, "value")) {
1620 protocolIEs_rab_sml := {
1621 {
1622 id := id_RAB_SetupOrModifiedList,
1623 criticality := ignore,
1624 value_ := {
1625 rAB_SetupOrModifiedList := rab_sml
1626 }
1627 }
1628 }
1629
1630 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1631 ie_pos := ie_pos + 1;
1632 }
1633
1634 /* TODO: RAB-ReleasedList */
1635 /* TODO: RAB-QueuedList */
1636
1637 /* RAB-FailedList */
1638 if (istemplatekind(rab_fl, "value")) {
1639 protocolIEs_rab_fl := {
1640 {
1641 id := id_RAB_FailedList,
1642 criticality := ignore,
1643 value_ := {
1644 rAB_FailedList := rab_fl
1645 }
1646 }
1647 }
1648
1649 protocolIEs[ie_pos] := protocolIEs_rab_fl[0];
1650 ie_pos := ie_pos + 1;
1651 }
1652
1653 /* TODO: RAB-ReleaseFailedList */
1654
1655 ret.outcome := {
Harald Weltea013e682018-06-18 19:49:39 +02001656 procedureCode := id_RAB_Assignment,
1657 criticality := reject,
1658 value_ := {
1659 rAB_AssignmentResponse := {
Philipp Maier6289ea82022-02-09 15:30:11 +01001660 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001661 protocolExtensions := exts
1662 }
1663 }
1664 }
Philipp Maier6289ea82022-02-09 15:30:11 +01001665
1666 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001667}
Philipp Maier6289ea82022-02-09 15:30:11 +01001668
1669function
1670tr_RANAP_RabAssResp(template RAB_SetupOrModifiedList rab_sml := omit,
1671 template RAB_FailedList rab_fl := omit,
1672 template RAB_AssignmentResponse.protocolExtensions exts := *) return template RANAP_PDU {
1673 var template RANAP_PDU ret;
1674 var template RAB_AssignmentResponse.protocolIEs protocolIEs := {};
1675 var integer ie_pos := 0;
1676
1677 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml;
1678 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
1679
1680 /* RAB-SetupOrModifiedList */
1681 if (not istemplatekind(rab_sml, "omit")) {
1682 protocolIEs_rab_sml := {
1683 {
1684 id := id_RAB_SetupOrModifiedList,
1685 criticality := ignore,
1686 value_ := {
1687 rAB_SetupOrModifiedList := rab_sml
1688 }
1689 }
1690 }
1691
1692 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1693 ie_pos := ie_pos + 1;
1694 }
1695
1696 /* TODO: RAB-ReleasedList */
1697 /* TODO: RAB-QueuedList */
1698
1699 /* RAB-FailedList */
1700 if (not istemplatekind(rab_fl, "omit")) {
1701 protocolIEs_rab_fl := {
1702 {
1703 id := id_RAB_FailedList,
1704 criticality := ignore,
1705 value_ := {
1706 rAB_FailedList := rab_fl
1707 }
1708 }
1709 }
1710
1711 protocolIEs[ie_pos] := protocolIEs_rab_fl[0];
1712 ie_pos := ie_pos + 1;
1713 }
1714
1715 /* TODO: RAB-ReleaseFailedList */
1716
1717 protocolIEs[ie_pos] := *;
1718
1719 ret.outcome := {
Harald Weltea013e682018-06-18 19:49:39 +02001720 procedureCode := id_RAB_Assignment,
1721 criticality := reject,
1722 value_ := {
1723 rAB_AssignmentResponse := {
Philipp Maier6289ea82022-02-09 15:30:11 +01001724 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001725 protocolExtensions := exts
1726 }
1727 }
1728 }
Philipp Maier6289ea82022-02-09 15:30:11 +01001729
1730 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001731}
1732
Harald Weltea013e682018-06-18 19:49:39 +02001733/*****************************************************************************************************
1734 *
1735 *****************************************************************************************************/
1736
1737/* extract the L3 (NAS) from a given RANAP message */
1738function f_ranap_extract_l3(RANAP_PDU ranap) return template (omit) octetstring
1739{
1740 var integer i;
1741
1742 if (match(ranap, tr_RANAP_initialUE_CS(?, ?, ?, ?, ?)) or
1743 match(ranap, tr_RANAP_initialUE_PS(?, ?, ?, ?, ?, ?)) ) {
1744 var InitialUE_Message.protocolIEs ies := ranap.initiatingMessage.value_.initialUE_Message.protocolIEs;
1745 for (i := 0; i < lengthof(ies); i := i+1) {
1746 if (ies[i].id == id_NAS_PDU) {
1747 return ies[i].value_.nAS_PDU;
1748 }
1749 }
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001750 } else if (match(ranap, tr_RANAP_DirectTransfer(?))) {
Harald Weltea013e682018-06-18 19:49:39 +02001751 var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs;
1752 for (i := 0; i < lengthof(ies); i := i+1) {
1753 if (ies[i].id == id_NAS_PDU) {
1754 return ies[i].value_.nAS_PDU;
1755 }
1756 }
1757 } else {
1758 /* relocationInformation not supported yet*/
1759 }
1760 return omit;
1761}
1762
1763function f_ranap_extract_sapi(RANAP_PDU ranap) return template (omit) SAPI
1764{
1765 var integer i;
1766
1767 /* InitialUE message has no SAPI */
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001768 if (match(ranap, tr_RANAP_DirectTransfer(?, omit))) {
Harald Weltea013e682018-06-18 19:49:39 +02001769 var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs;
1770 for (i := 0; i < lengthof(ies); i := i+1) {
1771 if (ies[i].id == id_SAPI) {
1772 return ies[i].value_.sAPI;
1773 }
1774 }
1775 }
1776 return omit;
1777}
1778
1779
1780}