blob: caccdc76d73f24f9176397888c8fe41a5a9297c7 [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
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01001294template (value) RAB_SetupOrModifiedList ts_RAB_SMdL(template (value) RAB_ID rab_id,
1295 template (value) TransportLayerAddress tla,
1296 template (value) BindingID binding_id) := { {
1297 {
1298 id := id_RAB_SetupOrModifiedItem,
1299 criticality := ignore,
1300 value_ := {
1301 rAB_SetupOrModifiedItem := {
1302 rAB_ID := rab_id,
1303 transportLayerAddress := tla,
1304 iuTransportAssociation := {
1305 bindingID := binding_id
1306 },
1307 dl_dataVolumes := omit,
1308 iE_Extensions := omit
1309 }
1310 }
1311 }
1312} }
1313
Daniel Willmann95263ca2022-02-15 09:55:18 +01001314template RAB_SetupOrModifiedList tr_RAB_SMdL(template (present) RAB_ID rab_id,
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01001315 template TransportLayerAddress tla,
1316 template BindingID binding_id) := { {
1317 {
1318 id := id_RAB_SetupOrModifiedItem,
1319 criticality := ignore,
1320 value_ := {
1321 rAB_SetupOrModifiedItem := {
1322 rAB_ID := rab_id,
1323 transportLayerAddress := tla,
1324 iuTransportAssociation := {
1325 bindingID := binding_id
1326 },
1327 dl_dataVolumes := *,
1328 iE_Extensions := *
1329 }
1330 }
1331 }
1332} }
Harald Weltea013e682018-06-18 19:49:39 +02001333
Philipp Maier6289ea82022-02-09 15:30:11 +01001334template (value) RAB_FailedList ts_RAB_FL(template (value) RAB_ID rab_id,
1335 template (value) Cause cause) := { {
1336 {
1337 id := id_RAB_FailedItem,
1338 criticality := ignore,
1339 value_ := {
1340 rAB_FailedItem := {
1341 rAB_ID := rab_id,
1342 cause := cause,
1343 iE_Extensions := omit
1344 }
1345 }
1346 }
1347} }
1348
1349template RAB_FailedList tr_RAB_FL(template RAB_ID rab_id,
1350 template Cause cause) := { {
1351 {
1352 id := id_RAB_FailedItem,
1353 criticality := ignore,
1354 value_ := {
1355 rAB_FailedItem := {
1356 rAB_ID := rab_id,
1357 cause := cause,
1358 iE_Extensions := *
1359 }
1360 }
1361 }
1362} }
1363
Harald Weltea013e682018-06-18 19:49:39 +02001364template (value) RANAP_PDU
1365ts_RANAP_RabAssReq(template (value) RAB_SetupOrModifyList rab_sml,
1366 template (omit) RAB_AssignmentRequest.protocolExtensions exts := omit) := {
1367 initiatingMessage := {
1368 procedureCode := id_RAB_Assignment,
1369 criticality := reject,
1370 value_ := {
1371 rAB_AssignmentRequest := {
1372 protocolIEs := {
1373 {
1374 id := id_RAB_SetupOrModifyList,
Daniel Willmannfc5e17a2022-01-28 11:42:40 +01001375 criticality := ignore,
Harald Weltea013e682018-06-18 19:49:39 +02001376 value_ := {
1377 rAB_SetupOrModifyList := rab_sml
1378 }
1379 }
1380 },
1381 protocolExtensions := exts
1382 }
1383 }
1384 }
1385}
1386template RANAP_PDU
1387tr_RANAP_RabAssReq(template RAB_SetupOrModifyList rab_sml,
1388 template RAB_AssignmentRequest.protocolExtensions exts := *) := {
1389 initiatingMessage := {
1390 procedureCode := id_RAB_Assignment,
1391 criticality := reject,
1392 value_ := {
1393 rAB_AssignmentRequest := {
1394 protocolIEs := {
1395 {
1396 id := id_RAB_SetupOrModifyList,
Neels Hofmeyr0b16bf12019-11-03 05:10:12 +01001397 criticality := ignore,
Harald Weltea013e682018-06-18 19:49:39 +02001398 value_ := {
1399 rAB_SetupOrModifyList := rab_sml
1400 }
1401 }
1402 },
1403 protocolExtensions := exts
1404 }
1405 }
1406 }
1407}
1408
Philipp Maier6289ea82022-02-09 15:30:11 +01001409function
1410ts_RANAP_RabAssResp(template (omit) RAB_SetupOrModifiedList rab_sml := omit,
1411 template (omit) RAB_FailedList rab_fl := omit,
1412 template (omit) RAB_AssignmentResponse.protocolExtensions exts := omit) return template RANAP_PDU {
1413 var template RANAP_PDU ret;
1414 var template RAB_AssignmentResponse.protocolIEs protocolIEs := {};
1415 var integer ie_pos := 0;
Harald Weltea013e682018-06-18 19:49:39 +02001416
Philipp Maier6289ea82022-02-09 15:30:11 +01001417 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml;
1418 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
1419
1420 /* RAB-SetupOrModifiedList */
1421 if (istemplatekind(rab_sml, "value")) {
1422 protocolIEs_rab_sml := {
1423 {
1424 id := id_RAB_SetupOrModifiedList,
1425 criticality := ignore,
1426 value_ := {
1427 rAB_SetupOrModifiedList := rab_sml
1428 }
1429 }
1430 }
1431
1432 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1433 ie_pos := ie_pos + 1;
1434 }
1435
1436 /* TODO: RAB-ReleasedList */
1437 /* TODO: RAB-QueuedList */
1438
1439 /* RAB-FailedList */
1440 if (istemplatekind(rab_fl, "value")) {
1441 protocolIEs_rab_fl := {
1442 {
1443 id := id_RAB_FailedList,
1444 criticality := ignore,
1445 value_ := {
1446 rAB_FailedList := rab_fl
1447 }
1448 }
1449 }
1450
1451 protocolIEs[ie_pos] := protocolIEs_rab_fl[0];
1452 ie_pos := ie_pos + 1;
1453 }
1454
1455 /* TODO: RAB-ReleaseFailedList */
1456
1457 ret.outcome := {
Harald Weltea013e682018-06-18 19:49:39 +02001458 procedureCode := id_RAB_Assignment,
1459 criticality := reject,
1460 value_ := {
1461 rAB_AssignmentResponse := {
Philipp Maier6289ea82022-02-09 15:30:11 +01001462 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001463 protocolExtensions := exts
1464 }
1465 }
1466 }
Philipp Maier6289ea82022-02-09 15:30:11 +01001467
1468 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001469}
Philipp Maier6289ea82022-02-09 15:30:11 +01001470
1471function
1472tr_RANAP_RabAssResp(template RAB_SetupOrModifiedList rab_sml := omit,
1473 template RAB_FailedList rab_fl := omit,
1474 template RAB_AssignmentResponse.protocolExtensions exts := *) return template RANAP_PDU {
1475 var template RANAP_PDU ret;
1476 var template RAB_AssignmentResponse.protocolIEs protocolIEs := {};
1477 var integer ie_pos := 0;
1478
1479 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml;
1480 var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
1481
1482 /* RAB-SetupOrModifiedList */
1483 if (not istemplatekind(rab_sml, "omit")) {
1484 protocolIEs_rab_sml := {
1485 {
1486 id := id_RAB_SetupOrModifiedList,
1487 criticality := ignore,
1488 value_ := {
1489 rAB_SetupOrModifiedList := rab_sml
1490 }
1491 }
1492 }
1493
1494 protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
1495 ie_pos := ie_pos + 1;
1496 }
1497
1498 /* TODO: RAB-ReleasedList */
1499 /* TODO: RAB-QueuedList */
1500
1501 /* RAB-FailedList */
1502 if (not istemplatekind(rab_fl, "omit")) {
1503 protocolIEs_rab_fl := {
1504 {
1505 id := id_RAB_FailedList,
1506 criticality := ignore,
1507 value_ := {
1508 rAB_FailedList := rab_fl
1509 }
1510 }
1511 }
1512
1513 protocolIEs[ie_pos] := protocolIEs_rab_fl[0];
1514 ie_pos := ie_pos + 1;
1515 }
1516
1517 /* TODO: RAB-ReleaseFailedList */
1518
1519 protocolIEs[ie_pos] := *;
1520
1521 ret.outcome := {
Harald Weltea013e682018-06-18 19:49:39 +02001522 procedureCode := id_RAB_Assignment,
1523 criticality := reject,
1524 value_ := {
1525 rAB_AssignmentResponse := {
Philipp Maier6289ea82022-02-09 15:30:11 +01001526 protocolIEs := protocolIEs,
Harald Weltea013e682018-06-18 19:49:39 +02001527 protocolExtensions := exts
1528 }
1529 }
1530 }
Philipp Maier6289ea82022-02-09 15:30:11 +01001531
1532 return ret;
Harald Weltea013e682018-06-18 19:49:39 +02001533}
1534
Daniel Willmann1f2d7402022-02-09 13:45:29 +01001535template (value) RAB_ReleaseList ts_RAB_RL(template (value) RAB_ID rab_id,
1536 template (value) Cause cause) := { {
1537 {
1538 id := id_RAB_ReleaseItem,
1539 criticality := ignore,
1540 value_ := {
1541 rAB_ReleaseItem := {
1542 rAB_ID := rab_id,
1543 cause := cause,
1544 iE_Extensions := omit
1545 }
1546 }
1547 }
1548} }
1549
Daniel Willmann95263ca2022-02-15 09:55:18 +01001550template RAB_ReleaseList tr_RAB_RL(template (present) RAB_ID rab_id,
Daniel Willmann1f2d7402022-02-09 13:45:29 +01001551 template Cause cause := ?) := { {
1552 {
1553 id := id_RAB_ReleaseItem,
1554 criticality := ignore,
1555 value_ := {
1556 rAB_ReleaseItem := {
1557 rAB_ID := rab_id,
1558 cause := cause,
1559 iE_Extensions := *
1560 }
1561 }
1562 }
1563} }
1564
1565template (value) RANAP_PDU
Daniel Willmann7af5a2a2022-02-18 17:08:42 +01001566ts_RANAP_RabAssignmentReqRabRel(template (value) RAB_ReleaseList rab_rl,
1567 template (omit) RAB_AssignmentRequest.protocolExtensions exts := omit) := {
Daniel Willmann1f2d7402022-02-09 13:45:29 +01001568 initiatingMessage := {
1569 procedureCode := id_RAB_Assignment,
1570 criticality := reject,
1571 value_ := {
Daniel Willmann7af5a2a2022-02-18 17:08:42 +01001572 rAB_AssignmentRequest := {
Daniel Willmann1f2d7402022-02-09 13:45:29 +01001573 protocolIEs := {
1574 {
1575 id := id_RAB_ReleaseList,
1576 criticality := ignore,
1577 value_ := {
1578 rAB_ReleaseList := rab_rl
1579 }
1580 }
1581 },
1582 protocolExtensions := exts
1583 }
1584 }
1585 }
1586}
1587
1588template RANAP_PDU
Daniel Willmann7af5a2a2022-02-18 17:08:42 +01001589tr_RANAP_RabAssignmentReqRabRel(template RAB_ReleaseList rab_rl,
1590 template RAB_AssignmentRequest.protocolExtensions exts := *) := {
Daniel Willmann1f2d7402022-02-09 13:45:29 +01001591 initiatingMessage := {
1592 procedureCode := id_RAB_Assignment,
1593 criticality := reject,
1594 value_ := {
Daniel Willmann7af5a2a2022-02-18 17:08:42 +01001595 rAB_AssignmentRequest := {
Daniel Willmann1f2d7402022-02-09 13:45:29 +01001596 protocolIEs := {
1597 {
1598 id := id_RAB_ReleaseList,
1599 criticality := ignore,
1600 value_ := {
1601 rAB_ReleaseList := rab_rl
1602 }
1603 }
1604 },
1605 protocolExtensions := exts
1606 }
1607 }
1608 }
1609}
1610
Harald Weltea013e682018-06-18 19:49:39 +02001611/*****************************************************************************************************
1612 *
1613 *****************************************************************************************************/
1614
1615/* extract the L3 (NAS) from a given RANAP message */
1616function f_ranap_extract_l3(RANAP_PDU ranap) return template (omit) octetstring
1617{
1618 var integer i;
1619
1620 if (match(ranap, tr_RANAP_initialUE_CS(?, ?, ?, ?, ?)) or
1621 match(ranap, tr_RANAP_initialUE_PS(?, ?, ?, ?, ?, ?)) ) {
1622 var InitialUE_Message.protocolIEs ies := ranap.initiatingMessage.value_.initialUE_Message.protocolIEs;
1623 for (i := 0; i < lengthof(ies); i := i+1) {
1624 if (ies[i].id == id_NAS_PDU) {
1625 return ies[i].value_.nAS_PDU;
1626 }
1627 }
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001628 } else if (match(ranap, tr_RANAP_DirectTransfer(?))) {
Harald Weltea013e682018-06-18 19:49:39 +02001629 var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs;
1630 for (i := 0; i < lengthof(ies); i := i+1) {
1631 if (ies[i].id == id_NAS_PDU) {
1632 return ies[i].value_.nAS_PDU;
1633 }
1634 }
1635 } else {
1636 /* relocationInformation not supported yet*/
1637 }
1638 return omit;
1639}
1640
1641function f_ranap_extract_sapi(RANAP_PDU ranap) return template (omit) SAPI
1642{
1643 var integer i;
1644
1645 /* InitialUE message has no SAPI */
Vadim Yanitskiye06f2282019-06-20 05:02:49 +07001646 if (match(ranap, tr_RANAP_DirectTransfer(?, omit))) {
Harald Weltea013e682018-06-18 19:49:39 +02001647 var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs;
1648 for (i := 0; i < lengthof(ies); i := i+1) {
1649 if (ies[i].id == id_SAPI) {
1650 return ies[i].value_.sAPI;
1651 }
1652 }
1653 }
1654 return omit;
1655}
1656
1657
1658}