Harald Welte | 0db4413 | 2019-10-17 11:09:05 +0200 | [diff] [blame] | 1 | module M3UA_Templates { |
| 2 | |
| 3 | /* M3UA Templates, building on top of M3UA_Types from Ericsson. |
| 4 | * |
| 5 | * (C) 2019 by Harald Welte <laforge@gnumonks.org> |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Released under the terms of GNU General Public License, Version 2 or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 12 | */ |
| 13 | |
| 14 | import from M3UA_Types all; |
| 15 | import from General_Types all; |
| 16 | import from Osmocom_Types all; |
| 17 | |
| 18 | const OCT1 c_M3UA_VERSION := '01'O; |
| 19 | |
| 20 | const OCT2 c_M3UA_ST_T_STATE_CHG := '0001'O; |
| 21 | const OCT2 c_M3UA_ST_I_RESERVED := '0001'O; |
| 22 | const OCT2 c_M3UA_ST_I_AS_INACTIVE := '0002'O; |
| 23 | const OCT2 c_M3UA_ST_I_AS_ACTIVE := '0003'O; |
| 24 | const OCT2 c_M3UA_ST_I_AS_PENDING := '0004'O; |
| 25 | |
| 26 | const OCT2 c_M3UA_ST_T_OTHER := '0002'O; |
| 27 | const OCT2 c_M3UA_ST_I_INSUFF_RESRC := '0001'O |
| 28 | const OCT2 c_M3UA_ST_I_ALTERNATE_ASP := '0002'O |
| 29 | const OCT2 c_M3UA_ST_I_ASP_FAILUREP := '0003'O |
| 30 | |
| 31 | private function f_aspid_or_omit(template (omit) OCT4 aspid) |
| 32 | return template (omit) M3UA_ASP_Identifier { |
| 33 | var template (omit) M3UA_ASP_Identifier id; |
| 34 | if (istemplatekind(aspid, "omit")) { |
| 35 | return omit; |
| 36 | } else { |
| 37 | id.tag := '0011'O; |
| 38 | id.lengthInd := 8; |
| 39 | id.aSPIdentifier := aspid; |
| 40 | return id; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | function tr_M3UA_asp_id(template OCT4 aspid) |
| 45 | return template M3UA_ASP_Identifier { |
| 46 | var template M3UA_ASP_Identifier id := { |
| 47 | tag := '0011'O, |
| 48 | lengthInd := 8, |
| 49 | aSPIdentifier := aspid |
| 50 | }; |
| 51 | if (istemplatekind(aspid, "omit")) { |
| 52 | return omit; |
| 53 | } else if (istemplatekind(aspid, "*")) { |
| 54 | return *; |
| 55 | } else { |
| 56 | return id; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | |
| 61 | /*********************************************************************** |
| 62 | * ASPSM Class |
| 63 | ***********************************************************************/ |
| 64 | |
| 65 | template (value) PDU_M3UA ts_M3UA_ASPUP(template (omit) OCT4 aspid := omit, |
| 66 | template (omit) octetstring infostr := omit) := { |
| 67 | m3UA_ASPUP := { |
| 68 | version := c_M3UA_VERSION, |
| 69 | reserved := '00'O, |
| 70 | messageClassAndType := '0301'O, |
| 71 | messageLength := 0, // overwritten |
| 72 | messageParameters := { |
| 73 | aSP_Identifier := f_aspid_or_omit(aspid), |
| 74 | info_String := omit |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | template (present) PDU_M3UA tr_M3UA_ASPUP(template OCT4 aspid := *, |
| 79 | template octetstring infostr := omit) := { |
| 80 | m3UA_ASPUP := { |
| 81 | version := c_M3UA_VERSION, |
| 82 | reserved := '00'O, |
| 83 | messageClassAndType := '0301'O, |
Harald Welte | dc9b691 | 2019-11-05 16:53:56 +0100 | [diff] [blame] | 84 | messageLength := ?, // overwritten |
Harald Welte | 0db4413 | 2019-10-17 11:09:05 +0200 | [diff] [blame] | 85 | messageParameters := { |
| 86 | aSP_Identifier := tr_M3UA_asp_id(aspid), |
| 87 | info_String := * |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | template (value) PDU_M3UA ts_M3UA_ASPUP_ACK := { |
| 93 | m3UA_ASPUP_Ack := { |
| 94 | version := c_M3UA_VERSION, |
| 95 | reserved := '00'O, |
| 96 | messageClassAndType := '0304'O, |
| 97 | messageLength := 0, // overwritten |
| 98 | messageParameters := { |
| 99 | info_String := omit |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | template (present) PDU_M3UA tr_M3UA_ASPUP_ACK := { |
| 104 | m3UA_ASPUP_Ack := { |
| 105 | version := c_M3UA_VERSION, |
| 106 | reserved := '00'O, |
| 107 | messageClassAndType := '0304'O, |
| 108 | messageLength := ?, |
| 109 | messageParameters := { |
| 110 | info_String := * |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | template (value) PDU_M3UA ts_M3UA_ASPDN := { |
| 116 | m3UA_ASPDN := { |
| 117 | version := c_M3UA_VERSION, |
| 118 | reserved := '00'O, |
| 119 | messageClassAndType := '0302'O, |
| 120 | messageLength := 0, // overwritten |
| 121 | messageParameters := { |
| 122 | info_String := omit |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | template (present) PDU_M3UA tr_M3UA_ASPDN := { |
| 127 | m3UA_ASPDN := { |
| 128 | version := c_M3UA_VERSION, |
| 129 | reserved := '00'O, |
| 130 | messageClassAndType := '0302'O, |
| 131 | messageLength := ?, |
| 132 | messageParameters := { |
| 133 | info_String := * |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | template (value) PDU_M3UA ts_M3UA_ASPDN_ACK := { |
| 139 | m3UA_ASPUP_Ack := { |
| 140 | version := c_M3UA_VERSION, |
| 141 | reserved := '00'O, |
| 142 | messageClassAndType := '0305'O, |
| 143 | messageLength := 0, // overwritten |
| 144 | messageParameters := { |
| 145 | info_String := omit |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | template (present) PDU_M3UA tr_M3UA_ASPDN_ACK := { |
| 150 | m3UA_ASPUP_Ack := { |
| 151 | version := c_M3UA_VERSION, |
| 152 | reserved := '00'O, |
| 153 | messageClassAndType := '0305'O, |
| 154 | messageLength := ?, |
| 155 | messageParameters := { |
| 156 | info_String := * |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | template (value) M3UA_Heartbeat_Data ts_M3UA_hb_data(template (value) octetstring hb_data) := { |
| 162 | tag := '0009'O, |
| 163 | lengthInd := 0, // overwritten |
| 164 | heartbeat_Data := hb_data |
| 165 | } |
| 166 | |
| 167 | template (present) M3UA_Heartbeat_Data tr_M3UA_hb_data(template (present) octetstring hb_data) := { |
| 168 | tag := '0009'O, |
| 169 | lengthInd := ?, |
| 170 | heartbeat_Data := hb_data |
| 171 | } |
| 172 | |
| 173 | template (value) PDU_M3UA ts_M3UA_BEAT(template (omit) M3UA_Heartbeat_Data hbd := omit) := { |
| 174 | m3UA_BEAT := { |
| 175 | version := c_M3UA_VERSION, |
| 176 | reserved := '00'O, |
| 177 | messageClassAndType := '0303'O, |
| 178 | messageLength := 0, // overwritten |
| 179 | messageParameters := { |
| 180 | heartbeat_Data := hbd |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | template (present) PDU_M3UA tr_M3UA_BEAT(template M3UA_Heartbeat_Data hbd := *) := { |
| 185 | m3UA_BEAT := { |
| 186 | version := c_M3UA_VERSION, |
| 187 | reserved := '00'O, |
| 188 | messageClassAndType := '0303'O, |
| 189 | messageLength := ?, |
| 190 | messageParameters := { |
| 191 | heartbeat_Data := hbd |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | template (value) PDU_M3UA ts_M3UA_BEAT_ACK(template (omit) M3UA_Heartbeat_Data hb_data) := { |
| 197 | m3UA_BEAT_Ack := { |
| 198 | version := c_M3UA_VERSION, |
| 199 | reserved := '00'O, |
| 200 | messageClassAndType := '0306'O, |
| 201 | messageLength := 0, // overwritten |
| 202 | messageParameters := { |
| 203 | heartbeat_Data := hb_data |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | template (present) PDU_M3UA tr_M3UA_BEAT_ACK(template M3UA_Heartbeat_Data hb_data := *) := { |
| 208 | m3UA_BEAT_Ack := { |
| 209 | version := c_M3UA_VERSION, |
| 210 | reserved := '00'O, |
| 211 | messageClassAndType := '0306'O, |
| 212 | messageLength := ?, |
| 213 | messageParameters := { |
| 214 | heartbeat_Data := hb_data |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | /*********************************************************************** |
| 223 | * ASPTM Class |
| 224 | ***********************************************************************/ |
| 225 | |
| 226 | |
| 227 | const M3UA_Traffic_Mode_Type c_M3UA_TMT_override := { |
| 228 | tag := '000B'O, |
| 229 | lengthInd := 8, |
| 230 | trafficModeType := int2oct(1, 4) |
| 231 | } |
| 232 | |
| 233 | const M3UA_Traffic_Mode_Type c_M3UA_TMT_loadshare := { |
| 234 | tag := '000B'O, |
| 235 | lengthInd := 8, |
| 236 | trafficModeType := int2oct(2, 4) |
| 237 | } |
| 238 | |
| 239 | const M3UA_Traffic_Mode_Type c_M3UA_TMT_broadcast := { |
| 240 | tag := '000B'O, |
| 241 | lengthInd := 8, |
| 242 | trafficModeType := int2oct(3, 4) |
| 243 | } |
| 244 | |
| 245 | function ts_M3UA_routing_ctx(template (omit) octetstring rctx) |
| 246 | return template (omit) M3UA_Routing_Context { |
| 247 | var template (omit) M3UA_Routing_Context id; |
| 248 | if (istemplatekind(rctx, "omit")) { |
| 249 | return omit; |
| 250 | } else { |
| 251 | id.tag := '0006'O; |
| 252 | id.lengthInd := 0; // overwritten |
| 253 | id.routingContext := rctx; |
| 254 | return id; |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | function tr_M3UA_routing_ctx(template octetstring rctx) |
| 259 | return template M3UA_Routing_Context { |
| 260 | var template M3UA_Routing_Context id; |
| 261 | if (istemplatekind(rctx, "omit")) { |
| 262 | return omit; |
| 263 | } else if (istemplatekind(rctx, "*")) { |
| 264 | return *; |
| 265 | } else { |
| 266 | id.tag := '0006'O; |
| 267 | id.lengthInd := ?; |
| 268 | id.routingContext := rctx; |
| 269 | return id; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | template (value) PDU_M3UA ts_M3UA_ASPAC(template (omit) M3UA_Traffic_Mode_Type tmt, |
| 274 | template (omit) OCT4 rctx) := { |
| 275 | m3UA_ASPAC := { |
| 276 | version := c_M3UA_VERSION, |
| 277 | reserved := '00'O, |
| 278 | messageClassAndType := '0401'O, |
| 279 | messageLength := 0, // overwritten |
| 280 | messageParameters := { |
| 281 | traffic_Mode_Type := tmt, |
| 282 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 283 | info_String := omit |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | template (present) PDU_M3UA tr_M3UA_ASPAC(template M3UA_Traffic_Mode_Type tmt, |
| 288 | template OCT4 rctx) := { |
| 289 | m3UA_ASPAC := { |
| 290 | version := c_M3UA_VERSION, |
| 291 | reserved := '00'O, |
| 292 | messageClassAndType := '0401'O, |
| 293 | messageLength := ?, |
| 294 | messageParameters := { |
| 295 | traffic_Mode_Type := tmt, |
| 296 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 297 | info_String := * |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | template (value) PDU_M3UA ts_M3UA_ASPAC_ACK(template (omit) M3UA_Traffic_Mode_Type tmt, |
| 303 | template (omit) OCT4 rctx) := { |
| 304 | m3UA_ASPAC_Ack := { |
| 305 | version := c_M3UA_VERSION, |
| 306 | reserved := '00'O, |
| 307 | messageClassAndType := '0403'O, |
| 308 | messageLength := 0, // overwritten |
| 309 | messageParameters := { |
| 310 | traffic_Mode_Type := tmt, |
| 311 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 312 | info_String := omit |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | template (present) PDU_M3UA tr_M3UA_ASPAC_ACK(template M3UA_Traffic_Mode_Type tmt, |
| 317 | template OCT4 rctx) := { |
| 318 | m3UA_ASPAC_Ack := { |
| 319 | version := c_M3UA_VERSION, |
| 320 | reserved := '00'O, |
| 321 | messageClassAndType := '0403'O, |
| 322 | messageLength := ?, |
| 323 | messageParameters := { |
| 324 | traffic_Mode_Type := tmt, |
| 325 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 326 | info_String := * |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | template (value) PDU_M3UA ts_M3UA_ASPIA(template (omit) OCT4 rctx) := { |
| 332 | m3UA_ASPIA := { |
| 333 | version := c_M3UA_VERSION, |
| 334 | reserved := '00'O, |
| 335 | messageClassAndType := '0402'O, |
| 336 | messageLength := 0, // overwritten |
| 337 | messageParameters := { |
| 338 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 339 | info_String := omit |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | template (present) PDU_M3UA tr_M3UA_ASPIA(template OCT4 rctx) := { |
| 344 | m3UA_ASPIA := { |
| 345 | version := c_M3UA_VERSION, |
| 346 | reserved := '00'O, |
| 347 | messageClassAndType := '0402'O, |
| 348 | messageLength := ?, |
| 349 | messageParameters := { |
| 350 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 351 | info_String := * |
| 352 | } |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | |
| 357 | template (value) PDU_M3UA ts_M3UA_ASPIA_ACK(template (omit) OCT4 rctx) := { |
| 358 | m3UA_ASPIA_Ack := { |
| 359 | version := c_M3UA_VERSION, |
| 360 | reserved := '00'O, |
| 361 | messageClassAndType := '0404'O, |
| 362 | messageLength := 0, // overwritten |
| 363 | messageParameters := { |
| 364 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 365 | info_String := omit |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | template (present) PDU_M3UA tr_M3UA_ASPIA_ACK(template OCT4 rctx) := { |
| 370 | m3UA_ASPIA_Ack := { |
| 371 | version := c_M3UA_VERSION, |
| 372 | reserved := '00'O, |
| 373 | messageClassAndType := '0404'O, |
| 374 | messageLength := ?, |
| 375 | messageParameters := { |
| 376 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 377 | info_String := * |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | |
Harald Welte | 42bcc44 | 2021-02-07 21:26:30 +0100 | [diff] [blame] | 382 | /*********************************************************************** |
| 383 | * SSNM Class |
| 384 | ***********************************************************************/ |
| 385 | |
| 386 | template (value) M3UA_Point_Code ts_M3UA_PC(uint24_t pc, uint8_t mask := 0) := { |
| 387 | mask := int2oct(mask, 1), |
| 388 | affected_Point_Code := int2oct(pc, 3) |
| 389 | } |
| 390 | |
| 391 | template (value) M3UA_Affected_Point_Codes ts_M3UA_AffPc(template (value) M3UA_Point_Codes pcs) := { |
| 392 | tag := '0012'O, |
| 393 | lengthInd := 0, |
| 394 | pointCodes := pcs |
| 395 | } |
| 396 | template (present) M3UA_Affected_Point_Codes tr_M3UA_AffPc(template (present) M3UA_Point_Codes pcs) := { |
| 397 | tag := '0012'O, |
| 398 | lengthInd := ?, |
| 399 | pointCodes := pcs |
| 400 | } |
| 401 | |
| 402 | template (value) M3UA_User_Cause ts_M3UA_UserCause(template (value) OCT2 cause, |
| 403 | template (value) OCT2 user) := { |
| 404 | tag := '0204'O, |
| 405 | lengthInd := 0, |
| 406 | cause := cause, |
| 407 | user := user |
| 408 | } |
| 409 | template (present) M3UA_User_Cause tr_M3UA_UserCause(template (present) OCT2 cause, |
| 410 | template (present) OCT2 user) := { |
| 411 | tag := '0204'O, |
| 412 | lengthInd := ?, |
| 413 | cause := cause, |
| 414 | user := user |
| 415 | } |
| 416 | |
| 417 | template (value) PDU_M3UA ts_M3UA_DUNA(template (value) M3UA_Point_Codes affected_pcs, |
| 418 | template (omit) OCT4 rctx := omit) := { |
| 419 | m3UA_DUNA := { |
| 420 | version := c_M3UA_VERSION, |
| 421 | reserved := '00'O, |
| 422 | messageClassAndType := '0201'O, |
| 423 | messageLength := 0, |
| 424 | messageParameters := { |
| 425 | network_Appearance := omit, |
| 426 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 427 | affected_Point_Codes := ts_M3UA_AffPc(affected_pcs), |
| 428 | info_String := omit |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | template (present) PDU_M3UA tr_M3UA_DUNA(template (present) M3UA_Point_Codes affected_pcs := ?, |
| 433 | template OCT4 rctx := *):= { |
| 434 | m3UA_DUNA := { |
| 435 | version := c_M3UA_VERSION, |
| 436 | reserved := '00'O, |
| 437 | messageClassAndType := '0201'O, |
| 438 | messageLength := ?, |
| 439 | messageParameters := { |
| 440 | network_Appearance := *, |
| 441 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 442 | affected_Point_Codes := tr_M3UA_AffPc(affected_pcs), |
| 443 | info_String := * |
| 444 | } |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | template (value) PDU_M3UA ts_M3UA_DAVA(template (value) M3UA_Point_Codes affected_pcs, |
| 449 | template (omit) OCT4 rctx := omit) := { |
| 450 | m3UA_DAVA := { |
| 451 | version := c_M3UA_VERSION, |
| 452 | reserved := '00'O, |
| 453 | messageClassAndType := '0202'O, |
| 454 | messageLength := 0, |
| 455 | messageParameters := { |
| 456 | network_Appearance := omit, |
| 457 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 458 | affected_Point_Codes := ts_M3UA_AffPc(affected_pcs), |
| 459 | info_String := omit |
| 460 | } |
| 461 | } |
| 462 | } |
| 463 | template (present) PDU_M3UA tr_M3UA_DAVA(template (present) M3UA_Point_Codes affected_pcs := ?, |
| 464 | template OCT4 rctx := *):= { |
| 465 | m3UA_DAVA := { |
| 466 | version := c_M3UA_VERSION, |
| 467 | reserved := '00'O, |
| 468 | messageClassAndType := '0202'O, |
| 469 | messageLength := ?, |
| 470 | messageParameters := { |
| 471 | network_Appearance := *, |
| 472 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 473 | affected_Point_Codes := tr_M3UA_AffPc(affected_pcs), |
| 474 | info_String := * |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | template (value) PDU_M3UA ts_M3UA_DAUD(template (value) M3UA_Point_Codes affected_pcs, |
| 480 | template (omit) OCT4 rctx := omit) := { |
| 481 | m3UA_DAUD := { |
| 482 | version := c_M3UA_VERSION, |
| 483 | reserved := '00'O, |
| 484 | messageClassAndType := '0203'O, |
| 485 | messageLength := 0, |
| 486 | messageParameters := { |
| 487 | network_Appearance := omit, |
| 488 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 489 | affected_Point_Codes := ts_M3UA_AffPc(affected_pcs), |
| 490 | info_String := omit |
| 491 | } |
| 492 | } |
| 493 | } |
| 494 | template (present) PDU_M3UA tr_M3UA_DAUD(template (present) M3UA_Point_Codes affected_pcs := ?, |
| 495 | template OCT4 rctx := *):= { |
| 496 | m3UA_DAUD := { |
| 497 | version := c_M3UA_VERSION, |
| 498 | reserved := '00'O, |
| 499 | messageClassAndType := '0203'O, |
| 500 | messageLength := ?, |
| 501 | messageParameters := { |
| 502 | network_Appearance := *, |
| 503 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 504 | affected_Point_Codes := tr_M3UA_AffPc(affected_pcs), |
| 505 | info_String := * |
| 506 | } |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | template (value) PDU_M3UA ts_M3UA_SCON(template (value) M3UA_Point_Codes affected_pcs, |
| 511 | template (omit) OCT4 rctx := omit) := { |
| 512 | m3UA_SCON := { |
| 513 | version := c_M3UA_VERSION, |
| 514 | reserved := '00'O, |
| 515 | messageClassAndType := '0204'O, |
| 516 | messageLength := 0, |
| 517 | messageParameters := { |
| 518 | network_Appearance := omit, |
| 519 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 520 | affected_Point_Codes := ts_M3UA_AffPc(affected_pcs), |
| 521 | concerned_Destination := omit, |
| 522 | congestion_Indicators := omit, |
| 523 | info_String := omit |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | template (present) PDU_M3UA tr_M3UA_SCON(template (present) M3UA_Point_Codes affected_pcs := ?, |
| 528 | template OCT4 rctx := *):= { |
| 529 | m3UA_SCON := { |
| 530 | version := c_M3UA_VERSION, |
| 531 | reserved := '00'O, |
| 532 | messageClassAndType := '0204'O, |
| 533 | messageLength := ?, |
| 534 | messageParameters := { |
| 535 | network_Appearance := *, |
| 536 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 537 | affected_Point_Codes := tr_M3UA_AffPc(affected_pcs), |
| 538 | concerned_Destination := *, |
| 539 | congestion_Indicators := *, |
| 540 | info_String := * |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | template (value) PDU_M3UA ts_M3UA_DUPU(template (value) M3UA_Point_Codes affected_pcs, |
| 546 | template (value) OCT2 cause, |
| 547 | template (value) OCT2 user, |
| 548 | template (omit) OCT4 rctx := omit) := { |
| 549 | m3UA_DUPU := { |
| 550 | version := c_M3UA_VERSION, |
| 551 | reserved := '00'O, |
| 552 | messageClassAndType := '0205'O, |
| 553 | messageLength := 0, |
| 554 | messageParameters := { |
| 555 | network_Appearance := omit, |
| 556 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 557 | affected_Point_Codes := ts_M3UA_AffPc(affected_pcs), |
| 558 | user_Cause := ts_M3UA_UserCause(cause, user), |
| 559 | info_String := omit |
| 560 | } |
| 561 | } |
| 562 | } |
| 563 | template (present) PDU_M3UA tr_M3UA_DUPU(template (present) M3UA_Point_Codes affected_pcs := ?, |
| 564 | template (present) OCT2 cause := ?, |
| 565 | template (present) OCT2 user := ?, |
| 566 | template OCT4 rctx := *):= { |
| 567 | m3UA_DUPU := { |
| 568 | version := c_M3UA_VERSION, |
| 569 | reserved := '00'O, |
| 570 | messageClassAndType := '0205'O, |
| 571 | messageLength := ?, |
| 572 | messageParameters := { |
| 573 | network_Appearance := *, |
| 574 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 575 | affected_Point_Codes := tr_M3UA_AffPc(affected_pcs), |
| 576 | user_Cause := tr_M3UA_UserCause(cause, user), |
| 577 | info_String := * |
| 578 | } |
| 579 | } |
| 580 | } |
| 581 | |
| 582 | template (present) PDU_M3UA tr_M3UA_DRST := { |
| 583 | m3UA_DRST := { |
| 584 | version := c_M3UA_VERSION, |
| 585 | reserved := '00'O, |
| 586 | messageClassAndType := '0206'O, |
| 587 | messageLength := ?, |
| 588 | messageParameters := ? |
| 589 | } |
| 590 | } |
| 591 | |
| 592 | template (present) PDU_M3UA tr_M3UA_SSNM := (tr_M3UA_DUNA, tr_M3UA_DAVA, tr_M3UA_DAUD, |
| 593 | tr_M3UA_SCON, tr_M3UA_DUPU, tr_M3UA_DRST); |
Harald Welte | 0db4413 | 2019-10-17 11:09:05 +0200 | [diff] [blame] | 594 | |
| 595 | /*********************************************************************** |
| 596 | * MGMT Class |
| 597 | ***********************************************************************/ |
| 598 | |
| 599 | template (value) M3UA_Error_Code ts_M3UA_err_code(template (value) OCT4 val) := { |
| 600 | tag := '000C'O, |
| 601 | lengthInd := 8, |
| 602 | errorCode := val |
| 603 | } |
| 604 | template (present) M3UA_Error_Code tr_M3UA_err_code(template (present) OCT4 val) := { |
| 605 | tag := '000C'O, |
| 606 | lengthInd := 8, |
| 607 | errorCode := val |
| 608 | } |
| 609 | |
| 610 | template (value) M3UA_Status ts_M3UA_status(template (value) OCT2 status_type, |
| 611 | template (value) OCT2 status_info) := { |
| 612 | tag := '000D'O, |
| 613 | lengthInd := 8, |
| 614 | statusType := status_type, |
| 615 | statusInfo := status_info |
| 616 | } |
| 617 | |
| 618 | template (present) M3UA_Status tr_M3UA_status(template (present) OCT2 status_type, |
| 619 | template (present) OCT2 status_info) := { |
| 620 | tag := '000D'O, |
| 621 | lengthInd := 8, |
| 622 | statusType := status_type, |
| 623 | statusInfo := status_info |
| 624 | } |
| 625 | |
| 626 | |
| 627 | template (value) PDU_M3UA ts_M3UA_ERR(template (value) OCT4 err_code, |
| 628 | template (omit) OCT4 rctx) := { |
| 629 | m3UA_ERR := { |
| 630 | version := c_M3UA_VERSION, |
| 631 | reserved := '00'O, |
| 632 | messageClassAndType := '0000'O, |
| 633 | messageLength := 0, // overwritten |
| 634 | messageParameters := { |
| 635 | error_Code := ts_M3UA_err_code(err_code), |
| 636 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 637 | affected_Point_Codes := omit, |
| 638 | network_Appearance := omit, |
| 639 | diagnostic_information := omit |
| 640 | } |
| 641 | } |
| 642 | } |
| 643 | template (present) PDU_M3UA tr_M3UA_ERR(template (present) OCT4 err_code, |
| 644 | template OCT4 rctx) := { |
| 645 | m3UA_ERR := { |
| 646 | version := c_M3UA_VERSION, |
| 647 | reserved := '00'O, |
| 648 | messageClassAndType := '0000'O, |
| 649 | messageLength := ?, |
| 650 | messageParameters := { |
| 651 | error_Code := tr_M3UA_err_code(err_code), |
| 652 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 653 | affected_Point_Codes := *, |
| 654 | network_Appearance := *, |
| 655 | diagnostic_information := * |
| 656 | } |
| 657 | } |
| 658 | } |
| 659 | |
| 660 | |
| 661 | template (value) PDU_M3UA ts_M3UA_NOTIFY(template (value) OCT2 status_type, |
| 662 | template (value) OCT2 status_info, |
| 663 | template (omit) OCT4 rctx, |
| 664 | template (omit) OCT4 aspid := omit, |
| 665 | template (omit) octetstring infostr := omit) := { |
| 666 | m3UA_NOTIFY := { |
| 667 | version := c_M3UA_VERSION, |
| 668 | reserved := '00'O, |
| 669 | messageClassAndType := '0001'O, |
| 670 | messageLength := 0, // overwritten |
| 671 | messageParameters := { |
| 672 | status := ts_M3UA_status(status_type, status_info), |
| 673 | aSP_Identifier := f_aspid_or_omit(aspid), |
| 674 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 675 | info_String := omit |
| 676 | } |
| 677 | } |
| 678 | } |
| 679 | template (present) PDU_M3UA tr_M3UA_NOTIFY(template (present) OCT2 status_type, |
| 680 | template (present) OCT2 status_info, |
| 681 | template OCT4 rctx, |
| 682 | template OCT4 aspid := *, |
| 683 | template octetstring infostr := *) := { |
| 684 | m3UA_NOTIFY := { |
| 685 | version := c_M3UA_VERSION, |
| 686 | reserved := '00'O, |
| 687 | messageClassAndType := '0001'O, |
| 688 | messageLength := ?, |
| 689 | messageParameters := { |
| 690 | status := tr_M3UA_status(status_type, status_info), |
| 691 | aSP_Identifier := *, |
| 692 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 693 | info_String := * |
| 694 | } |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | /*********************************************************************** |
| 699 | * Message Transfer Class |
| 700 | ***********************************************************************/ |
| 701 | |
| 702 | template (value) M3UA_Protocol_Data ts_M3UA_protocol_data(template (value) OCT4 opc, |
| 703 | template (value) OCT4 dpc, |
| 704 | template (value) OCT1 si, |
| 705 | template (value) OCT1 ni, |
| 706 | template (value) OCT1 mp, |
| 707 | template (value) OCT1 sls, |
| 708 | template (value) octetstring data) := { |
| 709 | tag := '0210'O, |
| 710 | lengthInd := 0, // overwritten |
| 711 | oPC := opc, |
| 712 | dPC := dpc, |
| 713 | sI := si, |
| 714 | nI := ni, |
| 715 | mP := mp, |
| 716 | sLS := sls, |
| 717 | userProtocolData := data |
| 718 | } |
| 719 | template (present) M3UA_Protocol_Data tr_M3UA_protocol_data(template (present) OCT4 opc, |
| 720 | template (present) OCT4 dpc, |
| 721 | template (present) OCT1 si, |
| 722 | template (present) OCT1 ni, |
| 723 | template (present) OCT1 mp, |
| 724 | template (present) OCT1 sls, |
| 725 | template (present) octetstring data) := { |
| 726 | tag := '0210'O, |
| 727 | lengthInd := ?, |
| 728 | oPC := opc, |
| 729 | dPC := dpc, |
| 730 | sI := si, |
| 731 | nI := ni, |
| 732 | mP := mp, |
| 733 | sLS := sls, |
| 734 | userProtocolData := data |
| 735 | } |
| 736 | |
| 737 | |
| 738 | template (value) PDU_M3UA ts_M3UA_DATA(template (omit) OCT4 rctx, |
| 739 | template (value) M3UA_Protocol_Data data) := { |
| 740 | m3UA_DATA := { |
| 741 | version := c_M3UA_VERSION, |
| 742 | reserved := '00'O, |
| 743 | messageClassAndType := '0101'O, |
| 744 | messageLength := 0, // overwritten |
| 745 | messageParameters :={ |
| 746 | network_Appearance := omit, |
| 747 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 748 | protocol_Data := data, |
| 749 | correlation_ID := omit |
| 750 | } |
| 751 | } |
| 752 | } |
| 753 | template (present) PDU_M3UA tr_M3UA_DATA(template OCT4 rctx, |
| 754 | template (present) M3UA_Protocol_Data data) := { |
| 755 | m3UA_DATA := { |
| 756 | version := c_M3UA_VERSION, |
| 757 | reserved := '00'O, |
| 758 | messageClassAndType := '0101'O, |
| 759 | messageLength := ?, // overwritten |
| 760 | messageParameters := { |
| 761 | network_Appearance := *, |
| 762 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 763 | protocol_Data := data, |
| 764 | correlation_ID := * |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | /*********************************************************************** |
| 770 | * Routing Key Management |
| 771 | ***********************************************************************/ |
| 772 | |
| 773 | template (value) M3UA_Local_Routing_Key_Id ts_M3UA_lrkid(template (value) OCT4 id) := { |
| 774 | tag := '020a'O, |
| 775 | lengthInd := 8, |
| 776 | localRkId := id |
| 777 | } |
| 778 | |
| 779 | template (present) M3UA_Local_Routing_Key_Id tr_M3UA_lrkid(template (present) OCT4 id) := { |
| 780 | tag := '020a'O, |
| 781 | lengthInd := 8, |
| 782 | localRkId := id |
| 783 | } |
| 784 | |
| 785 | |
| 786 | template (value) M3UA_Routing_Key ts_M3UA_rkey(OCT4 id, OCT3 dpc, |
| 787 | template (omit) M3UA_Traffic_Mode_Type tmt := omit, |
| 788 | template (omit) OCT4 rctx := omit) := { |
| 789 | tag := '0207'O, |
| 790 | lengthInd := 0, // overwritten |
| 791 | routingKey := { |
| 792 | local_Routing_Key_Id := ts_M3UA_lrkid(id), |
| 793 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 794 | traffic_Mode_Type := tmt, |
| 795 | destination_Point_Code := { |
| 796 | tag := '020b'O, |
| 797 | lengthInd := 8, |
| 798 | pointCode := { '00'O, dpc } |
| 799 | }, |
| 800 | network_Appearance := omit, |
| 801 | service_Indicators := omit, |
| 802 | opc_List := omit |
| 803 | } |
| 804 | } |
| 805 | template (present) M3UA_Routing_Key tr_M3UA_rkey(template (present) OCT4 id, template (present) OCT3 dpc, |
| 806 | template M3UA_Traffic_Mode_Type tmt := *, |
| 807 | template OCT4 rctx := *) := { |
| 808 | tag := '0207'O, |
| 809 | lengthInd := ?, |
| 810 | routingKey := { |
| 811 | local_Routing_Key_Id := tr_M3UA_lrkid(id), |
| 812 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 813 | traffic_Mode_Type := tmt, |
| 814 | destination_Point_Code := { |
| 815 | tag := '020b'O, |
| 816 | lengthInd := 8, |
| 817 | pointCode := { '00'O, dpc } |
| 818 | }, |
| 819 | network_Appearance := omit, |
| 820 | service_Indicators := omit, |
| 821 | opc_List := omit |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | |
| 826 | const OCT4 c_M3UA_REGSTS_SUCCESS := '00000000'O; |
| 827 | const OCT4 c_M3UA_REGSTS_ERR_UNKNOWN := '00000001'O; |
| 828 | const OCT4 c_M3UA_REGSTS_ERR_INVAL_DPC := '00000002'O; |
| 829 | const OCT4 c_M3UA_REGSTS_ERR_INVAL_NA := '00000003'O; |
| 830 | const OCT4 c_M3UA_REGSTS_ERR_INVAL_RKEY := '00000004'O; |
| 831 | const OCT4 c_M3UA_REGSTS_ERR_EPERM := '00000005'O; |
| 832 | // ... |
| 833 | |
| 834 | const OCT4 c_m3UA_DEREGSTS_SUCCESS := '00000000'O; |
| 835 | const OCT4 c_m3UA_DEREGSTS_ERR_UNKNOWN := '00000001'O; |
| 836 | const OCT4 c_m3UA_DEREGSTS_ERR_INVAL_RCTX := '00000002'O; |
| 837 | const OCT4 c_m3UA_DEREGSTS_ERR_EPERM := '00000003'O; |
| 838 | const OCT4 c_m3UA_DEREGSTS_ERR_NOT_REG := '00000004'O; |
| 839 | const OCT4 c_m3UA_DEREGSTS_ERR_ASP_ACTIVE := '00000005'O; |
| 840 | |
| 841 | template (value) M3UA_Registration_Result ts_M3UA_reg_res(template (value) OCT4 id, |
| 842 | template (value) OCT4 status, |
| 843 | template (value) OCT4 rctx) := { |
| 844 | tag := '0208'O, |
| 845 | lengthInd := 0, // overwritten |
| 846 | registrationResult := { |
| 847 | local_Routing_Key_Id := ts_M3UA_lrkid(id), |
| 848 | registration_Status := { |
| 849 | tag := '0212'O, |
| 850 | lengthInd := 8, |
| 851 | registrationStatus := status |
| 852 | }, |
| 853 | routing_Context := ts_M3UA_routing_ctx(rctx) |
| 854 | } |
| 855 | } |
| 856 | template (present) M3UA_Registration_Result tr_M3UA_reg_res(template (present) OCT4 id, |
| 857 | template (present) OCT4 status, |
| 858 | template (present) OCT4 rctx) := { |
| 859 | tag := '0208'O, |
| 860 | lengthInd := ?, |
| 861 | registrationResult := { |
| 862 | local_Routing_Key_Id := tr_M3UA_lrkid(id), |
| 863 | registration_Status := { |
| 864 | tag := '0212'O, |
| 865 | lengthInd := 8, |
| 866 | registrationStatus := status |
| 867 | }, |
| 868 | routing_Context := tr_M3UA_routing_ctx(rctx) |
| 869 | } |
| 870 | } |
| 871 | |
| 872 | template (value) M3UA_Deregistration_Result ts_M3UA_dereg_res(template (value) OCT4 rctx, |
| 873 | template (value) OCT4 status) := { |
| 874 | tag := '0209'O, |
| 875 | lengthInd := 0, // overwritten |
| 876 | deregistrationResult := { |
| 877 | routing_Context := ts_M3UA_routing_ctx(rctx), |
| 878 | deregistration_Status := { |
| 879 | tag := '0213'O, |
| 880 | lengthInd := 8, |
| 881 | deregistrationStatus := status |
| 882 | } |
| 883 | } |
| 884 | } |
| 885 | template (present) M3UA_Deregistration_Result tr_M3UA_dereg_res(template (present) OCT4 rctx, |
| 886 | template (present) OCT4 status) := { |
| 887 | tag := '0209'O, |
| 888 | lengthInd := ?, |
| 889 | deregistrationResult := { |
| 890 | routing_Context := tr_M3UA_routing_ctx(rctx), |
| 891 | deregistration_Status := { |
| 892 | tag := '0213'O, |
| 893 | lengthInd := 8, |
| 894 | deregistrationStatus := status |
| 895 | } |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | |
| 900 | template (value) PDU_M3UA ts_M3UA_REG_REQ(template (value) M3UA_Routing_Keys rkeys) := { |
| 901 | m3UA_REG_REQ := { |
| 902 | version := c_M3UA_VERSION, |
| 903 | reserved := '00'O, |
| 904 | messageClassAndType := '0901'O, |
| 905 | messageLength := 0, // overwritten |
| 906 | messageParameters := rkeys |
| 907 | } |
| 908 | } |
| 909 | template (present) PDU_M3UA tr_M3UA_REG_REQ(template (present) M3UA_Routing_Keys rkeys) := { |
| 910 | m3UA_REG_REQ := { |
| 911 | version := c_M3UA_VERSION, |
| 912 | reserved := '00'O, |
| 913 | messageClassAndType := '0901'O, |
| 914 | messageLength := ?, |
| 915 | messageParameters := rkeys |
| 916 | } |
| 917 | } |
| 918 | |
| 919 | |
| 920 | template (value) PDU_M3UA ts_M3UA_REG_RSP(template (value) M3UA_Registration_Results res) := { |
| 921 | m3UA_REG_RSP := { |
| 922 | version := c_M3UA_VERSION, |
| 923 | reserved := '00'O, |
| 924 | messageClassAndType := '0902'O, |
| 925 | messageLength := 0, // overwritten |
| 926 | messageParameters := res |
| 927 | } |
| 928 | } |
| 929 | template (present) PDU_M3UA tr_M3UA_REG_RSP(template (present) M3UA_Registration_Results res) := { |
| 930 | m3UA_REG_RSP := { |
| 931 | version := c_M3UA_VERSION, |
| 932 | reserved := '00'O, |
| 933 | messageClassAndType := '0902'O, |
| 934 | messageLength := ?, |
| 935 | messageParameters := res |
| 936 | } |
| 937 | } |
| 938 | |
| 939 | template (value) PDU_M3UA ts_M3UA_DEREG_REQ(template (value) M3UA_Routing_Context rctx) := { |
| 940 | m3UA_DEREG_REQ := { |
| 941 | version := c_M3UA_VERSION, |
| 942 | reserved := '00'O, |
| 943 | messageClassAndType := '0903'O, |
| 944 | messageLength := 0, // overwritten |
| 945 | messageParameters := { |
| 946 | routing_Context := rctx |
| 947 | } |
| 948 | } |
| 949 | } |
| 950 | template (present) PDU_M3UA tr_M3UA_DEREG_REQ(template (present) M3UA_Routing_Context rctx) := { |
| 951 | m3UA_DEREG_REQ := { |
| 952 | version := c_M3UA_VERSION, |
| 953 | reserved := '00'O, |
| 954 | messageClassAndType := '0903'O, |
| 955 | messageLength := ?, |
| 956 | messageParameters := { |
| 957 | routing_Context := rctx |
| 958 | } |
| 959 | } |
| 960 | } |
| 961 | |
| 962 | template (value) PDU_M3UA ts_M3UA_DEREG_RSP(template (value) M3UA_Deregistration_Results res) := { |
| 963 | m3UA_DEREG_RSP := { |
| 964 | version := c_M3UA_VERSION, |
| 965 | reserved := '00'O, |
| 966 | messageClassAndType := '0904'O, |
| 967 | messageLength := 0, // overwritten |
| 968 | messageParameters := res |
| 969 | } |
| 970 | } |
| 971 | template (present) PDU_M3UA tr_M3UA_DEREG_RSP(template (present) M3UA_Deregistration_Results res) := { |
| 972 | m3UA_DEREG_RSP := { |
| 973 | version := c_M3UA_VERSION, |
| 974 | reserved := '00'O, |
| 975 | messageClassAndType := '0904'O, |
| 976 | messageLength := ?, |
| 977 | messageParameters := res |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | |
| 982 | |
| 983 | } |