Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1 | /* GTPv1-C Templates in TTCN-3 |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 2 | * (C) 2018 Harald Welte <laforge@gnumonks.org> |
| 3 | * contributions by sysmocom - s.f.m.c. GmbH |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Released under the terms of GNU General Public License, Version 2 or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 10 | */ |
| 11 | |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 12 | module GTPv1C_Templates { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 13 | |
| 14 | import from General_Types all; |
| 15 | import from Osmocom_Types all; |
| 16 | import from GTPC_Types all; |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 17 | import from GTPv1C_CodecPort all; |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 18 | import from IPCP_Types all; |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 19 | import from GSM_Types all; // RoutingAreaIdentification, CellIdentity |
| 20 | |
Pau Espin Pedrol | bbff8b7 | 2024-01-15 18:45:35 +0100 | [diff] [blame] | 21 | template (present) OCT1 gtp1_requests := ( |
| 22 | '10'O, /* createPDPContextRequest */ |
| 23 | '12'O, /* updatePDPContextRequest */ |
| 24 | '14'O, /* */ |
| 25 | '16'O, /* deletePDPContextRequest */ |
| 26 | '1B'O, /* pdu_NotificationRequest */ |
| 27 | '1D'O, /* pdu_NotificationRejectRequest */ |
| 28 | '1F'O, /* supportedExtensionHeadersNotification */ |
| 29 | '20'O, /* sendRouteingInformationForGPRSRequest */ |
| 30 | '22'O, /* failureReportRequest */ |
| 31 | '24'O, /* noteMS_GPRSPresentRequest */ |
| 32 | '30'O, /* identificationRequest */ |
| 33 | '32'O, /* sgsn_ContextRequest */ |
| 34 | '35'O, /* forwardRelocationRequest */ |
| 35 | '38'O, /* relocationCancelRequest */ |
| 36 | '3A'O, /* forwardSRNSContext */ |
| 37 | '3D'O, /* uERegistrationQueryRequest */ |
| 38 | '46'O, /* ranInformationRelay */ |
| 39 | '60'O, /* mBMSNotificationRequest */ |
| 40 | '62'O, /* mBMSNotificationRejectRequest */ |
| 41 | '64'O, /* createMBMSContextRequest */ |
| 42 | '66'O, /* updateMBMSContextRequest */ |
| 43 | '68'O, /* deleteMBMSContextRequest */ |
| 44 | '70'O, /* mBMSRegistrationRequest */ |
| 45 | '72'O, /* mBMSDeRegistrationRequest */ |
| 46 | '74'O, /* mBMSSessionStartRequest */ |
| 47 | '76'O, /* mBMSSessionStopRequest */ |
| 48 | '78'O, /* mBMSSessionUpdateRequest */ |
| 49 | '80'O /* mS_InfoChangeNotificationRequest */ |
| 50 | ); |
| 51 | |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 52 | type record GTP_CellId { |
| 53 | RoutingAreaIdentification ra_id, |
| 54 | CellIdentity cell_id |
| 55 | } with { encode "RAW" }; |
| 56 | |
| 57 | template (value) GTP_CellId ts_GTP_CellId(template (value) RoutingAreaIdentification rai, CellIdentity cell_id) := { |
| 58 | ra_id := rai, |
| 59 | cell_id := cell_id |
| 60 | }; |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 61 | |
Harald Welte | 3b4c356 | 2018-03-01 10:01:58 +0100 | [diff] [blame] | 62 | /* Table 38 of 3GPP TS 29.060 */ |
| 63 | type enumerated GTP_Cause { |
| 64 | GTP_CAUSE_REQUEST_IMEI (1), |
| 65 | GTP_CAUSE_REQUEST_IMSI_AND_IMEI (2), |
| 66 | GTP_CAUSE_NO_IDENTITY_NEDED (3), |
| 67 | GTP_CAUSE_MS_REFUSES (4), |
| 68 | GTP_CAUSE_MS_IS_NOT_GPRS_RESPONDING (5), |
| 69 | /* reserved */ |
Vadim Yanitskiy | acd0b39 | 2024-04-06 05:38:35 +0700 | [diff] [blame^] | 70 | GTP_CAUSE_REQUEST_ACCEPTED (128), |
| 71 | GTP_CAUSE_INVALID_MSG_FORMAT (193) |
Harald Welte | 3b4c356 | 2018-03-01 10:01:58 +0100 | [diff] [blame] | 72 | /* FIXME */ |
| 73 | }; |
| 74 | |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 75 | template (value) Cause_gtpc ts_Cause_gtpc(template (value) GTP_Cause cause) := { |
| 76 | type_gtpc := '01'O, |
| 77 | causevalue := enum2oct1_Cause_gtpc_tmpl(cause) |
| 78 | } |
| 79 | private function enum2oct1_Cause_gtpc_tmpl(template GTP_Cause inp) return template OCT1 |
| 80 | { |
| 81 | if (istemplatekind(inp, "omit")) { |
| 82 | return omit; |
| 83 | } else if (istemplatekind(inp, "*")) { |
| 84 | return *; |
| 85 | } else if (istemplatekind(inp, "?")) { |
| 86 | return ?; |
| 87 | } else { |
| 88 | return int2oct(enum2int(valueof(inp)), 1); |
| 89 | } |
| 90 | } |
| 91 | template (present) Cause_gtpc tr_Cause_gtpc(template (present) GTP_Cause cause) := { |
| 92 | type_gtpc := '01'O, |
| 93 | causevalue := enum2oct1_Cause_gtpc_tmpl(cause) |
| 94 | } |
| 95 | function f_tr_Cause_gtpc(template GTP_Cause cause) return |
| 96 | template Cause_gtpc { |
| 97 | if (istemplatekind(cause, "omit")) { |
| 98 | return omit; |
| 99 | } else if (istemplatekind(cause, "*")) { |
| 100 | return *; |
| 101 | } else { |
| 102 | return tr_Cause_gtpc(cause); |
| 103 | } |
| 104 | } |
| 105 | |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 106 | private function f_oct_or_wc(template integer inp, integer len) return template octetstring { |
| 107 | if (istemplatekind(inp, "omit")) { |
| 108 | return omit; |
| 109 | } else if (istemplatekind(inp, "*")) { |
| 110 | return *; |
| 111 | } else if (istemplatekind(inp, "?")) { |
| 112 | return ?; |
| 113 | } |
| 114 | return int2oct(valueof(inp), len); |
| 115 | } |
| 116 | |
| 117 | private function f_hex_or_wc(template integer inp, integer len) return template hexstring { |
| 118 | if (istemplatekind(inp, "omit")) { |
| 119 | return omit; |
| 120 | } else if (istemplatekind(inp, "*")) { |
| 121 | return *; |
| 122 | } else if (istemplatekind(inp, "?")) { |
| 123 | return ?; |
| 124 | } |
| 125 | return int2hex(valueof(inp), len); |
| 126 | } |
| 127 | |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 128 | /* generalized GTP-C receive template */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 129 | template (present) PDU_GTPC tr_GTP1C_PDU(template (present) OCT1 msg_type, template (present) OCT4 teid, template (present) GTPC_PDUs pdu := ?) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 130 | /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an |
| 131 | * error if this flag is set to '1'. */ |
| 132 | pn_bit := '0'B, |
| 133 | /* Sequence number flag (S) shall be set to '1'. */ |
| 134 | s_bit := '1'B, |
| 135 | e_bit := ?, |
| 136 | spare := ?, |
| 137 | /* Protocol Type flag (PT) shall be set to '1'.*/ |
| 138 | pt := '1'B, |
| 139 | /* Version shall be set to decimal 1 ('001'). */ |
| 140 | version := '001'B, |
| 141 | messageType := msg_type, |
| 142 | lengthf := ?, |
| 143 | teid := teid, |
| 144 | opt_part := *, |
| 145 | gtpc_pdu := pdu |
| 146 | } |
| 147 | |
| 148 | /* generalized GTP-C send template */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 149 | template (value) PDU_GTPC ts_GTP1C_PDU(OCT1 msg_type, OCT4 teid, GTPC_PDUs pdu, uint16_t seq_nr) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 150 | /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an |
| 151 | * error if this flag is set to '1'. */ |
| 152 | pn_bit := '0'B, |
| 153 | /* Sequence number flag (S) shall be set to '1'. */ |
| 154 | s_bit := '1'B, |
| 155 | e_bit := '0'B, |
| 156 | spare := '0'B, |
| 157 | /* Protocol Type flag (PT) shall be set to '1'.*/ |
| 158 | pt := '1'B, |
| 159 | /* Version shall be set to decimal 1 ('001'). */ |
| 160 | version := '001'B, |
| 161 | messageType := msg_type, |
| 162 | lengthf := 0, /* we assume encoder overwrites this */ |
| 163 | teid := teid, |
| 164 | opt_part := { |
| 165 | sequenceNumber := int2oct(seq_nr, 2), |
| 166 | npduNumber := '00'O, |
| 167 | nextExtHeader := '00'O, |
| 168 | gTPC_extensionHeader_List := omit |
| 169 | }, |
| 170 | gtpc_pdu := pdu |
| 171 | } |
| 172 | |
| 173 | /* recovery IE */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 174 | template (value) Recovery_gtpc ts_Recovery(OCT1 restart_counter) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 175 | type_gtpc := '0E'O, |
| 176 | restartCounter := restart_counter |
| 177 | } |
| 178 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 179 | template (present) Recovery_gtpc tr_Recovery(template (present) OCT1 restart_counter) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 180 | type_gtpc := '0E'O, |
| 181 | restartCounter := restart_counter |
| 182 | } |
| 183 | |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 184 | /* Packet TMSI - 7.7.5 */ |
| 185 | template (value) PacketTMSI ts_PTMSI(OCT4 ptmsi) := { |
| 186 | type_gtpc := '05'O, |
| 187 | p_tmsi := ptmsi |
| 188 | } |
| 189 | |
| 190 | /* PTMSI Signature - 7.7.9 */ |
| 191 | template (value) PTMSI_Signature ts_PTMSI_sig(OCT3 ptmsi_sig) := { |
| 192 | type_gtpc := '0C'O, |
| 193 | ptmsi_Signature := ptmsi_sig |
| 194 | } |
| 195 | |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 196 | /* MS Validated - 7.7.10 */ |
| 197 | template (value) MS_Validated ts_MS_Validated(template (value) BIT1 msValidated) := { |
| 198 | type_gtpc := '0D'O, |
| 199 | msValidated := msValidated, |
| 200 | spare := '1111111'B |
| 201 | } |
| 202 | template (present) MS_Validated tr_MS_Validated(template (present) BIT1 msValidated := ?) := { |
| 203 | type_gtpc := '0D'O, |
| 204 | msValidated := msValidated, |
| 205 | spare := '1111111'B |
| 206 | } |
| 207 | function f_tr_MS_Validated(template BIT1 msValidated := *) return template MS_Validated { |
| 208 | if (istemplatekind(msValidated, "omit")) { |
| 209 | return omit; |
| 210 | } else if (istemplatekind(msValidated, "*")) { |
| 211 | return *; |
| 212 | } else { |
| 213 | return tr_MS_Validated(msValidated); |
| 214 | } |
| 215 | } |
| 216 | private function f_ts_MS_Validated(template (omit) BIT1 msValidated) |
| 217 | return template (omit) MS_Validated { |
| 218 | if (istemplatekind(msValidated, "omit")) { |
| 219 | return omit; |
| 220 | } |
| 221 | return ts_MS_Validated(msValidated); |
| 222 | } |
| 223 | |
| 224 | /* 7.7.13 TEI Data I */ |
| 225 | template (value) TeidDataI ts_TeidDataI(template (value) OCT4 teid) := { |
| 226 | type_gtpc := '10'O, |
| 227 | teidDataI := teid |
| 228 | } |
| 229 | template (present) TeidDataI tr_TeidDataI(template (present) OCT4 teid := ?) := { |
| 230 | type_gtpc := '10'O, |
| 231 | teidDataI := teid |
| 232 | } |
| 233 | |
| 234 | /* 7.7.14 TEI Control Plane */ |
| 235 | template (value) TeidControlPlane ts_TEIC(template (value) OCT4 teic) := { |
| 236 | type_gtpc := '11'O, |
| 237 | teidControlPlane := teic |
| 238 | } |
| 239 | template (present) TeidControlPlane tr_TEIC(template (present) OCT4 teic := ?) := { |
| 240 | type_gtpc := '11'O, |
| 241 | teidControlPlane := teic |
| 242 | } |
| 243 | private function f_ts_TEIC(template (omit) OCT4 teic) |
| 244 | return template (omit) TeidControlPlane { |
| 245 | if (istemplatekind(teic, "omit")) { |
| 246 | return omit; |
| 247 | } |
| 248 | return ts_TEIC(teic); |
| 249 | } |
| 250 | |
| 251 | /* 7.7.15 Tunnel Endpoint Identifier Data II */ |
| 252 | template (value) TeidDataII ts_TeidDataII(template (value) BIT4 nsapi, |
| 253 | template (value) OCT4 teid) := { |
| 254 | type_gtpc := '12'O, |
| 255 | nsapi := nsapi, |
| 256 | unused := '0000'B, |
| 257 | teidDataII := teid |
| 258 | } |
| 259 | template (present) TeidDataII tr_TeidDataII(template (present) BIT4 nsapi := ?, |
| 260 | template (present) OCT4 teid := ?) := { |
| 261 | type_gtpc := '12'O, |
| 262 | nsapi := nsapi, |
| 263 | unused := '0000'B, |
| 264 | teidDataII := teid |
| 265 | } |
| 266 | |
Pau Espin Pedrol | 38968e9 | 2022-05-13 16:17:48 +0200 | [diff] [blame] | 267 | /* IMEI(SV) IE TS 29.060 7.7.53 */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 268 | template (value) IMEISV_gtpc ts_IMEISV(template (value) OCT8 imeisv) := { |
Pau Espin Pedrol | 38968e9 | 2022-05-13 16:17:48 +0200 | [diff] [blame] | 269 | type_gtpc := '9A'O, |
| 270 | lengthf := 8, |
| 271 | imeisv := imeisv |
| 272 | } |
| 273 | private function f_ts_IMEISV(template (omit) OCT8 imeisv) |
| 274 | return template (omit) IMEISV_gtpc { |
| 275 | if (istemplatekind(imeisv, "omit")) { |
| 276 | return omit; |
| 277 | } |
| 278 | return ts_IMEISV(imeisv); |
| 279 | } |
| 280 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 281 | template (present) IMEISV_gtpc tr_IMEISV(template (present) OCT8 imeisv) := { |
Pau Espin Pedrol | 38968e9 | 2022-05-13 16:17:48 +0200 | [diff] [blame] | 282 | type_gtpc := '9A'O, |
| 283 | lengthf := 8, |
| 284 | imeisv := imeisv |
| 285 | } |
| 286 | |
Pau Espin Pedrol | 535ca26 | 2022-05-16 14:07:17 +0200 | [diff] [blame] | 287 | // MS Time Zone - 7.7.52 |
| 288 | template (value) MS_TimeZone ts_MS_TimeZone(template (value) OCT1 timeZone := '00'O, |
| 289 | template (value) BIT2 daylightSavingTime := '00'B) := { |
| 290 | type_gtpc := '99'O, |
| 291 | lengthf := 2, |
| 292 | timeZone := timeZone, |
| 293 | daylightSavingTime := daylightSavingTime, |
| 294 | spare1 := '000'B, |
| 295 | sgsnAttempsToUpdateMS := '0'B, /* propietary, use it as spare */ |
| 296 | spare2 := '00'B |
| 297 | } |
| 298 | function f_ts_MS_TimeZone(template (omit) OCT1 timeZone, template (omit) BIT2 daylightSavingTime) |
| 299 | return template (omit) MS_TimeZone { |
| 300 | if (istemplatekind(timeZone, "omit") and istemplatekind(daylightSavingTime, "omit")) { |
| 301 | return omit; |
| 302 | } |
| 303 | if (istemplatekind(timeZone, "omit")) { |
| 304 | return ts_MS_TimeZone(daylightSavingTime := daylightSavingTime); |
| 305 | } |
| 306 | if (istemplatekind(daylightSavingTime, "omit")) { |
| 307 | return ts_MS_TimeZone(timeZone); |
| 308 | } |
| 309 | return ts_MS_TimeZone(timeZone, daylightSavingTime); |
| 310 | } |
| 311 | |
| 312 | template (present) MS_TimeZone tr_MS_TimeZone(template (present) OCT1 timeZone := ?, |
| 313 | template (present) BIT2 daylightSavingTime := ?) := { |
| 314 | type_gtpc := '99'O, |
| 315 | lengthf := 2, |
| 316 | timeZone := timeZone, |
| 317 | daylightSavingTime := daylightSavingTime, |
| 318 | spare1 := '000'B, |
| 319 | sgsnAttempsToUpdateMS := '0'B, /* propietary, use it as spare */ |
| 320 | spare2 := '00'B |
| 321 | } |
| 322 | |
Pau Espin Pedrol | 0e12787 | 2022-05-12 17:58:50 +0200 | [diff] [blame] | 323 | /* Charging Characteristics IE TS 29.060 7.7.23 */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 324 | template (value) ChargingCharacteristics_GTPC ts_ChargingCharacteristics(template (value) OCT2 chargingChar) := { |
Pau Espin Pedrol | 0e12787 | 2022-05-12 17:58:50 +0200 | [diff] [blame] | 325 | type_gtpc := '1A'O, |
| 326 | chargingChar := chargingChar |
| 327 | } |
| 328 | private function f_ts_ChargingCharacteristics(template (omit) OCT2 chargingChar) |
| 329 | return template (omit) ChargingCharacteristics_GTPC { |
| 330 | if (istemplatekind(chargingChar, "omit")) { |
| 331 | return omit; |
| 332 | } |
| 333 | return ts_ChargingCharacteristics(chargingChar); |
| 334 | } |
| 335 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 336 | template (present) ChargingCharacteristics_GTPC tr_ChargingCharacteristics(template (present) OCT2 chargingChar) := { |
Pau Espin Pedrol | 0e12787 | 2022-05-12 17:58:50 +0200 | [diff] [blame] | 337 | type_gtpc := '1A'O, |
| 338 | chargingChar := chargingChar |
| 339 | } |
| 340 | |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 341 | /* 7.7.28 MM Context */ |
Vadim Yanitskiy | fdde168 | 2024-04-06 05:34:24 +0700 | [diff] [blame] | 342 | template (value) MM_Context ts_MM_ContextGSM(template (value) OCT8 kc, |
| 343 | template (value) BIT3 cksn := '000'B, |
| 344 | template (value) BIT3 gea := '000'B) := { |
| 345 | type_gtpc := '81'O, |
| 346 | context := { |
| 347 | mmcontGSM := { |
| 348 | lengthf := 0, /* overwritten */ |
| 349 | cksn := cksn, |
Vadim Yanitskiy | 95fb629 | 2024-04-19 01:17:48 +0700 | [diff] [blame] | 350 | spare := '11111'B, |
Vadim Yanitskiy | fdde168 | 2024-04-06 05:34:24 +0700 | [diff] [blame] | 351 | usedCipher := gea, |
Vadim Yanitskiy | 95fb629 | 2024-04-19 01:17:48 +0700 | [diff] [blame] | 352 | noofVectors := 0, /* overwritten */ |
| 353 | security := '01'B, /* GSM key and triplets */ |
Vadim Yanitskiy | fdde168 | 2024-04-06 05:34:24 +0700 | [diff] [blame] | 354 | kc := kc, |
| 355 | triplet := ''O, |
| 356 | drx_par := '0000'O, |
| 357 | msNetW_cap_length := 0, /* overwritten */ |
| 358 | msNetw_cap := omit, |
| 359 | containerLength := 0, /* overwritten */ |
| 360 | container := omit, |
| 361 | access_restriction_data_length := 0, |
| 362 | access_restriction_data := omit |
| 363 | } |
| 364 | } |
| 365 | } |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 366 | template (value) MM_Context ts_MM_ContextUMTS(template (value) OCT16 ck, |
| 367 | template (value) OCT16 ik) := { |
| 368 | type_gtpc := '81'O, |
| 369 | context := { |
| 370 | mmcontUMTS := { |
| 371 | lengthf := 0, /* overwritten */ |
| 372 | ksi := '001'B, |
| 373 | usedGPRSIntegrityAlgorithm := '000'B, |
| 374 | ugipai := '1'B, /* Integrity Protection not required */ |
| 375 | gupii := '1'B, /* Ignore "Used GPRS integrity protection algorithm" field" */ |
Vadim Yanitskiy | 95fb629 | 2024-04-19 01:17:48 +0700 | [diff] [blame] | 376 | spare1 := '111'B, |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 377 | noofVectors := 0, /* TODO: fill quintpuplets*/ |
Vadim Yanitskiy | 95fb629 | 2024-04-19 01:17:48 +0700 | [diff] [blame] | 378 | security := '10'B, /* UMTS key and quintuplets */ |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 379 | ck := ck, |
| 380 | ik := ik, |
| 381 | quintupletlength := 0, /* overwritten */ |
| 382 | quintuplet := ''O, |
| 383 | drx_par := '0000'O, |
| 384 | msNetW_cap_length := 0, /* overwritten */ |
| 385 | msNetw_cap := omit, |
| 386 | containerLength := 0, /* overwritten */ |
| 387 | container := omit, |
| 388 | access_restriction_data_length := 0, /* overwritten */ |
| 389 | access_restriction_data := omit |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | /* 7.7.29 PDP Context */ |
| 395 | template (value) PDP_Context_GTPC ts_PDP_Context_GTPC(template (value) octetstring pdp_addr, |
| 396 | template (value) octetstring ggsn_gsn_addr, |
| 397 | template (value) octetstring apn, |
| 398 | template (value) OCT4 ggsn_teic := '12345678'O, |
| 399 | template (value) OCT4 ggsn_teid := '87654321'O) := { |
| 400 | type_gtpc := '82'O, |
| 401 | lengthf := 0, /* overwritten */ |
| 402 | nsapi := '0101'B, |
| 403 | order := '0'B, |
| 404 | asi := '0'B, |
| 405 | vaa := '0'B, |
| 406 | ea := '0'B, |
| 407 | sapi := '0011'B, |
| 408 | spare1 := '0000'B, |
| 409 | qos_subLength := 0, /* overwritten */ |
| 410 | qos_sub := ts_QosProfileValueDefault, |
| 411 | qos_reqLength := 0, /* overwritten */ |
| 412 | qos_req := ts_QosProfileValueDefault, |
| 413 | qos_negLength := 0, /* overwritten */ |
| 414 | qos_neg := ts_QosProfileValueDefault, |
| 415 | snd := '0000'O, |
| 416 | snu := '0000'O, |
| 417 | sendNPDUnum := '00'O, |
| 418 | receiveNPDUnum := '00'O, |
| 419 | uteidControlPlane := ggsn_teic, |
| 420 | uteidData1 := ggsn_teid, |
| 421 | pdpcontext := '00'O, |
| 422 | pdp_typeorg := '0001'B, /* IETF */ |
| 423 | spare2 := '1111'B, |
| 424 | pdp_typenum := '21'O, /* IETF IPV4 */ |
| 425 | pdp_addressLength := 0, /* overwritten */ |
| 426 | pdp_address := pdp_addr, |
| 427 | ggsn_addressControlPlaneLength := 0, /* overwritten */ |
| 428 | ggsn_addressControlPlane := ggsn_gsn_addr, |
| 429 | ggsn_addressUserPlaneLength := 0, /* overwritten */ |
| 430 | ggsn_addressUserPlane := ggsn_gsn_addr, |
| 431 | apnLength := 0, /* overwritten */ |
| 432 | apn := apn, |
| 433 | transactionId := '0001'B, |
| 434 | spare3 := '0000'B, |
| 435 | transactionID_cont := '00'O, |
| 436 | pdp_typenum2 := omit, |
| 437 | pdp_addresslength2 := omit, |
| 438 | pdp_Address2 := omit |
| 439 | } |
| 440 | |
Pau Espin Pedrol | 0e12787 | 2022-05-12 17:58:50 +0200 | [diff] [blame] | 441 | |
Philipp Maier | 1c0c726 | 2023-07-24 10:51:53 +0200 | [diff] [blame] | 442 | /* template matching reception of GTP-C unit-data */ |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 443 | template (present) Gtp1cUnitdata tr_GTPC_MsgType(template (present) Gtp1cPeer peer, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 444 | template (present) OCT1 msg_type, |
| 445 | template (present) OCT4 teid, |
| 446 | template (present) GTPC_PDUs pdus := ?) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 447 | peer := peer, |
| 448 | gtpc := tr_GTP1C_PDU(msg_type, teid, pdus) |
| 449 | } |
| 450 | |
| 451 | /* template matching reception of GTP-C echo-request */ |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 452 | template (present) Gtp1cUnitdata tr_GTPC_PING(template (present) Gtp1cPeer peer) := tr_GTPC_MsgType(peer, echoRequest, '00000000'O); |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 453 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 454 | template (present) GTPC_PDUs tr_EchoRespPDU(template (present) OCT1 restart_counter) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 455 | echoResponse := { |
| 456 | recovery := tr_Recovery(restart_counter), |
| 457 | private_extension_gtpc := * |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | /* template matching reception of GTP-C echo-response */ |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 462 | template (present) Gtp1cUnitdata tr_GTPC_PONG(template (present) Gtp1cPeer peer) := tr_GTPC_MsgType(peer, echoResponse, '00000000'O, tr_EchoRespPDU(?)); |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 463 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 464 | template (value) GTPC_PDUs ts_EchoRespPDU(OCT1 restart_counter) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 465 | echoResponse := { |
| 466 | recovery := ts_Recovery(restart_counter), |
| 467 | private_extension_gtpc := omit |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | /* master template for senidng a GTP-C echo response */ |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 472 | template (value) Gtp1cUnitdata ts_GTPC_PONG(Gtp1cPeer peer, uint16_t seq, OCT1 rest_ctr) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 473 | peer := peer, |
| 474 | gtpc := ts_GTP1C_PDU(echoResponse, '00000000'O, valueof(ts_EchoRespPDU(rest_ctr)), seq) |
| 475 | } |
| 476 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 477 | template (value) GTPC_PDUs ts_EchoReqPDU := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 478 | echoRequest := { |
| 479 | private_extension_gtpc := omit |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | /* master template for sending a GTP-C echo request */ |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 484 | template (value) Gtp1cUnitdata ts_GTPC_PING(Gtp1cPeer peer, uint16_t seq) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 485 | peer := peer, |
| 486 | gtpc := ts_GTP1C_PDU(echoRequest, '00000000'O, valueof(ts_EchoReqPDU), seq) |
| 487 | } |
| 488 | |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 489 | private function f_eua_ipv4_len(template OCT4 ip_addr) return template (present) integer { |
Pau Espin Pedrol | 001b3e8 | 2022-02-23 18:38:37 +0100 | [diff] [blame] | 490 | if (istemplatekind(ip_addr, "omit")) { |
| 491 | return 2; |
| 492 | } else if (istemplatekind(ip_addr, "*")) { |
| 493 | return ?; |
| 494 | } else if (istemplatekind(ip_addr, "?")) { |
| 495 | return 6; |
| 496 | } |
| 497 | return 6; |
| 498 | } |
| 499 | |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 500 | private function f_eua_ipv6_len(template OCT16 ip_addr) return template (present) integer { |
Pau Espin Pedrol | 001b3e8 | 2022-02-23 18:38:37 +0100 | [diff] [blame] | 501 | if (istemplatekind(ip_addr, "omit")) { |
| 502 | return 2; |
| 503 | } else if (istemplatekind(ip_addr, "*")) { |
| 504 | return ?; |
| 505 | } else if (istemplatekind(ip_addr, "?")) { |
| 506 | return 18; |
| 507 | } |
| 508 | return 18; |
| 509 | } |
| 510 | |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 511 | private function f_eua_ipv4v6_len(template OCT4 ip_addr4, template OCT16 ip_addr6) return template (present) integer { |
Pau Espin Pedrol | 001b3e8 | 2022-02-23 18:38:37 +0100 | [diff] [blame] | 512 | var integer len := 2; |
| 513 | if (istemplatekind(ip_addr4, "*") or |
| 514 | istemplatekind(ip_addr6, "*")) { |
| 515 | return ?; |
| 516 | } |
| 517 | if (not istemplatekind(ip_addr4, "omit")) { |
| 518 | len := len + 4; |
| 519 | } |
| 520 | if (not istemplatekind(ip_addr6, "omit")) { |
| 521 | len := len + 16; |
| 522 | } |
| 523 | return len; |
| 524 | } |
| 525 | |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 526 | template (present) EndUserAddress t_EuaIPv4(template OCT4 ip_addr) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 527 | type_gtpc := '80'O, |
| 528 | endUserAddress := { |
| 529 | endUserAddressIPv4 := { |
| 530 | lengthf := 2, |
| 531 | pdp_typeorg := '0001'B, |
| 532 | spare := '1111'B, |
| 533 | pdp_typenum := '21'O, |
| 534 | ipv4_address := ip_addr |
| 535 | } |
| 536 | } |
| 537 | } |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 538 | template (present) EndUserAddress t_EuaIPv4Dyn := t_EuaIPv4(omit); |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 539 | template (present) EndUserAddress tr_EuaIPv4(template (present) OCT4 ip_addr) modifies t_EuaIPv4 := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 540 | endUserAddress := { |
| 541 | endUserAddressIPv4 := { |
Pau Espin Pedrol | 001b3e8 | 2022-02-23 18:38:37 +0100 | [diff] [blame] | 542 | lengthf := f_eua_ipv4_len(ip_addr) |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 543 | } |
| 544 | } |
| 545 | } |
| 546 | |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 547 | template (present) EndUserAddress t_EuaIPv6(template OCT16 ip_addr) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 548 | type_gtpc := '80'O, |
| 549 | endUserAddress := { |
| 550 | endUserAddressIPv6 := { |
| 551 | lengthf := 2, |
| 552 | pdp_typeorg := '0001'B, |
| 553 | spare := '1111'B, |
| 554 | pdp_typenum := '57'O, |
| 555 | ipv6_address := ip_addr |
| 556 | } |
| 557 | } |
| 558 | } |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 559 | template (present) EndUserAddress t_EuaIPv6Dyn := t_EuaIPv6(omit); |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 560 | template (present) EndUserAddress tr_EuaIPv6(template (present) OCT16 ip_addr) modifies t_EuaIPv6 := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 561 | endUserAddress := { |
| 562 | endUserAddressIPv6 := { |
Pau Espin Pedrol | 001b3e8 | 2022-02-23 18:38:37 +0100 | [diff] [blame] | 563 | lengthf := f_eua_ipv6_len(ip_addr) |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 564 | } |
| 565 | } |
| 566 | } |
| 567 | |
Oliver Smith | ee6a088 | 2019-03-08 11:05:46 +0100 | [diff] [blame] | 568 | /* 3GPP TS 29.060 Figure 37A: End User Address Information Element for IPv4v6 (both static) */ |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 569 | template (present) EndUserAddress t_EuaIPv4v6(template OCT4 ip_addr4, template OCT16 ip_addr6) := { |
Oliver Smith | ee6a088 | 2019-03-08 11:05:46 +0100 | [diff] [blame] | 570 | type_gtpc := '80'O, |
| 571 | endUserAddress := { |
| 572 | endUserAddressIPv4andIPv6 := { |
| 573 | lengthf := 2, |
| 574 | pdp_typeorg := '0001'B, |
| 575 | spare := '1111'B, |
| 576 | pdp_typenum := '8D'O, |
| 577 | ipv4_address := ip_addr4, |
| 578 | ipv6_address := ip_addr6 |
| 579 | } |
| 580 | } |
| 581 | } |
Pau Espin Pedrol | 0d138c6 | 2023-08-31 16:23:18 +0200 | [diff] [blame] | 582 | template (present) EndUserAddress t_EuaIPv4Dynv6Dyn := t_EuaIPv4v6(omit, omit); |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 583 | template (present) EndUserAddress tr_EuaIPv4v6(template (present) OCT4 ip_addr4, |
| 584 | template (present) OCT16 ip_addr6) modifies t_EuaIPv4v6 := { |
Oliver Smith | ee6a088 | 2019-03-08 11:05:46 +0100 | [diff] [blame] | 585 | endUserAddress := { |
| 586 | endUserAddressIPv4andIPv6 := { |
Pau Espin Pedrol | 001b3e8 | 2022-02-23 18:38:37 +0100 | [diff] [blame] | 587 | lengthf := f_eua_ipv4v6_len(ip_addr4, ip_addr6) |
Oliver Smith | ee6a088 | 2019-03-08 11:05:46 +0100 | [diff] [blame] | 588 | } |
| 589 | } |
| 590 | } |
| 591 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 592 | template (value) AccessPointName ts_APN(octetstring apn) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 593 | type_gtpc := '83'O, |
| 594 | lengthf := lengthof(apn), |
| 595 | apn_value := apn |
| 596 | } |
| 597 | |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 598 | template (value) GSN_Address_GTPC ts_GsnAddr(template (value) octetstring ip_addr) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 599 | type_gtpc := '85'O, |
| 600 | lengthf := lengthof(ip_addr), |
| 601 | addressf := ip_addr |
| 602 | } |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 603 | template (present) GSN_Address_GTPC tr_GsnAddr(template (present) octetstring ip_addr := ?) := { |
| 604 | type_gtpc := '85'O, |
| 605 | lengthf := ?, |
| 606 | addressf := ip_addr |
| 607 | } |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 608 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 609 | template (value) MSISDN ts_Msisdn(octetstring msisdn) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 610 | type_gtpc := '86'O, |
| 611 | lengthf := lengthof(msisdn), |
| 612 | msisdn := msisdn |
| 613 | } |
| 614 | |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 615 | template (value) QoSV_GTPC ts_QosValueDefault := { |
| 616 | reliabilityClass := '011'B, |
| 617 | delayClass := '001'B, |
| 618 | spare1 := '00'B, |
| 619 | precedenceClass := '010'B, |
| 620 | spare2 := '0'B, |
| 621 | peakThroughput := '1001'B, |
| 622 | meanThroughput := '11111'B, |
| 623 | spare3 := '000'B, |
| 624 | deliverErroneusSDU := '010'B, /* Erroneus SDU are delivered */ |
| 625 | deliveryOrder := '10'B, /* Without delivery order */ |
| 626 | trafficClass := '100'B, /* Background */ |
| 627 | maxSDUSize := '96'O, /* 1500 octets */ |
| 628 | maxBitrateUplink := 'FE'O, /* 8640, continues in extended octet */ |
| 629 | maxBitrateDownlink := 'FE'O, /* 8640, continues in extended octet */ |
| 630 | sduErrorRatio := '0100'B, /* 1x10^-4 */ |
| 631 | residualBER := '0101'B, /* 1x10^-3 */ |
| 632 | trafficHandlingPriority := '01'B, /* prio 1 */ |
| 633 | transferDelay := '000001'B, /* 10 ms */ |
| 634 | guaranteedBitRateUplink := 'FE'O, /* 8640, continues in extended octet */ |
| 635 | guaranteedBitRateDownlink := 'FE'O, /* 8640, continues in extended octet */ |
| 636 | sourceStatisticsDescriptor := '0000'B, /* unknown */ |
| 637 | signallingIndication := '0'B, /* Not optimized */ |
| 638 | spare4 := '000'B, |
| 639 | maxBitrateDownlinkExt := '5B'O, /* 33 mbps */ |
| 640 | guaranteedBitRateDownlinkExt := '5B'O, /* 33 mbps */ |
| 641 | maxBitrateUplinkExt := '6e'O, /* 52 mbps */ |
| 642 | guaranteedBitRateUplinkExt := '6e'O /* 52 mbps */ |
| 643 | } |
| 644 | |
| 645 | template (value) QualityOfServiceProfile_Value ts_QosProfileValueDefault := { |
| 646 | allocRetensionPrio := '00'O, |
| 647 | qos_ProfileValue := ts_QosValueDefault |
| 648 | } |
| 649 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 650 | template (value) QualityOfServiceProfile ts_QosDefault := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 651 | type_gtpc := '87'O, |
Pau Espin Pedrol | 7d58b08 | 2022-06-07 13:30:03 +0200 | [diff] [blame] | 652 | lengthf := 17, |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 653 | allocRetensionPrio := '00'O, |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 654 | qos_ProfileValue := ts_QosValueDefault |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 655 | } |
| 656 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 657 | template (value) IMSI_gtpc ts_Imsi(hexstring digits) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 658 | type_gtpc := '02'O, |
| 659 | digits := digits, |
| 660 | padding := 'F'H |
| 661 | } |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 662 | function f_ts_Imsi(template (omit) hexstring digits := omit) return template (omit) IMSI_gtpc { |
| 663 | var template (omit) IMSI_gtpc imsi; |
| 664 | if (istemplatekind(digits, "omit")) { |
| 665 | imsi := omit; |
| 666 | } else { |
| 667 | imsi := ts_Imsi(valueof(digits)); |
| 668 | } |
| 669 | return imsi; |
| 670 | } |
| 671 | template (present) IMSI_gtpc tr_Imsi(template (present) hexstring digits) := { |
| 672 | type_gtpc := '02'O, |
| 673 | digits := digits, |
| 674 | padding := 'F'H |
| 675 | } |
| 676 | function f_tr_Imsi(template hexstring digits := *) return template IMSI_gtpc { |
| 677 | if (istemplatekind(digits, "omit")) { |
| 678 | return omit; |
| 679 | } else if (istemplatekind(digits, "*")) { |
| 680 | return *; |
| 681 | } else { |
| 682 | return tr_Imsi(digits); |
| 683 | } |
| 684 | } |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 685 | |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 686 | /* 7.7.50 RAT Type */ |
| 687 | type enumerated GTP_RATType { |
| 688 | GTP_RAT_TYPE_RESERVED (0), |
| 689 | GTP_RAT_TYPE_UTRAN (1), |
| 690 | GTP_RAT_TYPE_GERAN (2), |
| 691 | GTP_RAT_TYPE_WLAN (3), |
| 692 | GTP_RAT_TYPE_GAN (4), |
| 693 | GTP_RAT_TYPE_HSPA_E (5), |
| 694 | GTP_RAT_TYPE_EUTRAN (6) |
| 695 | }; |
| 696 | template (value) RATType ts_RATType(template (value) OCT1 rat_type) := { |
| 697 | type_gtpc := '97'O, |
| 698 | lengthf := 1, |
| 699 | ratTypeValue := rat_type |
| 700 | } |
| 701 | function f_ts_RATType(template (omit) OCT1 rat_type := omit) return template (omit) RATType { |
| 702 | if (istemplatekind(rat_type, "omit")) { |
| 703 | return omit; |
Pau Espin Pedrol | 38aeffb | 2022-02-01 20:46:29 +0100 | [diff] [blame] | 704 | } else { |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 705 | return ts_RATType(rat_type); |
Pau Espin Pedrol | 38aeffb | 2022-02-01 20:46:29 +0100 | [diff] [blame] | 706 | } |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 707 | } |
| 708 | template (present) RATType tr_RATType(template (present) OCT1 rat_type) := { |
| 709 | type_gtpc := '97'O, |
| 710 | lengthf := 1, |
| 711 | ratTypeValue := rat_type |
| 712 | } |
| 713 | function f_tr_RATType(template OCT1 rat_type := *) return template RATType { |
| 714 | if (istemplatekind(rat_type, "omit")) { |
| 715 | return omit; |
| 716 | } else if (istemplatekind(rat_type, "*")) { |
| 717 | return *; |
| 718 | } else { |
| 719 | return tr_RATType(rat_type); |
| 720 | } |
Pau Espin Pedrol | 38aeffb | 2022-02-01 20:46:29 +0100 | [diff] [blame] | 721 | } |
| 722 | |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 723 | template (value) RoutingAreaIdentity ts_RoutingAreaIdentity(template (value) hexstring mcc_digits, |
| 724 | template (value) hexstring mnc_digits, |
| 725 | template (value) OCT2 lac, |
| 726 | template (value) OCT1 rac) := { |
| 727 | type_gtpc := '03'O, |
| 728 | mcc_digits := mcc_digits, |
| 729 | mnc_digits := mnc_digits, |
| 730 | lac := lac, |
| 731 | rac := rac |
| 732 | } |
| 733 | |
Pau Espin Pedrol | ca587f1 | 2022-02-02 10:42:01 +0100 | [diff] [blame] | 734 | template (value) GeographicLocationCGI |
| 735 | ts_GeographicLocationCGI(template (value) hexstring mcc, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 736 | template (value) hexstring mnc, |
| 737 | template (value) OCT2 lac, |
| 738 | template (value) OCT2 cI_value) := |
Pau Espin Pedrol | ca587f1 | 2022-02-02 10:42:01 +0100 | [diff] [blame] | 739 | { |
| 740 | mccDigit1 := mcc[0], |
| 741 | mccDigit2 := mcc[1], |
| 742 | mccDigit3 := mcc[2], |
| 743 | mncDigit3 := mnc[2], /* 'F'H for 2 digit MNC */ |
| 744 | mncDigit1 := mnc[0], |
| 745 | mncDigit2 := mnc[1], |
| 746 | lac := lac, |
| 747 | cI_value := cI_value |
| 748 | } |
| 749 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 750 | template (value) GTPC_PDUs ts_CreatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, |
| 751 | BIT4 nsapi, EndUserAddress eua, octetstring apn, |
| 752 | octetstring sgsn_ip_sign, octetstring sgsn_ip_data, |
| 753 | octetstring msisdn, template (omit) ProtConfigOptions pco := omit, |
| 754 | template (omit) OCT1 ratType := omit, |
| 755 | template (omit) UserLocationInformation uli := omit, |
| 756 | template (omit) OCT2 charging_char := omit, |
| 757 | template (omit) OCT8 imeisv := omit, |
| 758 | template (omit) MS_TimeZone ms_tz := omit) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 759 | createPDPContextRequest := { |
| 760 | imsi := ts_Imsi(imsi), |
| 761 | rai := omit, |
| 762 | recovery := ts_Recovery(restart_ctr), |
| 763 | selectionMode := { |
| 764 | type_gtpc := '0F'O, |
| 765 | selectModeValue := '00'B, |
| 766 | spare := '111111'B |
| 767 | }, |
| 768 | teidDataI := { |
| 769 | type_gtpc := '00'O, |
| 770 | teidDataI := teid_data |
| 771 | }, |
| 772 | teidControlPlane := { |
| 773 | type_gtpc := '00'O, |
| 774 | teidControlPlane := teid_ctrl |
| 775 | }, |
| 776 | nsapi := { |
| 777 | type_gtpc := '00'O, |
| 778 | nsapi := nsapi, |
| 779 | unused := '0000'B |
| 780 | }, |
| 781 | linked_nsapi := omit, |
Pau Espin Pedrol | 0e12787 | 2022-05-12 17:58:50 +0200 | [diff] [blame] | 782 | charging_char := f_ts_ChargingCharacteristics(charging_char), |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 783 | trace_ref := omit, |
| 784 | trace_type := omit, |
| 785 | endUserAddress := eua, |
| 786 | accessPointName := ts_APN(apn), |
| 787 | protConfigOptions := pco, |
| 788 | sgsn_addr_signalling := ts_GsnAddr(sgsn_ip_sign), |
| 789 | sgsn_addr_traffic := ts_GsnAddr(sgsn_ip_data), |
| 790 | msisdn := ts_Msisdn(msisdn), |
| 791 | qualityOfServiceProfile := ts_QosDefault, |
| 792 | tft := omit, |
| 793 | triggerId := omit, |
| 794 | omcId := omit, |
| 795 | commonFlags := omit, |
| 796 | aPN_Restriction := omit, |
Pau Espin Pedrol | 38aeffb | 2022-02-01 20:46:29 +0100 | [diff] [blame] | 797 | ratType := f_ts_RATType(ratType), |
Pau Espin Pedrol | ca587f1 | 2022-02-02 10:42:01 +0100 | [diff] [blame] | 798 | userLocationInformation := uli, |
Pau Espin Pedrol | 535ca26 | 2022-05-16 14:07:17 +0200 | [diff] [blame] | 799 | mS_TimeZone := ms_tz, |
Pau Espin Pedrol | 38968e9 | 2022-05-13 16:17:48 +0200 | [diff] [blame] | 800 | imeisv := f_ts_IMEISV(imeisv), |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 801 | camelChargingInformationContainer := omit, |
| 802 | additionalTraceInfo := omit, |
| 803 | correlationID := omit, |
| 804 | evolvedAllocationRetentionPriorityI := omit, |
| 805 | extendedCommonFlags := omit, |
| 806 | userCSGInformation := omit, |
| 807 | aPN_AMBR := omit, |
| 808 | signallingPriorityIndication := omit, |
| 809 | cN_OperatorSelectionEntity := omit, |
| 810 | private_extension_gtpc := omit |
| 811 | } |
| 812 | } |
| 813 | |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 814 | template (value) Gtp1cUnitdata ts_GTPC_CreatePDP(Gtp1cPeer peer, uint16_t seq, hexstring imsi, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 815 | OCT1 restart_ctr, OCT4 teid_data, |
| 816 | OCT4 teid_ctrl, BIT4 nsapi, EndUserAddress eua, |
| 817 | octetstring apn, octetstring sgsn_ip_sign, |
| 818 | octetstring sgsn_ip_data, octetstring msisdn, |
| 819 | template (omit) ProtConfigOptions pco := omit, |
| 820 | template (omit) OCT1 ratType := omit, |
| 821 | template (omit) UserLocationInformation uli := omit, |
| 822 | template (omit) OCT2 charging_char := omit, |
| 823 | template (omit) OCT8 imeisv := omit, |
| 824 | template (omit) MS_TimeZone ms_tz := omit) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 825 | peer := peer, |
| 826 | gtpc := ts_GTP1C_PDU(createPDPContextRequest, '00000000'O, |
| 827 | valueof(ts_CreatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl, |
| 828 | nsapi, eua, apn, sgsn_ip_sign, |
Pau Espin Pedrol | 38968e9 | 2022-05-13 16:17:48 +0200 | [diff] [blame] | 829 | sgsn_ip_data, msisdn, pco, ratType, uli, |
Pau Espin Pedrol | 535ca26 | 2022-05-16 14:07:17 +0200 | [diff] [blame] | 830 | charging_char, imeisv, ms_tz)), seq) |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 831 | } |
| 832 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 833 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 834 | template (value) GTPC_PDUs ts_UpdatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, |
| 835 | BIT4 nsapi, |
| 836 | octetstring sgsn_ip_sign, octetstring sgsn_ip_data, |
| 837 | template (omit) ProtConfigOptions pco := omit, |
| 838 | template (omit) OCT1 ratType := omit, |
| 839 | template (omit) UserLocationInformation uli := omit) := { |
Pau Espin Pedrol | cd326c5 | 2022-02-14 18:57:43 +0100 | [diff] [blame] | 840 | updatePDPContextRequest := { |
| 841 | updatePDPContextRequestSGSN := { |
| 842 | imsi := ts_Imsi(imsi), |
| 843 | rai := omit, |
| 844 | recovery := ts_Recovery(restart_ctr), |
| 845 | teidDataI := { |
| 846 | type_gtpc := '00'O, |
| 847 | teidDataI := teid_data |
| 848 | }, |
| 849 | teidControlPlane := { |
| 850 | type_gtpc := '00'O, |
| 851 | teidControlPlane := teid_ctrl |
| 852 | }, |
| 853 | nsapi := { |
| 854 | type_gtpc := '00'O, |
| 855 | nsapi := nsapi, |
| 856 | unused := '0000'B |
| 857 | }, |
| 858 | trace_ref := omit, |
| 859 | trace_type := omit, |
| 860 | protConfigOptions := pco, |
| 861 | sgsn_addr_controlPlane := ts_GsnAddr(sgsn_ip_sign), |
| 862 | sgsn_addr_traffic := ts_GsnAddr(sgsn_ip_data), |
| 863 | alt_ggsn_addr_controlPane := omit, |
| 864 | alt_ggsn_addr_traffic := omit, |
| 865 | qualityOfServiceProfile := ts_QosDefault, |
| 866 | tft := omit, |
| 867 | triggerId := omit, |
| 868 | omcId := omit, |
| 869 | commonFlags := omit, |
| 870 | ratType := f_ts_RATType(ratType), |
| 871 | userLocationInformation := uli, |
| 872 | mS_TimeZone := omit, |
| 873 | additionalTraceInfo := omit, |
| 874 | directTunnelFlags := omit, |
| 875 | evolvedAllocationRetentionPriorityI := omit, |
| 876 | extendedCommonFlags := omit, |
| 877 | userCSGInformation := omit, |
| 878 | aPN_AMBR := omit, |
| 879 | signallingPriorityIndication := omit, |
| 880 | cN_OperatorSelectionEntity := omit, |
| 881 | private_extension_gtpc := omit |
| 882 | } |
| 883 | } |
| 884 | } |
| 885 | |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 886 | template (value) Gtp1cUnitdata ts_GTPC_UpdatePDP(Gtp1cPeer peer, OCT4 teid, uint16_t seq, hexstring imsi, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 887 | OCT1 restart_ctr, OCT4 teid_data, |
| 888 | OCT4 teid_ctrl, BIT4 nsapi, octetstring sgsn_ip_sign, |
| 889 | octetstring sgsn_ip_data, |
| 890 | template (omit) ProtConfigOptions pco := omit, |
| 891 | template (omit) OCT1 ratType := omit, |
| 892 | template (omit) UserLocationInformation uli := omit) := { |
Pau Espin Pedrol | cd326c5 | 2022-02-14 18:57:43 +0100 | [diff] [blame] | 893 | peer := peer, |
| 894 | gtpc := ts_GTP1C_PDU(updatePDPContextRequest, teid, |
| 895 | valueof(ts_UpdatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl, |
| 896 | nsapi, sgsn_ip_sign, |
| 897 | sgsn_ip_data, pco, ratType, uli)), seq) |
| 898 | } |
| 899 | |
| 900 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 901 | template (value) NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 902 | type_gtpc := '14'O, |
| 903 | nsapi := nsapi, |
| 904 | unused := '0000'B |
| 905 | } |
| 906 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 907 | template (value) ReorderingRequired ts_ReorderReq(boolean req := false) := { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 908 | type_gtpc := '08'O, |
| 909 | reordreq := bool2bit(req), |
| 910 | spare := '0000000'B |
| 911 | } |
| 912 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 913 | template (value) GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, |
| 914 | octetstring ggsn_ip_sign, octetstring ggsn_ip_data, |
| 915 | OCT4 chg_id, template (omit) EndUserAddress eua := omit, |
| 916 | template (omit) Recovery_gtpc recovery := omit, |
| 917 | template (omit) ProtConfigOptions pco := omit) := { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 918 | createPDPContextResponse := { |
| 919 | cause := { '00'O, cause }, |
| 920 | reorderingRequired := ts_ReorderReq(false), |
Pau Espin Pedrol | 9401345 | 2018-07-17 15:50:21 +0200 | [diff] [blame] | 921 | recovery := recovery, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 922 | teidDataI := { |
| 923 | type_gtpc := '00'O, |
| 924 | teidDataI := teid_data |
| 925 | }, |
| 926 | teidControlPlane := { |
| 927 | type_gtpc := '00'O, |
| 928 | teidControlPlane := teid_ctrl |
| 929 | }, |
| 930 | nsapi := ts_NSAPI(nsapi), |
Harald Welte | 7aff2ca | 2018-02-18 15:34:50 +0100 | [diff] [blame] | 931 | chargingID := { |
| 932 | type_gtpc := '7F'O, |
| 933 | chargingID := chg_id |
| 934 | }, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 935 | endUserAddress := eua, |
| 936 | protConfigOptions := pco, |
| 937 | ggsn_addr_controlPlane := ts_GsnAddr(ggsn_ip_sign), |
| 938 | ggsn_addr_traffic := ts_GsnAddr(ggsn_ip_data), |
| 939 | alt_ggsn_addr_controlPane := omit, |
| 940 | alt_ggsn_addr_traffic := omit, |
| 941 | qualityOfServiceProfile := ts_QosDefault, |
| 942 | commonFlags := omit, |
| 943 | aPN_Restriction := omit, |
| 944 | mS_InfoChangeReportingAction := omit, |
| 945 | bearerControlMode := omit, |
| 946 | evolvedAllocationRetentionPriorityI := omit, |
| 947 | extendedCommonFlag := omit, |
| 948 | csg_information_reporting_action := omit, |
| 949 | aPN_AMBR := omit, |
| 950 | gGSN_BackOffTime := omit, |
| 951 | private_extension_gtpc := omit |
| 952 | } |
| 953 | } |
| 954 | |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 955 | template (value) Gtp1cUnitdata ts_GTPC_CreatePdpResp(Gtp1cPeer peer, uint16_t seq, OCT4 teid, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 956 | OCT1 cause, |
| 957 | OCT4 teid_ctrl, OCT4 teid_data, |
| 958 | BIT4 nsapi, octetstring ggsn_ip_sign, |
| 959 | octetstring ggsn_ip_data, OCT4 chg_id, |
| 960 | template (omit) EndUserAddress eua := omit, |
| 961 | template (omit) Recovery_gtpc recovery := omit, |
| 962 | template (omit) ProtConfigOptions pco := omit) := { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 963 | peer := peer, |
| 964 | gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid, |
| 965 | valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi, |
Harald Welte | 7aff2ca | 2018-02-18 15:34:50 +0100 | [diff] [blame] | 966 | ggsn_ip_sign, ggsn_ip_data, chg_id, |
Pau Espin Pedrol | 9401345 | 2018-07-17 15:50:21 +0200 | [diff] [blame] | 967 | eua, recovery, pco)), seq) |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 968 | } |
| 969 | |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 970 | /* PCO send base template */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 971 | template (value) ProtConfigOptions ts_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 972 | type_gtpc := '84'O, |
| 973 | lengthf := 0, |
| 974 | configProtocol := '000'B, |
| 975 | spare := '0000'B, |
| 976 | extension0 := '1'B, |
| 977 | protocols := {} |
| 978 | } |
| 979 | /* PCO receive base template */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 980 | template (present) ProtConfigOptions tr_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 981 | type_gtpc := '84'O, |
| 982 | lengthf := ?, |
| 983 | configProtocol := '000'B, |
| 984 | spare := ?, |
| 985 | extension0 := '1'B, |
| 986 | protocols := {} |
| 987 | } |
| 988 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 989 | template (value) ProtConfigOptions ts_PCO_IPv6_DNS modifies ts_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 990 | protocols := { |
| 991 | { protocolID := '0003'O, lengthProtoID := 0, protoIDContents := ''O } |
| 992 | } |
| 993 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 994 | template (present) ProtConfigOptions tr_PCO_IPv6_DNS_resp(template (present) OCT16 contents) modifies tr_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 995 | protocols := { |
| 996 | *, { protocolID := '0003'O, lengthProtoID := 16, protoIDContents := contents }, * |
| 997 | } |
| 998 | } |
| 999 | |
Pau Espin Pedrol | cff72f8 | 2024-01-26 16:58:48 +0100 | [diff] [blame] | 1000 | template (value) ProtConfigOptions ts_PCO_IPv4_DNS_IPCP(uint8_t ipcp_req_id := 0) modifies ts_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1001 | protocols := { |
| 1002 | /* dummy PAP entry to check if our parser in the GGSN can properly iterate over |
| 1003 | * the list of protocols, see Change-Id Icc2e6716c33d78d3c3e000f529806228d8aa155e */ |
| 1004 | { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, |
| 1005 | { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := |
Pau Espin Pedrol | cff72f8 | 2024-01-26 16:58:48 +0100 | [diff] [blame] | 1006 | enc_IpcpPacket(valueof(ts_IPCP_ReqDNS(ipcp_req_id))) } |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1007 | } |
| 1008 | } |
| 1009 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1010 | template (value) ProtConfigOptions ts_PCO_IPv4_PRI_DNS_IPCP modifies ts_PCO := { |
Philipp Maier | 33e5261 | 2018-05-30 17:22:02 +0200 | [diff] [blame] | 1011 | protocols := { |
| 1012 | /* dummy PAP entry to check if our parser can cope with a single primary DNS entry |
| 1013 | * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ |
| 1014 | { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, |
| 1015 | { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := |
| 1016 | enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Primary)) } |
| 1017 | } |
| 1018 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1019 | template (value) ProtConfigOptions ts_PCO_IPv4_SEC_DNS_IPCP modifies ts_PCO := { |
Philipp Maier | 33e5261 | 2018-05-30 17:22:02 +0200 | [diff] [blame] | 1020 | protocols := { |
| 1021 | /* dummy PAP entry to check if our parser can cope with a single secondary DNS entry |
| 1022 | * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ |
| 1023 | { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, |
| 1024 | { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := |
| 1025 | enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Secondary)) } |
| 1026 | } |
| 1027 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1028 | template (value) ProtConfigOptions ts_PCO_IPv4_SEPARATE_DNS_IPCP modifies ts_PCO := { |
Philipp Maier | 33e5261 | 2018-05-30 17:22:02 +0200 | [diff] [blame] | 1029 | protocols := { |
| 1030 | /* dummy PAP entry to check if our parser can cope with a primary and secondary DNS |
| 1031 | * in separate IPCP containers OS#3381 */ |
| 1032 | { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, |
| 1033 | { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := |
| 1034 | enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Primary)) }, |
| 1035 | { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := |
| 1036 | enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Secondary)) } |
| 1037 | } |
| 1038 | } |
| 1039 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1040 | template (present) ProtocolElement tr_PCO_Proto(OCT2 prot_id) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1041 | protocolID := prot_id, |
| 1042 | lengthProtoID := ?, |
| 1043 | protoIDContents := ? |
| 1044 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1045 | template (value) ProtocolElement ts_PCOelem_PAP_broken := { |
Harald Welte | f829854 | 2019-04-10 10:15:28 +0200 | [diff] [blame] | 1046 | protocolID := 'C023'O, |
| 1047 | lengthProtoID := 60, |
| 1048 | /* PPP Password Authentication Protocol containing incorrect Peer-Id-Length set to 4 (6-7 should be the valid one), see OS#3914. */ |
| 1049 | protoIDContents := '0100003c'O & '0444435338323700bc1c08087c1508083e00790000150808fd06000001000000000000000000000000000000000000000000000000000000'O |
| 1050 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1051 | template (value) ProtConfigOptions ts_PCO_PAP_IPv4_DNS modifies ts_PCO := { |
Harald Welte | f829854 | 2019-04-10 10:15:28 +0200 | [diff] [blame] | 1052 | protocols := { |
| 1053 | ts_PCOelem_PAP_broken, |
| 1054 | { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := enc_IpcpPacket(valueof(ts_IPCP_ReqDNS)) } |
| 1055 | } |
| 1056 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1057 | template (present) ProtConfigOptions tr_PCO_Contains(OCT2 prot_id) modifies tr_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1058 | protocols := { *, tr_PCO_Proto(prot_id), * } |
| 1059 | } |
| 1060 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1061 | template (value) ProtConfigOptions ts_PCO_IPv4_DNS_CONT modifies ts_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1062 | protocols := { |
| 1063 | { protocolID := '000d'O, lengthProtoID := 0, protoIDContents := ''O } |
| 1064 | } |
| 1065 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1066 | template (present) ProtConfigOptions tr_PCO_IPv4_DNS_CONT_resp(template (present) OCT4 contents) modifies tr_PCO := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1067 | protocols := { |
| 1068 | *, { protocolID := '000d'O, lengthProtoID := 4, protoIDContents := contents }, * |
| 1069 | } |
| 1070 | } |
| 1071 | |
| 1072 | /* extract a given protocol payload from PCO */ |
| 1073 | function f_PCO_extract_proto(ProtConfigOptions pco, OCT2 protocol, integer nth_match := 1) return octetstring { |
| 1074 | var integer i; |
| 1075 | var integer num_matches := 0; |
| 1076 | for (i := 0; i < lengthof(pco.protocols); i := i + 1) { |
| 1077 | if (pco.protocols[i].protocolID == protocol) { |
| 1078 | num_matches := num_matches + 1; |
| 1079 | if (num_matches == nth_match) { |
| 1080 | return pco.protocols[i].protoIDContents; |
| 1081 | } |
| 1082 | } |
| 1083 | } |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 1084 | setverdict(fail, "Could not extract protocol payload from protocol ", protocol); |
| 1085 | mtc.stop; |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1086 | return ''O; |
| 1087 | } |
| 1088 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1089 | template (present) IpcpPacket tr_IPCP(template (present) LcpCode code, template (present)uint8_t identifier, |
| 1090 | template (present) IpcpOptionList opts) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1091 | code := code, |
| 1092 | identifier := identifier, |
| 1093 | len := ?, |
| 1094 | options := opts |
| 1095 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1096 | template (present) IpcpOption tr_IPCP_PrimaryDns(template (present) OCT4 addr) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1097 | code := IPCP_OPT_PrimaryDNS, |
| 1098 | len := 6, |
| 1099 | data := addr |
| 1100 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1101 | template (present) IpcpOption tr_IPCP_SecondaryDns(template (present) OCT4 addr) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1102 | code := IPCP_OPT_SecondaryDNS, |
| 1103 | len := 6, |
| 1104 | data := addr |
| 1105 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1106 | template (present) IpcpPacket tr_IPCP_Ack_DNS(template (present) uint8_t identifier := ?, |
| 1107 | template (present) OCT4 dns1 := ?, |
| 1108 | template (present) OCT4 dns2 := ?) := |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1109 | tr_IPCP(LCP_Configure_Ack, identifier, |
| 1110 | { *, tr_IPCP_PrimaryDns(dns1), *, tr_IPCP_SecondaryDns(dns2), * }); |
| 1111 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1112 | template (value) IpcpPacket ts_IPCP(LcpCode code, uint8_t identifier, template (value) IpcpOptionList opts) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1113 | code := code, |
| 1114 | identifier := identifier, |
| 1115 | len := 0, /* overwritten */ |
| 1116 | options := opts |
| 1117 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1118 | template (value) IpcpPacket ts_IPCP_ReqDNS(uint8_t identifier := 0) := |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1119 | ts_IPCP(LCP_Configure_Request, identifier, |
| 1120 | { tr_IPCP_PrimaryDns('00000000'O), tr_IPCP_SecondaryDns('00000000'O) }); |
| 1121 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1122 | template (value) IpcpPacket ts_IPCP_ReqDNS_Primary(uint8_t identifier := 0) := |
Philipp Maier | 33e5261 | 2018-05-30 17:22:02 +0200 | [diff] [blame] | 1123 | ts_IPCP(LCP_Configure_Request, identifier, |
| 1124 | { tr_IPCP_PrimaryDns('00000000'O) }); |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1125 | template (value) IpcpPacket ts_IPCP_ReqDNS_Secondary(uint8_t identifier := 0) := |
Philipp Maier | 33e5261 | 2018-05-30 17:22:02 +0200 | [diff] [blame] | 1126 | ts_IPCP(LCP_Configure_Request, identifier, |
| 1127 | { tr_IPCP_SecondaryDns('00000000'O) }); |
| 1128 | |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 1129 | function f_teardown_ind_IE(in template (omit) BIT1 ind) return template (omit) TearDownInd { |
| 1130 | if (istemplatekind(ind, "omit")) { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1131 | return omit; |
| 1132 | } |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1133 | var TearDownInd ret := { |
| 1134 | type_gtpc := '13'O, |
| 1135 | tdInd := valueof(ind), |
| 1136 | spare:= '0000000'B |
| 1137 | } |
| 1138 | return ret; |
| 1139 | } |
| 1140 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1141 | template (value) GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1142 | deletePDPContextRequest := { |
| 1143 | cause := omit, |
| 1144 | tearDownIndicator := f_teardown_ind_IE(teardown_ind), |
| 1145 | nsapi := { |
| 1146 | type_gtpc := '14'O, |
| 1147 | nsapi := nsapi, |
| 1148 | unused := '0000'B |
| 1149 | }, |
| 1150 | protConfigOptions := omit, |
| 1151 | userLocationInformation := omit, |
| 1152 | mS_TimeZone := omit, |
| 1153 | extendedCommonFlags := omit, |
| 1154 | uLI_Timestamp := omit, |
| 1155 | private_extension_gtpc := omit |
| 1156 | } |
| 1157 | } |
| 1158 | |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1159 | template (value) Gtp1cUnitdata ts_GTPC_DeletePDP(Gtp1cPeer peer, uint16_t seq, OCT4 teid, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1160 | BIT4 nsapi, template (omit) BIT1 teardown_ind) := { |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1161 | peer := peer, |
| 1162 | gtpc := ts_GTP1C_PDU(deletePDPContextRequest, teid, |
| 1163 | valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) |
| 1164 | } |
| 1165 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1166 | template (value) GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, |
| 1167 | template (omit) ProtConfigOptions pco := omit) := { |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 1168 | deletePDPContextResponse := { |
| 1169 | cause := { '00'O, cause }, |
| 1170 | protConfigOptions := pco, |
| 1171 | userLocationInformation := omit, |
| 1172 | mS_TimeZone := omit, |
| 1173 | uLI_Timestamp := omit, |
| 1174 | private_extension_gtpc := omit |
| 1175 | } |
| 1176 | } |
| 1177 | |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1178 | template (value) Gtp1cUnitdata ts_GTPC_DeletePdpResp(Gtp1cPeer peer, uint16_t seq, OCT4 teid, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1179 | OCT1 cause, |
| 1180 | template (omit) ProtConfigOptions pco := omit) := { |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 1181 | peer := peer, |
| 1182 | gtpc := ts_GTP1C_PDU(deletePDPContextResponse, teid, |
| 1183 | valueof(ts_DeletePdpRespPDU(cause, pco)), seq) |
| 1184 | } |
| 1185 | |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1186 | /* SGSN Context Request - 7.5.3 */ |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1187 | template (present) GTPC_PDUs tr_SGSNContextReqPDU(template (present) RoutingAreaIdentity rai := ?, |
| 1188 | template (present) OCT4 teic := ?, |
| 1189 | template (present) octetstring sgsn_addr_control := ?, |
| 1190 | template hexstring imsi := *, |
| 1191 | template BIT1 msValidated := *, |
| 1192 | template TLLI tlli := *, |
| 1193 | template PacketTMSI ptmsi := *, |
| 1194 | template PTMSI_Signature ptmsi_sig := *, |
| 1195 | template OCT1 rat_type := *) := { |
| 1196 | sgsn_ContextRequest := { |
| 1197 | imsi := f_tr_Imsi(imsi), |
| 1198 | routingAreaIdentity := rai, |
| 1199 | tlli := tlli, |
| 1200 | packetTMSI := ptmsi, |
| 1201 | ptmsi_Signature := ptmsi_sig, |
| 1202 | ms_Validated := f_tr_MS_Validated(msValidated), |
| 1203 | teidControlPlane := { |
| 1204 | type_gtpc := '11'O, |
| 1205 | teidControlPlane := teic |
| 1206 | }, |
| 1207 | sgsn_addr_controlPlane := tr_GsnAddr(sgsn_addr_control), |
| 1208 | alternative_sgsn_addr_controlPlane := *, |
| 1209 | sGSN_Number := *, |
| 1210 | ratType := f_tr_RATType(rat_type), |
| 1211 | hopCounter := *, |
| 1212 | private_extension_gtpc := * |
| 1213 | } |
| 1214 | } |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1215 | template (present) Gtp1cUnitdata tr_GTPC_SGSNContextReq(template (present) Gtp1cPeer peer, |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1216 | template (present) GTPC_PDUs SGSNContextReqPDU) := { |
| 1217 | peer := peer, |
| 1218 | gtpc := tr_GTP1C_PDU(sgsnContextRequest, '00000000'O, SGSNContextReqPDU) |
| 1219 | } |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1220 | template (value) GTPC_PDUs ts_SGSNContextReqPDU(template (value) RoutingAreaIdentity rai, |
| 1221 | template (value) OCT4 teic, |
| 1222 | template (value) octetstring sgsn_addr_control, |
| 1223 | template (omit) hexstring imsi := omit, |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1224 | template (omit) BIT1 msValidated := '0'B, |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1225 | template (omit) TLLI tlli := omit, |
| 1226 | template (omit) PacketTMSI ptmsi := omit, |
| 1227 | template (omit) PTMSI_Signature ptmsi_sig := omit, |
| 1228 | template (omit) OCT1 rat_type := omit) := { |
| 1229 | sgsn_ContextRequest := { |
| 1230 | imsi := f_ts_Imsi(imsi), |
| 1231 | routingAreaIdentity := rai, |
| 1232 | tlli := tlli, |
| 1233 | packetTMSI := ptmsi, |
| 1234 | ptmsi_Signature := ptmsi_sig, |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1235 | ms_Validated := f_ts_MS_Validated(msValidated), |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1236 | teidControlPlane := { |
| 1237 | type_gtpc := '11'O, |
| 1238 | teidControlPlane := teic |
| 1239 | }, |
| 1240 | sgsn_addr_controlPlane := ts_GsnAddr(sgsn_addr_control), |
| 1241 | alternative_sgsn_addr_controlPlane := omit, |
| 1242 | sGSN_Number := omit, |
| 1243 | ratType := f_ts_RATType(rat_type), |
| 1244 | hopCounter := omit, |
| 1245 | private_extension_gtpc := omit |
| 1246 | } |
| 1247 | } |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1248 | template (value) Gtp1cUnitdata ts_GTPC_SGSNContextReq(Gtp1cPeer peer, uint16_t seq, |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1249 | template (value) GTPC_PDUs SGSNContextReqPDU) := { |
| 1250 | peer := peer, |
| 1251 | gtpc := ts_GTP1C_PDU(sgsnContextRequest, '00000000'O, valueof(SGSNContextReqPDU), seq) |
| 1252 | } |
| 1253 | |
| 1254 | /* SGSN Context Response - 7.5.4 */ |
| 1255 | template (present) GTPC_PDUs tr_SGSNContextRespPDU(template (present) GTP_Cause cause := ?, |
| 1256 | template hexstring imsi := *) := { |
| 1257 | sgsn_ContextResponse := { |
| 1258 | cause := tr_Cause_gtpc(cause), |
| 1259 | imsi := f_tr_Imsi(imsi), |
| 1260 | teidControlPlane := *, |
| 1261 | rabContext := *, |
| 1262 | radioPrioritySMS := *, |
| 1263 | radioPriority := *, |
| 1264 | packetFlowID := *, |
| 1265 | charging_char := *, |
| 1266 | mm_Context := *, |
| 1267 | pdp_Context := *, |
| 1268 | sgsn_addr_controlPlane := *, |
| 1269 | pdpContextPriorization := *, |
| 1270 | radioPriority_LCS := *, |
| 1271 | mBMS_UE_Context := *, |
| 1272 | subscribedRFSP_Index := *, |
| 1273 | rFSP_IndexInUse := *, |
| 1274 | colocatedGGSN_PGW_FQDN := *, |
| 1275 | evolvedAllocationRetentionPriorityII := *, |
| 1276 | extendedCommonFlags := *, |
| 1277 | ue_network_capability := *, |
| 1278 | ue_ambr := *, |
| 1279 | apn_ambr_nsapi := *, |
| 1280 | signallingPriorityIndication_nsapi := *, |
| 1281 | higher_bitrates_than_16mbps_flag := *, |
| 1282 | selectionMode_nsapi := *, |
| 1283 | localHomeNetworkID_nsapi := *, |
| 1284 | uE_UsageType := *, |
| 1285 | extendedCommonFlagsII := *, |
| 1286 | private_extension_gtpc := * |
| 1287 | } |
| 1288 | } |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1289 | template (present) Gtp1cUnitdata tr_GTPC_SGSNContextResp(template (present) Gtp1cPeer peer := ?, |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1290 | template (present) OCT4 teid := ?, |
| 1291 | template (present) GTPC_PDUs SGSNContextRespPDU := ?) |
| 1292 | := tr_GTPC_MsgType(peer, sgsnContextResponse, teid, SGSNContextRespPDU); |
| 1293 | |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1294 | template (value) GTPC_PDUs ts_SGSNContextRespPDU(template (value) GTP_Cause cause, |
| 1295 | template (omit) hexstring imsi := omit, |
| 1296 | template (omit) OCT4 teic := omit, |
| 1297 | template (omit) octetstring sgsn_addr_control := omit, |
| 1298 | template (omit) MM_Context mm_context := omit, |
| 1299 | template (omit) PDP_Context_GTPC_List pdp_ctx_list := omit) := { |
| 1300 | sgsn_ContextResponse := { |
| 1301 | cause := ts_Cause_gtpc(cause), |
| 1302 | imsi := f_ts_Imsi(imsi), |
| 1303 | teidControlPlane := f_ts_TEIC(teic), |
| 1304 | rabContext := omit, |
| 1305 | radioPrioritySMS := omit, |
| 1306 | radioPriority := omit, |
| 1307 | packetFlowID := omit, |
| 1308 | charging_char := omit, |
| 1309 | mm_Context := mm_context, |
| 1310 | pdp_Context := pdp_ctx_list, |
| 1311 | sgsn_addr_controlPlane := ts_GsnAddr(sgsn_addr_control), |
| 1312 | pdpContextPriorization := omit, |
| 1313 | radioPriority_LCS := omit, |
| 1314 | mBMS_UE_Context := omit, |
| 1315 | subscribedRFSP_Index := omit, |
| 1316 | rFSP_IndexInUse := omit, |
| 1317 | colocatedGGSN_PGW_FQDN := omit, |
| 1318 | evolvedAllocationRetentionPriorityII := omit, |
| 1319 | extendedCommonFlags := omit, |
| 1320 | ue_network_capability := omit, |
| 1321 | ue_ambr := omit, |
| 1322 | apn_ambr_nsapi := omit, |
| 1323 | signallingPriorityIndication_nsapi := omit, |
| 1324 | higher_bitrates_than_16mbps_flag := omit, |
| 1325 | selectionMode_nsapi := omit, |
| 1326 | localHomeNetworkID_nsapi := omit, |
| 1327 | uE_UsageType := omit, |
| 1328 | extendedCommonFlagsII := omit, |
| 1329 | private_extension_gtpc := omit |
| 1330 | } |
| 1331 | } |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1332 | template (value) Gtp1cUnitdata ts_GTPC_SGSNContextResp(Gtp1cPeer peer, OCT4 teid, uint16_t seq, |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1333 | template (value) GTPC_PDUs SGSNContextRespPDU) := { |
| 1334 | peer := peer, |
| 1335 | gtpc := ts_GTP1C_PDU(sgsnContextResponse, teid, valueof(SGSNContextRespPDU), seq) |
| 1336 | } |
| 1337 | |
| 1338 | |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1339 | /* SGSN Context Acknowledge - 7.5.5 */ |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1340 | template (present) GTPC_PDUs tr_SGSNContextAckPDU(template (present) GTP_Cause cause := ?) := { |
| 1341 | sgsn_ContextAcknowledge := { |
| 1342 | cause := tr_Cause_gtpc(cause), |
| 1343 | teidDataII := *, |
| 1344 | sgsn_AddressForUserTraffic := *, |
| 1345 | sgsn_Number := *, |
| 1346 | nodeIdentifier := *, |
| 1347 | private_extension_gtpc := * |
| 1348 | } |
| 1349 | } |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1350 | template (present) Gtp1cUnitdata tr_GTPC_SGSNContextAck(template (present) Gtp1cPeer peer := ?, |
Pau Espin Pedrol | f95460b | 2024-01-09 10:25:15 +0100 | [diff] [blame] | 1351 | template (present) OCT4 teid := ?, |
| 1352 | template (present) GTPC_PDUs SGSNContextAckPDU := ?) |
| 1353 | := tr_GTPC_MsgType(peer, sgsnContextAcknowledge, teid, SGSNContextAckPDU); |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1354 | template (value) GTPC_PDUs ts_SGSNContextAckPDU(template (value) GTP_Cause cause := GTP_CAUSE_REQUEST_ACCEPTED) := { |
| 1355 | sgsn_ContextAcknowledge := { |
| 1356 | cause := ts_Cause_gtpc(cause), |
| 1357 | teidDataII := omit, |
| 1358 | sgsn_AddressForUserTraffic := omit, |
| 1359 | sgsn_Number := omit, |
| 1360 | nodeIdentifier := omit, |
| 1361 | private_extension_gtpc := omit |
| 1362 | } |
| 1363 | } |
Vadim Yanitskiy | 061c36d | 2024-04-19 02:07:52 +0700 | [diff] [blame] | 1364 | |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1365 | template (value) Gtp1cUnitdata ts_GTPC_SGSNContextAck(Gtp1cPeer peer, OCT4 teid, uint16_t seq, |
Vadim Yanitskiy | 061c36d | 2024-04-19 02:07:52 +0700 | [diff] [blame] | 1366 | template (value) GTPC_PDUs SGSNContextAckPDU := ts_SGSNContextAckPDU) := { |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1367 | peer := peer, |
Pau Espin Pedrol | ca651b5 | 2023-12-20 18:37:39 +0100 | [diff] [blame] | 1368 | gtpc := ts_GTP1C_PDU(sgsnContextAcknowledge, teid, valueof(SGSNContextAckPDU), seq) |
Pau Espin Pedrol | 408e0ae | 2023-12-15 18:56:31 +0100 | [diff] [blame] | 1369 | } |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 1370 | |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1371 | /* GTP-C RIM */ |
| 1372 | |
| 1373 | template (value) RIM_Application_Identity_GTPC ts_GTPC_RIM_Application_Identity(OCT1 app_id) := { |
| 1374 | iEI := '4B'O, |
| 1375 | ext := '1'B, |
| 1376 | lengthIndicator := { |
| 1377 | length1 := 1 |
| 1378 | }, |
| 1379 | rIMApplicationIdentity := app_id |
| 1380 | } |
| 1381 | /* 3GPP TS 48.018 11.3.62 */ |
| 1382 | template (value) RIM_Sequence_Number_GTPC ts_GTPC_RIM_Sequence_Number(integer seq) := { |
| 1383 | iEI := '4C'O, |
| 1384 | ext := '1'B, |
| 1385 | lengthIndicator := { |
| 1386 | length1 := 4 |
| 1387 | }, |
| 1388 | rIMSequenceNumber := int2oct(seq, 4) |
| 1389 | } |
| 1390 | template (value) RIM_PDU_Indications_GTPC ts_GTPC_RIM_PDU_Indications(boolean ack, BIT3 type_ext) := { |
| 1391 | iEI := '4F'O, |
| 1392 | ext := '1'B, |
| 1393 | lengthIndicator := { |
| 1394 | length1 := 1 |
| 1395 | }, |
| 1396 | ack := bool2bit(ack), |
| 1397 | pDU_Type_Extension := type_ext, |
| 1398 | reserved := '0000'B |
| 1399 | } |
| 1400 | /* 3GPP TS 48.018 11.3.67 */ |
| 1401 | template (value) RIM_Protocol_Version_Number_GTPC ts_GTPC_RIM_Protocol_Version_Number(integer ver) := { |
| 1402 | iEI := '55'O, |
| 1403 | ext := '1'B, |
| 1404 | lengthIndicator := { |
| 1405 | length1 := 1 |
| 1406 | }, |
| 1407 | rIMProtocolVersionNumber := int2oct(ver, 1) |
| 1408 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1409 | function tr_GTPC_Cell_Identifier_V(template (present) GTP_CellId cid) return template (present) Cell_Identifier_V_GTPC { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1410 | var template Cell_Identifier_V_GTPC ret := { |
| 1411 | mccDigit1 := ?, |
| 1412 | mccDigit2 := ?, |
| 1413 | mccDigit3 := ?, |
| 1414 | mncDigit3 := ?, |
| 1415 | mncDigit1 := ?, |
| 1416 | mncDigit2 := ?, |
| 1417 | lac := ?, |
| 1418 | rac := ?, |
| 1419 | cI_value := ? |
| 1420 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1421 | if (istemplatekind(cid, "?")) { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1422 | return ?; |
| 1423 | } |
| 1424 | if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { |
| 1425 | if (isvalue(cid.ra_id.lai.mcc_mnc)) { |
| 1426 | ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; |
| 1427 | ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; |
| 1428 | ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; |
| 1429 | ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; |
| 1430 | ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; |
| 1431 | ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; |
| 1432 | } |
| 1433 | if (isvalue(cid.ra_id.lai.lac)) { |
| 1434 | ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); |
| 1435 | } |
| 1436 | } |
| 1437 | if (isvalue(cid) and isvalue(cid.ra_id)) { |
| 1438 | ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); |
| 1439 | } |
| 1440 | if (isvalue(cid)) { |
| 1441 | ret.cI_value := f_oct_or_wc(cid.cell_id, 2); |
| 1442 | } |
| 1443 | return ret; |
| 1444 | } |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 1445 | template (value) Cell_Identifier_V_GTPC ts_GTPC_Cell_Identifier_V(GTP_CellId cid) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1446 | mccDigit1 := cid.ra_id.lai.mcc_mnc[0], |
| 1447 | mccDigit2 := cid.ra_id.lai.mcc_mnc[1], |
| 1448 | mccDigit3 := cid.ra_id.lai.mcc_mnc[2], |
| 1449 | mncDigit3 := cid.ra_id.lai.mcc_mnc[3], |
| 1450 | mncDigit1 := cid.ra_id.lai.mcc_mnc[4], |
| 1451 | mncDigit2 := cid.ra_id.lai.mcc_mnc[5], |
| 1452 | lac := int2oct(cid.ra_id.lai.lac, 2), |
| 1453 | rac := int2oct(cid.ra_id.rac, 1), |
| 1454 | cI_value := int2oct(cid.cell_id, 2) |
| 1455 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1456 | template (value) RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(GTP_CellId cid) := { |
| 1457 | cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1458 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1459 | function tr_GTPC_ENB_Identifier(template (present) GTP_CellId cid, |
| 1460 | template (present) integer tac, |
| 1461 | template (present) octetstring gnbid) return template (present) ENB_Identifier { |
| 1462 | var template (present) ENB_Identifier ret := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1463 | mccDigit1 := ?, |
| 1464 | mccDigit2 := ?, |
| 1465 | mccDigit3 := ?, |
| 1466 | mncDigit3 := ?, |
| 1467 | mncDigit1 := ?, |
| 1468 | mncDigit2 := ?, |
| 1469 | tAC := ?, |
| 1470 | globalENB_ID := ? |
| 1471 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1472 | if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1473 | return ?; |
| 1474 | } |
| 1475 | if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { |
| 1476 | if (isvalue(cid.ra_id.lai.mcc_mnc)) { |
| 1477 | ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; |
| 1478 | ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; |
| 1479 | ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; |
| 1480 | ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; |
| 1481 | ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; |
| 1482 | ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; |
| 1483 | } |
| 1484 | } |
| 1485 | if (isvalue(tac)) { |
| 1486 | ret.tAC := int2oct(valueof(tac), 2); |
| 1487 | } |
| 1488 | if (isvalue(gnbid)) { |
| 1489 | ret.globalENB_ID := gnbid; |
| 1490 | } |
| 1491 | |
| 1492 | return ret; |
| 1493 | } |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 1494 | template (value) ENB_Identifier ts_GTPC_ENB_Identifier(GTP_CellId cid, integer tac, octetstring gnbid) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1495 | mccDigit1 := cid.ra_id.lai.mcc_mnc[0], |
| 1496 | mccDigit2 := cid.ra_id.lai.mcc_mnc[1], |
| 1497 | mccDigit3 := cid.ra_id.lai.mcc_mnc[2], |
| 1498 | mncDigit3 := cid.ra_id.lai.mcc_mnc[3], |
| 1499 | mncDigit1 := cid.ra_id.lai.mcc_mnc[4], |
| 1500 | mncDigit2 := cid.ra_id.lai.mcc_mnc[5], |
| 1501 | tAC := int2oct(tac, 2), |
| 1502 | globalENB_ID := gnbid |
| 1503 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1504 | template (value) RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(GTP_CellId cid, integer tac, octetstring gnbid) := { |
| 1505 | eNB_Identifier := ts_GTPC_ENB_Identifier(cid, tac, gnbid) |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1506 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1507 | template (present) RIM_Routing_Information_GTPC |
| 1508 | tr_GTPC_RIM_Routing_Information(HEX1 addr_discr, template (present) RIM_Routing_Address_GTPC addr) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1509 | iEI := '54'O, |
| 1510 | ext := '1'B, |
| 1511 | lengthIndicator := { |
| 1512 | length1 := ? |
| 1513 | }, |
| 1514 | rIMRoutingAddressDiscriminator := addr_discr, |
| 1515 | spare := '0'H, |
| 1516 | rIM_Routing_Address := addr |
| 1517 | } |
| 1518 | template (value) RIM_Routing_Information_GTPC |
| 1519 | ts_GTPC_RIM_Routing_Information(HEX1 addr_discr, template (value) RIM_Routing_Address_GTPC addr) := { |
| 1520 | iEI := '54'O, |
| 1521 | ext := '1'B, |
| 1522 | lengthIndicator := { |
| 1523 | length1 := 0 /* overwritten */ |
| 1524 | }, |
| 1525 | rIMRoutingAddressDiscriminator := addr_discr, |
| 1526 | spare := '0'H, |
| 1527 | rIM_Routing_Address := addr |
| 1528 | } |
| 1529 | /* 3GPP TS 48.018 11.3.63.1.1 */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1530 | template (present) RAN_Information_Request_Application_Container_NACC_GTPC |
| 1531 | tr_GTPC_RAN_Information_Request_Application_Container_NACC(template (present) GTP_CellId cid) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1532 | iEI := '4D'O, |
| 1533 | ext := '1'B, |
| 1534 | lengthIndicator := { |
| 1535 | length1 := ? |
| 1536 | }, |
| 1537 | reporting_Cell_Identifier := tr_GTPC_Cell_Identifier_V(cid) |
| 1538 | } |
| 1539 | template (value) RAN_Information_Request_Application_Container_NACC_GTPC |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 1540 | ts_GTPC_RAN_Information_Request_Application_Container_NACC(GTP_CellId cid) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1541 | iEI := '4D'O, |
| 1542 | ext := '1'B, |
| 1543 | lengthIndicator := { |
| 1544 | length1 := 0 /* overwritten */ |
| 1545 | }, |
| 1546 | reporting_Cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) |
| 1547 | } |
| 1548 | /* 3GPP TS 48.018 11.3.63.1 */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1549 | template (present) RAN_Information_Request_Application_Container_GTPC |
| 1550 | tru_GTPC_RAN_Information_Request_Application_Container_NACC(template (present) GTP_CellId cid) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1551 | nacc := tr_GTPC_RAN_Information_Request_Application_Container_NACC(cid) |
| 1552 | } |
| 1553 | template (value) RAN_Information_Request_Application_Container_GTPC |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 1554 | tsu_GTPC_RAN_Information_Request_Application_Container_NACC(GTP_CellId cid) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1555 | nacc := ts_GTPC_RAN_Information_Request_Application_Container_NACC(cid) |
| 1556 | } |
| 1557 | /* 3GPP TS 48.018 11.3.63.2.1 */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1558 | template (present) RAN_Information_Application_Container_NACC_GTPC |
| 1559 | tr_GTPC_RAN_Information_Application_Container_NACC(template (present) GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1560 | iEI := '4E'O, |
| 1561 | ext := '1'B, |
| 1562 | lengthIndicator := { |
| 1563 | length1 := ? |
| 1564 | }, |
| 1565 | reporting_Cell_Identifier := tr_GTPC_Cell_Identifier_V(cid), |
| 1566 | typeBit := bool2bit(psi_type), |
| 1567 | number_of_SI_PSI := int2bit(si_psi_num, 7), |
| 1568 | sI_PSI := si_psi |
| 1569 | } |
| 1570 | template (value) RAN_Information_Application_Container_NACC_GTPC |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 1571 | ts_GTPC_RAN_Information_Application_Container_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1572 | iEI := '4E'O, |
| 1573 | ext := '1'B, |
| 1574 | lengthIndicator := { |
| 1575 | length1 := 0 /* overwritten */ |
| 1576 | }, |
| 1577 | reporting_Cell_Identifier := ts_GTPC_Cell_Identifier_V(cid), |
| 1578 | typeBit := bool2bit(psi_type), |
| 1579 | number_of_SI_PSI := int2bit(si_psi_num, 7), |
| 1580 | sI_PSI := si_psi |
| 1581 | } |
Philipp Maier | f7cb0bb | 2023-07-28 12:35:38 +0200 | [diff] [blame] | 1582 | external function enc_RIM_Routing_Address_GTPC(in RIM_Routing_Address_GTPC ra) return octetstring |
| 1583 | with { extension "prototype(convert) encode(RAW)" }; |
Philipp Maier | 21bac7a | 2023-08-24 12:40:17 +0200 | [diff] [blame] | 1584 | external function dec_RIM_Routing_Address_GTPC(in octetstring stream) return RIM_Routing_Address_GTPC |
Philipp Maier | f7cb0bb | 2023-07-28 12:35:38 +0200 | [diff] [blame] | 1585 | with { extension "prototype(convert) decode(RAW)" }; |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1586 | |
| 1587 | /* RAN_Information_Request */ |
| 1588 | template (value) RAN_Information_Request_RIM_Container_GTPC |
| 1589 | ts_GTPC_RAN_Information_Request_RIM_Container(template (value) RIM_Application_Identity_GTPC app_id, |
| 1590 | template (value) RIM_Sequence_Number_GTPC seq, |
| 1591 | template (value) RIM_PDU_Indications_GTPC ind, |
| 1592 | template (omit) RIM_Protocol_Version_Number_GTPC ver := omit, |
| 1593 | template (omit) RAN_Information_Request_Application_Container_GTPC app_cont := omit, |
| 1594 | template (omit) SON_TransferApplicationIdentity son_app_id := omit) := { |
| 1595 | iEI := '57'O, |
| 1596 | ext := '1'B, |
| 1597 | lengthIndicator := { |
| 1598 | length1 := 0 /* overwritten */ |
| 1599 | }, |
| 1600 | rIM_Application_Identity := app_id, |
| 1601 | rIM_Sequence_Number := seq, |
| 1602 | rIM_PDU_Indications := ind, |
| 1603 | rIM_Protocol_Version_Number := ver, |
| 1604 | application_Container := app_cont, |
| 1605 | sON_TransferApplicationIdentity := son_app_id |
| 1606 | } |
| 1607 | template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC |
| 1608 | ts_GTPC_RAN_Information_Request(template (value) RIM_Routing_Information_GTPC dest, |
| 1609 | template (value) RIM_Routing_Information_GTPC src, |
Philipp Maier | 6cef1c3 | 2023-07-24 11:01:52 +0200 | [diff] [blame] | 1610 | template (value) RAN_Information_Request_RIM_Container_GTPC cont) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1611 | bssgpPduType := '71'O, |
| 1612 | destination_Cell_Identifier := dest, |
| 1613 | source_Cell_Identifier := src, |
| 1614 | rIM_Container := cont |
| 1615 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1616 | template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC |
| 1617 | tr_GTPC_RAN_Information_Request(template (present) RIM_Routing_Information_GTPC dest := ?, |
| 1618 | template (present) RIM_Routing_Information_GTPC src := ?, |
| 1619 | template (present) RAN_Information_Request_RIM_Container_GTPC cont := ?) := { |
Philipp Maier | 4b81c6e | 2023-07-24 11:03:15 +0200 | [diff] [blame] | 1620 | bssgpPduType := '71'O, |
| 1621 | destination_Cell_Identifier := dest, |
| 1622 | source_Cell_Identifier := src, |
| 1623 | rIM_Container := cont |
| 1624 | } |
| 1625 | |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1626 | template (value) RANTransparentContainer ts_RANTransparentContainer_RAN_INFO_REQ(template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC pdu) := { |
| 1627 | type_gtpc := '90'O, |
| 1628 | lengthf := 0, /* FIXME */ |
| 1629 | rANTransparentContainerField := { |
| 1630 | pDU_BSSGP_RAN_INFORMATION_REQUEST := pdu |
| 1631 | } |
| 1632 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1633 | template (present) RANTransparentContainer tr_RANTransparentContainer_RAN_INFO_REQ(template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC pdu := ?) := { |
Philipp Maier | edce92f | 2023-07-26 11:02:10 +0200 | [diff] [blame] | 1634 | type_gtpc := '90'O, |
| 1635 | lengthf := ?, |
| 1636 | rANTransparentContainerField := { |
| 1637 | pDU_BSSGP_RAN_INFORMATION_REQUEST := pdu |
| 1638 | } |
| 1639 | } |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1640 | |
| 1641 | /* RAN_Information */ |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1642 | template (present) ApplContainer_or_ApplErrContainer_NACC_GTPC |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 1643 | tru_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1644 | application_Container := tr_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) |
| 1645 | } |
| 1646 | template (value) ApplContainer_or_ApplErrContainer_NACC_GTPC |
Pau Espin Pedrol | 17e0f8c | 2021-12-03 15:11:34 +0100 | [diff] [blame] | 1647 | tsu_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1648 | application_Container := ts_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) |
| 1649 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1650 | template (present) ApplContainer_or_ApplErrContainer_GTPC |
| 1651 | tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(template (present) ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1652 | nacc := cont |
| 1653 | } |
| 1654 | template (value) ApplContainer_or_ApplErrContainer_GTPC |
| 1655 | tsu_GTPC_ApplContainer_or_ApplErrContainer_NACC(template (value) ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { |
| 1656 | nacc := cont |
| 1657 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1658 | template (present) RAN_Information_RIM_Container_GTPC |
| 1659 | tr_GTPC_RAN_Information_RIM_Container(template (present) RIM_Application_Identity_GTPC app_id, |
| 1660 | template (present) RIM_Sequence_Number_GTPC seq, |
| 1661 | template (present) RIM_PDU_Indications_GTPC ind, |
| 1662 | template RIM_Protocol_Version_Number_GTPC ver := *, |
| 1663 | template ApplContainer_or_ApplErrContainer_GTPC app_cont := *, |
| 1664 | template SON_TransferApplicationIdentity son_app_id := *) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1665 | iEI := '58'O, |
| 1666 | ext := '1'B, |
| 1667 | lengthIndicator := { |
| 1668 | length1 := ? |
| 1669 | }, |
| 1670 | rIM_Application_Identity := app_id, |
| 1671 | rIM_Sequence_Number := seq, |
| 1672 | rIM_PDU_Indications := ind, |
| 1673 | rIM_Protocol_Version_Number := ver, |
| 1674 | applContainer_or_ApplErrContainer := app_cont, |
| 1675 | sON_TransferApplicationIdentity := son_app_id |
| 1676 | } |
| 1677 | template (value) RAN_Information_RIM_Container_GTPC |
| 1678 | ts_GTPC_RAN_Information_RIM_Container(template (value) RIM_Application_Identity_GTPC app_id, |
| 1679 | template (value) RIM_Sequence_Number_GTPC seq, |
| 1680 | template (value) RIM_PDU_Indications_GTPC ind, |
| 1681 | template (omit) RIM_Protocol_Version_Number_GTPC ver := omit, |
| 1682 | template (omit) ApplContainer_or_ApplErrContainer_GTPC app_cont := omit, |
| 1683 | template (omit) SON_TransferApplicationIdentity son_app_id := omit) := { |
| 1684 | iEI := '58'O, |
| 1685 | ext := '1'B, |
| 1686 | lengthIndicator := { |
| 1687 | length1 := 0 /* overwritten */ |
| 1688 | }, |
| 1689 | rIM_Application_Identity := app_id, |
| 1690 | rIM_Sequence_Number := seq, |
| 1691 | rIM_PDU_Indications := ind, |
| 1692 | rIM_Protocol_Version_Number := ver, |
| 1693 | applContainer_or_ApplErrContainer := app_cont, |
| 1694 | sON_TransferApplicationIdentity := son_app_id |
| 1695 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1696 | template (present) PDU_BSSGP_RAN_INFORMATION_GTPC |
| 1697 | tr_GTPC_RAN_Information(template (present) RIM_Routing_Information_GTPC dest, |
| 1698 | template (present) RIM_Routing_Information_GTPC src, |
| 1699 | template (present) RAN_Information_RIM_Container_GTPC cont) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1700 | bssgpPduType := '70'O, |
| 1701 | destination_Cell_Identifier := dest, |
| 1702 | source_Cell_Identifier := src, |
| 1703 | rIM_Container := cont |
| 1704 | } |
| 1705 | template (value) PDU_BSSGP_RAN_INFORMATION_GTPC |
| 1706 | ts_GTPC_RAN_Information(template (value) RIM_Routing_Information_GTPC dest, |
| 1707 | template (value) RIM_Routing_Information_GTPC src, |
| 1708 | template (value) RAN_Information_RIM_Container_GTPC cont) := { |
| 1709 | bssgpPduType := '70'O, |
| 1710 | destination_Cell_Identifier := dest, |
| 1711 | source_Cell_Identifier := src, |
| 1712 | rIM_Container := cont |
| 1713 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1714 | template (present) RANTransparentContainer tr_RANTransparentContainer_RAN_INFO(template (present) PDU_BSSGP_RAN_INFORMATION_GTPC pdu) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1715 | type_gtpc := '90'O, |
| 1716 | lengthf := ?, |
| 1717 | rANTransparentContainerField := { |
| 1718 | pDU_BSSGP_RAN_INFORMATION := pdu |
| 1719 | } |
| 1720 | } |
| 1721 | template (value) RANTransparentContainer ts_RANTransparentContainer_RAN_INFO(template (value) PDU_BSSGP_RAN_INFORMATION_GTPC pdu) := { |
| 1722 | type_gtpc := '90'O, |
| 1723 | lengthf := 0, /* overwritten */ |
| 1724 | rANTransparentContainerField := { |
| 1725 | pDU_BSSGP_RAN_INFORMATION := pdu |
| 1726 | } |
| 1727 | } |
| 1728 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1729 | template (present) RANTransparentContainer tr_RANTransparentContainer(template (present) RANTransparentContainerField rANTransparentContainerField) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1730 | type_gtpc := '90'O, |
| 1731 | lengthf := ?, |
| 1732 | rANTransparentContainerField := rANTransparentContainerField |
| 1733 | } |
| 1734 | template (value) RANTransparentContainer ts_RANTransparentContainer(template (value) RANTransparentContainerField rANTransparentContainerField) := { |
| 1735 | type_gtpc := '90'O, |
| 1736 | lengthf := 0, /* overwritten */ |
| 1737 | rANTransparentContainerField := rANTransparentContainerField |
| 1738 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1739 | template (present) GTPC_PDUs tr_RANInfoRelay(template (present) RANTransparentContainer transparentContainer) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1740 | ranInformationRelay := { |
| 1741 | transparentContainer := transparentContainer, |
| 1742 | rIM_RoutingAddress := *, |
| 1743 | rIM_RoutingAddress_Discriminator := *, |
| 1744 | private_extension_gtpc := * |
| 1745 | } |
| 1746 | } |
Philipp Maier | 05ad55c | 2023-07-24 10:56:46 +0200 | [diff] [blame] | 1747 | template (value) GTPC_PDUs ts_RANInfoRelay(template (value) RANTransparentContainer transparentContainer, |
| 1748 | template (omit) RIM_RoutingAddress ra := omit, |
| 1749 | template (omit) RIM_RoutingAddress_Discriminator ra_discr := omit) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1750 | ranInformationRelay := { |
| 1751 | transparentContainer := transparentContainer, |
Philipp Maier | 05ad55c | 2023-07-24 10:56:46 +0200 | [diff] [blame] | 1752 | rIM_RoutingAddress := ra, |
| 1753 | rIM_RoutingAddress_Discriminator := ra_discr, |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1754 | private_extension_gtpc := omit |
| 1755 | } |
| 1756 | } |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1757 | template (present) Gtp1cUnitdata |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1758 | tr_GTPC_RANInfoRelay(template (present) Gtp1cPeer peer, |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1759 | template (present) RANTransparentContainer transparentContainer) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1760 | peer := peer, |
| 1761 | gtpc := tr_GTP1C_PDU(rANInformationRelay, '00000000'O, tr_RANInfoRelay(transparentContainer)) |
| 1762 | } |
| 1763 | template (value) Gtp1cUnitdata |
Pau Espin Pedrol | 4b090c9 | 2024-02-29 19:47:07 +0100 | [diff] [blame] | 1764 | ts_GTPC_RANInfoRelay(template (value) Gtp1cPeer peer, |
Philipp Maier | 05ad55c | 2023-07-24 10:56:46 +0200 | [diff] [blame] | 1765 | template (value) RANTransparentContainer transparentContainer, |
| 1766 | template (omit) RIM_RoutingAddress ra := omit, |
| 1767 | template (omit) RIM_RoutingAddress_Discriminator ra_discr := omit) := { |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1768 | peer := peer, |
Philipp Maier | 05ad55c | 2023-07-24 10:56:46 +0200 | [diff] [blame] | 1769 | gtpc := ts_GTP1C_PDU(rANInformationRelay, '00000000'O, valueof(ts_RANInfoRelay(transparentContainer, ra, ra_discr)), 0) |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1770 | } |
| 1771 | |
| 1772 | |
Philipp Maier | 5788949 | 2023-08-07 12:10:03 +0200 | [diff] [blame] | 1773 | template (present) RAN_Information_Request_RIM_Container_GTPC |
| 1774 | tr_GTPC_RAN_Information_Request_RIM_Container(template (present) RIM_Application_Identity_GTPC app_id := ?, |
| 1775 | template (present) RIM_Sequence_Number_GTPC seq := ?, |
| 1776 | template (present) RIM_PDU_Indications_GTPC ind := ?, |
Pau Espin Pedrol | 8c74cbb | 2021-05-04 15:26:56 +0200 | [diff] [blame] | 1777 | template RIM_Protocol_Version_Number_GTPC ver := *, |
| 1778 | template RAN_Information_Request_Application_Container_GTPC app_cont := *, |
| 1779 | template SON_TransferApplicationIdentity son_app_id := *) := { |
| 1780 | iEI := '57'O, |
| 1781 | ext := '1'B, |
| 1782 | lengthIndicator := { |
| 1783 | length1 := ? |
| 1784 | }, |
| 1785 | rIM_Application_Identity := app_id, |
| 1786 | rIM_Sequence_Number := seq, |
| 1787 | rIM_PDU_Indications := ind, |
| 1788 | rIM_Protocol_Version_Number := ver, |
| 1789 | application_Container := app_cont, |
| 1790 | sON_TransferApplicationIdentity := son_app_id |
| 1791 | } |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1792 | |
Philipp Maier | 653a014 | 2023-08-04 15:22:37 +0200 | [diff] [blame] | 1793 | /* 3GPP TS 29.060, section 7.7.57 */ |
| 1794 | template (value) RIM_RoutingAddress ts_RIM_RoutingAddress(octetstring addr_value) := { |
| 1795 | type_gtpc := '9F'O, |
| 1796 | lengthf := 0, /* we assume encoder overwrites this */ |
| 1797 | rIM_RoutingAddressValue := addr_value |
| 1798 | } |
| 1799 | template (present) RIM_RoutingAddress tr_RIM_RoutingAddress(template (present) octetstring addr_value := ?) := { |
| 1800 | type_gtpc := '9F'O, |
| 1801 | lengthf := ?, |
| 1802 | rIM_RoutingAddressValue := addr_value |
| 1803 | } |
| 1804 | |
| 1805 | /* 3GPP TS 29.060, section 7.7.77 */ |
| 1806 | template (value) RIM_RoutingAddress_Discriminator ts_RIM_RoutingAddress_Discriminator(bitstring addr_discr) := { |
| 1807 | type_gtpc := 'B2'O, |
| 1808 | lengthf := 0, /* we assume encoder overwrites this */ |
| 1809 | rra_discriminator := addr_discr, |
| 1810 | spare := '0000'B |
| 1811 | } |
| 1812 | template (present) RIM_RoutingAddress_Discriminator tr_RIM_RoutingAddress_Discriminator(template (present) bitstring addr_discr := ?) := { |
| 1813 | type_gtpc := 'B2'O, |
| 1814 | lengthf := ?, |
| 1815 | rra_discriminator := addr_discr, |
| 1816 | spare := '0000'B |
| 1817 | } |
Harald Welte | c69cf4e | 2018-02-17 20:57:02 +0100 | [diff] [blame] | 1818 | } |