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