Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 1 | module L3_Templates { |
| 2 | |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 3 | /* L3 Templates, building on top of MobileL3*_Types from Ericsson. |
| 4 | * |
| 5 | * (C) 2017 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 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 12 | import from General_Types all; |
| 13 | import from MobileL3_Types all; |
| 14 | import from MobileL3_CommonIE_Types all; |
| 15 | import from MobileL3_MM_Types all; |
| 16 | import from MobileL3_RRM_Types all; |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 17 | import from MobileL3_CC_Types all; |
| 18 | //import from MobileL3_GMM_SM_Types all; |
| 19 | //import from MobileL3_SMS_Types all; |
| 20 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 21 | |
| 22 | type enumerated CmServiceType { |
| 23 | CM_TYPE_MO_CALL ('0001'B), |
| 24 | CM_TYPE_EMERG_CALL ('0010'B), |
| 25 | CM_TYPE_MO_SMS ('0100'B), |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 26 | CM_TYPE_SS_ACT ('1000'B), |
| 27 | CM_TYPE_VGCS ('1001'B), |
| 28 | CM_TYPE_VBS ('1010'B), |
| 29 | CM_TYPE_LCS ('1011'B) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | |
| 33 | /* send template fro Mobile Identity (TMSI) */ |
| 34 | template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := { |
| 35 | lengthIndicator := 0, /* overwritten */ |
| 36 | mobileIdentityV := { |
| 37 | typeOfIdentity := '000'B, /* overwritten */ |
| 38 | oddEvenInd_identity := { |
| 39 | tmsi_ptmsi := { |
| 40 | oddevenIndicator := '0'B, |
| 41 | fillerDigit := '1111'B, |
| 42 | octets := tmsi |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 { |
| 49 | var IMSI_L3 l3; |
| 50 | var integer len := lengthof(digits); |
| 51 | if (len rem 2 == 1) { /* modulo remainder */ |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 52 | l3.oddevenIndicator := '1'B; |
Harald Welte | ae13625 | 2018-01-24 20:53:21 +0100 | [diff] [blame] | 53 | l3.fillerDigit := omit; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 54 | } else { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 55 | l3.oddevenIndicator := '0'B; |
Harald Welte | ae13625 | 2018-01-24 20:53:21 +0100 | [diff] [blame] | 56 | l3.fillerDigit := '1111'B; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 57 | } |
| 58 | l3.digits := digits; |
| 59 | return l3; |
| 60 | } |
| 61 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 62 | private function f_enc_IMEI_L3(hexstring digits) return IMEI_L3 { |
| 63 | var IMEI_L3 l3; |
| 64 | var integer len := lengthof(digits); |
| 65 | if (len rem 2 == 1) { /* modulo remainder */ |
| 66 | l3.oddevenIndicator := '1'B; |
| 67 | } else { |
| 68 | l3.oddevenIndicator := '0'B; |
| 69 | } |
| 70 | l3.digits := digits; |
| 71 | return l3; |
| 72 | } |
| 73 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 74 | /* send template fro Mobile Identity (IMSI) */ |
| 75 | template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := { |
| 76 | lengthIndicator := 0, /* overwritten */ |
| 77 | mobileIdentityV := { |
| 78 | typeOfIdentity := '000'B, /* overwritten */ |
| 79 | oddEvenInd_identity := { |
| 80 | imsi := f_enc_IMSI_L3(imsi_digits) |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 85 | /* send template fro Mobile Identity (IMEI) */ |
| 86 | template (value) MobileIdentityLV ts_MI_IMEI_LV(hexstring imei_digits) := { |
| 87 | lengthIndicator := 0, /* overwritten */ |
| 88 | mobileIdentityV := { |
| 89 | typeOfIdentity := '000'B, /* overwritten */ |
| 90 | oddEvenInd_identity := { |
| 91 | imei := f_enc_IMEI_L3(imei_digits) |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 97 | /* Send template for Classmark 2 */ |
| 98 | template (value) MobileStationClassmark2_LV ts_CM2 := { |
| 99 | lengthIndicator := 0, |
| 100 | rf_PowerCapability := '000'B, |
| 101 | a5_1 := '0'B, |
| 102 | esind := '1'B, |
| 103 | revisionLevel := '10'B, |
| 104 | spare1_1 := '0'B, |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 105 | mobileStationClassmark2_oct4 := { |
| 106 | fc := '1'B, |
| 107 | vgcs := '0'B, |
| 108 | vbs := '0'B, |
| 109 | sm_Capability := '1'B, |
| 110 | ss_ScreenIndicator := '01'B, |
| 111 | ps_Capability := '1'B, |
| 112 | spare2_1 := '0'B |
| 113 | }, |
| 114 | mobileStationClassmark2_oct5 := { |
| 115 | a5_2 := '0'B, |
| 116 | a5_3 := '1'B, |
| 117 | cmsp := '0'B, |
| 118 | solsa := '0'B, |
| 119 | ucs2 := '0'B, |
| 120 | lcsva_cap := '0'B, |
| 121 | spare5_7 :='0'B, |
| 122 | cm3 := '0'B |
| 123 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 124 | }; |
| 125 | |
| 126 | /* Send template for CM SERVICE REQUEST */ |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 127 | template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(CmServiceType serv_type, MobileIdentityLV mi_lv) := { |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 128 | discriminator := '0000'B, /* overwritten */ |
| 129 | tiOrSkip := { |
| 130 | skipIndicator := '0000'B |
| 131 | }, |
| 132 | msgs := { |
| 133 | mm := { |
| 134 | cMServiceRequest := { |
| 135 | messageType := '000000'B, /* overwritten */ |
| 136 | nsd := '00'B, |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 137 | cm_ServiceType := int2bit(enum2int(serv_type), 4), |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 138 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 139 | mobileStationClassmark2 := ts_CM2, |
| 140 | mobileIdentity := mi_lv, |
| 141 | priorityLevel := omit, |
| 142 | additionalUpdateParameterTV := omit, |
| 143 | deviceProperties := omit |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 149 | template (value) CipheringKeySequenceNumberV ts_CKSN(integer key_seq) := { |
| 150 | keySequence := int2bit(key_seq, 3), |
| 151 | spare := '0'B |
| 152 | } |
| 153 | |
| 154 | /* Send template for CM RE-ESTABLISH REQUEST */ |
| 155 | template (value) PDU_ML3_MS_NW ts_CM_REEST_REQ(integer cksn, MobileIdentityLV mi_lv) := { |
| 156 | discriminator := '0000'B, /* overwritten */ |
| 157 | tiOrSkip := { |
| 158 | skipIndicator := '0000'B |
| 159 | }, |
| 160 | msgs := { |
| 161 | mm := { |
| 162 | cMReEstablReq := { |
| 163 | messageType := '101000'B, /* overwritten */ |
| 164 | nsd := '00'B, |
| 165 | cipheringKeySequenceNumber := ts_CKSN(cksn), |
| 166 | spare := '0000'B, |
| 167 | mobileStationClassmark2 := ts_CM2, |
| 168 | mobileIdentityLV := mi_lv, |
| 169 | locationAreaIdentification := omit, |
| 170 | deviceProperties := omit |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 177 | template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := { |
| 178 | discriminator := discr, |
| 179 | tiOrSkip := { |
| 180 | skipIndicator := '0000'B |
| 181 | }, |
| 182 | msgs := ? |
| 183 | } |
| 184 | |
| 185 | |
| 186 | template PDU_ML3_NW_MS tr_CM_SERV_ACC := { |
| 187 | discriminator := '0101'B, |
| 188 | tiOrSkip := { |
| 189 | skipIndicator := '0000'B |
| 190 | }, |
| 191 | msgs := { |
| 192 | mm := { |
| 193 | cMServiceAccept := { |
| 194 | messageType := '100001'B, |
| 195 | nsd := ? |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 202 | template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := { |
| 203 | discriminator := '0101'B, |
| 204 | tiOrSkip := { |
| 205 | skipIndicator := '0000'B |
| 206 | }, |
| 207 | msgs := { |
| 208 | mm := { |
| 209 | cMServiceReject := { |
| 210 | messageType := '100010'B, |
| 211 | nsd := ?, |
| 212 | rejectCause := rej_cause, |
| 213 | t3246_Value := * |
| 214 | } |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 219 | /* Send template for PAGING RESPONSE */ |
| 220 | template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := { |
| 221 | discriminator := '0000'B, /* overwritten */ |
| 222 | tiOrSkip := { |
| 223 | skipIndicator := '0000'B |
| 224 | }, |
| 225 | msgs := { |
| 226 | rrm := { |
| 227 | pagingResponse := { |
| 228 | messageType := '00000000'B, /* overwritten */ |
| 229 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 230 | spare1_4 := '0000'B, |
| 231 | mobileStationClassmark := ts_CM2, |
| 232 | mobileIdentity := mi_lv, |
| 233 | additionalUpdateParameters := omit |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
Harald Welte | 1516614 | 2017-12-16 23:02:08 +0100 | [diff] [blame] | 239 | template (value) PDU_ML3_MS_NW ts_RRM_ModeModifyAck(ChannelDescription2_V desc, ChannelMode_V mode) := { |
| 240 | discriminator := '0000'B, /* overwritten */ |
| 241 | tiOrSkip := { |
| 242 | skipIndicator := '0000'B |
| 243 | }, |
| 244 | msgs := { |
| 245 | rrm := { |
| 246 | channelModeModifyAck := { |
| 247 | messageType := '00010111'B, |
| 248 | channelDescription := desc, |
| 249 | channelMode := mode, |
| 250 | extendedTSCSet := omit |
| 251 | } |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 256 | template (value) PDU_ML3_MS_NW ts_RRM_CiphModeCompl := { |
| 257 | discriminator := '0000'B, /* overwritten */ |
| 258 | tiOrSkip := { |
| 259 | skipIndicator := '0000'B |
| 260 | }, |
| 261 | msgs := { |
| 262 | rrm := { |
| 263 | cipheringModeComplete := { |
| 264 | messageType := '00110010'B, |
| 265 | mobileEquipmentIdentity := omit |
| 266 | } |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | |
Harald Welte | ecb254b | 2018-01-29 22:01:54 +0100 | [diff] [blame] | 271 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentComplete(OCT1 cause) := { |
| 272 | discriminator := '0000'B, /* overwritten */ |
| 273 | tiOrSkip := { |
| 274 | skipIndicator := '0000'B |
| 275 | }, |
| 276 | msgs := { |
| 277 | rrm := { |
| 278 | assignmentComplete := { |
| 279 | messageType := '00101001'B, |
| 280 | rR_Cause := { |
| 281 | valuePart := cause |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | } |
Harald Welte | 1516614 | 2017-12-16 23:02:08 +0100 | [diff] [blame] | 287 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 288 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := { |
| 289 | discriminator := '0000'B, /* overwritten */ |
| 290 | tiOrSkip := { |
| 291 | skipIndicator := '0000'B |
| 292 | }, |
| 293 | msgs := { |
| 294 | rrm := { |
| 295 | assignmentFailure := { |
| 296 | messageType := '00101111'B, |
| 297 | rR_Cause := { |
| 298 | valuePart := cause |
| 299 | } |
| 300 | } |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 305 | template (value) PDU_ML3_MS_NW ts_RRM_HandoverFailure(OCT1 cause) := { |
| 306 | discriminator := '0000'B, /* overwritten */ |
| 307 | tiOrSkip := { |
| 308 | skipIndicator := '0000'B |
| 309 | }, |
| 310 | msgs := { |
| 311 | rrm := { |
| 312 | handoverFailure := { |
| 313 | messageType := '00101000'B, |
| 314 | rRCause := { |
| 315 | valuePart := cause |
| 316 | }, |
| 317 | pSCause := omit |
| 318 | } |
| 319 | } |
| 320 | } |
| 321 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 322 | |
| 323 | function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { |
| 324 | if (not isvalue(cm3)) { |
| 325 | return omit; |
| 326 | } |
| 327 | var template MobileStationClassmark3_TLV ret := { |
| 328 | elementIdentifier := '20'O, |
| 329 | lengthIndicator := 0, /* overwritten */ |
| 330 | valuePart := cm3 |
| 331 | } |
| 332 | return ret; |
| 333 | } |
| 334 | |
| 335 | template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2, |
| 336 | template (omit) MobileStationClassmark3_TLV cm3 := omit) := { |
| 337 | discriminator := '0110'B, |
| 338 | tiOrSkip := { |
| 339 | skipIndicator := '0000'B |
| 340 | }, |
| 341 | msgs := { |
| 342 | rrm := { |
| 343 | classmarkChange := { |
| 344 | messageType := '00010110'B, |
| 345 | mobileStationClassmark2 := cm2, |
| 346 | mobileStationClassmark3 := cm3 |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame^] | 352 | template (value) PDU_ML3_MS_NW ts_RRM_UL_REL(OCT1 cause) := { |
| 353 | discriminator := '0110'B, |
| 354 | tiOrSkip := { |
| 355 | skipIndicator := '0000'B |
| 356 | }, |
| 357 | msgs := { |
| 358 | rrm := { |
| 359 | uplinkRelease := { |
| 360 | messageType := '00001110'B, |
| 361 | rR_Cause := { |
| 362 | valuePart := cause |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | template PDU_ML3_MS_NW tr_RRM_RR_STATUS(template OCT1 cause := ?) := { |
| 370 | discriminator := '0110'B, |
| 371 | tiOrSkip := { |
| 372 | skipIndicator := '0000'B |
| 373 | }, |
| 374 | msgs := { |
| 375 | rrm := { |
| 376 | rR_Status := { |
| 377 | messageType := '00010010'B, |
| 378 | rR_Cause := { |
| 379 | valuePart := cause |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | |
| 387 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 388 | template PDU_ML3_MS_NW ts_ML3_MO := { |
| 389 | discriminator := '0000'B, |
| 390 | tiOrSkip := { |
| 391 | skipIndicator := '0000'B |
| 392 | }, |
| 393 | msgs := ? |
| 394 | } |
| 395 | |
| 396 | template LocationUpdatingType ts_ML3_IE_LuType := { |
| 397 | lut := ?, |
| 398 | spare1_1 := '0'B, |
| 399 | fop := '0'B |
| 400 | } |
| 401 | |
| 402 | template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := { |
| 403 | lut := '00'B |
| 404 | } |
| 405 | |
| 406 | template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := { |
| 407 | lut := '01'B |
| 408 | } |
| 409 | |
| 410 | template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := { |
| 411 | lut := '10'B |
| 412 | } |
| 413 | |
| 414 | template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := { |
| 415 | keySequence := int2bit(cksn, 3), |
| 416 | spare := '0'B |
| 417 | } |
| 418 | |
| 419 | template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai, |
| 420 | MobileIdentityLV mi, MobileStationClassmark1_V cm1) |
| 421 | modifies ts_ML3_MO := { |
| 422 | msgs := { |
| 423 | mm := { |
| 424 | locationUpdateRequest := { |
| 425 | messageType := '001000'B, |
| 426 | nsd := '00'B, /* ? */ |
| 427 | locationUpdatingType := lu_type, |
| 428 | cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0), |
| 429 | locationAreaIdentification := lai, |
| 430 | mobileStationClassmark1 := cm1, |
| 431 | mobileIdentityLV := mi, |
| 432 | classmarkInformationType2_forUMTS := omit, |
| 433 | additionalUpdateParameterTV := omit, |
| 434 | deviceProperties := omit, |
| 435 | mS_NetworkFeatureSupport := omit |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | } |
| 440 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 441 | template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := { |
| 442 | msgs := { |
| 443 | mm := { |
| 444 | tmsiReallocComplete := { |
| 445 | messageType := '011011'B, |
| 446 | nsd := '00'B |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := { |
| 453 | discriminator := '0101'B, |
| 454 | tiOrSkip := { |
| 455 | skipIndicator := '0000'B |
| 456 | }, |
| 457 | msgs := { |
| 458 | mm := { |
| 459 | locationUpdateAccept := { |
| 460 | messageType := '000010'B, |
| 461 | nsd := '00'B, |
| 462 | locationAreaIdentification := ?, |
| 463 | mobileIdentityTLV := *, |
| 464 | followOnProceed := *, |
| 465 | cTS_Permission := *, |
| 466 | equivalentPLMNs := *, |
| 467 | emergencyNumberList := *, |
| 468 | perMS_T3212 := * |
| 469 | } |
| 470 | } |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := { |
| 475 | discriminator := '0101'B, |
| 476 | tiOrSkip := { |
| 477 | skipIndicator := '0000'B |
| 478 | }, |
| 479 | msgs := { |
| 480 | mm := { |
| 481 | locationUpdateReject := { |
| 482 | messageType := '000100'B, |
| 483 | nsd := '00'B, |
| 484 | rejectCause := cause, |
| 485 | t3246_Value := * |
| 486 | } |
| 487 | } |
| 488 | } |
| 489 | } |
| 490 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 491 | template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template BIT3 id_type := ?) := { |
| 492 | discriminator := '0101'B, |
| 493 | tiOrSkip := { |
| 494 | skipIndicator := '0000'B |
| 495 | }, |
| 496 | msgs := { |
| 497 | mm := { |
| 498 | identityRequest := { |
| 499 | messageType := '011000'B, |
| 500 | nsd := '00'B, |
| 501 | identityType := id_type, |
| 502 | spare1_5 := ? |
| 503 | } |
| 504 | } |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp(MobileIdentityLV mi) modifies ts_ML3_MO := { |
| 509 | msgs := { |
| 510 | mm := { |
| 511 | identityResponse := { |
| 512 | messageType := '011001'B, |
| 513 | nsd := '00'B, |
| 514 | mobileIdentityLV := mi, |
| 515 | p_TMSI_TypeTV := omit, |
| 516 | routingAreaIdentification2TLV := omit, |
| 517 | p_TMSISignature2TLV := omit |
| 518 | } |
| 519 | } |
| 520 | } |
| 521 | } |
| 522 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMSI(hexstring imsi) := |
| 523 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMSI_LV(imsi))); |
| 524 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMEI(hexstring imei) := |
| 525 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); |
| 526 | |
| 527 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 528 | template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { |
| 529 | rf_PowerCapability := '010'B, |
| 530 | a5_1 := a5_1_unavail, |
| 531 | esind := '1'B, |
| 532 | revisionLevel := rev, |
| 533 | spare1_1 := '0'B |
| 534 | } |
| 535 | |
| 536 | template PDU_ML3_MS_NW ts_ML3_MO_MM_IMSI_DET_Ind(MobileIdentityLV mi, |
| 537 | template MobileStationClassmark1_V cm1 := ts_CM1) |
| 538 | modifies ts_ML3_MO := { |
| 539 | msgs := { |
| 540 | mm := { |
| 541 | imsiDetachIndication := { |
| 542 | messageType := '000001'B, |
| 543 | nsd := '00'B, |
| 544 | mobileStationClassmark1 := cm1, |
| 545 | mobileIdentityLV := mi |
| 546 | } |
| 547 | } |
| 548 | } |
| 549 | } |
| 550 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 551 | template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { |
| 552 | discriminator := '0011'B, |
| 553 | tiOrSkip := { |
| 554 | transactionId := { |
| 555 | tio := '000'B, |
| 556 | tiFlag := '0'B, |
| 557 | tIExtension := omit |
| 558 | } |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := { |
| 563 | elementIdentifier := '5E'O, |
| 564 | lengthIndicator := 0, /* overwritten */ |
| 565 | numberingPlanIdentification := '0000'B, |
| 566 | typeOfNumber := '000'B, /* unknown */ |
| 567 | ext1 := '0'B, |
| 568 | digits := digits |
| 569 | } |
| 570 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 571 | template CalledPartyBCD_Number tr_Called(template hexstring digits) := { |
| 572 | elementIdentifier := '5E'O, |
| 573 | lengthIndicator := ?, |
| 574 | numberingPlanIdentification := ?, |
| 575 | typeOfNumber := ?, |
| 576 | ext1 := ?, |
| 577 | digits := digits |
| 578 | } |
| 579 | |
| 580 | template CallingPartyBCD_Number tr_Calling(template hexstring digits) := { |
| 581 | elementIdentifier := '5C'O, |
| 582 | lengthIndicator := ?, |
| 583 | oct3 := ?, |
| 584 | digits := digits |
| 585 | } |
| 586 | |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 587 | type integer SpeechVer; |
| 588 | |
| 589 | template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { |
| 590 | speechVersionIndication := int2bit(ver-1,3) & suffix, |
| 591 | spare1_1 := '0'B, |
| 592 | cTM_or_Spare := '0'B, |
| 593 | coding := '0'B, |
| 594 | extension_octet_3a_3b := '0'B |
| 595 | } |
| 596 | |
| 597 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B); |
| 598 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B); |
| 599 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 600 | template (value) BearerCapability_TLV ts_Bcap_voice := { |
| 601 | elementIdentifier := '04'O, |
| 602 | lengthIndicator := 0, /* overwritten */ |
| 603 | octet3 := { |
| 604 | informationTransferCapability := '000'B, |
| 605 | transferMode := '0'B, |
| 606 | codingStandard := '0'B, |
| 607 | radioChannelRequirement := '11'B, /* FR preferred */ |
| 608 | extension_octet_3 := '0'B, /* overwritten */ |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 609 | speech_aux_3a_3b := { |
| 610 | valueof(ts_SpeechAuxHR(3)), |
| 611 | valueof(ts_SpeechAuxFR(3)), |
| 612 | valueof(ts_SpeechAuxFR(2)), |
| 613 | valueof(ts_SpeechAuxFR(1)), |
| 614 | valueof(ts_SpeechAuxHR(1)) |
| 615 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 616 | }, |
| 617 | octet4 := omit, |
| 618 | octet5 := omit, |
| 619 | octet6 := omit, |
| 620 | octet7 := omit |
| 621 | } |
| 622 | |
| 623 | template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 624 | discriminator := '0011'B, |
| 625 | tiOrSkip := { |
| 626 | transactionId := { |
| 627 | tio := int2bit(tid, 3), |
| 628 | tiFlag := '0'B, |
| 629 | tIExtension := omit |
| 630 | } |
| 631 | }, |
| 632 | msgs := { |
| 633 | cc := { |
| 634 | setup_MS_NW := { |
| 635 | messageType := '000101'B, |
| 636 | nsd := '00'B, |
| 637 | bcRepeatIndicator := omit, |
| 638 | bearerCapability1 := bcap, |
| 639 | bearerCapability2 := omit, |
| 640 | facility := omit, |
| 641 | callingPartySubAddress := omit, |
| 642 | calledPartyBCD_Number := ts_Called(called), |
| 643 | calledPartySubAddress := omit, |
| 644 | llc_RepeatIndicator := omit, |
| 645 | lowLayerCompatibility1 := omit, |
| 646 | lowLayerCompatibility2 := omit, |
| 647 | hlc_RepeatIndicator := omit, |
| 648 | highLayerCompatibility1 := omit, |
| 649 | highLayerCompatibility2 := omit, |
| 650 | user_user := omit, |
| 651 | ss_VersionIndicator := omit, |
| 652 | clir_Suppression := omit, |
| 653 | clir_Invocation := omit, |
| 654 | cC_Capabilities := omit, |
| 655 | facility_ccbs1 := omit, |
| 656 | facility_ccbs2 := omit, |
| 657 | streamIdentifier := omit, |
| 658 | supportedCodecs := omit, |
| 659 | redial := omit |
| 660 | } |
| 661 | } |
| 662 | } |
| 663 | } |
| 664 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 665 | template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 666 | discriminator := '0011'B, |
| 667 | tiOrSkip := { |
| 668 | transactionId := { |
| 669 | tio := int2bit(tid, 3), |
| 670 | tiFlag := '0'B, |
| 671 | tIExtension := omit |
| 672 | } |
| 673 | }, |
| 674 | msgs := { |
| 675 | cc := { |
| 676 | emergencySetup := { |
| 677 | messageType := '001110'B, |
| 678 | nsd := '00'B, |
| 679 | bearerCapability := bcap, |
| 680 | streamIdentifier := omit, |
| 681 | supportedCodecs := omit, |
| 682 | emergencyCategory := omit |
| 683 | } |
| 684 | } |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 689 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { |
| 690 | discriminator := '0011'B, |
| 691 | tiOrSkip := { |
| 692 | transactionId := { |
| 693 | tio := int2bit(tid, 3), |
| 694 | tiFlag := ?, |
| 695 | tIExtension := omit |
| 696 | } |
| 697 | }, |
| 698 | msgs := { |
| 699 | cc := { |
| 700 | callProceeding := { |
| 701 | messageType := '000010'B, |
| 702 | nsd := '00'B, |
| 703 | repeatIndicator := *, |
| 704 | bearerCapability1 := *, |
| 705 | bearerCapability2 := *, |
| 706 | facility := *, |
| 707 | progressIndicator := *, |
| 708 | priorityGranted := *, |
| 709 | networkCCCapabilities := * |
| 710 | } |
| 711 | } |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := { |
| 716 | discriminator := '0011'B, |
| 717 | tiOrSkip := { |
| 718 | transactionId := { |
| 719 | tio := int2bit(tid, 3), |
| 720 | tiFlag := ?, |
| 721 | tIExtension := omit |
| 722 | } |
| 723 | }, |
| 724 | msgs := { |
| 725 | cc := { |
| 726 | alerting_NW_MS := { |
| 727 | messageType := '000001'B, |
| 728 | nsd := '00'B, |
| 729 | facility := *, |
| 730 | progressIndicator := *, |
| 731 | user_user := * |
| 732 | } |
| 733 | } |
| 734 | } |
| 735 | } |
| 736 | |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 737 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := { |
| 738 | discriminator := '0011'B, |
| 739 | tiOrSkip := { |
| 740 | transactionId := { |
| 741 | tio := int2bit(tid, 3), |
| 742 | tiFlag := '1'B, |
| 743 | tIExtension := omit |
| 744 | } |
| 745 | }, |
| 746 | msgs := { |
| 747 | cc := { |
| 748 | connect_NW_MS := { |
| 749 | messageType := '000111'B, |
| 750 | nsd := '00'B, |
| 751 | facility := *, |
| 752 | progressIndicator := *, |
| 753 | connectedNumber := *, |
| 754 | connectedSubAddress := *, |
| 755 | user_user := * |
| 756 | } |
| 757 | } |
| 758 | } |
| 759 | } |
| 760 | |
| 761 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := { |
| 762 | discriminator := '0011'B, |
| 763 | tiOrSkip := { |
| 764 | transactionId := { |
| 765 | tio := int2bit(tid, 3), |
| 766 | tiFlag := '0'B, |
| 767 | tIExtension := omit |
| 768 | } |
| 769 | }, |
| 770 | msgs := { |
| 771 | cc := { |
| 772 | connectAck := { |
| 773 | messageType := '001111'B, |
| 774 | nsd := '00'B |
| 775 | } |
| 776 | } |
| 777 | } |
| 778 | } |
| 779 | |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 780 | template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { |
| 781 | discriminator := '0011'B, |
| 782 | tiOrSkip := { |
| 783 | transactionId := { |
| 784 | tio := int2bit(tid, 3), |
| 785 | tiFlag := ?, |
| 786 | tIExtension := omit |
| 787 | } |
| 788 | }, |
| 789 | msgs := { |
| 790 | cc := { |
| 791 | disconnect_NW_MS := { |
| 792 | messageType := '100101'B, |
| 793 | nsd := '00'B, |
| 794 | cause := ?, |
| 795 | facility := *, |
| 796 | progressIndicator := *, |
| 797 | user_user := *, |
| 798 | allowedActions := * |
| 799 | } |
| 800 | } |
| 801 | } |
| 802 | } |
| 803 | |
| 804 | template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := { |
| 805 | discriminator := '0011'B, |
| 806 | tiOrSkip := { |
| 807 | transactionId := { |
| 808 | tio := int2bit(tid, 3), |
| 809 | tiFlag := ?, |
| 810 | tIExtension := omit |
| 811 | } |
| 812 | }, |
| 813 | msgs := { |
| 814 | cc := { |
| 815 | release_NW_MS := { |
| 816 | messageType := '101101'B, |
| 817 | nsd := '00'B, |
| 818 | cause := ?, |
| 819 | secondCause := *, |
| 820 | facility := *, |
| 821 | user_user := * |
| 822 | } |
| 823 | } |
| 824 | } |
| 825 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 826 | |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 827 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := { |
| 828 | discriminator := '0011'B, |
| 829 | tiOrSkip := { |
| 830 | transactionId := { |
| 831 | tio := int2bit(tid, 3), |
| 832 | tiFlag := '0'B, |
| 833 | tIExtension := omit |
| 834 | } |
| 835 | }, |
| 836 | msgs := { |
| 837 | cc := { |
| 838 | releaseComplete_MS_NW := { |
| 839 | messageType := '101010'B, |
| 840 | nsd := '00'B, |
| 841 | cause := omit, |
| 842 | facility := omit, |
| 843 | user_user := omit, |
| 844 | ss_VersionIndicator := omit |
| 845 | } |
| 846 | } |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 851 | template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { |
| 852 | discriminator := '0101'B, |
| 853 | tiOrSkip := { |
| 854 | skipIndicator := '0000'B |
| 855 | }, |
| 856 | msgs := { |
| 857 | mm := { |
| 858 | authenticationRequest := { |
| 859 | messageType := '010010'B, |
| 860 | nsd := '00'B, |
| 861 | cipheringKeySequenceNumber := ?, |
| 862 | spare2_4 := ?, |
| 863 | authenticationParRAND := rand, |
| 864 | authenticationParAUTN := * |
| 865 | } |
| 866 | } |
| 867 | } |
| 868 | } |
| 869 | |
| 870 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := { |
| 871 | discriminator := '0101'B, |
| 872 | tiOrSkip := { |
| 873 | skipIndicator := '0000'B |
| 874 | }, |
| 875 | msgs := { |
| 876 | mm := { |
| 877 | authenticationResponse := { |
| 878 | messageType := '010100'B, |
| 879 | nsd := '00'B, |
| 880 | authenticationParSRES := sres, |
| 881 | authenticationParSRESext := omit |
| 882 | } |
| 883 | } |
| 884 | } |
| 885 | } |
| 886 | |
| 887 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := { |
| 888 | discriminator := '0101'B, |
| 889 | tiOrSkip := { |
| 890 | skipIndicator := '0000'B |
| 891 | }, |
| 892 | msgs := { |
| 893 | mm := { |
| 894 | authenticationResponse := { |
| 895 | messageType := '010100'B, |
| 896 | nsd := '00'B, |
| 897 | authenticationParSRES := sres, |
| 898 | authenticationParSRESext := { |
| 899 | elementIdentifier := '21'O, |
| 900 | lengthIndicator := 0, /* overwritten */ |
| 901 | valueField := res |
| 902 | } |
| 903 | } |
| 904 | } |
| 905 | } |
| 906 | } |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 907 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 908 | template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid, |
| 909 | template BearerCapability_TLV bcap := omit) := { |
| 910 | discriminator := '0011'B, |
| 911 | tiOrSkip := { |
| 912 | transactionId := { |
| 913 | tio := int2bit(tid, 3), |
| 914 | tiFlag := '1'B, /* response from destination */ |
| 915 | tIExtension := omit |
| 916 | } |
| 917 | }, |
| 918 | msgs := { |
| 919 | cc := { |
| 920 | callConfirmed := { |
| 921 | messageType := '001000'B, |
| 922 | nsd := '00'B, |
| 923 | repeatIndicator := omit, |
| 924 | bearerCapability1 := bcap, |
| 925 | bearerCapability2 := omit, |
| 926 | cause := omit, |
| 927 | cC_Capabilities := omit, |
| 928 | streamIdentifier := omit, |
| 929 | supportedCodecs := omit |
| 930 | } |
| 931 | } |
| 932 | } |
| 933 | } |
| 934 | |
| 935 | |
| 936 | template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *, |
| 937 | template hexstring calling := *, |
| 938 | template BearerCapability_TLV bcap := *) := { |
| 939 | discriminator := '0011'B, |
| 940 | tiOrSkip := { |
| 941 | transactionId := { |
| 942 | tio := int2bit(tid, 3), |
| 943 | tiFlag := '0'B, /* from originator */ |
| 944 | tIExtension := omit |
| 945 | } |
| 946 | }, |
| 947 | msgs := { |
| 948 | cc := { |
| 949 | setup_NW_MS := { |
| 950 | messageType := '000101'B, |
| 951 | nsd := '00'B, |
| 952 | bcRepeatIndicator := *, |
| 953 | bearerCapability1 := bcap, |
| 954 | bearerCapability2 := *, |
| 955 | facility := *, |
| 956 | progressIndicator := *, |
| 957 | signal := *, |
| 958 | callingPartyBCD_Number := tr_Calling(calling) ifpresent, |
| 959 | callingPartySubAddress := *, |
| 960 | calledPartyBCD_Number := tr_Called(called) ifpresent, |
| 961 | calledPartySubAddress := *, |
| 962 | redirectingPartyBCDNumber := *, |
| 963 | redirectingPartySubaddress := *, |
| 964 | llc_RepeatIndicator := *, |
| 965 | lowLayerCompatibility1 := *, |
| 966 | lowLayerCompatibility2 := *, |
| 967 | hlc_RepeatIndicator := *, |
| 968 | highLayerCompatibility1 := *, |
| 969 | highLayerCompatibility2 := *, |
| 970 | user_user := *, |
| 971 | priority := *, |
| 972 | alert := *, |
| 973 | networkCCCapabilities := *, |
| 974 | causeofNoCli := *, |
| 975 | backupBearerCapacity := * |
| 976 | } |
| 977 | } |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 982 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 983 | } |