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