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 | * |
Harald Welte | f45efeb | 2018-04-09 18:19:24 +0200 | [diff] [blame] | 5 | * (C) 2017-2018 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 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 | f45efeb | 2018-04-09 18:19:24 +0200 | [diff] [blame] | 20 | import from MobileL3_SMS_Types all; |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 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 | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 391 | template (value) PDU_ML3_NW_MS ts_RRM_CiphModeCmd(BIT3 alg_id) := { |
| 392 | discriminator := '0000'B, /* overwritten */ |
| 393 | tiOrSkip := { |
| 394 | skipIndicator := '0000'B |
| 395 | }, |
| 396 | msgs := { |
| 397 | rrm := { |
| 398 | cipheringModeCommand := { |
| 399 | messageType := '00110101'B, |
| 400 | cipherModeSetting := { |
| 401 | sC := '1'B, |
| 402 | algorithmIdentifier := alg_id |
| 403 | }, |
| 404 | cipherModeResponse := { |
| 405 | cR := '0'B, |
| 406 | spare := '000'B |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 413 | template (value) PDU_ML3_MS_NW ts_RRM_CiphModeCompl := { |
| 414 | discriminator := '0000'B, /* overwritten */ |
| 415 | tiOrSkip := { |
| 416 | skipIndicator := '0000'B |
| 417 | }, |
| 418 | msgs := { |
| 419 | rrm := { |
| 420 | cipheringModeComplete := { |
| 421 | messageType := '00110010'B, |
| 422 | mobileEquipmentIdentity := omit |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | } |
| 427 | |
Harald Welte | ecb254b | 2018-01-29 22:01:54 +0100 | [diff] [blame] | 428 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentComplete(OCT1 cause) := { |
| 429 | discriminator := '0000'B, /* overwritten */ |
| 430 | tiOrSkip := { |
| 431 | skipIndicator := '0000'B |
| 432 | }, |
| 433 | msgs := { |
| 434 | rrm := { |
| 435 | assignmentComplete := { |
| 436 | messageType := '00101001'B, |
| 437 | rR_Cause := { |
| 438 | valuePart := cause |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | } |
| 443 | } |
Harald Welte | 1516614 | 2017-12-16 23:02:08 +0100 | [diff] [blame] | 444 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 445 | template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := { |
| 446 | discriminator := '0000'B, /* overwritten */ |
| 447 | tiOrSkip := { |
| 448 | skipIndicator := '0000'B |
| 449 | }, |
| 450 | msgs := { |
| 451 | rrm := { |
| 452 | assignmentFailure := { |
| 453 | messageType := '00101111'B, |
| 454 | rR_Cause := { |
| 455 | valuePart := cause |
| 456 | } |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | } |
| 461 | |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 462 | template (value) PDU_ML3_MS_NW ts_RRM_HandoverFailure(OCT1 cause) := { |
| 463 | discriminator := '0000'B, /* overwritten */ |
| 464 | tiOrSkip := { |
| 465 | skipIndicator := '0000'B |
| 466 | }, |
| 467 | msgs := { |
| 468 | rrm := { |
| 469 | handoverFailure := { |
| 470 | messageType := '00101000'B, |
| 471 | rRCause := { |
| 472 | valuePart := cause |
| 473 | }, |
| 474 | pSCause := omit |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 479 | |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 480 | template (value) PDU_ML3_MS_NW ts_RRM_HandoverComplete(OCT1 cause) := { |
| 481 | discriminator := '0000'B, /* overwritten */ |
| 482 | tiOrSkip := { |
| 483 | skipIndicator := '0000'B |
| 484 | }, |
| 485 | msgs := { |
| 486 | rrm := { |
| 487 | handoverComplete := { |
| 488 | messageType := '00101100'B, |
| 489 | rRCause := { |
| 490 | valuePart := cause |
| 491 | }, |
| 492 | mobileObsservedTimeDiff := omit, |
| 493 | mobileTimeDifferenceHyperframe := omit |
| 494 | } |
| 495 | } |
| 496 | } |
| 497 | } |
| 498 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 499 | function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { |
| 500 | if (not isvalue(cm3)) { |
| 501 | return omit; |
| 502 | } |
| 503 | var template MobileStationClassmark3_TLV ret := { |
| 504 | elementIdentifier := '20'O, |
| 505 | lengthIndicator := 0, /* overwritten */ |
| 506 | valuePart := cm3 |
| 507 | } |
| 508 | return ret; |
| 509 | } |
| 510 | |
| 511 | template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2, |
| 512 | template (omit) MobileStationClassmark3_TLV cm3 := omit) := { |
| 513 | discriminator := '0110'B, |
| 514 | tiOrSkip := { |
| 515 | skipIndicator := '0000'B |
| 516 | }, |
| 517 | msgs := { |
| 518 | rrm := { |
| 519 | classmarkChange := { |
| 520 | messageType := '00010110'B, |
| 521 | mobileStationClassmark2 := cm2, |
| 522 | mobileStationClassmark3 := cm3 |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 528 | template (value) PDU_ML3_MS_NW ts_RRM_UL_REL(OCT1 cause) := { |
| 529 | discriminator := '0110'B, |
| 530 | tiOrSkip := { |
| 531 | skipIndicator := '0000'B |
| 532 | }, |
| 533 | msgs := { |
| 534 | rrm := { |
| 535 | uplinkRelease := { |
| 536 | messageType := '00001110'B, |
| 537 | rR_Cause := { |
| 538 | valuePart := cause |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | template PDU_ML3_MS_NW tr_RRM_RR_STATUS(template OCT1 cause := ?) := { |
| 546 | discriminator := '0110'B, |
| 547 | tiOrSkip := { |
| 548 | skipIndicator := '0000'B |
| 549 | }, |
| 550 | msgs := { |
| 551 | rrm := { |
| 552 | rR_Status := { |
| 553 | messageType := '00010010'B, |
| 554 | rR_Cause := { |
| 555 | valuePart := cause |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | |
| 563 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 564 | template PDU_ML3_MS_NW ts_ML3_MO := { |
| 565 | discriminator := '0000'B, |
| 566 | tiOrSkip := { |
| 567 | skipIndicator := '0000'B |
| 568 | }, |
| 569 | msgs := ? |
| 570 | } |
| 571 | |
| 572 | template LocationUpdatingType ts_ML3_IE_LuType := { |
| 573 | lut := ?, |
| 574 | spare1_1 := '0'B, |
| 575 | fop := '0'B |
| 576 | } |
| 577 | |
| 578 | template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := { |
| 579 | lut := '00'B |
| 580 | } |
| 581 | |
| 582 | template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := { |
| 583 | lut := '01'B |
| 584 | } |
| 585 | |
| 586 | template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := { |
| 587 | lut := '10'B |
| 588 | } |
| 589 | |
| 590 | template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := { |
| 591 | keySequence := int2bit(cksn, 3), |
| 592 | spare := '0'B |
| 593 | } |
| 594 | |
| 595 | template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai, |
| 596 | MobileIdentityLV mi, MobileStationClassmark1_V cm1) |
| 597 | modifies ts_ML3_MO := { |
| 598 | msgs := { |
| 599 | mm := { |
| 600 | locationUpdateRequest := { |
| 601 | messageType := '001000'B, |
| 602 | nsd := '00'B, /* ? */ |
| 603 | locationUpdatingType := lu_type, |
| 604 | cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0), |
| 605 | locationAreaIdentification := lai, |
| 606 | mobileStationClassmark1 := cm1, |
| 607 | mobileIdentityLV := mi, |
| 608 | classmarkInformationType2_forUMTS := omit, |
| 609 | additionalUpdateParameterTV := omit, |
| 610 | deviceProperties := omit, |
| 611 | mS_NetworkFeatureSupport := omit |
| 612 | } |
| 613 | } |
| 614 | } |
| 615 | } |
| 616 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 617 | template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := { |
| 618 | msgs := { |
| 619 | mm := { |
| 620 | tmsiReallocComplete := { |
| 621 | messageType := '011011'B, |
| 622 | nsd := '00'B |
| 623 | } |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := { |
| 629 | discriminator := '0101'B, |
| 630 | tiOrSkip := { |
| 631 | skipIndicator := '0000'B |
| 632 | }, |
| 633 | msgs := { |
| 634 | mm := { |
| 635 | locationUpdateAccept := { |
| 636 | messageType := '000010'B, |
| 637 | nsd := '00'B, |
| 638 | locationAreaIdentification := ?, |
| 639 | mobileIdentityTLV := *, |
| 640 | followOnProceed := *, |
| 641 | cTS_Permission := *, |
| 642 | equivalentPLMNs := *, |
| 643 | emergencyNumberList := *, |
| 644 | perMS_T3212 := * |
| 645 | } |
| 646 | } |
| 647 | } |
| 648 | } |
| 649 | |
| 650 | template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := { |
| 651 | discriminator := '0101'B, |
| 652 | tiOrSkip := { |
| 653 | skipIndicator := '0000'B |
| 654 | }, |
| 655 | msgs := { |
| 656 | mm := { |
| 657 | locationUpdateReject := { |
| 658 | messageType := '000100'B, |
| 659 | nsd := '00'B, |
| 660 | rejectCause := cause, |
| 661 | t3246_Value := * |
| 662 | } |
| 663 | } |
| 664 | } |
| 665 | } |
| 666 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 667 | template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template BIT3 id_type := ?) := { |
| 668 | discriminator := '0101'B, |
| 669 | tiOrSkip := { |
| 670 | skipIndicator := '0000'B |
| 671 | }, |
| 672 | msgs := { |
| 673 | mm := { |
| 674 | identityRequest := { |
| 675 | messageType := '011000'B, |
| 676 | nsd := '00'B, |
| 677 | identityType := id_type, |
| 678 | spare1_5 := ? |
| 679 | } |
| 680 | } |
| 681 | } |
| 682 | } |
| 683 | |
| 684 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp(MobileIdentityLV mi) modifies ts_ML3_MO := { |
| 685 | msgs := { |
| 686 | mm := { |
| 687 | identityResponse := { |
| 688 | messageType := '011001'B, |
| 689 | nsd := '00'B, |
| 690 | mobileIdentityLV := mi, |
| 691 | p_TMSI_TypeTV := omit, |
| 692 | routingAreaIdentification2TLV := omit, |
| 693 | p_TMSISignature2TLV := omit |
| 694 | } |
| 695 | } |
| 696 | } |
| 697 | } |
| 698 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMSI(hexstring imsi) := |
| 699 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMSI_LV(imsi))); |
| 700 | template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMEI(hexstring imei) := |
| 701 | ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); |
| 702 | |
| 703 | |
Neels Hofmeyr | 6338247 | 2018-03-01 19:57:44 +0100 | [diff] [blame] | 704 | 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] | 705 | rf_PowerCapability := '010'B, |
| 706 | a5_1 := a5_1_unavail, |
Neels Hofmeyr | 6338247 | 2018-03-01 19:57:44 +0100 | [diff] [blame] | 707 | esind := esind, |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 708 | revisionLevel := rev, |
| 709 | spare1_1 := '0'B |
| 710 | } |
| 711 | |
| 712 | template PDU_ML3_MS_NW ts_ML3_MO_MM_IMSI_DET_Ind(MobileIdentityLV mi, |
| 713 | template MobileStationClassmark1_V cm1 := ts_CM1) |
| 714 | modifies ts_ML3_MO := { |
| 715 | msgs := { |
| 716 | mm := { |
| 717 | imsiDetachIndication := { |
| 718 | messageType := '000001'B, |
| 719 | nsd := '00'B, |
| 720 | mobileStationClassmark1 := cm1, |
| 721 | mobileIdentityLV := mi |
| 722 | } |
| 723 | } |
| 724 | } |
| 725 | } |
| 726 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 727 | template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { |
| 728 | discriminator := '0011'B, |
| 729 | tiOrSkip := { |
| 730 | transactionId := { |
Daniel Willmann | dcf9eb9 | 2018-02-02 20:07:52 +0100 | [diff] [blame] | 731 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 732 | tiFlag := c_TIF_ORIG, |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 733 | tIExtension := omit |
| 734 | } |
| 735 | } |
| 736 | } |
| 737 | |
| 738 | template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := { |
| 739 | elementIdentifier := '5E'O, |
| 740 | lengthIndicator := 0, /* overwritten */ |
| 741 | numberingPlanIdentification := '0000'B, |
| 742 | typeOfNumber := '000'B, /* unknown */ |
| 743 | ext1 := '0'B, |
| 744 | digits := digits |
| 745 | } |
| 746 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 747 | template CalledPartyBCD_Number tr_Called(template hexstring digits) := { |
| 748 | elementIdentifier := '5E'O, |
| 749 | lengthIndicator := ?, |
| 750 | numberingPlanIdentification := ?, |
| 751 | typeOfNumber := ?, |
| 752 | ext1 := ?, |
| 753 | digits := digits |
| 754 | } |
| 755 | |
| 756 | template CallingPartyBCD_Number tr_Calling(template hexstring digits) := { |
| 757 | elementIdentifier := '5C'O, |
| 758 | lengthIndicator := ?, |
| 759 | oct3 := ?, |
| 760 | digits := digits |
| 761 | } |
| 762 | |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 763 | type integer SpeechVer; |
| 764 | |
| 765 | template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { |
| 766 | speechVersionIndication := int2bit(ver-1,3) & suffix, |
| 767 | spare1_1 := '0'B, |
| 768 | cTM_or_Spare := '0'B, |
| 769 | coding := '0'B, |
| 770 | extension_octet_3a_3b := '0'B |
| 771 | } |
| 772 | |
| 773 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B); |
| 774 | template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B); |
| 775 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 776 | template (value) BearerCapability_TLV ts_Bcap_voice := { |
| 777 | elementIdentifier := '04'O, |
| 778 | lengthIndicator := 0, /* overwritten */ |
| 779 | octet3 := { |
| 780 | informationTransferCapability := '000'B, |
| 781 | transferMode := '0'B, |
| 782 | codingStandard := '0'B, |
| 783 | radioChannelRequirement := '11'B, /* FR preferred */ |
| 784 | extension_octet_3 := '0'B, /* overwritten */ |
Harald Welte | 4b2b3a6 | 2018-01-26 10:32:39 +0100 | [diff] [blame] | 785 | speech_aux_3a_3b := { |
| 786 | valueof(ts_SpeechAuxHR(3)), |
| 787 | valueof(ts_SpeechAuxFR(3)), |
| 788 | valueof(ts_SpeechAuxFR(2)), |
| 789 | valueof(ts_SpeechAuxFR(1)), |
| 790 | valueof(ts_SpeechAuxHR(1)) |
| 791 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 792 | }, |
| 793 | octet4 := omit, |
| 794 | octet5 := omit, |
| 795 | octet6 := omit, |
| 796 | octet7 := omit |
| 797 | } |
| 798 | |
| 799 | template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 800 | discriminator := '0011'B, |
| 801 | tiOrSkip := { |
| 802 | transactionId := { |
| 803 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 804 | tiFlag := c_TIF_ORIG, |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 805 | tIExtension := omit |
| 806 | } |
| 807 | }, |
| 808 | msgs := { |
| 809 | cc := { |
| 810 | setup_MS_NW := { |
| 811 | messageType := '000101'B, |
| 812 | nsd := '00'B, |
| 813 | bcRepeatIndicator := omit, |
| 814 | bearerCapability1 := bcap, |
| 815 | bearerCapability2 := omit, |
| 816 | facility := omit, |
| 817 | callingPartySubAddress := omit, |
| 818 | calledPartyBCD_Number := ts_Called(called), |
| 819 | calledPartySubAddress := omit, |
| 820 | llc_RepeatIndicator := omit, |
| 821 | lowLayerCompatibility1 := omit, |
| 822 | lowLayerCompatibility2 := omit, |
| 823 | hlc_RepeatIndicator := omit, |
| 824 | highLayerCompatibility1 := omit, |
| 825 | highLayerCompatibility2 := omit, |
| 826 | user_user := omit, |
| 827 | ss_VersionIndicator := omit, |
| 828 | clir_Suppression := omit, |
| 829 | clir_Invocation := omit, |
| 830 | cC_Capabilities := omit, |
| 831 | facility_ccbs1 := omit, |
| 832 | facility_ccbs2 := omit, |
| 833 | streamIdentifier := omit, |
| 834 | supportedCodecs := omit, |
| 835 | redial := omit |
| 836 | } |
| 837 | } |
| 838 | } |
| 839 | } |
| 840 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 841 | template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := { |
| 842 | discriminator := '0011'B, |
| 843 | tiOrSkip := { |
| 844 | transactionId := { |
| 845 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 846 | tiFlag := c_TIF_ORIG, |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 847 | tIExtension := omit |
| 848 | } |
| 849 | }, |
| 850 | msgs := { |
| 851 | cc := { |
| 852 | emergencySetup := { |
| 853 | messageType := '001110'B, |
| 854 | nsd := '00'B, |
| 855 | bearerCapability := bcap, |
| 856 | streamIdentifier := omit, |
| 857 | supportedCodecs := omit, |
| 858 | emergencyCategory := omit |
| 859 | } |
| 860 | } |
| 861 | } |
| 862 | } |
| 863 | |
| 864 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 865 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { |
| 866 | discriminator := '0011'B, |
| 867 | tiOrSkip := { |
| 868 | transactionId := { |
| 869 | tio := int2bit(tid, 3), |
| 870 | tiFlag := ?, |
| 871 | tIExtension := omit |
| 872 | } |
| 873 | }, |
| 874 | msgs := { |
| 875 | cc := { |
| 876 | callProceeding := { |
| 877 | messageType := '000010'B, |
| 878 | nsd := '00'B, |
| 879 | repeatIndicator := *, |
| 880 | bearerCapability1 := *, |
| 881 | bearerCapability2 := *, |
| 882 | facility := *, |
| 883 | progressIndicator := *, |
| 884 | priorityGranted := *, |
| 885 | networkCCCapabilities := * |
| 886 | } |
| 887 | } |
| 888 | } |
| 889 | } |
| 890 | |
| 891 | template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := { |
| 892 | discriminator := '0011'B, |
| 893 | tiOrSkip := { |
| 894 | transactionId := { |
| 895 | tio := int2bit(tid, 3), |
| 896 | tiFlag := ?, |
| 897 | tIExtension := omit |
| 898 | } |
| 899 | }, |
| 900 | msgs := { |
| 901 | cc := { |
| 902 | alerting_NW_MS := { |
| 903 | messageType := '000001'B, |
| 904 | nsd := '00'B, |
| 905 | facility := *, |
| 906 | progressIndicator := *, |
| 907 | user_user := * |
| 908 | } |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 913 | template PDU_ML3_MS_NW ts_ML3_MO_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_MT_CC_ALERTING(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 | alerting_MS_NW := { |
| 947 | messageType := '000001'B, |
| 948 | nsd := '00'B, |
| 949 | facility := omit, |
| 950 | user_user := omit, |
| 951 | ss_VersionIndicator := omit |
| 952 | } |
| 953 | } |
| 954 | } |
| 955 | } |
| 956 | |
| 957 | template PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT(integer tid) := { |
| 958 | discriminator := '0011'B, |
| 959 | tiOrSkip := { |
| 960 | transactionId := { |
| 961 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 962 | tiFlag := c_TIF_REPL, |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 963 | tIExtension := omit |
| 964 | } |
| 965 | }, |
| 966 | msgs := { |
| 967 | cc := { |
| 968 | connect_MS_NW := { |
| 969 | messageType := '000111'B, |
| 970 | nsd := '00'B, |
| 971 | facility := omit, |
| 972 | connectedSubAddress := omit, |
| 973 | user_user := omit, |
| 974 | ss_VersionIndicator := omit, |
| 975 | streamIdentifier := omit |
| 976 | } |
| 977 | } |
| 978 | } |
| 979 | } |
| 980 | |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 981 | template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := { |
| 982 | discriminator := '0011'B, |
| 983 | tiOrSkip := { |
| 984 | transactionId := { |
| 985 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 986 | tiFlag := c_TIF_REPL, |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 987 | tIExtension := omit |
| 988 | } |
| 989 | }, |
| 990 | msgs := { |
| 991 | cc := { |
| 992 | connect_NW_MS := { |
| 993 | messageType := '000111'B, |
| 994 | nsd := '00'B, |
| 995 | facility := *, |
| 996 | progressIndicator := *, |
| 997 | connectedNumber := *, |
| 998 | connectedSubAddress := *, |
| 999 | user_user := * |
| 1000 | } |
| 1001 | } |
| 1002 | } |
| 1003 | } |
| 1004 | |
| 1005 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := { |
| 1006 | discriminator := '0011'B, |
| 1007 | tiOrSkip := { |
| 1008 | transactionId := { |
| 1009 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1010 | tiFlag := c_TIF_ORIG, |
Harald Welte | 4017d55 | 2018-01-26 21:40:05 +0100 | [diff] [blame] | 1011 | tIExtension := omit |
| 1012 | } |
| 1013 | }, |
| 1014 | msgs := { |
| 1015 | cc := { |
| 1016 | connectAck := { |
| 1017 | messageType := '001111'B, |
| 1018 | nsd := '00'B |
| 1019 | } |
| 1020 | } |
| 1021 | } |
| 1022 | } |
| 1023 | |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1024 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_START_DTMF(integer tid, charstring number) := { |
| 1025 | discriminator := '0011'B, |
| 1026 | tiOrSkip := { |
| 1027 | transactionId := { |
| 1028 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1029 | tiFlag := c_TIF_ORIG, |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1030 | tIExtension := omit |
| 1031 | } |
| 1032 | }, |
| 1033 | msgs := { |
| 1034 | cc := { |
| 1035 | startDTMF := { |
| 1036 | messageType := '110101'B, |
| 1037 | nsd := '00'B, |
| 1038 | keypadFacility := { |
| 1039 | elementIdentifier := '2C'O, |
| 1040 | keypadInformation := int2bit(char2int(number), 7), |
| 1041 | spare_1 := '0'B |
| 1042 | } |
| 1043 | } |
| 1044 | } |
| 1045 | } |
| 1046 | } |
| 1047 | |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 1048 | template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { |
| 1049 | discriminator := '0011'B, |
| 1050 | tiOrSkip := { |
| 1051 | transactionId := { |
| 1052 | tio := int2bit(tid, 3), |
| 1053 | tiFlag := ?, |
| 1054 | tIExtension := omit |
| 1055 | } |
| 1056 | }, |
| 1057 | msgs := { |
| 1058 | cc := { |
| 1059 | disconnect_NW_MS := { |
| 1060 | messageType := '100101'B, |
| 1061 | nsd := '00'B, |
| 1062 | cause := ?, |
| 1063 | facility := *, |
| 1064 | progressIndicator := *, |
| 1065 | user_user := *, |
| 1066 | allowedActions := * |
| 1067 | } |
| 1068 | } |
| 1069 | } |
| 1070 | } |
| 1071 | |
| 1072 | template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := { |
| 1073 | discriminator := '0011'B, |
| 1074 | tiOrSkip := { |
| 1075 | transactionId := { |
| 1076 | tio := int2bit(tid, 3), |
| 1077 | tiFlag := ?, |
| 1078 | tIExtension := omit |
| 1079 | } |
| 1080 | }, |
| 1081 | msgs := { |
| 1082 | cc := { |
| 1083 | release_NW_MS := { |
| 1084 | messageType := '101101'B, |
| 1085 | nsd := '00'B, |
| 1086 | cause := ?, |
| 1087 | secondCause := *, |
| 1088 | facility := *, |
| 1089 | user_user := * |
| 1090 | } |
| 1091 | } |
| 1092 | } |
| 1093 | } |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 1094 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1095 | template PDU_ML3_MS_NW ts_ML3_MO_CC_RELEASE(integer tid, BIT1 tid_remote, BIT7 cause) := { |
| 1096 | discriminator := '0011'B, |
| 1097 | tiOrSkip := { |
| 1098 | transactionId := { |
| 1099 | tio := int2bit(tid, 3), |
| 1100 | tiFlag := tid_remote, |
| 1101 | tIExtension := omit |
| 1102 | } |
| 1103 | }, |
| 1104 | msgs := { |
| 1105 | cc := { |
| 1106 | release_MS_NW := { |
| 1107 | messageType := '101101'B, |
| 1108 | nsd := '00'B, |
| 1109 | cause := ts_ML3_Cause(cause), |
| 1110 | secondCause := omit, |
| 1111 | facility := omit, |
| 1112 | user_user := omit, |
| 1113 | ss_VersionIndicator := omit |
| 1114 | } |
| 1115 | } |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 1120 | template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := { |
| 1121 | discriminator := '0011'B, |
| 1122 | tiOrSkip := { |
| 1123 | transactionId := { |
| 1124 | tio := int2bit(tid, 3), |
| 1125 | tiFlag := '0'B, |
| 1126 | tIExtension := omit |
| 1127 | } |
| 1128 | }, |
| 1129 | msgs := { |
| 1130 | cc := { |
| 1131 | releaseComplete_MS_NW := { |
| 1132 | messageType := '101010'B, |
| 1133 | nsd := '00'B, |
| 1134 | cause := omit, |
| 1135 | facility := omit, |
| 1136 | user_user := omit, |
| 1137 | ss_VersionIndicator := omit |
| 1138 | } |
| 1139 | } |
| 1140 | } |
| 1141 | } |
| 1142 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1143 | template PDU_ML3_NW_MS tr_ML3_MT_CC_REL_COMPL(integer tid) := { |
| 1144 | discriminator := '0011'B, |
| 1145 | tiOrSkip := { |
| 1146 | transactionId := { |
| 1147 | tio := int2bit(tid, 3), |
| 1148 | tiFlag := ?, |
| 1149 | tIExtension := omit |
| 1150 | } |
| 1151 | }, |
| 1152 | msgs := { |
| 1153 | cc := { |
| 1154 | releaseComplete_NW_MS := { |
| 1155 | messageType := '101010'B, |
| 1156 | nsd := '00'B, |
| 1157 | cause := *, |
| 1158 | facility := *, |
| 1159 | user_user := * |
| 1160 | } |
| 1161 | } |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 1166 | |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 1167 | template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { |
| 1168 | discriminator := '0101'B, |
| 1169 | tiOrSkip := { |
| 1170 | skipIndicator := '0000'B |
| 1171 | }, |
| 1172 | msgs := { |
| 1173 | mm := { |
| 1174 | authenticationRequest := { |
| 1175 | messageType := '010010'B, |
| 1176 | nsd := '00'B, |
| 1177 | cipheringKeySequenceNumber := ?, |
| 1178 | spare2_4 := ?, |
| 1179 | authenticationParRAND := rand, |
| 1180 | authenticationParAUTN := * |
| 1181 | } |
| 1182 | } |
| 1183 | } |
| 1184 | } |
| 1185 | |
| 1186 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := { |
| 1187 | discriminator := '0101'B, |
| 1188 | tiOrSkip := { |
| 1189 | skipIndicator := '0000'B |
| 1190 | }, |
| 1191 | msgs := { |
| 1192 | mm := { |
| 1193 | authenticationResponse := { |
| 1194 | messageType := '010100'B, |
| 1195 | nsd := '00'B, |
| 1196 | authenticationParSRES := sres, |
| 1197 | authenticationParSRESext := omit |
| 1198 | } |
| 1199 | } |
| 1200 | } |
| 1201 | } |
| 1202 | |
| 1203 | template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := { |
| 1204 | discriminator := '0101'B, |
| 1205 | tiOrSkip := { |
| 1206 | skipIndicator := '0000'B |
| 1207 | }, |
| 1208 | msgs := { |
| 1209 | mm := { |
| 1210 | authenticationResponse := { |
| 1211 | messageType := '010100'B, |
| 1212 | nsd := '00'B, |
| 1213 | authenticationParSRES := sres, |
| 1214 | authenticationParSRESext := { |
| 1215 | elementIdentifier := '21'O, |
| 1216 | lengthIndicator := 0, /* overwritten */ |
| 1217 | valueField := res |
| 1218 | } |
| 1219 | } |
| 1220 | } |
| 1221 | } |
| 1222 | } |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 1223 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1224 | template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid, |
| 1225 | template BearerCapability_TLV bcap := omit) := { |
| 1226 | discriminator := '0011'B, |
| 1227 | tiOrSkip := { |
| 1228 | transactionId := { |
| 1229 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1230 | tiFlag := c_TIF_REPL, /* response from destination */ |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1231 | tIExtension := omit |
| 1232 | } |
| 1233 | }, |
| 1234 | msgs := { |
| 1235 | cc := { |
| 1236 | callConfirmed := { |
| 1237 | messageType := '001000'B, |
| 1238 | nsd := '00'B, |
| 1239 | repeatIndicator := omit, |
| 1240 | bearerCapability1 := bcap, |
| 1241 | bearerCapability2 := omit, |
| 1242 | cause := omit, |
| 1243 | cC_Capabilities := omit, |
| 1244 | streamIdentifier := omit, |
| 1245 | supportedCodecs := omit |
| 1246 | } |
| 1247 | } |
| 1248 | } |
| 1249 | } |
| 1250 | |
| 1251 | |
| 1252 | template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *, |
| 1253 | template hexstring calling := *, |
| 1254 | template BearerCapability_TLV bcap := *) := { |
| 1255 | discriminator := '0011'B, |
| 1256 | tiOrSkip := { |
| 1257 | transactionId := { |
| 1258 | tio := int2bit(tid, 3), |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 1259 | tiFlag := c_TIF_ORIG, /* from originator */ |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1260 | tIExtension := omit |
| 1261 | } |
| 1262 | }, |
| 1263 | msgs := { |
| 1264 | cc := { |
| 1265 | setup_NW_MS := { |
| 1266 | messageType := '000101'B, |
| 1267 | nsd := '00'B, |
| 1268 | bcRepeatIndicator := *, |
| 1269 | bearerCapability1 := bcap, |
| 1270 | bearerCapability2 := *, |
| 1271 | facility := *, |
| 1272 | progressIndicator := *, |
| 1273 | signal := *, |
| 1274 | callingPartyBCD_Number := tr_Calling(calling) ifpresent, |
| 1275 | callingPartySubAddress := *, |
| 1276 | calledPartyBCD_Number := tr_Called(called) ifpresent, |
| 1277 | calledPartySubAddress := *, |
| 1278 | redirectingPartyBCDNumber := *, |
| 1279 | redirectingPartySubaddress := *, |
| 1280 | llc_RepeatIndicator := *, |
| 1281 | lowLayerCompatibility1 := *, |
| 1282 | lowLayerCompatibility2 := *, |
| 1283 | hlc_RepeatIndicator := *, |
| 1284 | highLayerCompatibility1 := *, |
| 1285 | highLayerCompatibility2 := *, |
| 1286 | user_user := *, |
| 1287 | priority := *, |
| 1288 | alert := *, |
| 1289 | networkCCCapabilities := *, |
| 1290 | causeofNoCli := *, |
| 1291 | backupBearerCapacity := * |
| 1292 | } |
| 1293 | } |
| 1294 | } |
| 1295 | } |
| 1296 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1297 | /*********************************************************************** |
Harald Welte | 5360396 | 2018-05-28 11:13:09 +0200 | [diff] [blame] | 1298 | * Supplementary Services |
| 1299 | ***********************************************************************/ |
| 1300 | |
| 1301 | private template (value) Facility_TLV ts_FacTLV(OCTN facility) := { |
| 1302 | elementIdentifier := '1C'O, |
| 1303 | lengthIndicator := lengthof(facility), |
| 1304 | facilityInformation := facility |
| 1305 | } |
| 1306 | private template Facility_TLV tr_FacTLV(template OCTN facility) := { |
| 1307 | elementIdentifier := '1C'O, |
| 1308 | lengthIndicator := ?, |
| 1309 | facilityInformation := facility |
| 1310 | } |
| 1311 | |
| 1312 | private template (value) Facility_LV ts_FacLV(OCTN facility) := { |
| 1313 | lengthIndicator := lengthof(facility), |
| 1314 | facilityInformation := facility |
| 1315 | } |
| 1316 | private template Facility_LV tr_FacLV(template OCTN facility) := { |
| 1317 | lengthIndicator := ?, |
| 1318 | facilityInformation := facility |
| 1319 | } |
| 1320 | |
Vadim Yanitskiy | 0319813 | 2018-05-29 03:35:16 +0700 | [diff] [blame] | 1321 | private function f_facility_or_omit(template (omit) OCTN facility) |
| 1322 | return template (omit) Facility_TLV { |
| 1323 | if (istemplatekind(facility, "omit")) { |
| 1324 | return omit; |
| 1325 | } else { |
| 1326 | return ts_FacTLV(valueof(facility)); |
| 1327 | } |
| 1328 | } |
| 1329 | private function f_facility_or_wc(template OCTN facility) |
| 1330 | return template Facility_TLV { |
| 1331 | if (istemplatekind(facility, "*")) { |
| 1332 | return *; |
| 1333 | } else if (istemplatekind(facility, "?")) { |
| 1334 | return ?; |
Vadim Yanitskiy | 52f8b6e | 2018-06-19 17:32:46 +0700 | [diff] [blame] | 1335 | } else if (istemplatekind(facility, "omit")) { |
| 1336 | return omit; |
Vadim Yanitskiy | 0319813 | 2018-05-29 03:35:16 +0700 | [diff] [blame] | 1337 | } else { |
| 1338 | return tr_FacTLV(facility); |
| 1339 | } |
| 1340 | } |
| 1341 | |
Harald Welte | 5360396 | 2018-05-28 11:13:09 +0200 | [diff] [blame] | 1342 | template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_REGISTER( |
| 1343 | uint3_t tid, BIT1 ti_flag, |
| 1344 | OCTN facility, |
| 1345 | template (omit) SS_VersionIndicator ss_ver := omit |
| 1346 | ) := { |
| 1347 | discriminator := '1011'B, |
| 1348 | tiOrSkip := { |
| 1349 | transactionId := { |
| 1350 | tio := int2bit(tid, 3), |
| 1351 | tiFlag := ti_flag, |
| 1352 | tIExtension := omit |
| 1353 | } |
| 1354 | }, |
| 1355 | msgs := { |
| 1356 | ss := { |
| 1357 | register := { |
| 1358 | messageType := '111011'B, |
| 1359 | nsd := '00'B, |
| 1360 | facility := ts_FacTLV(facility), |
| 1361 | ss_version := ss_ver |
| 1362 | } |
| 1363 | } |
| 1364 | } |
| 1365 | } |
| 1366 | template PDU_ML3_MS_NW tr_ML3_MO_SS_REGISTER( |
| 1367 | template uint3_t tid, template BIT1 ti_flag, |
| 1368 | template OCTN facility, |
| 1369 | template SS_VersionIndicator ss_ver := omit |
| 1370 | ) := { |
| 1371 | discriminator := '1011'B, |
| 1372 | tiOrSkip := { |
| 1373 | transactionId := { |
| 1374 | tio := f_tid_or_wc(tid), |
| 1375 | tiFlag := ti_flag, |
| 1376 | tIExtension := omit |
| 1377 | } |
| 1378 | }, |
| 1379 | msgs := { |
| 1380 | ss := { |
| 1381 | register := { |
| 1382 | messageType := '111011'B, |
| 1383 | nsd := '00'B, |
| 1384 | facility := tr_FacTLV(facility), |
| 1385 | ss_version := ss_ver |
| 1386 | } |
| 1387 | } |
| 1388 | } |
| 1389 | } |
| 1390 | |
| 1391 | template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_REGISTER( |
| 1392 | uint3_t tid, BIT1 ti_flag, |
| 1393 | OCTN facility |
| 1394 | ) := { |
| 1395 | discriminator := '1011'B, |
| 1396 | tiOrSkip := { |
| 1397 | transactionId := { |
| 1398 | tio := int2bit(tid, 3), |
| 1399 | tiFlag := ti_flag, |
| 1400 | tIExtension := omit |
| 1401 | } |
| 1402 | }, |
| 1403 | msgs := { |
| 1404 | ss := { |
| 1405 | register := { |
| 1406 | messageType := '111011'B, |
| 1407 | nsd := '00'B, |
| 1408 | facility := ts_FacTLV(facility) |
| 1409 | } |
| 1410 | } |
| 1411 | } |
| 1412 | } |
| 1413 | template PDU_ML3_NW_MS tr_ML3_MT_SS_REGISTER( |
| 1414 | template uint3_t tid, template BIT1 ti_flag, |
| 1415 | template OCTN facility |
| 1416 | ) := { |
| 1417 | discriminator := '1011'B, |
| 1418 | tiOrSkip := { |
| 1419 | transactionId := { |
| 1420 | tio := f_tid_or_wc(tid), |
| 1421 | tiFlag := ti_flag, |
| 1422 | tIExtension := omit |
| 1423 | } |
| 1424 | }, |
| 1425 | msgs := { |
| 1426 | ss := { |
| 1427 | register := { |
| 1428 | messageType := '111011'B, |
| 1429 | nsd := '00'B, |
| 1430 | facility := tr_FacTLV(facility) |
| 1431 | } |
| 1432 | } |
| 1433 | } |
| 1434 | } |
| 1435 | |
| 1436 | template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_FACILITY( |
| 1437 | uint3_t tid, BIT1 ti_flag, |
| 1438 | OCTN facility |
| 1439 | ) := { |
| 1440 | discriminator := '1011'B, |
| 1441 | tiOrSkip := { |
| 1442 | transactionId := { |
| 1443 | tio := int2bit(tid, 3), |
| 1444 | tiFlag := ti_flag, |
| 1445 | tIExtension := omit |
| 1446 | } |
| 1447 | }, |
| 1448 | msgs := { |
| 1449 | ss := { |
| 1450 | facility := { |
| 1451 | messageType := '111010'B, |
| 1452 | nsd := '00'B, |
| 1453 | facility := ts_FacLV(facility) |
| 1454 | } |
| 1455 | } |
| 1456 | } |
| 1457 | } |
| 1458 | template PDU_ML3_MS_NW tr_ML3_MO_SS_FACILITY( |
| 1459 | template uint3_t tid, template BIT1 ti_flag, |
| 1460 | template OCTN facility |
| 1461 | ) := { |
| 1462 | discriminator := '1011'B, |
| 1463 | tiOrSkip := { |
| 1464 | transactionId := { |
| 1465 | tio := f_tid_or_wc(tid), |
| 1466 | tiFlag := ti_flag, |
| 1467 | tIExtension := omit |
| 1468 | } |
| 1469 | }, |
| 1470 | msgs := { |
| 1471 | ss := { |
| 1472 | facility := { |
| 1473 | messageType := '111010'B, |
| 1474 | nsd := '00'B, |
| 1475 | facility := tr_FacLV(facility) |
| 1476 | } |
| 1477 | } |
| 1478 | } |
| 1479 | } |
| 1480 | |
| 1481 | template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_FACILITY( |
| 1482 | uint3_t tid, BIT1 ti_flag, |
| 1483 | OCTN facility |
| 1484 | ) := { |
| 1485 | discriminator := '1011'B, |
| 1486 | tiOrSkip := { |
| 1487 | transactionId := { |
| 1488 | tio := int2bit(tid, 3), |
| 1489 | tiFlag := ti_flag, |
| 1490 | tIExtension := omit |
| 1491 | } |
| 1492 | }, |
| 1493 | msgs := { |
| 1494 | ss := { |
| 1495 | facility := { |
| 1496 | messageType := '111010'B, |
| 1497 | nsd := '00'B, |
| 1498 | facility := ts_FacLV(facility) |
| 1499 | } |
| 1500 | } |
| 1501 | } |
| 1502 | } |
| 1503 | template PDU_ML3_NW_MS tr_ML3_MT_SS_FACILITY( |
| 1504 | template uint3_t tid, template BIT1 ti_flag, |
| 1505 | template OCTN facility |
| 1506 | ) := { |
| 1507 | discriminator := '1011'B, |
| 1508 | tiOrSkip := { |
| 1509 | transactionId := { |
| 1510 | tio := f_tid_or_wc(tid), |
| 1511 | tiFlag := ti_flag, |
| 1512 | tIExtension := omit |
| 1513 | } |
| 1514 | }, |
| 1515 | msgs := { |
| 1516 | ss := { |
| 1517 | facility := { |
| 1518 | messageType := '111010'B, |
| 1519 | nsd := '00'B, |
| 1520 | facility := tr_FacLV(facility) |
| 1521 | } |
| 1522 | } |
| 1523 | } |
| 1524 | } |
| 1525 | |
Vadim Yanitskiy | 0319813 | 2018-05-29 03:35:16 +0700 | [diff] [blame] | 1526 | template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_RELEASE_COMPLETE( |
| 1527 | uint3_t tid, BIT1 ti_flag, |
| 1528 | template (omit) ML3_Cause_TLV cause := omit, |
| 1529 | template (omit) OCTN facility := omit |
| 1530 | ) := { |
| 1531 | discriminator := '1011'B, |
| 1532 | tiOrSkip := { |
| 1533 | transactionId := { |
| 1534 | tio := int2bit(tid, 3), |
| 1535 | tiFlag := ti_flag, |
| 1536 | tIExtension := omit |
| 1537 | } |
| 1538 | }, |
| 1539 | msgs := { |
| 1540 | ss := { |
| 1541 | releaseComplete_MS_NW := { |
| 1542 | messageType := '101010'B, |
| 1543 | nsd := '00'B, |
| 1544 | cause := cause, |
| 1545 | facility := f_facility_or_omit(facility) |
| 1546 | } |
| 1547 | } |
| 1548 | } |
| 1549 | } |
| 1550 | template PDU_ML3_MS_NW tr_ML3_MO_SS_RELEASE_COMPLETE( |
| 1551 | template uint3_t tid, template BIT1 ti_flag, |
| 1552 | template ML3_Cause_TLV cause := *, |
| 1553 | template OCTN facility := * |
| 1554 | ) := { |
| 1555 | discriminator := '1011'B, |
| 1556 | tiOrSkip := { |
| 1557 | transactionId := { |
| 1558 | tio := f_tid_or_wc(tid), |
| 1559 | tiFlag := ti_flag, |
| 1560 | tIExtension := omit |
| 1561 | } |
| 1562 | }, |
| 1563 | msgs := { |
| 1564 | ss := { |
| 1565 | releaseComplete_MS_NW := { |
| 1566 | messageType := '101010'B, |
| 1567 | nsd := '00'B, |
| 1568 | cause := cause, |
| 1569 | facility := f_facility_or_wc(facility) |
| 1570 | } |
| 1571 | } |
| 1572 | } |
| 1573 | } |
| 1574 | |
| 1575 | template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_RELEASE_COMPLETE( |
| 1576 | uint3_t tid, BIT1 ti_flag, |
| 1577 | template (omit) ML3_Cause_TLV cause := omit, |
| 1578 | template (omit) OCTN facility := omit |
| 1579 | ) := { |
| 1580 | discriminator := '1011'B, |
| 1581 | tiOrSkip := { |
| 1582 | transactionId := { |
| 1583 | tio := int2bit(tid, 3), |
| 1584 | tiFlag := ti_flag, |
| 1585 | tIExtension := omit |
| 1586 | } |
| 1587 | }, |
| 1588 | msgs := { |
| 1589 | ss := { |
| 1590 | releaseComplete_NW_MS := { |
| 1591 | messageType := '101010'B, |
| 1592 | nsd := '00'B, |
| 1593 | cause := cause, |
| 1594 | facility := f_facility_or_omit(facility) |
| 1595 | } |
| 1596 | } |
| 1597 | } |
| 1598 | } |
| 1599 | template PDU_ML3_NW_MS tr_ML3_MT_SS_RELEASE_COMPLETE( |
| 1600 | template uint3_t tid, template BIT1 ti_flag, |
| 1601 | template ML3_Cause_TLV cause := *, |
| 1602 | template OCTN facility := * |
| 1603 | ) := { |
| 1604 | discriminator := '1011'B, |
| 1605 | tiOrSkip := { |
| 1606 | transactionId := { |
| 1607 | tio := f_tid_or_wc(tid), |
| 1608 | tiFlag := ti_flag, |
| 1609 | tIExtension := omit |
| 1610 | } |
| 1611 | }, |
| 1612 | msgs := { |
| 1613 | ss := { |
| 1614 | releaseComplete_NW_MS := { |
| 1615 | messageType := '101010'B, |
| 1616 | nsd := '00'B, |
| 1617 | cause := cause, |
| 1618 | facility := f_facility_or_wc(facility) |
| 1619 | } |
| 1620 | } |
| 1621 | } |
| 1622 | } |
| 1623 | |
Harald Welte | 5360396 | 2018-05-28 11:13:09 +0200 | [diff] [blame] | 1624 | /*********************************************************************** |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1625 | * GPRS Mobility Management |
| 1626 | ***********************************************************************/ |
| 1627 | |
| 1628 | template (value) MSNetworkCapabilityV ts_GMM_MsNetCapV := { |
| 1629 | gea1bit := '1'B, |
| 1630 | smCapabilitiesviaDedicatedChannels := '1'B, |
| 1631 | smCapabilitiesviaGPRSChannels := '0'B, |
| 1632 | ucs2Support := '1'B, |
| 1633 | ssScreeningIndicator := '01'B, |
| 1634 | solSACapability := omit, |
| 1635 | revisionLevelIndicatior := omit, |
| 1636 | pFCFeatureMode := omit, |
| 1637 | extendedGEAbits := omit, |
| 1638 | lcsVAcapability := omit, |
| 1639 | pSInterRATHOtoUTRANIuModeCapability := omit, |
| 1640 | pSInterRATHOtoEUTRANS1ModeCapability := omit, |
| 1641 | eMMCombinedProceduresCapability := omit, |
| 1642 | iSRSupport := omit, |
| 1643 | sRVCCtoGERANUTRANCapability := omit, |
| 1644 | ePCCapability := omit, |
| 1645 | nFCapability := omit, |
| 1646 | gERANNertworkSharingCapability := omit, |
| 1647 | spare_octets := omit |
| 1648 | }; |
| 1649 | |
| 1650 | template (value) MSNetworkCapabilityLV ts_GMM_MsNetCapLV := { |
| 1651 | lengthIndicator := 0, /* overwritten */ |
| 1652 | msNetworkCapabilityV := ts_GMM_MsNetCapV |
| 1653 | }; |
| 1654 | |
| 1655 | type enumerated GprsAttachType { |
| 1656 | GPRS_ATT_T_GPRS, |
| 1657 | GPRS_ATT_T_GPRS_IMSI_COMBINED |
| 1658 | }; |
| 1659 | |
| 1660 | function ts_GMM_AttachType(boolean combined := false, boolean follow_on_pending := false) |
| 1661 | return AttachTypeV { |
| 1662 | var AttachTypeV att; |
| 1663 | if (combined) { |
| 1664 | att.attachType := '011'B; |
| 1665 | } else { |
| 1666 | att.attachType := '001'B; |
| 1667 | } |
| 1668 | att.for_l3 := bool2bit(combined); |
| 1669 | return att; |
| 1670 | } |
| 1671 | |
| 1672 | type enumerated GprsUpdateType { |
| 1673 | GPRS_UPD_T_RA ('000'B), |
| 1674 | GPRS_UPD_T_RA_LA_COMBINED ('001'B), |
| 1675 | GPRS_UPD_T_RA_LA_COMBINED_IMSI_ATT ('010'B), |
| 1676 | GPRS_UPD_T_PERIODIC ('011'B) |
| 1677 | }; |
| 1678 | |
| 1679 | /* 10.5.5.18 Update Type */ |
| 1680 | template UpdateTypeV ts_GMM_UpdateType(GprsUpdateType upd_t, boolean combined := false, |
| 1681 | boolean follow_on_pending := false) := { |
| 1682 | valueField := int2bit(enum2int(upd_t), 3), |
| 1683 | for_l3 := bool2bit(combined) |
| 1684 | } |
| 1685 | |
| 1686 | template (value) DRXParameterV ts_DrxParameterV := { |
| 1687 | splitPGCycleCode := '00'O, /* no DRX */ |
| 1688 | nonDRXTimer := '000'B, /* no non-DRX mode */ |
| 1689 | splitOnCCCH := '0'B, /* not supported */ |
| 1690 | cnSpecificDRXCycleLength := '0000'B /* SI value used */ |
| 1691 | }; |
| 1692 | |
| 1693 | template (value) AccessCapabilitiesStruct ts_AccesssCap := { |
| 1694 | lengthIndicator := 0, /* overwritten */ |
| 1695 | accessCapabilities := { |
| 1696 | rfPowerCapability := '001'B, /* FIXME */ |
| 1697 | presenceBitA5 := '0'B, |
| 1698 | a5bits := omit, |
| 1699 | esind := '1'B, |
| 1700 | psbit := '0'B, |
| 1701 | vgcs := '0'B, |
| 1702 | vbs := '0'B, |
| 1703 | presenceBitMultislot := '0'B, |
| 1704 | multislotcap := omit, |
| 1705 | accessCapAdditionsAfterRel97 := omit |
| 1706 | }, |
| 1707 | spare_bits := omit |
| 1708 | } |
| 1709 | |
| 1710 | template (value) MSRACapabilityValuesRecord ts_RaCapRec(BIT4 att) := { |
| 1711 | mSRACapabilityValues := { |
| 1712 | mSRACapabilityValuesExclude1111 := { |
| 1713 | accessTechnType := '0001'B, /* E-GSM */ |
| 1714 | accessCapabilities := ts_AccesssCap |
| 1715 | } |
| 1716 | }, |
| 1717 | presenceBitMSRACap := '0'B |
| 1718 | }; |
| 1719 | |
| 1720 | template (value) MSRadioAccessCapabilityLV ts_MS_RaCapa := { |
| 1721 | lengthIndicator := 0, /* overwritten */ |
| 1722 | msRadioAccessCapabilityV := { |
| 1723 | ts_RaCapRec('0001'B) /* E-GSM */ |
| 1724 | } |
| 1725 | } |
| 1726 | |
| 1727 | template (value) PDU_L3_MS_SGSN |
| 1728 | ts_GMM_ATTACH_REQ(MobileIdentityLV mi_lv, RoutingAreaIdentificationV old_ra, |
| 1729 | boolean combined := false, boolean follow_on_pending := false, |
| 1730 | template (omit) MobileStationClassmark2_TLV cm2_tlv, |
| 1731 | template (omit) MobileStationClassmark3_TLV cm3_tlv |
| 1732 | ) := { |
| 1733 | discriminator := '0000'B, /* overwritten */ |
| 1734 | tiOrSkip := { |
| 1735 | skipIndicator := '0000'B |
| 1736 | }, |
| 1737 | msgs := { |
| 1738 | gprs_mm := { |
| 1739 | attachRequest := { |
| 1740 | messageType := '00000000'B, /* overwritten */ |
| 1741 | msNetworkCapability := ts_GMM_MsNetCapLV, |
| 1742 | attachType := valueof(ts_GMM_AttachType(combined, follow_on_pending)), |
| 1743 | gprsCKSN := { '111'B, '0'B }, |
| 1744 | drxParam := ts_DrxParameterV, |
| 1745 | mobileIdentity := mi_lv, |
| 1746 | oldRoutingAreaID := old_ra, |
| 1747 | msRACap := ts_MS_RaCapa, |
| 1748 | ptmsiSignature := omit, /* TODO */ |
| 1749 | reqGPRStimer := omit, |
| 1750 | tmsiStatus := omit, |
| 1751 | pC_LCSCapability := omit, |
| 1752 | mobileStationClassmark2 := cm2_tlv, |
| 1753 | mobileStationClassmark3 := cm3_tlv, |
| 1754 | supportedCodecs := omit, |
| 1755 | uENetworkCapability := omit, |
| 1756 | additionalMobileIdentity := omit, |
| 1757 | routingAreaIdentification2 := omit, |
| 1758 | voiceDomainandUEsUsageSetting := omit, |
| 1759 | deviceProperties := omit, |
| 1760 | p_TMSI_Type := omit, |
| 1761 | mS_NetworkFeatureSupport := omit, |
| 1762 | oldLocationAreaIdentification := omit, |
| 1763 | additionalUpdateType := omit, |
| 1764 | tMSIBasedNRIcontainer := omit, |
| 1765 | t3324 := omit, |
| 1766 | t3312_ExtendedValue := omit, |
| 1767 | extendedDRXParameters := omit |
| 1768 | } |
| 1769 | } |
| 1770 | } |
| 1771 | } |
| 1772 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 1773 | private function tr_MI_TMSI_TLV(template OCT4 tmsi) return template MobileIdentityTLV { |
| 1774 | if (istemplatekind(tmsi, "*")) { |
| 1775 | return *; |
| 1776 | } else if (istemplatekind(tmsi, "?")) { |
| 1777 | return ?; |
| 1778 | } else { |
| 1779 | var template MobileIdentityTLV mi := { |
| 1780 | elementIdentifier := '0011000'B, |
| 1781 | spare1 := '0'B, |
| 1782 | mobileIdentityLV := { |
| 1783 | lengthIndicator := 4, |
| 1784 | mobileIdentityV := { |
| 1785 | typeOfIdentity := '100'B, |
| 1786 | oddEvenInd_identity := { |
| 1787 | tmsi_ptmsi := { |
| 1788 | oddevenIndicator := '1'B, |
| 1789 | fillerDigit := '1111'B, |
| 1790 | octets := tmsi |
| 1791 | } |
| 1792 | } |
| 1793 | } |
| 1794 | } |
| 1795 | }; |
| 1796 | return mi; |
| 1797 | } |
| 1798 | } |
| 1799 | |
| 1800 | template PDU_L3_SGSN_MS tr_GMM_ATTACH_ACCEPT(template BIT3 res := ?, |
| 1801 | template RoutingAreaIdentificationV ra := ?, |
| 1802 | template OCT4 ptmsi := *) := { |
| 1803 | discriminator := '1000'B, |
| 1804 | tiOrSkip := { |
| 1805 | skipIndicator := '0000'B |
| 1806 | }, |
| 1807 | msgs := { |
| 1808 | gprs_mm := { |
| 1809 | attachAccept := { |
| 1810 | messageType := '00000010'B, |
| 1811 | attachResult := { res, ? }, |
| 1812 | forceToStandby := ?, |
| 1813 | updateTimer := ?, |
| 1814 | radioPriority := ?, |
| 1815 | radioPriorityTOM8 := ?, |
| 1816 | routingAreaIdentification := ra, |
| 1817 | ptmsiSignature := *, |
| 1818 | readyTimer := *, |
| 1819 | allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi), |
| 1820 | msIdentity := *, |
| 1821 | gmmCause := *, |
| 1822 | t3302 := *, |
| 1823 | cellNotification := *, |
| 1824 | equivalentPLMNs := *, |
| 1825 | networkFeatureSupport := *, |
| 1826 | emergencyNumberList := *, |
| 1827 | requestedMSInformation := *, |
| 1828 | t3319 := *, |
| 1829 | t3323 := *, |
| 1830 | t3312_ExtendedValue := *, |
| 1831 | additionalNetworkFeatureSupport := *, |
| 1832 | t3324 := *, |
| 1833 | extendedDRXParameters := * |
| 1834 | } |
| 1835 | } |
| 1836 | } |
| 1837 | } |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1838 | |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 1839 | template PDU_L3_SGSN_MS tr_GMM_ATTACH_REJECT(template OCT1 cause) := { |
| 1840 | discriminator := '1000'B, |
| 1841 | tiOrSkip := { |
| 1842 | skipIndicator := '0000'B |
| 1843 | }, |
| 1844 | msgs := { |
| 1845 | gprs_mm := { |
| 1846 | attachReject := { |
| 1847 | messageType := '00000100'B, |
| 1848 | gmmCause := { |
| 1849 | causeValue := cause |
| 1850 | }, |
| 1851 | t3302 := *, |
| 1852 | t3346 := * |
| 1853 | } |
| 1854 | } |
| 1855 | } |
| 1856 | } |
| 1857 | |
| 1858 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1859 | template (value) PDU_L3_MS_SGSN ts_GMM_ATTACH_COMPL := { |
| 1860 | discriminator := '0000'B, /* overwritten */ |
| 1861 | tiOrSkip := { |
| 1862 | skipIndicator := '0000'B |
| 1863 | }, |
| 1864 | msgs := { |
| 1865 | gprs_mm := { |
| 1866 | attachComplete := { |
| 1867 | messageType := '00000000'B, /* overwritten */ |
| 1868 | interRATHandoverInformation := omit, |
| 1869 | eUTRANinterRATHandoverInformation := omit |
| 1870 | } |
| 1871 | } |
| 1872 | } |
| 1873 | } |
| 1874 | |
| 1875 | template (value) PDU_L3_MS_SGSN |
| 1876 | ts_GMM_RAU_REQ(MobileIdentityLV mi_lv, GprsUpdateType upd_type, |
| 1877 | RoutingAreaIdentificationV old_ra, |
| 1878 | boolean follow_on_pending := false, |
| 1879 | template (omit) MobileStationClassmark2_TLV cm2_tlv, |
| 1880 | template (omit) MobileStationClassmark3_TLV cm3_tlv |
| 1881 | ) := { |
| 1882 | discriminator := '0000'B, /* overwritten */ |
| 1883 | tiOrSkip := { |
| 1884 | skipIndicator := '0000'B |
| 1885 | }, |
| 1886 | msgs := { |
| 1887 | gprs_mm := { |
| 1888 | routingAreaUpdateRequest := { |
| 1889 | messageType := '00000000'B, /* overwritten */ |
| 1890 | updateType := ts_GMM_UpdateType(upd_type, follow_on_pending), |
| 1891 | gprsCKSN := { '111'B, '0'B }, |
| 1892 | oldRoutingAreaId := old_ra, |
| 1893 | msRACap := ts_MS_RaCapa, |
| 1894 | oldPTMSISignature := omit, /* TODO */ |
| 1895 | readyTimerValue := omit, |
| 1896 | drxParameter := omit, |
| 1897 | tmsiStatus := omit, |
| 1898 | ptmsi := omit, |
| 1899 | mSNetworkCapability := omit, |
| 1900 | pdpContextStatus := omit, /* TODO */ |
| 1901 | pC_LCSCapability := omit, |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 1902 | mBMS_ContextStatus := omit, |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1903 | uENetworkCapability := omit, |
| 1904 | additionalMobileIdentity := omit, |
| 1905 | oldRoutingAreaIdentification2 := omit, |
| 1906 | mobileStationClassmark2 := cm2_tlv, |
| 1907 | mobileStationClassmark3 := cm3_tlv, |
| 1908 | supportedCodecs := omit, |
| 1909 | voiceDomainUEUsageSetting := omit, |
| 1910 | p_TMSI_Type := omit, |
| 1911 | deviceProperties := omit, |
| 1912 | mS_NetworkFeatureSupport := omit, |
| 1913 | oldLocationAreaIdentification := omit, |
| 1914 | additionalUpdateType := omit, |
| 1915 | tMSIBasedNRIcontainer := omit, |
| 1916 | t3324 := omit, |
| 1917 | t3312_ExtendedValue := omit, |
| 1918 | extendedDRXParameters := omit |
| 1919 | } |
| 1920 | } |
| 1921 | } |
| 1922 | } |
| 1923 | |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 1924 | template PDU_L3_SGSN_MS tr_GMM_RAU_REJECT(template OCT1 cause := ?) := { |
| 1925 | discriminator := '1000'B, |
| 1926 | tiOrSkip := { |
| 1927 | skipIndicator := '0000'B |
| 1928 | }, |
| 1929 | msgs := { |
| 1930 | gprs_mm := { |
| 1931 | routingAreaUpdateReject := { |
| 1932 | messageType := '00001011'B, |
| 1933 | gmmCause := { |
| 1934 | causeValue := cause |
| 1935 | }, |
| 1936 | forceToStandby := ?, |
| 1937 | spare := '0000'B, |
| 1938 | t3302 := *, |
| 1939 | t3346 := * |
| 1940 | } |
| 1941 | } |
| 1942 | } |
| 1943 | } |
| 1944 | |
Harald Welte | 91636de | 2018-02-17 10:16:14 +0100 | [diff] [blame] | 1945 | template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?, |
| 1946 | template RoutingAreaIdentificationV ra := ?, |
| 1947 | template OCT4 ptmsi := *) := { |
| 1948 | discriminator := '1000'B, |
| 1949 | tiOrSkip := { |
| 1950 | skipIndicator := '0000'B |
| 1951 | }, |
| 1952 | msgs := { |
| 1953 | gprs_mm := { |
| 1954 | routingAreaUpdateAccept := { |
| 1955 | messageType := '00001001'B, |
| 1956 | forceToStandby := ?, |
| 1957 | updateResult := { res, ? }, |
| 1958 | raUpdateTimer := ?, |
| 1959 | routingAreaId := ra, |
| 1960 | ptmsiSignature := *, |
| 1961 | allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi), |
| 1962 | msIdentity := *, |
| 1963 | receiveNPDUNumbers := *, |
| 1964 | readyTimer := *, |
| 1965 | gmmCause := *, |
| 1966 | t3302 := *, |
| 1967 | cellNotification := *, |
| 1968 | equivalentPLMNs := *, |
| 1969 | pdpContextStatus := *, |
| 1970 | networkFeatureSupport := *, |
| 1971 | emergencyNumberList := *, |
| 1972 | mBMS_ContextStatus := *, |
| 1973 | requestedMSInformation := *, |
| 1974 | t3319 := *, |
| 1975 | t3323 := *, |
| 1976 | t3312_ExtendedValue := *, |
| 1977 | additionalNetworkFeatureSupport := *, |
| 1978 | t3324 := *, |
| 1979 | extendedDRXParameters := * |
| 1980 | } |
| 1981 | } |
| 1982 | } |
| 1983 | } |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 1984 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 1985 | template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := { |
| 1986 | discriminator := '0000'B, /* overwritten */ |
| 1987 | tiOrSkip := { |
| 1988 | skipIndicator := '0000'B |
| 1989 | }, |
| 1990 | msgs := { |
| 1991 | gprs_mm := { |
| 1992 | routingAreaUpdateComplete := { |
| 1993 | messageType := '00000000'B, /* overwritten */ |
| 1994 | receiveNPDUNumbers := omit, |
| 1995 | interRATHandoverInformation := omit, |
| 1996 | eUTRANinterRATHandoverInformation := omit |
| 1997 | } |
| 1998 | } |
| 1999 | } |
| 2000 | } |
| 2001 | |
| 2002 | template (value) PDU_L3_MS_SGSN ts_GMM_PTMSI_REALL_COMPL := { |
| 2003 | discriminator := '0000'B, /* overwritten */ |
| 2004 | tiOrSkip := { |
| 2005 | skipIndicator := '0000'B |
| 2006 | }, |
| 2007 | msgs := { |
| 2008 | gprs_mm := { |
| 2009 | p_TMSIReallocationComplete := { |
| 2010 | messageType := '00000000'B /* overwritten */ |
| 2011 | } |
| 2012 | } |
| 2013 | } |
| 2014 | } |
| 2015 | |
| 2016 | template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_CIPH_COMPL(ACReferenceNumberV ref, OCT4 res) := { |
| 2017 | discriminator := '0000'B, /* overwritten */ |
| 2018 | tiOrSkip := { |
| 2019 | skipIndicator := '0000'B |
| 2020 | }, |
| 2021 | msgs := { |
| 2022 | gprs_mm := { |
| 2023 | authenticationAndCipheringResponse := { |
| 2024 | messageType := '00000000'B, /* overwritten */ |
| 2025 | acReferenceNumber := ref, |
| 2026 | spare := '0000'B, |
| 2027 | authenticationParResp := { |
| 2028 | elementIdentifier := '22'O, |
| 2029 | valueField := res |
| 2030 | }, |
| 2031 | imeisv := omit, |
| 2032 | authenticationRespParExt := omit |
| 2033 | } |
| 2034 | } |
| 2035 | } |
| 2036 | } |
| 2037 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 2038 | template PDU_L3_SGSN_MS tr_GMM_ID_REQ(template BIT3 id_type := ?) := { |
| 2039 | discriminator := '1000'B, |
| 2040 | tiOrSkip := { |
| 2041 | skipIndicator := '0000'B |
| 2042 | }, |
| 2043 | msgs := { |
| 2044 | gprs_mm := { |
| 2045 | identityRequest := { |
| 2046 | messageType := '00010101'B, |
| 2047 | identityType := { id_type, '0'B }, |
| 2048 | forceToStandby := ? |
| 2049 | } |
| 2050 | } |
| 2051 | } |
| 2052 | } |
| 2053 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 2054 | template (value) PDU_L3_MS_SGSN ts_GMM_ID_RESP(MobileIdentityLV mi_lv) := { |
| 2055 | discriminator := '0000'B, /* overwritten */ |
| 2056 | tiOrSkip := { |
| 2057 | skipIndicator := '0000'B |
| 2058 | }, |
| 2059 | msgs := { |
| 2060 | gprs_mm := { |
| 2061 | identityResponse := { |
| 2062 | messageType := '00000000'B, /* overwritten */ |
| 2063 | mobileIdentity := mi_lv |
| 2064 | } |
| 2065 | } |
| 2066 | } |
| 2067 | } |
| 2068 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 2069 | template PDU_L3_SGSN_MS tr_GMM_AUTH_REQ(template OCT16 rand := ?, template BIT3 ciph_alg := ?) := { |
| 2070 | discriminator := '1000'B, |
| 2071 | tiOrSkip := { |
| 2072 | skipIndicator := '0000'B |
| 2073 | }, |
| 2074 | msgs := { |
| 2075 | gprs_mm := { |
| 2076 | authenticationAndCipheringRequest := { |
| 2077 | messageType := '00010010'B, |
| 2078 | cipheringAlgorithm := { ciph_alg, '0'B }, |
| 2079 | imeisvRequest := ?, |
| 2080 | forceToStandby := ?, |
| 2081 | acReferenceNumber := ?, |
| 2082 | authenticationParameterRAND := { |
| 2083 | elementIdentifier := '21'O, |
| 2084 | randValue := rand |
| 2085 | }, |
| 2086 | cipheringKeySequenceNumber := *, |
| 2087 | authenticationParameterAUTN := * |
| 2088 | } |
| 2089 | } |
| 2090 | } |
| 2091 | } |
| 2092 | |
| 2093 | template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_RESP_2G(BIT4 ac_ref, OCT4 sres) := { |
| 2094 | discriminator := '1000'B, |
| 2095 | tiOrSkip := { |
| 2096 | skipIndicator := '0000'B |
| 2097 | }, |
| 2098 | msgs := { |
| 2099 | gprs_mm := { |
| 2100 | authenticationAndCipheringResponse := { |
| 2101 | messageType := '00010011'B, |
| 2102 | acReferenceNumber := { valueField := ac_ref }, |
| 2103 | spare := '0000'B, |
| 2104 | authenticationParResp := { |
| 2105 | elementIdentifier := '22'O, |
| 2106 | valueField := sres |
| 2107 | }, |
| 2108 | imeisv := omit, |
| 2109 | authenticationRespParExt := omit |
| 2110 | } |
| 2111 | } |
| 2112 | } |
| 2113 | } |
| 2114 | |
Alexander Couzens | 15faf92 | 2018-09-04 15:16:26 +0200 | [diff] [blame^] | 2115 | template PDU_L3_MS_SGSN ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC(octetstring auts) := { |
| 2116 | discriminator := '1000'B, |
| 2117 | tiOrSkip := { |
| 2118 | skipIndicator := '0000'B |
| 2119 | }, |
| 2120 | msgs := { |
| 2121 | gprs_mm := { |
| 2122 | authenticationAndCipheringFailure := { |
| 2123 | messageType := '00011100'B, |
| 2124 | gmmCause := { |
| 2125 | causeValue := '15'O /* GMM_CAUSE_SYNC_FAIL 10.5.3.2.2 */ |
| 2126 | }, |
| 2127 | authenticationFailureParam := { |
| 2128 | elementIdentifier := '30'O, |
| 2129 | lengthIndicator := 14, |
| 2130 | valueField := auts |
| 2131 | } |
| 2132 | } |
| 2133 | } |
| 2134 | } |
| 2135 | } |
| 2136 | |
Harald Welte | b0386df | 2018-02-16 18:14:28 +0100 | [diff] [blame] | 2137 | |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 2138 | const BIT3 c_GMM_DTT_MO_GPRS := '001'B; |
| 2139 | const BIT3 c_GMM_DTT_MO_IMSI := '010'B; |
| 2140 | const BIT3 c_GMM_DTT_MO_GPRS_IMSI_COMBINED := '011'B; |
| 2141 | |
Alexander Couzens | b6ab456 | 2018-05-17 02:59:22 +0200 | [diff] [blame] | 2142 | const BIT3 c_GMM_DTT_MT_REATTACH_REQUIRED := '001'B; |
| 2143 | const BIT3 c_GMM_DTT_MT_REATTACH_NOT_REQUIRED := '010'B; |
| 2144 | const BIT3 c_GMM_DTT_MT_IMSI_DETACH := '011'B; |
| 2145 | |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 2146 | template (value) DetachTypeV ts_GMM_DetType(BIT3 dtt, boolean power_off := false) := { |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 2147 | detachType := dtt, |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 2148 | powerOffFlag := bool2bit(power_off) |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 2149 | } |
| 2150 | |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 2151 | function ts_PtmsiSigTV(template (omit) OCT3 val) return template (omit) P_TMSISignatureTV { |
| 2152 | var template (omit) P_TMSISignatureTV ret; |
| 2153 | if (istemplatekind(val, "omit")) { |
| 2154 | return omit; |
| 2155 | } else { |
| 2156 | ret := { |
| 2157 | elementIdentifier := '19'O, |
| 2158 | valueField := valueof(val) |
| 2159 | } |
| 2160 | return ret; |
| 2161 | } |
| 2162 | } |
| 2163 | |
| 2164 | function ts_PtmsiSigTLV(template (omit) OCT3 val) return template (omit) P_TMSISignature2TLV { |
| 2165 | var template (omit) P_TMSISignature2TLV ret; |
| 2166 | if (istemplatekind(val, "omit")) { |
| 2167 | return omit; |
| 2168 | } else { |
| 2169 | ret := { |
| 2170 | elementIdentifier := '19'O, |
| 2171 | lengthIndicator := 3, |
| 2172 | valueField := valueof(val) |
| 2173 | } |
| 2174 | return ret; |
| 2175 | } |
| 2176 | } |
| 2177 | |
| 2178 | template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS, |
| 2179 | boolean power_off := false, |
| 2180 | template (omit) OCT4 p_tmsi := omit, |
| 2181 | template (omit) OCT3 p_tmsi_sig := omit) := { |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 2182 | discriminator := '0000'B, /* overwritten */ |
| 2183 | tiOrSkip := { |
| 2184 | skipIndicator := '0000'B |
| 2185 | }, |
| 2186 | msgs := { |
| 2187 | gprs_mm := { |
| 2188 | detachRequest_MS_SGSN := { |
| 2189 | messageType := '00000000'B, /* overwritten */ |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 2190 | detachType := valueof(ts_GMM_DetType(dtt, power_off)), |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 2191 | spare := '0000'B, |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 2192 | ptmsi := ts_MI_TMSI_TLV(p_tmsi), |
| 2193 | ptmsiSignature := ts_PtmsiSigTLV(p_tmsi_sig) |
| 2194 | } |
| 2195 | } |
| 2196 | } |
| 2197 | } |
| 2198 | |
| 2199 | template PDU_L3_SGSN_MS tr_GMM_DET_ACCEPT_MT := { |
| 2200 | discriminator := '1000'B, |
| 2201 | tiOrSkip := { |
| 2202 | skipIndicator := '0000'B |
| 2203 | }, |
| 2204 | msgs := { |
| 2205 | gprs_mm := { |
| 2206 | detachAccept_SGSN_MS := { |
| 2207 | messageType := '00000110'B, |
| 2208 | forceToStandby := ?, |
| 2209 | spare := '0000'B |
Harald Welte | 38575a7 | 2018-02-15 20:41:37 +0100 | [diff] [blame] | 2210 | } |
| 2211 | } |
| 2212 | } |
| 2213 | } |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 2214 | |
Alexander Couzens | d62fba5 | 2018-05-22 16:08:39 +0200 | [diff] [blame] | 2215 | template PDU_L3_SGSN_MS tr_GMM_DET_REQ_MT( |
| 2216 | template BIT3 dtt := *, |
| 2217 | template BIT3 forceToStandby := ?, |
Alexander Couzens | d8604ab | 2018-05-29 15:46:06 +0200 | [diff] [blame] | 2218 | template OCT1 cause := *) := { |
Harald Welte | 835b15f | 2018-02-18 14:39:11 +0100 | [diff] [blame] | 2219 | discriminator := '1000'B, |
| 2220 | tiOrSkip := { |
| 2221 | skipIndicator := '0000'B |
| 2222 | }, |
| 2223 | msgs := { |
| 2224 | gprs_mm := { |
| 2225 | detachRequest_SGSN_MS := { |
| 2226 | messageType := '00000101'B, |
Alexander Couzens | d62fba5 | 2018-05-22 16:08:39 +0200 | [diff] [blame] | 2227 | detachType := { dtt, ? }, |
| 2228 | forceToStandby := { forceToStandby, '0'B }, |
| 2229 | gmmCause := { |
| 2230 | elementIdentifier := '25'O, |
| 2231 | causeValue := { cause } |
| 2232 | } |
| 2233 | } |
| 2234 | } |
| 2235 | } |
| 2236 | } |
| 2237 | |
| 2238 | template PDU_L3_MS_SGSN ts_GMM_DET_ACCEPT_MO := { |
| 2239 | discriminator := '0000'B, /* overwritten */ |
| 2240 | tiOrSkip := { |
| 2241 | skipIndicator := '0000'B |
| 2242 | }, |
| 2243 | msgs := { |
| 2244 | gprs_mm := { |
| 2245 | detachAccept_MS_SGSN := { |
| 2246 | messageType := '00000000'B |
Harald Welte | 835b15f | 2018-02-18 14:39:11 +0100 | [diff] [blame] | 2247 | } |
| 2248 | } |
| 2249 | } |
| 2250 | } |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2251 | |
| 2252 | function ts_ApnTLV(template (omit) octetstring apn) return template (omit) AccessPointNameTLV { |
| 2253 | if (istemplatekind(apn, "omit")) { |
| 2254 | return omit; |
| 2255 | } else { |
| 2256 | var template (omit) AccessPointNameTLV ret := { |
| 2257 | elementIdentifier := '28'O, |
| 2258 | lengthIndicator := 0, /* overwritten */ |
| 2259 | accessPointNameValue := apn |
| 2260 | } |
| 2261 | return ret; |
| 2262 | } |
| 2263 | } |
| 2264 | |
| 2265 | function ts_PcoTLV(template (omit) ProtocolConfigOptionsV pco) |
| 2266 | return template (omit) ProtocolConfigOptionsTLV { |
| 2267 | if (istemplatekind(pco, "omit")) { |
| 2268 | return omit; |
| 2269 | } else { |
| 2270 | var template (omit) ProtocolConfigOptionsTLV ret := { |
| 2271 | elementIdentifier := '27'O, |
| 2272 | lengthIndicator := 0, /* overwritten */ |
| 2273 | protocolConfigOptionsV := pco |
| 2274 | } |
| 2275 | return ret; |
| 2276 | } |
| 2277 | } |
| 2278 | |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2279 | function ts_TearDownIndicatorTV(in template (omit) boolean ind) |
| 2280 | return template (omit) TearDownIndicatorTV { |
| 2281 | if (istemplatekind(ind, "omit")) { |
| 2282 | return omit; |
| 2283 | } else { |
| 2284 | var template (omit) TearDownIndicatorTV ret := { |
| 2285 | tearDownIndicatorV := { |
| 2286 | tdi_flag := bool2bit(valueof(ind)), |
| 2287 | spare := '000'B |
| 2288 | }, |
| 2289 | elementIdentifier := '1001'B |
| 2290 | } |
| 2291 | return ret; |
| 2292 | } |
| 2293 | } |
| 2294 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2295 | template (value) PDU_L3_MS_SGSN ts_SM_ACT_PDP_REQ(BIT3 tid, BIT4 nsapi, BIT4 sapi, QoSV qos, |
| 2296 | PDPAddressV addr, |
| 2297 | template (omit) octetstring apn := omit, |
| 2298 | template (omit) ProtocolConfigOptionsV pco := omit |
| 2299 | ) := { |
| 2300 | discriminator := '0000'B, /* overwritten */ |
| 2301 | tiOrSkip := { |
| 2302 | transactionId := { |
| 2303 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2304 | tiFlag := c_TIF_ORIG, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2305 | tIExtension := omit |
| 2306 | } |
| 2307 | }, |
| 2308 | msgs := { |
| 2309 | gprs_sm := { |
| 2310 | activatePDPContextRequest := { |
| 2311 | messageType := '00000000'B, /* overwritten */ |
| 2312 | requestedNSAPI := { nsapi, '0000'B }, |
| 2313 | requestedLLCSAPI := { sapi, '0000'B }, |
| 2314 | requestedQoS := { |
| 2315 | lengthIndicator := 0, /* overwritten */ |
| 2316 | qoSV := qos |
| 2317 | }, |
| 2318 | requestedPDPaddress := { |
| 2319 | lengthIndicator := 0, /* overwritten */ |
| 2320 | pdpAddressV := addr |
| 2321 | }, |
| 2322 | accessPointName := ts_ApnTLV(apn), |
| 2323 | protocolConfigOpts := ts_PcoTLV(pco), |
| 2324 | requestType := omit, |
| 2325 | deviceProperties := omit, |
| 2326 | nBIFOM_Container := omit |
| 2327 | } |
| 2328 | } |
| 2329 | } |
| 2330 | } |
| 2331 | |
| 2332 | template PDU_L3_SGSN_MS tr_SM_ACT_PDP_REJ(template BIT3 tid := ?, template OCT1 cause := ?) := { |
| 2333 | discriminator := '1010'B, |
| 2334 | tiOrSkip := { |
| 2335 | transactionId := { |
| 2336 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2337 | tiFlag := c_TIF_REPL, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2338 | tIExtension := omit |
| 2339 | } |
| 2340 | }, |
| 2341 | msgs := { |
| 2342 | gprs_sm := { |
| 2343 | activatePDPContextReject := { |
Harald Welte | 4aacdd8 | 2018-02-18 21:24:05 +0100 | [diff] [blame] | 2344 | messageType := '01000011'B, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2345 | smCause := cause, |
| 2346 | protocolConfigOpts := *, |
| 2347 | backOffTimer := *, |
| 2348 | reAttemptIndicator := *, |
| 2349 | nBIFOM_Container := * |
| 2350 | } |
| 2351 | } |
| 2352 | } |
| 2353 | } |
| 2354 | |
| 2355 | template PDU_L3_SGSN_MS tr_SM_ACT_PDP_ACCEPT(template BIT3 tid := ?, template BIT4 sapi := ?, |
| 2356 | template QoSV qos := ?) |
| 2357 | := { |
| 2358 | discriminator := '1010'B, |
| 2359 | tiOrSkip := { |
| 2360 | transactionId := { |
| 2361 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2362 | tiFlag := c_TIF_REPL, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2363 | tIExtension := omit |
| 2364 | } |
| 2365 | }, |
| 2366 | msgs := { |
| 2367 | gprs_sm := { |
| 2368 | activatePDPContextAccept := { |
| 2369 | messageType := '01000010'B, |
| 2370 | negotiatedLLCSAPI := { sapi, '0000'B }, |
| 2371 | negotiatedQoS := { |
| 2372 | lengthIndicator := ?, |
| 2373 | qoSV := qos |
| 2374 | }, |
| 2375 | radioPriority := ?, |
| 2376 | spare := '0000'B, |
| 2377 | pdpAddress := *, |
| 2378 | protocolConfigOpts := *, |
| 2379 | packetFlowID := *, |
| 2380 | sMCause2 := *, |
| 2381 | connectivityType := *, |
| 2382 | wLANOffloadIndication := *, |
| 2383 | nBIFOM_Container := * |
| 2384 | } |
| 2385 | } |
| 2386 | } |
| 2387 | } |
| 2388 | |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2389 | template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, |
| 2390 | template (omit) boolean tdown := omit, |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2391 | template (omit) ProtocolConfigOptionsV pco := omit |
| 2392 | ) := { |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2393 | discriminator := '1010'B, |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2394 | tiOrSkip := { |
| 2395 | transactionId := { |
| 2396 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2397 | tiFlag := c_TIF_ORIG, |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2398 | tIExtension := omit |
| 2399 | } |
| 2400 | }, |
| 2401 | msgs := { |
| 2402 | gprs_sm := { |
| 2403 | deactivatePDPContextRequest := { |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2404 | messageType := '01000110'B, |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2405 | smCause := cause, |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2406 | tearDownIndicator := ts_TearDownIndicatorTV(tdown), |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2407 | protocolConfigOpts := ts_PcoTLV(pco), |
| 2408 | mBMSprotocolConfigOptions := omit, |
| 2409 | t3396 := omit, |
| 2410 | wLANOffloadIndication := omit, |
| 2411 | nBIFOM_Container := omit |
| 2412 | } |
| 2413 | } |
| 2414 | } |
| 2415 | } |
| 2416 | |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2417 | template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, |
| 2418 | template (omit) boolean tdown := omit, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2419 | template (omit) ProtocolConfigOptionsV pco := omit |
| 2420 | ) := { |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2421 | discriminator := '1010'B, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2422 | tiOrSkip := { |
| 2423 | transactionId := { |
| 2424 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2425 | tiFlag := c_TIF_REPL, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2426 | tIExtension := omit |
| 2427 | } |
| 2428 | }, |
| 2429 | msgs := { |
| 2430 | gprs_sm := { |
| 2431 | deactivatePDPContextRequest := { |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2432 | messageType := '01000110'B, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2433 | smCause := cause, |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2434 | tearDownIndicator := ts_TearDownIndicatorTV(tdown), |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2435 | protocolConfigOpts := ts_PcoTLV(pco), |
| 2436 | mBMSprotocolConfigOptions := omit, |
| 2437 | t3396 := omit, |
| 2438 | wLANOffloadIndication := omit, |
| 2439 | nBIFOM_Container := omit |
| 2440 | } |
| 2441 | } |
| 2442 | } |
| 2443 | } |
| 2444 | |
| 2445 | template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause, |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2446 | template (omit) boolean tdown := omit, |
| 2447 | template (omit) ProtocolConfigOptionsV pco := omit |
| 2448 | ) := { |
| 2449 | discriminator := '1010'B, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2450 | tiOrSkip := { |
| 2451 | transactionId := { |
| 2452 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2453 | tiFlag := c_TIF_REPL, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2454 | tIExtension := omit |
| 2455 | } |
| 2456 | }, |
| 2457 | msgs := { |
| 2458 | gprs_sm := { |
| 2459 | deactivatePDPContextRequest := { |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2460 | messageType := '01000110'B, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2461 | smCause := cause, |
Pau Espin Pedrol | 67e47dd | 2018-07-13 15:07:43 +0200 | [diff] [blame] | 2462 | tearDownIndicator := ts_TearDownIndicatorTV(tdown), |
| 2463 | protocolConfigOpts := ts_PcoTLV(pco), |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2464 | mBMSprotocolConfigOptions := *, |
| 2465 | t3396 := *, |
| 2466 | wLANOffloadIndication := *, |
| 2467 | nBIFOM_Container := * |
| 2468 | } |
| 2469 | } |
| 2470 | } |
| 2471 | } |
| 2472 | |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2473 | template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?) |
| 2474 | := { |
| 2475 | discriminator := '1010'B, |
| 2476 | tiOrSkip := { |
| 2477 | transactionId := { |
| 2478 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2479 | tiFlag := c_TIF_REPL, |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 2480 | tIExtension := omit |
| 2481 | } |
| 2482 | }, |
| 2483 | msgs := { |
| 2484 | gprs_sm := { |
| 2485 | deactivatePDPContextAccept := { |
| 2486 | messageType := '01000111'B, |
| 2487 | protocolConfigOpts := *, |
| 2488 | mBMSprotocolConfigOptions := *, |
| 2489 | nBIFOM_Container := * |
| 2490 | } |
| 2491 | } |
| 2492 | } |
| 2493 | } |
| 2494 | |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2495 | template PDU_L3_MS_SGSN tr_SM_DEACT_PDP_ACCEPT_MO(template BIT3 tid := ?) |
| 2496 | := { |
| 2497 | discriminator := '1010'B, |
| 2498 | tiOrSkip := { |
| 2499 | transactionId := { |
| 2500 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2501 | tiFlag := c_TIF_ORIG, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2502 | tIExtension := omit |
| 2503 | } |
| 2504 | }, |
| 2505 | msgs := { |
| 2506 | gprs_sm := { |
| 2507 | deactivatePDPContextAccept := { |
| 2508 | messageType := '01000111'B, |
| 2509 | protocolConfigOpts := *, |
| 2510 | mBMSprotocolConfigOptions := *, |
| 2511 | nBIFOM_Container := * |
| 2512 | } |
| 2513 | } |
| 2514 | } |
| 2515 | } |
| 2516 | |
| 2517 | template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_ACCEPT_MO(BIT3 tid) |
| 2518 | := { |
| 2519 | discriminator := '1010'B, |
| 2520 | tiOrSkip := { |
| 2521 | transactionId := { |
| 2522 | tio := tid, |
Harald Welte | 51affb6 | 2018-04-09 14:17:45 +0200 | [diff] [blame] | 2523 | tiFlag := c_TIF_ORIG, |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 2524 | tIExtension := omit |
| 2525 | } |
| 2526 | }, |
| 2527 | msgs := { |
| 2528 | gprs_sm := { |
| 2529 | deactivatePDPContextAccept := { |
| 2530 | messageType := '01000111'B, |
| 2531 | protocolConfigOpts := omit, |
| 2532 | mBMSprotocolConfigOptions := omit, |
| 2533 | nBIFOM_Container := omit |
| 2534 | } |
| 2535 | } |
| 2536 | } |
| 2537 | } |
| 2538 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 2539 | |
| 2540 | |
Harald Welte | e5695f5 | 2018-02-16 14:46:15 +0100 | [diff] [blame] | 2541 | private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { |
| 2542 | var integer suffix_len := tot_len - lengthof(prefix); |
| 2543 | var charstring suffix_ch := int2str(suffix); |
| 2544 | var integer pad_len := suffix_len - lengthof(suffix_ch); |
| 2545 | |
| 2546 | return prefix & int2hex(0, pad_len) & str2hex(suffix_ch); |
| 2547 | } |
| 2548 | |
| 2549 | function f_gen_imei(integer suffix) return hexstring { |
| 2550 | return f_concat_pad(15, '49999'H, suffix); |
| 2551 | } |
| 2552 | |
| 2553 | function f_gen_imsi(integer suffix) return hexstring { |
| 2554 | return f_concat_pad(15, '26242'H, suffix); |
| 2555 | } |
| 2556 | |
| 2557 | function f_gen_msisdn(integer suffix) return hexstring { |
| 2558 | return f_concat_pad(12, '49123'H, suffix); |
| 2559 | } |
| 2560 | |
Harald Welte | 7484fc4 | 2018-02-24 14:09:45 +0100 | [diff] [blame] | 2561 | external function enc_MobileIdentityLV(in MobileIdentityLV si) return octetstring |
| 2562 | with { extension "prototype(convert) encode(RAW)" }; |
Harald Welte | e5695f5 | 2018-02-16 14:46:15 +0100 | [diff] [blame] | 2563 | |
Harald Welte | cb6cc33 | 2018-01-21 13:59:08 +0100 | [diff] [blame] | 2564 | |
Harald Welte | f45efeb | 2018-04-09 18:19:24 +0200 | [diff] [blame] | 2565 | |
| 2566 | /* SMS TPDU Layer */ |
| 2567 | |
| 2568 | template (value) TPDU_RP_DATA_MS_SGSN ts_SMS_SUBMIT(OCT1 msg_ref, template (value) TP_DA dst_addr, |
| 2569 | template (value) OCT1 pid, template (value) OCT1 dcs, |
| 2570 | integer length_ind, octetstring user_data) := { |
| 2571 | sMS_SUBMIT := { |
| 2572 | tP_MTI := '01'B, /* SUBMIT */ |
| 2573 | tP_RD := '1'B, /* reject duplicates */ |
| 2574 | tP_VPF := '00'B, /* not present */ |
| 2575 | tP_SRR := '0'B, /* no status report requested */ |
| 2576 | tP_UDHI := '0'B, /* no user data header in UD */ |
| 2577 | tP_RP := '0'B, /* no reply path */ |
| 2578 | tP_MR := msg_ref, |
| 2579 | tP_DA := dst_addr, |
| 2580 | tP_PID := pid, |
| 2581 | tP_DCS := dcs, |
| 2582 | tP_VP := omit, |
| 2583 | tP_UDL_UD := { |
| 2584 | tP_LengthIndicator := length_ind, |
| 2585 | tP_UD := user_data |
| 2586 | } |
| 2587 | } |
| 2588 | } |
| 2589 | |
| 2590 | template TPDU_RP_DATA_SGSN_MS tr_SMS_DELIVER(template TP_OA src_addr := ?, |
| 2591 | template octetstring user_data := ?, |
| 2592 | template OCT1 pid := ?, template OCT1 dcs := ?, |
| 2593 | template BIT1 mms := ? |
| 2594 | ) := { |
| 2595 | sMS_DELIVER := { |
| 2596 | tP_MTI := '00'B, /* DELIVER */ |
| 2597 | tP_MMS := mms, /* more messages to send */ |
| 2598 | tP_LP := ?, /* ?!? */ |
| 2599 | tP_Spare := '0'B, |
| 2600 | tP_SRI := '0'B, /* status report indication */ |
| 2601 | tP_UDHI := '0'B, /* no user data header in UD */ |
| 2602 | tP_RP := '0'B, /* no reply path */ |
| 2603 | tP_OA := src_addr, |
| 2604 | tP_PID := pid, |
| 2605 | tP_DCS := dcs, |
| 2606 | tP_SCTS := ?, |
| 2607 | tP_UDL_UD := { |
| 2608 | tP_LengthIndicator := ?, |
| 2609 | tP_UD := user_data |
| 2610 | } |
| 2611 | } |
| 2612 | } |
| 2613 | |
| 2614 | /* RP Layer */ |
| 2615 | |
| 2616 | private function ts_RpOrig(template (omit) RP_NumberingPlan_and_NumberDigits rp_orig) |
| 2617 | return RP_OriginatorAddressLV { |
| 2618 | var RP_OriginatorAddressLV ret; |
| 2619 | if (istemplatekind(rp_orig, "omit")) { |
| 2620 | ret := { 0, omit }; |
| 2621 | } else { |
| 2622 | ret := { 0, valueof(rp_orig) }; |
| 2623 | } |
| 2624 | return ret; |
| 2625 | } |
| 2626 | |
| 2627 | private function ts_RpDst(template (omit) RP_NumberingPlan_and_NumberDigits rp_dst) |
| 2628 | return RP_DestinationAddressLV { |
| 2629 | var RP_DestinationAddressLV ret; |
| 2630 | if (istemplatekind(rp_dst, "omit")) { |
| 2631 | ret := { 0, omit }; |
| 2632 | } else { |
| 2633 | ret := { 0, valueof(rp_dst) }; |
| 2634 | } |
| 2635 | return ret; |
| 2636 | } |
| 2637 | |
| 2638 | template (value) RPDU_MS_SGSN ts_RP_DATA_MO(OCT1 msg_ref, |
| 2639 | template (omit) RP_NumberingPlan_and_NumberDigits rp_orig, |
| 2640 | template (omit) RP_NumberingPlan_and_NumberDigits rp_dst, |
| 2641 | template (value) TPDU_RP_DATA_MS_SGSN tpdu) := { |
| 2642 | rP_DATA_MS_SGSN := { |
| 2643 | rP_MTI := '000'B, |
| 2644 | rP_Spare := '00000'B, |
| 2645 | rP_MessageReference := msg_ref, |
| 2646 | rP_OriginatorAddress := ts_RpOrig(rp_orig), |
| 2647 | rP_DestinationAddress := ts_RpDst(rp_dst), |
| 2648 | rP_User_Data := { |
| 2649 | rP_LengthIndicator := 0, /* overwritten */ |
| 2650 | rP_TPDU := tpdu |
| 2651 | } |
| 2652 | } |
| 2653 | } |
| 2654 | |
| 2655 | template RPDU_SGSN_MS tr_RP_DATA_MT(template OCT1 msg_ref, |
| 2656 | template RP_NumberingPlan_and_NumberDigits rp_orig, |
| 2657 | template RP_NumberingPlan_and_NumberDigits rp_dst, |
| 2658 | template TPDU_RP_DATA_SGSN_MS tpdu) := { |
| 2659 | rP_DATA_SGSN_MS := { |
| 2660 | rP_MTI := '001'B, |
| 2661 | rP_Spare := '00000'B, |
| 2662 | rP_MessageReference := msg_ref, |
| 2663 | rP_OriginatorAddress := { ?, rp_orig }, |
| 2664 | rP_DestinationAddress := { ?, rp_dst }, |
| 2665 | rP_User_Data := { |
| 2666 | rP_LengthIndicator := ?, |
| 2667 | rP_TPDU := tpdu |
| 2668 | } |
| 2669 | |
| 2670 | } |
| 2671 | } |
| 2672 | |
| 2673 | template (value) RPDU_MS_SGSN ts_RP_ACK_MO(OCT1 msg_ref) := { |
| 2674 | rP_ACK_MS_SGSN := { |
| 2675 | rP_MTI := '010'B, |
| 2676 | rP_Spare := '00000'B, |
| 2677 | rP_MessageReference := msg_ref, |
| 2678 | rP_User_Data := omit /* FIXME: report */ |
| 2679 | } |
| 2680 | } |
| 2681 | |
| 2682 | template RPDU_SGSN_MS tr_RP_ACK_MT(template OCT1 msg_ref) := { |
| 2683 | rP_ACK_SGSN_MS := { |
| 2684 | rP_MTI := '011'B, |
| 2685 | rP_Spare := '00000'B, |
| 2686 | rP_MessageReference := msg_ref, |
| 2687 | rP_User_Data := omit /* FIXME: report */ |
| 2688 | } |
| 2689 | } |
| 2690 | |
| 2691 | template (value) RPDU_MS_SGSN ts_RP_ERROR_MO(OCT1 msg_ref, uint7_t cause) := { |
| 2692 | rP_ERROR_MS_SGSN := { |
| 2693 | rP_MTI := '100'B, |
| 2694 | rP_Spare := '00000'B, |
| 2695 | rP_Message_Reference := msg_ref, |
| 2696 | rP_CauseLV := { |
| 2697 | rP_LengthIndicator := 0, /* overwritten */ |
| 2698 | rP_CauseV := { |
| 2699 | causeValue := int2bit(cause, 7), |
| 2700 | ext := '0'B |
| 2701 | }, |
| 2702 | rP_diagnisticField := omit |
| 2703 | }, |
| 2704 | rP_User_Data := omit /* FIXME: report */ |
| 2705 | } |
| 2706 | } |
| 2707 | |
| 2708 | private function f_cause_or_wc(template uint7_t cause) return template BIT7 { |
| 2709 | if (istemplatekind(cause, "?")) { |
| 2710 | return ?; |
| 2711 | } else if (istemplatekind(cause, "*")) { |
| 2712 | return *; |
| 2713 | } else { |
| 2714 | return int2bit(valueof(cause), 7); |
| 2715 | } |
| 2716 | } |
| 2717 | |
| 2718 | template RPDU_SGSN_MS tr_RP_ERROR_MT(template OCT1 msg_ref, template uint7_t cause) := { |
| 2719 | rP_ERROR_SGSN_MS := { |
| 2720 | rP_MTI := '101'B, |
| 2721 | rP_Spare := '00000'B, |
| 2722 | rP_Message_Reference := msg_ref, |
| 2723 | rP_CauseLV := { |
| 2724 | rP_LengthIndicator := 0, /* overwritten */ |
| 2725 | rP_CauseV := { |
| 2726 | causeValue := f_cause_or_wc(cause), |
| 2727 | ext := '0'B |
| 2728 | }, |
| 2729 | rP_diagnisticField := omit |
| 2730 | }, |
| 2731 | rP_User_Data := omit /* FIXME: report */ |
| 2732 | } |
| 2733 | } |
| 2734 | |
| 2735 | |
| 2736 | template (value) RPDU_MS_SGSN ts_RP_SMMA_MO(OCT1 msg_ref) := { |
| 2737 | rP_SMMA := { |
| 2738 | rP_MTI := '110'B, |
| 2739 | rP_Spare := '00000'B, |
| 2740 | rP_MessageReference := msg_ref |
| 2741 | } |
| 2742 | } |
| 2743 | |
| 2744 | |
| 2745 | |
| 2746 | |
| 2747 | /* CP Layer */ |
| 2748 | |
| 2749 | template (value) L3_SMS_MS_SGSN ts_CP_DATA_MO(template (value) RPDU_MS_SGSN rpdu) := { |
| 2750 | cP_DATA := { |
| 2751 | cP_messageType := '00000001'B, |
| 2752 | cP_User_Data := { |
| 2753 | lengthIndicator := 0, /* overwritten */ |
| 2754 | cP_RPDU := rpdu |
| 2755 | } |
| 2756 | } |
| 2757 | } |
| 2758 | |
| 2759 | template (value) L3_SMS_MS_SGSN ts_CP_ACK_MO := { |
| 2760 | cP_ACK := { |
| 2761 | cP_messageType := '00000100'B |
| 2762 | } |
| 2763 | } |
| 2764 | |
| 2765 | template (value) L3_SMS_MS_SGSN ts_CP_ERROR_MO(OCT1 cause) := { |
| 2766 | cP_ERROR := { |
| 2767 | cP_messageType := '00010000'B, |
| 2768 | cP_Cause := { |
| 2769 | causeValue := cause |
| 2770 | } |
| 2771 | } |
| 2772 | } |
| 2773 | |
| 2774 | template L3_SMS_SGSN_MS tr_CP_DATA_MT(template RPDU_SGSN_MS rpdu) := { |
| 2775 | cP_DATA := { |
| 2776 | cP_messageType := '00000001'B, |
| 2777 | cP_User_Data := { |
| 2778 | lengthIndicator := ?, |
| 2779 | cP_RPDU := rpdu |
| 2780 | } |
| 2781 | } |
| 2782 | } |
| 2783 | |
| 2784 | template L3_SMS_SGSN_MS tr_CP_ACK_MT := { |
| 2785 | cP_ACK := { |
| 2786 | cP_messageType := '00000100'B |
| 2787 | } |
| 2788 | } |
| 2789 | |
| 2790 | template L3_SMS_SGSN_MS tr_CP_ERROR_MT(template OCT1 cause) := { |
| 2791 | cP_ERROR := { |
| 2792 | cP_messageType := '00010000'B, |
| 2793 | cP_Cause := { |
| 2794 | causeValue := cause |
| 2795 | } |
| 2796 | } |
| 2797 | } |
| 2798 | |
| 2799 | /* L3 Wrapper */ |
| 2800 | |
| 2801 | template (value) PDU_ML3_MS_NW ts_ML3_MO_SMS(uint3_t tid, BIT1 ti_flag, |
| 2802 | template (value) L3_SMS_MS_SGSN sms_mo) := { |
| 2803 | discriminator := '1001'B, |
| 2804 | tiOrSkip := { |
| 2805 | transactionId := { |
| 2806 | tio := int2bit(tid, 3), |
| 2807 | tiFlag := ti_flag, |
| 2808 | tIExtension := omit |
| 2809 | } |
| 2810 | }, |
| 2811 | msgs := { |
| 2812 | sms := sms_mo |
| 2813 | } |
| 2814 | } |
| 2815 | |
| 2816 | private function f_tid_or_wc(template uint3_t tid) return template BIT3 { |
| 2817 | var template BIT3 ret; |
| 2818 | if (istemplatekind(tid, "*")) { |
| 2819 | return *; |
| 2820 | } else if (istemplatekind(tid, "?")) { |
| 2821 | return ?; |
| 2822 | } else { |
| 2823 | return int2bit(valueof(tid), 3); |
| 2824 | } |
| 2825 | } |
| 2826 | |
| 2827 | template PDU_ML3_NW_MS tr_ML3_MT_SMS(template uint3_t tid, template BIT1 ti_flag, |
| 2828 | template L3_SMS_SGSN_MS sms_mt) := { |
| 2829 | discriminator := '1001'B, |
| 2830 | tiOrSkip := { |
| 2831 | transactionId := { |
| 2832 | tio := f_tid_or_wc(tid), |
| 2833 | tiFlag := ti_flag, |
| 2834 | tIExtension := omit |
| 2835 | } |
| 2836 | }, |
| 2837 | msgs := { |
| 2838 | sms := sms_mt |
| 2839 | } |
| 2840 | } |
| 2841 | |
| 2842 | |
| 2843 | |
| 2844 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 2845 | } |