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