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