Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1 | module RANAP_Templates { |
| 2 | |
| 3 | import from General_Types all; |
Daniel Willmann | fc5e17a | 2022-01-28 11:42:40 +0100 | [diff] [blame] | 4 | import from Misc_Helpers all; |
| 5 | import from Native_Functions all; |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 6 | |
| 7 | import from RANAP_IEs all; |
| 8 | import from RANAP_CommonDataTypes all; |
| 9 | import from RANAP_Constants all; |
| 10 | import from RANAP_Containers all; |
| 11 | import from RANAP_PDU_Contents all; |
| 12 | import from RANAP_PDU_Descriptions all; |
| 13 | |
| 14 | template (value) Cause ts_RanapCause_om_intervention := { misc := 113 }; |
| 15 | |
| 16 | /***************************************************************************************************** |
| 17 | * Reset |
| 18 | *****************************************************************************************************/ |
| 19 | |
| 20 | template (value) RANAP_PDU |
| 21 | ts_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 | } |
| 48 | template RANAP_PDU |
| 49 | tr_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 | |
| 77 | template (value) RANAP_PDU |
| 78 | ts_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 | } |
| 99 | template RANAP_PDU |
| 100 | tr_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 | |
| 126 | template (value) RANAP_PDU |
| 127 | ts_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 | } |
| 160 | template RANAP_PDU |
| 161 | tr_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 | |
| 195 | template (value) RANAP_PDU |
| 196 | ts_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 | } |
| 241 | template RANAP_PDU |
| 242 | tr_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 | |
| 288 | template (value) RANAP_PDU |
| 289 | ts_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 | } |
| 310 | template RANAP_PDU |
| 311 | tr_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 | |
| 333 | template (value) RANAP_PDU |
| 334 | ts_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 | } |
| 362 | template RANAP_PDU |
| 363 | tr_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 | |
| 392 | template (value) RANAP_PDU |
| 393 | ts_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 | } |
| 414 | template RANAP_PDU |
| 415 | tr_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 | |
| 443 | template (value) RANAP_PDU |
| 444 | ts_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 Willmann | cd8b71c | 2022-02-22 16:47:44 +0100 | [diff] [blame] | 454 | criticality := ignore, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 455 | value_ := { |
| 456 | cause := cause |
| 457 | } |
| 458 | } |
| 459 | }, |
| 460 | protocolExtensions := exts |
| 461 | } |
| 462 | } |
| 463 | } |
| 464 | } |
| 465 | template RANAP_PDU |
| 466 | tr_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 Willmann | cd8b71c | 2022-02-22 16:47:44 +0100 | [diff] [blame] | 476 | criticality := ignore, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 477 | value_ := { |
| 478 | cause := cause |
| 479 | } |
| 480 | } |
| 481 | }, |
| 482 | protocolExtensions := exts |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | /***************************************************************************************************** |
| 489 | * RAB Release |
| 490 | *****************************************************************************************************/ |
| 491 | |
Daniel Willmann | fc5e17a | 2022-01-28 11:42:40 +0100 | [diff] [blame] | 492 | template (value) RAB_ID |
| 493 | t_RAB_id(integer rab_id) := int2bit(rab_id, 8); |
| 494 | |
| 495 | template (value) TransportLayerAddress ts_RAB_TLA4(OCT4 ip) := hex2bit('350001'H & oct2hex(ip) & '00000000000000000000000000'H); |
| 496 | template (value) TransportLayerAddress ts_RAB_TLA6(OCT16 ip) := hex2bit('350000'H & oct2hex(ip) & '00'H); |
| 497 | function 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 | |
| 507 | template (value) BindingID |
| 508 | t_RAB_binding_port(integer prt) := int2oct(prt, 2) & '0000'O; |
| 509 | |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 510 | template (value) RANAP_PDU |
| 511 | ts_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 | } |
| 544 | template RANAP_PDU |
Daniel Willmann | fc5e17a | 2022-01-28 11:42:40 +0100 | [diff] [blame] | 545 | tr_RANAP_RabReleaseRequest(template (present) RAB_ID rab_id, template Cause cause, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 546 | 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 | |
| 584 | template (value) RANAP_PDU |
| 585 | ts_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 | } |
| 606 | template RANAP_PDU |
| 607 | tr_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 | |
| 629 | template (value) RANAP_PDU |
| 630 | ts_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 | } |
| 643 | template RANAP_PDU |
| 644 | tr_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 | |
| 662 | template (value) RANAP_PDU |
| 663 | ts_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 | } |
| 693 | template RANAP_PDU |
| 694 | tr_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 | |
| 730 | template (value) RANAP_PDU |
| 731 | ts_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 | } |
| 754 | template RANAP_PDU |
| 755 | tr_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 | |
| 783 | template (value) RANAP_PDU |
| 784 | ts_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 | } |
| 838 | template RANAP_PDU |
| 839 | tr_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 | |
| 894 | template (value) RANAP_PDU |
| 895 | ts_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 | } |
| 955 | template RANAP_PDU |
| 956 | tr_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 Yanitskiy | e06f228 | 2019-06-20 05:02:49 +0700 | [diff] [blame] | 1021 | private function f_gen_ts_dt_ies(template (value) NAS_PDU nas, |
| 1022 | template (omit) SAPI sapi, |
| 1023 | template (value) DirectTransfer.protocolIEs opt_ies) |
| 1024 | return 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 | |
| 1053 | private function f_gen_tr_dt_ies(template NAS_PDU nas, |
| 1054 | template SAPI sapi, |
| 1055 | template DirectTransfer.protocolIEs opt_ies) |
| 1056 | return 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 Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1098 | template (value) RANAP_PDU |
| 1099 | ts_RANAP_DirectTransfer(template (value) NAS_PDU nas, |
Vadim Yanitskiy | e06f228 | 2019-06-20 05:02:49 +0700 | [diff] [blame] | 1100 | template (omit) SAPI sapi := omit, |
| 1101 | template (value) DirectTransfer.protocolIEs ies := {}, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1102 | template (omit) DirectTransfer.protocolExtensions exts := omit) := { |
| 1103 | initiatingMessage := { |
| 1104 | procedureCode := id_DirectTransfer, |
| 1105 | criticality := ignore, |
| 1106 | value_ := { |
| 1107 | directTransfer := { |
Vadim Yanitskiy | e06f228 | 2019-06-20 05:02:49 +0700 | [diff] [blame] | 1108 | protocolIEs := f_gen_ts_dt_ies(nas, sapi, ies), |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1109 | protocolExtensions := exts |
| 1110 | } |
| 1111 | } |
| 1112 | } |
| 1113 | } |
| 1114 | template RANAP_PDU |
| 1115 | tr_RANAP_DirectTransfer(template NAS_PDU nas, |
Vadim Yanitskiy | e06f228 | 2019-06-20 05:02:49 +0700 | [diff] [blame] | 1116 | template SAPI sapi := *, |
| 1117 | template DirectTransfer.protocolIEs ies := *, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1118 | template DirectTransfer.protocolExtensions exts := *) := { |
| 1119 | initiatingMessage := { |
| 1120 | procedureCode := id_DirectTransfer, |
| 1121 | criticality := ignore, |
| 1122 | value_ := { |
| 1123 | directTransfer := { |
Vadim Yanitskiy | e06f228 | 2019-06-20 05:02:49 +0700 | [diff] [blame] | 1124 | protocolIEs := f_gen_tr_dt_ies(nas, sapi, ies), |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1125 | protocolExtensions := exts |
| 1126 | } |
| 1127 | } |
| 1128 | } |
| 1129 | } |
| 1130 | |
| 1131 | |
| 1132 | /***************************************************************************************************** |
| 1133 | * RAB Assignment Request |
| 1134 | *****************************************************************************************************/ |
| 1135 | |
| 1136 | template (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 | |
| 1208 | template (value) UserPlaneInformation ts_UserPlaneInfo := { |
| 1209 | userPlaneMode := support_mode_for_predefined_SDU_sizes, |
| 1210 | uP_ModeVersions := '0000000000000010'B, |
| 1211 | iE_Extensions := omit |
| 1212 | } |
| 1213 | |
| 1214 | template (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 | } |
| 1222 | template 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 | |
| 1231 | template (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 Willmann | 95263ca | 2022-02-15 09:55:18 +0100 | [diff] [blame] | 1262 | template RAB_SetupOrModifyList tr_RAB_SML(template (present) RAB_ID rab_id, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1263 | 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 Willmann | fc5e17a | 2022-01-28 11:42:40 +0100 | [diff] [blame] | 1294 | template (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 Willmann | 95263ca | 2022-02-15 09:55:18 +0100 | [diff] [blame] | 1314 | template RAB_SetupOrModifiedList tr_RAB_SMdL(template (present) RAB_ID rab_id, |
Daniel Willmann | fc5e17a | 2022-01-28 11:42:40 +0100 | [diff] [blame] | 1315 | 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 Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1333 | |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1334 | template (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 | |
| 1349 | template 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 | |
Daniel Willmann | 9e789be | 2022-02-22 13:30:51 +0100 | [diff] [blame] | 1364 | template (value) RAB_ReleaseList ts_RAB_RL(template (value) RAB_ID rab_id, |
| 1365 | template (value) Cause cause) := { { |
| 1366 | { |
| 1367 | id := id_RAB_ReleaseItem, |
| 1368 | criticality := ignore, |
| 1369 | value_ := { |
| 1370 | rAB_ReleaseItem := { |
| 1371 | rAB_ID := rab_id, |
| 1372 | cause := cause, |
| 1373 | iE_Extensions := omit |
| 1374 | } |
| 1375 | } |
| 1376 | } |
| 1377 | } } |
| 1378 | |
| 1379 | template RAB_ReleaseList tr_RAB_RL(template (present) RAB_ID rab_id, |
| 1380 | template Cause cause := ?) := { { |
| 1381 | { |
| 1382 | id := id_RAB_ReleaseItem, |
| 1383 | criticality := ignore, |
| 1384 | value_ := { |
| 1385 | rAB_ReleaseItem := { |
| 1386 | rAB_ID := rab_id, |
| 1387 | cause := cause, |
| 1388 | iE_Extensions := * |
| 1389 | } |
| 1390 | } |
| 1391 | } |
| 1392 | } } |
| 1393 | |
| 1394 | |
| 1395 | function |
| 1396 | ts_RANAP_RabAssReq(template (omit) RAB_SetupOrModifyList rab_sml := omit, |
| 1397 | template (omit) RAB_ReleaseList rab_rl := omit, |
| 1398 | template (omit) RAB_AssignmentRequest.protocolExtensions exts := omit) return template RANAP_PDU { |
| 1399 | var template RANAP_PDU ret; |
| 1400 | var template RAB_AssignmentRequest.protocolIEs protocolIEs := {}; |
| 1401 | var integer ie_pos := 0; |
| 1402 | |
| 1403 | var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml; |
| 1404 | var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl; |
| 1405 | |
| 1406 | /* RAB-SetupOrModifyList */ |
| 1407 | if (istemplatekind(rab_sml, "value")) { |
| 1408 | protocolIEs_rab_sml := { |
| 1409 | { |
| 1410 | id := id_RAB_SetupOrModifyList, |
| 1411 | criticality := ignore, |
| 1412 | value_ := { |
| 1413 | rAB_SetupOrModifyList := rab_sml |
| 1414 | } |
| 1415 | } |
| 1416 | }; |
| 1417 | protocolIEs[ie_pos] := protocolIEs_rab_sml[0]; |
| 1418 | ie_pos := ie_pos + 1; |
| 1419 | } |
| 1420 | |
| 1421 | /* RAB-ReleaseList */ |
| 1422 | if (istemplatekind(rab_rl, "value")) { |
| 1423 | protocolIEs_rab_rl := { |
| 1424 | { |
| 1425 | id := id_RAB_ReleaseList, |
| 1426 | criticality := ignore, |
| 1427 | value_ := { |
| 1428 | rAB_ReleaseList := rab_rl |
| 1429 | } |
| 1430 | } |
| 1431 | }; |
| 1432 | protocolIEs[ie_pos] := protocolIEs_rab_rl[0]; |
| 1433 | ie_pos := ie_pos + 1; |
| 1434 | } |
| 1435 | |
| 1436 | |
| 1437 | ret.initiatingMessage := { |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1438 | procedureCode := id_RAB_Assignment, |
| 1439 | criticality := reject, |
| 1440 | value_ := { |
| 1441 | rAB_AssignmentRequest := { |
Daniel Willmann | 9e789be | 2022-02-22 13:30:51 +0100 | [diff] [blame] | 1442 | protocolIEs := protocolIEs, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1443 | protocolExtensions := exts |
| 1444 | } |
| 1445 | } |
| 1446 | } |
Daniel Willmann | 9e789be | 2022-02-22 13:30:51 +0100 | [diff] [blame] | 1447 | |
| 1448 | return ret; |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1449 | } |
Daniel Willmann | 9e789be | 2022-02-22 13:30:51 +0100 | [diff] [blame] | 1450 | |
| 1451 | function |
| 1452 | tr_RANAP_RabAssReq(template RAB_SetupOrModifyList rab_sml := omit, |
| 1453 | template RAB_ReleaseList rab_rl := omit, |
| 1454 | template RAB_AssignmentRequest.protocolExtensions exts := *) return template RANAP_PDU { |
| 1455 | var template RANAP_PDU ret; |
| 1456 | var template RAB_AssignmentRequest.protocolIEs protocolIEs := {}; |
| 1457 | var integer ie_pos := 0; |
| 1458 | |
| 1459 | var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml; |
| 1460 | var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl; |
| 1461 | |
| 1462 | /* RAB-SetupOrModifyList */ |
| 1463 | if (not istemplatekind(rab_sml, "omit")) { |
| 1464 | protocolIEs_rab_sml := { |
| 1465 | { |
| 1466 | id := id_RAB_SetupOrModifyList, |
| 1467 | criticality := ignore, |
| 1468 | value_ := { |
| 1469 | rAB_SetupOrModifyList := rab_sml |
| 1470 | } |
| 1471 | } |
| 1472 | }; |
| 1473 | protocolIEs[ie_pos] := protocolIEs_rab_sml[0]; |
| 1474 | ie_pos := ie_pos + 1; |
| 1475 | } |
| 1476 | |
| 1477 | /* RAB-ReleaseList */ |
| 1478 | if (not istemplatekind(rab_rl, "omit")) { |
| 1479 | protocolIEs_rab_rl := { |
| 1480 | { |
| 1481 | id := id_RAB_ReleaseList, |
| 1482 | criticality := ignore, |
| 1483 | value_ := { |
| 1484 | rAB_ReleaseList := rab_rl |
| 1485 | } |
| 1486 | } |
| 1487 | }; |
| 1488 | protocolIEs[ie_pos] := protocolIEs_rab_rl[0]; |
| 1489 | ie_pos := ie_pos + 1; |
| 1490 | } |
| 1491 | |
| 1492 | |
| 1493 | ret.initiatingMessage := { |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1494 | procedureCode := id_RAB_Assignment, |
| 1495 | criticality := reject, |
| 1496 | value_ := { |
| 1497 | rAB_AssignmentRequest := { |
Daniel Willmann | 9e789be | 2022-02-22 13:30:51 +0100 | [diff] [blame] | 1498 | protocolIEs := protocolIEs, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1499 | protocolExtensions := exts |
| 1500 | } |
| 1501 | } |
| 1502 | } |
Daniel Willmann | 9e789be | 2022-02-22 13:30:51 +0100 | [diff] [blame] | 1503 | |
| 1504 | return ret; |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1505 | } |
| 1506 | |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1507 | function |
| 1508 | ts_RANAP_RabAssResp(template (omit) RAB_SetupOrModifiedList rab_sml := omit, |
| 1509 | template (omit) RAB_FailedList rab_fl := omit, |
| 1510 | template (omit) RAB_AssignmentResponse.protocolExtensions exts := omit) return template RANAP_PDU { |
| 1511 | var template RANAP_PDU ret; |
| 1512 | var template RAB_AssignmentResponse.protocolIEs protocolIEs := {}; |
| 1513 | var integer ie_pos := 0; |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1514 | |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1515 | var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml; |
| 1516 | var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl; |
| 1517 | |
| 1518 | /* RAB-SetupOrModifiedList */ |
| 1519 | if (istemplatekind(rab_sml, "value")) { |
| 1520 | protocolIEs_rab_sml := { |
| 1521 | { |
| 1522 | id := id_RAB_SetupOrModifiedList, |
| 1523 | criticality := ignore, |
| 1524 | value_ := { |
| 1525 | rAB_SetupOrModifiedList := rab_sml |
| 1526 | } |
| 1527 | } |
| 1528 | } |
| 1529 | |
| 1530 | protocolIEs[ie_pos] := protocolIEs_rab_sml[0]; |
| 1531 | ie_pos := ie_pos + 1; |
| 1532 | } |
| 1533 | |
| 1534 | /* TODO: RAB-ReleasedList */ |
| 1535 | /* TODO: RAB-QueuedList */ |
| 1536 | |
| 1537 | /* RAB-FailedList */ |
| 1538 | if (istemplatekind(rab_fl, "value")) { |
| 1539 | protocolIEs_rab_fl := { |
| 1540 | { |
| 1541 | id := id_RAB_FailedList, |
| 1542 | criticality := ignore, |
| 1543 | value_ := { |
| 1544 | rAB_FailedList := rab_fl |
| 1545 | } |
| 1546 | } |
| 1547 | } |
| 1548 | |
| 1549 | protocolIEs[ie_pos] := protocolIEs_rab_fl[0]; |
| 1550 | ie_pos := ie_pos + 1; |
| 1551 | } |
| 1552 | |
| 1553 | /* TODO: RAB-ReleaseFailedList */ |
| 1554 | |
| 1555 | ret.outcome := { |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1556 | procedureCode := id_RAB_Assignment, |
| 1557 | criticality := reject, |
| 1558 | value_ := { |
| 1559 | rAB_AssignmentResponse := { |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1560 | protocolIEs := protocolIEs, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1561 | protocolExtensions := exts |
| 1562 | } |
| 1563 | } |
| 1564 | } |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1565 | |
| 1566 | return ret; |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1567 | } |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1568 | |
| 1569 | function |
| 1570 | tr_RANAP_RabAssResp(template RAB_SetupOrModifiedList rab_sml := omit, |
| 1571 | template RAB_FailedList rab_fl := omit, |
| 1572 | template RAB_AssignmentResponse.protocolExtensions exts := *) return template RANAP_PDU { |
| 1573 | var template RANAP_PDU ret; |
| 1574 | var template RAB_AssignmentResponse.protocolIEs protocolIEs := {}; |
| 1575 | var integer ie_pos := 0; |
| 1576 | |
| 1577 | var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml; |
| 1578 | var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl; |
| 1579 | |
| 1580 | /* RAB-SetupOrModifiedList */ |
| 1581 | if (not istemplatekind(rab_sml, "omit")) { |
| 1582 | protocolIEs_rab_sml := { |
| 1583 | { |
| 1584 | id := id_RAB_SetupOrModifiedList, |
| 1585 | criticality := ignore, |
| 1586 | value_ := { |
| 1587 | rAB_SetupOrModifiedList := rab_sml |
| 1588 | } |
| 1589 | } |
| 1590 | } |
| 1591 | |
| 1592 | protocolIEs[ie_pos] := protocolIEs_rab_sml[0]; |
| 1593 | ie_pos := ie_pos + 1; |
| 1594 | } |
| 1595 | |
| 1596 | /* TODO: RAB-ReleasedList */ |
| 1597 | /* TODO: RAB-QueuedList */ |
| 1598 | |
| 1599 | /* RAB-FailedList */ |
| 1600 | if (not istemplatekind(rab_fl, "omit")) { |
| 1601 | protocolIEs_rab_fl := { |
| 1602 | { |
| 1603 | id := id_RAB_FailedList, |
| 1604 | criticality := ignore, |
| 1605 | value_ := { |
| 1606 | rAB_FailedList := rab_fl |
| 1607 | } |
| 1608 | } |
| 1609 | } |
| 1610 | |
| 1611 | protocolIEs[ie_pos] := protocolIEs_rab_fl[0]; |
| 1612 | ie_pos := ie_pos + 1; |
| 1613 | } |
| 1614 | |
| 1615 | /* TODO: RAB-ReleaseFailedList */ |
| 1616 | |
| 1617 | protocolIEs[ie_pos] := *; |
| 1618 | |
| 1619 | ret.outcome := { |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1620 | procedureCode := id_RAB_Assignment, |
| 1621 | criticality := reject, |
| 1622 | value_ := { |
| 1623 | rAB_AssignmentResponse := { |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1624 | protocolIEs := protocolIEs, |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1625 | protocolExtensions := exts |
| 1626 | } |
| 1627 | } |
| 1628 | } |
Philipp Maier | 6289ea8 | 2022-02-09 15:30:11 +0100 | [diff] [blame] | 1629 | |
| 1630 | return ret; |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1631 | } |
| 1632 | |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1633 | /***************************************************************************************************** |
| 1634 | * |
| 1635 | *****************************************************************************************************/ |
| 1636 | |
| 1637 | /* extract the L3 (NAS) from a given RANAP message */ |
| 1638 | function f_ranap_extract_l3(RANAP_PDU ranap) return template (omit) octetstring |
| 1639 | { |
| 1640 | var integer i; |
| 1641 | |
| 1642 | if (match(ranap, tr_RANAP_initialUE_CS(?, ?, ?, ?, ?)) or |
| 1643 | match(ranap, tr_RANAP_initialUE_PS(?, ?, ?, ?, ?, ?)) ) { |
| 1644 | var InitialUE_Message.protocolIEs ies := ranap.initiatingMessage.value_.initialUE_Message.protocolIEs; |
| 1645 | for (i := 0; i < lengthof(ies); i := i+1) { |
| 1646 | if (ies[i].id == id_NAS_PDU) { |
| 1647 | return ies[i].value_.nAS_PDU; |
| 1648 | } |
| 1649 | } |
Vadim Yanitskiy | e06f228 | 2019-06-20 05:02:49 +0700 | [diff] [blame] | 1650 | } else if (match(ranap, tr_RANAP_DirectTransfer(?))) { |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1651 | var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs; |
| 1652 | for (i := 0; i < lengthof(ies); i := i+1) { |
| 1653 | if (ies[i].id == id_NAS_PDU) { |
| 1654 | return ies[i].value_.nAS_PDU; |
| 1655 | } |
| 1656 | } |
| 1657 | } else { |
| 1658 | /* relocationInformation not supported yet*/ |
| 1659 | } |
| 1660 | return omit; |
| 1661 | } |
| 1662 | |
| 1663 | function f_ranap_extract_sapi(RANAP_PDU ranap) return template (omit) SAPI |
| 1664 | { |
| 1665 | var integer i; |
| 1666 | |
| 1667 | /* InitialUE message has no SAPI */ |
Vadim Yanitskiy | e06f228 | 2019-06-20 05:02:49 +0700 | [diff] [blame] | 1668 | if (match(ranap, tr_RANAP_DirectTransfer(?, omit))) { |
Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame] | 1669 | var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs; |
| 1670 | for (i := 0; i < lengthof(ies); i := i+1) { |
| 1671 | if (ies[i].id == id_SAPI) { |
| 1672 | return ies[i].value_.sAPI; |
| 1673 | } |
| 1674 | } |
| 1675 | } |
| 1676 | return omit; |
| 1677 | } |
| 1678 | |
| 1679 | |
| 1680 | } |