Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 1 | module GTPv2_Templates { |
| 2 | |
| 3 | /* (C) 2019 by Harald Welte <laforge@gnumonks.org> |
| 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 | |
| 12 | import from General_Types all; |
| 13 | import from Osmocom_Types all; |
| 14 | import from GTPv2_Types all; |
| 15 | |
| 16 | private function fs_GTP2C_t_bit(template (omit) OCT4 teid) return BIT1 { |
| 17 | if (istemplatekind(teid, "omit")) { |
| 18 | return '0'B; |
| 19 | } else { |
| 20 | return '1'B; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | private function fs_GTP2C_p_bit(template (omit) PDU_GTPCv2 piggyback) return BIT1 { |
| 25 | if (istemplatekind(piggyback, "omit")) { |
| 26 | return '0'B; |
| 27 | } else { |
| 28 | return '1'B; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | template (present) PDU_GTPCv2 tr_PDU_GTP2C(template OCT4 teid := ?, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 33 | template (present) OCT3 seq := ?, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 34 | template (present) GTPCv2_PDUs pdus := ?, |
| 35 | template PDU_GTPCv2 piggyback := omit) := { |
| 36 | spare := '000'B, |
| 37 | t_Bit := ?, |
| 38 | p_Bit := ?, |
| 39 | version := '010'B, |
| 40 | messageType := ?, |
| 41 | lengthf := ?, |
| 42 | tEID := teid, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 43 | sequenceNumber := seq, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 44 | spare3 := '00'O, |
| 45 | gtpcv2_pdu := pdus, |
| 46 | piggybackPDU_GTPCv2 := piggyback |
| 47 | } |
| 48 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 49 | template (present) OCT1 gtp2_requests := ( |
| 50 | '01'O, // echoRequest |
| 51 | '20'O, // createSessionRequest |
| 52 | '5F'O, // createBearerRequest |
| 53 | '22'O, // modifyBearerRequest |
| 54 | '24'O, // deleteSessionRequest |
| 55 | '63'O, // deleteBearerRequest |
| 56 | 'A8'O, // deleteIndirectDataForwardingTunnelRequest |
| 57 | '61'O, // updateBearerRequest |
| 58 | '42'O, // deleteBearerCommand |
| 59 | 'A6'O, // createIndirectDataForwardingTunnelRequest |
| 60 | 'AA'O, // releaseAccessBearersRequest |
| 61 | 'B3'O, // modifyAccessBearersRequest |
| 62 | '85'O, // forwardRelocationRequest |
| 63 | '82'O, // contextRequest |
| 64 | '80'O, // identificationRequest |
| 65 | '26'O, // changeNotificationRequest |
| 66 | '8B'O, // relocationCancelRequest |
| 67 | 'A0'O, // createForwardingTunnelRequest |
| 68 | '65'O, // deletePDN_ConnectionSetRequest |
| 69 | 'C8'O, // updatePDN_ConnectionSetRequest |
| 70 | '9E'O, // uE_RegistrationQueryRequest |
| 71 | 'E7'O, // mBMSSessionStartRequest |
| 72 | 'E9'O, // mBMSSessionUpdateRequest |
| 73 | 'EB'O // mBMSSessionStopRequest |
| 74 | ); |
| 75 | template (present) OCT1 gtp2_responses := ( |
| 76 | '02'O, // echoResponse |
| 77 | '21'O, // createSessionResponse |
| 78 | '60'O, // createBearerResponse |
| 79 | '23'O, // modifyBearerResponse |
| 80 | '25'O, // deleteSessionResponse |
| 81 | '64'O, // deleteBearerResponse |
| 82 | 'A9'O, // deleteIndirectDataForwardingTunnelResponse |
| 83 | '62'O, // updateBearerResponse |
| 84 | '43'O, // deleteBearerFailureIndication |
| 85 | 'A7'O, // createIndirectDataForwardingTunnelResponse |
| 86 | 'AB'O, // releaseAccessBearersResponse |
| 87 | 'B4'O, // modifyAccessBearersResponse |
| 88 | '86'O, // forwardRelocationResponse |
| 89 | '83'O, // contextResponse |
| 90 | '81'O, // identificationResponse |
| 91 | '27'O, // changeNotificationResponse |
| 92 | '8C'O, // relocationCancelResponse |
| 93 | 'A1'O, // createForwardingTunnelResponse |
| 94 | '66'O, // deletePDN_ConnectionSetResponse |
| 95 | 'C9'O, // updatePDN_ConnectionSetResponse |
| 96 | '9F'O, // uE_RegistrationQueryResponse |
| 97 | 'E8'O, // mBMSSessionStartResponse |
| 98 | 'EA'O, // mBMSSessionUpdateResponse |
| 99 | 'EC'O // mBMSSessionStopResponse |
| 100 | ); |
| 101 | |
| 102 | template (present) PDU_GTPCv2 tr_PDU_GTP2C_msgtypes(template (present) OCT1 types) := { |
| 103 | spare := '000'B, |
| 104 | t_Bit := ?, |
| 105 | p_Bit := ?, |
| 106 | version := '010'B, |
| 107 | messageType := types, |
| 108 | lengthf := ?, |
| 109 | tEID := ?, |
| 110 | sequenceNumber := ?, |
| 111 | spare3 := '00'O, |
| 112 | gtpcv2_pdu := ?, |
| 113 | piggybackPDU_GTPCv2 := * |
| 114 | }; |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 115 | |
| 116 | /* 8.3 */ |
| 117 | template (value) IMSI ts_GTP2C_Imsi(template (value) hexstring imsi) := { |
| 118 | elementIdentifier := '01'O, |
| 119 | lengthIndicator := 0, /* overwritten */ |
| 120 | instance := '0000'B, |
| 121 | spare := '0000'B, |
| 122 | iMSI_Value := imsi |
| 123 | } |
| 124 | template (present) IMSI tr_GTP2C_Imsi(template (present) hexstring imsi) := { |
| 125 | elementIdentifier := '01'O, |
| 126 | lengthIndicator := ?, |
| 127 | instance := ?, |
| 128 | spare := '0000'B, |
Pau Espin Pedrol | 5c18a0c | 2023-10-19 13:41:41 +0200 | [diff] [blame] | 129 | iMSI_Value := f_pad_bcd_number_tmpl(imsi) |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 130 | } |
| 131 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 132 | template (present) MSISDN ts_GTP2C_msisdn(template (present) hexstring msisdn) := { |
| 133 | elementIdentifier := '4C'O, |
| 134 | lengthIndicator := 0, /* overwritten */ |
| 135 | instance := '0000'B, |
| 136 | spare := '0000'B, |
| 137 | mSISDN_Value := msisdn |
| 138 | } |
| 139 | private function fs_GTP2C_msisdn(template (omit) hexstring msisdn) return |
| 140 | template (omit) MSISDN { |
| 141 | if (istemplatekind(msisdn, "omit")) { |
| 142 | return omit; |
| 143 | } else { |
| 144 | return ts_GTP2C_msisdn(msisdn); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 149 | /* 8.4-1 */ |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 150 | type enumerated GTP2C_Cause { |
| 151 | Local_Detach (2), |
| 152 | Complete_Detach (3), |
| 153 | RAT_changed_from_3GPP_to_Non_3GPP (4), |
| 154 | ISR_deactivation (5), |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 155 | Error_Ind_from_RNC_eNB_SGSN_MME (6), |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 156 | IMSI_Detach_Only (7), |
| 157 | Reactivation_Required (8), |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 158 | PDN_reconnection_to_APN_disallowed (9), |
| 159 | Access_changed_from_Non_3GPP_to_3GPP (10), |
| 160 | PDN_connection_inactivity_timer_expires (11), |
| 161 | PGW_not_responding (12), |
| 162 | Network_Failure (13), |
| 163 | QoS_parameter_mismatch (14), |
| 164 | EPS_to_5GS_Mobility (15), |
| 165 | Request_accepted (16), |
| 166 | Request_accepted_partially (17), |
| 167 | New_PDN_type_due_to_network_preference (18), |
| 168 | New_PDN_type_due_to_single_address_bearer_only (19), |
| 169 | /* ... */ |
| 170 | Context_Not_Found (64) |
| 171 | } with { variant "FIELDLENGTH(8)" encode "RAW" }; |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 172 | |
| 173 | /* 8.4 */ |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 174 | template (value) Cause ts_GTP2C_Cause(template (value) GTP2C_Cause cause, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 175 | template (value) BIT1 cs) := { |
| 176 | elementIdentifier := '02'O, |
| 177 | lengthIndicator := 0, /* overwritten */ |
| 178 | instance := '0000'B, |
| 179 | spare := '0000'B, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 180 | causeValue := int2oct(enum2int(valueof(cause)), 1), |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 181 | cS := cs, |
| 182 | bCE := '0'B, |
| 183 | pCE := '0'B, |
| 184 | spare2 := '00000'B, |
| 185 | typeOfOffendingIE := omit, |
| 186 | lengthIndicator2 := omit, |
| 187 | instanceOfOffendingIE := omit, |
| 188 | spare3 := omit |
| 189 | } |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 190 | private function enum2int_GTP2C_Cause_tmpl(template GTP2C_Cause inp) return template integer |
| 191 | { |
| 192 | if (istemplatekind(inp, "omit")) { |
| 193 | return omit; |
| 194 | } else if (istemplatekind(inp, "*")) { |
| 195 | return *; |
| 196 | } else if (istemplatekind(inp, "?")) { |
| 197 | return ?; |
| 198 | } else { |
| 199 | return enum2int(valueof(inp)); |
| 200 | } |
| 201 | } |
| 202 | template (present) Cause tr_GTP2C_Cause(template (present) GTP2C_Cause cause) := { |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 203 | elementIdentifier := '02'O, |
| 204 | lengthIndicator := ?, |
| 205 | instance := ?, |
| 206 | spare := '0000'B, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 207 | causeValue := int2oct_tmpl(enum2int_GTP2C_Cause_tmpl(cause), 1), |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 208 | cS := ?, |
| 209 | bCE := ?, |
| 210 | pCE := ?, |
| 211 | spare2 := '00000'B, |
| 212 | typeOfOffendingIE := *, |
| 213 | lengthIndicator2 := *, |
| 214 | instanceOfOffendingIE := *, |
| 215 | spare3 := * |
| 216 | } |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 217 | private function fs_GTP2C_Cause(template (omit) GTP2C_Cause cause, template (value) BIT1 cs) return |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 218 | template (omit) Cause { |
| 219 | if (istemplatekind(cause, "omit")) { |
| 220 | return omit; |
| 221 | } else { |
| 222 | return ts_GTP2C_Cause(cause, cs); |
| 223 | } |
| 224 | } |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 225 | private function fr_GTP2C_Cause(template GTP2C_Cause cause) return |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 226 | template Cause { |
| 227 | if (istemplatekind(cause, "omit")) { |
| 228 | return omit; |
| 229 | } else if (istemplatekind(cause, "*")) { |
| 230 | return *; |
| 231 | } else { |
| 232 | return tr_GTP2C_Cause(cause); |
| 233 | } |
| 234 | } |
| 235 | |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 236 | |
Pau Espin Pedrol | 2a2e854 | 2023-10-19 13:39:45 +0200 | [diff] [blame] | 237 | /* 8.6 */ |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 238 | template (value) AccessPointName ts_GTP2C_APN(template (value) octetstring apn) := { |
Pau Espin Pedrol | 2a2e854 | 2023-10-19 13:39:45 +0200 | [diff] [blame] | 239 | elementIdentifier := '47'O, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 240 | lengthIndicator := 0, /* overwritten */ |
| 241 | instance := '0000'B, |
| 242 | spare := '0000'B, |
| 243 | aPN_Value := apn |
| 244 | } |
| 245 | template (present) AccessPointName tr_GTP2C_APN(template (present) octetstring apn) := { |
Pau Espin Pedrol | 2a2e854 | 2023-10-19 13:39:45 +0200 | [diff] [blame] | 246 | elementIdentifier := '47'O, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 247 | lengthIndicator := ?, |
| 248 | instance := ?, |
| 249 | spare := '0000'B, |
| 250 | aPN_Value := apn |
| 251 | } |
| 252 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 253 | /* 8.7 */ |
| 254 | template (value) AggregateMaximumBitRate |
| 255 | ts_GTP2C_Ambr(integer ambr_ul, integer ambr_dl) := { |
| 256 | elementIdentifier := '48'O, |
| 257 | lengthIndicator := 0, /* overwritten */ |
| 258 | instance := '0000'B, |
| 259 | spare := '0000'B, |
| 260 | aPN_AMBR_for_uplink := int2oct(ambr_ul, 4), |
| 261 | aPN_AMBR_for_downlink := int2oct(ambr_dl, 4) |
| 262 | } |
| 263 | |
| 264 | /* 8.8 */ |
| 265 | template (value) EPS_BearerID |
| 266 | ts_GTP2C_EpsBearerId(template (value) uint4_t bid) := { |
| 267 | elementIdentifier := '49'O, |
| 268 | lengthIndicator := 0, /* overwritten */ |
| 269 | instance := '0000'B, |
| 270 | spare := '0000'B, |
| 271 | ePS_Bearer_ID_Value := bid, |
| 272 | spare2 := '0000'B, |
| 273 | additionalOctets := omit |
| 274 | } |
| 275 | template (present) EPS_BearerID |
| 276 | tr_GTP2C_EpsBearerId(template (present) uint4_t bid) := { |
| 277 | elementIdentifier := '49'O, |
| 278 | lengthIndicator := ?, /* overwritten */ |
| 279 | instance := '0000'B, |
| 280 | spare := '0000'B, |
| 281 | ePS_Bearer_ID_Value := bid, |
| 282 | spare2 := '0000'B, |
| 283 | additionalOctets := * |
| 284 | } |
| 285 | |
| 286 | |
| 287 | |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 288 | /* 8.14 */ |
| 289 | template (value) PDN_AddressAllocation |
| 290 | ts_GTP2C_PdnAddrAlloc(template (value) BIT3 pdn_type, |
| 291 | template (value) PDN_Address_and_Prefix addr_pfx) := { |
| 292 | elementIdentifier := '4F'O, |
| 293 | lengthIndicator := 0, /* overwritten */ |
| 294 | instance := '0000'B, |
| 295 | spare := '0000'B, |
| 296 | pDN_Type := pdn_type, |
| 297 | spare2 := '00000'B, |
| 298 | pDN_Address_and_Prefix := addr_pfx |
| 299 | } |
| 300 | template (present) PDN_AddressAllocation |
| 301 | tr_GTP2C_PdnAddrAlloc(template (present) BIT3 pdn_type, |
| 302 | template (present) PDN_Address_and_Prefix addr_pfx) := { |
| 303 | elementIdentifier := '4F'O, |
| 304 | lengthIndicator := ?, |
| 305 | instance := ?, |
| 306 | spare := '0000'B, |
| 307 | pDN_Type := pdn_type, |
| 308 | spare2 := '00000'B, |
| 309 | pDN_Address_and_Prefix := addr_pfx |
| 310 | } |
| 311 | template (value) PDN_AddressAllocation |
| 312 | ts_GTP2C_PdnAddrAlloc_v4(template (value) OCT4 addr) := |
| 313 | ts_GTP2C_PdnAddrAlloc('001'B, {iPv4_Address:=addr}); |
| 314 | template (present) PDN_AddressAllocation |
| 315 | tr_GTP2C_PdnAddrAlloc_v4(template (present) OCT4 addr) := |
| 316 | ts_GTP2C_PdnAddrAlloc('001'B, {iPv4_Address:=addr}); |
| 317 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 318 | /* 8.15 */ |
| 319 | template (value) Bearer_QoS |
| 320 | ts_GTP2C_BearerQos(template (value) OCT1 qci, |
| 321 | uint40_t max_br_ul, uint40_t max_br_dl, |
| 322 | uint40_t g_br_ul, uint40_t g_br_dl, |
| 323 | template (value) BIT4 prio_lvl := '1001'B, |
| 324 | template (value) BIT1 pe_vuln := '0'B, |
| 325 | template (value) BIT1 pe_capa := '0'B) := { |
| 326 | elementIdentifier := '50'O, |
| 327 | lengthIndicator := 0, /* overwritten */ |
| 328 | instance := '0000'B, |
| 329 | spare := '0000'B, |
| 330 | pVI := pe_vuln, |
| 331 | spare2 := '0'B, |
| 332 | pL := prio_lvl, |
| 333 | pCI := pe_capa, |
| 334 | spare3 := '0'B, |
| 335 | labelQCI := qci, |
| 336 | maxBitrateUplink := int2oct(max_br_ul, 5), |
| 337 | maxBitrateDownLink := int2oct(max_br_dl, 5), |
| 338 | guaranteedBitrateUplink := int2oct(g_br_ul, 5), |
| 339 | guaranteedBitrateDownLink := int2oct(g_br_dl, 5), |
| 340 | additionalOctets := omit |
| 341 | } |
| 342 | |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 343 | /* 8.17 */ |
| 344 | template (value) RAT_Type ts_GTP2C_RatType(template (value) integer rat) := { |
Pau Espin Pedrol | 2a2e854 | 2023-10-19 13:39:45 +0200 | [diff] [blame] | 345 | elementIdentifier := '52'O, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 346 | lengthIndicator := 0, /* overwritten */ |
| 347 | instance := '0000'B, |
| 348 | spare := '0000'B, |
| 349 | rAT_TypeValue := rat, |
| 350 | additionalOctets := omit |
| 351 | } |
| 352 | template (present) RAT_Type tr_GTP2C_RatType(template (present) integer rat) := { |
Pau Espin Pedrol | 2a2e854 | 2023-10-19 13:39:45 +0200 | [diff] [blame] | 353 | elementIdentifier := '52'O, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 354 | lengthIndicator := ?, |
| 355 | instance := ?, |
| 356 | spare := '0000'B, |
| 357 | rAT_TypeValue := rat, |
| 358 | additionalOctets := * |
| 359 | } |
| 360 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 361 | /* 8.21 */ |
| 362 | function ts_GTP2C_UserLocInfo(template (omit) CGI cgi := omit, |
| 363 | template (omit) SAI sai := omit, |
| 364 | template (omit) RAI rai := omit, |
| 365 | template (omit) TAI tai := omit, |
| 366 | template (omit) ECGI ecgi := omit, |
| 367 | template (omit) LAI lai := omit) |
| 368 | return template (value) UserLocationInfo { |
| 369 | var template (value) UserLocationInfo uli; |
| 370 | uli.elementIdentifier := '56'O; |
| 371 | uli.lengthIndicator := 0; // overwritten |
| 372 | uli.instance := '0000'B; |
| 373 | uli.spare := '0000'B; |
| 374 | uli.spare2 := '00'B; |
| 375 | uli.additionalOctets := omit; |
| 376 | |
| 377 | if (istemplatekind(cgi, "omit")) { |
| 378 | uli.cGI_Flag := '0'B; |
| 379 | } else { |
| 380 | uli.cGI_Flag := '1'B; |
| 381 | } |
| 382 | uli.cGI := cgi; |
| 383 | |
| 384 | if (istemplatekind(sai, "omit")) { |
| 385 | uli.sAI_Flag := '0'B; |
| 386 | } else { |
| 387 | uli.sAI_Flag := '1'B; |
| 388 | } |
| 389 | uli.sAI := sai; |
| 390 | |
| 391 | if (istemplatekind(rai, "omit")) { |
| 392 | uli.rAI_Flag := '0'B; |
| 393 | } else { |
| 394 | uli.rAI_Flag := '1'B; |
| 395 | } |
| 396 | uli.rAI := rai |
| 397 | |
| 398 | if (istemplatekind(tai, "omit")) { |
| 399 | uli.tAI_Flag := '0'B; |
| 400 | } else { |
| 401 | uli.tAI_Flag := '1'B; |
| 402 | } |
| 403 | uli.tAI := tai |
| 404 | |
| 405 | if (istemplatekind(ecgi, "omit")) { |
| 406 | uli.eCGI_Flag := '0'B; |
| 407 | } else { |
| 408 | uli.eCGI_Flag := '1'B; |
| 409 | } |
| 410 | uli.eCGI := ecgi; |
| 411 | |
| 412 | if (istemplatekind(lai, "omit")) { |
| 413 | uli.lAI_Flag := '0'B; |
| 414 | } else { |
| 415 | uli.lAI_Flag := '1'B; |
| 416 | } |
| 417 | uli.lAI := lai |
| 418 | |
| 419 | return uli; |
| 420 | } |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 421 | |
| 422 | /* 8.22 */ |
| 423 | private function f_bit4oct(template (omit) octetstring os) return BIT1 |
| 424 | { |
| 425 | if (istemplatekind(os, "omit")) { |
| 426 | return '0'B; |
| 427 | } else { |
| 428 | return '1'B; |
| 429 | } |
| 430 | } |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 431 | type enumerated FteidInterface { |
| 432 | FTEID_IF_S1U_eNodeB_GTPU (0), |
| 433 | FTEID_IF_S1U_SGW_GTPU (1), |
| 434 | FTEID_IF_S12_RNC_GTPU (2), |
| 435 | FTEID_IF_S12_SGW_GTPU (3), |
| 436 | FTEID_IF_S5S8_SGW_GTPU (4), |
| 437 | FTEID_IF_S5S8_PGW_GTPU (5), |
| 438 | FTEID_IF_S5S8_SGW_GTPC (6), |
| 439 | FTEID_IF_S5S8_PGW_GTPC (7), |
| 440 | FTEID_IF_S5S8_SGW_PMIPv6 (8), |
| 441 | FTEID_IF_S5S8_PGW_PMIPv6 (9), |
| 442 | FTEID_IF_S11_MME_GTPC (10), |
| 443 | FTEID_IF_S11S4_SGW_GTPC (11), |
| 444 | FTEID_IF_S10ND26_MME_GTPC (12), |
| 445 | FTEID_IF_S3_MME_GTPC (13), |
| 446 | FTEID_IF_S3_SGSN_GTPC (14), |
| 447 | FTEID_IF_S4_SGSN_GTPU (15), |
| 448 | FTEID_IF_S4_SGW_GTPU (16), |
| 449 | FTEID_IF_S16_SGSN_GTPC (18), |
| 450 | FTEID_IF_eNB_GTPU_DL_DATA_FW (19), |
| 451 | FTEID_IF_eNB_GTPU_UL_DATA_FW (20), |
| 452 | FTEID_IF_RNC_GTPU_DATA_FW (21), |
| 453 | FTEID_IF_SGSN_GTPU_DATA_FW (22), |
| 454 | FTEID_IF_SGWUPF_GTPU_DL_DATA_FW (23), |
| 455 | FTEID_IF_Sm_MMBS_GW_GTPC (24), |
| 456 | FTEID_IF_Sn_MMBS_GW_GTPC (25), |
| 457 | FTEID_IF_Sm_MME_GTPC (26), |
| 458 | FTEID_IF_Sn_MME_GTPC (27), |
| 459 | FTEID_IF_SGW_GTPU_UL_DATA_FW (28), |
| 460 | FTEID_IF_Sn_SGSN_GTPU (29), |
| 461 | FTEID_IF_S2b_ePDG_GTPC (30), |
| 462 | FTEID_IF_S2bU_ePDG_GTPU (31), |
| 463 | FTEID_IF_S2b_PGW_GTPC (32), |
| 464 | FTEID_IF_S2bU_PGW_GTPU (33), |
| 465 | FTEID_IF_S2a_TWAN_GTPU (34), |
| 466 | FTEID_IF_S2a_TWAN_GTPC (35), |
| 467 | FTEID_IF_S2a_PGW_GTPC (36), |
| 468 | FTEID_IF_S2a_PGW_GTPU (37), |
| 469 | FTEID_IF_S11_MME_GTPU (38), |
| 470 | FTEID_IF_S11_SGW_GTPU (39), |
| 471 | FTEID_IF_N26_AMF_GTPC (40) |
| 472 | }; |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 473 | template (value) FullyQualifiedTEID |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 474 | ts_GTP2C_FTEID(FteidInterface if_type, OCT4 teid, uint4_t instance := 0, |
| 475 | template (omit) OCT4 v4_addr := omit, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 476 | template (omit) OCT16 v6_addr := omit) := { |
| 477 | elementIdentifier := '57'O, |
| 478 | lengthIndicator := 0, /* overwritten */ |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 479 | instance := int2bit(instance, 4), |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 480 | spare := '0000'B, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 481 | interfaceType := enum2int(if_type), |
| 482 | v6_Flag := f_bit4oct(v6_addr), |
| 483 | v4_Flag := f_bit4oct(v4_addr), |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 484 | tEID_GRE_Key := teid, |
| 485 | iPv4_Address := v4_addr, |
| 486 | iPv6_Address := v6_addr, |
| 487 | additionalOctets := omit |
| 488 | } |
| 489 | template (present) FullyQualifiedTEID |
| 490 | tr_GTP2C_FTEID(template (present) integer if_type, template (present) OCT4 teid, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 491 | template BIT4 instance := ?, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 492 | template OCT4 v4_addr := omit, |
| 493 | template OCT16 v6_addr := omit) := { |
| 494 | elementIdentifier := '57'O, |
| 495 | lengthIndicator := ?, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 496 | instance := instance, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 497 | spare := '0000'B, |
| 498 | interfaceType := if_type, |
| 499 | v6_Flag := ?, |
| 500 | v4_Flag := ?, |
| 501 | tEID_GRE_Key := teid, |
| 502 | iPv4_Address := v4_addr, |
| 503 | iPv6_Address := v6_addr, |
| 504 | additionalOctets := omit |
| 505 | } |
| 506 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 507 | /* 8.28 */ |
Pau Espin Pedrol | 8c74649 | 2023-10-23 20:56:09 +0200 | [diff] [blame] | 508 | template (value) BearerContextIEs |
| 509 | ts_GTP2C_BcContextIE(template (value) uint4_t bid, |
| 510 | template (omit) FullyQualifiedTEID_List teid_list := omit, |
| 511 | template (omit) Bearer_QoS qos := ts_GTP2C_BearerQos('09'O, 0,0,0,0), |
| 512 | template (omit) ChargingID charging_id := omit) := { |
| 513 | ePS_Bearer_ID := ts_GTP2C_EpsBearerId(bid), |
| 514 | cause := ts_GTP2C_Cause(Request_accepted, '0'B), |
| 515 | ePS_Bearer_TFT := omit, |
| 516 | fullyQualifiedTEID := teid_list, |
| 517 | bearerLevel_QoS := qos, |
| 518 | chargingID := charging_id, |
| 519 | bearerFlags := omit, |
| 520 | transactionIdentifier := omit, |
| 521 | protocolConfigOptions := omit, |
| 522 | rAN_NASCause := omit, |
| 523 | additionalProtocolConfigOptions := omit, |
| 524 | extendedProtocolConfigOptions := omit |
| 525 | } |
| 526 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 527 | template (value) BearerContextGrouped |
| 528 | ts_GTP2C_BcGrouped(template (value) BearerContextIEs ies) := { |
| 529 | elementIdentifier := '5D'O, |
| 530 | lengthIndicator := 0, /* overwritten */ |
| 531 | instance := '0000'B, |
| 532 | spare := '0000'B, |
| 533 | bearerContextIEs := ies |
| 534 | } |
| 535 | template (present) BearerContextGrouped |
| 536 | tr_GTP2C_BcGrouped(template (present) BearerContextIEs ies) := { |
| 537 | elementIdentifier := '5D'O, |
| 538 | lengthIndicator := ?, /* overwritten */ |
| 539 | instance := '0000'B, |
| 540 | spare := '0000'B, |
| 541 | bearerContextIEs := ies |
| 542 | } |
| 543 | |
Pau Espin Pedrol | 8c74649 | 2023-10-23 20:56:09 +0200 | [diff] [blame] | 544 | /* 8.29 */ |
| 545 | template (value) ChargingID |
| 546 | ts_GTP2C_ChargingID(template (value) OCT4 chargingID_Value) := { |
| 547 | elementIdentifier := '5D'O, |
| 548 | lengthIndicator := 0, /* overwritten */ |
| 549 | instance := '0000'B, |
| 550 | spare := '0000'B, |
| 551 | chargingID_Value := chargingID_Value, |
| 552 | additionalOctets := omit |
| 553 | } |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 554 | |
| 555 | /* 8.30 */ |
| 556 | template (value) ChargingCharacteristics |
| 557 | ts_GTP2C_ChargingCaracteristics(template (value) OCT2 cc) := { |
| 558 | elementIdentifier := '5F'O, |
| 559 | lengthIndicator := 0, /* overwritten */ |
| 560 | instance := '0000'B, |
| 561 | spare := '0000'B, |
| 562 | chargingCharacteristicsValue := cc, |
| 563 | additionalOctets := omit |
| 564 | } |
| 565 | template (present) ChargingCharacteristics |
| 566 | tr_GTP2C_ChargingCaracteristics(template (present) OCT2 cc) := { |
| 567 | elementIdentifier := '5F'O, |
| 568 | lengthIndicator := ?, /* overwritten */ |
| 569 | instance := '0000'B, |
| 570 | spare := '0000'B, |
| 571 | chargingCharacteristicsValue := cc, |
| 572 | additionalOctets := omit |
| 573 | } |
| 574 | |
| 575 | |
| 576 | /* 8.34 */ |
| 577 | template (value) PDN_Type |
| 578 | ts_GTP2C_PdnType(template (value) BIT3 pdn_type) := { |
| 579 | elementIdentifier := '63'O, |
| 580 | lengthIndicator := 0, |
| 581 | instance := '0000'B, |
| 582 | spare := '0000'B, |
| 583 | pDN_TypeValue := pdn_type, |
| 584 | spare2 := '00000'B, |
| 585 | additionalOctets := omit |
| 586 | } |
| 587 | template (present) PDN_Type |
| 588 | tr_GTP2C_PdnType(template (present) BIT3 pdn_type) := { |
| 589 | elementIdentifier := '63'O, |
| 590 | lengthIndicator := ?, |
| 591 | instance := ?, |
| 592 | spare := ?, |
| 593 | pDN_TypeValue := pdn_type, |
| 594 | spare2 := ?, |
| 595 | additionalOctets := * |
| 596 | } |
| 597 | |
| 598 | /* 8.35 */ |
| 599 | template (value) ProcedureTransactionID |
| 600 | ts_GTP2C_ProcTransId(template (value) integer pti) := { |
| 601 | elementIdentifier := '64'O, |
| 602 | lengthIndicator := 0, |
| 603 | instance := '0000'B, |
| 604 | spare := '0000'B, |
| 605 | pTI_Value := pti, |
| 606 | additionalOctets := omit |
| 607 | } |
| 608 | template (present) ProcedureTransactionID |
| 609 | tr_GTP2C_ProcTransId(template (present) integer pti) := { |
| 610 | elementIdentifier := '64'O, |
| 611 | lengthIndicator := ?, |
| 612 | instance :=?, |
| 613 | spare := ?, |
| 614 | pTI_Value := pti, |
| 615 | additionalOctets := * |
| 616 | } |
| 617 | |
| 618 | |
| 619 | /* 8.57 */ |
| 620 | template (value) APN_Restriction |
| 621 | ts_GTP2C_ApnRestriction(template (value) integer val) := { |
| 622 | elementIdentifier := '7F'O, |
| 623 | lengthIndicator := 0, |
| 624 | instance := '0000'B, |
| 625 | spare := '0000'B, |
| 626 | restrictionTypeValue := val, |
| 627 | additionalOctets := omit |
| 628 | } |
| 629 | template (present) APN_Restriction |
| 630 | tr_GTP2C_ApnRestriction(template (present) integer val) := { |
| 631 | elementIdentifier := '7F'O, |
| 632 | lengthIndicator := ?, |
| 633 | instance := '0000'B, |
| 634 | spare := ?, |
| 635 | restrictionTypeValue := val, |
| 636 | additionalOctets := * |
| 637 | } |
| 638 | |
| 639 | |
| 640 | /* 8.58 */ |
| 641 | template (value) SelectionMode |
| 642 | ts_GTP2C_SelectionMode(template (value) integer mode) := { |
| 643 | elementIdentifier := '80'O, |
| 644 | lengthIndicator := 0, /* overwritten */ |
| 645 | instance := '0000'B, |
| 646 | spare := '0000'B, |
| 647 | selectionModeValue := mode, |
| 648 | spare2 := '000000'B, |
| 649 | additionalOctets := omit |
| 650 | } |
| 651 | template (present) SelectionMode |
| 652 | tr_GTP2C_SelectionMode(template (present) integer mode) := { |
| 653 | elementIdentifier := '80'O, |
| 654 | lengthIndicator := ?, |
| 655 | instance := ?, |
| 656 | spare := ?, |
| 657 | selectionModeValue := mode, |
| 658 | spare2 := ?, |
| 659 | additionalOctets := * |
| 660 | } |
| 661 | |
| 662 | |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 663 | |
| 664 | |
| 665 | template (value) PDU_GTPCv2 ts_PDU_GTP2C(template (omit) OCT4 teid, template (value) OCT3 seq, |
| 666 | template (value) OCT1 msg_type, |
| 667 | template (value) GTPCv2_PDUs pdus, |
| 668 | template (omit) PDU_GTPCv2 piggyback := omit) := { |
| 669 | spare := '000'B, |
| 670 | t_Bit := fs_GTP2C_t_bit(teid), |
| 671 | p_Bit := fs_GTP2C_p_bit(piggyback), |
| 672 | version := '010'B, |
| 673 | messageType := msg_type, |
| 674 | lengthf := 0, /* overwritten */ |
| 675 | tEID := teid, |
| 676 | sequenceNumber := seq, |
| 677 | spare3 := '00'O, |
| 678 | gtpcv2_pdu := pdus, |
| 679 | piggybackPDU_GTPCv2 := piggyback |
| 680 | } |
| 681 | |
| 682 | |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 683 | template (value) PDU_GTPCv2 |
| 684 | ts_GTP2C_EchoReq(template (value) integer rec_val) := |
| 685 | ts_PDU_GTP2C(omit, '000000'O, '01'O, { |
| 686 | echoRequest := { |
| 687 | recovery := { |
| 688 | elementIdentifier := '03'O, |
| 689 | lengthIndicator := 0, |
| 690 | instance := '0000'B, |
| 691 | spare := '0000'B, |
| 692 | recoveryValue := rec_val |
| 693 | }, |
| 694 | sendingNodeFeatures := omit, |
| 695 | privateExtension := omit |
| 696 | }}); |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 697 | template (present) PDU_GTPCv2 |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 698 | tr_GTP2C_EchoReq(template (present) OCT3 seq := ?) := |
| 699 | tr_PDU_GTP2C(omit, seq, { echoRequest := ? }, omit); |
| 700 | |
| 701 | template (value) PDU_GTPCv2 |
| 702 | ts_GTP2C_EchoResp(template (value) integer rec_val) := |
| 703 | ts_PDU_GTP2C(omit, '000000'O, '02'O, { |
| 704 | echoRequest := { |
| 705 | recovery := { |
| 706 | elementIdentifier := '03'O, |
| 707 | lengthIndicator := 0, |
| 708 | instance := '0000'B, |
| 709 | spare := '0000'B, |
| 710 | recoveryValue := rec_val |
| 711 | }, |
| 712 | sendingNodeFeatures := omit, |
| 713 | privateExtension := omit |
| 714 | }}); |
| 715 | template (present) PDU_GTPCv2 |
| 716 | tr_GTP2C_EchoResp(template (present) OCT3 seq := ?) := |
| 717 | tr_PDU_GTP2C(omit, seq, { echoResponse := ? }, omit); |
| 718 | |
| 719 | |
| 720 | |
| 721 | template (present) PDU_GTPCv2 |
| 722 | ts_GTP2C_CreateSessionReq(template (value) hexstring imsi, template (omit) hexstring msisdn, |
| 723 | integer rat_type, template (value) FullyQualifiedTEID sender_fteid, |
| 724 | template (value) octetstring apn, template (value) BIT3 pdn_type, |
| 725 | template (omit) FullyQualifiedTEID_List teid_list, |
| 726 | template (value) OCT2 chg_car, template (value) uint4_t bearer_id, |
| 727 | template (value) Bearer_QoS qos := ts_GTP2C_BearerQos('09'O, 0,0,0,0)) := |
| 728 | ts_PDU_GTP2C('00000000'O, '000000'O, '20'O, { |
| 729 | createSessionRequest := { |
| 730 | iMSI := ts_GTP2C_Imsi(imsi), |
| 731 | mSISDN := fs_GTP2C_msisdn(msisdn), |
| 732 | mEI := omit, |
| 733 | userLocationInfo := omit, |
| 734 | servingNetwork := omit, |
| 735 | rAT_Type := ts_GTP2C_RatType(rat_type), |
| 736 | indication := omit, |
| 737 | fullyQualifiedTEID := { sender_fteid }, |
| 738 | accessPointName := ts_GTP2C_APN(apn), |
| 739 | selectionMode := ts_GTP2C_SelectionMode(0), |
| 740 | pDN_Type := ts_GTP2C_PdnType(pdn_type), |
| 741 | pDN_AddressAllocation := ts_GTP2C_PdnAddrAlloc('001'B, {iPv4_Address:='00000000'O}), |
| 742 | maxAPN_Restriction := ts_GTP2C_ApnRestriction(0), |
| 743 | ambr := ts_GTP2C_Ambr(102400, 102400), |
| 744 | linkedEPS_Bearer_ID := omit, |
| 745 | trustedWLANModeIndication := omit, |
| 746 | protocolConfigOptions := omit, |
| 747 | bearerContextGrouped := { |
| 748 | ts_GTP2C_BcGrouped({ |
| 749 | ePS_Bearer_ID := ts_GTP2C_EpsBearerId(bearer_id), |
| 750 | cause := omit, |
| 751 | ePS_Bearer_TFT := omit, |
| 752 | fullyQualifiedTEID := teid_list, |
| 753 | bearerLevel_QoS := qos, |
| 754 | chargingID := omit, |
| 755 | bearerFlags := omit, |
| 756 | transactionIdentifier := omit, |
| 757 | protocolConfigOptions := omit, |
| 758 | rAN_NASCause := omit, |
| 759 | additionalProtocolConfigOptions := omit, |
| 760 | extendedProtocolConfigOptions := omit |
| 761 | }) |
| 762 | }, |
| 763 | traceInformation := omit, |
| 764 | recovery := omit, |
| 765 | csid := omit, |
| 766 | uE_TimeZone := omit, |
| 767 | user_CSG_Information := omit, |
| 768 | chargingCharacteristics := ts_GTP2C_ChargingCaracteristics(chg_car), |
| 769 | lDN := omit, |
| 770 | signallingPriorityIndication := omit, |
| 771 | iP_Addr := omit, |
| 772 | portNumber := omit, |
| 773 | aPCO := omit, |
| 774 | trustedWLANAccessNetworkIdentifier := omit, |
| 775 | cNOperatorSelectionEntity := omit, |
| 776 | presenceReportingAreaInformation := omit, |
| 777 | overloadControlInformationGrouped := omit, |
| 778 | originationTimeStamp := omit, |
| 779 | maximumWaitTime := omit, |
| 780 | wLANLocationTimestamp := omit, |
| 781 | nBIFOMContainer := omit, |
| 782 | remoteUEContextGrouped := omit, |
| 783 | nodeIdentifier := omit, |
| 784 | extendedProtocolConfigOptions := omit, |
| 785 | servingPLMNRateControl := omit, |
| 786 | counter := omit, |
| 787 | privateExtension := omit |
| 788 | }}); |
| 789 | |
| 790 | |
| 791 | template (present) PDU_GTPCv2 |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 792 | tr_GTP2C_CreateSessionReq(template (present) hexstring imsi := ?, template (present) octetstring apn := ?) := |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 793 | tr_PDU_GTP2C('00000000'O, ?, { |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 794 | createSessionRequest := { |
| 795 | iMSI := tr_GTP2C_Imsi(imsi), |
| 796 | mSISDN := *, |
| 797 | mEI := *, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 798 | userLocationInfo := *, |
| 799 | servingNetwork := *, |
| 800 | rAT_Type := tr_GTP2C_RatType(?), |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 801 | indication := *, |
| 802 | fullyQualifiedTEID := ?, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 803 | accessPointName := tr_GTP2C_APN(apn), // '*' |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 804 | selectionMode := ?, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 805 | pDN_Type := *, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 806 | pDN_AddressAllocation := ?, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 807 | maxAPN_Restriction := *, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 808 | ambr := *, |
| 809 | linkedEPS_Bearer_ID := omit, |
| 810 | trustedWLANModeIndication := omit, |
| 811 | protocolConfigOptions := omit, |
| 812 | bearerContextGrouped := ?, |
| 813 | traceInformation := *, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 814 | recovery := *, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 815 | csid := omit, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 816 | uE_TimeZone := *, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 817 | user_CSG_Information := omit, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 818 | chargingCharacteristics := *, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 819 | lDN := omit, |
| 820 | signallingPriorityIndication := *, |
| 821 | iP_Addr := omit, |
| 822 | portNumber := omit, |
Pau Espin Pedrol | 90a46c4 | 2023-10-19 13:44:44 +0200 | [diff] [blame] | 823 | aPCO := *, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 824 | trustedWLANAccessNetworkIdentifier := omit, |
| 825 | cNOperatorSelectionEntity := omit, |
| 826 | presenceReportingAreaInformation := omit, |
| 827 | overloadControlInformationGrouped := omit, |
| 828 | originationTimeStamp := *, |
| 829 | maximumWaitTime := *, |
| 830 | wLANLocationTimestamp := omit, |
| 831 | nBIFOMContainer := omit, |
| 832 | remoteUEContextGrouped := *, |
| 833 | nodeIdentifier := *, |
| 834 | extendedProtocolConfigOptions := omit, |
| 835 | servingPLMNRateControl := omit, |
| 836 | counter := omit, |
| 837 | privateExtension := omit |
| 838 | }}); |
| 839 | |
| 840 | template (value) PDU_GTPCv2 |
| 841 | ts_GTP2C_CreateSessionResp(template (value) FullyQualifiedTEID_List fteids, |
Pau Espin Pedrol | 8c74649 | 2023-10-23 20:56:09 +0200 | [diff] [blame] | 842 | template (value) PDN_AddressAllocation addr, |
| 843 | template (omit) BearerContextGrouped_List bearerContextGrouped := omit) := |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 844 | ts_PDU_GTP2C('00000000'O, '000000'O, '21'O, { |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 845 | createSessionResponse := { |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 846 | cause := ts_GTP2C_Cause(Request_accepted, '0'B), |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 847 | changeReportingAction := omit, |
| 848 | cSG_InformationReportingAction := omit, |
| 849 | heNBInformationReporting := omit, |
| 850 | fullyQualifiedTEID := fteids, |
| 851 | pDN_AddressAllocation := addr, |
| 852 | aPN_Restriction := omit, |
| 853 | ambr := omit, |
| 854 | linkedEPS_Bearer_ID := omit, |
| 855 | protocolConfigOptions := omit, |
Pau Espin Pedrol | 8c74649 | 2023-10-23 20:56:09 +0200 | [diff] [blame] | 856 | bearerContextGrouped := bearerContextGrouped, |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 857 | recovery := omit, |
| 858 | chargingGatewayName := omit, |
| 859 | chargingGatewayAddress := omit, |
| 860 | csid := omit, |
| 861 | lDN := omit, |
| 862 | pGW_Back_OffTime := omit, |
| 863 | aPCO := omit, |
| 864 | trustedWLANIPv4Parameters := omit, |
| 865 | indicationFlags := omit, |
| 866 | presenceReportingAreaAction := omit, |
| 867 | loadControlInformationGrouped := omit, |
| 868 | overloadControlInformationGrouped := omit, |
| 869 | nBIFOMContainer := omit, |
| 870 | pDNConnectionChargingID := omit, |
| 871 | extendedProtocolConfigOptions := omit, |
| 872 | privateExtension := omit |
| 873 | }}); |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 874 | template (present) PDU_GTPCv2 |
| 875 | tr_GTP2C_CreateSessionResp(template (present) OCT4 d_teid := ?, |
| 876 | template (present) OCT3 seq := ?, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 877 | template (present) GTP2C_Cause cause := ?, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 878 | template FullyQualifiedTEID_List fteids := *, |
| 879 | template PDN_AddressAllocation addr := *, |
| 880 | template BearerContextGrouped_List bctxg := *) := |
| 881 | tr_PDU_GTP2C(d_teid, seq, { |
| 882 | createSessionResponse := { |
| 883 | cause := tr_GTP2C_Cause(cause), |
| 884 | changeReportingAction := *, |
| 885 | cSG_InformationReportingAction := *, |
| 886 | heNBInformationReporting := *, |
| 887 | fullyQualifiedTEID := fteids, |
| 888 | pDN_AddressAllocation := addr, |
| 889 | aPN_Restriction := ?, |
| 890 | ambr := *, |
| 891 | linkedEPS_Bearer_ID := *, |
| 892 | protocolConfigOptions := *, |
| 893 | bearerContextGrouped := bctxg, |
| 894 | recovery := *, |
| 895 | chargingGatewayName := *, |
| 896 | chargingGatewayAddress := *, |
| 897 | csid := *, |
| 898 | lDN := *, |
| 899 | pGW_Back_OffTime := *, |
| 900 | aPCO := *, |
| 901 | trustedWLANIPv4Parameters := *, |
| 902 | indicationFlags := *, |
| 903 | presenceReportingAreaAction := *, |
| 904 | loadControlInformationGrouped := *, |
| 905 | overloadControlInformationGrouped := *, |
| 906 | nBIFOMContainer := *, |
| 907 | pDNConnectionChargingID := *, |
| 908 | extendedProtocolConfigOptions := *, |
| 909 | privateExtension := * |
| 910 | }}); |
| 911 | |
| 912 | |
| 913 | template (value) PDU_GTPCv2 |
| 914 | ts_GTP2C_DeleteSessionReq(template (value) OCT4 d_teid, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 915 | template (omit) GTP2C_Cause cause := omit, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 916 | template (value) FullyQualifiedTEID sender_fteid, |
| 917 | template (omit) FullyQualifiedTEID_List teid_list := omit, |
| 918 | template (value) uint4_t bearer_id) := |
| 919 | ts_PDU_GTP2C(d_teid, '000000'O, '24'O, { |
| 920 | deleteSessionRequest := { |
| 921 | cause := fs_GTP2C_Cause(cause, '0'B), |
| 922 | linkedEPS_Bearer_ID := ts_GTP2C_EpsBearerId(bearer_id), |
| 923 | uLI := omit, |
| 924 | indicationFlags := omit, |
| 925 | protocolConfigOptions := omit, |
| 926 | originatingNode := omit, |
| 927 | fullyQualifiedTEID := sender_fteid, |
| 928 | uE_TimeZone := omit, |
| 929 | uLITimestamp := omit, |
| 930 | rANNASReleaseCause := omit, |
| 931 | trustedWLANAccessNetworkIdentifier := omit, |
| 932 | tWANIdentifierTimestamp := omit, |
| 933 | overloadControlInformationGrouped := omit, |
| 934 | uELocalIP_Addr := omit, |
| 935 | portNumber := omit, |
| 936 | extendedProtocolConfigOptions := omit, |
| 937 | privateExtension := omit |
| 938 | }}); |
| 939 | template (present) PDU_GTPCv2 |
| 940 | tr_GTP2C_DeleteSessionReq(template (present) OCT4 d_teid, |
| 941 | template (present) OCT3 seq := ?, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 942 | template (omit) GTP2C_Cause cause, |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 943 | template (present) FullyQualifiedTEID sender_fteid, |
| 944 | template FullyQualifiedTEID_List teid_list, |
| 945 | template (present) uint4_t bearer_id) := |
| 946 | tr_PDU_GTP2C(d_teid, seq, { |
| 947 | deleteSessionRequest := { |
| 948 | cause := fr_GTP2C_Cause(cause), |
| 949 | linkedEPS_Bearer_ID := tr_GTP2C_EpsBearerId(bearer_id), |
| 950 | uLI := *, |
| 951 | indicationFlags := *, |
| 952 | protocolConfigOptions := *, |
| 953 | originatingNode := *, |
| 954 | fullyQualifiedTEID := sender_fteid, |
| 955 | uE_TimeZone := *, |
| 956 | uLITimestamp := *, |
| 957 | rANNASReleaseCause := *, |
| 958 | trustedWLANAccessNetworkIdentifier := *, |
| 959 | tWANIdentifierTimestamp := *, |
| 960 | overloadControlInformationGrouped := *, |
| 961 | uELocalIP_Addr := *, |
| 962 | portNumber := *, |
| 963 | extendedProtocolConfigOptions := *, |
| 964 | privateExtension := * |
| 965 | }}); |
| 966 | |
| 967 | |
| 968 | template (value) PDU_GTPCv2 |
| 969 | ts_GTP2C_DeleteSessionResp(template (value) OCT4 d_teid, |
| 970 | template (value) OCT3 seq, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 971 | template (value) GTP2C_Cause cause) := |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 972 | ts_PDU_GTP2C(d_teid, '000000'O, '25'O, { |
| 973 | deleteSessionResponse := { |
| 974 | cause := ts_GTP2C_Cause(cause, '0'B), |
| 975 | recovery := omit, |
| 976 | protocolConfigOptions := omit, |
| 977 | indicationFlags := omit, |
| 978 | loadControlInformationGrouped := omit, |
| 979 | overloadControlInformationGrouped := omit, |
| 980 | extendedProtocolConfigOptions := omit, |
| 981 | privateExtension := omit |
| 982 | |
| 983 | }}); |
| 984 | template (present) PDU_GTPCv2 |
| 985 | tr_GTP2C_DeleteSessionResp(template (present) OCT4 d_teid, |
| 986 | template (present) OCT3 seq := ?, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 987 | template (present) GTP2C_Cause cause := ? |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 988 | ) := |
| 989 | tr_PDU_GTP2C(d_teid, seq, { |
| 990 | deleteSessionResponse := { |
| 991 | cause := tr_GTP2C_Cause(cause), |
| 992 | recovery := *, |
| 993 | protocolConfigOptions := *, |
| 994 | indicationFlags := *, |
| 995 | loadControlInformationGrouped := *, |
| 996 | overloadControlInformationGrouped := *, |
| 997 | extendedProtocolConfigOptions := *, |
| 998 | privateExtension := * |
| 999 | }}); |
| 1000 | |
| 1001 | template (value) PDU_GTPCv2 |
| 1002 | ts_GTP2C_CreateBearerReq(template (value) OCT4 d_teid, |
| 1003 | template (value) integer proc_trans_id, |
| 1004 | template (value) uint4_t linked_id, |
| 1005 | template (value) uint4_t bearer_id, |
| 1006 | template (omit) FullyQualifiedTEID_List teid_list, |
| 1007 | template (value) Bearer_QoS qos := ts_GTP2C_BearerQos('09'O, 0,0,0,0)) := |
| 1008 | ts_PDU_GTP2C(d_teid, '000000'O, '5F'O, { |
| 1009 | createBearerRequest := { |
| 1010 | procedureTransactionID := ts_GTP2C_ProcTransId(proc_trans_id), |
| 1011 | linkedEPS_BearerID := ts_GTP2C_EpsBearerId(linked_id), |
| 1012 | protocolConfigOptions := omit, |
| 1013 | bearerContextGrouped := { |
| 1014 | ts_GTP2C_BcGrouped({ |
| 1015 | ePS_Bearer_ID := ts_GTP2C_EpsBearerId(bearer_id), |
| 1016 | cause := omit, |
| 1017 | ePS_Bearer_TFT := omit, |
| 1018 | fullyQualifiedTEID := teid_list, |
| 1019 | bearerLevel_QoS := qos, |
| 1020 | chargingID := omit, |
| 1021 | bearerFlags := omit, |
| 1022 | transactionIdentifier := omit, |
| 1023 | protocolConfigOptions := omit, |
| 1024 | rAN_NASCause := omit, |
| 1025 | additionalProtocolConfigOptions := omit, |
| 1026 | extendedProtocolConfigOptions := omit |
| 1027 | }) |
| 1028 | }, |
| 1029 | csid := omit, |
| 1030 | changeReportingAction := omit, |
| 1031 | cSG_InformationReportingAction := omit, |
| 1032 | heNBInformationReporting := omit, |
| 1033 | presenceReportingAreaAction := omit, |
| 1034 | indicationFlags := omit, |
| 1035 | loadControlInformationGrouped := omit, |
| 1036 | overloadControlInformationGrouped := omit, |
| 1037 | nBIFOMContainer := omit, |
| 1038 | privateExtension := omit |
| 1039 | }}); |
| 1040 | |
| 1041 | |
| 1042 | template (value) PDU_GTPCv2 |
| 1043 | ts_GTP2C_DeleteBearerReq(template (value) OCT4 d_teid, |
| 1044 | template (value) integer proc_trans_id, |
| 1045 | template (value) uint4_t bearer_id, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 1046 | template (value) GTP2C_Cause cause) := |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 1047 | ts_PDU_GTP2C(d_teid, '000000'O, '63'O, { |
| 1048 | deleteBearerRequest := { |
| 1049 | epsBearerIdentity := { ts_GTP2C_EpsBearerId(bearer_id) }, |
| 1050 | bearerContextGrouped := omit, |
| 1051 | procedureTransactionID := ts_GTP2C_ProcTransId(proc_trans_id), |
| 1052 | protocolConfigOptions := omit, |
| 1053 | csid := omit, |
| 1054 | cause := ts_GTP2C_Cause(cause, '0'B), |
| 1055 | indicationFlags := omit, |
| 1056 | loadControlInformationGrouped := omit, |
| 1057 | overloadControlInformationGrouped := omit, |
| 1058 | nBIFOMContainer := omit, |
| 1059 | extendedProtocolConfigOptions := omit, |
| 1060 | privateExtension := omit |
| 1061 | }}); |
| 1062 | |
| 1063 | |
| 1064 | template (present) PDU_GTPCv2 |
| 1065 | tr_GTP2C_DeleteBearerResp(template (present) OCT4 d_teid, |
| 1066 | template (present) OCT3 seq := ?, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 1067 | template (present) GTP2C_Cause cause := ?) := |
Harald Welte | 88b3ccb | 2020-03-12 21:36:32 +0100 | [diff] [blame] | 1068 | tr_PDU_GTP2C(d_teid, seq, { |
| 1069 | deleteBearerResponse := { |
| 1070 | cause := tr_GTP2C_Cause(cause), |
| 1071 | linkedBearerIdentity := *, |
| 1072 | bearerContextGrouped := *, |
| 1073 | recovery := *, |
| 1074 | csid := *, |
| 1075 | protocolConfigOptions := *, |
| 1076 | uE_TimeZone := *, |
| 1077 | uLI := *, |
| 1078 | uLITimestamp := *, |
| 1079 | trustedWLANAccessNetworkIdentifier := *, |
| 1080 | tWANIdentifierTimestamp := *, |
| 1081 | overloadControlInformationGrouped := *, |
| 1082 | iP_Addr := *, |
| 1083 | portNumber := *, |
| 1084 | nBIFOMContainer := *, |
| 1085 | privateExtension := * |
| 1086 | }}); |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 1087 | |
Vadim Yanitskiy | bada3c9 | 2022-01-20 18:59:07 +0600 | [diff] [blame] | 1088 | /* 8.18 */ |
| 1089 | template (value) ServingNetwork |
| 1090 | ts_GTP2C_ServingNetwork(template (value) hexstring mcc, |
| 1091 | template (value) hexstring mnc, |
| 1092 | template (value) BIT4 instance := '0000'B) := |
| 1093 | { |
| 1094 | elementIdentifier := '53'O, |
| 1095 | lengthIndicator := 0, /* overwritten */ |
| 1096 | instance := instance, |
| 1097 | spare := '0000'B, |
| 1098 | mccDigit1 := mcc[0], |
| 1099 | mccDigit2 := mcc[1], |
| 1100 | mccDigit3 := mcc[2], |
| 1101 | mncDigit3 := mnc[2], /* 'F'H for 2 digit MNC */ |
| 1102 | mncDigit1 := mnc[0], |
| 1103 | mncDigit2 := mnc[1], |
| 1104 | additionalOctets := omit |
| 1105 | } |
| 1106 | |
Harald Welte | 0f7d03a | 2019-07-16 19:43:32 +0900 | [diff] [blame] | 1107 | |
| 1108 | |
| 1109 | } |