blob: f819862416cdabe298b22aa536ab9463178b8f96 [file] [log] [blame]
Harald Weltefc5f6372019-07-09 14:10:05 +08001/* EPC (Evolved Packet Core) NAS (Non-Access Stratum) templates in TTCN-3
2 * (C) 2019 Harald Welte <laforge@gnumonks.org>
3 * All rights reserved.
4 *
5 * Released under the terms of GNU General Public License, Version 2 or
6 * (at your option) any later version.
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11module NAS_Templates {
12
13import from General_Types all;
14import from NAS_EPS_Types all;
15
16template (value) PDU_NAS_EPS
17ts_NAS_SM(template (value) EPS_SessionManagement sm) := {
18 protocolDiscriminator := '0010'B,
19 ePS_messages := {
20 ePS_SessionManagement := sm
21 }
22}
23template (present) PDU_NAS_EPS
24tr_NAS_SM(template (present) EPS_SessionManagement sm) := {
25 protocolDiscriminator := '0010'B,
26 ePS_messages := {
27 ePS_SessionManagement := sm
28 }
29}
30
31template (value) PDU_NAS_EPS
32ts_NAS_MM(template (value) EPS_MobilityManagement mm) := {
33 protocolDiscriminator := c_EPS_NAS_PD_EMM,
34 ePS_messages := {
35 ePS_MobilityManagement := mm
36 }
37}
38template (present) PDU_NAS_EPS
39tr_NAS_MM(template (present) EPS_MobilityManagement mm) := {
40 protocolDiscriminator := c_EPS_NAS_PD_EMM,
41 ePS_messages := {
42 ePS_MobilityManagement := mm
43 }
44}
45
46const BIT4 c_EPS_SEC_NONE := '0000'B;
47const BIT4 c_EPS_NAS_PD_EMM := '0111'B;
48const BIT4 c_EPS_NAS_PD_ESM := '0010'B;
49
50private template (value) ESM_MessageContainerLVE
51ts_NAS_EsmMsgContLVE(template (value) octetstring inp) := {
52 lengthIndicator := 0,
53 content := inp
54}
55private template (present) ESM_MessageContainerLVE
56tr_NAS_EsmMsgContLVE(template (present) octetstring inp) := {
57 lengthIndicator := ?,
58 content := inp
59}
60
61private template (value) MobileIdentityLV
62ts_NAS_MobileIdLV(template (value) MobileIdentityV mid) := {
63 lengthIndicator := 0,
64 mobileIdentityV := mid
65}
66private template (present) MobileIdentityLV
67tr_NAS_MobileIdLV(template (present) MobileIdentityV mid) := {
68 lengthIndicator := ?,
69 mobileIdentityV := mid
70}
71
72private function f_enc_IMSI_NAS(hexstring digits) return IMSI {
73 var IMSI l3;
74 var integer len := lengthof(digits);
75 if (len rem 2 == 1) { /* modulo remainder */
76 l3.oddevenIndicator := '1'B;
77 l3.fillerDigit := omit;
78 } else {
79 l3.oddevenIndicator := '0'B;
80 l3.fillerDigit := '1111'B;
81 }
82 l3.digits := digits;
83 return l3;
84}
85
86private function f_enc_IMEI_NAS(hexstring digits) return IMEI {
87 var IMEI l3;
88 var integer len := lengthof(digits);
89 if (len rem 2 == 1) { /* modulo remainder */
90 l3.oddevenIndicator := '1'B;
91 } else {
92 l3.oddevenIndicator := '0'B;
93 }
94 l3.digits := digits;
95 return l3;
96}
97
98private function f_enc_IMEI_SV(hexstring digits) return IMEI_SV {
99 var IMEI_SV l3;
100 var integer len := lengthof(digits);
101 if (len rem 2 == 1) { /* modulo remainder */
102 l3.oddevenIndicator := '1'B;
103 } else {
104 l3.oddevenIndicator := '0'B;
105 }
106 l3.digits := digits;
107 l3.fillerDigit := '1111'B;
108 return l3;
109}
110
111template (value) GUTI ts_NAS_GUTI(hexstring mcc_mnc, OCT2 mmegi, OCT1 mmec, OCT4 tmsi) := {
112 oddevenIndicator := '0'B,
113 spare := '1111'B,
114 /* mcc_mnc specified in format 262f42 */
115 mccDigit1 := mcc_mnc[0],
116 mccDigit2 := mcc_mnc[1],
117 mccDigit3 := mcc_mnc[2],
118 mncDigit3 := mcc_mnc[5],
119 mncDigit1 := mcc_mnc[3],
120 mncDigit2 := mcc_mnc[4],
121 mMEGI := mmegi,
122 mMEC := mmec,
123 mTMSI := tmsi
124}
125
126template (value) EPS_MobileIdentityV
127ts_NAS_MobileId_IMSI(hexstring imsi) := {
128 typeOfIdentity := '001'B,
129 oddEvenInd_identity := {
130 imsi := f_enc_IMSI_NAS(imsi)
131 }
132}
133
134template (value) EPS_MobileIdentityV
135ts_NAS_MobileId_IMEI(hexstring imei) := {
136 typeOfIdentity := '011'B,
137 oddEvenInd_identity := {
138 imei := f_enc_IMEI_NAS(imei)
139 }
140}
141
142template (value) EPS_MobileIdentityV
143ts_NAS_MobileId_GUTI(hexstring mcc_mnc, OCT2 mmegi, OCT1 mmec, OCT4 tmsi) := {
144 typeOfIdentity := '110'B,
145 oddEvenInd_identity := {
146 guti := ts_NAS_GUTI(mcc_mnc, mmegi, mmec, tmsi)
147 }
148}
149
150template (value) PDU_NAS_EPS
151ts_NAS_EMM_SecurityProtected(BIT4 sec_hdr_t, integer seq_nr, octetstring inner_nas) := {
152 protocolDiscriminator := c_EPS_NAS_PD_EMM,
153 ePS_messages := {
154 ePS_MobilityManagement := {
155 pDU_NAS_EPS_SecurityProtectedNASMessage := {
156 securityHeaderType := sec_hdr_t,
157 messageAuthenticationCode := '00000000'O,
158 sequenceNumber := seq_nr,
159 nAS_Message := inner_nas
160 }
161 }
162 }
163}
164template (present) PDU_NAS_EPS
165tr_NAS_EMM_SecurityProtected := {
166 protocolDiscriminator := c_EPS_NAS_PD_EMM,
167 ePS_messages := {
168 ePS_MobilityManagement := {
169 pDU_NAS_EPS_SecurityProtectedNASMessage := ?
170 }
171 }
172}
173
174const BIT3 NAS_PDN_T_IPv4 := '001'B;
175const BIT3 NAS_PDN_T_IPv6 := '010'B;
176const BIT3 NAS_PDN_T_IPv4v6 := '011'B;
177const BIT3 NAS_PDN_T_NonIP := '101'B;
178
179
180/*********************************************************************************
181 * Mobility Management
182 *********************************************************************************/
183
184/* 8.2.1 Attach Accept */
185template (value) PDU_NAS_EPS
186ts_NAS_AttachAccept(template (value) EPS_AttachResultV result,
187 template (value) GPRSTimerV t3412,
188 template (value) TAI_Lists tai_lists,
189 template (value) octetstring esm_enc) := {
190 protocolDiscriminator := c_EPS_NAS_PD_EMM,
191 ePS_messages := {
192 ePS_MobilityManagement := {
193 pDU_NAS_EPS_AttachAccept := {
194 securityHeaderType := c_EPS_SEC_NONE,
195 messageType := '01000010'B,
196 ePS_AttachResult := result,
197 spare := '0000'B,
198 t3412 := t3412,
199 tAI_List := {
200 lengthIndicator := 0,
201 trackingAreaIdentityLists := tai_lists
202 },
203 eSM_MessageContainer := ts_NAS_EsmMsgContLVE(esm_enc),
204 gUTI := omit,
205 locationAreaIdentification := omit,
206 msIdentity := omit,
207 eMMCause := omit,
208 t3402 := omit,
209 t3423 := omit,
210 equivalentPLMNs := omit,
211 emergencyNumberList := omit,
212 ePS_NetworkFeatureSupport := omit,
213 additionalUpdateResult := omit,
214 t3412_Extended := omit,
215 t3324 := omit,
216 extendedDRXParameters := omit,
217 dNCID := omit,
218 sMS_ServiceStatus := omit,
219 non3GPP_NW_ProvidedPolicies := omit,
220 t3448 := omit,
221 networkPolicy := omit,
222 t3447 := omit,
223 extendedEmergencyNumberList := omit
224 }
225 }
226 }
227}
228template (present) PDU_NAS_EPS
229tr_NAS_AttachAccept(template (present) EPS_AttachResultV result := ?,
230 template (present) GPRSTimerV t3412 := ?,
231 template (present) TAI_Lists tai_lists := ?,
232 template (present) octetstring esm_enc := ?) := {
233 protocolDiscriminator := c_EPS_NAS_PD_EMM,
234 ePS_messages := {
235 ePS_MobilityManagement := {
236 pDU_NAS_EPS_AttachAccept := {
237 securityHeaderType := c_EPS_SEC_NONE,
238 messageType := '01000010'B,
239 ePS_AttachResult := result,
240 spare := ?,
241 t3412 := t3412,
242 tAI_List := {
243 lengthIndicator := ?,
244 trackingAreaIdentityLists := tai_lists
245 },
246 eSM_MessageContainer := tr_NAS_EsmMsgContLVE(esm_enc),
247 gUTI := *,
248 locationAreaIdentification := *,
249 msIdentity := *,
250 eMMCause := *,
251 t3402 := *,
252 t3423 := *,
253 equivalentPLMNs := *,
254 emergencyNumberList := *,
255 ePS_NetworkFeatureSupport := *,
256 additionalUpdateResult := *,
257 t3412_Extended := *,
258 t3324 := *,
259 extendedDRXParameters := *,
260 dNCID := *,
261 sMS_ServiceStatus := *,
262 non3GPP_NW_ProvidedPolicies := *,
263 t3448 := *,
264 networkPolicy := *,
265 t3447 := *,
266 extendedEmergencyNumberList := *
267 }
268 }
269 }
270}
271
272
273/* 8.2.2 Attach Complete */
274template (value) PDU_NAS_EPS
275ts_NAS_AttachComplete(template (value) octetstring esm_enc) := {
276 protocolDiscriminator := c_EPS_NAS_PD_EMM,
277 ePS_messages := {
278 ePS_MobilityManagement := {
279 pDU_NAS_EPS_AttachComplete := {
280 securityHeaderType := c_EPS_SEC_NONE,
281 messageType := '01000011'B,
282 eSM_MessageContainer := ts_NAS_EsmMsgContLVE(esm_enc)
283 }
284 }
285 }
286}
287template (present) PDU_NAS_EPS
288tr_NAS_AttachComplete(template (present) octetstring esm_enc := ?) := {
289 protocolDiscriminator := c_EPS_NAS_PD_EMM,
290 ePS_messages := {
291 ePS_MobilityManagement := {
292 pDU_NAS_EPS_AttachComplete := {
293 securityHeaderType := c_EPS_SEC_NONE,
294 messageType := '01000011'B,
295 eSM_MessageContainer := tr_NAS_EsmMsgContLVE(esm_enc)
296 }
297 }
298 }
299}
300
301
302/* 8.2.3 Attach Reject */
303template (value) PDU_NAS_EPS
304ts_NAS_AttachReject(template (value) EMM_CauseV cause) := {
305 protocolDiscriminator := c_EPS_NAS_PD_EMM,
306 ePS_messages := {
307 ePS_MobilityManagement := {
308 pDU_NAS_EPS_AttachReject := {
309 securityHeaderType := c_EPS_SEC_NONE,
310 messageType := '01000100'B,
311 emmCause := cause,
312 eSM_MessageContainer := omit,
313 t3346 := omit,
314 t3402 := omit,
315 extendedEmmCause := omit
316 }
317 }
318 }
319}
320template (present) PDU_NAS_EPS
321tr_NAS_AttachReject(template (present) EMM_CauseV cause := ?) := {
322 protocolDiscriminator := c_EPS_NAS_PD_EMM,
323 ePS_messages := {
324 ePS_MobilityManagement := {
325 pDU_NAS_EPS_AttachReject := {
326 securityHeaderType := c_EPS_SEC_NONE,
327 messageType := '01000100'B,
328 emmCause := cause,
329 eSM_MessageContainer := omit,
330 t3346 := omit,
331 t3402 := omit,
332 extendedEmmCause := omit
333 }
334 }
335 }
336}
337
338/* 8.2.4 Attach Request */
339template (value) PDU_NAS_EPS
340ts_NAS_AttachRequest(template (value) BIT3 att_type,
341 template (value) BIT3 kset_id,
342 template (value) EPS_MobileIdentityV mobile_id,
343 template (value) UENetworkCapabilityV ue_net_cap,
344 template (value) octetstring esm_enc) := {
345 protocolDiscriminator := c_EPS_NAS_PD_EMM,
346 ePS_messages := {
347 ePS_MobilityManagement := {
348 pDU_NAS_EPS_AttachRequest := {
349 securityHeaderType := c_EPS_SEC_NONE,
350 messageType := '01000001'B,
351 ePS_attachType := {
352 typeOfAttach := att_type,
353 spare := '0'B
354 },
355 nasKeySetId := {
356 identifier := kset_id,
357 tSC := '1'B
358 },
359 ePSMobileId := {
360 lengthIndicator := 0,
361 ePS_MobileIdentity := mobile_id
362 },
363 uENetworkCapability := {
364 lengthIndicator := 0,
365 uENetworkCapabilityV := ue_net_cap
366 },
367 eSM_MessageContainer := ts_NAS_EsmMsgContLVE(esm_enc),
368 old_P_TMSISignature := omit,
369 additionalGUTI := omit,
370 lastVisitedRegisteredTAI := omit,
371 dRXParameter := omit,
372 mSNetworkCapability := omit,
373 oldLocationAreaIdentification := omit,
374 tMSIStatusTV := omit,
375 mobileStationClassmark2 := omit,
376 mobileStationClassmark3 := omit,
377 supportedCodecList := omit,
378 additionalUpdateType := omit,
379 voiceDomainPrefandUEsettings := omit,
380 deviceProperties := omit,
381 oldGUTI_Type := omit,
382 mS_NetworkFeatureSupport := omit,
383 tMSIBasedNRIContainer := omit,
384 t3324 := omit,
385 t3412_Extended := omit,
386 extendedDRXParameters := omit,
387 uEAdditionalSecurityCapability := omit
388 }
389 }
390 }
391}
392template (present) PDU_NAS_EPS
393tr_NAS_AttachRequest(template (present) BIT3 att_type := ?,
394 template (present) BIT3 kset_id := ?,
395 template (present) EPS_MobileIdentityV mobile_id := ?,
396 template (present) UENetworkCapabilityV ue_net_cap := ?,
397 template (present) octetstring esm_enc := ?) := {
398 protocolDiscriminator := c_EPS_NAS_PD_EMM,
399 ePS_messages := {
400 ePS_MobilityManagement := {
401 pDU_NAS_EPS_AttachRequest := {
402 securityHeaderType := ?,
403 messageType := '01000001'B,
404 ePS_attachType := {
405 typeOfAttach := att_type,
406 spare := ?
407 },
408 nasKeySetId := {
409 identifier := kset_id,
410 tSC := ?
411 },
412 ePSMobileId := {
413 lengthIndicator := ?,
414 ePS_MobileIdentity := mobile_id
415 },
416 uENetworkCapability := {
417 lengthIndicator := ?,
418 uENetworkCapabilityV := ue_net_cap
419 },
420 eSM_MessageContainer := tr_NAS_EsmMsgContLVE(esm_enc),
421 old_P_TMSISignature := *,
422 additionalGUTI := *,
423 lastVisitedRegisteredTAI := *,
424 dRXParameter := *,
425 mSNetworkCapability := *,
426 oldLocationAreaIdentification := *,
427 tMSIStatusTV := *,
428 mobileStationClassmark2 := *,
429 mobileStationClassmark3 := *,
430 supportedCodecList := *,
431 additionalUpdateType := *,
432 voiceDomainPrefandUEsettings := *,
433 deviceProperties := *,
434 oldGUTI_Type := *,
435 mS_NetworkFeatureSupport := *,
436 tMSIBasedNRIContainer := *,
437 t3324 := *,
438 t3412_Extended := *,
439 extendedDRXParameters := *,
440 uEAdditionalSecurityCapability := *
441 }
442 }
443 }
444}
445
446
447/* 8.2.5 Authentication Failure */
448template (value) PDU_NAS_EPS
449ts_NAS_AuthFail(template (value) EMM_CauseV cause /* template (omit) OCT14 auth_fail_par */) := {
450 protocolDiscriminator := c_EPS_NAS_PD_EMM,
451 ePS_messages := {
452 ePS_MobilityManagement := {
453 pDU_NAS_EPS_AuthenticationFailure := {
454 securityHeaderType := c_EPS_SEC_NONE,
455 messageType := '01011100'B,
456 emmCause := cause,
457 authenticationFailureParameter := omit
458 }
459 }
460 }
461}
462template (value) PDU_NAS_EPS
463ts_NAS_AuthFail_par(template (value) EMM_CauseV cause,
464 template (value) OCT14 auth_fail_par) := {
465 protocolDiscriminator := c_EPS_NAS_PD_EMM,
466 ePS_messages := {
467 ePS_MobilityManagement := {
468 pDU_NAS_EPS_AuthenticationFailure := {
469 securityHeaderType := c_EPS_SEC_NONE,
470 messageType := '01011100'B,
471 emmCause := cause,
472 authenticationFailureParameter := {
473 elementIdentifier := '30'O,
474 lengthIndicator := lengthof(auth_fail_par),
475 authenticationFailureParameter := auth_fail_par
476 }
477 }
478 }
479 }
480}
481
482/* 8.2.6 Authentication Reject */
483template (value) PDU_NAS_EPS
484ts_NAS_AuthRej := {
485 protocolDiscriminator := c_EPS_NAS_PD_EMM,
486 ePS_messages := {
487 ePS_MobilityManagement := {
488 pDU_NAS_EPS_AuthenticationReject := {
489 securityHeaderType := c_EPS_SEC_NONE,
490 messageType := '01010100'B
491 }
492 }
493 }
494}
495template (present) PDU_NAS_EPS
496tr_NAS_AuthRej := {
497 protocolDiscriminator := c_EPS_NAS_PD_EMM,
498 ePS_messages := {
499 ePS_MobilityManagement := {
500 pDU_NAS_EPS_AuthenticationReject := {
501 securityHeaderType := ?,
502 messageType := '01010100'B
503 }
504 }
505 }
506}
507
508/* 8.2.7 Authentication Request */
509template (value) PDU_NAS_EPS
510ts_NAS_AuthReq(template (value) NAS_KeySetIdentifierV kset_id,
511 OCT16 rand, OCT16 autn) := {
512 protocolDiscriminator := c_EPS_NAS_PD_EMM,
513 ePS_messages := {
514 ePS_MobilityManagement := {
515 pDU_NAS_EPS_AuthenticationRequest := {
516 securityHeaderType := c_EPS_SEC_NONE,
517 messageType := '01010010'B,
518 nasKeySetId := kset_id,
519 spare := '0000'B,
520 authenticationParameterRAND := {
521 rAND := rand
522 },
523 authenticationParameterAUTN := {
524 lengthIndicator := lengthof(autn),
525 aUTN := autn
526 }
527 }
528 }
529 }
530}
531template (present) PDU_NAS_EPS
532tr_NAS_AuthReq(template (present) NAS_KeySetIdentifierV kset_id := ?,
533 template (present) OCT16 rand := ?,
534 template (present) OCT16 autn := ?) := {
535 protocolDiscriminator := c_EPS_NAS_PD_EMM,
536 ePS_messages := {
537 ePS_MobilityManagement := {
538 pDU_NAS_EPS_AuthenticationRequest := {
539 securityHeaderType := ?,
540 messageType := '01010010'B,
541 nasKeySetId := kset_id,
542 spare := '0000'B,
543 authenticationParameterRAND := {
544 rAND := rand
545 },
546 authenticationParameterAUTN := {
547 lengthIndicator := ?,
548 aUTN := autn
549 }
550 }
551 }
552 }
553}
554
555/* 8.2.8 Authentication Response */
556template (value) PDU_NAS_EPS
557ts_NAS_AuthResp(octetstring res) := {
558 protocolDiscriminator := c_EPS_NAS_PD_EMM,
559 ePS_messages := {
560 ePS_MobilityManagement := {
561 pDU_NAS_EPS_AuthenticationResponse := {
562 securityHeaderType := c_EPS_SEC_NONE,
563 messageType := '01010011'B,
564 authenticationResponseParameter := {
565 lengthIndicator := lengthof(res),
566 authenticationResponseParameter := {
567 rES := res
568 }
569 }
570 }
571 }
572 }
573}
574template (present) PDU_NAS_EPS
575tr_NAS_AuthResp(template OCT16 res := ?) := {
576 protocolDiscriminator := c_EPS_NAS_PD_EMM,
577 ePS_messages := {
578 ePS_MobilityManagement := {
579 pDU_NAS_EPS_AuthenticationResponse := {
580 securityHeaderType := ?,
581 messageType := '01010011'B,
582 authenticationResponseParameter := {
583 lengthIndicator := ?,
584 authenticationResponseParameter := {
585 rES := res
586 }
587 }
588 }
589 }
590 }
591}
592
593/* 8.2.18 Identity Request */
594template (value) PDU_NAS_EPS
595ts_NAS_IdentityReq(template (value) IdentityType2V id_type) := {
596 protocolDiscriminator := c_EPS_NAS_PD_EMM,
597 ePS_messages := {
598 ePS_MobilityManagement := {
599 pDU_NAS_EPS_IdentityRequest := {
600 securityHeaderType := c_EPS_SEC_NONE,
601 messageType := '01010101'B,
602 identityType := id_type,
603 spareHalfOctet := '0000'B
604 }
605 }
606 }
607}
608template (present) PDU_NAS_EPS
609tr_NAS_IdentityReq(template (present) IdentityType2V id_type := ?) := {
610 protocolDiscriminator := c_EPS_NAS_PD_EMM,
611 ePS_messages := {
612 ePS_MobilityManagement := {
613 pDU_NAS_EPS_IdentityRequest := {
614 securityHeaderType := c_EPS_SEC_NONE,
615 messageType := '01010101'B,
616 identityType := id_type,
617 spareHalfOctet := ?
618 }
619 }
620 }
621}
622
623/* 8.2.19 Identity Response */
624template (value) PDU_NAS_EPS
625ts_NAS_IdentityResp(template (value) MobileIdentityV mobile_id) := {
626 protocolDiscriminator := c_EPS_NAS_PD_EMM,
627 ePS_messages := {
628 ePS_MobilityManagement := {
629 pDU_NAS_EPS_IdentityResponse := {
630 securityHeaderType := c_EPS_SEC_NONE,
631 messageType := '01010110'B,
632 mobileIdentity := ts_NAS_MobileIdLV(mobile_id)
633 }
634 }
635 }
636}
637template (present) PDU_NAS_EPS
638tr_NAS_IdentityResp(template (present) MobileIdentityV mobile_id := ?) := {
639 protocolDiscriminator := c_EPS_NAS_PD_EMM,
640 ePS_messages := {
641 ePS_MobilityManagement := {
642 pDU_NAS_EPS_IdentityResponse := {
643 securityHeaderType := c_EPS_SEC_NONE,
644 messageType := '01010110'B,
645 mobileIdentity := tr_NAS_MobileIdLV(mobile_id)
646 }
647 }
648 }
649}
650
651
652
653
654/* 8.2.20 Security Mode Command */
655template (value) PDU_NAS_EPS
656ts_NAS_SecModeCmd(template (value) NAS_SecurityAlgorithmsV alg,
657 template (value) NAS_KeySetIdentifierV kset_id,
658 template (value) UESecurityCapabilityLV ue_sec_cap) := {
659 protocolDiscriminator := c_EPS_NAS_PD_EMM,
660 ePS_messages := {
661 ePS_MobilityManagement := {
662 pDU_NAS_EPS_SecurityModeCommand := {
663 securityHeaderType := c_EPS_SEC_NONE,
664 messageType := '01011101'B,
665 selected_NAS_SecurityAlgorithms := alg,
666 nasKeySetId := kset_id,
667 spareHalfOctet := '0000'B,
668 replayed_UE_SecurityCapability := ue_sec_cap,
669 iMEISV_Request := omit,
670 replayedNonceUE := omit,
671 nonceMME := omit,
672 hashMME := omit,
673 uEAdditionalSecurityCapability := omit
674 }
675 }
676 }
677}
678template (present) PDU_NAS_EPS
679tr_NAS_SecModeCmd(template (present) NAS_SecurityAlgorithmsV alg := ?,
680 template (present) NAS_KeySetIdentifierV kset_id := ?,
681 template (present) UESecurityCapabilityLV ue_sec_cap := ?) := {
682 protocolDiscriminator := c_EPS_NAS_PD_EMM,
683 ePS_messages := {
684 ePS_MobilityManagement := {
685 pDU_NAS_EPS_SecurityModeCommand := {
686 securityHeaderType := c_EPS_SEC_NONE,
687 messageType := '01011101'B,
688 selected_NAS_SecurityAlgorithms := alg,
689 nasKeySetId := kset_id,
690 spareHalfOctet := ?,
691 replayed_UE_SecurityCapability := ue_sec_cap,
692 iMEISV_Request := *,
693 replayedNonceUE := *,
694 nonceMME := *,
695 hashMME := *,
696 uEAdditionalSecurityCapability := *
697 }
698 }
699 }
700}
701
702/* 8.2.21 Security Mode Complete */
703template (value) PDU_NAS_EPS
704ts_NAS_SecModeCmpl := {
705 protocolDiscriminator := c_EPS_NAS_PD_EMM,
706 ePS_messages := {
707 ePS_MobilityManagement := {
708 pDU_NAS_EPS_SecurityModeComplete := {
709 securityHeaderType := c_EPS_SEC_NONE,
710 messageType := '01011110'B,
711 iMEISV := omit,
712 replayedNASMessageContainer := omit
713 }
714 }
715 }
716}
717template (present) PDU_NAS_EPS
718tr_NAS_SecModeCmpl := {
719 protocolDiscriminator := c_EPS_NAS_PD_EMM,
720 ePS_messages := {
721 ePS_MobilityManagement := {
722 pDU_NAS_EPS_SecurityModeComplete := {
723 securityHeaderType := c_EPS_SEC_NONE,
724 messageType := '01011110'B,
725 iMEISV := *,
726 replayedNASMessageContainer := *
727 }
728 }
729 }
730}
731
732/*********************************************************************************
733 * Session Management
734 *********************************************************************************/
735
736/* 9.9.4.11 - 10.5.6.3/24.008 */
737private function ts_NAS_PCO_TLV(template (omit) ProtocolConfigOptionsV pco)
738return template (omit) ProtocolConfigOptionsTLV {
739 var template (value) ProtocolConfigOptionsTLV ret;
740 if (istemplatekind(pco, "omit")) {
741 return omit;
742 }
743 ret := {
744 elementIdentifier := '27'O,
745 protocolConfigOptions := {
746 lengthIndicator := 0,
747 protocolConfigOptionsV := pco
748 }
749 }
750 return ret;
751}
752private function tr_NAS_PCO_TLV(template ProtocolConfigOptionsV pco := ?)
753return template ProtocolConfigOptionsTLV {
754 var template ProtocolConfigOptionsTLV ret := {
755 elementIdentifier := '27'O,
756 protocolConfigOptions := {
757 lengthIndicator := ?,
758 protocolConfigOptionsV := pco
759 }
760 }
761 if (istemplatekind(pco, "omit")) {
762 return omit;
763 } else if (istemplatekind(pco, "*")) {
764 return *;
765 } else {
766 return ret;
767 }
768}
769
770
771
772/* 8.3.20 PDN Connectivity Request */
773template (value) PDU_NAS_EPS
774ts_NAS_PdnConnReq(template (value) BIT4 bearer_id,
775 template (value) BIT8 proc_tid,
776 template (value) BIT3 pdn_type,
777 template (value) BIT3 req_type) := {
778 protocolDiscriminator := c_EPS_NAS_PD_ESM,
779 ePS_messages := {
780 ePS_SessionManagement := {
781 pDU_NAS_EPS_PDN_ConnectivityRequest := {
782 ePSBearerIdentity := bearer_id,
783 procedureTransactionIdentifier := proc_tid,
784 messageType := '11010000'B,
785 requestType := {
786 requestTypeValue := req_type,
787 spare := '0'B
788 },
789 pDN_Type := {
790 pDN_TypeValue := pdn_type,
791 spare := '0'B
792 },
793 eSM_InformationTransferFlag := omit,
794 accessPointName := omit,
795 protocolConfigOptions := omit,
796 deviceProperties := omit,
797 nBIFOMContainer := omit,
798 headerCompressinConfiguration := omit,
799 extendedProtocolConfigurationOptions := omit
800 }
801 }
802 }
803}
804template (present) PDU_NAS_EPS
805tr_NAS_PdnConnReq(template (present) BIT4 bearer_id := ?,
806 template (present) BIT8 proc_tid := ?,
807 template (present) BIT3 pdn_type := ?,
808 template (present) BIT3 req_type := ?) := {
809 protocolDiscriminator := c_EPS_NAS_PD_ESM,
810 ePS_messages := {
811 ePS_SessionManagement := {
812 pDU_NAS_EPS_PDN_ConnectivityRequest := {
813 ePSBearerIdentity := bearer_id,
814 procedureTransactionIdentifier := proc_tid,
815 messageType := '11010000'B,
816 requestType := {
817 requestTypeValue := req_type,
818 spare := '0'B
819 },
820 pDN_Type := {
821 pDN_TypeValue := pdn_type,
822 spare := '0'B
823 },
824 eSM_InformationTransferFlag := omit,
825 accessPointName := omit,
826 protocolConfigOptions := omit,
827 deviceProperties := omit,
828 nBIFOMContainer := omit,
829 headerCompressinConfiguration := omit,
830 extendedProtocolConfigurationOptions := omit
831 }
832 }
833 }
834}
835
836/* 8.3.19 PDN Connectivity Reject */
837template (value) PDU_NAS_EPS
838ts_NAS_PdnConnRej(template (value) BIT4 bearer_id,
839 template (value) BIT8 proc_tid,
840 template (value) ESM_CauseV cause) := {
841 protocolDiscriminator := c_EPS_NAS_PD_ESM,
842 ePS_messages := {
843 ePS_SessionManagement := {
844 pDU_NAS_EPS_PDN_ConnectivityReject := {
845 ePSBearerIdentity := bearer_id,
846 procedureTransactionIdentifier := proc_tid,
847 messageType := '11010001'B,
848 esmCause := cause,
849 protocolConfigOptions := omit,
850 backOffTimer := omit,
851 reAttemptIndicator := omit,
852 nBIFOMContainer := omit,
853 extendedProtocolConfigurationOptions := omit
854 }
855 }
856 }
857}
858template (present) PDU_NAS_EPS
859tr_NAS_PdnConnRej(template (present) BIT4 bearer_id := ?,
860 template (present) BIT8 proc_tid := ?,
861 template (present) ESM_CauseV cause := ?) := {
862 protocolDiscriminator := c_EPS_NAS_PD_ESM,
863 ePS_messages := {
864 ePS_SessionManagement := {
865 pDU_NAS_EPS_PDN_ConnectivityReject := {
866 ePSBearerIdentity := bearer_id,
867 procedureTransactionIdentifier := proc_tid,
868 messageType := '11010001'B,
869 esmCause := cause,
870 protocolConfigOptions := *,
871 backOffTimer := *,
872 reAttemptIndicator := *,
873 nBIFOMContainer := *,
874 extendedProtocolConfigurationOptions := *
875 }
876 }
877 }
878}
879
880
881/* 8.3.6 Activate Default EPS Bearer Context Request */
882template (value) PDU_NAS_EPS
883ts_NAS_ActDefEpsBearCtxReq(template (value) BIT4 bearer_id,
884 template (value) BIT8 proc_tid,
885 template (value) EPS_QualityOfServiceV qos,
886 template (value) octetstring apn,
887 template (value) BIT3 addr_type,
888 template (value) octetstring addr_info) := {
889 protocolDiscriminator := c_EPS_NAS_PD_ESM,
890 ePS_messages := {
891 ePS_SessionManagement := {
892 pDU_NAS_EPS_ActDefEPSBearerContextRequest := {
893 ePSBearerIdentity := bearer_id,
894 procedureTransactionIdentifier := proc_tid,
895 messageType := '11000001'B,
896 ePS_QoS := {
897 lengthIndicator := 0,
898 ePS_QualityOfServiceV := qos
899 },
900 accessPointName := {
901 lengthIndicator := 0,
902 accessPointNameValue := apn
903 },
904 pDN_Address := {
905 lengthIndicator := 0,
906 typeValue := addr_type,
907 spare := '00000'B,
908 addressInformation := addr_info
909 },
910 transactionIdentifier := omit,
911 negotiatedQoS := omit,
912 negotiated_LLC_SAPI := omit,
913 radioPriority := omit,
914 packetFlowID := omit,
915 aPN_AMBR := omit,
916 esmCause := omit,
917 protocolConfigOptions := omit,
918 connectivityType := omit,
919 wLANOffloadIndication := omit,
920 nBIFOMContainer := omit,
921 headerCompressinConfiguration := omit,
922 controlPlaneOnlyIndication := omit,
923 extendedProtocolConfigurationOptions := omit,
924 servingPLMNRateControl := omit,
925 extended_APN_AMBR := omit,
926 extendedQoS := omit
927 }
928 }
929 }
930}
931
932/* 8.3.4 Activate Default EPS Bearer Context Accept */
933template (value) PDU_NAS_EPS
934ts_NAS_ActDefEpsBearCtxAck(template (value) BIT4 bearer_id,
935 template (value) BIT8 proc_tid,
936 template (omit) ProtocolConfigOptionsV pco) := {
937 protocolDiscriminator := c_EPS_NAS_PD_ESM,
938 ePS_messages := {
939 ePS_SessionManagement := {
940 pDU_NAS_EPS_ActDefEPSBearerContextAccept := {
941 ePSBearerIdentity := bearer_id,
942 procedureTransactionIdentifier := proc_tid,
943 messageType := '11000010'B,
944 protocolConfigOptions := ts_NAS_PCO_TLV(pco),
945 extendedProtocolConfigurationOptions := omit
946 }
947 }
948 }
949}
950template (present) PDU_NAS_EPS
951tr_NAS_ActDefEpsBearCtxAck(template (present) BIT4 bearer_id := ?,
952 template (present) BIT8 proc_tid := ?,
953 template ProtocolConfigOptionsV pco := *) := {
954 protocolDiscriminator := c_EPS_NAS_PD_ESM,
955 ePS_messages := {
956 ePS_SessionManagement := {
957 pDU_NAS_EPS_ActDefEPSBearerContextAccept := {
958 ePSBearerIdentity := bearer_id,
959 procedureTransactionIdentifier := proc_tid,
960 messageType := '11000010'B,
961 protocolConfigOptions := tr_NAS_PCO_TLV(pco),
962 extendedProtocolConfigurationOptions := *
963 }
964 }
965 }
966}
967
968
969/* 8.3.5 Activate Default EPS Bearer Context Reject */
970template (value) PDU_NAS_EPS
971ts_NAS_ActDefEpsBearCtxRej(template (value) BIT4 bearer_id,
972 template (value) BIT8 proc_tid,
973 template (value) ESM_CauseV cause) := {
974 protocolDiscriminator := c_EPS_NAS_PD_ESM,
975 ePS_messages := {
976 ePS_SessionManagement := {
977 pDU_NAS_EPS_ActDefEPSBearerContextReject := {
978 ePSBearerIdentity := bearer_id,
979 procedureTransactionIdentifier := proc_tid,
980 messageType := '11000011'B,
981 esmCause := cause,
982 protocolConfigOptions := omit,
983 extendedProtocolConfigurationOptions := omit
984 }
985 }
986 }
987}
988template (present) PDU_NAS_EPS
989tr_NAS_ActDefEpsBearCtxRej(template (present) BIT4 bearer_id := ?,
990 template (present) BIT8 proc_tid := ?,
991 template (present) ESM_CauseV cause := ?) := {
992 protocolDiscriminator := c_EPS_NAS_PD_ESM,
993 ePS_messages := {
994 ePS_SessionManagement := {
995 pDU_NAS_EPS_ActDefEPSBearerContextReject := {
996 ePSBearerIdentity := bearer_id,
997 procedureTransactionIdentifier := proc_tid,
998 messageType := '11000011'B,
999 esmCause := cause,
1000 protocolConfigOptions := *,
1001 extendedProtocolConfigurationOptions := *
1002 }
1003 }
1004 }
1005}
1006
1007
1008
1009
1010
1011}