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; |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 13 | import from Osmocom_Types all; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 14 | import from MobileL3_Types all; |
| 15 | import from MobileL3_CommonIE_Types all; |
| 16 | import from MobileL3_MM_Types all; |
| 17 | import from MobileL3_RRM_Types all; |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 18 | import from MobileL3_CC_Types all; |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 19 | import from MobileL3_GMM_SM_Types all; |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 20 | //import from MobileL3_SMS_Types all; |
| 21 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 22 | |
| 23 | type enumerated CmServiceType { |
| 24 | CM_TYPE_MO_CALL ('0001'B), |
| 25 | CM_TYPE_EMERG_CALL ('0010'B), |
| 26 | CM_TYPE_MO_SMS ('0100'B), |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 27 | CM_TYPE_SS_ACT ('1000'B), |
| 28 | CM_TYPE_VGCS ('1001'B), |
| 29 | CM_TYPE_VBS ('1010'B), |
| 30 | CM_TYPE_LCS ('1011'B) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 31 | } |
| 32 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 33 | template ML3_Cause_TLV ts_ML3_Cause(BIT7 cause, BIT4 loc := '0001'B, BIT2 std := '11'B) := { |
| 34 | elementIdentifier := '08'O, |
| 35 | lengthIndicator := 0, /* overwritten */ |
| 36 | oct3 := { |
| 37 | location := loc, |
| 38 | spare1_1 := '0'B, |
| 39 | codingStandard := std, |
| 40 | ext1 := '0'B, |
| 41 | recommendation := omit, |
| 42 | ext2 := omit |
| 43 | }, |
| 44 | oct4 := { |
| 45 | causeValue := cause, |
| 46 | ext3 := '1'B |
| 47 | }, |
| 48 | diagnostics := omit |
| 49 | } |
| 50 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 51 | |
| 52 | /* send template fro Mobile Identity (TMSI) */ |
| 53 | template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := { |
| 54 | lengthIndicator := 0, /* overwritten */ |
| 55 | mobileIdentityV := { |
| 56 | typeOfIdentity := '000'B, /* overwritten */ |
| 57 | oddEvenInd_identity := { |
| 58 | tmsi_ptmsi := { |
| 59 | oddevenIndicator := '0'B, |
| 60 | fillerDigit := '1111'B, |
| 61 | octets := tmsi |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 67 | /* send template fro Mobile Identity (TMSI) */ |
| 68 | template MobileIdentityTLV ts_MI_TMSI_TLV(OCT4 tmsi) := { |
| 69 | elementIdentifier := '0000000'B, /* overwritten */ |
| 70 | spare1 := '0'B, |
| 71 | mobileIdentityLV := ts_MI_TMSI_LV(tmsi) |
| 72 | } |
| 73 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 74 | private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 { |
| 75 | var IMSI_L3 l3; |
| 76 | var integer len := lengthof(digits); |
| 77 | if (len rem 2 == 1) { /* modulo remainder */ |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 78 | l3.oddevenIndicator := '1'B; |
Harald Welte | ae13625 | 2018-01-24 20:53:21 +0100 | [diff] [blame] | 79 | l3.fillerDigit := omit; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 80 | } else { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 81 | l3.oddevenIndicator := '0'B; |
Harald Welte | ae13625 | 2018-01-24 20:53:21 +0100 | [diff] [blame] | 82 | l3.fillerDigit := '1111'B; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 83 | } |
| 84 | l3.digits := digits; |
| 85 | return l3; |
| 86 | } |
| 87 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 88 | private function f_enc_IMEI_L3(hexstring digits) return IMEI_L3 { |
| 89 | var IMEI_L3 l3; |
| 90 | var integer len := lengthof(digits); |
| 91 | if (len rem 2 == 1) { /* modulo remainder */ |
| 92 | l3.oddevenIndicator := '1'B; |
| 93 | } else { |
| 94 | l3.oddevenIndicator := '0'B; |
| 95 | } |
| 96 | l3.digits := digits; |
| 97 | return l3; |
| 98 | } |
| 99 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 100 | /* send template fro Mobile Identity (IMSI) */ |
| 101 | template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := { |
| 102 | lengthIndicator := 0, /* overwritten */ |
| 103 | mobileIdentityV := { |
| 104 | typeOfIdentity := '000'B, /* overwritten */ |
| 105 | oddEvenInd_identity := { |
| 106 | imsi := f_enc_IMSI_L3(imsi_digits) |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 111 | /* send template fro Mobile Identity (IMEI) */ |
| 112 | template (value) MobileIdentityLV ts_MI_IMEI_LV(hexstring imei_digits) := { |
| 113 | lengthIndicator := 0, /* overwritten */ |
| 114 | mobileIdentityV := { |
| 115 | typeOfIdentity := '000'B, /* overwritten */ |
| 116 | oddEvenInd_identity := { |
| 117 | imei := f_enc_IMEI_L3(imei_digits) |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 123 | /* Send template for Classmark 2 */ |
| 124 | template (value) MobileStationClassmark2_LV ts_CM2 := { |
| 125 | lengthIndicator := 0, |
| 126 | rf_PowerCapability := '000'B, |
| 127 | a5_1 := '0'B, |
| 128 | esind := '1'B, |
| 129 | revisionLevel := '10'B, |
| 130 | spare1_1 := '0'B, |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 131 | mobileStationClassmark2_oct4 := { |
| 132 | fc := '1'B, |
| 133 | vgcs := '0'B, |
| 134 | vbs := '0'B, |
| 135 | sm_Capability := '1'B, |
| 136 | ss_ScreenIndicator := '01'B, |
| 137 | ps_Capability := '1'B, |
| 138 | spare2_1 := '0'B |
| 139 | }, |
| 140 | mobileStationClassmark2_oct5 := { |
| 141 | a5_2 := '0'B, |
| 142 | a5_3 := '1'B, |
| 143 | cmsp := '0'B, |
| 144 | solsa := '0'B, |
| 145 | ucs2 := '0'B, |
| 146 | lcsva_cap := '0'B, |
| 147 | spare5_7 :='0'B, |
| 148 | cm3 := '0'B |
| 149 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 150 | }; |
| 151 | |
| 152 | /* Send template for CM SERVICE REQUEST */ |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 153 | 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] | 154 | discriminator := '0000'B, /* overwritten */ |
| 155 | tiOrSkip := { |
| 156 | skipIndicator := '0000'B |
| 157 | }, |
| 158 | msgs := { |
| 159 | mm := { |
| 160 | cMServiceRequest := { |
| 161 | messageType := '000000'B, /* overwritten */ |
| 162 | nsd := '00'B, |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 163 | cm_ServiceType := int2bit(enum2int(serv_type), 4), |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 164 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 165 | mobileStationClassmark2 := ts_CM2, |
| 166 | mobileIdentity := mi_lv, |
| 167 | priorityLevel := omit, |
| 168 | additionalUpdateParameterTV := omit, |
| 169 | deviceProperties := omit |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 175 | template (value) CipheringKeySequenceNumberV ts_CKSN(integer key_seq) := { |
| 176 | keySequence := int2bit(key_seq, 3), |
| 177 | spare := '0'B |
| 178 | } |
| 179 | |
| 180 | /* Send template for CM RE-ESTABLISH REQUEST */ |
| 181 | template (value) PDU_ML3_MS_NW ts_CM_REEST_REQ(integer cksn, MobileIdentityLV mi_lv) := { |
| 182 | discriminator := '0000'B, /* overwritten */ |
| 183 | tiOrSkip := { |
| 184 | skipIndicator := '0000'B |
| 185 | }, |
| 186 | msgs := { |
| 187 | mm := { |
| 188 | cMReEstablReq := { |
| 189 | messageType := '101000'B, /* overwritten */ |
| 190 | nsd := '00'B, |
| 191 | cipheringKeySequenceNumber := ts_CKSN(cksn), |
| 192 | spare := '0000'B, |
| 193 | mobileStationClassmark2 := ts_CM2, |
| 194 | mobileIdentityLV := mi_lv, |
| 195 | locationAreaIdentification := omit, |
| 196 | deviceProperties := omit |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 203 | template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := { |
| 204 | discriminator := discr, |
| 205 | tiOrSkip := { |
| 206 | skipIndicator := '0000'B |
| 207 | }, |
| 208 | msgs := ? |
| 209 | } |
| 210 | |
| 211 | |
| 212 | template PDU_ML3_NW_MS tr_CM_SERV_ACC := { |
| 213 | discriminator := '0101'B, |
| 214 | tiOrSkip := { |
| 215 | skipIndicator := '0000'B |
| 216 | }, |
| 217 | msgs := { |
| 218 | mm := { |
| 219 | cMServiceAccept := { |
| 220 | messageType := '100001'B, |
| 221 | nsd := ? |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 228 | template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := { |
| 229 | discriminator := '0101'B, |
| 230 | tiOrSkip := { |
| 231 | skipIndicator := '0000'B |
| 232 | }, |
| 233 | msgs := { |
| 234 | mm := { |
| 235 | cMServiceReject := { |
| 236 | messageType := '100010'B, |
| 237 | nsd := ?, |
| 238 | rejectCause := rej_cause, |
| 239 | t3246_Value := * |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 245 | /* Send template for PAGING RESPONSE */ |
| 246 | template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := { |
| 247 | discriminator := '0000'B, /* overwritten */ |
| 248 | tiOrSkip := { |
| 249 | skipIndicator := '0000'B |
| 250 | }, |
| 251 | msgs := { |
| 252 | rrm := { |
| 253 | pagingResponse := { |
| 254 | messageType := '00000000'B, /* overwritten */ |
| 255 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 256 | spare1_4 := '0000'B, |
| 257 | mobileStationClassmark := ts_CM2, |
| 258 | mobileIdentity := mi_lv, |
| 259 | additionalUpdateParameters := omit |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
Harald Welte | 1516614 | 2017-12-16 23:02:08 +0100 | [diff] [blame] | 265 | template (value) PDU_ML3_MS_NW ts_RRM_ModeModifyAck(ChannelDescription2_V desc, ChannelMode_V mode) := { |
| 266 | discriminator := '0000'B, /* overwritten */ |
| 267 | tiOrSkip := { |
| 268 | skipIndicator := '0000'B |
| 269 | }, |
| 270 | msgs := { |
| 271 | rrm := { |
| 272 | channelModeModifyAck := { |
| 273 | messageType := '00010111'B, |
| 274 | channelDescription := desc, |
| 275 | channelMode := mode, |
| 276 | extendedTSCSet := omit |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 282 | template (value) PDU_ML3_MS_NW ts_RRM_CiphModeCompl := { |
| 283 | discriminator := '0000'B, /* overwritten */ |
| 284 | tiOrSkip := { |
| 285 | skipIndicator := '0000'B |
| 286 | }, |
| 287 | msgs := { |
| 288 | rrm := { |
| 289 | cipheringModeComplete := { |
| 290 | messageType := '00110010'B, |
| 291 | mobileEquipmentIdentity := omit |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | |
Harald Welte | ecb254b | 2018-01-29 22:01:54 +0100 | [diff] [blame] | 297 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentComplete(OCT1 cause) := { |
| 298 | discriminator := '0000'B, /* overwritten */ |
| 299 | tiOrSkip := { |
| 300 | skipIndicator := '0000'B |
| 301 | }, |
| 302 | msgs := { |
| 303 | rrm := { |
| 304 | assignmentComplete := { |
| 305 | messageType := '00101001'B, |
| 306 | rR_Cause := { |
| 307 | valuePart := cause |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | } |
Harald Welte | 1516614 | 2017-12-16 23:02:08 +0100 | [diff] [blame] | 313 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 314 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := { |
| 315 | discriminator := '0000'B, /* overwritten */ |
| 316 | tiOrSkip := { |
| 317 | skipIndicator := '0000'B |
| 318 | }, |
| 319 | msgs := { |
| 320 | rrm := { |
| 321 | assignmentFailure := { |
| 322 | messageType := '00101111'B, |
| 323 | rR_Cause := { |
| 324 | valuePart := cause |
| 325 | } |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 331 | template (value) PDU_ML3_MS_NW ts_RRM_HandoverFailure(OCT1 cause) := { |
| 332 | discriminator := '0000'B, /* overwritten */ |
| 333 | tiOrSkip := { |
| 334 | skipIndicator := '0000'B |
| 335 | }, |
| 336 | msgs := { |
| 337 | rrm := { |
| 338 | handoverFailure := { |
| 339 | messageType := '00101000'B, |
| 340 | rRCause := { |
| 341 | valuePart := cause |
| 342 | }, |
| 343 | pSCause := omit |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 348 | |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 349 | template (value) PDU_ML3_MS_NW ts_RRM_HandoverComplete(OCT1 cause) := { |
| 350 | discriminator := '0000'B, /* overwritten */ |
| 351 | tiOrSkip := { |
| 352 | skipIndicator := '0000'B |
| 353 | }, |
| 354 | msgs := { |
| 355 | rrm := { |
| 356 | handoverComplete := { |
| 357 | messageType := '00101100'B, |
| 358 | rRCause := { |
| 359 | valuePart := cause |
| 360 | }, |
| 361 | mobileObsservedTimeDiff := omit, |
| 362 | mobileTimeDifferenceHyperframe := omit |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | } |
| 367 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 368 | function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { |
| 369 | if (not isvalue(cm3)) { |
| 370 | return omit; |
| 371 | } |
| 372 | var template MobileStationClassmark3_TLV ret := { |
| 373 | elementIdentifier := '20'O, |
| 374 | lengthIndicator := 0, /* overwritten */ |
| 375 | valuePart := cm3 |
| 376 | } |
| 377 | return ret; |
| 378 | } |
| 379 | |
| 380 | template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2, |
| 381 | template (omit) MobileStationClassmark3_TLV cm3 := omit) := { |
| 382 | discriminator := '0110'B, |
| 383 | tiOrSkip := { |
| 384 | skipIndicator := '0000'B |
| 385 | }, |
| 386 | msgs := { |
| 387 | rrm := { |
| 388 | classmarkChange := { |
| 389 | messageType := '00010110'B, |
| 390 | mobileStationClassmark2 := cm2, |
| 391 | mobileStationClassmark3 := cm3 |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 397 | template (value) PDU_ML3_MS_NW ts_RRM_UL_REL(OCT1 cause) := { |
| 398 | discriminator := '0110'B, |
| 399 | tiOrSkip := { |
| 400 | skipIndicator := '0000'B |
| 401 | }, |
| 402 | msgs := { |
| 403 | rrm := { |
| 404 | uplinkRelease := { |
| 405 | messageType := '00001110'B, |
| 406 | rR_Cause := { |
| 407 | valuePart := cause |
| 408 | } |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | template PDU_ML3_MS_NW tr_RRM_RR_STATUS(template OCT1 cause := ?) := { |
| 415 | discriminator := '0110'B, |
| 416 | tiOrSkip := { |
| 417 | skipIndicator := '0000'B |
| 418 | }, |
| 419 | msgs := { |
| 420 | rrm := { |
| 421 | rR_Status := { |
| 422 | messageType := '00010010'B, |
| 423 | rR_Cause := { |
| 424 | valuePart := cause |
| 425 | } |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | |
| 432 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 433 | template PDU_ML3_MS_NW ts_ML3_MO := { |
| 434 | discriminator := '0000'B, |
| 435 | tiOrSkip := { |
| 436 | skipIndicator := '0000'B |
| 437 | }, |
| 438 | msgs := ? |
| 439 | } |
| 440 | |
| 441 | template LocationUpdatingType ts_ML3_IE_LuType := { |
| 442 | lut := ?, |
| 443 | spare1_1 := '0'B, |
| 444 | fop := '0'B |
| 445 | } |
| 446 | |
| 447 | template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := { |
| 448 | lut := '00'B |
| 449 | } |
| 450 | |
| 451 | template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := { |
| 452 | lut := '01'B |
| 453 | } |
| 454 | |
| 455 | template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := { |
| 456 | lut := '10'B |
| 457 | } |
| 458 | |
| 459 | template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := { |
| 460 | keySequence := int2bit(cksn, 3), |
| 461 | spare := '0'B |
| 462 | } |
| 463 | |
| 464 | template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai, |
| 465 | MobileIdentityLV mi, MobileStationClassmark1_V cm1) |
| 466 | modifies ts_ML3_MO := { |
| 467 | msgs := { |
| 468 | mm := { |
| 469 | locationUpdateRequest := { |
| 470 | messageType := '001000'B, |
| 471 | nsd := '00'B, /* ? */ |
| 472 | locationUpdatingType := lu_type, |
| 473 | cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0), |
| 474 | locationAreaIdentification := lai, |
| 475 | mobileStationClassmark1 := cm1, |
| 476 | mobileIdentityLV := mi, |
| 477 | classmarkInformationType2_forUMTS := omit, |
| 478 | additionalUpdateParameterTV := omit, |
| 479 | deviceProperties := omit, |
| 480 | mS_NetworkFeatureSupport := omit |
| 481 | } |
| 482 | } |
| 483 | } |
| 484 | } |
| 485 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 486 | template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := { |
| 487 | msgs := { |
| 488 | mm := { |
| 489 | tmsiReallocComplete := { |
| 490 | messageType := '011011'B, |
| 491 | nsd := '00'B |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := { |
| 498 | discriminator := '0101'B, |
| 499 | tiOrSkip := { |
| 500 | skipIndicator := '0000'B |
| 501 | }, |
| 502 | msgs := { |
| 503 | mm := { |
| 504 | locationUpdateAccept := { |
| 505 | messageType := '000010'B, |
| 506 | nsd := '00'B, |
| 507 | locationAreaIdentification := ?, |
| 508 | mobileIdentityTLV := *, |
| 509 | followOnProceed := *, |
| 510 | cTS_Permission := *, |
| 511 | equivalentPLMNs := *, |
| 512 | emergencyNumberList := *, |
| 513 | perMS_T3212 := * |
| 514 | } |
| 515 | } |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := { |
| 520 | discriminator := '0101'B, |
| 521 | tiOrSkip := { |
| 522 | skipIndicator := '0000'B |
| 523 | }, |
| 524 | msgs := { |
| 525 | mm := { |
| 526 | locationUpdateReject := { |
| 527 | messageType := '000100'B, |
| 528 | nsd := '00'B, |
| 529 | rejectCause := cause, |
| 530 | t3246_Value := * |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 536 | template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template BIT3 id_type := ?) := { |
| 537 | discriminator := '0101'B, |
| 538 | tiOrSkip := { |
| 539 | skipIndicator := '0000'B |
| 540 | }, |
| 541 | msgs := { |
| 542 | mm := { |
| 543 | identityRequest := { |
| 544 | messageType := '011000'B, |
| 545 | nsd := '00'B, |
| 546 | identityType := id_type, |
| 547 | spare1_5 := ? |
| 548 | } |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp(MobileIdentityLV mi) modifies ts_ML3_MO := { |
| 554 | msgs := { |
| 555 | mm := { |
| 556 | identityResponse := { |
| 557 | messageType := '011001'B, |
| 558 | nsd := '00'B, |
| 559 | mobileIdentityLV := mi, |
| 560 | p_TMSI_TypeTV := omit, |
| 561 | routingAreaIdentification2TLV := omit, |
| 562 | p_TMSISignature2TLV := omit |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | } |
| 567 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMSI(hexstring imsi) := |
| 568 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMSI_LV(imsi))); |
| 569 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMEI(hexstring imei) := |
| 570 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); |
| 571 | |
| 572 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 573 | template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { |
| 574 | rf_PowerCapability := '010'B, |
| 575 | a5_1 := a5_1_unavail, |
| 576 | esind := '1'B, |
| 577 | revisionLevel := rev, |
| 578 | spare1_1 := '0'B |
| 579 | } |
| 580 | |
| 581 | template PDU_ML3_MS_NW ts_ML3_MO_MM_IMSI_DET_Ind(MobileIdentityLV mi, |
| 582 | template MobileStationClassmark1_V cm1 := ts_CM1) |
| 583 | modifies ts_ML3_MO := { |
| 584 | msgs := { |
| 585 | mm := { |
| 586 | imsiDetachIndication := { |
| 587 | messageType := '000001'B, |
| 588 | nsd := '00'B, |
| 589 | mobileStationClassmark1 := cm1, |
| 590 | mobileIdentityLV := mi |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 596 | template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { |
| 597 | discriminator := '0011'B, |
| 598 | tiOrSkip := { |
| 599 | transactionId := { |
Daniel Willmann | dcf9eb9 | 2018-02-02 20:07:52 +0100 | [diff] [blame] | 600 | tio := int2bit(tid, 3), |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 601 | tiFlag := '0'B, |
| 602 | tIExtension := omit |
| 603 | } |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := { |
| 608 | elementIdentifier := '5E'O, |
| 609 | lengthIndicator := 0, /* overwritten */ |
| 610 | numberingPlanIdentification := '0000'B, |
| 611 | typeOfNumber := '000'B, /* unknown */ |
| 612 | ext1 := '0'B, |
| 613 | digits := digits |
| 614 | } |
| 615 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 616 | template CalledPartyBCD_Number tr_Called(template hexstring digits) := { |
| 617 | elementIdentifier := '5E'O, |
| 618 | lengthIndicator := ?, |
| 619 | numberingPlanIdentification := ?, |
| 620 | typeOfNumber := ?, |
| 621 | ext1 := ?, |
| 622 | digits := digits |
| 623 | } |
| 624 | |
| 625 | template CallingPartyBCD_Number tr_Calling(template hexstring digits) := { |
| 626 | elementIdentifier := '5C'O, |
| 627 | lengthIndicator := ?, |
| 628 | oct3 := ?, |
| 629 | digits := digits |
| 630 | } |
| 631 | |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 632 | type integer SpeechVer; |
| 633 | |
| 634 | template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { |
| 635 | speechVersionIndication := int2bit(ver-1,3) & suffix, |
| 636 | spare1_1 := '0'B, |
| 637 | cTM_or_Spare := '0'B, |
| 638 | coding := '0'B, |
| 639 | extension_octet_3a_3b := '0'B |
| 640 | } |
| 641 | |
| 642 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B); |
| 643 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B); |
| 644 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 645 | template (value) BearerCapability_TLV ts_Bcap_voice := { |
| 646 | elementIdentifier := '04'O, |
| 647 | lengthIndicator := 0, /* overwritten */ |
| 648 | octet3 := { |
| 649 | informationTransferCapability := '000'B, |
| 650 | transferMode := '0'B, |
| 651 | codingStandard := '0'B, |
| 652 | radioChannelRequirement := '11'B, /* FR preferred */ |
| 653 | extension_octet_3 := '0'B, /* overwritten */ |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 654 | speech_aux_3a_3b := { |
| 655 | valueof(ts_SpeechAuxHR(3)), |
| 656 | valueof(ts_SpeechAuxFR(3)), |
| 657 | valueof(ts_SpeechAuxFR(2)), |
| 658 | valueof(ts_SpeechAuxFR(1)), |
| 659 | valueof(ts_SpeechAuxHR(1)) |
| 660 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 661 | }, |
| 662 | octet4 := omit, |
| 663 | octet5 := omit, |
| 664 | octet6 := omit, |
| 665 | octet7 := omit |
| 666 | } |
| 667 | |
| 668 | template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 669 | discriminator := '0011'B, |
| 670 | tiOrSkip := { |
| 671 | transactionId := { |
| 672 | tio := int2bit(tid, 3), |
| 673 | tiFlag := '0'B, |
| 674 | tIExtension := omit |
| 675 | } |
| 676 | }, |
| 677 | msgs := { |
| 678 | cc := { |
| 679 | setup_MS_NW := { |
| 680 | messageType := '000101'B, |
| 681 | nsd := '00'B, |
| 682 | bcRepeatIndicator := omit, |
| 683 | bearerCapability1 := bcap, |
| 684 | bearerCapability2 := omit, |
| 685 | facility := omit, |
| 686 | callingPartySubAddress := omit, |
| 687 | calledPartyBCD_Number := ts_Called(called), |
| 688 | calledPartySubAddress := omit, |
| 689 | llc_RepeatIndicator := omit, |
| 690 | lowLayerCompatibility1 := omit, |
| 691 | lowLayerCompatibility2 := omit, |
| 692 | hlc_RepeatIndicator := omit, |
| 693 | highLayerCompatibility1 := omit, |
| 694 | highLayerCompatibility2 := omit, |
| 695 | user_user := omit, |
| 696 | ss_VersionIndicator := omit, |
| 697 | clir_Suppression := omit, |
| 698 | clir_Invocation := omit, |
| 699 | cC_Capabilities := omit, |
| 700 | facility_ccbs1 := omit, |
| 701 | facility_ccbs2 := omit, |
| 702 | streamIdentifier := omit, |
| 703 | supportedCodecs := omit, |
| 704 | redial := omit |
| 705 | } |
| 706 | } |
| 707 | } |
| 708 | } |
| 709 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 710 | template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 711 | discriminator := '0011'B, |
| 712 | tiOrSkip := { |
| 713 | transactionId := { |
| 714 | tio := int2bit(tid, 3), |
| 715 | tiFlag := '0'B, |
| 716 | tIExtension := omit |
| 717 | } |
| 718 | }, |
| 719 | msgs := { |
| 720 | cc := { |
| 721 | emergencySetup := { |
| 722 | messageType := '001110'B, |
| 723 | nsd := '00'B, |
| 724 | bearerCapability := bcap, |
| 725 | streamIdentifier := omit, |
| 726 | supportedCodecs := omit, |
| 727 | emergencyCategory := omit |
| 728 | } |
| 729 | } |
| 730 | } |
| 731 | } |
| 732 | |
| 733 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 734 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { |
| 735 | discriminator := '0011'B, |
| 736 | tiOrSkip := { |
| 737 | transactionId := { |
| 738 | tio := int2bit(tid, 3), |
| 739 | tiFlag := ?, |
| 740 | tIExtension := omit |
| 741 | } |
| 742 | }, |
| 743 | msgs := { |
| 744 | cc := { |
| 745 | callProceeding := { |
| 746 | messageType := '000010'B, |
| 747 | nsd := '00'B, |
| 748 | repeatIndicator := *, |
| 749 | bearerCapability1 := *, |
| 750 | bearerCapability2 := *, |
| 751 | facility := *, |
| 752 | progressIndicator := *, |
| 753 | priorityGranted := *, |
| 754 | networkCCCapabilities := * |
| 755 | } |
| 756 | } |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := { |
| 761 | discriminator := '0011'B, |
| 762 | tiOrSkip := { |
| 763 | transactionId := { |
| 764 | tio := int2bit(tid, 3), |
| 765 | tiFlag := ?, |
| 766 | tIExtension := omit |
| 767 | } |
| 768 | }, |
| 769 | msgs := { |
| 770 | cc := { |
| 771 | alerting_NW_MS := { |
| 772 | messageType := '000001'B, |
| 773 | nsd := '00'B, |
| 774 | facility := *, |
| 775 | progressIndicator := *, |
| 776 | user_user := * |
| 777 | } |
| 778 | } |
| 779 | } |
| 780 | } |
| 781 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 782 | template PDU_ML3_MS_NW ts_ML3_MO_CC_ALERTING(integer tid) := { |
| 783 | discriminator := '0011'B, |
| 784 | tiOrSkip := { |
| 785 | transactionId := { |
| 786 | tio := int2bit(tid, 3), |
| 787 | tiFlag := '1'B, |
| 788 | tIExtension := omit |
| 789 | } |
| 790 | }, |
| 791 | msgs := { |
| 792 | cc := { |
| 793 | alerting_MS_NW := { |
| 794 | messageType := '000001'B, |
| 795 | nsd := '00'B, |
| 796 | facility := omit, |
| 797 | user_user := omit, |
| 798 | ss_VersionIndicator := omit |
| 799 | } |
| 800 | } |
| 801 | } |
| 802 | } |
| 803 | |
| 804 | template PDU_ML3_MS_NW ts_ML3_MT_CC_ALERTING(integer tid) := { |
| 805 | discriminator := '0011'B, |
| 806 | tiOrSkip := { |
| 807 | transactionId := { |
| 808 | tio := int2bit(tid, 3), |
| 809 | tiFlag := '1'B, |
| 810 | tIExtension := omit |
| 811 | } |
| 812 | }, |
| 813 | msgs := { |
| 814 | cc := { |
| 815 | alerting_MS_NW := { |
| 816 | messageType := '000001'B, |
| 817 | nsd := '00'B, |
| 818 | facility := omit, |
| 819 | user_user := omit, |
| 820 | ss_VersionIndicator := omit |
| 821 | } |
| 822 | } |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | template PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT(integer tid) := { |
| 827 | discriminator := '0011'B, |
| 828 | tiOrSkip := { |
| 829 | transactionId := { |
| 830 | tio := int2bit(tid, 3), |
| 831 | tiFlag := '1'B, |
| 832 | tIExtension := omit |
| 833 | } |
| 834 | }, |
| 835 | msgs := { |
| 836 | cc := { |
| 837 | connect_MS_NW := { |
| 838 | messageType := '000111'B, |
| 839 | nsd := '00'B, |
| 840 | facility := omit, |
| 841 | connectedSubAddress := omit, |
| 842 | user_user := omit, |
| 843 | ss_VersionIndicator := omit, |
| 844 | streamIdentifier := omit |
| 845 | } |
| 846 | } |
| 847 | } |
| 848 | } |
| 849 | |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 850 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := { |
| 851 | discriminator := '0011'B, |
| 852 | tiOrSkip := { |
| 853 | transactionId := { |
| 854 | tio := int2bit(tid, 3), |
| 855 | tiFlag := '1'B, |
| 856 | tIExtension := omit |
| 857 | } |
| 858 | }, |
| 859 | msgs := { |
| 860 | cc := { |
| 861 | connect_NW_MS := { |
| 862 | messageType := '000111'B, |
| 863 | nsd := '00'B, |
| 864 | facility := *, |
| 865 | progressIndicator := *, |
| 866 | connectedNumber := *, |
| 867 | connectedSubAddress := *, |
| 868 | user_user := * |
| 869 | } |
| 870 | } |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := { |
| 875 | discriminator := '0011'B, |
| 876 | tiOrSkip := { |
| 877 | transactionId := { |
| 878 | tio := int2bit(tid, 3), |
| 879 | tiFlag := '0'B, |
| 880 | tIExtension := omit |
| 881 | } |
| 882 | }, |
| 883 | msgs := { |
| 884 | cc := { |
| 885 | connectAck := { |
| 886 | messageType := '001111'B, |
| 887 | nsd := '00'B |
| 888 | } |
| 889 | } |
| 890 | } |
| 891 | } |
| 892 | |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 893 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_START_DTMF(integer tid, charstring number) := { |
| 894 | discriminator := '0011'B, |
| 895 | tiOrSkip := { |
| 896 | transactionId := { |
| 897 | tio := int2bit(tid, 3), |
| 898 | tiFlag := '0'B, |
| 899 | tIExtension := omit |
| 900 | } |
| 901 | }, |
| 902 | msgs := { |
| 903 | cc := { |
| 904 | startDTMF := { |
| 905 | messageType := '110101'B, |
| 906 | nsd := '00'B, |
| 907 | keypadFacility := { |
| 908 | elementIdentifier := '2C'O, |
| 909 | keypadInformation := int2bit(char2int(number), 7), |
| 910 | spare_1 := '0'B |
| 911 | } |
| 912 | } |
| 913 | } |
| 914 | } |
| 915 | } |
| 916 | |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 917 | template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { |
| 918 | discriminator := '0011'B, |
| 919 | tiOrSkip := { |
| 920 | transactionId := { |
| 921 | tio := int2bit(tid, 3), |
| 922 | tiFlag := ?, |
| 923 | tIExtension := omit |
| 924 | } |
| 925 | }, |
| 926 | msgs := { |
| 927 | cc := { |
| 928 | disconnect_NW_MS := { |
| 929 | messageType := '100101'B, |
| 930 | nsd := '00'B, |
| 931 | cause := ?, |
| 932 | facility := *, |
| 933 | progressIndicator := *, |
| 934 | user_user := *, |
| 935 | allowedActions := * |
| 936 | } |
| 937 | } |
| 938 | } |
| 939 | } |
| 940 | |
| 941 | template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := { |
| 942 | discriminator := '0011'B, |
| 943 | tiOrSkip := { |
| 944 | transactionId := { |
| 945 | tio := int2bit(tid, 3), |
| 946 | tiFlag := ?, |
| 947 | tIExtension := omit |
| 948 | } |
| 949 | }, |
| 950 | msgs := { |
| 951 | cc := { |
| 952 | release_NW_MS := { |
| 953 | messageType := '101101'B, |
| 954 | nsd := '00'B, |
| 955 | cause := ?, |
| 956 | secondCause := *, |
| 957 | facility := *, |
| 958 | user_user := * |
| 959 | } |
| 960 | } |
| 961 | } |
| 962 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 963 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 964 | template PDU_ML3_MS_NW ts_ML3_MO_CC_RELEASE(integer tid, BIT1 tid_remote, BIT7 cause) := { |
| 965 | discriminator := '0011'B, |
| 966 | tiOrSkip := { |
| 967 | transactionId := { |
| 968 | tio := int2bit(tid, 3), |
| 969 | tiFlag := tid_remote, |
| 970 | tIExtension := omit |
| 971 | } |
| 972 | }, |
| 973 | msgs := { |
| 974 | cc := { |
| 975 | release_MS_NW := { |
| 976 | messageType := '101101'B, |
| 977 | nsd := '00'B, |
| 978 | cause := ts_ML3_Cause(cause), |
| 979 | secondCause := omit, |
| 980 | facility := omit, |
| 981 | user_user := omit, |
| 982 | ss_VersionIndicator := omit |
| 983 | } |
| 984 | } |
| 985 | } |
| 986 | } |
| 987 | |
| 988 | |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 989 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := { |
| 990 | discriminator := '0011'B, |
| 991 | tiOrSkip := { |
| 992 | transactionId := { |
| 993 | tio := int2bit(tid, 3), |
| 994 | tiFlag := '0'B, |
| 995 | tIExtension := omit |
| 996 | } |
| 997 | }, |
| 998 | msgs := { |
| 999 | cc := { |
| 1000 | releaseComplete_MS_NW := { |
| 1001 | messageType := '101010'B, |
| 1002 | nsd := '00'B, |
| 1003 | cause := omit, |
| 1004 | facility := omit, |
| 1005 | user_user := omit, |
| 1006 | ss_VersionIndicator := omit |
| 1007 | } |
| 1008 | } |
| 1009 | } |
| 1010 | } |
| 1011 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1012 | template PDU_ML3_NW_MS tr_ML3_MT_CC_REL_COMPL(integer tid) := { |
| 1013 | discriminator := '0011'B, |
| 1014 | tiOrSkip := { |
| 1015 | transactionId := { |
| 1016 | tio := int2bit(tid, 3), |
| 1017 | tiFlag := ?, |
| 1018 | tIExtension := omit |
| 1019 | } |
| 1020 | }, |
| 1021 | msgs := { |
| 1022 | cc := { |
| 1023 | releaseComplete_NW_MS := { |
| 1024 | messageType := '101010'B, |
| 1025 | nsd := '00'B, |
| 1026 | cause := *, |
| 1027 | facility := *, |
| 1028 | user_user := * |
| 1029 | } |
| 1030 | } |
| 1031 | } |
| 1032 | } |
| 1033 | |
| 1034 | |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 1035 | |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 1036 | template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { |
| 1037 | discriminator := '0101'B, |
| 1038 | tiOrSkip := { |
| 1039 | skipIndicator := '0000'B |
| 1040 | }, |
| 1041 | msgs := { |
| 1042 | mm := { |
| 1043 | authenticationRequest := { |
| 1044 | messageType := '010010'B, |
| 1045 | nsd := '00'B, |
| 1046 | cipheringKeySequenceNumber := ?, |
| 1047 | spare2_4 := ?, |
| 1048 | authenticationParRAND := rand, |
| 1049 | authenticationParAUTN := * |
| 1050 | } |
| 1051 | } |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := { |
| 1056 | discriminator := '0101'B, |
| 1057 | tiOrSkip := { |
| 1058 | skipIndicator := '0000'B |
| 1059 | }, |
| 1060 | msgs := { |
| 1061 | mm := { |
| 1062 | authenticationResponse := { |
| 1063 | messageType := '010100'B, |
| 1064 | nsd := '00'B, |
| 1065 | authenticationParSRES := sres, |
| 1066 | authenticationParSRESext := omit |
| 1067 | } |
| 1068 | } |
| 1069 | } |
| 1070 | } |
| 1071 | |
| 1072 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := { |
| 1073 | discriminator := '0101'B, |
| 1074 | tiOrSkip := { |
| 1075 | skipIndicator := '0000'B |
| 1076 | }, |
| 1077 | msgs := { |
| 1078 | mm := { |
| 1079 | authenticationResponse := { |
| 1080 | messageType := '010100'B, |
| 1081 | nsd := '00'B, |
| 1082 | authenticationParSRES := sres, |
| 1083 | authenticationParSRESext := { |
| 1084 | elementIdentifier := '21'O, |
| 1085 | lengthIndicator := 0, /* overwritten */ |
| 1086 | valueField := res |
| 1087 | } |
| 1088 | } |
| 1089 | } |
| 1090 | } |
| 1091 | } |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 1092 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1093 | template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid, |
| 1094 | template BearerCapability_TLV bcap := omit) := { |
| 1095 | discriminator := '0011'B, |
| 1096 | tiOrSkip := { |
| 1097 | transactionId := { |
| 1098 | tio := int2bit(tid, 3), |
| 1099 | tiFlag := '1'B, /* response from destination */ |
| 1100 | tIExtension := omit |
| 1101 | } |
| 1102 | }, |
| 1103 | msgs := { |
| 1104 | cc := { |
| 1105 | callConfirmed := { |
| 1106 | messageType := '001000'B, |
| 1107 | nsd := '00'B, |
| 1108 | repeatIndicator := omit, |
| 1109 | bearerCapability1 := bcap, |
| 1110 | bearerCapability2 := omit, |
| 1111 | cause := omit, |
| 1112 | cC_Capabilities := omit, |
| 1113 | streamIdentifier := omit, |
| 1114 | supportedCodecs := omit |
| 1115 | } |
| 1116 | } |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | |
| 1121 | template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *, |
| 1122 | template hexstring calling := *, |
| 1123 | template BearerCapability_TLV bcap := *) := { |
| 1124 | discriminator := '0011'B, |
| 1125 | tiOrSkip := { |
| 1126 | transactionId := { |
| 1127 | tio := int2bit(tid, 3), |
| 1128 | tiFlag := '0'B, /* from originator */ |
| 1129 | tIExtension := omit |
| 1130 | } |
| 1131 | }, |
| 1132 | msgs := { |
| 1133 | cc := { |
| 1134 | setup_NW_MS := { |
| 1135 | messageType := '000101'B, |
| 1136 | nsd := '00'B, |
| 1137 | bcRepeatIndicator := *, |
| 1138 | bearerCapability1 := bcap, |
| 1139 | bearerCapability2 := *, |
| 1140 | facility := *, |
| 1141 | progressIndicator := *, |
| 1142 | signal := *, |
| 1143 | callingPartyBCD_Number := tr_Calling(calling) ifpresent, |
| 1144 | callingPartySubAddress := *, |
| 1145 | calledPartyBCD_Number := tr_Called(called) ifpresent, |
| 1146 | calledPartySubAddress := *, |
| 1147 | redirectingPartyBCDNumber := *, |
| 1148 | redirectingPartySubaddress := *, |
| 1149 | llc_RepeatIndicator := *, |
| 1150 | lowLayerCompatibility1 := *, |
| 1151 | lowLayerCompatibility2 := *, |
| 1152 | hlc_RepeatIndicator := *, |
| 1153 | highLayerCompatibility1 := *, |
| 1154 | highLayerCompatibility2 := *, |
| 1155 | user_user := *, |
| 1156 | priority := *, |
| 1157 | alert := *, |
| 1158 | networkCCCapabilities := *, |
| 1159 | causeofNoCli := *, |
| 1160 | backupBearerCapacity := * |
| 1161 | } |
| 1162 | } |
| 1163 | } |
| 1164 | } |
| 1165 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1166 | /*********************************************************************** |
| 1167 | * GPRS Mobility Management |
| 1168 | ***********************************************************************/ |
| 1169 | |
| 1170 | template (value) MSNetworkCapabilityV ts_GMM_MsNetCapV := { |
| 1171 | gea1bit := '1'B, |
| 1172 | smCapabilitiesviaDedicatedChannels := '1'B, |
| 1173 | smCapabilitiesviaGPRSChannels := '0'B, |
| 1174 | ucs2Support := '1'B, |
| 1175 | ssScreeningIndicator := '01'B, |
| 1176 | solSACapability := omit, |
| 1177 | revisionLevelIndicatior := omit, |
| 1178 | pFCFeatureMode := omit, |
| 1179 | extendedGEAbits := omit, |
| 1180 | lcsVAcapability := omit, |
| 1181 | pSInterRATHOtoUTRANIuModeCapability := omit, |
| 1182 | pSInterRATHOtoEUTRANS1ModeCapability := omit, |
| 1183 | eMMCombinedProceduresCapability := omit, |
| 1184 | iSRSupport := omit, |
| 1185 | sRVCCtoGERANUTRANCapability := omit, |
| 1186 | ePCCapability := omit, |
| 1187 | nFCapability := omit, |
| 1188 | gERANNertworkSharingCapability := omit, |
| 1189 | spare_octets := omit |
| 1190 | }; |
| 1191 | |
| 1192 | template (value) MSNetworkCapabilityLV ts_GMM_MsNetCapLV := { |
| 1193 | lengthIndicator := 0, /* overwritten */ |
| 1194 | msNetworkCapabilityV := ts_GMM_MsNetCapV |
| 1195 | }; |
| 1196 | |
| 1197 | type enumerated GprsAttachType { |
| 1198 | GPRS_ATT_T_GPRS, |
| 1199 | GPRS_ATT_T_GPRS_IMSI_COMBINED |
| 1200 | }; |
| 1201 | |
| 1202 | function ts_GMM_AttachType(boolean combined := false, boolean follow_on_pending := false) |
| 1203 | return AttachTypeV { |
| 1204 | var AttachTypeV att; |
| 1205 | if (combined) { |
| 1206 | att.attachType := '011'B; |
| 1207 | } else { |
| 1208 | att.attachType := '001'B; |
| 1209 | } |
| 1210 | att.for_l3 := bool2bit(combined); |
| 1211 | return att; |
| 1212 | } |
| 1213 | |
| 1214 | type enumerated GprsUpdateType { |
| 1215 | GPRS_UPD_T_RA ('000'B), |
| 1216 | GPRS_UPD_T_RA_LA_COMBINED ('001'B), |
| 1217 | GPRS_UPD_T_RA_LA_COMBINED_IMSI_ATT ('010'B), |
| 1218 | GPRS_UPD_T_PERIODIC ('011'B) |
| 1219 | }; |
| 1220 | |
| 1221 | /* 10.5.5.18 Update Type */ |
| 1222 | template UpdateTypeV ts_GMM_UpdateType(GprsUpdateType upd_t, boolean combined := false, |
| 1223 | boolean follow_on_pending := false) := { |
| 1224 | valueField := int2bit(enum2int(upd_t), 3), |
| 1225 | for_l3 := bool2bit(combined) |
| 1226 | } |
| 1227 | |
| 1228 | template (value) DRXParameterV ts_DrxParameterV := { |
| 1229 | splitPGCycleCode := '00'O, /* no DRX */ |
| 1230 | nonDRXTimer := '000'B, /* no non-DRX mode */ |
| 1231 | splitOnCCCH := '0'B, /* not supported */ |
| 1232 | cnSpecificDRXCycleLength := '0000'B /* SI value used */ |
| 1233 | }; |
| 1234 | |
| 1235 | template (value) AccessCapabilitiesStruct ts_AccesssCap := { |
| 1236 | lengthIndicator := 0, /* overwritten */ |
| 1237 | accessCapabilities := { |
| 1238 | rfPowerCapability := '001'B, /* FIXME */ |
| 1239 | presenceBitA5 := '0'B, |
| 1240 | a5bits := omit, |
| 1241 | esind := '1'B, |
| 1242 | psbit := '0'B, |
| 1243 | vgcs := '0'B, |
| 1244 | vbs := '0'B, |
| 1245 | presenceBitMultislot := '0'B, |
| 1246 | multislotcap := omit, |
| 1247 | accessCapAdditionsAfterRel97 := omit |
| 1248 | }, |
| 1249 | spare_bits := omit |
| 1250 | } |
| 1251 | |
| 1252 | template (value) MSRACapabilityValuesRecord ts_RaCapRec(BIT4 att) := { |
| 1253 | mSRACapabilityValues := { |
| 1254 | mSRACapabilityValuesExclude1111 := { |
| 1255 | accessTechnType := '0001'B, /* E-GSM */ |
| 1256 | accessCapabilities := ts_AccesssCap |
| 1257 | } |
| 1258 | }, |
| 1259 | presenceBitMSRACap := '0'B |
| 1260 | }; |
| 1261 | |
| 1262 | template (value) MSRadioAccessCapabilityLV ts_MS_RaCapa := { |
| 1263 | lengthIndicator := 0, /* overwritten */ |
| 1264 | msRadioAccessCapabilityV := { |
| 1265 | ts_RaCapRec('0001'B) /* E-GSM */ |
| 1266 | } |
| 1267 | } |
| 1268 | |
| 1269 | template (value) PDU_L3_MS_SGSN |
| 1270 | ts_GMM_ATTACH_REQ(MobileIdentityLV mi_lv, RoutingAreaIdentificationV old_ra, |
| 1271 | boolean combined := false, boolean follow_on_pending := false, |
| 1272 | template (omit) MobileStationClassmark2_TLV cm2_tlv, |
| 1273 | template (omit) MobileStationClassmark3_TLV cm3_tlv |
| 1274 | ) := { |
| 1275 | discriminator := '0000'B, /* overwritten */ |
| 1276 | tiOrSkip := { |
| 1277 | skipIndicator := '0000'B |
| 1278 | }, |
| 1279 | msgs := { |
| 1280 | gprs_mm := { |
| 1281 | attachRequest := { |
| 1282 | messageType := '00000000'B, /* overwritten */ |
| 1283 | msNetworkCapability := ts_GMM_MsNetCapLV, |
| 1284 | attachType := valueof(ts_GMM_AttachType(combined, follow_on_pending)), |
| 1285 | gprsCKSN := { '111'B, '0'B }, |
| 1286 | drxParam := ts_DrxParameterV, |
| 1287 | mobileIdentity := mi_lv, |
| 1288 | oldRoutingAreaID := old_ra, |
| 1289 | msRACap := ts_MS_RaCapa, |
| 1290 | ptmsiSignature := omit, /* TODO */ |
| 1291 | reqGPRStimer := omit, |
| 1292 | tmsiStatus := omit, |
| 1293 | pC_LCSCapability := omit, |
| 1294 | mobileStationClassmark2 := cm2_tlv, |
| 1295 | mobileStationClassmark3 := cm3_tlv, |
| 1296 | supportedCodecs := omit, |
| 1297 | uENetworkCapability := omit, |
| 1298 | additionalMobileIdentity := omit, |
| 1299 | routingAreaIdentification2 := omit, |
| 1300 | voiceDomainandUEsUsageSetting := omit, |
| 1301 | deviceProperties := omit, |
| 1302 | p_TMSI_Type := omit, |
| 1303 | mS_NetworkFeatureSupport := omit, |
| 1304 | oldLocationAreaIdentification := omit, |
| 1305 | additionalUpdateType := omit, |
| 1306 | tMSIBasedNRIcontainer := omit, |
| 1307 | t3324 := omit, |
| 1308 | t3312_ExtendedValue := omit, |
| 1309 | extendedDRXParameters := omit |
| 1310 | } |
| 1311 | } |
| 1312 | } |
| 1313 | } |
| 1314 | |
| 1315 | |
| 1316 | template (value) PDU_L3_MS_SGSN ts_GMM_ATTACH_COMPL := { |
| 1317 | discriminator := '0000'B, /* overwritten */ |
| 1318 | tiOrSkip := { |
| 1319 | skipIndicator := '0000'B |
| 1320 | }, |
| 1321 | msgs := { |
| 1322 | gprs_mm := { |
| 1323 | attachComplete := { |
| 1324 | messageType := '00000000'B, /* overwritten */ |
| 1325 | interRATHandoverInformation := omit, |
| 1326 | eUTRANinterRATHandoverInformation := omit |
| 1327 | } |
| 1328 | } |
| 1329 | } |
| 1330 | } |
| 1331 | |
| 1332 | template (value) PDU_L3_MS_SGSN |
| 1333 | ts_GMM_RAU_REQ(MobileIdentityLV mi_lv, GprsUpdateType upd_type, |
| 1334 | RoutingAreaIdentificationV old_ra, |
| 1335 | boolean follow_on_pending := false, |
| 1336 | template (omit) MobileStationClassmark2_TLV cm2_tlv, |
| 1337 | template (omit) MobileStationClassmark3_TLV cm3_tlv |
| 1338 | ) := { |
| 1339 | discriminator := '0000'B, /* overwritten */ |
| 1340 | tiOrSkip := { |
| 1341 | skipIndicator := '0000'B |
| 1342 | }, |
| 1343 | msgs := { |
| 1344 | gprs_mm := { |
| 1345 | routingAreaUpdateRequest := { |
| 1346 | messageType := '00000000'B, /* overwritten */ |
| 1347 | updateType := ts_GMM_UpdateType(upd_type, follow_on_pending), |
| 1348 | gprsCKSN := { '111'B, '0'B }, |
| 1349 | oldRoutingAreaId := old_ra, |
| 1350 | msRACap := ts_MS_RaCapa, |
| 1351 | oldPTMSISignature := omit, /* TODO */ |
| 1352 | readyTimerValue := omit, |
| 1353 | drxParameter := omit, |
| 1354 | tmsiStatus := omit, |
| 1355 | ptmsi := omit, |
| 1356 | mSNetworkCapability := omit, |
| 1357 | pdpContextStatus := omit, /* TODO */ |
| 1358 | pC_LCSCapability := omit, |
| 1359 | uENetworkCapability := omit, |
| 1360 | additionalMobileIdentity := omit, |
| 1361 | oldRoutingAreaIdentification2 := omit, |
| 1362 | mobileStationClassmark2 := cm2_tlv, |
| 1363 | mobileStationClassmark3 := cm3_tlv, |
| 1364 | supportedCodecs := omit, |
| 1365 | voiceDomainUEUsageSetting := omit, |
| 1366 | p_TMSI_Type := omit, |
| 1367 | deviceProperties := omit, |
| 1368 | mS_NetworkFeatureSupport := omit, |
| 1369 | oldLocationAreaIdentification := omit, |
| 1370 | additionalUpdateType := omit, |
| 1371 | tMSIBasedNRIcontainer := omit, |
| 1372 | t3324 := omit, |
| 1373 | t3312_ExtendedValue := omit, |
| 1374 | extendedDRXParameters := omit |
| 1375 | } |
| 1376 | } |
| 1377 | } |
| 1378 | } |
| 1379 | |
| 1380 | template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := { |
| 1381 | discriminator := '0000'B, /* overwritten */ |
| 1382 | tiOrSkip := { |
| 1383 | skipIndicator := '0000'B |
| 1384 | }, |
| 1385 | msgs := { |
| 1386 | gprs_mm := { |
| 1387 | routingAreaUpdateComplete := { |
| 1388 | messageType := '00000000'B, /* overwritten */ |
| 1389 | receiveNPDUNumbers := omit, |
| 1390 | interRATHandoverInformation := omit, |
| 1391 | eUTRANinterRATHandoverInformation := omit |
| 1392 | } |
| 1393 | } |
| 1394 | } |
| 1395 | } |
| 1396 | |
| 1397 | template (value) PDU_L3_MS_SGSN ts_GMM_PTMSI_REALL_COMPL := { |
| 1398 | discriminator := '0000'B, /* overwritten */ |
| 1399 | tiOrSkip := { |
| 1400 | skipIndicator := '0000'B |
| 1401 | }, |
| 1402 | msgs := { |
| 1403 | gprs_mm := { |
| 1404 | p_TMSIReallocationComplete := { |
| 1405 | messageType := '00000000'B /* overwritten */ |
| 1406 | } |
| 1407 | } |
| 1408 | } |
| 1409 | } |
| 1410 | |
| 1411 | template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_CIPH_COMPL(ACReferenceNumberV ref, OCT4 res) := { |
| 1412 | discriminator := '0000'B, /* overwritten */ |
| 1413 | tiOrSkip := { |
| 1414 | skipIndicator := '0000'B |
| 1415 | }, |
| 1416 | msgs := { |
| 1417 | gprs_mm := { |
| 1418 | authenticationAndCipheringResponse := { |
| 1419 | messageType := '00000000'B, /* overwritten */ |
| 1420 | acReferenceNumber := ref, |
| 1421 | spare := '0000'B, |
| 1422 | authenticationParResp := { |
| 1423 | elementIdentifier := '22'O, |
| 1424 | valueField := res |
| 1425 | }, |
| 1426 | imeisv := omit, |
| 1427 | authenticationRespParExt := omit |
| 1428 | } |
| 1429 | } |
| 1430 | } |
| 1431 | } |
| 1432 | |
| 1433 | template (value) PDU_L3_MS_SGSN ts_GMM_ID_RESP(MobileIdentityLV mi_lv) := { |
| 1434 | discriminator := '0000'B, /* overwritten */ |
| 1435 | tiOrSkip := { |
| 1436 | skipIndicator := '0000'B |
| 1437 | }, |
| 1438 | msgs := { |
| 1439 | gprs_mm := { |
| 1440 | identityResponse := { |
| 1441 | messageType := '00000000'B, /* overwritten */ |
| 1442 | mobileIdentity := mi_lv |
| 1443 | } |
| 1444 | } |
| 1445 | } |
| 1446 | } |
| 1447 | |
| 1448 | const BIT3 c_GMM_DTT_MO_GPRS := '001'B; |
| 1449 | const BIT3 c_GMM_DTT_MO_IMSI := '010'B; |
| 1450 | const BIT3 c_GMM_DTT_MO_GPRS_IMSI_COMBINED := '011'B; |
| 1451 | |
| 1452 | template (value) DetachTypeV ts_GMM_DetType(BIT3 dtt) := { |
| 1453 | detachType := dtt, |
| 1454 | powerOffFlag := '0'B |
| 1455 | } |
| 1456 | |
| 1457 | template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS) := { |
| 1458 | discriminator := '0000'B, /* overwritten */ |
| 1459 | tiOrSkip := { |
| 1460 | skipIndicator := '0000'B |
| 1461 | }, |
| 1462 | msgs := { |
| 1463 | gprs_mm := { |
| 1464 | detachRequest_MS_SGSN := { |
| 1465 | messageType := '00000000'B, /* overwritten */ |
| 1466 | detachType := valueof(ts_GMM_DetType(dtt)), |
| 1467 | spare := '0000'B, |
| 1468 | ptmsi := omit, /* TODO */ |
| 1469 | ptmsiSignature := omit /* TODO */ |
| 1470 | } |
| 1471 | } |
| 1472 | } |
| 1473 | } |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1474 | |
Harald Welte | e5695f5 | 2018-02-16 14:46:15 +0100 | [diff] [blame] | 1475 | private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { |
| 1476 | var integer suffix_len := tot_len - lengthof(prefix); |
| 1477 | var charstring suffix_ch := int2str(suffix); |
| 1478 | var integer pad_len := suffix_len - lengthof(suffix_ch); |
| 1479 | |
| 1480 | return prefix & int2hex(0, pad_len) & str2hex(suffix_ch); |
| 1481 | } |
| 1482 | |
| 1483 | function f_gen_imei(integer suffix) return hexstring { |
| 1484 | return f_concat_pad(15, '49999'H, suffix); |
| 1485 | } |
| 1486 | |
| 1487 | function f_gen_imsi(integer suffix) return hexstring { |
| 1488 | return f_concat_pad(15, '26242'H, suffix); |
| 1489 | } |
| 1490 | |
| 1491 | function f_gen_msisdn(integer suffix) return hexstring { |
| 1492 | return f_concat_pad(12, '49123'H, suffix); |
| 1493 | } |
| 1494 | |
| 1495 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 1496 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 1497 | } |