Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 1 | module SGsAP_Templates { |
| 2 | |
| 3 | /* Templates for the SGsAP protocol as per 3GPP TS 29.118 |
| 4 | * (C) 2018 by Harald Welte <laforg@gnumonks.org> |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Released under the terms of the GNU General Public License, Version 2 or |
| 8 | * (at your option) any later version. |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 9 | * |
| 10 | * SPDX-License-Identifier: GPL-2.0-or-later |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | import from SGsAP_Types all; |
| 14 | import from GSM_Types all; |
| 15 | import from General_Types all; |
Pau Espin Pedrol | 3768a6f | 2021-04-28 14:24:23 +0200 | [diff] [blame] | 16 | import from Osmocom_Types all; |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 17 | import from MobileL3_CommonIE_Types all; |
| 18 | |
| 19 | /* 9.4.2 */ |
| 20 | template (value) EPS_LocationUpdateType ts_SGsAP_IE_EpsLuType(template (value) EPS_location_update_type lut) := { |
| 21 | iEI := '00001010'B, |
| 22 | lengthIndicator := 1, |
| 23 | locationUpdateType := lut |
| 24 | } |
| 25 | template EPS_LocationUpdateType tr_SGsAP_IE_EpsLuType(template EPS_location_update_type lut) := { |
| 26 | iEI := '00001010'B, |
| 27 | lengthIndicator := 1, |
| 28 | locationUpdateType := lut |
| 29 | } |
| 30 | |
| 31 | /* 9.4.3 */ |
| 32 | template (value) ErroneousMessage ts_SGsAP_IE_ErrMsg(template (value) octetstring err_msg) := { |
| 33 | iEI := '00011011'B, |
| 34 | lengthIndicator := lengthof(valueof(err_msg)), |
| 35 | erroneousMessage := err_msg |
| 36 | } |
| 37 | template ErroneousMessage tr_SGsAP_IE_ErrMsg(template octetstring err_msg) := { |
| 38 | iEI := '00011011'B, |
| 39 | lengthIndicator := ?, |
| 40 | erroneousMessage := err_msg |
| 41 | } |
| 42 | |
| 43 | |
| 44 | /* 9.4.6 */ |
| 45 | private function ts_SGsAP_IMSI(hexstring digits) return template (value) IMSI { |
| 46 | var template (value) IMSI imsi := { |
| 47 | iEI := '00000001'B, |
| 48 | lengthIndicator := lengthof(digits)/2 + 1, |
| 49 | iMSI := { |
| 50 | field1 := '001'B, |
| 51 | parity := '0'B, /* even */ |
| 52 | digits := digits, |
| 53 | fillerDigit := '1111'B /* even */ |
| 54 | } |
| 55 | } |
| 56 | if (lengthof(digits) mod 2 == 1) { |
| 57 | /* odd number of digits */ |
| 58 | imsi.iMSI.parity := '1'B; |
| 59 | imsi.iMSI.fillerDigit := omit; |
| 60 | } |
| 61 | return imsi; |
| 62 | } |
| 63 | private function ts_SGsAP_IMSI_omit(template (omit) hexstring digits) return template (omit) IMSI { |
| 64 | if (istemplatekind(digits, "omit")) { |
| 65 | return omit; |
| 66 | } else { |
| 67 | return ts_SGsAP_IMSI(valueof(digits)); |
| 68 | } |
| 69 | } |
| 70 | private function tr_SGsAP_IMSI(template hexstring digits) return template IMSI { |
| 71 | if (istemplatekind(digits, "omit")) { |
| 72 | return omit; |
| 73 | } else if (istemplatekind(digits, "*")) { |
| 74 | return *; |
Harald Welte | 4263c52 | 2018-12-06 11:56:27 +0100 | [diff] [blame] | 75 | } else if (istemplatekind(digits, "?")) { |
| 76 | return ?; |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 77 | } |
Harald Welte | 4263c52 | 2018-12-06 11:56:27 +0100 | [diff] [blame] | 78 | log("tr_SGsAP_IMSI: ", digits); |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 79 | var template IMSI imsi := { |
| 80 | iEI := '00000001'B, |
| 81 | lengthIndicator := lengthof(digits)/2 + 1, |
| 82 | iMSI := { |
| 83 | field1 := '001'B, |
| 84 | parity := '0'B, /* even */ |
| 85 | digits := digits, |
| 86 | fillerDigit := '1111'B /* even */ |
| 87 | } |
| 88 | } |
| 89 | if (lengthof(digits) mod 2 == 1) { |
| 90 | /* odd number of digits */ |
| 91 | /* odd number of digits */ |
| 92 | imsi.iMSI.parity := '1'B; |
| 93 | imsi.iMSI.fillerDigit := omit; |
| 94 | } |
| 95 | return imsi; |
| 96 | } |
| 97 | |
| 98 | /* 9.4.7 */ |
| 99 | template (value) IMSI_DetachFromEPS_ServiceType ts_SGsAP_IE_DetServiceType(template (value) IMSI_detachFromEPS_serviceType st) := { |
| 100 | iEI := '00010000'B, |
| 101 | lengthIndicator := 1, |
| 102 | serviceType := st |
| 103 | } |
| 104 | template IMSI_DetachFromEPS_ServiceType tr_SGsAP_IE_DetServiceType(template IMSI_detachFromEPS_serviceType st) := { |
| 105 | iEI := '00010000'B, |
| 106 | lengthIndicator := 1, |
| 107 | serviceType := st |
| 108 | } |
| 109 | |
| 110 | /* 9.4.8 */ |
| 111 | template (value) IMSI_DetachFromNonEPS_ServiceType ts_SGsAP_IE_DetNonEpsServiceType(template (value) IMSI_detachFromNonEPS_serviceType st) := { |
| 112 | iEI := '00010001'B, |
| 113 | lengthIndicator := 1, |
| 114 | serviceType := st |
| 115 | } |
| 116 | template IMSI_DetachFromNonEPS_ServiceType tr_SGsAP_IE_DetNonEpsServiceType(template IMSI_detachFromNonEPS_serviceType st) := { |
| 117 | iEI := '00010001'B, |
| 118 | lengthIndicator := 1, |
| 119 | serviceType := st |
| 120 | } |
| 121 | |
| 122 | /* 9.4.11 */ |
| 123 | private function f_enc_mnc_digit3(GsmMnc mnc) return HEX1 { |
| 124 | if (lengthof(mnc) == 2) { |
| 125 | return 'F'H; |
| 126 | } else { |
| 127 | return mnc[2]; |
| 128 | } |
| 129 | } |
| 130 | template (value) LocationAreaIdValue ts_SGsAP_LAI(GsmMcc mcc, GsmMnc mnc, GsmLac lac) := { |
| 131 | mccDigit1 := mcc[0], |
| 132 | mccDigit2 := mcc[1], |
| 133 | mccDigit3 := mcc[2], |
| 134 | mncDigit3 := f_enc_mnc_digit3(mnc), |
| 135 | mncDigit1 := mnc[0], |
| 136 | mncDigit2 := mnc[1], |
| 137 | lac := int2oct(lac, 2) |
| 138 | } |
| 139 | template (value) LocationAreaId ts_SGsAP_IE_Lai(template (value) LocationAreaIdValue lai) := { |
| 140 | iEI := '00000100'B, |
| 141 | lengthIndicator := 5, |
| 142 | locationAreaId := lai |
| 143 | } |
| 144 | template LocationAreaId tr_SGsAP_IE_Lai(template LocationAreaIdValue lai) := { |
| 145 | iEI := '00000100'B, |
| 146 | lengthIndicator := 5, |
| 147 | locationAreaId := lai |
| 148 | } |
| 149 | function ts_SGsAP_IE_Lai_omit(template (omit) LocationAreaIdValue lai) return template (omit) LocationAreaId { |
| 150 | if (istemplatekind(lai, "omit")) { |
| 151 | return omit; |
| 152 | } else { |
| 153 | return ts_SGsAP_IE_Lai(lai); |
| 154 | } |
| 155 | } |
| 156 | function tr_SGsAP_IE_Lai_omit(template LocationAreaIdValue lai) return template LocationAreaId { |
| 157 | if (istemplatekind(lai, "omit")) { |
| 158 | return omit; |
| 159 | } else if (istemplatekind(lai, "*")) { |
| 160 | return *; |
| 161 | } else { |
| 162 | return tr_SGsAP_IE_Lai(lai); |
| 163 | } |
| 164 | } |
| 165 | |
Pau Espin Pedrol | 3768a6f | 2021-04-28 14:24:23 +0200 | [diff] [blame] | 166 | /* 9.4.21a */ |
| 167 | template (value) TrackingAreaIdentityValue ts_SGsAP_TAI(GsmMcc mcc, GsmMnc mnc, uint16_t tac) := { |
| 168 | mccDigit1 := mcc[0], |
| 169 | mccDigit2 := mcc[1], |
| 170 | mccDigit3 := mcc[2], |
| 171 | mncDigit3 := f_enc_mnc_digit3(mnc), |
| 172 | mncDigit1 := mnc[0], |
| 173 | mncDigit2 := mnc[1], |
| 174 | tAC := int2oct(tac, 2) |
| 175 | } |
| 176 | template (value) TrackingAreaIdentity ts_SGsAP_IE_TAI(template (value) TrackingAreaIdentityValue tai) := { |
| 177 | iEI := '00100011'B, |
| 178 | lengthIndicator := 5, |
| 179 | iD := tai |
| 180 | } |
| 181 | function ts_SGsAP_IE_TAI_omit(template (omit) TrackingAreaIdentityValue tai) |
| 182 | return template (omit) TrackingAreaIdentity { |
| 183 | if (istemplatekind(tai, "omit")) { |
| 184 | return omit; |
| 185 | } else { |
| 186 | return ts_SGsAP_IE_TAI(tai); |
| 187 | } |
| 188 | } |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 189 | |
| 190 | |
| 191 | /* 9.4.12 */ |
| 192 | template (value) MM_Information ts_SGsAP_IE_MmInfo(template (value) octetstring mm_info) := { |
| 193 | iEI := '00010111'B, |
| 194 | lengthIndicator := lengthof(valueof(mm_info)), |
| 195 | information := mm_info |
| 196 | } |
| 197 | template MM_Information tr_SGsAP_IE_MmInfo(template octetstring mm_info) := { |
| 198 | iEI := '00010111'B, |
| 199 | lengthIndicator := ?, |
| 200 | information := mm_info |
| 201 | } |
| 202 | |
| 203 | |
| 204 | |
| 205 | /* 9.4.13 */ |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 206 | template (value) MME_Name ts_SGsAP_IE_MmeName(template (value) octetstring name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 207 | iEI := '00001001'B, |
| 208 | lengthIndicator := lengthof(valueof(name)), |
| 209 | name := name |
| 210 | }; |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 211 | template MME_Name tr_SGsAP_IE_MmeName(template octetstring name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 212 | iEI := '00001001'B, |
| 213 | lengthIndicator := ?, |
| 214 | name := name |
| 215 | }; |
| 216 | |
| 217 | /* 9.4.14 */ |
| 218 | function f_l3_to_sgs_id(MobileIdentityLV l3) return MobileIdentityValue { |
| 219 | var OddEvenInd_Identity l3v := l3.mobileIdentityV.oddEvenInd_identity; |
| 220 | var MobileIdentityValue ret; |
| 221 | ret.typeOfIdentity := l3.mobileIdentityV.typeOfIdentity; |
| 222 | if (ischosen(l3v.imei)) { |
| 223 | ret.iD.imei.oddevenIndicator := l3v.imei.oddevenIndicator; |
| 224 | ret.iD.imei.digits := l3v.imei.digits; |
| 225 | } else if (ischosen(l3v.imsi)) { |
| 226 | ret.iD.imsi.oddevenIndicator := l3v.imsi.oddevenIndicator; |
| 227 | ret.iD.imsi.digits := l3v.imsi.digits; |
| 228 | ret.iD.imsi.fillerDigit := l3v.imsi.fillerDigit; |
| 229 | } else if (ischosen(l3v.imei_sv)) { |
| 230 | ret.iD.imei_sv.oddevenIndicator := l3v.imei_sv.oddevenIndicator; |
| 231 | ret.iD.imei_sv.digits := l3v.imei_sv.digits; |
| 232 | ret.iD.imei_sv.fillerDigit := l3v.imei_sv.fillerDigit; |
| 233 | } else if (ischosen(l3v.tmsi_ptmsi)) { |
| 234 | ret.iD.tmsi_ptmsi.oddevenIndicator := l3v.tmsi_ptmsi.oddevenIndicator; |
| 235 | ret.iD.tmsi_ptmsi.fillerDigit := l3v.tmsi_ptmsi.fillerDigit; |
| 236 | ret.iD.tmsi_ptmsi.octets := l3v.tmsi_ptmsi.octets; |
| 237 | } else if (ischosen(l3v.tmgi_and_MBMS_SessionID)) { |
| 238 | ret.iD.tmgi_and_MBMS_SessionID.oddevenIndicator := l3v.tmgi_and_MBMS_SessionID.oddevenIndicator; |
| 239 | ret.iD.tmgi_and_MBMS_SessionID.mCC_MNCIndicator := l3v.tmgi_and_MBMS_SessionID.mCC_MNCIndicator; |
| 240 | ret.iD.tmgi_and_MBMS_SessionID.mBMS_SessionIdentityIndicator := l3v.tmgi_and_MBMS_SessionID.mBMS_SessionIdentityIndicator; |
| 241 | ret.iD.tmgi_and_MBMS_SessionID.spare := l3v.tmgi_and_MBMS_SessionID.spare; |
| 242 | ret.iD.tmgi_and_MBMS_SessionID.mBMS_ServiceID := l3v.tmgi_and_MBMS_SessionID.mBMS_ServiceID; |
| 243 | ret.iD.tmgi_and_MBMS_SessionID.mccDigit1 := l3v.tmgi_and_MBMS_SessionID.mccDigit1; |
| 244 | ret.iD.tmgi_and_MBMS_SessionID.mccDigit2 := l3v.tmgi_and_MBMS_SessionID.mccDigit2; |
| 245 | ret.iD.tmgi_and_MBMS_SessionID.mccDigit3 := l3v.tmgi_and_MBMS_SessionID.mccDigit3; |
| 246 | ret.iD.tmgi_and_MBMS_SessionID.mccDigit3 := l3v.tmgi_and_MBMS_SessionID.mccDigit3; |
| 247 | ret.iD.tmgi_and_MBMS_SessionID.mccDigit1 := l3v.tmgi_and_MBMS_SessionID.mccDigit1; |
| 248 | ret.iD.tmgi_and_MBMS_SessionID.mccDigit2 := l3v.tmgi_and_MBMS_SessionID.mccDigit2; |
| 249 | ret.iD.tmgi_and_MBMS_SessionID.mBMS_SessionIdentity := l3v.tmgi_and_MBMS_SessionID.mBMS_SessionIdentity; |
| 250 | } else if (ischosen(l3v.no_identity)) { |
| 251 | ret.iD.no_identity.oddevenIndicator := l3v.no_identity.oddevenIndicator; |
| 252 | ret.iD.no_identity.fillerDigits := l3v.no_identity.fillerDigits; |
| 253 | } |
| 254 | return ret; |
| 255 | } |
| 256 | template MobileIdentity ts_SGsAP_IE_MobileID(template (value) MobileIdentityLV l3_mi) := { |
| 257 | iEI := '00001110'B, |
| 258 | lengthIndicator := 0, /* overwritten */ |
| 259 | iD := f_l3_to_sgs_id(valueof(l3_mi)) |
| 260 | } |
| 261 | |
| 262 | |
| 263 | /* 9.4.15 */ |
| 264 | template (value) NAS_MessageContainer ts_SGsAP_NasContainer(template (value) octetstring nas_pdu) := { |
| 265 | iEI := '00010110'B, |
| 266 | lengthIndicator := lengthof(valueof(nas_pdu)), |
| 267 | nAS_MessageContainer := nas_pdu |
| 268 | } |
| 269 | template NAS_MessageContainer tr_SGsAP_NasContainer(template octetstring nas_pdu) := { |
| 270 | iEI := '00010110'B, |
| 271 | lengthIndicator := ?, |
| 272 | nAS_MessageContainer := nas_pdu |
| 273 | } |
| 274 | |
| 275 | /* 9.4.16 */ |
| 276 | template (value) RejectCause ts_SGsAP_IE_RejCause(template (value) Reject_Cause cause) := { |
| 277 | iEI := '00001111'B, |
| 278 | lengthIndicator := 1, |
| 279 | cause := cause |
| 280 | } |
| 281 | template RejectCause tr_SGsAP_IE_RejCause(template Reject_Cause cause) := { |
| 282 | iEI := '00001111'B, |
| 283 | lengthIndicator := 1, |
| 284 | cause := cause |
| 285 | } |
| 286 | |
| 287 | /* 9.4.17 */ |
| 288 | template (value) ServiceIndicator ts_SGsAP_ServiceInd(template (value) Service_Indicator si) := { |
| 289 | iEI := '00100000'B, |
| 290 | lengthIndicator := 1, |
| 291 | indicator := si |
| 292 | } |
| 293 | template ServiceIndicator tr_SGsAP_ServiceInd(template Service_Indicator si) := { |
| 294 | iEI := '00100000'B, |
| 295 | lengthIndicator := 1, |
| 296 | indicator := si |
| 297 | } |
| 298 | |
| 299 | |
| 300 | /* 9.4.18 */ |
| 301 | template (value) SGsCause ts_SGsAP_IE_SgsCause(template (value) SGs_Cause cause) := { |
| 302 | iEI := '00001000'B, |
| 303 | lengthIndicator := 1, |
| 304 | cause := cause |
| 305 | } |
| 306 | function tr_SGsAP_IE_SgsCause(template SGs_Cause cause) return template SGsCause { |
| 307 | if (istemplatekind(cause, "omit")) { |
| 308 | return omit; |
| 309 | } else if (istemplatekind(cause, "*")) { |
| 310 | return *; |
| 311 | } else { |
| 312 | var template SGsCause ret := { |
| 313 | iEI := '00001000'B, |
| 314 | lengthIndicator := 1, |
| 315 | cause := cause |
| 316 | } |
| 317 | return ret; |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | /* 9.4.21c */ |
| 322 | template (value) UE_EMM_Mode ts_SGsAP_IE_UeEmmMode(template (value) UE_EMM_mode mode) := { |
| 323 | iEI := '00100101'B, |
| 324 | lengthIndicator := 1, |
| 325 | mode := mode |
| 326 | } |
| 327 | template UE_EMM_Mode tr_SGsAP_IE_UeEmmMode(template UE_EMM_mode mode) := { |
| 328 | iEI := '00100101'B, |
| 329 | lengthIndicator := 1, |
| 330 | mode := mode |
| 331 | } |
| 332 | |
| 333 | |
| 334 | /* 9.4.22 */ |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 335 | template (value) VLR_Name ts_SGsAP_IE_VlrName(template (value) octetstring name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 336 | iEI := '00000010'B, |
| 337 | lengthIndicator := lengthof(name), |
| 338 | name := name |
| 339 | } |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 340 | template VLR_Name tr_SGsAP_IE_VlrName(template octetstring name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 341 | iEI := '00000010'B, |
| 342 | lengthIndicator := ?, |
| 343 | name := name |
| 344 | } |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | /* 3GPP TS 29.118 Section 8.1 */ |
| 351 | template (value) PDU_SGsAP ts_SGsAP_ALERT_ACK(hexstring imsi) := { |
| 352 | sGsAP_ALERT_ACK := { |
| 353 | messageType := '00001110'B, |
| 354 | iMSI := ts_SGsAP_IMSI(imsi) |
| 355 | } |
| 356 | } |
| 357 | template PDU_SGsAP tr_SGsAP_ALERT_ACK(template hexstring imsi) := { |
| 358 | sGsAP_ALERT_ACK := { |
| 359 | messageType := '00001110'B, |
| 360 | iMSI := tr_SGsAP_IMSI(imsi) |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | /* 3GPP TS 29.118 Section 8.2 */ |
| 365 | template PDU_SGsAP ts_SGsAP_ALERT_REJECT(hexstring imsi, |
| 366 | template (value) SGs_Cause cause) := { |
| 367 | sGsAP_ALERT_REJECT := { |
| 368 | messageType := '00001111'B, |
| 369 | iMSI := ts_SGsAP_IMSI(imsi), |
| 370 | sGsCause := ts_SGsAP_IE_SgsCause(cause) |
| 371 | } |
| 372 | } |
| 373 | template PDU_SGsAP tr_SGsAP_ALERT_REJECT(template hexstring imsi, |
| 374 | template SGs_Cause cause := ?) := { |
| 375 | sGsAP_ALERT_REJECT := { |
| 376 | messageType := '00001111'B, |
| 377 | iMSI := tr_SGsAP_IMSI(imsi), |
| 378 | sGsCause := tr_SGsAP_IE_SgsCause(cause) |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /* 3GPP TS 29.118 Section 8.3 */ |
| 383 | template (value) PDU_SGsAP ts_SGsAP_ALERT_REQ(hexstring imsi) := { |
| 384 | sGsAP_ALERT_REQUEST := { |
| 385 | messageType := '00001101'B, |
| 386 | iMSI := ts_SGsAP_IMSI(imsi) |
| 387 | } |
| 388 | } |
| 389 | template PDU_SGsAP tr_SGsAP_ALERT_REQ(template hexstring imsi) := { |
| 390 | sGsAP_ALERT_REQUEST := { |
| 391 | messageType := '00001101'B, |
| 392 | iMSI := tr_SGsAP_IMSI(imsi) |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | /* 3GPP TS 29.118 Section 8.4 */ |
| 397 | template (value) PDU_SGsAP ts_SGsAP_DL_UD(hexstring imsi, |
| 398 | template (value) octetstring nas_pdu) := { |
| 399 | sGsAP_DOWNLINK_UNITDATA := { |
| 400 | messageType := '00000111'B, |
| 401 | iMSI := ts_SGsAP_IMSI(imsi), |
| 402 | nAS_MessageContainer := ts_SGsAP_NasContainer(nas_pdu) |
| 403 | } |
| 404 | } |
| 405 | template PDU_SGsAP tr_SGsAP_DL_UD(template hexstring imsi, template octetstring nas_pdu := ?) := { |
| 406 | sGsAP_DOWNLINK_UNITDATA := { |
| 407 | messageType := '00000111'B, |
| 408 | iMSI := tr_SGsAP_IMSI(imsi), |
| 409 | nAS_MessageContainer := tr_SGsAP_NasContainer(nas_pdu) |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | /* 8.5 */ |
| 414 | template (value) PDU_SGsAP ts_SGsAP_EPS_DETACH_ACK(hexstring imsi) := { |
| 415 | sGsAP_EPS_DETACH_ACK:= { |
| 416 | messageType := '00010010'B, |
| 417 | iMSI := ts_SGsAP_IMSI(imsi) |
| 418 | } |
| 419 | } |
| 420 | template PDU_SGsAP tr_SGsAP_EPS_DETACH_ACK(template hexstring imsi) := { |
| 421 | sGsAP_EPS_DETACH_ACK:= { |
| 422 | messageType := '00010010'B, |
| 423 | iMSI := tr_SGsAP_IMSI(valueof(imsi)) |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | /* 8.6 */ |
| 428 | template (value) PDU_SGsAP ts_SGsAP_EPS_DETACH_IND(hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 429 | template (value) octetstring mme_name, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 430 | template (value) IMSI_detachFromEPS_serviceType det_serv_typ) := { |
| 431 | sGsAP_EPS_DETACH_INDICATION:= { |
| 432 | messageType := '00010001'B, |
| 433 | iMSI := ts_SGsAP_IMSI(imsi), |
| 434 | mME_Name := ts_SGsAP_IE_MmeName(mme_name), |
| 435 | iMSI_DetachFromEPS_ServiceType := ts_SGsAP_IE_DetServiceType(det_serv_typ) |
| 436 | } |
| 437 | } |
| 438 | template PDU_SGsAP tr_SGsAP_EPS_DETACH_IND(template hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 439 | template octetstring mme_name, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 440 | template IMSI_detachFromEPS_serviceType det_serv_typ) := { |
| 441 | sGsAP_EPS_DETACH_INDICATION:= { |
| 442 | messageType := '00010001'B, |
| 443 | iMSI := tr_SGsAP_IMSI(valueof(imsi)), |
| 444 | mME_Name := tr_SGsAP_IE_MmeName(mme_name), |
| 445 | iMSI_DetachFromEPS_ServiceType := tr_SGsAP_IE_DetServiceType(det_serv_typ) |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | /* 8.7 */ |
| 450 | template (value) PDU_SGsAP ts_SGsAP_IMSI_DETACH_ACK(hexstring imsi) := { |
| 451 | sGsAP_IMSI_DETACH_ACK := { |
| 452 | messageType := '00010100'B, |
| 453 | iMSI := ts_SGsAP_IMSI(imsi) |
| 454 | } |
| 455 | } |
| 456 | template PDU_SGsAP tr_SGsAP_IMSI_DETACH_ACK(template hexstring imsi) := { |
| 457 | sGsAP_IMSI_DETACH_ACK := { |
| 458 | messageType := '00010100'B, |
| 459 | iMSI := tr_SGsAP_IMSI(imsi) |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | /* 8.8 */ |
| 464 | template (value) PDU_SGsAP ts_SGsAP_IMSI_DETACH_IND(hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 465 | template (value) octetstring mme_name, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 466 | template (value) IMSI_detachFromNonEPS_serviceType det_serv_typ) := { |
| 467 | sGsAP_IMSI_DETACH_INDICATION := { |
| 468 | messageType := '00010011'B, |
| 469 | iMSI := ts_SGsAP_IMSI(imsi), |
| 470 | mME_Name := ts_SGsAP_IE_MmeName(mme_name), |
| 471 | iMSI_DetachFromNonEPS_ServiceType := ts_SGsAP_IE_DetNonEpsServiceType(det_serv_typ) |
| 472 | } |
| 473 | } |
| 474 | template PDU_SGsAP tr_SGsAP_IMSI_DETACH_IND(template hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 475 | template octetstring mme_name := ?, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 476 | template IMSI_detachFromNonEPS_serviceType det_serv_typ := ?) := { |
| 477 | sGsAP_IMSI_DETACH_INDICATION := { |
| 478 | messageType := '00010011'B, |
| 479 | iMSI := tr_SGsAP_IMSI(imsi), |
| 480 | mME_Name := tr_SGsAP_IE_MmeName(mme_name), |
| 481 | iMSI_DetachFromNonEPS_ServiceType := tr_SGsAP_IE_DetNonEpsServiceType(det_serv_typ) |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | /* 8.9 */ |
| 486 | template (value) PDU_SGsAP ts_SGsAP_LU_ACCEPT(hexstring imsi, |
| 487 | template (value) LocationAreaIdValue lai, |
| 488 | template (value) MobileIdentityLV mobile_id) := { |
| 489 | sGsAP_LOCATION_UPDATE_ACCEPT := { |
| 490 | messageType := '00001010'B, |
| 491 | iMSI := ts_SGsAP_IMSI(imsi), |
| 492 | locationAreaId := ts_SGsAP_IE_Lai(lai), |
| 493 | newTMSIorIMSI := ts_SGsAP_IE_MobileID(mobile_id) |
| 494 | } |
| 495 | } |
| 496 | template PDU_SGsAP tr_SGsAP_LU_ACCEPT(template hexstring imsi, |
| 497 | template LocationAreaIdValue lai := ?) := { |
| 498 | sGsAP_LOCATION_UPDATE_ACCEPT := { |
| 499 | messageType := '00001010'B, |
| 500 | iMSI := tr_SGsAP_IMSI(imsi), |
| 501 | locationAreaId := tr_SGsAP_IE_Lai(lai), |
| 502 | newTMSIorIMSI := * |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | /* 8.10 */ |
| 507 | template (value) PDU_SGsAP ts_SGsAP_LU_REJECT(hexstring imsi, |
| 508 | template (value) Reject_Cause rej_cause, |
| 509 | template (omit) LocationAreaIdValue lai) := { |
| 510 | sGsAP_LOCATION_UPDATE_REJECT := { |
| 511 | messageType := '00001011'B, |
| 512 | iMSI := ts_SGsAP_IMSI(imsi), |
| 513 | rejectCause := ts_SGsAP_IE_RejCause(rej_cause), |
| 514 | locationAreaId := ts_SGsAP_IE_Lai_omit(lai) |
| 515 | } |
| 516 | } |
| 517 | template PDU_SGsAP tr_SGsAP_LU_REJECT(template hexstring imsi, |
| 518 | template Reject_Cause rej_cause, |
| 519 | template LocationAreaIdValue lai) := { |
| 520 | sGsAP_LOCATION_UPDATE_REJECT := { |
| 521 | messageType := '00001011'B, |
| 522 | iMSI := tr_SGsAP_IMSI(imsi), |
| 523 | rejectCause := tr_SGsAP_IE_RejCause(rej_cause), |
| 524 | locationAreaId := tr_SGsAP_IE_Lai_omit(lai) |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | /* 8.11 */ |
| 529 | template (value) PDU_SGsAP ts_SGsAP_LU_REQ(hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 530 | template (value) octetstring mme_name, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 531 | template (value) EPS_location_update_type eps_lu_type, |
Pau Espin Pedrol | 3768a6f | 2021-04-28 14:24:23 +0200 | [diff] [blame] | 532 | template (value) LocationAreaIdValue new_lai, |
| 533 | template (omit) TrackingAreaIdentityValue tAI := omit) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 534 | sGsAP_LOCATION_UPDATE_REQUEST := { |
| 535 | messageType := '00001001'B, |
| 536 | iMSI := ts_SGsAP_IMSI(imsi), |
| 537 | mME_Name := ts_SGsAP_IE_MmeName(mme_name), |
| 538 | ePS_LocationUpdateType := ts_SGsAP_IE_EpsLuType(eps_lu_type), |
| 539 | newLocationAreaId := ts_SGsAP_IE_Lai(new_lai), |
| 540 | oldLocationAreaId := omit, |
| 541 | tMSI_Status := omit, |
| 542 | iMEI_SV := omit, |
Pau Espin Pedrol | 3768a6f | 2021-04-28 14:24:23 +0200 | [diff] [blame] | 543 | tAI := ts_SGsAP_IE_TAI_omit(tAI), |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 544 | eCGI := omit, |
| 545 | tMSI_NRI := omit, |
| 546 | cS_DomainOperator := omit |
| 547 | } |
| 548 | } |
| 549 | template PDU_SGsAP tr_SGsAP_LU_REQ(template hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 550 | template octetstring mme_name := ?, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 551 | template EPS_location_update_type eps_lu_type := ?, |
| 552 | template LocationAreaIdValue new_lai := ?) := { |
| 553 | sGsAP_LOCATION_UPDATE_REQUEST := { |
| 554 | messageType := '00001001'B, |
| 555 | iMSI := tr_SGsAP_IMSI(imsi), |
| 556 | mME_Name := tr_SGsAP_IE_MmeName(mme_name), |
| 557 | ePS_LocationUpdateType := tr_SGsAP_IE_EpsLuType(eps_lu_type), |
| 558 | newLocationAreaId := tr_SGsAP_IE_Lai_omit(new_lai), |
| 559 | oldLocationAreaId := *, |
| 560 | tMSI_Status := *, |
| 561 | iMEI_SV := *, |
| 562 | tAI := *, |
| 563 | eCGI := *, |
| 564 | tMSI_NRI := *, |
| 565 | cS_DomainOperator := * |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | /* 8.12 */ |
| 570 | template (value) PDU_SGsAP ts_SGsAP_MM_INFO_REQ(hexstring imsi, |
| 571 | template (value) octetstring mm_info) := { |
| 572 | sGsAP_MM_INFORMATION_REQUEST := { |
| 573 | messageType := '00011010'B, |
| 574 | iMSI := ts_SGsAP_IMSI(imsi), |
| 575 | mM_Information := ts_SGsAP_IE_MmInfo(mm_info) |
| 576 | } |
| 577 | } |
| 578 | template PDU_SGsAP tr_SGsAP_MM_INFO_REQ(template hexstring imsi, |
| 579 | template octetstring mm_info :=?) := { |
| 580 | sGsAP_MM_INFORMATION_REQUEST := { |
| 581 | messageType := '00011010'B, |
| 582 | iMSI := tr_SGsAP_IMSI(imsi), |
| 583 | mM_Information := tr_SGsAP_IE_MmInfo(mm_info) |
| 584 | } |
| 585 | } |
| 586 | |
| 587 | /* 8.13 */ |
| 588 | template (value) PDU_SGsAP ts_SGsAP_PAGING_REJ(hexstring imsi, |
| 589 | template (value) SGs_Cause cause) := { |
| 590 | sGsAP_PAGING_REJECT := { |
| 591 | messageType := '00000010'B, |
| 592 | iMSI := ts_SGsAP_IMSI(imsi), |
| 593 | sGsCause := ts_SGsAP_IE_SgsCause(cause) |
| 594 | } |
| 595 | } |
| 596 | template PDU_SGsAP tr_SGsAP_PAGING_REJ(template hexstring imsi, |
| 597 | template SGs_Cause cause := ?) := { |
| 598 | sGsAP_PAGING_REJECT := { |
| 599 | messageType := '00000010'B, |
| 600 | iMSI := tr_SGsAP_IMSI(imsi), |
| 601 | sGsCause := tr_SGsAP_IE_SgsCause(cause) |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | /* 8.14 */ |
| 606 | template (value) PDU_SGsAP ts_SGsAP_PAGING_REQ(hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 607 | template (value) octetstring vlr_name, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 608 | template (value) Service_Indicator serv_ind, |
| 609 | template (omit) OCT4 tmsi) := |
| 610 | { |
| 611 | sGsAP_PAGING_REQUEST := { |
| 612 | messageType := '00000001'B, |
| 613 | iMSI := ts_SGsAP_IMSI(imsi), |
| 614 | vLR_Name := ts_SGsAP_IE_VlrName(vlr_name), |
| 615 | serviceIndicator := ts_SGsAP_ServiceInd(serv_ind), |
| 616 | tMSI := omit, |
| 617 | cLI := omit, |
| 618 | locationAreaId := omit, |
| 619 | globalCN_Id := omit, |
| 620 | sS_Code := omit, |
| 621 | lCS_Indicator := omit, |
| 622 | lCS_ClientIdentity := omit, |
| 623 | channelNeeded := omit, |
| 624 | eMLPP_Priority := omit, |
| 625 | additionalPagingIndicator := omit |
| 626 | } |
| 627 | } |
| 628 | template PDU_SGsAP tr_SGsAP_PAGING_REQ(template hexstring imsi, |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 629 | template octetstring vlr_name, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 630 | template Service_Indicator serv_ind, |
| 631 | template OCT4 tmsi) := |
| 632 | { |
| 633 | sGsAP_PAGING_REQUEST := { |
| 634 | messageType := '00000001'B, |
| 635 | iMSI := tr_SGsAP_IMSI(imsi), |
| 636 | vLR_Name := tr_SGsAP_IE_VlrName(vlr_name), |
| 637 | serviceIndicator := tr_SGsAP_ServiceInd(serv_ind), |
| 638 | tMSI := *, |
| 639 | cLI := *, |
| 640 | locationAreaId := *, |
| 641 | globalCN_Id := *, |
| 642 | sS_Code := *, |
| 643 | lCS_Indicator := *, |
| 644 | lCS_ClientIdentity := *, |
| 645 | channelNeeded := *, |
| 646 | eMLPP_Priority := *, |
| 647 | additionalPagingIndicator := * |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | /* 8.15 */ |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 652 | template (value) PDU_SGsAP ts_SGsAP_RESET_ACK_MME(template (value) octetstring mme_name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 653 | sGsAP_RESET_ACK := { |
| 654 | messageType := '00010110'B, |
| 655 | mME_Name := ts_SGsAP_IE_MmeName(mme_name), |
| 656 | vLR_Name := omit |
| 657 | } |
| 658 | } |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 659 | template (value) PDU_SGsAP ts_SGsAP_RESET_ACK_VLR(template (value) octetstring vlr_name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 660 | sGsAP_RESET_ACK := { |
| 661 | messageType := '00010110'B, |
| 662 | mME_Name := omit, |
| 663 | vLR_Name := ts_SGsAP_IE_VlrName(vlr_name) |
| 664 | } |
| 665 | } |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 666 | template PDU_SGsAP tr_SGsAP_RESET_ACK(template octetstring mme_name, template octetstring vlr_name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 667 | sGsAP_RESET_ACK := { |
| 668 | messageType := '00010110'B, |
| 669 | mME_Name := tr_SGsAP_IE_MmeName(mme_name), |
| 670 | vLR_Name := tr_SGsAP_IE_VlrName(vlr_name) |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | /* 8.16 */ |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 675 | template (value) PDU_SGsAP ts_SGsAP_RESET_IND_MME(template (value) octetstring mme_name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 676 | sGsAP_RESET_INDICATION := { |
| 677 | messageType := '00010101'B, |
| 678 | mME_Name := ts_SGsAP_IE_MmeName(mme_name), |
| 679 | vLR_Name := omit |
| 680 | } |
| 681 | } |
Harald Welte | 1fd461a | 2018-10-28 10:26:13 +0100 | [diff] [blame] | 682 | template (value) PDU_SGsAP ts_SGsAP_RESET_IND_VLR(template (value) octetstring vlr_name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 683 | sGsAP_RESET_INDICATION := { |
| 684 | messageType := '00010101'B, |
| 685 | mME_Name := omit, |
| 686 | vLR_Name := ts_SGsAP_IE_VlrName(vlr_name) |
| 687 | } |
| 688 | } |
Philipp Maier | d3e0bfa | 2019-04-09 15:29:40 +0200 | [diff] [blame] | 689 | |
| 690 | template PDU_SGsAP tr_SGsAP_RESET_IND_MME(template octetstring mme_name) := { |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 691 | sGsAP_RESET_INDICATION := { |
| 692 | messageType := '00010101'B, |
| 693 | mME_Name := tr_SGsAP_IE_MmeName(mme_name), |
Philipp Maier | d3e0bfa | 2019-04-09 15:29:40 +0200 | [diff] [blame] | 694 | vLR_Name := omit |
| 695 | } |
| 696 | } |
| 697 | template PDU_SGsAP tr_SGsAP_RESET_IND_VLR(template octetstring vlr_name) := { |
| 698 | sGsAP_RESET_INDICATION := { |
| 699 | messageType := '00010101'B, |
| 700 | mME_Name := omit, |
Harald Welte | 1831443 | 2018-10-05 19:03:28 +0200 | [diff] [blame] | 701 | vLR_Name := tr_SGsAP_IE_VlrName(vlr_name) |
| 702 | } |
| 703 | } |
| 704 | |
| 705 | /* 8.17 */ |
| 706 | template (value) PDU_SGsAP ts_SGsAP_SERVICE_REQ(hexstring imsi, |
| 707 | template (value) Service_Indicator serv_ind, |
| 708 | template (value) UE_EMM_mode emm_mode) := { |
| 709 | sGsAP_SERVICE_REQUEST := { |
| 710 | messageType := '00000110'B, |
| 711 | iMSI := ts_SGsAP_IMSI(imsi), |
| 712 | serviceIndicator := ts_SGsAP_ServiceInd(serv_ind), |
| 713 | iMEI_SV := omit, |
| 714 | uE_TimeZone := omit, |
| 715 | mobileStationClassmark2 := omit, |
| 716 | tAI := omit, |
| 717 | eCGI := omit, |
| 718 | /* optional, but "the MME shall include this IE." */ |
| 719 | uE_EMM_Mode := ts_SGsAP_IE_UeEmmMode(emm_mode) |
| 720 | } |
| 721 | } |
| 722 | template PDU_SGsAP tr_SGsAP_SERVICE_REQ(template hexstring imsi, |
| 723 | template Service_Indicator serv_ind := ?, |
| 724 | template UE_EMM_mode emm_mode := ?) := { |
| 725 | sGsAP_SERVICE_REQUEST := { |
| 726 | messageType := '00000110'B, |
| 727 | iMSI := tr_SGsAP_IMSI(imsi), |
| 728 | serviceIndicator := tr_SGsAP_ServiceInd(serv_ind), |
| 729 | iMEI_SV := *, |
| 730 | uE_TimeZone := *, |
| 731 | mobileStationClassmark2 := *, |
| 732 | tAI := *, |
| 733 | eCGI := *, |
| 734 | /* optional, but "the MME shall include this IE." */ |
| 735 | uE_EMM_Mode := tr_SGsAP_IE_UeEmmMode(emm_mode) |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | |
| 740 | /* 8.18 */ |
| 741 | template (value) PDU_SGsAP ts_SGsAP_STATUS(template (omit) hexstring imsi, |
| 742 | template (value) SGs_Cause cause, |
| 743 | template (value) octetstring err_msg) := { |
| 744 | sGsAP_STATUS := { |
| 745 | messageType := '00011101'B, |
| 746 | iMSI := ts_SGsAP_IMSI_omit(imsi), |
| 747 | sGsCause := ts_SGsAP_IE_SgsCause(cause), |
| 748 | erroneousMessage := ts_SGsAP_IE_ErrMsg(err_msg) |
| 749 | } |
| 750 | } |
| 751 | template PDU_SGsAP tr_SGsAP_STATUS(template hexstring imsi, |
| 752 | template SGs_Cause cause, |
| 753 | template octetstring err_msg) := { |
| 754 | sGsAP_STATUS := { |
| 755 | messageType := '00011101'B, |
| 756 | iMSI := tr_SGsAP_IMSI(imsi), |
| 757 | sGsCause := tr_SGsAP_IE_SgsCause(cause), |
| 758 | erroneousMessage := tr_SGsAP_IE_ErrMsg(err_msg) |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | |
| 763 | /* 8.19 */ |
| 764 | template (value) PDU_SGsAP ts_SGsAP_TMSI_REALL_CMPL(hexstring imsi) := { |
| 765 | sGsAP_TMSI_REALLOCATION_COMPLETE := { |
| 766 | messageType := '00001100'B, |
| 767 | iMSI := ts_SGsAP_IMSI(imsi) |
| 768 | } |
| 769 | } |
| 770 | template PDU_SGsAP tr_SGsAP_TMSI_REALL_CMPL(template hexstring imsi) := { |
| 771 | sGsAP_TMSI_REALLOCATION_COMPLETE := { |
| 772 | messageType := '00001100'B, |
| 773 | iMSI := tr_SGsAP_IMSI(imsi) |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | /* 8.20 */ |
| 778 | template (value) PDU_SGsAP ts_SGsAP_UE_ACT_IND(hexstring imsi) := { |
| 779 | sGsAP_UE_ACTIVITY_INDICATION := { |
| 780 | messageType := '00010000'B, |
| 781 | iMSI := ts_SGsAP_IMSI(imsi) |
| 782 | /* Rel 14: Max UE Avail Time */ |
| 783 | } |
| 784 | } |
| 785 | template PDU_SGsAP tr_SGsAP_UE_ACT_IND(template hexstring imsi) := { |
| 786 | sGsAP_UE_ACTIVITY_INDICATION := { |
| 787 | messageType := '00010000'B, |
| 788 | iMSI := tr_SGsAP_IMSI(imsi) |
| 789 | /* Rel 14: Max UE Avail Time */ |
| 790 | } |
| 791 | } |
| 792 | |
| 793 | /* 8.21 */ |
| 794 | template (value) PDU_SGsAP ts_SGsAP_UE_UNREACHABLE(hexstring imsi, |
| 795 | template (value) SGs_Cause cause) := { |
| 796 | sGsAP_UE_UNREACHABLE := { |
| 797 | messageType := '00011111'B, |
| 798 | iMSI := ts_SGsAP_IMSI(imsi), |
| 799 | sGsCause := ts_SGsAP_IE_SgsCause(cause) |
| 800 | /* Rel 14: Requested Retransmission Time */ |
| 801 | /* Rel 14: Additional UE Unreachable indicators */ |
| 802 | } |
| 803 | } |
| 804 | template PDU_SGsAP tr_SGsAP_UE_UNREACHABLE(template hexstring imsi, |
| 805 | template SGs_Cause cause := ?) := { |
| 806 | sGsAP_UE_UNREACHABLE := { |
| 807 | messageType := '00011111'B, |
| 808 | iMSI := tr_SGsAP_IMSI(imsi), |
| 809 | sGsCause := tr_SGsAP_IE_SgsCause(cause) |
| 810 | /* Rel 14: Requested Retransmission Time */ |
| 811 | /* Rel 14: Additional UE Unreachable indicators */ |
| 812 | } |
| 813 | } |
| 814 | |
| 815 | /* 8.22 */ |
| 816 | template (value) PDU_SGsAP ts_SGsAP_UL_UD(hexstring imsi, |
| 817 | template (value) octetstring nas_msg) := { |
| 818 | sGsAP_UPLINK_UNITDATA := { |
| 819 | messageType := '00001000'B, |
| 820 | iMSI := ts_SGsAP_IMSI(imsi), |
| 821 | nAS_MessageContainer := ts_SGsAP_NasContainer(nas_msg), |
| 822 | iMEI_SV := omit, |
| 823 | uE_TimeZone := omit, |
| 824 | mobileStationClassmark2 := omit, |
| 825 | tAI := omit, |
| 826 | eCGI := omit |
| 827 | } |
| 828 | } |
| 829 | template PDU_SGsAP tr_SGsAP_UL_UD(template hexstring imsi, |
| 830 | template octetstring nas_msg := ?) := { |
| 831 | sGsAP_UPLINK_UNITDATA := { |
| 832 | messageType := '00001000'B, |
| 833 | iMSI := tr_SGsAP_IMSI(imsi), |
| 834 | nAS_MessageContainer := tr_SGsAP_NasContainer(nas_msg), |
| 835 | iMEI_SV := *, |
| 836 | uE_TimeZone := *, |
| 837 | mobileStationClassmark2 := *, |
| 838 | tAI := *, |
| 839 | eCGI := * |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | /* 8.23 */ |
| 844 | template (value) PDU_SGsAP ts_SGsAP_RELEASE_REQ(hexstring imsi, |
| 845 | template (value) SGs_Cause cause) := { |
| 846 | sGsAP_RELEASE_REQUEST := { |
| 847 | messageType := '00011011'B, |
| 848 | iMSI := ts_SGsAP_IMSI(imsi), |
| 849 | sGsCause := ts_SGsAP_IE_SgsCause(cause) |
| 850 | } |
| 851 | } |
| 852 | template PDU_SGsAP tr_SGsAP_RELEASE_REQ(template hexstring imsi, |
| 853 | template SGs_Cause cause) := { |
| 854 | sGsAP_RELEASE_REQUEST := { |
| 855 | messageType := '00011011'B, |
| 856 | iMSI := tr_SGsAP_IMSI(imsi), |
| 857 | sGsCause := tr_SGsAP_IE_SgsCause(cause) |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | /* 8.24 */ |
| 862 | template (value) PDU_SGsAP ts_SGsAP_SERVICE_ABORT_REQ(hexstring imsi) := { |
| 863 | sGsAP_SERVICE_ABORT_REQUEST := { |
| 864 | messageType := '00010111'B, |
| 865 | iMSI := ts_SGsAP_IMSI(imsi) |
| 866 | } |
| 867 | } |
| 868 | template PDU_SGsAP tr_SGsAP_SERVICE_ABORT_REQ(template hexstring imsi) := { |
| 869 | sGsAP_SERVICE_ABORT_REQUEST := { |
| 870 | messageType := '00010111'B, |
| 871 | iMSI := tr_SGsAP_IMSI(imsi) |
| 872 | } |
| 873 | } |
| 874 | |
| 875 | /* 8.25 */ |
| 876 | template (value) PDU_SGsAP ts_SGsAP_MO_CSFB_IND(hexstring imsi) := { |
| 877 | sGsAP_MO_CSFB_INDICATION := { |
| 878 | messageType := '00011000'B, |
| 879 | iMSI := ts_SGsAP_IMSI(imsi), |
| 880 | tAI := omit, |
| 881 | eCGI := omit |
| 882 | } |
| 883 | } |
| 884 | template PDU_SGsAP tr_SGsAP_MO_CSFB_IND(template hexstring imsi) := { |
| 885 | sGsAP_MO_CSFB_INDICATION := { |
| 886 | messageType := '00011000'B, |
| 887 | iMSI := tr_SGsAP_IMSI(imsi), |
| 888 | tAI := *, |
| 889 | eCGI := * |
| 890 | } |
| 891 | } |
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | |
| 898 | } |