blob: c09bca822bd5a9fae52afb4e0afdaf2357254195 [file] [log] [blame]
Harald Welte0f7d03a2019-07-16 19:43:32 +09001module 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
12import from General_Types all;
13import from Osmocom_Types all;
14import from GTPv2_Types all;
15
16private 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
24private 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
32template (present) PDU_GTPCv2 tr_PDU_GTP2C(template OCT4 teid := ?,
Harald Welte88b3ccb2020-03-12 21:36:32 +010033 template (present) OCT3 seq := ?,
Harald Welte0f7d03a2019-07-16 19:43:32 +090034 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 Welte88b3ccb2020-03-12 21:36:32 +010043 sequenceNumber := seq,
Harald Welte0f7d03a2019-07-16 19:43:32 +090044 spare3 := '00'O,
45 gtpcv2_pdu := pdus,
46 piggybackPDU_GTPCv2 := piggyback
47}
48
Harald Welte88b3ccb2020-03-12 21:36:32 +010049template (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);
75template (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
102template (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 Welte0f7d03a2019-07-16 19:43:32 +0900115
116/* 8.3 */
117template (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}
124template (present) IMSI tr_GTP2C_Imsi(template (present) hexstring imsi) := {
125 elementIdentifier := '01'O,
126 lengthIndicator := ?,
127 instance := ?,
128 spare := '0000'B,
Pau Espin Pedrol5c18a0c2023-10-19 13:41:41 +0200129 iMSI_Value := f_pad_bcd_number_tmpl(imsi)
Harald Welte0f7d03a2019-07-16 19:43:32 +0900130}
131
Harald Welte88b3ccb2020-03-12 21:36:32 +0100132template (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}
139private function fs_GTP2C_msisdn(template (omit) hexstring msisdn) return
140template (omit) MSISDN {
141 if (istemplatekind(msisdn, "omit")) {
142 return omit;
143 } else {
144 return ts_GTP2C_msisdn(msisdn);
145 }
146}
147
148
Harald Welte0f7d03a2019-07-16 19:43:32 +0900149/* 8.4-1 */
Harald Welte0f7d03a2019-07-16 19:43:32 +0900150type 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 Pedrol1344e472023-10-23 19:54:29 +0200155 Error_Ind_from_RNC_eNB_SGSN_MME (6),
Harald Welte0f7d03a2019-07-16 19:43:32 +0900156 IMSI_Detach_Only (7),
157 Reactivation_Required (8),
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200158 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 Welte0f7d03a2019-07-16 19:43:32 +0900172
173/* 8.4 */
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200174template (value) Cause ts_GTP2C_Cause(template (value) GTP2C_Cause cause,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900175 template (value) BIT1 cs) := {
176 elementIdentifier := '02'O,
177 lengthIndicator := 0, /* overwritten */
178 instance := '0000'B,
179 spare := '0000'B,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200180 causeValue := int2oct(enum2int(valueof(cause)), 1),
Harald Welte0f7d03a2019-07-16 19:43:32 +0900181 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 Pedrol1344e472023-10-23 19:54:29 +0200190private 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}
202template (present) Cause tr_GTP2C_Cause(template (present) GTP2C_Cause cause) := {
Harald Welte0f7d03a2019-07-16 19:43:32 +0900203 elementIdentifier := '02'O,
204 lengthIndicator := ?,
205 instance := ?,
206 spare := '0000'B,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200207 causeValue := int2oct_tmpl(enum2int_GTP2C_Cause_tmpl(cause), 1),
Harald Welte0f7d03a2019-07-16 19:43:32 +0900208 cS := ?,
209 bCE := ?,
210 pCE := ?,
211 spare2 := '00000'B,
212 typeOfOffendingIE := *,
213 lengthIndicator2 := *,
214 instanceOfOffendingIE := *,
215 spare3 := *
216}
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200217private function fs_GTP2C_Cause(template (omit) GTP2C_Cause cause, template (value) BIT1 cs) return
Harald Welte88b3ccb2020-03-12 21:36:32 +0100218template (omit) Cause {
219 if (istemplatekind(cause, "omit")) {
220 return omit;
221 } else {
222 return ts_GTP2C_Cause(cause, cs);
223 }
224}
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200225private function fr_GTP2C_Cause(template GTP2C_Cause cause) return
Harald Welte88b3ccb2020-03-12 21:36:32 +0100226template 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 Welte0f7d03a2019-07-16 19:43:32 +0900236
Pau Espin Pedrol2a2e8542023-10-19 13:39:45 +0200237/* 8.6 */
Harald Welte0f7d03a2019-07-16 19:43:32 +0900238template (value) AccessPointName ts_GTP2C_APN(template (value) octetstring apn) := {
Pau Espin Pedrol2a2e8542023-10-19 13:39:45 +0200239 elementIdentifier := '47'O,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900240 lengthIndicator := 0, /* overwritten */
241 instance := '0000'B,
242 spare := '0000'B,
243 aPN_Value := apn
244}
245template (present) AccessPointName tr_GTP2C_APN(template (present) octetstring apn) := {
Pau Espin Pedrol2a2e8542023-10-19 13:39:45 +0200246 elementIdentifier := '47'O,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900247 lengthIndicator := ?,
248 instance := ?,
249 spare := '0000'B,
250 aPN_Value := apn
251}
252
Harald Welte88b3ccb2020-03-12 21:36:32 +0100253/* 8.7 */
254template (value) AggregateMaximumBitRate
255ts_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 */
265template (value) EPS_BearerID
266ts_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}
275template (present) EPS_BearerID
276tr_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 Welte0f7d03a2019-07-16 19:43:32 +0900288/* 8.14 */
289template (value) PDN_AddressAllocation
290ts_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}
300template (present) PDN_AddressAllocation
301tr_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}
311template (value) PDN_AddressAllocation
312ts_GTP2C_PdnAddrAlloc_v4(template (value) OCT4 addr) :=
313 ts_GTP2C_PdnAddrAlloc('001'B, {iPv4_Address:=addr});
314template (present) PDN_AddressAllocation
315tr_GTP2C_PdnAddrAlloc_v4(template (present) OCT4 addr) :=
316 ts_GTP2C_PdnAddrAlloc('001'B, {iPv4_Address:=addr});
317
Harald Welte88b3ccb2020-03-12 21:36:32 +0100318/* 8.15 */
319template (value) Bearer_QoS
320ts_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 Welte0f7d03a2019-07-16 19:43:32 +0900343/* 8.17 */
344template (value) RAT_Type ts_GTP2C_RatType(template (value) integer rat) := {
Pau Espin Pedrol2a2e8542023-10-19 13:39:45 +0200345 elementIdentifier := '52'O,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900346 lengthIndicator := 0, /* overwritten */
347 instance := '0000'B,
348 spare := '0000'B,
349 rAT_TypeValue := rat,
350 additionalOctets := omit
351}
352template (present) RAT_Type tr_GTP2C_RatType(template (present) integer rat) := {
Pau Espin Pedrol2a2e8542023-10-19 13:39:45 +0200353 elementIdentifier := '52'O,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900354 lengthIndicator := ?,
355 instance := ?,
356 spare := '0000'B,
357 rAT_TypeValue := rat,
358 additionalOctets := *
359}
360
Harald Welte88b3ccb2020-03-12 21:36:32 +0100361/* 8.21 */
362function 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)
368return 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 Welte0f7d03a2019-07-16 19:43:32 +0900421
422/* 8.22 */
423private 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 Welte88b3ccb2020-03-12 21:36:32 +0100431type 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 Welte0f7d03a2019-07-16 19:43:32 +0900473template (value) FullyQualifiedTEID
Harald Welte88b3ccb2020-03-12 21:36:32 +0100474ts_GTP2C_FTEID(FteidInterface if_type, OCT4 teid, uint4_t instance := 0,
475 template (omit) OCT4 v4_addr := omit,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900476 template (omit) OCT16 v6_addr := omit) := {
477 elementIdentifier := '57'O,
478 lengthIndicator := 0, /* overwritten */
Harald Welte88b3ccb2020-03-12 21:36:32 +0100479 instance := int2bit(instance, 4),
Harald Welte0f7d03a2019-07-16 19:43:32 +0900480 spare := '0000'B,
Harald Welte88b3ccb2020-03-12 21:36:32 +0100481 interfaceType := enum2int(if_type),
482 v6_Flag := f_bit4oct(v6_addr),
483 v4_Flag := f_bit4oct(v4_addr),
Harald Welte0f7d03a2019-07-16 19:43:32 +0900484 tEID_GRE_Key := teid,
485 iPv4_Address := v4_addr,
486 iPv6_Address := v6_addr,
487 additionalOctets := omit
488}
489template (present) FullyQualifiedTEID
490tr_GTP2C_FTEID(template (present) integer if_type, template (present) OCT4 teid,
Harald Welte88b3ccb2020-03-12 21:36:32 +0100491 template BIT4 instance := ?,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900492 template OCT4 v4_addr := omit,
493 template OCT16 v6_addr := omit) := {
494 elementIdentifier := '57'O,
495 lengthIndicator := ?,
Harald Welte88b3ccb2020-03-12 21:36:32 +0100496 instance := instance,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900497 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 Welte88b3ccb2020-03-12 21:36:32 +0100507/* 8.28 */
Pau Espin Pedrol8c746492023-10-23 20:56:09 +0200508template (value) BearerContextIEs
Pau Espin Pedrold4a20082023-10-23 19:59:24 +0200509ts_GTP2C_BcContextIE(template (value) uint4_t ebi,
Pau Espin Pedrol8c746492023-10-23 20:56:09 +0200510 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) := {
Pau Espin Pedrold4a20082023-10-23 19:59:24 +0200513 ePS_Bearer_ID := ts_GTP2C_EpsBearerId(ebi),
Pau Espin Pedrol8c746492023-10-23 20:56:09 +0200514 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 Welte88b3ccb2020-03-12 21:36:32 +0100527template (value) BearerContextGrouped
528ts_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}
535template (present) BearerContextGrouped
536tr_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 Pedrol8c746492023-10-23 20:56:09 +0200544/* 8.29 */
545template (value) ChargingID
546ts_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 Welte88b3ccb2020-03-12 21:36:32 +0100554
555/* 8.30 */
556template (value) ChargingCharacteristics
557ts_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}
565template (present) ChargingCharacteristics
566tr_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 */
577template (value) PDN_Type
578ts_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}
587template (present) PDN_Type
588tr_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 */
599template (value) ProcedureTransactionID
600ts_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}
608template (present) ProcedureTransactionID
609tr_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 */
620template (value) APN_Restriction
621ts_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}
629template (present) APN_Restriction
630tr_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 */
641template (value) SelectionMode
642ts_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}
651template (present) SelectionMode
652tr_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 Welte0f7d03a2019-07-16 19:43:32 +0900663
664
665template (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 Welte88b3ccb2020-03-12 21:36:32 +0100683template (value) PDU_GTPCv2
684ts_GTP2C_EchoReq(template (value) integer rec_val) :=
685ts_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 Welte0f7d03a2019-07-16 19:43:32 +0900697template (present) PDU_GTPCv2
Harald Welte88b3ccb2020-03-12 21:36:32 +0100698tr_GTP2C_EchoReq(template (present) OCT3 seq := ?) :=
699tr_PDU_GTP2C(omit, seq, { echoRequest := ? }, omit);
700
701template (value) PDU_GTPCv2
702ts_GTP2C_EchoResp(template (value) integer rec_val) :=
703ts_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 }});
715template (present) PDU_GTPCv2
716tr_GTP2C_EchoResp(template (present) OCT3 seq := ?) :=
717tr_PDU_GTP2C(omit, seq, { echoResponse := ? }, omit);
718
719
720
721template (present) PDU_GTPCv2
722ts_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)) :=
728ts_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
791template (present) PDU_GTPCv2
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200792tr_GTP2C_CreateSessionReq(template (present) hexstring imsi := ?, template (present) octetstring apn := ?) :=
Harald Welte88b3ccb2020-03-12 21:36:32 +0100793tr_PDU_GTP2C('00000000'O, ?, {
Harald Welte0f7d03a2019-07-16 19:43:32 +0900794 createSessionRequest := {
795 iMSI := tr_GTP2C_Imsi(imsi),
796 mSISDN := *,
797 mEI := *,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200798 userLocationInfo := *,
799 servingNetwork := *,
800 rAT_Type := tr_GTP2C_RatType(?),
Harald Welte0f7d03a2019-07-16 19:43:32 +0900801 indication := *,
802 fullyQualifiedTEID := ?,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200803 accessPointName := tr_GTP2C_APN(apn), // '*'
Harald Welte0f7d03a2019-07-16 19:43:32 +0900804 selectionMode := ?,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200805 pDN_Type := *,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900806 pDN_AddressAllocation := ?,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200807 maxAPN_Restriction := *,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900808 ambr := *,
809 linkedEPS_Bearer_ID := omit,
810 trustedWLANModeIndication := omit,
811 protocolConfigOptions := omit,
812 bearerContextGrouped := ?,
813 traceInformation := *,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200814 recovery := *,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900815 csid := omit,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200816 uE_TimeZone := *,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900817 user_CSG_Information := omit,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200818 chargingCharacteristics := *,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900819 lDN := omit,
820 signallingPriorityIndication := *,
821 iP_Addr := omit,
822 portNumber := omit,
Pau Espin Pedrol90a46c42023-10-19 13:44:44 +0200823 aPCO := *,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900824 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
840template (value) PDU_GTPCv2
Pau Espin Pedrolfa2b3842023-12-13 18:49:19 +0100841ts_GTP2C_CreateSessionResp(template (value) OCT4 d_teid,
842 template (value) OCT3 seq,
843 template (value) FullyQualifiedTEID_List fteids,
Pau Espin Pedrol8c746492023-10-23 20:56:09 +0200844 template (value) PDN_AddressAllocation addr,
845 template (omit) BearerContextGrouped_List bearerContextGrouped := omit) :=
Pau Espin Pedrolfa2b3842023-12-13 18:49:19 +0100846ts_PDU_GTP2C(d_teid, seq, '21'O, {
Harald Welte0f7d03a2019-07-16 19:43:32 +0900847 createSessionResponse := {
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200848 cause := ts_GTP2C_Cause(Request_accepted, '0'B),
Harald Welte0f7d03a2019-07-16 19:43:32 +0900849 changeReportingAction := omit,
850 cSG_InformationReportingAction := omit,
851 heNBInformationReporting := omit,
852 fullyQualifiedTEID := fteids,
853 pDN_AddressAllocation := addr,
854 aPN_Restriction := omit,
855 ambr := omit,
856 linkedEPS_Bearer_ID := omit,
857 protocolConfigOptions := omit,
Pau Espin Pedrol8c746492023-10-23 20:56:09 +0200858 bearerContextGrouped := bearerContextGrouped,
Harald Welte0f7d03a2019-07-16 19:43:32 +0900859 recovery := omit,
860 chargingGatewayName := omit,
861 chargingGatewayAddress := omit,
862 csid := omit,
863 lDN := omit,
864 pGW_Back_OffTime := omit,
865 aPCO := omit,
866 trustedWLANIPv4Parameters := omit,
867 indicationFlags := omit,
868 presenceReportingAreaAction := omit,
869 loadControlInformationGrouped := omit,
870 overloadControlInformationGrouped := omit,
871 nBIFOMContainer := omit,
872 pDNConnectionChargingID := omit,
873 extendedProtocolConfigOptions := omit,
874 privateExtension := omit
875 }});
Harald Welte88b3ccb2020-03-12 21:36:32 +0100876template (present) PDU_GTPCv2
877tr_GTP2C_CreateSessionResp(template (present) OCT4 d_teid := ?,
878 template (present) OCT3 seq := ?,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200879 template (present) GTP2C_Cause cause := ?,
Harald Welte88b3ccb2020-03-12 21:36:32 +0100880 template FullyQualifiedTEID_List fteids := *,
881 template PDN_AddressAllocation addr := *,
882 template BearerContextGrouped_List bctxg := *) :=
883tr_PDU_GTP2C(d_teid, seq, {
884 createSessionResponse := {
885 cause := tr_GTP2C_Cause(cause),
886 changeReportingAction := *,
887 cSG_InformationReportingAction := *,
888 heNBInformationReporting := *,
889 fullyQualifiedTEID := fteids,
890 pDN_AddressAllocation := addr,
891 aPN_Restriction := ?,
892 ambr := *,
893 linkedEPS_Bearer_ID := *,
894 protocolConfigOptions := *,
895 bearerContextGrouped := bctxg,
896 recovery := *,
897 chargingGatewayName := *,
898 chargingGatewayAddress := *,
899 csid := *,
900 lDN := *,
901 pGW_Back_OffTime := *,
902 aPCO := *,
903 trustedWLANIPv4Parameters := *,
904 indicationFlags := *,
905 presenceReportingAreaAction := *,
906 loadControlInformationGrouped := *,
907 overloadControlInformationGrouped := *,
908 nBIFOMContainer := *,
909 pDNConnectionChargingID := *,
910 extendedProtocolConfigOptions := *,
911 privateExtension := *
912 }});
913
914
915template (value) PDU_GTPCv2
916ts_GTP2C_DeleteSessionReq(template (value) OCT4 d_teid,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200917 template (omit) GTP2C_Cause cause := omit,
Harald Welte88b3ccb2020-03-12 21:36:32 +0100918 template (value) FullyQualifiedTEID sender_fteid,
919 template (omit) FullyQualifiedTEID_List teid_list := omit,
920 template (value) uint4_t bearer_id) :=
921ts_PDU_GTP2C(d_teid, '000000'O, '24'O, {
922 deleteSessionRequest := {
923 cause := fs_GTP2C_Cause(cause, '0'B),
924 linkedEPS_Bearer_ID := ts_GTP2C_EpsBearerId(bearer_id),
925 uLI := omit,
926 indicationFlags := omit,
927 protocolConfigOptions := omit,
928 originatingNode := omit,
929 fullyQualifiedTEID := sender_fteid,
930 uE_TimeZone := omit,
931 uLITimestamp := omit,
932 rANNASReleaseCause := omit,
933 trustedWLANAccessNetworkIdentifier := omit,
934 tWANIdentifierTimestamp := omit,
935 overloadControlInformationGrouped := omit,
936 uELocalIP_Addr := omit,
937 portNumber := omit,
938 extendedProtocolConfigOptions := omit,
939 privateExtension := omit
940 }});
941template (present) PDU_GTPCv2
942tr_GTP2C_DeleteSessionReq(template (present) OCT4 d_teid,
943 template (present) OCT3 seq := ?,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200944 template (omit) GTP2C_Cause cause,
Harald Welte88b3ccb2020-03-12 21:36:32 +0100945 template (present) FullyQualifiedTEID sender_fteid,
946 template FullyQualifiedTEID_List teid_list,
947 template (present) uint4_t bearer_id) :=
948tr_PDU_GTP2C(d_teid, seq, {
949 deleteSessionRequest := {
950 cause := fr_GTP2C_Cause(cause),
951 linkedEPS_Bearer_ID := tr_GTP2C_EpsBearerId(bearer_id),
952 uLI := *,
953 indicationFlags := *,
954 protocolConfigOptions := *,
955 originatingNode := *,
956 fullyQualifiedTEID := sender_fteid,
957 uE_TimeZone := *,
958 uLITimestamp := *,
959 rANNASReleaseCause := *,
960 trustedWLANAccessNetworkIdentifier := *,
961 tWANIdentifierTimestamp := *,
962 overloadControlInformationGrouped := *,
963 uELocalIP_Addr := *,
964 portNumber := *,
965 extendedProtocolConfigOptions := *,
966 privateExtension := *
967 }});
968
969
970template (value) PDU_GTPCv2
971ts_GTP2C_DeleteSessionResp(template (value) OCT4 d_teid,
972 template (value) OCT3 seq,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200973 template (value) GTP2C_Cause cause) :=
Pau Espin Pedrol2e9988d2023-12-13 18:48:33 +0100974ts_PDU_GTP2C(d_teid, seq, '25'O, {
Harald Welte88b3ccb2020-03-12 21:36:32 +0100975 deleteSessionResponse := {
976 cause := ts_GTP2C_Cause(cause, '0'B),
977 recovery := omit,
978 protocolConfigOptions := omit,
979 indicationFlags := omit,
980 loadControlInformationGrouped := omit,
981 overloadControlInformationGrouped := omit,
982 extendedProtocolConfigOptions := omit,
983 privateExtension := omit
984
985 }});
986template (present) PDU_GTPCv2
987tr_GTP2C_DeleteSessionResp(template (present) OCT4 d_teid,
988 template (present) OCT3 seq := ?,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +0200989 template (present) GTP2C_Cause cause := ?
Harald Welte88b3ccb2020-03-12 21:36:32 +0100990 ) :=
991tr_PDU_GTP2C(d_teid, seq, {
992 deleteSessionResponse := {
993 cause := tr_GTP2C_Cause(cause),
994 recovery := *,
995 protocolConfigOptions := *,
996 indicationFlags := *,
997 loadControlInformationGrouped := *,
998 overloadControlInformationGrouped := *,
999 extendedProtocolConfigOptions := *,
1000 privateExtension := *
1001 }});
1002
1003template (value) PDU_GTPCv2
1004ts_GTP2C_CreateBearerReq(template (value) OCT4 d_teid,
1005 template (value) integer proc_trans_id,
1006 template (value) uint4_t linked_id,
1007 template (value) uint4_t bearer_id,
1008 template (omit) FullyQualifiedTEID_List teid_list,
1009 template (value) Bearer_QoS qos := ts_GTP2C_BearerQos('09'O, 0,0,0,0)) :=
1010ts_PDU_GTP2C(d_teid, '000000'O, '5F'O, {
1011 createBearerRequest := {
1012 procedureTransactionID := ts_GTP2C_ProcTransId(proc_trans_id),
1013 linkedEPS_BearerID := ts_GTP2C_EpsBearerId(linked_id),
1014 protocolConfigOptions := omit,
1015 bearerContextGrouped := {
1016 ts_GTP2C_BcGrouped({
1017 ePS_Bearer_ID := ts_GTP2C_EpsBearerId(bearer_id),
1018 cause := omit,
1019 ePS_Bearer_TFT := omit,
1020 fullyQualifiedTEID := teid_list,
1021 bearerLevel_QoS := qos,
1022 chargingID := omit,
1023 bearerFlags := omit,
1024 transactionIdentifier := omit,
1025 protocolConfigOptions := omit,
1026 rAN_NASCause := omit,
1027 additionalProtocolConfigOptions := omit,
1028 extendedProtocolConfigOptions := omit
1029 })
1030 },
1031 csid := omit,
1032 changeReportingAction := omit,
1033 cSG_InformationReportingAction := omit,
1034 heNBInformationReporting := omit,
1035 presenceReportingAreaAction := omit,
1036 indicationFlags := omit,
1037 loadControlInformationGrouped := omit,
1038 overloadControlInformationGrouped := omit,
1039 nBIFOMContainer := omit,
1040 privateExtension := omit
1041 }});
1042
Pau Espin Pedrolecfc7d62023-12-13 18:49:29 +01001043template (present) PDU_GTPCv2
1044tr_GTP2C_ModifyBearerReq(template (present) OCT4 d_teid := ?,
1045 template (present) OCT3 seq := ?) :=
1046tr_PDU_GTP2C(d_teid, seq, {
1047 modifyBearerRequest := {
1048 mEI := *,
1049 userLocationInfo := *,
1050 servingNetwork := *,
1051 rAT_Type := *,
1052 indicationFlags := *,
1053 fullyQualifiedTEID := *,
1054 ambr := *,
1055 delayDownlinkPacketNotificationReq := *,
1056 bearerContextGrouped := *,
1057 recovery := *,
1058 uE_TimeZone := *,
1059 csid := *,
1060 user_CSG_Information := *,
1061 iP_Addr := *,
1062 portNumber := *,
1063 lDN := *,
1064 //maxMBR_APN_AMBR := *,
1065 cNOperatorSelectionEntity := *,
1066 presenceReportingAreaInformation := *,
1067 overloadControlInformationGrouped := *,
1068 servingPLMNRateControl := *,
1069 counter := *,
1070 privateExtension := *
1071 }});
1072
1073template (value) PDU_GTPCv2
1074ts_GTP2C_ModifyBearerResp(template (value) OCT4 d_teid,
1075 template (value) OCT3 seq,
1076 template (value) GTP2C_Cause cause,
1077 template (value) uint4_t bearer_id,
1078 template (omit) BearerContextGrouped_List bearerContextGrouped := omit) :=
1079ts_PDU_GTP2C(d_teid, seq, '23'O, {
1080 modifyBearerResponse := {
1081 cause := ts_GTP2C_Cause(cause, '0'B),
1082 mSISDN := omit,
1083 linkedEPS_Bearer_ID := ts_GTP2C_EpsBearerId(bearer_id),
1084 aPN_Restriction := omit,
1085 protocolConfigOptions := omit,
1086 bearerContextGrouped := bearerContextGrouped,
1087 changeReportingAction := omit,
1088 cSG_InformationReportingAction := omit,
1089 heNBInformationReporting := omit,
1090 chargingGatewayName := omit,
1091 chargingGatewayAddress := omit,
1092 csid := omit,
1093 recovery := omit,
1094 lDN := omit,
1095 indicationFlags := omit,
1096 presenceReportingAreaAction := omit,
1097 loadControlInformationGrouped := omit,
1098 overloadControlInformationGrouped := omit,
1099 pDNConnectionChargingID := omit,
1100 privateExtension := omit
1101 }});
Harald Welte88b3ccb2020-03-12 21:36:32 +01001102
1103template (value) PDU_GTPCv2
1104ts_GTP2C_DeleteBearerReq(template (value) OCT4 d_teid,
1105 template (value) integer proc_trans_id,
1106 template (value) uint4_t bearer_id,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +02001107 template (value) GTP2C_Cause cause) :=
Harald Welte88b3ccb2020-03-12 21:36:32 +01001108ts_PDU_GTP2C(d_teid, '000000'O, '63'O, {
1109 deleteBearerRequest := {
1110 epsBearerIdentity := { ts_GTP2C_EpsBearerId(bearer_id) },
1111 bearerContextGrouped := omit,
1112 procedureTransactionID := ts_GTP2C_ProcTransId(proc_trans_id),
1113 protocolConfigOptions := omit,
1114 csid := omit,
1115 cause := ts_GTP2C_Cause(cause, '0'B),
1116 indicationFlags := omit,
1117 loadControlInformationGrouped := omit,
1118 overloadControlInformationGrouped := omit,
1119 nBIFOMContainer := omit,
1120 extendedProtocolConfigOptions := omit,
1121 privateExtension := omit
1122 }});
1123
1124
1125template (present) PDU_GTPCv2
1126tr_GTP2C_DeleteBearerResp(template (present) OCT4 d_teid,
1127 template (present) OCT3 seq := ?,
Pau Espin Pedrol1344e472023-10-23 19:54:29 +02001128 template (present) GTP2C_Cause cause := ?) :=
Harald Welte88b3ccb2020-03-12 21:36:32 +01001129tr_PDU_GTP2C(d_teid, seq, {
1130 deleteBearerResponse := {
1131 cause := tr_GTP2C_Cause(cause),
1132 linkedBearerIdentity := *,
1133 bearerContextGrouped := *,
1134 recovery := *,
1135 csid := *,
1136 protocolConfigOptions := *,
1137 uE_TimeZone := *,
1138 uLI := *,
1139 uLITimestamp := *,
1140 trustedWLANAccessNetworkIdentifier := *,
1141 tWANIdentifierTimestamp := *,
1142 overloadControlInformationGrouped := *,
1143 iP_Addr := *,
1144 portNumber := *,
1145 nBIFOMContainer := *,
1146 privateExtension := *
1147 }});
Harald Welte0f7d03a2019-07-16 19:43:32 +09001148
Vadim Yanitskiybada3c92022-01-20 18:59:07 +06001149/* 8.18 */
1150template (value) ServingNetwork
1151ts_GTP2C_ServingNetwork(template (value) hexstring mcc,
1152 template (value) hexstring mnc,
1153 template (value) BIT4 instance := '0000'B) :=
1154{
1155 elementIdentifier := '53'O,
1156 lengthIndicator := 0, /* overwritten */
1157 instance := instance,
1158 spare := '0000'B,
1159 mccDigit1 := mcc[0],
1160 mccDigit2 := mcc[1],
1161 mccDigit3 := mcc[2],
1162 mncDigit3 := mnc[2], /* 'F'H for 2 digit MNC */
1163 mncDigit1 := mnc[0],
1164 mncDigit2 := mnc[1],
1165 additionalOctets := omit
1166}
1167
Harald Welte0f7d03a2019-07-16 19:43:32 +09001168
1169
1170}