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 | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 22 | /* TS 24.007 Table 11.3 TI Flag */ |
| 23 | const BIT1 c_TIF_ORIG := '0'B; |
| 24 | const BIT1 c_TIF_REPL := '1'B; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 25 | |
| 26 | type enumerated CmServiceType { |
| 27 | CM_TYPE_MO_CALL ('0001'B), |
| 28 | CM_TYPE_EMERG_CALL ('0010'B), |
| 29 | CM_TYPE_MO_SMS ('0100'B), |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 30 | CM_TYPE_SS_ACT ('1000'B), |
| 31 | CM_TYPE_VGCS ('1001'B), |
| 32 | CM_TYPE_VBS ('1010'B), |
| 33 | CM_TYPE_LCS ('1011'B) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 34 | } |
| 35 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 36 | template ML3_Cause_TLV ts_ML3_Cause(BIT7 cause, BIT4 loc := '0001'B, BIT2 std := '11'B) := { |
| 37 | elementIdentifier := '08'O, |
| 38 | lengthIndicator := 0, /* overwritten */ |
| 39 | oct3 := { |
| 40 | location := loc, |
| 41 | spare1_1 := '0'B, |
| 42 | codingStandard := std, |
| 43 | ext1 := '0'B, |
| 44 | recommendation := omit, |
| 45 | ext2 := omit |
| 46 | }, |
| 47 | oct4 := { |
| 48 | causeValue := cause, |
| 49 | ext3 := '1'B |
| 50 | }, |
| 51 | diagnostics := omit |
| 52 | } |
| 53 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 54 | |
| 55 | /* send template fro Mobile Identity (TMSI) */ |
| 56 | template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := { |
| 57 | lengthIndicator := 0, /* overwritten */ |
| 58 | mobileIdentityV := { |
| 59 | typeOfIdentity := '000'B, /* overwritten */ |
| 60 | oddEvenInd_identity := { |
| 61 | tmsi_ptmsi := { |
| 62 | oddevenIndicator := '0'B, |
| 63 | fillerDigit := '1111'B, |
| 64 | octets := tmsi |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 70 | /* send template fro Mobile Identity (TMSI) */ |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 71 | function ts_MI_TMSI_TLV(template (omit) OCT4 tmsi) return template (omit) MobileIdentityTLV { |
| 72 | var template (omit) MobileIdentityTLV ret; |
| 73 | if (istemplatekind(tmsi, "omit")) { |
| 74 | return omit; |
| 75 | } else { |
| 76 | ret := { |
| 77 | elementIdentifier := '0100011'B, |
| 78 | spare1 := '0'B, |
| 79 | mobileIdentityLV := ts_MI_TMSI_LV(valueof(tmsi)) |
| 80 | } |
| 81 | return ret; |
| 82 | } |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 83 | } |
| 84 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 85 | template MobileIdentityTLV ts_MI_IMEISV_TLV(hexstring imeisv) := { |
| 86 | elementIdentifier := '0100011'B, |
| 87 | spare1 := '0'B, |
| 88 | mobileIdentityLV := ts_MI_IMEISV_LV(imeisv) |
| 89 | } |
| 90 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 91 | private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 { |
| 92 | var IMSI_L3 l3; |
| 93 | var integer len := lengthof(digits); |
| 94 | if (len rem 2 == 1) { /* modulo remainder */ |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 95 | l3.oddevenIndicator := '1'B; |
Harald Welte | ae13625 | 2018-01-24 20:53:21 +0100 | [diff] [blame] | 96 | l3.fillerDigit := omit; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 97 | } else { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 98 | l3.oddevenIndicator := '0'B; |
Harald Welte | ae13625 | 2018-01-24 20:53:21 +0100 | [diff] [blame] | 99 | l3.fillerDigit := '1111'B; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 100 | } |
| 101 | l3.digits := digits; |
| 102 | return l3; |
| 103 | } |
| 104 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 105 | private function f_enc_IMEI_L3(hexstring digits) return IMEI_L3 { |
| 106 | var IMEI_L3 l3; |
| 107 | var integer len := lengthof(digits); |
| 108 | if (len rem 2 == 1) { /* modulo remainder */ |
| 109 | l3.oddevenIndicator := '1'B; |
| 110 | } else { |
| 111 | l3.oddevenIndicator := '0'B; |
| 112 | } |
| 113 | l3.digits := digits; |
| 114 | return l3; |
| 115 | } |
| 116 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 117 | private function f_enc_IMEI_SV(hexstring digits) return IMEI_SV { |
| 118 | var IMEI_SV l3; |
| 119 | var integer len := lengthof(digits); |
| 120 | if (len rem 2 == 1) { /* modulo remainder */ |
| 121 | l3.oddevenIndicator := '1'B; |
| 122 | } else { |
| 123 | l3.oddevenIndicator := '0'B; |
| 124 | } |
| 125 | l3.digits := digits; |
| 126 | l3.fillerDigit := '1111'B; |
| 127 | return l3; |
| 128 | } |
| 129 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 130 | /* send template fro Mobile Identity (IMSI) */ |
| 131 | template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := { |
| 132 | lengthIndicator := 0, /* overwritten */ |
| 133 | mobileIdentityV := { |
Harald Welte | 519db89 | 2018-02-16 18:15:22 +0100 | [diff] [blame] | 134 | typeOfIdentity := '001'B, |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 135 | oddEvenInd_identity := { |
| 136 | imsi := f_enc_IMSI_L3(imsi_digits) |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 141 | /* send template fro Mobile Identity (IMEI) */ |
| 142 | template (value) MobileIdentityLV ts_MI_IMEI_LV(hexstring imei_digits) := { |
| 143 | lengthIndicator := 0, /* overwritten */ |
| 144 | mobileIdentityV := { |
Harald Welte | 519db89 | 2018-02-16 18:15:22 +0100 | [diff] [blame] | 145 | typeOfIdentity := '010'B, |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 146 | oddEvenInd_identity := { |
| 147 | imei := f_enc_IMEI_L3(imei_digits) |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 152 | /* send template fro Mobile Identity (IMEISV) */ |
| 153 | template (value) MobileIdentityLV ts_MI_IMEISV_LV(hexstring imei_digits) := { |
| 154 | lengthIndicator := 0, /* overwritten */ |
| 155 | mobileIdentityV := { |
| 156 | typeOfIdentity := '011'B, |
| 157 | oddEvenInd_identity := { |
| 158 | imei_sv := f_enc_IMEI_SV(imei_digits) |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 163 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 164 | /* Send template for Classmark 2 */ |
| 165 | template (value) MobileStationClassmark2_LV ts_CM2 := { |
| 166 | lengthIndicator := 0, |
| 167 | rf_PowerCapability := '000'B, |
| 168 | a5_1 := '0'B, |
| 169 | esind := '1'B, |
| 170 | revisionLevel := '10'B, |
| 171 | spare1_1 := '0'B, |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 172 | mobileStationClassmark2_oct4 := { |
| 173 | fc := '1'B, |
| 174 | vgcs := '0'B, |
| 175 | vbs := '0'B, |
| 176 | sm_Capability := '1'B, |
| 177 | ss_ScreenIndicator := '01'B, |
| 178 | ps_Capability := '1'B, |
| 179 | spare2_1 := '0'B |
| 180 | }, |
| 181 | mobileStationClassmark2_oct5 := { |
| 182 | a5_2 := '0'B, |
| 183 | a5_3 := '1'B, |
| 184 | cmsp := '0'B, |
| 185 | solsa := '0'B, |
| 186 | ucs2 := '0'B, |
| 187 | lcsva_cap := '0'B, |
| 188 | spare5_7 :='0'B, |
| 189 | cm3 := '0'B |
| 190 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 191 | }; |
| 192 | |
| 193 | /* Send template for CM SERVICE REQUEST */ |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 194 | 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] | 195 | discriminator := '0000'B, /* overwritten */ |
| 196 | tiOrSkip := { |
| 197 | skipIndicator := '0000'B |
| 198 | }, |
| 199 | msgs := { |
| 200 | mm := { |
| 201 | cMServiceRequest := { |
| 202 | messageType := '000000'B, /* overwritten */ |
| 203 | nsd := '00'B, |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 204 | cm_ServiceType := int2bit(enum2int(serv_type), 4), |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 205 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 206 | mobileStationClassmark2 := ts_CM2, |
| 207 | mobileIdentity := mi_lv, |
| 208 | priorityLevel := omit, |
| 209 | additionalUpdateParameterTV := omit, |
| 210 | deviceProperties := omit |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 216 | template (value) CipheringKeySequenceNumberV ts_CKSN(integer key_seq) := { |
| 217 | keySequence := int2bit(key_seq, 3), |
| 218 | spare := '0'B |
| 219 | } |
| 220 | |
| 221 | /* Send template for CM RE-ESTABLISH REQUEST */ |
| 222 | template (value) PDU_ML3_MS_NW ts_CM_REEST_REQ(integer cksn, MobileIdentityLV mi_lv) := { |
| 223 | discriminator := '0000'B, /* overwritten */ |
| 224 | tiOrSkip := { |
| 225 | skipIndicator := '0000'B |
| 226 | }, |
| 227 | msgs := { |
| 228 | mm := { |
| 229 | cMReEstablReq := { |
| 230 | messageType := '101000'B, /* overwritten */ |
| 231 | nsd := '00'B, |
| 232 | cipheringKeySequenceNumber := ts_CKSN(cksn), |
| 233 | spare := '0000'B, |
| 234 | mobileStationClassmark2 := ts_CM2, |
| 235 | mobileIdentityLV := mi_lv, |
| 236 | locationAreaIdentification := omit, |
| 237 | deviceProperties := omit |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 244 | template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := { |
| 245 | discriminator := discr, |
| 246 | tiOrSkip := { |
| 247 | skipIndicator := '0000'B |
| 248 | }, |
| 249 | msgs := ? |
| 250 | } |
| 251 | |
| 252 | |
| 253 | template PDU_ML3_NW_MS tr_CM_SERV_ACC := { |
| 254 | discriminator := '0101'B, |
| 255 | tiOrSkip := { |
| 256 | skipIndicator := '0000'B |
| 257 | }, |
| 258 | msgs := { |
| 259 | mm := { |
| 260 | cMServiceAccept := { |
| 261 | messageType := '100001'B, |
| 262 | nsd := ? |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 269 | template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := { |
| 270 | discriminator := '0101'B, |
| 271 | tiOrSkip := { |
| 272 | skipIndicator := '0000'B |
| 273 | }, |
| 274 | msgs := { |
| 275 | mm := { |
| 276 | cMServiceReject := { |
| 277 | messageType := '100010'B, |
| 278 | nsd := ?, |
| 279 | rejectCause := rej_cause, |
| 280 | t3246_Value := * |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 286 | template PDU_ML3_NW_MS tr_PAGING_REQ1(template MobileIdentityLV mi1 := ?, |
| 287 | template MobileIdentityTLV mi2 := *) := { |
| 288 | discriminator := '0110'B, |
| 289 | tiOrSkip := { |
| 290 | skipIndicator := '0000'B |
| 291 | }, |
| 292 | msgs := { |
| 293 | rrm := { |
| 294 | pagingReq_Type1 := { |
| 295 | messageType := '00100001'B, |
| 296 | pageMode := ?, |
| 297 | channelNeeded := ?, |
| 298 | mobileIdentity1 := mi1, |
| 299 | mobileIdentity2 := mi2, |
| 300 | p1RestOctets := ? |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | template PDU_ML3_NW_MS tr_PAGING_REQ2(template TMSIP_TMSI_V mi1 := ?, |
| 307 | template TMSIP_TMSI_V mi2 := ?, |
| 308 | template MobileIdentityTLV mi3 := *) := { |
| 309 | discriminator := '0110'B, |
| 310 | tiOrSkip := { |
| 311 | skipIndicator := '0000'B |
| 312 | }, |
| 313 | msgs := { |
| 314 | rrm := { |
| 315 | pagingReq_Type2 := { |
| 316 | messageType := '00100010'B, |
| 317 | pageMode := ?, |
| 318 | channelNeeded := ?, |
| 319 | mobileIdentity1 := mi1, |
| 320 | mobileIdentity2 := mi2, |
| 321 | mobileIdentity3 := mi3, |
| 322 | p2RestOctets := ? |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | template PDU_ML3_NW_MS tr_PAGING_REQ3(template TMSIP_TMSI_V mi1 := ?, |
| 329 | template TMSIP_TMSI_V mi2 := ?, |
| 330 | template TMSIP_TMSI_V mi3 := ?, |
| 331 | template TMSIP_TMSI_V mi4 := ?) := { |
| 332 | discriminator := '0110'B, |
| 333 | tiOrSkip := { |
| 334 | skipIndicator := '0000'B |
| 335 | }, |
| 336 | msgs := { |
| 337 | rrm := { |
| 338 | pagingReq_Type3 := { |
| 339 | messageType := '00100100'B, |
| 340 | pageMode := ?, |
| 341 | channelNeeded := ?, |
| 342 | mobileIdentity1 := mi1, |
| 343 | mobileIdentity2 := mi2, |
| 344 | mobileIdentity3 := mi3, |
| 345 | mobileIdentity4 := mi4, |
| 346 | p3RestOctets := ? |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | |
| 353 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 354 | /* Send template for PAGING RESPONSE */ |
| 355 | template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := { |
| 356 | discriminator := '0000'B, /* overwritten */ |
| 357 | tiOrSkip := { |
| 358 | skipIndicator := '0000'B |
| 359 | }, |
| 360 | msgs := { |
| 361 | rrm := { |
| 362 | pagingResponse := { |
| 363 | messageType := '00000000'B, /* overwritten */ |
| 364 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 365 | spare1_4 := '0000'B, |
| 366 | mobileStationClassmark := ts_CM2, |
| 367 | mobileIdentity := mi_lv, |
| 368 | additionalUpdateParameters := omit |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | } |
| 373 | |
Harald Welte | 1516614 | 2017-12-16 23:02:08 +0100 | [diff] [blame] | 374 | template (value) PDU_ML3_MS_NW ts_RRM_ModeModifyAck(ChannelDescription2_V desc, ChannelMode_V mode) := { |
| 375 | discriminator := '0000'B, /* overwritten */ |
| 376 | tiOrSkip := { |
| 377 | skipIndicator := '0000'B |
| 378 | }, |
| 379 | msgs := { |
| 380 | rrm := { |
| 381 | channelModeModifyAck := { |
| 382 | messageType := '00010111'B, |
| 383 | channelDescription := desc, |
| 384 | channelMode := mode, |
| 385 | extendedTSCSet := omit |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 391 | template (value) PDU_ML3_MS_NW ts_RRM_CiphModeCompl := { |
| 392 | discriminator := '0000'B, /* overwritten */ |
| 393 | tiOrSkip := { |
| 394 | skipIndicator := '0000'B |
| 395 | }, |
| 396 | msgs := { |
| 397 | rrm := { |
| 398 | cipheringModeComplete := { |
| 399 | messageType := '00110010'B, |
| 400 | mobileEquipmentIdentity := omit |
| 401 | } |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
Harald Welte | ecb254b | 2018-01-29 22:01:54 +0100 | [diff] [blame] | 406 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentComplete(OCT1 cause) := { |
| 407 | discriminator := '0000'B, /* overwritten */ |
| 408 | tiOrSkip := { |
| 409 | skipIndicator := '0000'B |
| 410 | }, |
| 411 | msgs := { |
| 412 | rrm := { |
| 413 | assignmentComplete := { |
| 414 | messageType := '00101001'B, |
| 415 | rR_Cause := { |
| 416 | valuePart := cause |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | } |
| 421 | } |
Harald Welte | 1516614 | 2017-12-16 23:02:08 +0100 | [diff] [blame] | 422 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 423 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := { |
| 424 | discriminator := '0000'B, /* overwritten */ |
| 425 | tiOrSkip := { |
| 426 | skipIndicator := '0000'B |
| 427 | }, |
| 428 | msgs := { |
| 429 | rrm := { |
| 430 | assignmentFailure := { |
| 431 | messageType := '00101111'B, |
| 432 | rR_Cause := { |
| 433 | valuePart := cause |
| 434 | } |
| 435 | } |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 440 | template (value) PDU_ML3_MS_NW ts_RRM_HandoverFailure(OCT1 cause) := { |
| 441 | discriminator := '0000'B, /* overwritten */ |
| 442 | tiOrSkip := { |
| 443 | skipIndicator := '0000'B |
| 444 | }, |
| 445 | msgs := { |
| 446 | rrm := { |
| 447 | handoverFailure := { |
| 448 | messageType := '00101000'B, |
| 449 | rRCause := { |
| 450 | valuePart := cause |
| 451 | }, |
| 452 | pSCause := omit |
| 453 | } |
| 454 | } |
| 455 | } |
| 456 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 457 | |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 458 | template (value) PDU_ML3_MS_NW ts_RRM_HandoverComplete(OCT1 cause) := { |
| 459 | discriminator := '0000'B, /* overwritten */ |
| 460 | tiOrSkip := { |
| 461 | skipIndicator := '0000'B |
| 462 | }, |
| 463 | msgs := { |
| 464 | rrm := { |
| 465 | handoverComplete := { |
| 466 | messageType := '00101100'B, |
| 467 | rRCause := { |
| 468 | valuePart := cause |
| 469 | }, |
| 470 | mobileObsservedTimeDiff := omit, |
| 471 | mobileTimeDifferenceHyperframe := omit |
| 472 | } |
| 473 | } |
| 474 | } |
| 475 | } |
| 476 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 477 | function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { |
| 478 | if (not isvalue(cm3)) { |
| 479 | return omit; |
| 480 | } |
| 481 | var template MobileStationClassmark3_TLV ret := { |
| 482 | elementIdentifier := '20'O, |
| 483 | lengthIndicator := 0, /* overwritten */ |
| 484 | valuePart := cm3 |
| 485 | } |
| 486 | return ret; |
| 487 | } |
| 488 | |
| 489 | template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2, |
| 490 | template (omit) MobileStationClassmark3_TLV cm3 := omit) := { |
| 491 | discriminator := '0110'B, |
| 492 | tiOrSkip := { |
| 493 | skipIndicator := '0000'B |
| 494 | }, |
| 495 | msgs := { |
| 496 | rrm := { |
| 497 | classmarkChange := { |
| 498 | messageType := '00010110'B, |
| 499 | mobileStationClassmark2 := cm2, |
| 500 | mobileStationClassmark3 := cm3 |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | } |
| 505 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 506 | template (value) PDU_ML3_MS_NW ts_RRM_UL_REL(OCT1 cause) := { |
| 507 | discriminator := '0110'B, |
| 508 | tiOrSkip := { |
| 509 | skipIndicator := '0000'B |
| 510 | }, |
| 511 | msgs := { |
| 512 | rrm := { |
| 513 | uplinkRelease := { |
| 514 | messageType := '00001110'B, |
| 515 | rR_Cause := { |
| 516 | valuePart := cause |
| 517 | } |
| 518 | } |
| 519 | } |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | template PDU_ML3_MS_NW tr_RRM_RR_STATUS(template OCT1 cause := ?) := { |
| 524 | discriminator := '0110'B, |
| 525 | tiOrSkip := { |
| 526 | skipIndicator := '0000'B |
| 527 | }, |
| 528 | msgs := { |
| 529 | rrm := { |
| 530 | rR_Status := { |
| 531 | messageType := '00010010'B, |
| 532 | rR_Cause := { |
| 533 | valuePart := cause |
| 534 | } |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | |
| 541 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 542 | template PDU_ML3_MS_NW ts_ML3_MO := { |
| 543 | discriminator := '0000'B, |
| 544 | tiOrSkip := { |
| 545 | skipIndicator := '0000'B |
| 546 | }, |
| 547 | msgs := ? |
| 548 | } |
| 549 | |
| 550 | template LocationUpdatingType ts_ML3_IE_LuType := { |
| 551 | lut := ?, |
| 552 | spare1_1 := '0'B, |
| 553 | fop := '0'B |
| 554 | } |
| 555 | |
| 556 | template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := { |
| 557 | lut := '00'B |
| 558 | } |
| 559 | |
| 560 | template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := { |
| 561 | lut := '01'B |
| 562 | } |
| 563 | |
| 564 | template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := { |
| 565 | lut := '10'B |
| 566 | } |
| 567 | |
| 568 | template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := { |
| 569 | keySequence := int2bit(cksn, 3), |
| 570 | spare := '0'B |
| 571 | } |
| 572 | |
| 573 | template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai, |
| 574 | MobileIdentityLV mi, MobileStationClassmark1_V cm1) |
| 575 | modifies ts_ML3_MO := { |
| 576 | msgs := { |
| 577 | mm := { |
| 578 | locationUpdateRequest := { |
| 579 | messageType := '001000'B, |
| 580 | nsd := '00'B, /* ? */ |
| 581 | locationUpdatingType := lu_type, |
| 582 | cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0), |
| 583 | locationAreaIdentification := lai, |
| 584 | mobileStationClassmark1 := cm1, |
| 585 | mobileIdentityLV := mi, |
| 586 | classmarkInformationType2_forUMTS := omit, |
| 587 | additionalUpdateParameterTV := omit, |
| 588 | deviceProperties := omit, |
| 589 | mS_NetworkFeatureSupport := omit |
| 590 | } |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 595 | template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := { |
| 596 | msgs := { |
| 597 | mm := { |
| 598 | tmsiReallocComplete := { |
| 599 | messageType := '011011'B, |
| 600 | nsd := '00'B |
| 601 | } |
| 602 | } |
| 603 | } |
| 604 | } |
| 605 | |
| 606 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := { |
| 607 | discriminator := '0101'B, |
| 608 | tiOrSkip := { |
| 609 | skipIndicator := '0000'B |
| 610 | }, |
| 611 | msgs := { |
| 612 | mm := { |
| 613 | locationUpdateAccept := { |
| 614 | messageType := '000010'B, |
| 615 | nsd := '00'B, |
| 616 | locationAreaIdentification := ?, |
| 617 | mobileIdentityTLV := *, |
| 618 | followOnProceed := *, |
| 619 | cTS_Permission := *, |
| 620 | equivalentPLMNs := *, |
| 621 | emergencyNumberList := *, |
| 622 | perMS_T3212 := * |
| 623 | } |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := { |
| 629 | discriminator := '0101'B, |
| 630 | tiOrSkip := { |
| 631 | skipIndicator := '0000'B |
| 632 | }, |
| 633 | msgs := { |
| 634 | mm := { |
| 635 | locationUpdateReject := { |
| 636 | messageType := '000100'B, |
| 637 | nsd := '00'B, |
| 638 | rejectCause := cause, |
| 639 | t3246_Value := * |
| 640 | } |
| 641 | } |
| 642 | } |
| 643 | } |
| 644 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 645 | template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template BIT3 id_type := ?) := { |
| 646 | discriminator := '0101'B, |
| 647 | tiOrSkip := { |
| 648 | skipIndicator := '0000'B |
| 649 | }, |
| 650 | msgs := { |
| 651 | mm := { |
| 652 | identityRequest := { |
| 653 | messageType := '011000'B, |
| 654 | nsd := '00'B, |
| 655 | identityType := id_type, |
| 656 | spare1_5 := ? |
| 657 | } |
| 658 | } |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp(MobileIdentityLV mi) modifies ts_ML3_MO := { |
| 663 | msgs := { |
| 664 | mm := { |
| 665 | identityResponse := { |
| 666 | messageType := '011001'B, |
| 667 | nsd := '00'B, |
| 668 | mobileIdentityLV := mi, |
| 669 | p_TMSI_TypeTV := omit, |
| 670 | routingAreaIdentification2TLV := omit, |
| 671 | p_TMSISignature2TLV := omit |
| 672 | } |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMSI(hexstring imsi) := |
| 677 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMSI_LV(imsi))); |
| 678 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMEI(hexstring imei) := |
| 679 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); |
| 680 | |
| 681 | |
Neels Hofmeyr | 6338247 | 2018-03-01 19:57:44 +0100 | [diff] [blame] | 682 | template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B, BIT1 esind := '1'B) := { |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 683 | rf_PowerCapability := '010'B, |
| 684 | a5_1 := a5_1_unavail, |
Neels Hofmeyr | 6338247 | 2018-03-01 19:57:44 +0100 | [diff] [blame] | 685 | esind := esind, |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 686 | revisionLevel := rev, |
| 687 | spare1_1 := '0'B |
| 688 | } |
| 689 | |
| 690 | template PDU_ML3_MS_NW ts_ML3_MO_MM_IMSI_DET_Ind(MobileIdentityLV mi, |
| 691 | template MobileStationClassmark1_V cm1 := ts_CM1) |
| 692 | modifies ts_ML3_MO := { |
| 693 | msgs := { |
| 694 | mm := { |
| 695 | imsiDetachIndication := { |
| 696 | messageType := '000001'B, |
| 697 | nsd := '00'B, |
| 698 | mobileStationClassmark1 := cm1, |
| 699 | mobileIdentityLV := mi |
| 700 | } |
| 701 | } |
| 702 | } |
| 703 | } |
| 704 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 705 | template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { |
| 706 | discriminator := '0011'B, |
| 707 | tiOrSkip := { |
| 708 | transactionId := { |
Daniel Willmann | dcf9eb9 | 2018-02-02 20:07:52 +0100 | [diff] [blame] | 709 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 710 | tiFlag := c_TIF_ORIG, |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 711 | tIExtension := omit |
| 712 | } |
| 713 | } |
| 714 | } |
| 715 | |
| 716 | template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := { |
| 717 | elementIdentifier := '5E'O, |
| 718 | lengthIndicator := 0, /* overwritten */ |
| 719 | numberingPlanIdentification := '0000'B, |
| 720 | typeOfNumber := '000'B, /* unknown */ |
| 721 | ext1 := '0'B, |
| 722 | digits := digits |
| 723 | } |
| 724 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 725 | template CalledPartyBCD_Number tr_Called(template hexstring digits) := { |
| 726 | elementIdentifier := '5E'O, |
| 727 | lengthIndicator := ?, |
| 728 | numberingPlanIdentification := ?, |
| 729 | typeOfNumber := ?, |
| 730 | ext1 := ?, |
| 731 | digits := digits |
| 732 | } |
| 733 | |
| 734 | template CallingPartyBCD_Number tr_Calling(template hexstring digits) := { |
| 735 | elementIdentifier := '5C'O, |
| 736 | lengthIndicator := ?, |
| 737 | oct3 := ?, |
| 738 | digits := digits |
| 739 | } |
| 740 | |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 741 | type integer SpeechVer; |
| 742 | |
| 743 | template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { |
| 744 | speechVersionIndication := int2bit(ver-1,3) & suffix, |
| 745 | spare1_1 := '0'B, |
| 746 | cTM_or_Spare := '0'B, |
| 747 | coding := '0'B, |
| 748 | extension_octet_3a_3b := '0'B |
| 749 | } |
| 750 | |
| 751 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B); |
| 752 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B); |
| 753 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 754 | template (value) BearerCapability_TLV ts_Bcap_voice := { |
| 755 | elementIdentifier := '04'O, |
| 756 | lengthIndicator := 0, /* overwritten */ |
| 757 | octet3 := { |
| 758 | informationTransferCapability := '000'B, |
| 759 | transferMode := '0'B, |
| 760 | codingStandard := '0'B, |
| 761 | radioChannelRequirement := '11'B, /* FR preferred */ |
| 762 | extension_octet_3 := '0'B, /* overwritten */ |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 763 | speech_aux_3a_3b := { |
| 764 | valueof(ts_SpeechAuxHR(3)), |
| 765 | valueof(ts_SpeechAuxFR(3)), |
| 766 | valueof(ts_SpeechAuxFR(2)), |
| 767 | valueof(ts_SpeechAuxFR(1)), |
| 768 | valueof(ts_SpeechAuxHR(1)) |
| 769 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 770 | }, |
| 771 | octet4 := omit, |
| 772 | octet5 := omit, |
| 773 | octet6 := omit, |
| 774 | octet7 := omit |
| 775 | } |
| 776 | |
| 777 | template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 778 | discriminator := '0011'B, |
| 779 | tiOrSkip := { |
| 780 | transactionId := { |
| 781 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 782 | tiFlag := c_TIF_ORIG, |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 783 | tIExtension := omit |
| 784 | } |
| 785 | }, |
| 786 | msgs := { |
| 787 | cc := { |
| 788 | setup_MS_NW := { |
| 789 | messageType := '000101'B, |
| 790 | nsd := '00'B, |
| 791 | bcRepeatIndicator := omit, |
| 792 | bearerCapability1 := bcap, |
| 793 | bearerCapability2 := omit, |
| 794 | facility := omit, |
| 795 | callingPartySubAddress := omit, |
| 796 | calledPartyBCD_Number := ts_Called(called), |
| 797 | calledPartySubAddress := omit, |
| 798 | llc_RepeatIndicator := omit, |
| 799 | lowLayerCompatibility1 := omit, |
| 800 | lowLayerCompatibility2 := omit, |
| 801 | hlc_RepeatIndicator := omit, |
| 802 | highLayerCompatibility1 := omit, |
| 803 | highLayerCompatibility2 := omit, |
| 804 | user_user := omit, |
| 805 | ss_VersionIndicator := omit, |
| 806 | clir_Suppression := omit, |
| 807 | clir_Invocation := omit, |
| 808 | cC_Capabilities := omit, |
| 809 | facility_ccbs1 := omit, |
| 810 | facility_ccbs2 := omit, |
| 811 | streamIdentifier := omit, |
| 812 | supportedCodecs := omit, |
| 813 | redial := omit |
| 814 | } |
| 815 | } |
| 816 | } |
| 817 | } |
| 818 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 819 | template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 820 | discriminator := '0011'B, |
| 821 | tiOrSkip := { |
| 822 | transactionId := { |
| 823 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 824 | tiFlag := c_TIF_ORIG, |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 825 | tIExtension := omit |
| 826 | } |
| 827 | }, |
| 828 | msgs := { |
| 829 | cc := { |
| 830 | emergencySetup := { |
| 831 | messageType := '001110'B, |
| 832 | nsd := '00'B, |
| 833 | bearerCapability := bcap, |
| 834 | streamIdentifier := omit, |
| 835 | supportedCodecs := omit, |
| 836 | emergencyCategory := omit |
| 837 | } |
| 838 | } |
| 839 | } |
| 840 | } |
| 841 | |
| 842 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 843 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { |
| 844 | discriminator := '0011'B, |
| 845 | tiOrSkip := { |
| 846 | transactionId := { |
| 847 | tio := int2bit(tid, 3), |
| 848 | tiFlag := ?, |
| 849 | tIExtension := omit |
| 850 | } |
| 851 | }, |
| 852 | msgs := { |
| 853 | cc := { |
| 854 | callProceeding := { |
| 855 | messageType := '000010'B, |
| 856 | nsd := '00'B, |
| 857 | repeatIndicator := *, |
| 858 | bearerCapability1 := *, |
| 859 | bearerCapability2 := *, |
| 860 | facility := *, |
| 861 | progressIndicator := *, |
| 862 | priorityGranted := *, |
| 863 | networkCCCapabilities := * |
| 864 | } |
| 865 | } |
| 866 | } |
| 867 | } |
| 868 | |
| 869 | template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := { |
| 870 | discriminator := '0011'B, |
| 871 | tiOrSkip := { |
| 872 | transactionId := { |
| 873 | tio := int2bit(tid, 3), |
| 874 | tiFlag := ?, |
| 875 | tIExtension := omit |
| 876 | } |
| 877 | }, |
| 878 | msgs := { |
| 879 | cc := { |
| 880 | alerting_NW_MS := { |
| 881 | messageType := '000001'B, |
| 882 | nsd := '00'B, |
| 883 | facility := *, |
| 884 | progressIndicator := *, |
| 885 | user_user := * |
| 886 | } |
| 887 | } |
| 888 | } |
| 889 | } |
| 890 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 891 | template PDU_ML3_MS_NW ts_ML3_MO_CC_ALERTING(integer tid) := { |
| 892 | discriminator := '0011'B, |
| 893 | tiOrSkip := { |
| 894 | transactionId := { |
| 895 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 896 | tiFlag := c_TIF_REPL, |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 897 | tIExtension := omit |
| 898 | } |
| 899 | }, |
| 900 | msgs := { |
| 901 | cc := { |
| 902 | alerting_MS_NW := { |
| 903 | messageType := '000001'B, |
| 904 | nsd := '00'B, |
| 905 | facility := omit, |
| 906 | user_user := omit, |
| 907 | ss_VersionIndicator := omit |
| 908 | } |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | template PDU_ML3_MS_NW ts_ML3_MT_CC_ALERTING(integer tid) := { |
| 914 | discriminator := '0011'B, |
| 915 | tiOrSkip := { |
| 916 | transactionId := { |
| 917 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 918 | tiFlag := c_TIF_REPL, |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 919 | tIExtension := omit |
| 920 | } |
| 921 | }, |
| 922 | msgs := { |
| 923 | cc := { |
| 924 | alerting_MS_NW := { |
| 925 | messageType := '000001'B, |
| 926 | nsd := '00'B, |
| 927 | facility := omit, |
| 928 | user_user := omit, |
| 929 | ss_VersionIndicator := omit |
| 930 | } |
| 931 | } |
| 932 | } |
| 933 | } |
| 934 | |
| 935 | template PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT(integer tid) := { |
| 936 | discriminator := '0011'B, |
| 937 | tiOrSkip := { |
| 938 | transactionId := { |
| 939 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 940 | tiFlag := c_TIF_REPL, |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 941 | tIExtension := omit |
| 942 | } |
| 943 | }, |
| 944 | msgs := { |
| 945 | cc := { |
| 946 | connect_MS_NW := { |
| 947 | messageType := '000111'B, |
| 948 | nsd := '00'B, |
| 949 | facility := omit, |
| 950 | connectedSubAddress := omit, |
| 951 | user_user := omit, |
| 952 | ss_VersionIndicator := omit, |
| 953 | streamIdentifier := omit |
| 954 | } |
| 955 | } |
| 956 | } |
| 957 | } |
| 958 | |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 959 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := { |
| 960 | discriminator := '0011'B, |
| 961 | tiOrSkip := { |
| 962 | transactionId := { |
| 963 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 964 | tiFlag := c_TIF_REPL, |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 965 | tIExtension := omit |
| 966 | } |
| 967 | }, |
| 968 | msgs := { |
| 969 | cc := { |
| 970 | connect_NW_MS := { |
| 971 | messageType := '000111'B, |
| 972 | nsd := '00'B, |
| 973 | facility := *, |
| 974 | progressIndicator := *, |
| 975 | connectedNumber := *, |
| 976 | connectedSubAddress := *, |
| 977 | user_user := * |
| 978 | } |
| 979 | } |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := { |
| 984 | discriminator := '0011'B, |
| 985 | tiOrSkip := { |
| 986 | transactionId := { |
| 987 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 988 | tiFlag := c_TIF_ORIG, |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 989 | tIExtension := omit |
| 990 | } |
| 991 | }, |
| 992 | msgs := { |
| 993 | cc := { |
| 994 | connectAck := { |
| 995 | messageType := '001111'B, |
| 996 | nsd := '00'B |
| 997 | } |
| 998 | } |
| 999 | } |
| 1000 | } |
| 1001 | |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1002 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_START_DTMF(integer tid, charstring number) := { |
| 1003 | discriminator := '0011'B, |
| 1004 | tiOrSkip := { |
| 1005 | transactionId := { |
| 1006 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1007 | tiFlag := c_TIF_ORIG, |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1008 | tIExtension := omit |
| 1009 | } |
| 1010 | }, |
| 1011 | msgs := { |
| 1012 | cc := { |
| 1013 | startDTMF := { |
| 1014 | messageType := '110101'B, |
| 1015 | nsd := '00'B, |
| 1016 | keypadFacility := { |
| 1017 | elementIdentifier := '2C'O, |
| 1018 | keypadInformation := int2bit(char2int(number), 7), |
| 1019 | spare_1 := '0'B |
| 1020 | } |
| 1021 | } |
| 1022 | } |
| 1023 | } |
| 1024 | } |
| 1025 | |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 1026 | template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { |
| 1027 | discriminator := '0011'B, |
| 1028 | tiOrSkip := { |
| 1029 | transactionId := { |
| 1030 | tio := int2bit(tid, 3), |
| 1031 | tiFlag := ?, |
| 1032 | tIExtension := omit |
| 1033 | } |
| 1034 | }, |
| 1035 | msgs := { |
| 1036 | cc := { |
| 1037 | disconnect_NW_MS := { |
| 1038 | messageType := '100101'B, |
| 1039 | nsd := '00'B, |
| 1040 | cause := ?, |
| 1041 | facility := *, |
| 1042 | progressIndicator := *, |
| 1043 | user_user := *, |
| 1044 | allowedActions := * |
| 1045 | } |
| 1046 | } |
| 1047 | } |
| 1048 | } |
| 1049 | |
| 1050 | template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := { |
| 1051 | discriminator := '0011'B, |
| 1052 | tiOrSkip := { |
| 1053 | transactionId := { |
| 1054 | tio := int2bit(tid, 3), |
| 1055 | tiFlag := ?, |
| 1056 | tIExtension := omit |
| 1057 | } |
| 1058 | }, |
| 1059 | msgs := { |
| 1060 | cc := { |
| 1061 | release_NW_MS := { |
| 1062 | messageType := '101101'B, |
| 1063 | nsd := '00'B, |
| 1064 | cause := ?, |
| 1065 | secondCause := *, |
| 1066 | facility := *, |
| 1067 | user_user := * |
| 1068 | } |
| 1069 | } |
| 1070 | } |
| 1071 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 1072 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1073 | template PDU_ML3_MS_NW ts_ML3_MO_CC_RELEASE(integer tid, BIT1 tid_remote, BIT7 cause) := { |
| 1074 | discriminator := '0011'B, |
| 1075 | tiOrSkip := { |
| 1076 | transactionId := { |
| 1077 | tio := int2bit(tid, 3), |
| 1078 | tiFlag := tid_remote, |
| 1079 | tIExtension := omit |
| 1080 | } |
| 1081 | }, |
| 1082 | msgs := { |
| 1083 | cc := { |
| 1084 | release_MS_NW := { |
| 1085 | messageType := '101101'B, |
| 1086 | nsd := '00'B, |
| 1087 | cause := ts_ML3_Cause(cause), |
| 1088 | secondCause := omit, |
| 1089 | facility := omit, |
| 1090 | user_user := omit, |
| 1091 | ss_VersionIndicator := omit |
| 1092 | } |
| 1093 | } |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 1098 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := { |
| 1099 | discriminator := '0011'B, |
| 1100 | tiOrSkip := { |
| 1101 | transactionId := { |
| 1102 | tio := int2bit(tid, 3), |
| 1103 | tiFlag := '0'B, |
| 1104 | tIExtension := omit |
| 1105 | } |
| 1106 | }, |
| 1107 | msgs := { |
| 1108 | cc := { |
| 1109 | releaseComplete_MS_NW := { |
| 1110 | messageType := '101010'B, |
| 1111 | nsd := '00'B, |
| 1112 | cause := omit, |
| 1113 | facility := omit, |
| 1114 | user_user := omit, |
| 1115 | ss_VersionIndicator := omit |
| 1116 | } |
| 1117 | } |
| 1118 | } |
| 1119 | } |
| 1120 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1121 | template PDU_ML3_NW_MS tr_ML3_MT_CC_REL_COMPL(integer tid) := { |
| 1122 | discriminator := '0011'B, |
| 1123 | tiOrSkip := { |
| 1124 | transactionId := { |
| 1125 | tio := int2bit(tid, 3), |
| 1126 | tiFlag := ?, |
| 1127 | tIExtension := omit |
| 1128 | } |
| 1129 | }, |
| 1130 | msgs := { |
| 1131 | cc := { |
| 1132 | releaseComplete_NW_MS := { |
| 1133 | messageType := '101010'B, |
| 1134 | nsd := '00'B, |
| 1135 | cause := *, |
| 1136 | facility := *, |
| 1137 | user_user := * |
| 1138 | } |
| 1139 | } |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 1144 | |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 1145 | template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { |
| 1146 | discriminator := '0101'B, |
| 1147 | tiOrSkip := { |
| 1148 | skipIndicator := '0000'B |
| 1149 | }, |
| 1150 | msgs := { |
| 1151 | mm := { |
| 1152 | authenticationRequest := { |
| 1153 | messageType := '010010'B, |
| 1154 | nsd := '00'B, |
| 1155 | cipheringKeySequenceNumber := ?, |
| 1156 | spare2_4 := ?, |
| 1157 | authenticationParRAND := rand, |
| 1158 | authenticationParAUTN := * |
| 1159 | } |
| 1160 | } |
| 1161 | } |
| 1162 | } |
| 1163 | |
| 1164 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := { |
| 1165 | discriminator := '0101'B, |
| 1166 | tiOrSkip := { |
| 1167 | skipIndicator := '0000'B |
| 1168 | }, |
| 1169 | msgs := { |
| 1170 | mm := { |
| 1171 | authenticationResponse := { |
| 1172 | messageType := '010100'B, |
| 1173 | nsd := '00'B, |
| 1174 | authenticationParSRES := sres, |
| 1175 | authenticationParSRESext := omit |
| 1176 | } |
| 1177 | } |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := { |
| 1182 | discriminator := '0101'B, |
| 1183 | tiOrSkip := { |
| 1184 | skipIndicator := '0000'B |
| 1185 | }, |
| 1186 | msgs := { |
| 1187 | mm := { |
| 1188 | authenticationResponse := { |
| 1189 | messageType := '010100'B, |
| 1190 | nsd := '00'B, |
| 1191 | authenticationParSRES := sres, |
| 1192 | authenticationParSRESext := { |
| 1193 | elementIdentifier := '21'O, |
| 1194 | lengthIndicator := 0, /* overwritten */ |
| 1195 | valueField := res |
| 1196 | } |
| 1197 | } |
| 1198 | } |
| 1199 | } |
| 1200 | } |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 1201 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1202 | template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid, |
| 1203 | template BearerCapability_TLV bcap := omit) := { |
| 1204 | discriminator := '0011'B, |
| 1205 | tiOrSkip := { |
| 1206 | transactionId := { |
| 1207 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1208 | tiFlag := c_TIF_REPL, /* response from destination */ |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1209 | tIExtension := omit |
| 1210 | } |
| 1211 | }, |
| 1212 | msgs := { |
| 1213 | cc := { |
| 1214 | callConfirmed := { |
| 1215 | messageType := '001000'B, |
| 1216 | nsd := '00'B, |
| 1217 | repeatIndicator := omit, |
| 1218 | bearerCapability1 := bcap, |
| 1219 | bearerCapability2 := omit, |
| 1220 | cause := omit, |
| 1221 | cC_Capabilities := omit, |
| 1222 | streamIdentifier := omit, |
| 1223 | supportedCodecs := omit |
| 1224 | } |
| 1225 | } |
| 1226 | } |
| 1227 | } |
| 1228 | |
| 1229 | |
| 1230 | template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *, |
| 1231 | template hexstring calling := *, |
| 1232 | template BearerCapability_TLV bcap := *) := { |
| 1233 | discriminator := '0011'B, |
| 1234 | tiOrSkip := { |
| 1235 | transactionId := { |
| 1236 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1237 | tiFlag := c_TIF_ORIG, /* from originator */ |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1238 | tIExtension := omit |
| 1239 | } |
| 1240 | }, |
| 1241 | msgs := { |
| 1242 | cc := { |
| 1243 | setup_NW_MS := { |
| 1244 | messageType := '000101'B, |
| 1245 | nsd := '00'B, |
| 1246 | bcRepeatIndicator := *, |
| 1247 | bearerCapability1 := bcap, |
| 1248 | bearerCapability2 := *, |
| 1249 | facility := *, |
| 1250 | progressIndicator := *, |
| 1251 | signal := *, |
| 1252 | callingPartyBCD_Number := tr_Calling(calling) ifpresent, |
| 1253 | callingPartySubAddress := *, |
| 1254 | calledPartyBCD_Number := tr_Called(called) ifpresent, |
| 1255 | calledPartySubAddress := *, |
| 1256 | redirectingPartyBCDNumber := *, |
| 1257 | redirectingPartySubaddress := *, |
| 1258 | llc_RepeatIndicator := *, |
| 1259 | lowLayerCompatibility1 := *, |
| 1260 | lowLayerCompatibility2 := *, |
| 1261 | hlc_RepeatIndicator := *, |
| 1262 | highLayerCompatibility1 := *, |
| 1263 | highLayerCompatibility2 := *, |
| 1264 | user_user := *, |
| 1265 | priority := *, |
| 1266 | alert := *, |
| 1267 | networkCCCapabilities := *, |
| 1268 | causeofNoCli := *, |
| 1269 | backupBearerCapacity := * |
| 1270 | } |
| 1271 | } |
| 1272 | } |
| 1273 | } |
| 1274 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1275 | /*********************************************************************** |
| 1276 | * GPRS Mobility Management |
| 1277 | ***********************************************************************/ |
| 1278 | |
| 1279 | template (value) MSNetworkCapabilityV ts_GMM_MsNetCapV := { |
| 1280 | gea1bit := '1'B, |
| 1281 | smCapabilitiesviaDedicatedChannels := '1'B, |
| 1282 | smCapabilitiesviaGPRSChannels := '0'B, |
| 1283 | ucs2Support := '1'B, |
| 1284 | ssScreeningIndicator := '01'B, |
| 1285 | solSACapability := omit, |
| 1286 | revisionLevelIndicatior := omit, |
| 1287 | pFCFeatureMode := omit, |
| 1288 | extendedGEAbits := omit, |
| 1289 | lcsVAcapability := omit, |
| 1290 | pSInterRATHOtoUTRANIuModeCapability := omit, |
| 1291 | pSInterRATHOtoEUTRANS1ModeCapability := omit, |
| 1292 | eMMCombinedProceduresCapability := omit, |
| 1293 | iSRSupport := omit, |
| 1294 | sRVCCtoGERANUTRANCapability := omit, |
| 1295 | ePCCapability := omit, |
| 1296 | nFCapability := omit, |
| 1297 | gERANNertworkSharingCapability := omit, |
| 1298 | spare_octets := omit |
| 1299 | }; |
| 1300 | |
| 1301 | template (value) MSNetworkCapabilityLV ts_GMM_MsNetCapLV := { |
| 1302 | lengthIndicator := 0, /* overwritten */ |
| 1303 | msNetworkCapabilityV := ts_GMM_MsNetCapV |
| 1304 | }; |
| 1305 | |
| 1306 | type enumerated GprsAttachType { |
| 1307 | GPRS_ATT_T_GPRS, |
| 1308 | GPRS_ATT_T_GPRS_IMSI_COMBINED |
| 1309 | }; |
| 1310 | |
| 1311 | function ts_GMM_AttachType(boolean combined := false, boolean follow_on_pending := false) |
| 1312 | return AttachTypeV { |
| 1313 | var AttachTypeV att; |
| 1314 | if (combined) { |
| 1315 | att.attachType := '011'B; |
| 1316 | } else { |
| 1317 | att.attachType := '001'B; |
| 1318 | } |
| 1319 | att.for_l3 := bool2bit(combined); |
| 1320 | return att; |
| 1321 | } |
| 1322 | |
| 1323 | type enumerated GprsUpdateType { |
| 1324 | GPRS_UPD_T_RA ('000'B), |
| 1325 | GPRS_UPD_T_RA_LA_COMBINED ('001'B), |
| 1326 | GPRS_UPD_T_RA_LA_COMBINED_IMSI_ATT ('010'B), |
| 1327 | GPRS_UPD_T_PERIODIC ('011'B) |
| 1328 | }; |
| 1329 | |
| 1330 | /* 10.5.5.18 Update Type */ |
| 1331 | template UpdateTypeV ts_GMM_UpdateType(GprsUpdateType upd_t, boolean combined := false, |
| 1332 | boolean follow_on_pending := false) := { |
| 1333 | valueField := int2bit(enum2int(upd_t), 3), |
| 1334 | for_l3 := bool2bit(combined) |
| 1335 | } |
| 1336 | |
| 1337 | template (value) DRXParameterV ts_DrxParameterV := { |
| 1338 | splitPGCycleCode := '00'O, /* no DRX */ |
| 1339 | nonDRXTimer := '000'B, /* no non-DRX mode */ |
| 1340 | splitOnCCCH := '0'B, /* not supported */ |
| 1341 | cnSpecificDRXCycleLength := '0000'B /* SI value used */ |
| 1342 | }; |
| 1343 | |
| 1344 | template (value) AccessCapabilitiesStruct ts_AccesssCap := { |
| 1345 | lengthIndicator := 0, /* overwritten */ |
| 1346 | accessCapabilities := { |
| 1347 | rfPowerCapability := '001'B, /* FIXME */ |
| 1348 | presenceBitA5 := '0'B, |
| 1349 | a5bits := omit, |
| 1350 | esind := '1'B, |
| 1351 | psbit := '0'B, |
| 1352 | vgcs := '0'B, |
| 1353 | vbs := '0'B, |
| 1354 | presenceBitMultislot := '0'B, |
| 1355 | multislotcap := omit, |
| 1356 | accessCapAdditionsAfterRel97 := omit |
| 1357 | }, |
| 1358 | spare_bits := omit |
| 1359 | } |
| 1360 | |
| 1361 | template (value) MSRACapabilityValuesRecord ts_RaCapRec(BIT4 att) := { |
| 1362 | mSRACapabilityValues := { |
| 1363 | mSRACapabilityValuesExclude1111 := { |
| 1364 | accessTechnType := '0001'B, /* E-GSM */ |
| 1365 | accessCapabilities := ts_AccesssCap |
| 1366 | } |
| 1367 | }, |
| 1368 | presenceBitMSRACap := '0'B |
| 1369 | }; |
| 1370 | |
| 1371 | template (value) MSRadioAccessCapabilityLV ts_MS_RaCapa := { |
| 1372 | lengthIndicator := 0, /* overwritten */ |
| 1373 | msRadioAccessCapabilityV := { |
| 1374 | ts_RaCapRec('0001'B) /* E-GSM */ |
| 1375 | } |
| 1376 | } |
| 1377 | |
| 1378 | template (value) PDU_L3_MS_SGSN |
| 1379 | ts_GMM_ATTACH_REQ(MobileIdentityLV mi_lv, RoutingAreaIdentificationV old_ra, |
| 1380 | boolean combined := false, boolean follow_on_pending := false, |
| 1381 | template (omit) MobileStationClassmark2_TLV cm2_tlv, |
| 1382 | template (omit) MobileStationClassmark3_TLV cm3_tlv |
| 1383 | ) := { |
| 1384 | discriminator := '0000'B, /* overwritten */ |
| 1385 | tiOrSkip := { |
| 1386 | skipIndicator := '0000'B |
| 1387 | }, |
| 1388 | msgs := { |
| 1389 | gprs_mm := { |
| 1390 | attachRequest := { |
| 1391 | messageType := '00000000'B, /* overwritten */ |
| 1392 | msNetworkCapability := ts_GMM_MsNetCapLV, |
| 1393 | attachType := valueof(ts_GMM_AttachType(combined, follow_on_pending)), |
| 1394 | gprsCKSN := { '111'B, '0'B }, |
| 1395 | drxParam := ts_DrxParameterV, |
| 1396 | mobileIdentity := mi_lv, |
| 1397 | oldRoutingAreaID := old_ra, |
| 1398 | msRACap := ts_MS_RaCapa, |
| 1399 | ptmsiSignature := omit, /* TODO */ |
| 1400 | reqGPRStimer := omit, |
| 1401 | tmsiStatus := omit, |
| 1402 | pC_LCSCapability := omit, |
| 1403 | mobileStationClassmark2 := cm2_tlv, |
| 1404 | mobileStationClassmark3 := cm3_tlv, |
| 1405 | supportedCodecs := omit, |
| 1406 | uENetworkCapability := omit, |
| 1407 | additionalMobileIdentity := omit, |
| 1408 | routingAreaIdentification2 := omit, |
| 1409 | voiceDomainandUEsUsageSetting := omit, |
| 1410 | deviceProperties := omit, |
| 1411 | p_TMSI_Type := omit, |
| 1412 | mS_NetworkFeatureSupport := omit, |
| 1413 | oldLocationAreaIdentification := omit, |
| 1414 | additionalUpdateType := omit, |
| 1415 | tMSIBasedNRIcontainer := omit, |
| 1416 | t3324 := omit, |
| 1417 | t3312_ExtendedValue := omit, |
| 1418 | extendedDRXParameters := omit |
| 1419 | } |
| 1420 | } |
| 1421 | } |
| 1422 | } |
| 1423 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 1424 | private function tr_MI_TMSI_TLV(template OCT4 tmsi) return template MobileIdentityTLV { |
| 1425 | if (istemplatekind(tmsi, "*")) { |
| 1426 | return *; |
| 1427 | } else if (istemplatekind(tmsi, "?")) { |
| 1428 | return ?; |
| 1429 | } else { |
| 1430 | var template MobileIdentityTLV mi := { |
| 1431 | elementIdentifier := '0011000'B, |
| 1432 | spare1 := '0'B, |
| 1433 | mobileIdentityLV := { |
| 1434 | lengthIndicator := 4, |
| 1435 | mobileIdentityV := { |
| 1436 | typeOfIdentity := '100'B, |
| 1437 | oddEvenInd_identity := { |
| 1438 | tmsi_ptmsi := { |
| 1439 | oddevenIndicator := '1'B, |
| 1440 | fillerDigit := '1111'B, |
| 1441 | octets := tmsi |
| 1442 | } |
| 1443 | } |
| 1444 | } |
| 1445 | } |
| 1446 | }; |
| 1447 | return mi; |
| 1448 | } |
| 1449 | } |
| 1450 | |
| 1451 | template PDU_L3_SGSN_MS tr_GMM_ATTACH_ACCEPT(template BIT3 res := ?, |
| 1452 | template RoutingAreaIdentificationV ra := ?, |
| 1453 | template OCT4 ptmsi := *) := { |
| 1454 | discriminator := '1000'B, |
| 1455 | tiOrSkip := { |
| 1456 | skipIndicator := '0000'B |
| 1457 | }, |
| 1458 | msgs := { |
| 1459 | gprs_mm := { |
| 1460 | attachAccept := { |
| 1461 | messageType := '00000010'B, |
| 1462 | attachResult := { res, ? }, |
| 1463 | forceToStandby := ?, |
| 1464 | updateTimer := ?, |
| 1465 | radioPriority := ?, |
| 1466 | radioPriorityTOM8 := ?, |
| 1467 | routingAreaIdentification := ra, |
| 1468 | ptmsiSignature := *, |
| 1469 | readyTimer := *, |
| 1470 | allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi), |
| 1471 | msIdentity := *, |
| 1472 | gmmCause := *, |
| 1473 | t3302 := *, |
| 1474 | cellNotification := *, |
| 1475 | equivalentPLMNs := *, |
| 1476 | networkFeatureSupport := *, |
| 1477 | emergencyNumberList := *, |
| 1478 | requestedMSInformation := *, |
| 1479 | t3319 := *, |
| 1480 | t3323 := *, |
| 1481 | t3312_ExtendedValue := *, |
| 1482 | additionalNetworkFeatureSupport := *, |
| 1483 | t3324 := *, |
| 1484 | extendedDRXParameters := * |
| 1485 | } |
| 1486 | } |
| 1487 | } |
| 1488 | } |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1489 | |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 1490 | template PDU_L3_SGSN_MS tr_GMM_ATTACH_REJECT(template OCT1 cause) := { |
| 1491 | discriminator := '1000'B, |
| 1492 | tiOrSkip := { |
| 1493 | skipIndicator := '0000'B |
| 1494 | }, |
| 1495 | msgs := { |
| 1496 | gprs_mm := { |
| 1497 | attachReject := { |
| 1498 | messageType := '00000100'B, |
| 1499 | gmmCause := { |
| 1500 | causeValue := cause |
| 1501 | }, |
| 1502 | t3302 := *, |
| 1503 | t3346 := * |
| 1504 | } |
| 1505 | } |
| 1506 | } |
| 1507 | } |
| 1508 | |
| 1509 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1510 | template (value) PDU_L3_MS_SGSN ts_GMM_ATTACH_COMPL := { |
| 1511 | discriminator := '0000'B, /* overwritten */ |
| 1512 | tiOrSkip := { |
| 1513 | skipIndicator := '0000'B |
| 1514 | }, |
| 1515 | msgs := { |
| 1516 | gprs_mm := { |
| 1517 | attachComplete := { |
| 1518 | messageType := '00000000'B, /* overwritten */ |
| 1519 | interRATHandoverInformation := omit, |
| 1520 | eUTRANinterRATHandoverInformation := omit |
| 1521 | } |
| 1522 | } |
| 1523 | } |
| 1524 | } |
| 1525 | |
| 1526 | template (value) PDU_L3_MS_SGSN |
| 1527 | ts_GMM_RAU_REQ(MobileIdentityLV mi_lv, GprsUpdateType upd_type, |
| 1528 | RoutingAreaIdentificationV old_ra, |
| 1529 | boolean follow_on_pending := false, |
| 1530 | template (omit) MobileStationClassmark2_TLV cm2_tlv, |
| 1531 | template (omit) MobileStationClassmark3_TLV cm3_tlv |
| 1532 | ) := { |
| 1533 | discriminator := '0000'B, /* overwritten */ |
| 1534 | tiOrSkip := { |
| 1535 | skipIndicator := '0000'B |
| 1536 | }, |
| 1537 | msgs := { |
| 1538 | gprs_mm := { |
| 1539 | routingAreaUpdateRequest := { |
| 1540 | messageType := '00000000'B, /* overwritten */ |
| 1541 | updateType := ts_GMM_UpdateType(upd_type, follow_on_pending), |
| 1542 | gprsCKSN := { '111'B, '0'B }, |
| 1543 | oldRoutingAreaId := old_ra, |
| 1544 | msRACap := ts_MS_RaCapa, |
| 1545 | oldPTMSISignature := omit, /* TODO */ |
| 1546 | readyTimerValue := omit, |
| 1547 | drxParameter := omit, |
| 1548 | tmsiStatus := omit, |
| 1549 | ptmsi := omit, |
| 1550 | mSNetworkCapability := omit, |
| 1551 | pdpContextStatus := omit, /* TODO */ |
| 1552 | pC_LCSCapability := omit, |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 1553 | mBMS_ContextStatus := omit, |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1554 | uENetworkCapability := omit, |
| 1555 | additionalMobileIdentity := omit, |
| 1556 | oldRoutingAreaIdentification2 := omit, |
| 1557 | mobileStationClassmark2 := cm2_tlv, |
| 1558 | mobileStationClassmark3 := cm3_tlv, |
| 1559 | supportedCodecs := omit, |
| 1560 | voiceDomainUEUsageSetting := omit, |
| 1561 | p_TMSI_Type := omit, |
| 1562 | deviceProperties := omit, |
| 1563 | mS_NetworkFeatureSupport := omit, |
| 1564 | oldLocationAreaIdentification := omit, |
| 1565 | additionalUpdateType := omit, |
| 1566 | tMSIBasedNRIcontainer := omit, |
| 1567 | t3324 := omit, |
| 1568 | t3312_ExtendedValue := omit, |
| 1569 | extendedDRXParameters := omit |
| 1570 | } |
| 1571 | } |
| 1572 | } |
| 1573 | } |
| 1574 | |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 1575 | template PDU_L3_SGSN_MS tr_GMM_RAU_REJECT(template OCT1 cause := ?) := { |
| 1576 | discriminator := '1000'B, |
| 1577 | tiOrSkip := { |
| 1578 | skipIndicator := '0000'B |
| 1579 | }, |
| 1580 | msgs := { |
| 1581 | gprs_mm := { |
| 1582 | routingAreaUpdateReject := { |
| 1583 | messageType := '00001011'B, |
| 1584 | gmmCause := { |
| 1585 | causeValue := cause |
| 1586 | }, |
| 1587 | forceToStandby := ?, |
| 1588 | spare := '0000'B, |
| 1589 | t3302 := *, |
| 1590 | t3346 := * |
| 1591 | } |
| 1592 | } |
| 1593 | } |
| 1594 | } |
| 1595 | |
Harald Welte | 91636de | 2018-02-17 10:16:14 +0100 | [diff] [blame] | 1596 | template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?, |
| 1597 | template RoutingAreaIdentificationV ra := ?, |
| 1598 | template OCT4 ptmsi := *) := { |
| 1599 | discriminator := '1000'B, |
| 1600 | tiOrSkip := { |
| 1601 | skipIndicator := '0000'B |
| 1602 | }, |
| 1603 | msgs := { |
| 1604 | gprs_mm := { |
| 1605 | routingAreaUpdateAccept := { |
| 1606 | messageType := '00001001'B, |
| 1607 | forceToStandby := ?, |
| 1608 | updateResult := { res, ? }, |
| 1609 | raUpdateTimer := ?, |
| 1610 | routingAreaId := ra, |
| 1611 | ptmsiSignature := *, |
| 1612 | allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi), |
| 1613 | msIdentity := *, |
| 1614 | receiveNPDUNumbers := *, |
| 1615 | readyTimer := *, |
| 1616 | gmmCause := *, |
| 1617 | t3302 := *, |
| 1618 | cellNotification := *, |
| 1619 | equivalentPLMNs := *, |
| 1620 | pdpContextStatus := *, |
| 1621 | networkFeatureSupport := *, |
| 1622 | emergencyNumberList := *, |
| 1623 | mBMS_ContextStatus := *, |
| 1624 | requestedMSInformation := *, |
| 1625 | t3319 := *, |
| 1626 | t3323 := *, |
| 1627 | t3312_ExtendedValue := *, |
| 1628 | additionalNetworkFeatureSupport := *, |
| 1629 | t3324 := *, |
| 1630 | extendedDRXParameters := * |
| 1631 | } |
| 1632 | } |
| 1633 | } |
| 1634 | } |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 1635 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1636 | template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := { |
| 1637 | discriminator := '0000'B, /* overwritten */ |
| 1638 | tiOrSkip := { |
| 1639 | skipIndicator := '0000'B |
| 1640 | }, |
| 1641 | msgs := { |
| 1642 | gprs_mm := { |
| 1643 | routingAreaUpdateComplete := { |
| 1644 | messageType := '00000000'B, /* overwritten */ |
| 1645 | receiveNPDUNumbers := omit, |
| 1646 | interRATHandoverInformation := omit, |
| 1647 | eUTRANinterRATHandoverInformation := omit |
| 1648 | } |
| 1649 | } |
| 1650 | } |
| 1651 | } |
| 1652 | |
| 1653 | template (value) PDU_L3_MS_SGSN ts_GMM_PTMSI_REALL_COMPL := { |
| 1654 | discriminator := '0000'B, /* overwritten */ |
| 1655 | tiOrSkip := { |
| 1656 | skipIndicator := '0000'B |
| 1657 | }, |
| 1658 | msgs := { |
| 1659 | gprs_mm := { |
| 1660 | p_TMSIReallocationComplete := { |
| 1661 | messageType := '00000000'B /* overwritten */ |
| 1662 | } |
| 1663 | } |
| 1664 | } |
| 1665 | } |
| 1666 | |
| 1667 | template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_CIPH_COMPL(ACReferenceNumberV ref, OCT4 res) := { |
| 1668 | discriminator := '0000'B, /* overwritten */ |
| 1669 | tiOrSkip := { |
| 1670 | skipIndicator := '0000'B |
| 1671 | }, |
| 1672 | msgs := { |
| 1673 | gprs_mm := { |
| 1674 | authenticationAndCipheringResponse := { |
| 1675 | messageType := '00000000'B, /* overwritten */ |
| 1676 | acReferenceNumber := ref, |
| 1677 | spare := '0000'B, |
| 1678 | authenticationParResp := { |
| 1679 | elementIdentifier := '22'O, |
| 1680 | valueField := res |
| 1681 | }, |
| 1682 | imeisv := omit, |
| 1683 | authenticationRespParExt := omit |
| 1684 | } |
| 1685 | } |
| 1686 | } |
| 1687 | } |
| 1688 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 1689 | template PDU_L3_SGSN_MS tr_GMM_ID_REQ(template BIT3 id_type := ?) := { |
| 1690 | discriminator := '1000'B, |
| 1691 | tiOrSkip := { |
| 1692 | skipIndicator := '0000'B |
| 1693 | }, |
| 1694 | msgs := { |
| 1695 | gprs_mm := { |
| 1696 | identityRequest := { |
| 1697 | messageType := '00010101'B, |
| 1698 | identityType := { id_type, '0'B }, |
| 1699 | forceToStandby := ? |
| 1700 | } |
| 1701 | } |
| 1702 | } |
| 1703 | } |
| 1704 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1705 | template (value) PDU_L3_MS_SGSN ts_GMM_ID_RESP(MobileIdentityLV mi_lv) := { |
| 1706 | discriminator := '0000'B, /* overwritten */ |
| 1707 | tiOrSkip := { |
| 1708 | skipIndicator := '0000'B |
| 1709 | }, |
| 1710 | msgs := { |
| 1711 | gprs_mm := { |
| 1712 | identityResponse := { |
| 1713 | messageType := '00000000'B, /* overwritten */ |
| 1714 | mobileIdentity := mi_lv |
| 1715 | } |
| 1716 | } |
| 1717 | } |
| 1718 | } |
| 1719 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 1720 | template PDU_L3_SGSN_MS tr_GMM_AUTH_REQ(template OCT16 rand := ?, template BIT3 ciph_alg := ?) := { |
| 1721 | discriminator := '1000'B, |
| 1722 | tiOrSkip := { |
| 1723 | skipIndicator := '0000'B |
| 1724 | }, |
| 1725 | msgs := { |
| 1726 | gprs_mm := { |
| 1727 | authenticationAndCipheringRequest := { |
| 1728 | messageType := '00010010'B, |
| 1729 | cipheringAlgorithm := { ciph_alg, '0'B }, |
| 1730 | imeisvRequest := ?, |
| 1731 | forceToStandby := ?, |
| 1732 | acReferenceNumber := ?, |
| 1733 | authenticationParameterRAND := { |
| 1734 | elementIdentifier := '21'O, |
| 1735 | randValue := rand |
| 1736 | }, |
| 1737 | cipheringKeySequenceNumber := *, |
| 1738 | authenticationParameterAUTN := * |
| 1739 | } |
| 1740 | } |
| 1741 | } |
| 1742 | } |
| 1743 | |
| 1744 | template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_RESP_2G(BIT4 ac_ref, OCT4 sres) := { |
| 1745 | discriminator := '1000'B, |
| 1746 | tiOrSkip := { |
| 1747 | skipIndicator := '0000'B |
| 1748 | }, |
| 1749 | msgs := { |
| 1750 | gprs_mm := { |
| 1751 | authenticationAndCipheringResponse := { |
| 1752 | messageType := '00010011'B, |
| 1753 | acReferenceNumber := { valueField := ac_ref }, |
| 1754 | spare := '0000'B, |
| 1755 | authenticationParResp := { |
| 1756 | elementIdentifier := '22'O, |
| 1757 | valueField := sres |
| 1758 | }, |
| 1759 | imeisv := omit, |
| 1760 | authenticationRespParExt := omit |
| 1761 | } |
| 1762 | } |
| 1763 | } |
| 1764 | } |
| 1765 | |
| 1766 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1767 | const BIT3 c_GMM_DTT_MO_GPRS := '001'B; |
| 1768 | const BIT3 c_GMM_DTT_MO_IMSI := '010'B; |
| 1769 | const BIT3 c_GMM_DTT_MO_GPRS_IMSI_COMBINED := '011'B; |
| 1770 | |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 1771 | template (value) DetachTypeV ts_GMM_DetType(BIT3 dtt, boolean power_off := false) := { |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1772 | detachType := dtt, |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 1773 | powerOffFlag := bool2bit(power_off) |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1774 | } |
| 1775 | |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 1776 | function ts_PtmsiSigTV(template (omit) OCT3 val) return template (omit) P_TMSISignatureTV { |
| 1777 | var template (omit) P_TMSISignatureTV ret; |
| 1778 | if (istemplatekind(val, "omit")) { |
| 1779 | return omit; |
| 1780 | } else { |
| 1781 | ret := { |
| 1782 | elementIdentifier := '19'O, |
| 1783 | valueField := valueof(val) |
| 1784 | } |
| 1785 | return ret; |
| 1786 | } |
| 1787 | } |
| 1788 | |
| 1789 | function ts_PtmsiSigTLV(template (omit) OCT3 val) return template (omit) P_TMSISignature2TLV { |
| 1790 | var template (omit) P_TMSISignature2TLV ret; |
| 1791 | if (istemplatekind(val, "omit")) { |
| 1792 | return omit; |
| 1793 | } else { |
| 1794 | ret := { |
| 1795 | elementIdentifier := '19'O, |
| 1796 | lengthIndicator := 3, |
| 1797 | valueField := valueof(val) |
| 1798 | } |
| 1799 | return ret; |
| 1800 | } |
| 1801 | } |
| 1802 | |
| 1803 | template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS, |
| 1804 | boolean power_off := false, |
| 1805 | template (omit) OCT4 p_tmsi := omit, |
| 1806 | template (omit) OCT3 p_tmsi_sig := omit) := { |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1807 | discriminator := '0000'B, /* overwritten */ |
| 1808 | tiOrSkip := { |
| 1809 | skipIndicator := '0000'B |
| 1810 | }, |
| 1811 | msgs := { |
| 1812 | gprs_mm := { |
| 1813 | detachRequest_MS_SGSN := { |
| 1814 | messageType := '00000000'B, /* overwritten */ |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 1815 | detachType := valueof(ts_GMM_DetType(dtt, power_off)), |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1816 | spare := '0000'B, |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 1817 | ptmsi := ts_MI_TMSI_TLV(p_tmsi), |
| 1818 | ptmsiSignature := ts_PtmsiSigTLV(p_tmsi_sig) |
| 1819 | } |
| 1820 | } |
| 1821 | } |
| 1822 | } |
| 1823 | |
| 1824 | template PDU_L3_SGSN_MS tr_GMM_DET_ACCEPT_MT := { |
| 1825 | discriminator := '1000'B, |
| 1826 | tiOrSkip := { |
| 1827 | skipIndicator := '0000'B |
| 1828 | }, |
| 1829 | msgs := { |
| 1830 | gprs_mm := { |
| 1831 | detachAccept_SGSN_MS := { |
| 1832 | messageType := '00000110'B, |
| 1833 | forceToStandby := ?, |
| 1834 | spare := '0000'B |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1835 | } |
| 1836 | } |
| 1837 | } |
| 1838 | } |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1839 | |
Harald Welte | 835b15f | 2018-02-18 14:39:11 +0100 | [diff] [blame] | 1840 | template PDU_L3_SGSN_MS tr_GMM_DET_REQ_MT(template BIT3 dtt := ?, template boolean power_off := ?) := { |
| 1841 | discriminator := '1000'B, |
| 1842 | tiOrSkip := { |
| 1843 | skipIndicator := '0000'B |
| 1844 | }, |
| 1845 | msgs := { |
| 1846 | gprs_mm := { |
| 1847 | detachRequest_SGSN_MS := { |
| 1848 | messageType := '00000101'B, |
| 1849 | detachType := { dtt, bool2bit_tmpl(power_off) }, |
| 1850 | forceToStandby := ?, |
| 1851 | gmmCause := * |
| 1852 | } |
| 1853 | } |
| 1854 | } |
| 1855 | } |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1856 | |
| 1857 | function ts_ApnTLV(template (omit) octetstring apn) return template (omit) AccessPointNameTLV { |
| 1858 | if (istemplatekind(apn, "omit")) { |
| 1859 | return omit; |
| 1860 | } else { |
| 1861 | var template (omit) AccessPointNameTLV ret := { |
| 1862 | elementIdentifier := '28'O, |
| 1863 | lengthIndicator := 0, /* overwritten */ |
| 1864 | accessPointNameValue := apn |
| 1865 | } |
| 1866 | return ret; |
| 1867 | } |
| 1868 | } |
| 1869 | |
| 1870 | function ts_PcoTLV(template (omit) ProtocolConfigOptionsV pco) |
| 1871 | return template (omit) ProtocolConfigOptionsTLV { |
| 1872 | if (istemplatekind(pco, "omit")) { |
| 1873 | return omit; |
| 1874 | } else { |
| 1875 | var template (omit) ProtocolConfigOptionsTLV ret := { |
| 1876 | elementIdentifier := '27'O, |
| 1877 | lengthIndicator := 0, /* overwritten */ |
| 1878 | protocolConfigOptionsV := pco |
| 1879 | } |
| 1880 | return ret; |
| 1881 | } |
| 1882 | } |
| 1883 | |
| 1884 | template (value) PDU_L3_MS_SGSN ts_SM_ACT_PDP_REQ(BIT3 tid, BIT4 nsapi, BIT4 sapi, QoSV qos, |
| 1885 | PDPAddressV addr, |
| 1886 | template (omit) octetstring apn := omit, |
| 1887 | template (omit) ProtocolConfigOptionsV pco := omit |
| 1888 | ) := { |
| 1889 | discriminator := '0000'B, /* overwritten */ |
| 1890 | tiOrSkip := { |
| 1891 | transactionId := { |
| 1892 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1893 | tiFlag := c_TIF_ORIG, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1894 | tIExtension := omit |
| 1895 | } |
| 1896 | }, |
| 1897 | msgs := { |
| 1898 | gprs_sm := { |
| 1899 | activatePDPContextRequest := { |
| 1900 | messageType := '00000000'B, /* overwritten */ |
| 1901 | requestedNSAPI := { nsapi, '0000'B }, |
| 1902 | requestedLLCSAPI := { sapi, '0000'B }, |
| 1903 | requestedQoS := { |
| 1904 | lengthIndicator := 0, /* overwritten */ |
| 1905 | qoSV := qos |
| 1906 | }, |
| 1907 | requestedPDPaddress := { |
| 1908 | lengthIndicator := 0, /* overwritten */ |
| 1909 | pdpAddressV := addr |
| 1910 | }, |
| 1911 | accessPointName := ts_ApnTLV(apn), |
| 1912 | protocolConfigOpts := ts_PcoTLV(pco), |
| 1913 | requestType := omit, |
| 1914 | deviceProperties := omit, |
| 1915 | nBIFOM_Container := omit |
| 1916 | } |
| 1917 | } |
| 1918 | } |
| 1919 | } |
| 1920 | |
| 1921 | template PDU_L3_SGSN_MS tr_SM_ACT_PDP_REJ(template BIT3 tid := ?, template OCT1 cause := ?) := { |
| 1922 | discriminator := '1010'B, |
| 1923 | tiOrSkip := { |
| 1924 | transactionId := { |
| 1925 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1926 | tiFlag := c_TIF_REPL, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1927 | tIExtension := omit |
| 1928 | } |
| 1929 | }, |
| 1930 | msgs := { |
| 1931 | gprs_sm := { |
| 1932 | activatePDPContextReject := { |
Harald Welte | 4aacdd8 | 2018-02-18 21:24:05 +0100 | [diff] [blame] | 1933 | messageType := '01000011'B, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1934 | smCause := cause, |
| 1935 | protocolConfigOpts := *, |
| 1936 | backOffTimer := *, |
| 1937 | reAttemptIndicator := *, |
| 1938 | nBIFOM_Container := * |
| 1939 | } |
| 1940 | } |
| 1941 | } |
| 1942 | } |
| 1943 | |
| 1944 | template PDU_L3_SGSN_MS tr_SM_ACT_PDP_ACCEPT(template BIT3 tid := ?, template BIT4 sapi := ?, |
| 1945 | template QoSV qos := ?) |
| 1946 | := { |
| 1947 | discriminator := '1010'B, |
| 1948 | tiOrSkip := { |
| 1949 | transactionId := { |
| 1950 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1951 | tiFlag := c_TIF_REPL, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1952 | tIExtension := omit |
| 1953 | } |
| 1954 | }, |
| 1955 | msgs := { |
| 1956 | gprs_sm := { |
| 1957 | activatePDPContextAccept := { |
| 1958 | messageType := '01000010'B, |
| 1959 | negotiatedLLCSAPI := { sapi, '0000'B }, |
| 1960 | negotiatedQoS := { |
| 1961 | lengthIndicator := ?, |
| 1962 | qoSV := qos |
| 1963 | }, |
| 1964 | radioPriority := ?, |
| 1965 | spare := '0000'B, |
| 1966 | pdpAddress := *, |
| 1967 | protocolConfigOpts := *, |
| 1968 | packetFlowID := *, |
| 1969 | sMCause2 := *, |
| 1970 | connectivityType := *, |
| 1971 | wLANOffloadIndication := *, |
| 1972 | nBIFOM_Container := * |
| 1973 | } |
| 1974 | } |
| 1975 | } |
| 1976 | } |
| 1977 | |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 1978 | template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, boolean tdown := false, |
| 1979 | template (omit) ProtocolConfigOptionsV pco := omit |
| 1980 | ) := { |
| 1981 | discriminator := '0000'B, /* overwritten */ |
| 1982 | tiOrSkip := { |
| 1983 | transactionId := { |
| 1984 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1985 | tiFlag := c_TIF_ORIG, |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 1986 | tIExtension := omit |
| 1987 | } |
| 1988 | }, |
| 1989 | msgs := { |
| 1990 | gprs_sm := { |
| 1991 | deactivatePDPContextRequest := { |
| 1992 | messageType := '00000000'B, /* overwritten */ |
| 1993 | smCause := cause, |
| 1994 | tearDownIndicator := { |
| 1995 | tearDownIndicatorV := { |
| 1996 | tdi_flag := bool2bit(tdown), |
| 1997 | spare := '000'B |
| 1998 | }, |
| 1999 | elementIdentifier := '1001'B |
| 2000 | }, |
| 2001 | protocolConfigOpts := ts_PcoTLV(pco), |
| 2002 | mBMSprotocolConfigOptions := omit, |
| 2003 | t3396 := omit, |
| 2004 | wLANOffloadIndication := omit, |
| 2005 | nBIFOM_Container := omit |
| 2006 | } |
| 2007 | } |
| 2008 | } |
| 2009 | } |
| 2010 | |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2011 | template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, boolean tdown := false, |
| 2012 | template (omit) ProtocolConfigOptionsV pco := omit |
| 2013 | ) := { |
| 2014 | discriminator := '0000'B, /* overwritten */ |
| 2015 | tiOrSkip := { |
| 2016 | transactionId := { |
| 2017 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2018 | tiFlag := c_TIF_REPL, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2019 | tIExtension := omit |
| 2020 | } |
| 2021 | }, |
| 2022 | msgs := { |
| 2023 | gprs_sm := { |
| 2024 | deactivatePDPContextRequest := { |
| 2025 | messageType := '00000000'B, /* overwritten */ |
| 2026 | smCause := cause, |
| 2027 | tearDownIndicator := { |
| 2028 | tearDownIndicatorV := { |
| 2029 | tdi_flag := bool2bit(tdown), |
| 2030 | spare := '000'B |
| 2031 | }, |
| 2032 | elementIdentifier := '1001'B |
| 2033 | }, |
| 2034 | protocolConfigOpts := ts_PcoTLV(pco), |
| 2035 | mBMSprotocolConfigOptions := omit, |
| 2036 | t3396 := omit, |
| 2037 | wLANOffloadIndication := omit, |
| 2038 | nBIFOM_Container := omit |
| 2039 | } |
| 2040 | } |
| 2041 | } |
| 2042 | } |
| 2043 | |
| 2044 | template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause, |
| 2045 | template boolean tdown := false, |
| 2046 | template (omit) ProtocolConfigOptionsV pco := omit |
| 2047 | ) := { |
| 2048 | discriminator := '0000'B, /* overwritten */ |
| 2049 | tiOrSkip := { |
| 2050 | transactionId := { |
| 2051 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2052 | tiFlag := c_TIF_REPL, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2053 | tIExtension := omit |
| 2054 | } |
| 2055 | }, |
| 2056 | msgs := { |
| 2057 | gprs_sm := { |
| 2058 | deactivatePDPContextRequest := { |
| 2059 | messageType := '00000000'B, /* overwritten */ |
| 2060 | smCause := cause, |
| 2061 | tearDownIndicator := { |
| 2062 | tearDownIndicatorV := { |
| 2063 | tdi_flag := bool2bit_tmpl(tdown), |
| 2064 | spare := '000'B |
| 2065 | }, |
| 2066 | elementIdentifier := '1001'B |
| 2067 | }, |
| 2068 | protocolConfigOpts := *, |
| 2069 | mBMSprotocolConfigOptions := *, |
| 2070 | t3396 := *, |
| 2071 | wLANOffloadIndication := *, |
| 2072 | nBIFOM_Container := * |
| 2073 | } |
| 2074 | } |
| 2075 | } |
| 2076 | } |
| 2077 | |
| 2078 | |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2079 | template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?) |
| 2080 | := { |
| 2081 | discriminator := '1010'B, |
| 2082 | tiOrSkip := { |
| 2083 | transactionId := { |
| 2084 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2085 | tiFlag := c_TIF_REPL, |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2086 | tIExtension := omit |
| 2087 | } |
| 2088 | }, |
| 2089 | msgs := { |
| 2090 | gprs_sm := { |
| 2091 | deactivatePDPContextAccept := { |
| 2092 | messageType := '01000111'B, |
| 2093 | protocolConfigOpts := *, |
| 2094 | mBMSprotocolConfigOptions := *, |
| 2095 | nBIFOM_Container := * |
| 2096 | } |
| 2097 | } |
| 2098 | } |
| 2099 | } |
| 2100 | |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2101 | template PDU_L3_MS_SGSN tr_SM_DEACT_PDP_ACCEPT_MO(template BIT3 tid := ?) |
| 2102 | := { |
| 2103 | discriminator := '1010'B, |
| 2104 | tiOrSkip := { |
| 2105 | transactionId := { |
| 2106 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2107 | tiFlag := c_TIF_ORIG, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2108 | tIExtension := omit |
| 2109 | } |
| 2110 | }, |
| 2111 | msgs := { |
| 2112 | gprs_sm := { |
| 2113 | deactivatePDPContextAccept := { |
| 2114 | messageType := '01000111'B, |
| 2115 | protocolConfigOpts := *, |
| 2116 | mBMSprotocolConfigOptions := *, |
| 2117 | nBIFOM_Container := * |
| 2118 | } |
| 2119 | } |
| 2120 | } |
| 2121 | } |
| 2122 | |
| 2123 | template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_ACCEPT_MO(BIT3 tid) |
| 2124 | := { |
| 2125 | discriminator := '1010'B, |
| 2126 | tiOrSkip := { |
| 2127 | transactionId := { |
| 2128 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2129 | tiFlag := c_TIF_ORIG, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2130 | tIExtension := omit |
| 2131 | } |
| 2132 | }, |
| 2133 | msgs := { |
| 2134 | gprs_sm := { |
| 2135 | deactivatePDPContextAccept := { |
| 2136 | messageType := '01000111'B, |
| 2137 | protocolConfigOpts := omit, |
| 2138 | mBMSprotocolConfigOptions := omit, |
| 2139 | nBIFOM_Container := omit |
| 2140 | } |
| 2141 | } |
| 2142 | } |
| 2143 | } |
| 2144 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2145 | |
| 2146 | |
Harald Welte | e5695f5 | 2018-02-16 14:46:15 +0100 | [diff] [blame] | 2147 | private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { |
| 2148 | var integer suffix_len := tot_len - lengthof(prefix); |
| 2149 | var charstring suffix_ch := int2str(suffix); |
| 2150 | var integer pad_len := suffix_len - lengthof(suffix_ch); |
| 2151 | |
| 2152 | return prefix & int2hex(0, pad_len) & str2hex(suffix_ch); |
| 2153 | } |
| 2154 | |
| 2155 | function f_gen_imei(integer suffix) return hexstring { |
| 2156 | return f_concat_pad(15, '49999'H, suffix); |
| 2157 | } |
| 2158 | |
| 2159 | function f_gen_imsi(integer suffix) return hexstring { |
| 2160 | return f_concat_pad(15, '26242'H, suffix); |
| 2161 | } |
| 2162 | |
| 2163 | function f_gen_msisdn(integer suffix) return hexstring { |
| 2164 | return f_concat_pad(12, '49123'H, suffix); |
| 2165 | } |
| 2166 | |
Harald Welte | 7484fc4 | 2018-02-24 14:09:45 +0100 | [diff] [blame] | 2167 | external function enc_MobileIdentityLV(in MobileIdentityLV si) return octetstring |
| 2168 | with { extension "prototype(convert) encode(RAW)" }; |
Harald Welte | e5695f5 | 2018-02-16 14:46:15 +0100 | [diff] [blame] | 2169 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 2170 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 2171 | } |