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