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