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