blob: 42866ff38f28a024ad1daa54f49eab4473b2e780 [file] [log] [blame]
Harald Weltee0abc472018-02-05 09:13:31 +01001module Osmocom_Gb_Types {
2
3 /* This module contains additional definitions and templates that we use on top of the
4 * TITAN NS + BSSGP modules */
5
6 import from General_Types all;
7 import from Osmocom_Types all;
Pau Espin Pedrol7e88ce92021-02-05 16:01:36 +01008 import from Misc_Helpers all;
Harald Weltee0abc472018-02-05 09:13:31 +01009 import from GSM_Types all;
Harald Weltee0abc472018-02-05 09:13:31 +010010 import from BSSGP_Types all
11 import from NS_Types all
Harald Weltef4bf1312018-06-30 11:05:20 +020012 import from Native_Functions all;
Harald Weltee0abc472018-02-05 09:13:31 +010013
14 type uint16_t Nsvci;
15 type uint16_t Nsei;
16 type uint16_t BssgpBvci;
17
Harald Weltebe7afce2021-01-17 22:04:36 +010018 template (present) BssgpBvci t_BssgpBvciUser := complement (0);
19
Alexander Couzens20cd41e2021-01-11 02:56:03 +010020 type enumerated OsmoNsDialect {
21 NS2_DIALECT_UNDEF ('00'H),
22 NS2_DIALECT_STATIC_ALIVE ('01'H),
23 NS2_DIALECT_STATIC_RESETBLOCK ('02'H),
24 NS2_DIALECT_IPACCESS ('03'H),
25 NS2_DIALECT_SNS ('04'H)
26 };
27
Harald Weltee0abc472018-02-05 09:13:31 +010028 /* TS 48.016 10.3.7 */
29 type enumerated NsPduType {
30 NS_PDUT_NS_UNITDATA ('00000000'B),
31 NS_PDUT_NS_RESET ('00000010'B),
32 NS_PDUT_NS_RESET_ACK ('00000011'B),
33 NS_PDUT_NS_BLOCK ('00000100'B),
34 NS_PDUT_NS_BLOCK_ACK ('00000101'B),
35 NS_PDUT_NS_UNBLOCK ('00000110'B),
36 NS_PDUT_NS_UNBLOCK_ACK ('00000111'B),
37 NS_PDUT_NS_STATUS ('00001000'B),
38 NS_PDUT_NS_ALIVE ('00001010'B),
39 NS_PDUT_NS_ALIVE_ACK ('00001011'B)
40 /* FIXME: SNS */
41 } with { variant "FIELDLENGTH(8)" };
42
43 /* TS 48.016 10.3 */
44 type enumerated NsIEI {
45 NS_IEI_CAUSE ('00000000'B),
46 NS_IEI_NSVCI ('00000001'B),
47 NS_IEI_NS_PDU ('00000010'B),
48 NS_IEI_BVCI ('00000011'B),
49 NS_IEI_NSEI ('00000100'B),
50 NS_IEI_LIST_IPv4 ('00000101'B),
51 NS_IEI_LIST_IPv6 ('00000110'B),
52 NS_IEI_MAX_NUM_NSVC ('00000111'B),
53 NS_IEI_NUM_IPv4_EP ('00001000'B),
54 NS_IEI_NUM_IPv6_EP ('00001001'B),
55 NS_IEI_RESET_FLAG ('00001010'B),
56 NS_IEI_IP_ADDRESS ('00001011'B)
57 } with { variant "FIELDLENGTH(8)" };
58
59 /* TS 48.016 10.3.2 */
60 type enumerated NsCause {
61 NS_CAUSE_TRANSIT_NETWORK_FAILURE ('00000000'B),
62 NS_CAUSE_OM_INTERVENTION ('00000001'B),
63 NS_CAUSE_EQUIPMENT_FAILURE ('00000010'B),
64 NS_CAUSE_NSVC_BLOCKED ('00000011'B),
65 NS_CAUSE_NSVC_UNKNOWN ('00000100'B),
66 NS_CAUSE_BVCI_UNKNOWN_AT_NSE ('00000101'B),
67 NS_CAUSE_SEMANTICALLY_INCORRECT_PDU ('00001000'B),
68 NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('00001010'B),
Alexander Couzens619213f2021-04-20 10:54:51 +020069 NS_CAUSE_PROTOCOL_ERROR_UNSPECIFIED ('00001011'B),
Harald Weltee0abc472018-02-05 09:13:31 +010070 NS_CAUSE_INVALID_ESSENTIAL_IE ('00001100'B),
71 NS_CAUSE_MISSING_ESSENTIAL_IE ('00001101'B),
72 NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS ('00001110'B),
73 NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS ('00001111'B),
74 NS_CAUSE_INVALID_NR_OF_NSVCS ('00010000'B),
75 NS_CAUSE_INVALID_WEIGHTS ('00010001'B),
76 NS_CAUSE_UNKNOWN_IP_ENDPOINT ('00010010'B),
77 NS_CAUSE_UNKNOWN_IP_ADDRESS ('00010011'B),
78 NS_CAUSE_IP_TEST_FAILEDA ('00010100'B)
79 } with { variant "FIELDLENGTH(8)" };
80
Harald Welte387ab372018-06-30 10:27:06 +020081 template (value) NS_SDU_ControlBits t_SduCtrlB := {
Harald Weltee0abc472018-02-05 09:13:31 +010082 rBit := '0'B,
83 cBit := '0'B,
84 spare := '000000'B
85 }
86
Harald Welte387ab372018-06-30 10:27:06 +020087 template (value) CauseNS ts_NS_IE_CAUSE(NsCause cause) := {
88 iEI := '00'O,
89 ext := '1'B,
90 lengthIndicator := {
91 length1 := 1
92 },
93 cause := int2oct(enum2int(valueof(cause)), 1)
94 }
Harald Weltef4bf1312018-06-30 11:05:20 +020095 function ts_NS_IE_CAUSE_omit(template (omit) NsCause cause) return template (omit) CauseNS {
96 var template (omit) CauseNS ret;
97 if (istemplatekind(cause, "omit")) {
98 return omit;
99 } else {
100 ret := {
101 iEI := '00'O,
102 ext := '1'B,
103 lengthIndicator := {
104 length1 := 1
105 },
106 cause := int2oct(enum2int(valueof(cause)), 1)
107 }
108 return ret;
109 }
110 }
Harald Welte387ab372018-06-30 10:27:06 +0200111
112 function tr_NS_IE_CAUSE(template NsCause cause) return template CauseNS {
Harald Weltee0abc472018-02-05 09:13:31 +0100113 var template CauseNS ret;
114 ret.iEI := '00'O;
115 ret.ext := '1'B;
116 ret.lengthIndicator := { length1 := 1 };
Harald Weltef4bf1312018-06-30 11:05:20 +0200117 if (istemplatekind(cause, "omit")) {
118 return omit;
119 } else if (istemplatekind(cause, "*")) {
120 return *;
121 } else if (istemplatekind(cause, "?")) {
Harald Weltee0abc472018-02-05 09:13:31 +0100122 ret.cause := ?
Harald Weltef4bf1312018-06-30 11:05:20 +0200123 } else {
124 ret.cause := int2oct(enum2int(valueof(cause)), 1);
Harald Weltee0abc472018-02-05 09:13:31 +0100125 }
126 return ret;
127 }
128
Harald Welte630d0e62019-02-22 23:26:40 +0100129 function ts_SNS_IP_ADDR(template (omit) IPAddress ip) return template (omit) IP_Address_NS {
130 var template (omit) IP_Address_NS ret;
131 if (istemplatekind(ip, "omit")) {
132 return omit;
133 } else {
134 ret.iEI := '0B'O;
135 ret.ipAddress := ip;
136 if (ischosen(ip.ip4Address)) {
137 ret.addressType := '01'O;
138 } else {
139 ret.addressType := '02'O;
140 }
141 }
142 return ret;
143 }
144 function tr_SNS_IP_ADDR(template IPAddress ip) return template IP_Address_NS {
145 var template IP_Address_NS ret;
146 ret.iEI := '0B'O;
147 if (istemplatekind(ip, "omit")) {
148 return omit;
149 } else if (istemplatekind(ip, "*")) {
150 return *;
151 } else if (istemplatekind(ip, "?")) {
152 return ?;
153 } else {
154 ret.ipAddress := ip;
155 if (ischosen(ip.ip4Address)) {
156 ret.addressType := '01'O;
157 } else {
158 ret.addressType := '02'O;
159 }
160 }
161 return ret;
162 }
163
Harald Weltee0abc472018-02-05 09:13:31 +0100164 private function f_oct_or_wc(template integer inp, integer len) return template octetstring {
Harald Weltef4bf1312018-06-30 11:05:20 +0200165 if (istemplatekind(inp, "omit")) {
166 return omit;
167 } else if (istemplatekind(inp, "*")) {
168 return *;
169 } else if (istemplatekind(inp, "?")) {
170 return ?;
Harald Weltee0abc472018-02-05 09:13:31 +0100171 }
Harald Weltef4bf1312018-06-30 11:05:20 +0200172 return int2oct(valueof(inp), len);
Harald Weltee0abc472018-02-05 09:13:31 +0100173 }
174
Daniel Willmann00c0bbf2020-11-24 18:37:49 +0100175 private function f_hex_or_wc(template integer inp, integer len) return template hexstring {
176 if (istemplatekind(inp, "omit")) {
177 return omit;
178 } else if (istemplatekind(inp, "*")) {
179 return *;
180 } else if (istemplatekind(inp, "?")) {
181 return ?;
182 }
183 return int2hex(valueof(inp), len);
184 }
185
Harald Welte387ab372018-06-30 10:27:06 +0200186 template (value) NS_VCI ts_NS_IE_NSVCI(Nsvci nsvci) := {
187 iEI := '01'O,
188 ext := '1'B,
189 lengthIndicator := {
190 length1 := 2
191 },
192 nS_VCI := int2oct(nsvci, 2)
193 }
194 template NS_VCI tr_NS_IE_NSVCI(template Nsvci nsvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100195 iEI := '01'O,
196 ext := '1'B,
197 lengthIndicator := {
198 length1 := 2
199 },
200 nS_VCI := f_oct_or_wc(nsvci, 2)
201 }
202
Harald Welte387ab372018-06-30 10:27:06 +0200203 template (value) NSEI_NS ts_NS_IE_NSEI(Nsei nsei) := {
204 iEI:= '04'O,
205 ext := '1'B,
206 lengthIndicator := {
207 length1 := 2
208 },
209 nSEI := int2oct(nsei, 2)
210 }
211 template NSEI_NS tr_NS_IE_NSEI(template Nsei nsei) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100212 iEI:= '04'O,
213 ext := '1'B,
214 lengthIndicator := {
215 length1 := 2
216 },
217 nSEI := f_oct_or_wc(nsei, 2)
218 }
219
Harald Weltef4bf1312018-06-30 11:05:20 +0200220 template (value) IP4_Element ts_SNS_IPv4(charstring ip, integer udp_port,
221 uint8_t sig_weight := 1, uint8_t data_weight := 1) := {
222 ipAddress := f_inet_addr(ip),
223 uDP_Port := int2oct(udp_port, 2),
224 signallingWeight := int2oct(sig_weight, 1),
225 dataWeight := int2oct(data_weight, 1)
226 }
227 function tr_SNS_IPv4(template charstring ip, template integer udp_port,
228 template uint8_t sig_weight := ?, template uint8_t data_weight := ?)
229 return template IP4_Element {
230 var template IP4_Element e;
231 if (istemplatekind(ip, "?")) {
232 e.ipAddress := ?;
233 } else {
234 e.ipAddress := f_inet_addr(valueof(ip));
235 }
236 if (istemplatekind(udp_port, "?")) {
237 e.uDP_Port := ?;
238 } else {
239 e.uDP_Port := int2oct(valueof(udp_port), 2);
240 }
241 if (istemplatekind(sig_weight, "?")) {
242 e.signallingWeight := ?;
243 } else {
244 e.signallingWeight := int2oct(valueof(sig_weight), 1);
245 }
246 if (istemplatekind(data_weight, "?")) {
247 e.dataWeight := ?;
248 } else {
249 e.dataWeight := int2oct(valueof(data_weight), 1);
250 }
251 return e;
252 }
253
Alexander Couzens7b1e44f2020-08-25 23:33:17 +0200254 template (value) IP6_Element ts_SNS_IPv6(charstring ip, integer udp_port,
255 uint8_t sig_weight := 1, uint8_t data_weight := 1) := {
256 ipAddress := f_inet6_addr(ip),
257 uDP_Port := int2oct(udp_port, 2),
258 signallingWeight := int2oct(sig_weight, 1),
259 dataWeight := int2oct(data_weight, 1)
260 }
261 function tr_SNS_IPv6(template charstring ip, template integer udp_port,
262 template uint8_t sig_weight := ?, template uint8_t data_weight := ?)
263 return template IP6_Element {
264 var template IP6_Element e;
265 if (istemplatekind(ip, "?")) {
266 e.ipAddress := ?;
267 } else {
268 e.ipAddress := f_inet6_addr(valueof(ip));
269 }
270 if (istemplatekind(udp_port, "?")) {
271 e.uDP_Port := ?;
272 } else {
273 e.uDP_Port := int2oct(valueof(udp_port), 2);
274 }
275 if (istemplatekind(sig_weight, "?")) {
276 e.signallingWeight := ?;
277 } else {
278 e.signallingWeight := int2oct(valueof(sig_weight), 1);
279 }
280 if (istemplatekind(data_weight, "?")) {
281 e.dataWeight := ?;
282 } else {
283 e.dataWeight := int2oct(valueof(data_weight), 1);
284 }
285 return e;
286 }
287
Harald Welte387ab372018-06-30 10:27:06 +0200288
289 template (value) PDU_NS ts_NS_RESET(NsCause cause, Nsvci nsvci, Nsei nsei) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100290 pDU_NS_Reset := {
291 nsPduType := '02'O,
Harald Welte387ab372018-06-30 10:27:06 +0200292 causeNS := ts_NS_IE_CAUSE(cause),
293 nS_VCI := ts_NS_IE_NSVCI(nsvci),
294 nSEI_NS := ts_NS_IE_NSEI(nsei)
295 }
296 }
297 template PDU_NS tr_NS_RESET(template NsCause cause, template Nsvci nsvci, template Nsei nsei) := {
298 pDU_NS_Reset := {
299 nsPduType := '02'O,
300 causeNS := tr_NS_IE_CAUSE(cause),
301 nS_VCI := tr_NS_IE_NSVCI(nsvci),
302 nSEI_NS := tr_NS_IE_NSEI(nsei)
Harald Weltee0abc472018-02-05 09:13:31 +0100303 }
304 }
305
Harald Welte387ab372018-06-30 10:27:06 +0200306 template (value) PDU_NS ts_NS_RESET_ACK(Nsvci nsvci, Nsei nsei) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100307 pDU_NS_Reset_Ack := {
308 nsPduType := '03'O,
Harald Welte387ab372018-06-30 10:27:06 +0200309 nS_VCI := ts_NS_IE_NSVCI(nsvci),
310 nSEI_NS := ts_NS_IE_NSEI(nsei)
311 }
312 }
313 template PDU_NS tr_NS_RESET_ACK(template Nsvci nsvci, template Nsei nsei) := {
314 pDU_NS_Reset_Ack := {
315 nsPduType := '03'O,
316 nS_VCI := tr_NS_IE_NSVCI(nsvci),
317 nSEI_NS := tr_NS_IE_NSEI(nsei)
Harald Weltee0abc472018-02-05 09:13:31 +0100318 }
319 }
320
Harald Welte387ab372018-06-30 10:27:06 +0200321 template (value) PDU_NS ts_NS_BLOCK(NsCause cause, Nsvci nsvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100322 pDU_NS_Block := {
323 nsPduType := '04'O,
Harald Welte387ab372018-06-30 10:27:06 +0200324 causeNS := ts_NS_IE_CAUSE(cause),
325 nS_VCI := ts_NS_IE_NSVCI(nsvci)
326 }
327 }
328 template PDU_NS tr_NS_BLOCK(template NsCause cause, template Nsvci nsvci) := {
329 pDU_NS_Block := {
330 nsPduType := '04'O,
331 causeNS := tr_NS_IE_CAUSE(cause),
332 nS_VCI := tr_NS_IE_NSVCI(nsvci)
Harald Weltee0abc472018-02-05 09:13:31 +0100333 }
334 }
335
Harald Welte387ab372018-06-30 10:27:06 +0200336 template (value) PDU_NS ts_NS_BLOCK_ACK(Nsvci nsvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100337 pDU_NS_Block_Ack := {
338 nsPduType := '05'O,
Harald Welte387ab372018-06-30 10:27:06 +0200339 nS_VCI := ts_NS_IE_NSVCI(nsvci)
340 }
341 }
342 template PDU_NS tr_NS_BLOCK_ACK(template Nsvci nsvci) := {
343 pDU_NS_Block_Ack := {
344 nsPduType := '05'O,
345 nS_VCI := tr_NS_IE_NSVCI(nsvci)
Harald Weltee0abc472018-02-05 09:13:31 +0100346 }
347 }
348
349 template PDU_NS t_NS_UNBLOCK := {
350 pDU_NS_Unblock := {
351 nsPduType := '06'O
352 }
353 }
354
355 template PDU_NS t_NS_UNBLOCK_ACK := {
356 pDU_NS_Unblock_Ack := {
357 nsPduType := '07'O
358 }
359 }
360
361 template PDU_NS t_NS_ALIVE := {
362 pDU_NS_Alive := {
363 nsPduType := '0A'O
364 }
365 }
366
367 template PDU_NS t_NS_ALIVE_ACK := {
368 pDU_NS_Alive_Ack := {
369 nsPduType := '0B'O
370 }
371 }
372
Harald Welte387ab372018-06-30 10:27:06 +0200373 template (value) PDU_NS ts_NS_STATUS(NsCause cause, PDU_NS pdu) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100374 pDU_NS_Status := {
375 nsPduType := '08'O,
Harald Welte387ab372018-06-30 10:27:06 +0200376 causeNS := ts_NS_IE_CAUSE(cause),
Harald Weltee0abc472018-02-05 09:13:31 +0100377 nS_VCI := omit,
378 nS_PDU := {
379 iEI := '02'O,
380 ext := '1'B,
381 lengthIndicator := {
382 length1 := 0 /* overwritten */
383 },
384 ns_PDU := enc_PDU_NS(pdu)
385 },
386 bVCI_NS := omit,
387 listofIP4Elements := omit,
388 listofIP6Elements := omit
389 }
390 }
391
Alexander Couzens9843b662020-09-07 05:20:54 +0200392 template PDU_NS tr_NS_STATUS(template NsCause cause) := {
393 pDU_NS_Status := {
394 nsPduType := '08'O,
395 causeNS := tr_NS_IE_CAUSE(cause),
396 nS_VCI := *,
397 nS_PDU := *,
398 bVCI_NS := *,
399 listofIP4Elements := *,
400 listofIP6Elements := *
401 }
402 }
403
Harald Welte387ab372018-06-30 10:27:06 +0200404 template (value) PDU_NS ts_NS_UNITDATA(template (value) NS_SDU_ControlBits bits, BssgpBvci bvci, octetstring sdu) := {
405 pDU_NS_Unitdata := {
406 nsPduType := '00'O,
407 nS_SDU_ControlBits := bits,
408 bVCI := int2oct(bvci, 2),
409 nS_SDU := sdu
410 }
411 }
412 template PDU_NS tr_NS_UNITDATA(template NS_SDU_ControlBits bits, template BssgpBvci bvci, template
Harald Weltee0abc472018-02-05 09:13:31 +0100413octetstring sdu) := {
414 pDU_NS_Unitdata := {
415 nsPduType := '00'O,
416 nS_SDU_ControlBits := bits,
417 bVCI := f_oct_or_wc(bvci, 2),
418 nS_SDU := sdu
419 }
420 }
Harald Weltebe7afce2021-01-17 22:04:36 +0100421 template PDU_NS tr_NS_UNITDATA_User(template NS_SDU_ControlBits bits, template octetstring sdu) := {
422 pDU_NS_Unitdata := {
423 nsPduType := '00'O,
424 nS_SDU_ControlBits := bits,
425 bVCI := complement ('0000'O),
426 nS_SDU := sdu
427 }
428 }
Harald Weltee0abc472018-02-05 09:13:31 +0100429
430
Harald Weltef4bf1312018-06-30 11:05:20 +0200431
432 private function ts_num_of_ep(OCT1 iei, template (omit) uint16_t num_ep)
433 return template (omit) NumberOfIP_Endpoints {
434 var template (omit) NumberOfIP_Endpoints t;
435 if (istemplatekind(num_ep, "omit")) {
436 return omit;
437 } else {
438 t.iEI := iei;
439 t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2);
440 return t;
441 }
442 }
443 private function tr_num_of_ep(OCT1 iei, template uint16_t num_ep)
444 return template NumberOfIP_Endpoints {
445 var template NumberOfIP_Endpoints t;
446 if (istemplatekind(num_ep, "omit")) {
447 return omit;
448 } else if (istemplatekind(num_ep, "*")) {
449 return *;
450 } else if (istemplatekind(num_ep, "?")) {
451 return ?;
452 } else {
453 t.iEI := iei;
454 t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2);
455 return t;
456 }
457 }
458
459
460 template (value) ResetFlag ts_SNS_IE_ResetFlag(boolean rst) := {
461 iEI := '0A'O,
462 resetBIT := bool2bit(rst),
463 spare := '0000000'B
464 }
465 template ResetFlag tr_SNS_IE_ResetFlag(template boolean rst) := {
466 iEI := '0A'O,
467 resetBIT := bool2bit_tmpl(rst),
468 spare := '0000000'B
469 }
470
471 template (value) EndFlag ts_SNS_IE_EndFlag(boolean end) := {
472 eBIT := bool2bit(end),
473 spare := '0000000'B
474 }
475 template EndFlag tr_SNS_IE_EndFlag(template boolean end) := {
476 eBIT := bool2bit_tmpl(end),
477 spare := '0000000'B
478 }
479
480 template (value) MaxNumberOfNSVCs ts_SNS_IE_MaxNumOfNSVCs(uint16_t num) := {
481 iEI := '07'O,
482 maxNumberOfNSVCs := int2oct(num, 2)
483 }
484 template MaxNumberOfNSVCs tr_SNS_IE_MaxNumOfNSVCs(template uint16_t num) := {
485 iEI := '07'O,
486 maxNumberOfNSVCs := f_oct_or_wc(num, 2)
487 }
488
489 template (value) PDU_NS ts_SNS_SIZE(Nsei nsei, boolean rst_flag := true,
490 uint16_t max_nsvcs := 2,
491 template (omit) uint16_t num_v4 := 1,
492 template (omit) uint16_t num_v6 := omit) := {
493 pDU_SNS_Size := {
494 nsPduType := '12'O,
495 nSEI_NS := ts_NS_IE_NSEI(nsei),
496 resetFlag := ts_SNS_IE_ResetFlag(rst_flag),
497 maxNumberOfNSVCs := ts_SNS_IE_MaxNumOfNSVCs(max_nsvcs),
498 numberOfIP4_Endpoints := ts_num_of_ep('08'O, num_v4),
499 numberOfIP6_Endpoints := ts_num_of_ep('09'O, num_v6)
500 }
501 }
502 template PDU_NS tr_SNS_SIZE(template Nsei nsei, template boolean rst_flag := ?,
503 template uint16_t max_nsvcs := ?,
504 template uint16_t num_v4 := ?,
505 template uint16_t num_v6 := *) := {
506 pDU_SNS_Size := {
507 nsPduType := '12'O,
508 nSEI_NS := tr_NS_IE_NSEI(nsei),
509 resetFlag := tr_SNS_IE_ResetFlag(rst_flag),
510 maxNumberOfNSVCs := tr_SNS_IE_MaxNumOfNSVCs(max_nsvcs),
511 numberOfIP4_Endpoints := tr_num_of_ep('08'O, num_v4),
512 numberOfIP6_Endpoints := tr_num_of_ep('09'O, num_v6)
513 }
514 }
515
516 template PDU_NS ts_SNS_SIZE_ACK(Nsei nsei, template (omit) NsCause cause) := {
517 pDU_SNS_Size_Ack := {
518 nsPduType := '13'O,
519 nSEI_NS := ts_NS_IE_NSEI(nsei),
520 causeNS := ts_NS_IE_CAUSE_omit(cause)
521 }
522 }
523 template PDU_NS tr_SNS_SIZE_ACK(template Nsei nsei, template NsCause cause) := {
524 pDU_SNS_Size_Ack := {
525 nsPduType := '13'O,
526 nSEI_NS := tr_NS_IE_NSEI(nsei),
527 causeNS := tr_NS_IE_CAUSE(cause)
528 }
529 }
530
531 private function ts_SNS_IE_ListIP4(template (omit) IP4_Elements elem)
532 return template (omit) ListofIP4Elements {
533 var template (omit) ListofIP4Elements r;
534 if (istemplatekind(elem, "omit")) {
535 return omit;
536 } else {
537 r := {
538 iEI := '05'O,
539 ext := '1'B,
540 lengthIndicator := {
541 length1 := 0 /* overwritten */
542 },
543 iP4_Elements := elem
544 }
545 return r;
546 }
547 }
548 private function tr_SNS_IE_ListIP4(template IP4_Elements elem)
549 return template ListofIP4Elements {
550 var template ListofIP4Elements r;
551 if (istemplatekind(elem, "omit")) {
552 return omit;
Harald Welte1308dbb2021-01-18 18:19:38 +0100553 } else if (istemplatekind(elem, "*")) {
554 return *;
555 } else if (istemplatekind(elem, "?")) {
556 return ?;
Harald Weltef4bf1312018-06-30 11:05:20 +0200557 } else {
558 r := {
559 iEI := '05'O,
560 ext := '1'B,
561 lengthIndicator := {
562 length1 := ? /* overwritten */
563 },
564 iP4_Elements := elem
565 }
566 return r;
567 }
568 }
569
570 private function ts_SNS_IE_ListIP6(template (omit) IP6_Elements elem)
571 return template (omit) ListofIP6Elements {
572 var template (omit) ListofIP6Elements r;
573 if (istemplatekind(elem, "omit")) {
574 return omit;
575 } else {
576 r := {
577 iEI := '06'O,
578 ext := '1'B,
579 lengthIndicator := {
580 length1 := 0 /* overwritten */
581 },
582 iP6_Elements := elem
583 }
584 return r;
585 }
586 }
587 private function tr_SNS_IE_ListIP6(template IP6_Elements elem)
588 return template ListofIP6Elements {
589 var template ListofIP6Elements r;
590 if (istemplatekind(elem, "omit")) {
591 return omit;
Harald Welte630d0e62019-02-22 23:26:40 +0100592 } else if (istemplatekind(elem, "*")) {
593 return *;
Harald Welte1308dbb2021-01-18 18:19:38 +0100594 } else if (istemplatekind(elem, "?")) {
595 return ?;
Harald Weltef4bf1312018-06-30 11:05:20 +0200596 } else {
597 r := {
598 iEI := '06'O,
599 ext := '1'B,
600 lengthIndicator := {
601 length1 := ? /* overwritten */
602 },
603 iP6_Elements := elem
604 }
605 return r;
606 }
607 }
608
609 template (value) PDU_NS ts_SNS_CONFIG(Nsei nsei, boolean end_flag,
Alexander Couzens7b1e44f2020-08-25 23:33:17 +0200610 template (omit) IP4_Elements v4 := omit,
Harald Weltef4bf1312018-06-30 11:05:20 +0200611 template (omit) IP6_Elements v6 := omit) := {
612 pDU_SNS_Config := {
613 nsPduType := '0F'O,
614 endFlag := ts_SNS_IE_EndFlag(end_flag),
615 nSEI_NS := ts_NS_IE_NSEI(nsei),
616 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
617 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
618 }
619 }
620 template PDU_NS tr_SNS_CONFIG(template Nsei nsei, template boolean end_flag,
Alexander Couzens7b1e44f2020-08-25 23:33:17 +0200621 template IP4_Elements v4 := omit,
Harald Weltef4bf1312018-06-30 11:05:20 +0200622 template IP6_Elements v6 := omit) := {
623 pDU_SNS_Config := {
624 nsPduType := '0F'O,
625 endFlag := tr_SNS_IE_EndFlag(end_flag),
626 nSEI_NS := tr_NS_IE_NSEI(nsei),
627 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
628 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
629 }
630 }
631
632 template (value) PDU_NS ts_SNS_CONFIG_ACK(Nsei nsei, template (omit) NsCause cause) := {
633 pDU_SNS_Config_Ack := {
634 nsPduType := '10'O,
635 nSEI_NS := ts_NS_IE_NSEI(nsei),
636 causeNS := ts_NS_IE_CAUSE_omit(cause)
637 }
638 }
639 template PDU_NS tr_SNS_CONFIG_ACK(template Nsei nsei, template NsCause cause) := {
640 pDU_SNS_Config_Ack := {
641 nsPduType := '10'O,
642 nSEI_NS := tr_NS_IE_NSEI(nsei),
643 causeNS := tr_NS_IE_CAUSE(cause)
644 }
645 }
646
Harald Welte630d0e62019-02-22 23:26:40 +0100647 template (value) PDU_NS ts_SNS_ADD(Nsei nsei, uint8_t trans_id,
648 template (omit) IP4_Elements v4,
649 template (omit) IP6_Elements v6 := omit) := {
650 pDU_SNS_Add := {
651 nsPduType := '0D'O,
652 nSEI_NS := ts_NS_IE_NSEI(nsei),
653 transactionID := trans_id,
654 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
655 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
656 }
657 }
658 template PDU_NS tr_SNS_ADD(template Nsei nsei, template uint8_t trans_id,
659 template IP4_Elements v4,
660 template IP6_Elements v6 := omit) := {
661 pDU_SNS_Add := {
662 nsPduType := '0D'O,
663 nSEI_NS := tr_NS_IE_NSEI(nsei),
664 transactionID := trans_id,
665 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
666 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
667 }
668 }
669
670 template (value) PDU_NS ts_SNS_DEL(Nsei nsei, uint8_t trans_id,
671 template (omit) IPAddress ip_sns,
672 template (omit) IP4_Elements v4,
673 template (omit) IP6_Elements v6 := omit) := {
674 pDU_SNS_Delete := {
675 nsPduType := '11'O,
676 nSEI_NS := ts_NS_IE_NSEI(nsei),
677 transactionID := trans_id,
678 iP_Address_NS := ts_SNS_IP_ADDR(ip_sns),
679 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
680 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
681 }
682 }
683 template PDU_NS tr_SNS_DEL(template Nsei nsei, template uint8_t trans_id,
684 template IPAddress ip_sns,
685 template IP4_Elements v4,
686 template IP6_Elements v6 := omit) := {
687 pDU_SNS_Delete := {
688 nsPduType := '11'O,
689 nSEI_NS := tr_NS_IE_NSEI(nsei),
690 transactionID := trans_id,
691 iP_Address_NS := tr_SNS_IP_ADDR(ip_sns),
692 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
693 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
694 }
695 }
696
Harald Welte72099552019-02-23 15:09:22 +0100697 template (value) PDU_NS ts_SNS_CHG_WEIGHT(Nsei nsei, uint8_t trans_id,
698 template (omit) IP4_Elements v4,
699 template (omit) IP6_Elements v6 := omit) := {
700 pDU_SNS_ChangeWeight := {
701 nsPduType := '0E'O,
702 nSEI_NS := ts_NS_IE_NSEI(nsei),
703 transactionID := trans_id,
704 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
705 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
706 }
707 }
708 template PDU_NS tr_SNS_CHG_WEIGHT(template Nsei nsei, template uint8_t trans_id,
709 template IP4_Elements v4,
710 template IP6_Elements v6 := omit) := {
711 pDU_SNS_ChangeWeight := {
712 nsPduType := '0E'O,
713 nSEI_NS := tr_NS_IE_NSEI(nsei),
714 transactionID := trans_id,
715 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
716 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
717 }
718 }
719
Harald Welte630d0e62019-02-22 23:26:40 +0100720
721 template (value) PDU_NS ts_SNS_ACK(Nsei nsei, uint8_t trans_id,
722 template (omit) NsCause cause := omit,
723 template (omit) IP4_Elements v4 := omit,
724 template (omit) IP6_Elements v6 := omit) := {
725 pDU_SNS_Ack := {
726 nsPduType := '0C'O,
727 nSEI_NS := ts_NS_IE_NSEI(nsei),
728 transactionID := trans_id,
729 causeNS := ts_NS_IE_CAUSE_omit(cause),
730 iP_Address_NS := omit,
731 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
732 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
733 }
734 }
735 template PDU_NS tr_SNS_ACK(template Nsei nsei, template uint8_t trans_id := ?,
736 template NsCause cause := omit,
737 template IP4_Elements v4 := *,
738 template IP6_Elements v6 := *) := {
739 pDU_SNS_Ack := {
740 nsPduType := '0C'O,
741 nSEI_NS := tr_NS_IE_NSEI(nsei),
742 transactionID := trans_id,
743 causeNS := tr_NS_IE_CAUSE(cause),
744 iP_Address_NS := omit,
745 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
746 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
747 }
748 }
749
Harald Welte1308dbb2021-01-18 18:19:38 +0100750 template PDU_NS tr_SNS(template Nsei nsei) := ( tr_SNS_SIZE(nsei),
751 tr_SNS_SIZE_ACK(nsei, *),
752 tr_SNS_CONFIG(nsei, ?, *, *),
753 tr_SNS_CONFIG_ACK(nsei, *),
754 tr_SNS_ADD(nsei, ?, *, *),
755 tr_SNS_DEL(nsei, ?, *, *),
756 tr_SNS_CHG_WEIGHT(nsei, ?, *, *),
757 tr_SNS_ACK(nsei, ?, *, *, *) )
Harald Welte630d0e62019-02-22 23:26:40 +0100758
759
760
761
762
763
Harald Weltee0abc472018-02-05 09:13:31 +0100764 type record BssgpCellId {
765 RoutingAreaIdentification ra_id,
766 CellIdentity cell_id
767 } with { variant "" };
768
Pau Espin Pedrol8bd54cf2021-01-08 17:11:03 +0100769 template (value) BssgpCellId ts_BssgpCellId(template (value) RoutingAreaIdentification rai, CellIdentity cell_id) := {
770 ra_id := rai,
771 cell_id := cell_id
772 };
773
Harald Weltee0abc472018-02-05 09:13:31 +0100774 type enumerated BssgpCause {
775 BSSGP_CAUSE_PROC_OVERLOAD ('00'H),
776 BSSGP_CAUSE_EQUIMENT_FAILURE ('01'H),
777 BSSGP_CAUSE_TRANSIT_NETWORK_FAILURE ('02'H),
778 BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS ('03'H),
779 BSSGP_CAUSE_UNKNOWN_MS ('04'H),
780 BSSGP_CAUSE_BVCI_UNKNOWN ('05'H),
781 BSSGP_CAUSE_CELL_TRAFFIC_CONGESTION ('06'H),
782 BSSGP_CAUSE_SGSN_CONGESTION ('07'H),
783 BSSGP_CAUSE_OM_INTERVENTION ('08'H),
784 BSSGP_CAUSE_BVCI_BLOCKED ('09'H),
785 BSSGP_CAUSE_PFC_CREATE_FAILURE ('0a'H),
786 BSSGP_CAUSE_PFC_PREEMPTED ('0b'H),
787 BSSGP_CAUSE_ABQP_NO_MORE_SUPPORTED ('0c'H),
788 BSSGP_CAUSE_SEMANTICALLY_INCORRECT_PDU ('20'H),
789 BSSGP_CAUSE_INVALID_MANDATORY_IE ('21'H),
790 BSSGP_CAUSE_MISSING_MANDATORY_IE ('22'H),
791 BSSGP_CAUSE_MISSING_CONDITIONAL_IE ('23'H),
792 BSSGP_CAUSE_UNEXPECTED_CONDITIONAL_IE ('24'H),
793 BSSGP_CAUSE_CONDITIONAL_IE_ERROR ('25'H),
794 BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('26'H),
795 BSSGP_CAUSE_PROTOCOL_ERROR_UNSPECIFIED ('27'H),
796 BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_FEATURE_SET ('28'H),
797 BSSGP_CAUSE_REQUESTED_INFO_NOT_AVAILABLE ('29'H),
798 BSSGP_CAUSE_UNKNOWN_DESTINATION_ADDRESS ('2a'H),
799 BSSGP_CAUSE_UNKNOWN_RIM_APP_IDENTITY ('2b'H),
800 BSSGP_CAUSE_INVALID_CONTAINER_UNIT_INFO ('2c'H),
801 BSSGP_CAUSE_PFC_QUEUING ('2d'H),
802 BSSGP_CAUSE_PFC_CREATED_SUCCESSFULLY ('2e'H),
803 BSSGP_CAUSE_T12_EXPIRY ('2f'H),
804 BSSGP_CAUSE_MS_UNDER_PS_HANDOVER_TREATMENT ('30'H),
805 BSSGP_CAUSE_UPLINK_QUALITY ('31'H),
806 BSSGP_CAUSE_UPLINK_STRENGTH ('32'H),
807 BSSGP_CAUSE_DOWNLINK_QUALITY ('33'H),
808 BSSGP_CAUSE_DOWNLINK_STRENGTH ('34'H),
809 BSSGP_CAUSE_DISTANCE ('35'H),
810 BSSGP_CAUSE_BETTER_CELL ('36'H),
811 BSSGP_CAUSE_TRAFFIC ('37'H),
812 BSSGP_CAUSE_OM_INTERVENTION2 ('38'H),
813 BSSGP_CAUSE_MS_BACK_ON_OLD_CHANNEL ('39'H),
814 BSSGP_CAUSE_T13_EXPIRY ('3a'H),
815 BSSGP_CAUSE_T14_EXPIRY ('3b'H),
816 BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED ('3c'H)
817 } with { variant "FIELDLENGTH(8)" };
818
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100819 private function tr_FLUSH_ACTION(template OCT1 act)
Daniel Willmann7f1d78e2020-11-24 14:42:40 +0100820 return template Flush_Action {
821 var template Flush_Action r;
822 if (istemplatekind(act, "omit")) {
823 return omit;
824 } else if (istemplatekind(act, "*")) {
825 return *;
826 } else {
827 r := {
828 iEI := '0C'O,
829 ext := '1'B,
830 lengthIndicator := {
831 length1 := 1
832 },
833 actionValue := act
834 }
835 return r;
836 }
837 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100838 template (value) Flush_Action ts_FLUSH_ACTION(template (value) OCT1 act) := {
839 iEI := '0C'O,
840 ext := '1'B,
841 lengthIndicator := {
842 length1 := 1
843 },
844 actionValue := act
845 }
846
847 private function tr_NO_OCT_AFF(template integer oct_aff)
Daniel Willmann7f1d78e2020-11-24 14:42:40 +0100848 return template Number_of_octets_affected {
849 var template Number_of_octets_affected r;
850 if (istemplatekind(oct_aff, "omit")) {
851 return omit;
852 } else if (istemplatekind(oct_aff, "*")) {
853 return *;
854 } else {
855 r := {
856 iEI := '25'O,
857 ext := '1'B,
858 lengthIndicator := {
859 length1 := 3
860 },
861 number_of_octets_transfered_or_deleted := f_oct_or_wc(oct_aff, 3)
862 }
863 return r;
864 }
865 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100866 template (value) Number_of_octets_affected ts_NO_OCT_AFF(template (value) integer oct_aff) := {
867 iEI := '25'O,
868 ext := '1'B,
869 lengthIndicator := {
870 length1 := 3
871 },
872 number_of_octets_transfered_or_deleted := int2oct(valueof(oct_aff), 3)
873 }
Harald Weltee0abc472018-02-05 09:13:31 +0100874
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100875 private function tr_LLC_FRAMES_DISCARDED(template integer frames_discarded)
Daniel Willmann00c0bbf2020-11-24 18:37:49 +0100876 return template LLC_Frames_Discarded {
877 var template LLC_Frames_Discarded r;
878 if (istemplatekind(frames_discarded, "omit")) {
879 return omit;
880 } else if (istemplatekind(frames_discarded, "*")) {
881 return *;
882 } else {
883 r := {
884 iEI := '0F'O,
885 ext := '1'B,
886 lengthIndicator := {
Harald Weltec0351d12020-11-27 22:49:02 +0100887 length1 := 1
Daniel Willmann00c0bbf2020-11-24 18:37:49 +0100888 },
889 number_of_frames_discarded := f_hex_or_wc(frames_discarded, 2)
890 }
891 return r;
892 }
893 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100894 template (value) LLC_Frames_Discarded ts_LLC_FRAMES_DISCARDED(template (value) integer frames_discarded) := {
895 iEI := '0F'O,
896 ext := '1'B,
897 lengthIndicator := {
898 length1 := 1
899 },
900 number_of_frames_discarded := int2hex(valueof(frames_discarded), 2)
901 }
Daniel Willmann00c0bbf2020-11-24 18:37:49 +0100902
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100903
904 private function tr_BSSGP_BVCI(template BssgpBvci bvci)
Daniel Willmann379fc252020-11-20 18:34:22 +0100905 return template BVCI {
906 var template BVCI r;
907 if (istemplatekind(bvci, "omit")) {
908 return omit;
909 } else if (istemplatekind(bvci, "*")) {
910 return *;
911 } else {
912 r := {
913 iEI := '04'O,
914 ext := '1'B,
915 lengthIndicator := {
916 length1 := 2
917 },
918 unstructured_value := f_oct_or_wc(bvci, 2)
919 }
920 return r;
921 }
922 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100923 template (value) BVCI ts_BSSGP_BVCI(template (value) BssgpBvci bvci) := {
924 iEI := '04'O,
925 ext := '1'B,
926 lengthIndicator := {
927 length1 := 2
928 },
929 unstructured_value := int2oct(valueof(bvci), 2)
930 }
931 private function f_ts_BSSGP_BVCI(template (omit) BssgpBvci bvci)
932 return template (omit) BVCI {
933 if (istemplatekind(bvci, "omit")) {
934 return omit;
935 } else {
936 return ts_BSSGP_BVCI(valueof(bvci));
937 }
938 }
939
940 private function t_BSSGP_NSEI(template Nsei nsei)
Daniel Willmann379fc252020-11-20 18:34:22 +0100941 return template NSEI_BSSGP {
942 var template NSEI_BSSGP r;
943 if (istemplatekind(nsei, "omit")) {
944 return omit;
945 } else if (istemplatekind(nsei, "*")) {
946 return *;
947 } else {
948 r := {
949 iEI:= '3E'O,
950 ext := '1'B,
951 lengthIndicator := {
952 length1 := 2
953 },
954 nSEI := f_oct_or_wc(nsei, 2)
955 }
956 return r;
957 }
Harald Weltee0abc472018-02-05 09:13:31 +0100958 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100959 template (value) NSEI_BSSGP ts_BSSGP_NSEI(template (value) Nsei nsei) := {
960 iEI:= '3E'O,
961 ext := '1'B,
962 lengthIndicator := {
963 length1 := 2
964 },
965 nSEI := int2oct(valueof(nsei), 2)
966 }
967 private function f_ts_BSSGP_NSEI(template (omit) Nsei nsei)
968 return template (omit) NSEI_BSSGP {
969 if (istemplatekind(nsei, "omit")) {
970 return omit;
971 } else {
972 return ts_BSSGP_NSEI(valueof(nsei));
973 }
974 }
Harald Weltee0abc472018-02-05 09:13:31 +0100975
Harald Welte23989a62019-03-21 21:32:45 +0100976 template (value) TLLI_BSSGP ts_BSSGP_TLLI(template (value) GprsTlli tlli) := {
977 iEI := '1F'O,
978 ext := '1'B,
979 lengthIndicator := {
980 length1 := 4
981 },
982 tLLI_Value := tlli
983 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +0100984 template (present) TLLI_BSSGP tr_BSSGP_TLLI(template (present) GprsTlli tlli) := {
Harald Welte23989a62019-03-21 21:32:45 +0100985 iEI := '1F'O,
986 ext := '1'B,
987 lengthIndicator := {
988 length1 := 4
989 },
990 tLLI_Value := tlli
991 }
Harald Welte112bc142021-01-17 11:10:30 +0100992 private function f_ts_BSSGP_TLLI(template (omit) GprsTlli tlli) return template (omit) TLLI_BSSGP {
993 if (istemplatekind(tlli, "omit")) {
994 return omit;
995 } else {
996 return ts_BSSGP_TLLI(valueof(tlli));
997 }
998 }
999 private function f_tr_BSSGP_TLLI(template GprsTlli tlli) return template TLLI_BSSGP {
1000 if (istemplatekind(tlli, "omit")) {
1001 return omit;
1002 } else if (istemplatekind(tlli, "*")) {
1003 return *;
1004 } else {
1005 return tr_BSSGP_TLLI(valueof(tlli));
1006 }
1007 }
Harald Welte23989a62019-03-21 21:32:45 +01001008
1009 template (value) Suspend_Reference_Number ts_BSSGP_SUSP_REF(template (value) OCT1 susp_ref) := {
1010 iEI := '1D'O,
1011 ext := '1'B,
1012 lengthIndicator := {
1013 length1 := 1
1014 },
1015 suspend_Reference_Number_value := susp_ref
1016 }
1017 template Suspend_Reference_Number tr_BSSGP_SUSP_REF(template OCT1 susp_ref) := {
1018 iEI := '1D'O,
1019 ext := '1'B,
1020 lengthIndicator := {
1021 length1 := 1
1022 },
1023 suspend_Reference_Number_value := susp_ref
1024 }
1025
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001026 template (present) IMSI_BSSGP tr_BSSGP_IMSI(template (present) hexstring imsi) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001027 iEI := '0D'O,
1028 ext := '1'B,
1029 lengthIndicator := ?,
1030 type_of_Identity := '001'B,
1031 oddevenIndicator := ?,
1032 digits := imsi
1033 }
1034
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001035 template (value) IMSI_BSSGP ts_BSSGP_IMSI(hexstring imsi) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001036 iEI := '0D'O,
1037 ext := '1'B,
1038 lengthIndicator := { length1 := 0 /* overwritten */ },
1039 type_of_Identity := '001'B,
1040 oddevenIndicator := f_hex_is_odd_length(imsi),
1041 digits := imsi
1042 }
Harald Welte112bc142021-01-17 11:10:30 +01001043 private function f_ts_BSSGP_IMSI(template (omit) hexstring imsi) return template (omit) IMSI_BSSGP {
1044 if (istemplatekind(imsi, "omit")) {
1045 return omit;
1046 } else {
1047 return ts_BSSGP_IMSI(valueof(imsi));
1048 }
1049 }
1050 private function f_tr_BSSGP_IMSI(template hexstring imsi) return template IMSI_BSSGP {
1051 if (istemplatekind(imsi, "omit")) {
1052 return omit;
1053 } else if (istemplatekind(imsi, "*")) {
1054 return *;
1055 } else {
1056 return tr_BSSGP_IMSI(imsi);
1057 }
1058 }
Harald Weltee0abc472018-02-05 09:13:31 +01001059
Harald Welte0e188242020-11-22 21:46:48 +01001060 template (present) TMSI_BSSGP tr_BSSGP_TMSI(GsmTmsi tmsi) := {
1061 iEI := '20'O,
1062 ext := '1'B,
1063 lengthIndicator := { length1 := 4 },
1064 tMSI_Value := int2oct(tmsi, 4)
1065 }
1066
Harald Weltee0abc472018-02-05 09:13:31 +01001067 template TMSI_BSSGP ts_BSSGP_TMSI(GsmTmsi tmsi) := {
1068 iEI := '20'O,
1069 ext := '1'B,
1070 lengthIndicator := { length1 := 4 },
1071 tMSI_Value := int2oct(tmsi, 4)
1072 }
Harald Weltebe9bf1e2021-01-16 15:17:23 +01001073 private function f_ts_BSSGP_TMSI(template (omit) GsmTmsi tmsi) return template (omit) TMSI_BSSGP {
1074 if (istemplatekind(tmsi, "omit")) {
1075 return omit;
1076 } else {
1077 return ts_BSSGP_TMSI(valueof(tmsi));
1078 }
1079 }
1080 private function f_tr_BSSGP_TMSI(template GsmTmsi tmsi) return template TMSI_BSSGP {
1081 if (istemplatekind(tmsi, "omit")) {
1082 return omit;
1083 } else if (istemplatekind(tmsi, "*")) {
1084 return *;
1085 } else if (istemplatekind(tmsi, "?")) {
1086 return ?;
1087 } else {
1088 return tr_BSSGP_TMSI(valueof(tmsi));
1089 }
1090 }
Harald Weltee0abc472018-02-05 09:13:31 +01001091
1092 function f_bssgp_length_ind(integer len) return LIN2_2a {
1093 var LIN2_2a ret;
1094 if (len > 255) {
1095 ret := { length2 := len };
1096 } else {
1097 ret := { length1 := len };
1098 }
1099 return ret;
1100 }
1101
1102 template LLC_PDU ts_BSSGP_LLC_PDU(octetstring pdu) := {
Vadim Yanitskiy5bdbb252022-11-24 03:54:17 +07001103 iEI := '0E'O,
Harald Weltee0abc472018-02-05 09:13:31 +01001104 ext := '1'B,
1105 lengthIndicator := f_bssgp_length_ind(lengthof(pdu)),
1106 lLC_PDU := pdu
1107 }
1108
1109 template LLC_PDU tr_BSSGP_LLC_PDU(template octetstring pdu := ?) := {
Harald Welte7024baa2018-03-02 23:37:51 +01001110 iEI := '0E'O,
1111 ext := ?,
Harald Weltee0abc472018-02-05 09:13:31 +01001112 lengthIndicator := ?,
1113 lLC_PDU := pdu
1114 }
1115
Harald Welte23989a62019-03-21 21:32:45 +01001116 function ts_BSSGP_CAUSE(template (omit) BssgpCause cause) return template (omit) Cause_BSSGP {
1117 var template (omit) Cause_BSSGP ret;
1118 if (istemplatekind(cause, "omit")) {
1119 ret := omit;
1120 } else {
1121 ret.iEI := '07'O;
1122 ret.ext := '1'B;
1123 ret.lengthIndicator := { length1 := 1 };
1124 ret.cause_Value := int2oct(enum2int(valueof(cause)), 1);
1125 }
1126 return ret;
1127 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001128 function tr_BSSGP_CAUSE(template BssgpCause cause) return template Cause_BSSGP {
Harald Weltee0abc472018-02-05 09:13:31 +01001129 var template Cause_BSSGP ret;
Harald Weltebacca282018-03-02 16:03:59 +01001130 ret.iEI := '07'O;
Harald Weltee0abc472018-02-05 09:13:31 +01001131 ret.ext := '1'B;
1132 ret.lengthIndicator := { length1 := 1 };
1133 if (isvalue(cause)) {
1134 ret.cause_Value := int2oct(enum2int(valueof(cause)), 1);
1135 } else {
1136 ret.cause_Value := ?
1137 }
1138 return ret;
1139 }
1140
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001141 function tr_BSSGP_IE_CellId(template BssgpCellId cid) return template Cell_Identifier {
Harald Weltee0abc472018-02-05 09:13:31 +01001142 var template Cell_Identifier ret := {
1143 iEI := '08'O,
1144 ext := '1'B,
1145 lengthIndicator := { length1 := 8 },
1146 mccDigit1 := ?,
1147 mccDigit2 := ?,
1148 mccDigit3 := ?,
1149 mncDigit3 := ?,
1150 mncDigit1 := ?,
1151 mncDigit2 := ?,
1152 lac := ?,
1153 rac := ?,
1154 cI_value := ?
1155 }
1156 if (istemplatekind(cid, "omit")) {
1157 return omit;
1158 } else if (istemplatekind(cid, "*")) {
1159 return *;
1160 } else if (istemplatekind(cid, "?")) {
1161 return ?;
1162 }
1163 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
1164 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
1165 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
1166 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
1167 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
Harald Welte797ab3a2019-03-21 21:33:28 +01001168 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
Harald Welte797ab3a2019-03-21 21:33:28 +01001169 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
Alexander Couzensc7dddbd2019-04-11 19:18:35 +02001170 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
Harald Weltee0abc472018-02-05 09:13:31 +01001171 }
1172 if (isvalue(cid.ra_id.lai.lac)) {
1173 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
1174 }
1175 }
1176 if (isvalue(cid) and isvalue(cid.ra_id)) {
1177 ret.rac := f_oct_or_wc(cid.ra_id.rac, 1);
1178 }
1179 if (isvalue(cid)) {
1180 ret.cI_value := f_oct_or_wc(cid.cell_id, 2);
1181 }
1182 return ret;
1183 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001184 template (value) Cell_Identifier ts_BSSGP_IE_CellId(template (value) BssgpCellId cid) := {
1185 iEI := '08'O,
1186 ext := '1'B,
1187 lengthIndicator := { length1 := 8 },
1188 mccDigit1 := cid.ra_id.lai.mcc_mnc[0],
1189 mccDigit2 := cid.ra_id.lai.mcc_mnc[1],
1190 mccDigit3 := cid.ra_id.lai.mcc_mnc[2],
1191 mncDigit3 := cid.ra_id.lai.mcc_mnc[3],
1192 mncDigit1 := cid.ra_id.lai.mcc_mnc[4],
1193 mncDigit2 := cid.ra_id.lai.mcc_mnc[5],
1194 lac := int2oct(valueof(cid.ra_id.lai.lac), 2),
1195 rac := int2oct(valueof(cid.ra_id.rac), 1),
1196 cI_value := int2oct(valueof(cid.cell_id), 2)
1197 }
1198 function f_ts_BSSGP_IE_CellId(template (omit) BssgpCellId cid) return template (omit) Cell_Identifier {
1199 if (istemplatekind(cid, "omit")) {
1200 return omit;
1201 } else {
1202 return ts_BSSGP_IE_CellId(valueof(cid));
1203 }
1204 }
Harald Weltee0abc472018-02-05 09:13:31 +01001205
Daniel Willmann670bbc02020-11-19 16:39:39 +01001206 template (value) Tag ts_BSSGP_IE_Tag(OCT1 tag) := {
1207 iEI := '1E'O,
1208 ext := '1'B,
1209 lengthIndicator := {
1210 length1 := 1
1211 },
1212 unstructured_Value := tag
1213 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001214
Daniel Willmann670bbc02020-11-19 16:39:39 +01001215 template (present) Tag tr_BSSGP_IE_Tag(template (present) OCT1 tag) := {
1216 iEI := '1E'O,
1217 ext := '1'B,
1218 lengthIndicator := {
1219 length1 := 1
1220 },
1221 unstructured_Value := tag
1222 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001223
Daniel Willmann670bbc02020-11-19 16:39:39 +01001224 template (value) RA_Cap_UPD_CAUSE ts_BSSGP_IE_RACU_Cause(template (value) OCT1 cause) := {
1225 iEI := '1A'O,
1226 ext := '1'B,
1227 lengthIndicator := {
1228 length1 := 1
1229 },
1230 rA_CAP_UPD_Cause_value := cause
1231 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001232
Daniel Willmann670bbc02020-11-19 16:39:39 +01001233 template (present) RA_Cap_UPD_CAUSE tr_BSSGP_IE_RACU_Cause(template (present) OCT1 cause) := {
1234 iEI := '1A'O,
1235 ext := '1'B,
1236 lengthIndicator := {
1237 length1 := 1
1238 },
1239 rA_CAP_UPD_Cause_value := cause
1240 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001241
Harald Welte14ac3462021-01-16 13:20:31 +01001242 /* 10.4.12 */
Harald Weltee0abc472018-02-05 09:13:31 +01001243 template PDU_BSSGP ts_BVC_RESET(BssgpCause cause, BssgpBvci bvci,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001244 template (omit) BssgpCellId cell_id) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001245 pDU_BSSGP_BVC_RESET := {
1246 bssgpPduType := '22'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001247 bVCI := ts_BSSGP_BVCI(bvci),
Harald Welte23989a62019-03-21 21:32:45 +01001248 cause := ts_BSSGP_CAUSE(cause),
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001249 cell_Identifier := f_ts_BSSGP_IE_CellId(cell_id),
Harald Weltee0abc472018-02-05 09:13:31 +01001250 feature_bitmap := omit,
1251 extended_Feature_Bitmap := omit
1252 }
1253 }
Harald Weltee0abc472018-02-05 09:13:31 +01001254 template PDU_BSSGP tr_BVC_RESET(template BssgpCause cause, template BssgpBvci bvci,
1255 template BssgpCellId cell_id) := {
1256 pDU_BSSGP_BVC_RESET := {
1257 bssgpPduType := '22'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001258 bVCI := tr_BSSGP_BVCI(bvci),
1259 cause := tr_BSSGP_CAUSE(cause),
1260 cell_Identifier := tr_BSSGP_IE_CellId(cell_id),
Harald Weltee0abc472018-02-05 09:13:31 +01001261 feature_bitmap := *,
1262 extended_Feature_Bitmap := *
1263 }
1264 }
1265
Harald Welte14ac3462021-01-16 13:20:31 +01001266 /* 10.4.13 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001267 template PDU_BSSGP ts_BVC_RESET_ACK(BssgpBvci bvci, template (omit) BssgpCellId cell_id) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001268 pDU_BSSGP_BVC_RESET_ACK := {
1269 bssgpPduType := '23'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001270 bVCI := ts_BSSGP_BVCI(bvci),
1271 cell_Identifier := f_ts_BSSGP_IE_CellId(cell_id),
Harald Weltee0abc472018-02-05 09:13:31 +01001272 feature_bitmap := omit,
1273 extended_Feature_Bitmap := omit
1274 }
1275 }
Harald Weltee0abc472018-02-05 09:13:31 +01001276 template PDU_BSSGP tr_BVC_RESET_ACK(template BssgpBvci bvci, template BssgpCellId cell_id) := {
1277 pDU_BSSGP_BVC_RESET_ACK := {
1278 bssgpPduType := '23'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001279 bVCI := tr_BSSGP_BVCI(bvci),
1280 cell_Identifier := tr_BSSGP_IE_CellId(cell_id),
Harald Weltee0abc472018-02-05 09:13:31 +01001281 feature_bitmap := *,
1282 extended_Feature_Bitmap := *
1283 }
1284 }
1285
1286
Harald Welte14ac3462021-01-16 13:20:31 +01001287 /* 10.4.10 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001288 template (present) PDU_BSSGP tr_BVC_UNBLOCK(template (present) BssgpBvci bvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001289 pDU_BSSGP_BVC_UNBLOCK := {
1290 bssgpPduType := '24'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001291 bVCI := tr_BSSGP_BVCI(bvci)
1292 }
1293 }
1294 template (value) PDU_BSSGP ts_BVC_UNBLOCK(template (value) BssgpBvci bvci) := {
1295 pDU_BSSGP_BVC_UNBLOCK := {
1296 bssgpPduType := '24'O,
1297 bVCI := ts_BSSGP_BVCI(bvci)
Harald Weltee0abc472018-02-05 09:13:31 +01001298 }
1299 }
1300
Harald Welte14ac3462021-01-16 13:20:31 +01001301 /* 10.4.11 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001302 template (present) PDU_BSSGP tr_BVC_UNBLOCK_ACK(template (present) BssgpBvci bvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001303 pDU_BSSGP_BVC_UNBLOCK_ACK := {
1304 bssgpPduType := '25'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001305 bVCI := tr_BSSGP_BVCI(bvci)
1306 }
1307 }
1308 template (value) PDU_BSSGP ts_BVC_UNBLOCK_ACK(template (value) BssgpBvci bvci) := {
1309 pDU_BSSGP_BVC_UNBLOCK_ACK := {
1310 bssgpPduType := '25'O,
1311 bVCI := ts_BSSGP_BVCI(bvci)
Harald Weltee0abc472018-02-05 09:13:31 +01001312 }
1313 }
1314
Harald Welte14ac3462021-01-16 13:20:31 +01001315 /* 10.4.8 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001316 template (present) PDU_BSSGP tr_BVC_BLOCK(template (present) BssgpBvci bvci,
1317 template (present) BssgpCause cause) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001318 pDU_BSSGP_BVC_BLOCK := {
1319 bssgpPduType := '20'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001320 bVCI := tr_BSSGP_BVCI(bvci),
1321 cause := tr_BSSGP_CAUSE(cause)
1322 }
1323 }
1324 template (value) PDU_BSSGP ts_BVC_BLOCK(template (value) BssgpBvci bvci,
1325 template (value) BssgpCause cause) := {
1326 pDU_BSSGP_BVC_BLOCK := {
1327 bssgpPduType := '20'O,
1328 bVCI := ts_BSSGP_BVCI(bvci),
1329 cause := ts_BSSGP_CAUSE(cause)
Harald Weltee0abc472018-02-05 09:13:31 +01001330 }
1331 }
1332
Harald Welte14ac3462021-01-16 13:20:31 +01001333 /* 10.4.9 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001334 template (present) PDU_BSSGP tr_BVC_BLOCK_ACK(template (present) BssgpBvci bvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001335 pDU_BSSGP_BVC_BLOCK_ACK := {
1336 bssgpPduType := '21'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001337 bVCI := tr_BSSGP_BVCI(bvci)
1338 }
1339 }
1340 template (value) PDU_BSSGP ts_BVC_BLOCK_ACK(template (value) BssgpBvci bvci) := {
1341 pDU_BSSGP_BVC_BLOCK_ACK := {
1342 bssgpPduType := '21'O,
1343 bVCI := ts_BSSGP_BVCI(bvci)
Harald Weltee0abc472018-02-05 09:13:31 +01001344 }
1345 }
1346
Harald Welte14ac3462021-01-16 13:20:31 +01001347 /* 10.4.4 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001348 template (value) PDU_BSSGP ts_BVC_FC_BVC(uint16_t bmax, uint16_t bucket_leak_rate,
Harald Weltee0abc472018-02-05 09:13:31 +01001349 uint16_t bmax_default_ms, uint16_t r_default_ms, OCT1 tag) := {
1350 pDU_BSSGP_FLOW_CONTROL_BVC := {
1351 bssgpPduType := '26'O,
1352 tag := {
1353 iEI := '1E'O,
1354 ext := '1'B,
1355 lengthIndicator := {
Harald Welteedcdd902018-03-02 22:04:54 +01001356 length1 := 1
Harald Weltee0abc472018-02-05 09:13:31 +01001357 },
1358 unstructured_Value := tag
1359 },
1360 bVC_Bucket_Size := {
1361 iEI := '05'O,
1362 ext := '1'B,
1363 lengthIndicator := {
1364 length1 := 2
1365 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001366 bmax := int2oct(bmax, 2)
Harald Weltee0abc472018-02-05 09:13:31 +01001367 },
1368 bucket_Leak_Rate := {
1369 iEI := '03'O,
1370 ext := '1'B,
1371 lengthIndicator := {
Harald Welteedcdd902018-03-02 22:04:54 +01001372 length1 := 2
Harald Weltee0abc472018-02-05 09:13:31 +01001373 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001374 r_Value := int2oct(bucket_leak_rate, 2)
Harald Weltee0abc472018-02-05 09:13:31 +01001375 },
1376 bmax_default_MS := {
1377 iEI := '01'O,
1378 ext := '1'B,
1379 lengthIndicator := {
1380 length1 := 2
1381 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001382 bmax := int2oct(bmax_default_ms, 2)
Harald Weltee0abc472018-02-05 09:13:31 +01001383 },
1384 r_default_MS := {
1385 iEI := '1C'O,
1386 ext := '1'B,
1387 lengthIndicator := {
1388 length1 := 2
1389 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001390 r_default_MS_value := int2oct(r_default_ms, 2)
Harald Weltee0abc472018-02-05 09:13:31 +01001391 },
1392 bucket_Full_Ratio := omit,
1393 bVC_Measurement := omit,
1394 flow_Control_Granularity := omit
1395 }
1396 }
Harald Welteedcdd902018-03-02 22:04:54 +01001397 template PDU_BSSGP tr_BVC_FC_BVC(template uint16_t bmax := ?,
1398 template uint16_t bucket_leak_rate := ?,
1399 template uint16_t bmax_default_ms := ?,
1400 template uint16_t r_default_ms := ?,
1401 template OCT1 tag := ?) := {
1402 pDU_BSSGP_FLOW_CONTROL_BVC := {
1403 bssgpPduType := '26'O,
1404 tag := {
1405 iEI := '1E'O,
1406 ext := '1'B,
1407 lengthIndicator := {
1408 length1 := 1
1409 },
1410 unstructured_Value := tag
1411 },
1412 bVC_Bucket_Size := {
1413 iEI := '05'O,
1414 ext := '1'B,
1415 lengthIndicator := {
1416 length1 := 2
1417 },
1418 bmax := f_oct_or_wc(bmax, 2)
1419 },
1420 bucket_Leak_Rate := {
1421 iEI := '03'O,
1422 ext := '1'B,
1423 lengthIndicator := {
1424 length1 := 2
1425 },
1426 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
1427 },
1428 bmax_default_MS := {
1429 iEI := '01'O,
1430 ext := '1'B,
1431 lengthIndicator := {
1432 length1 := 2
1433 },
1434 bmax := f_oct_or_wc(bmax_default_ms, 2)
1435 },
1436 r_default_MS := {
1437 iEI := '1C'O,
1438 ext := '1'B,
1439 lengthIndicator := {
1440 length1 := 2
1441 },
1442 r_default_MS_value := f_oct_or_wc(r_default_ms, 2)
1443 },
1444 bucket_Full_Ratio := *,
1445 bVC_Measurement := *,
1446 flow_Control_Granularity := *
1447 }
1448 }
1449
Harald Welte14ac3462021-01-16 13:20:31 +01001450 /* 10.4.5 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001451 template (present) PDU_BSSGP tr_BVC_FC_BVC_ACK(template (present) OCT1 tag) := {
1452 pDU_BSSGP_FLOW_CONTROL_BVC_ACK := {
1453 bssgpPduType := '27'O,
1454 tag := {
1455 iEI := '1E'O,
1456 ext := '1'B,
1457 lengthIndicator := {
1458 length1 := 1
1459 },
1460 unstructured_Value := tag
1461 }
1462 }
1463 }
1464 template (value) PDU_BSSGP ts_BVC_FC_BVC_ACK(template (value) OCT1 tag) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001465 pDU_BSSGP_FLOW_CONTROL_BVC_ACK := {
1466 bssgpPduType := '27'O,
1467 tag := {
1468 iEI := '1E'O,
1469 ext := '1'B,
1470 lengthIndicator := {
Harald Welte86bdcaa2020-12-09 15:05:32 +01001471 length1 := 1
Harald Weltee0abc472018-02-05 09:13:31 +01001472 },
1473 unstructured_Value := tag
1474 }
1475 }
1476 }
1477
Harald Welte14ac3462021-01-16 13:20:31 +01001478 /* 10.4.6 */
Harald Weltecc3894b2020-12-09 16:50:12 +01001479 template (value) PDU_BSSGP ts_BVC_FC_MS(GprsTlli tlli, uint16_t bmax, uint16_t bucket_leak_rate,
1480 OCT1 tag) := {
1481 pDU_BSSGP_FLOW_CONTROL_MS := {
1482 bssgpPduType := '28'O,
1483 tLLI := ts_BSSGP_TLLI(tlli),
1484 tag := {
1485 iEI := '1E'O,
1486 ext := '1'B,
1487 lengthIndicator := {
1488 length1 := 1
1489 },
1490 unstructured_Value := tag
1491 },
1492 mS_Bucket_Size := {
1493 iEI := '12'O,
1494 ext := '1'B,
1495 lengthIndicator := {
1496 length1 := 2
1497 },
Pau Espin Pedrol810b1df2021-02-05 12:51:18 +01001498 bmax := int2oct(bmax, 2)
Harald Weltecc3894b2020-12-09 16:50:12 +01001499 },
1500 bucket_Leak_Rate := {
1501 iEI := '03'O,
1502 ext := '1'B,
1503 lengthIndicator := {
1504 length1 := 2
1505 },
Pau Espin Pedrol810b1df2021-02-05 12:51:18 +01001506 r_Value := int2oct(bucket_leak_rate, 2)
Harald Weltecc3894b2020-12-09 16:50:12 +01001507 },
1508 bucket_Full_Ratio := omit,
1509 flow_Control_Granularity := omit
1510 }
1511 }
1512 template (present) PDU_BSSGP tr_BVC_FC_MS(template (present) GprsTlli tlli := ?,
1513 template (present) uint16_t bmax := ?,
1514 template (present) uint16_t bucket_leak_rate := ?,
1515 template (present) OCT1 tag := ?) := {
1516 pDU_BSSGP_FLOW_CONTROL_MS := {
1517 bssgpPduType := '28'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001518 tLLI := tr_BSSGP_TLLI(tlli),
Harald Weltecc3894b2020-12-09 16:50:12 +01001519 tag := {
1520 iEI := '1E'O,
1521 ext := '1'B,
1522 lengthIndicator := {
1523 length1 := 1
1524 },
1525 unstructured_Value := tag
1526 },
1527 mS_Bucket_Size := {
1528 iEI := '12'O,
1529 ext := '1'B,
1530 lengthIndicator := {
1531 length1 := 2
1532 },
1533 bmax := f_oct_or_wc(bmax, 2)
1534 },
1535 bucket_Leak_Rate := {
1536 iEI := '03'O,
1537 ext := '1'B,
1538 lengthIndicator := {
1539 length1 := 2
1540 },
1541 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
1542 },
1543 bucket_Full_Ratio := *,
1544 flow_Control_Granularity := *
1545 }
1546 }
1547
Harald Welte14ac3462021-01-16 13:20:31 +01001548 /* 10.4.7 */
Harald Weltecc3894b2020-12-09 16:50:12 +01001549 template (value) PDU_BSSGP ts_BVC_FC_MS_ACK(template (value) GprsTlli tlli,
1550 template (value) OCT1 tag) := {
1551
1552 pDU_BSSGP_FLOW_CONTROL_MS_ACK := {
1553 bssgpPduType := '29'O,
1554 tLLI := ts_BSSGP_TLLI(tlli),
1555 tag := {
1556 iEI := '1E'O,
1557 ext := '1'B,
1558 lengthIndicator := {
1559 length1 := 1
1560 },
1561 unstructured_Value := tag
1562 }
1563 }
1564 }
1565 template (present) PDU_BSSGP tr_BVC_FC_MS_ACK(template (present) GprsTlli tlli,
1566 template (present) OCT1 tag := ?) := {
1567
1568 pDU_BSSGP_FLOW_CONTROL_MS_ACK := {
1569 bssgpPduType := '29'O,
1570 tLLI := tr_BSSGP_TLLI(tlli),
1571 tag := {
1572 iEI := '1E'O,
1573 ext := '1'B,
1574 lengthIndicator := {
1575 length1 := 1
1576 },
1577 unstructured_Value := tag
1578 }
1579 }
1580 }
1581
Harald Welte14ac3462021-01-16 13:20:31 +01001582 /* 10.4.14 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001583 template (value) PDU_BSSGP ts_BSSGP_STATUS(template (omit) BssgpBvci bvci,
1584 template (value) BssgpCause cause,
1585 PDU_BSSGP pdu) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001586 pDU_BSSGP_STATUS := {
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001587 bssgpPduType := '41'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001588 cause := ts_BSSGP_CAUSE(cause),
1589 bVCI := f_ts_BSSGP_BVCI(bvci),
Harald Weltee0abc472018-02-05 09:13:31 +01001590 pDU_in_Error := {
1591 iEI := '15'O,
1592 ext := '1'B,
1593 lengthIndicator := {
1594 length1 := 0 /* overwritten */
1595 },
1596 erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu)
1597 }
1598 }
1599 }
Harald Welte04358652021-01-17 13:48:13 +01001600 template PDU_BSSGP tr_BSSGP_STATUS(template BssgpBvci bvci := ?, template BssgpCause cause := ?,
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001601 template octetstring pdu := ?) := {
1602 pDU_BSSGP_STATUS := {
1603 bssgpPduType := '41'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001604 cause := tr_BSSGP_CAUSE(cause),
1605 bVCI := tr_BSSGP_BVCI(bvci),
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001606 pDU_in_Error := {
1607 iEI := '15'O,
1608 ext := '1'B,
1609 lengthIndicator := {
1610 length1 := ?
1611 },
1612 erroneous_BSSGP_PDU := pdu
1613 }
1614 }
1615 }
1616
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001617 private function f_presence_bit_MultislotCap_GPRS_BSSGP(template (omit) MultislotCap_GPRS_BSSGP mscap_gprs) return BIT1 {
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001618 if (istemplatekind(mscap_gprs, "omit")) {
1619 return '0'B;
1620 }
1621 return '1'B;
1622 }
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001623 private function f_presence_bit_MultislotCap_EGPRS_BSSGP(template (omit) MultislotCap_EGPRS_BSSGP mscap_egprs) return BIT1 {
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001624 if (istemplatekind(mscap_egprs, "omit")) {
1625 return '0'B;
1626 }
1627 return '1'B;
1628 }
1629 template (value) MSRACapabilityValuesRecord_BSSGP ts_RaCapRec_BSSGP(BIT4 att := '0001'B /* E-GSM */, template (omit) MultislotCap_GPRS_BSSGP mscap_gprs := omit, template (omit) MultislotCap_EGPRS_BSSGP mscap_egprs := omit) := {
1630 mSRACapabilityValues := {
1631 mSRACapabilityValuesExclude1111 := {
1632 accessTechnType := att, /* E-GSM */
1633 accessCapabilities := {
1634 lengthIndicator := 0, /* overwritten */
1635 accessCapabilities := {
1636 rfPowerCapability := '001'B, /* FIXME */
1637 presenceBitA5 := '0'B,
1638 a5bits := omit,
1639 esind := '1'B,
1640 psbit := '0'B,
1641 vgcs := '0'B,
1642 vbs := '0'B,
1643 presenceBitMultislot := '1'B,
1644 multislotcap := {
1645 presenceBitHscsd := '0'B,
1646 hscsdmultislotclass := omit,
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001647 presenceBitGprs := f_presence_bit_MultislotCap_GPRS_BSSGP(mscap_gprs),
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001648 gprsmultislot := mscap_gprs,
1649 presenceBitSms := '0'B,
1650 multislotCap_SMS := omit,
1651 multislotCapAdditionsAfterRel97 := {
1652 presenceBitEcsdmulti := '0'B,
1653 ecsdmultislotclass := omit,
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001654 presenceBitEgprsmulti := f_presence_bit_MultislotCap_EGPRS_BSSGP(mscap_egprs),
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001655 multislotCap_EGPRS := mscap_egprs,
1656 presenceBitDtmGprsmulti := '0'B,
1657 multislotCapdtmgprsmultislotsubclass := omit
1658 }
1659 },
1660 accessCapAdditionsAfterRel97 := omit
1661 },
1662 spare_bits := omit
1663 }
1664 }
1665 },
1666 presenceBitMSRACap := '0'B
1667 };
Harald Welte6dc2ac42020-11-16 09:16:17 +01001668 template (present) MSRACapabilityValuesRecord_BSSGP
1669 tr_RaCapRec_BSSGP(template (present) BIT4 att := '0001'B /* E-GSM */, template MultislotCap_GPRS_BSSGP mscap_gprs := *,
1670 template MultislotCap_EGPRS_BSSGP mscap_egprs := *) := {
1671 mSRACapabilityValues := {
1672 mSRACapabilityValuesExclude1111 := {
1673 accessTechnType := att, /* E-GSM */
1674 accessCapabilities := {
1675 lengthIndicator := ?, /* overwritten */
1676 accessCapabilities := {
1677 rfPowerCapability := '001'B, /* FIXME */
1678 presenceBitA5 := ?,
1679 a5bits := *,
1680 esind := '1'B,
1681 psbit := '0'B,
1682 vgcs := '0'B,
1683 vbs := '0'B,
1684 presenceBitMultislot := '1'B,
1685 multislotcap := {
1686 presenceBitHscsd := '0'B,
1687 hscsdmultislotclass := omit,
1688 presenceBitGprs := ?,
1689 gprsmultislot := mscap_gprs,
1690 presenceBitSms := '0'B,
1691 multislotCap_SMS := omit,
1692 multislotCapAdditionsAfterRel97 := {
1693 presenceBitEcsdmulti := '0'B,
1694 ecsdmultislotclass := *,
1695 presenceBitEgprsmulti := ?,
1696 multislotCap_EGPRS := mscap_egprs,
1697 presenceBitDtmGprsmulti := ?,
1698 multislotCapdtmgprsmultislotsubclass := *
1699 }
1700 },
1701 accessCapAdditionsAfterRel97 := *
1702 },
1703 spare_bits := *
1704 }
1705 }
1706 },
1707 presenceBitMSRACap := '0'B
1708 };
1709
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001710
Harald Weltee0abc472018-02-05 09:13:31 +01001711 template QoS_Profile_V t_defaultQos := {
1712 peak_Bit_Rate := int2oct(80, 2),
1713 precedence := '000'B,
1714 a_bit := '0'B,
1715 t_bit := '0'B,
1716 c_r_bit := '0'B,
1717 peakBitRateGranularity := '00'B
1718 }
1719
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001720 template (value) QoS_Profile ts_QoS_TLV(template (value) QoS_Profile_V qos) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001721 iEI := '18'O,
1722 ext := '1'B,
1723 lengthIndicator := { length1 := 3 },
1724 peak_Bit_Rate := qos.peak_Bit_Rate,
1725 precedence := qos.precedence,
1726 a_bit := qos.a_bit,
1727 t_bit := qos.t_bit,
1728 c_r_bit := qos.c_r_bit,
1729 peakBitRateGranularity := qos.peakBitRateGranularity
1730 }
1731
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001732 template (value) PDU_Lifetime t_DefaultLifetime(uint16_t delay := 65535) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001733 iEI := '16'O,
1734 ext := '1'B,
1735 lengthIndicator := {
1736 length1 := 2
1737 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001738 delay_Value := int2oct(delay, 2)
Harald Weltee0abc472018-02-05 09:13:31 +01001739 }
1740
Pau Espin Pedrol88bf5372019-12-09 21:12:28 +01001741 template DRX_Parameters t_defaultDRXparam := {
1742 iEI := '0A'O,
1743 ext := '1'B,
1744 lengthIndicator := {
1745 length1 := 2
1746 },
1747 splitPG_CycleCode := '00'O,
1748 nonDRXTimer := '000'B,
1749 splitOnCCCH := '0'B,
1750 cnSpecificDRXCycleLength := '0000'B
1751 }
1752
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001753 function ts_BSSGP_IE_MSRAcap_omit(template (omit) MSRadioAccessCapabilityV_BSSGP racap) return template (omit) MS_Radio_Access_Capability {
1754 var template (omit) MS_Radio_Access_Capability ret;
1755 if (istemplatekind(racap, "omit")) {
1756 return omit;
1757 } else {
1758 ret := {
Harald Welte6dc2ac42020-11-16 09:16:17 +01001759 iEI := '13'O,
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001760 ext := '1'B,
1761 lengthIndicator := {
1762 length1 := 1
1763 },
1764 mSRadioAccessCapabilityV_BSSGP := racap
1765 }
1766 return ret;
1767 }
1768 }
1769
Harald Welte6dc2ac42020-11-16 09:16:17 +01001770 function tr_BSSGP_IE_MSRAcap(template MSRadioAccessCapabilityV_BSSGP racap) return template MS_Radio_Access_Capability {
1771 var template MS_Radio_Access_Capability ret;
1772 if (istemplatekind(racap, "omit")) {
1773 return omit;
1774 } else {
1775 ret := {
1776 iEI := '13'O,
1777 ext := ?,
1778 lengthIndicator := ?,
1779 mSRadioAccessCapabilityV_BSSGP := racap
1780 }
1781 return ret;
1782 }
1783 }
1784
Harald Welte14ac3462021-01-16 13:20:31 +01001785 /* 10.2.1 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001786 template (value) PDU_BSSGP ts_BSSGP_DL_UD(GprsTlli tlli, octetstring pdu,
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001787 template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit,
1788 template (omit) IMSI_BSSGP imsi := omit) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001789 pDU_BSSGP_DL_UNITDATA := {
1790 bssgpPduType := '00'O,
Harald Welteacc93ab2018-03-02 21:39:09 +01001791 tLLI_current := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +01001792 qoS_Profile := t_defaultQos,
1793 pDU_Lifetime := t_DefaultLifetime(65535),
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001794 mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap),
Harald Weltee0abc472018-02-05 09:13:31 +01001795 priority := omit,
1796 dRX_Parameters := omit,
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001797 iMSI := imsi,
Harald Weltee0abc472018-02-05 09:13:31 +01001798 tLLI_old := omit,
1799 pFI := omit,
1800 lSA_Information := omit,
1801 service_UTRAN_CCO := omit,
1802 service_Class_Indicator := omit,
1803 subscriber_Profile_ID_For_RAT_Priority := omit,
1804 redirection_Indication := omit,
1805 redirection_Completed := omit,
1806 unconfirmed_Send_State_Variable := omit,
1807 sCI := omit,
1808 gGSN_PGW_Location := omit,
1809 eDRX_Paremeters := omit,
1810 old_Routing_Area_Identification := omit,
1811 attach_Indicator := omit,
1812 alignment_octets := omit,
1813 lLC_PDU := ts_BSSGP_LLC_PDU(pdu),
1814 initialLLC_PDU := omit
1815 }
1816 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001817 template (present) PDU_BSSGP tr_BSSGP_DL_UD(template (present) GprsTlli tlli, template (present) octetstring pdu,
Daniel Willmann325458d2021-02-11 14:22:42 +01001818 template IMSI_BSSGP imsi := omit) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001819 pDU_BSSGP_DL_UNITDATA := {
1820 bssgpPduType := '00'O,
Harald Welte2436fb52020-11-15 22:38:47 +01001821 tLLI_current := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +01001822 qoS_Profile := ?,
1823 pDU_Lifetime := ?,
1824 mS_Radio_Access_Capability := *,
1825 priority := *,
1826 dRX_Parameters := *,
Harald Welte2436fb52020-11-15 22:38:47 +01001827 iMSI := imsi,
Harald Weltee0abc472018-02-05 09:13:31 +01001828 tLLI_old := *,
1829 pFI := *,
1830 lSA_Information := *,
1831 service_UTRAN_CCO := *,
1832 service_Class_Indicator := *,
1833 subscriber_Profile_ID_For_RAT_Priority := *,
1834 redirection_Indication := *,
1835 redirection_Completed := *,
1836 unconfirmed_Send_State_Variable := *,
1837 sCI := *,
1838 gGSN_PGW_Location := *,
1839 eDRX_Paremeters := *,
1840 old_Routing_Area_Identification := *,
1841 attach_Indicator := *,
1842 alignment_octets := *,
Harald Welte2436fb52020-11-15 22:38:47 +01001843 lLC_PDU := tr_BSSGP_LLC_PDU(pdu),
Harald Weltee0abc472018-02-05 09:13:31 +01001844 initialLLC_PDU := *
1845 }
1846 }
1847
Harald Welte14ac3462021-01-16 13:20:31 +01001848 /* 10.2.2 */
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001849 template (value) PDU_BSSGP ts_BSSGP_UL_UD(GprsTlli tlli, BssgpCellId cell_id, octetstring payload) := {
Harald Welte78d9f272018-02-16 18:13:45 +01001850 pDU_BSSGP_UL_UNITDATA := {
1851 bssgpPduType := '01'O,
1852 tLLI := tlli,
1853 qoS_Profile := t_defaultQos,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001854 cell_Identifier := ts_BSSGP_IE_CellId(cell_id),
Harald Welte78d9f272018-02-16 18:13:45 +01001855 pFI := omit,
1856 lSA_Identifier_List := omit,
1857 redirect_Attempt_Flag := omit,
1858 iMSI_BSSGP := omit,
1859 unconfirmed_Send_State_Variable := omit,
1860 selected_PLMN_ID := omit,
1861 selected_Operator := omit,
1862 cS_Registered_Operator := omit,
1863 alignment_octets := omit,
1864 lLC_PDU := ts_BSSGP_LLC_PDU(payload)
1865 }
1866 }
Harald Weltee0abc472018-02-05 09:13:31 +01001867 template PDU_BSSGP tr_BSSGP_UL_UD(template GprsTlli tlli := ?, template BssgpCellId cell_id := ?,
1868 template octetstring payload := ?) := {
1869 pDU_BSSGP_UL_UNITDATA := {
1870 bssgpPduType := '01'O,
Harald Welteacc93ab2018-03-02 21:39:09 +01001871 tLLI := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +01001872 qoS_Profile := ?,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001873 cell_Identifier := tr_BSSGP_IE_CellId(cell_id),
Harald Weltee0abc472018-02-05 09:13:31 +01001874 pFI := *,
1875 lSA_Identifier_List := *,
1876 redirect_Attempt_Flag := *,
1877 iMSI_BSSGP := *,
1878 unconfirmed_Send_State_Variable := *,
1879 selected_PLMN_ID := *,
1880 selected_Operator := *,
1881 cS_Registered_Operator := *,
1882 alignment_octets := *,
1883 lLC_PDU := tr_BSSGP_LLC_PDU(payload)
1884 }
1885 }
1886
Harald Welte14ac3462021-01-16 13:20:31 +01001887 /* 10.3.2 */
Pau Espin Pedrol88bf5372019-12-09 21:12:28 +01001888 template PDU_BSSGP tr_BSSGP_CS_PAGING(BssgpBvci bvci) := {
1889 pDU_BSSGP_PAGING_CS := {
1890 bssgpPduType := '07'O,
1891 iMSI := ?,
1892 dRX_Parameters := ?,
1893 paging_Field4 := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001894 bVCI := ts_BSSGP_BVCI(bvci)
Pau Espin Pedrol88bf5372019-12-09 21:12:28 +01001895 },
1896 tLLI := *,
1897 channel_needed := *,
1898 eMLPP_Priority := *,
1899 tMSI := *,
1900 global_CN_Id := *
1901 }
1902 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001903 template (value) PDU_BSSGP ts_BSSGP_CS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := {
Pau Espin Pedrol88bf5372019-12-09 21:12:28 +01001904 pDU_BSSGP_PAGING_CS := {
1905 bssgpPduType := '07'O,
1906 iMSI := ts_BSSGP_IMSI(imsi),
1907 dRX_Parameters := t_defaultDRXparam,
1908 paging_Field4 := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001909 bVCI := ts_BSSGP_BVCI(bvci)
Pau Espin Pedrol88bf5372019-12-09 21:12:28 +01001910 },
1911 tLLI := omit,
1912 channel_needed := omit,
1913 eMLPP_Priority := omit,
1914 tMSI := omit,
1915 global_CN_Id := omit
1916 }
1917 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001918 template (value) PDU_BSSGP ts_BSSGP_CS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := {
Vadim Yanitskiy7b224212020-03-26 02:43:55 +07001919 pDU_BSSGP_PAGING_CS := {
1920 bssgpPduType := '07'O,
1921 iMSI := ts_BSSGP_IMSI(imsi),
1922 dRX_Parameters := t_defaultDRXparam,
1923 paging_Field4 := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001924 bVCI := ts_BSSGP_BVCI(bvci)
Vadim Yanitskiy7b224212020-03-26 02:43:55 +07001925 },
1926 tLLI := omit,
1927 channel_needed := omit,
1928 eMLPP_Priority := omit,
1929 tMSI := ts_BSSGP_TMSI(tmsi),
1930 global_CN_Id := omit
1931 }
1932 }
1933
Harald Welte14ac3462021-01-16 13:20:31 +01001934 /* 10.3.1 */
Harald Weltea36b2462020-06-17 22:11:08 +02001935 template PDU_BSSGP tr_BSSGP_PS_PAGING(template BssgpBvci bvci) := {
Harald Welte78d9f272018-02-16 18:13:45 +01001936 pDU_BSSGP_PAGING_PS := {
1937 bssgpPduType := '06'O,
1938 iMSI := ?,
1939 dRX_Parameters := *,
1940 paging_Field4 := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001941 bVCI := tr_BSSGP_BVCI(bvci)
Harald Welte78d9f272018-02-16 18:13:45 +01001942 },
1943 pFI := *,
1944 aBQP := *,
1945 qoS_Profile := ?,
1946 pTMSI := *,
1947 eDRX_Paremeters := *
1948 }
1949 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001950 template (value) PDU_BSSGP ts_BSSGP_PS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001951 pDU_BSSGP_PAGING_PS := {
1952 bssgpPduType := '06'O,
1953 iMSI := ts_BSSGP_IMSI(imsi),
1954 dRX_Parameters := omit,
1955 paging_Field4 := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001956 bVCI := ts_BSSGP_BVCI(bvci)
Harald Weltee0abc472018-02-05 09:13:31 +01001957 },
1958 pFI := omit,
1959 aBQP := omit,
1960 qoS_Profile := ts_QoS_TLV(t_defaultQos),
1961 pTMSI := omit,
1962 eDRX_Paremeters := omit
1963 }
1964 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001965 template (value) PDU_BSSGP ts_BSSGP_PS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001966 pDU_BSSGP_PAGING_PS := {
1967 bssgpPduType := '06'O,
1968 iMSI := ts_BSSGP_IMSI(imsi),
1969 dRX_Parameters := omit,
1970 paging_Field4 := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01001971 bVCI := ts_BSSGP_BVCI(bvci)
Harald Weltee0abc472018-02-05 09:13:31 +01001972 },
1973 pFI := omit,
1974 aBQP := omit,
1975 qoS_Profile := ts_QoS_TLV(t_defaultQos),
1976 pTMSI := ts_BSSGP_TMSI(tmsi),
1977 eDRX_Paremeters := omit
1978 }
1979 }
1980
Harald Welte0e188242020-11-22 21:46:48 +01001981 template (value) Paging_Field4 ts_BssgpP4BssArea := {
1982 bSS_Area_Indication := {
1983 iEI := '02'O,
1984 ext := '1'B,
1985 lengthIndicator := {
1986 length1 := 1
1987 },
1988 bSS_indicator := '00'O
1989 }
1990 }
1991
1992 template (value) Paging_Field4 ts_BssgpP4LAC(GSM_Types.LocationAreaIdentification lai) := {
1993 location_Area := ts_BSSGP_LA_ID(lai)
1994 }
1995
1996 template (value) Paging_Field4 ts_BssgpP4RAC(GSM_Types.RoutingAreaIdentification rai) := {
1997 routeing_Area := ts_BSSGP_RA_ID(rai)
1998 }
1999
2000 template (value) Paging_Field4 ts_BssgpP4Bvci(BssgpBvci bvci) := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002001 bVCI := ts_BSSGP_BVCI(bvci)
Harald Welte0e188242020-11-22 21:46:48 +01002002 }
2003
2004 template (value) Location_Area ts_BSSGP_LA_ID(GSM_Types.LocationAreaIdentification input) := {
2005 iEI := '10'O,
2006 ext := '1'B,
2007 lengthIndicator := {
2008 length1 := 5
2009 },
2010 mccDigit1 := input.mcc_mnc[0],
2011 mccDigit2 := input.mcc_mnc[1],
2012 mccDigit3 := input.mcc_mnc[2],
2013 mncDigit3 := input.mcc_mnc[3],
2014 mncDigit1 := input.mcc_mnc[4],
2015 mncDigit2 := input.mcc_mnc[5],
2016 lac := int2oct(input.lac, 2)
2017 }
2018
2019 template (value) Routeing_Area ts_BSSGP_RA_ID(GSM_Types.RoutingAreaIdentification input) := {
Harald Welte23989a62019-03-21 21:32:45 +01002020 iEI := '1B'O,
2021 ext := '1'B,
2022 lengthIndicator := {
2023 length1 := 6
2024 },
2025 mccDigit1 := input.lai.mcc_mnc[0],
2026 mccDigit2 := input.lai.mcc_mnc[1],
2027 mccDigit3 := input.lai.mcc_mnc[2],
2028 mncDigit3 := input.lai.mcc_mnc[3],
2029 mncDigit1 := input.lai.mcc_mnc[4],
2030 mncDigit2 := input.lai.mcc_mnc[5],
2031 lac := int2oct(input.lai.lac, 2),
2032 rac := int2oct(input.rac, 1)
2033 }
2034
Harald Weltebe9bf1e2021-01-16 15:17:23 +01002035 private function f_ts_BSSGP_RA_ID(template (omit) GSM_Types.RoutingAreaIdentification input)
2036 return template (omit) Routeing_Area {
2037 if (istemplatekind(input, "omit")) {
2038 return omit;
2039 } else {
2040 return ts_BSSGP_RA_ID(valueof(input));
2041 }
2042 }
2043
2044 private function f_tr_BSSGP_RA_ID(template GSM_Types.RoutingAreaIdentification input)
2045 return template Routeing_Area {
2046 if (istemplatekind(input, "omit")) {
2047 return omit;
2048 } else if (istemplatekind(input, "*")) {
2049 return *;
2050 } else if (istemplatekind(input, "?")) {
2051 return ?;
2052 } else {
2053 return ts_BSSGP_RA_ID(valueof(input));
2054 }
2055 }
2056
Harald Welte14ac3462021-01-16 13:20:31 +01002057 /* 10.3.6 */
Harald Welte23989a62019-03-21 21:32:45 +01002058 template (value) PDU_BSSGP ts_BSSGP_SUSPEND(GprsTlli tlli, RoutingAreaIdentification ra_id) := {
2059 pDU_BSSGP_SUSPEND := {
2060 bssgpPduType := '0B'O,
2061 tLLI := ts_BSSGP_TLLI(tlli),
2062 routeing_Area := ts_BSSGP_RA_ID(ra_id)
2063 }
2064 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002065 template PDU_BSSGP tr_BSSGP_SUSPEND(template (present) GprsTlli tlli, RoutingAreaIdentification ra_id) := {
Harald Welte23989a62019-03-21 21:32:45 +01002066 pDU_BSSGP_SUSPEND := {
2067 bssgpPduType := '0B'O,
2068 tLLI := tr_BSSGP_TLLI(tlli),
2069 routeing_Area := ts_BSSGP_RA_ID(ra_id)
2070 }
2071 }
2072
Harald Welte14ac3462021-01-16 13:20:31 +01002073 /* 10.3.7 */
Harald Welte23989a62019-03-21 21:32:45 +01002074 template (value) PDU_BSSGP ts_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
2075 template (value) OCT1 susp_ref) := {
2076 pDU_BSSGP_SUSPEND_ACK := {
2077 bssgpPduType := '0C'O,
2078 tLLI := ts_BSSGP_TLLI(tlli),
2079 routeing_Area := ts_BSSGP_RA_ID(ra_id),
2080 suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref)
2081 }
2082 }
2083 template PDU_BSSGP tr_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
2084 template OCT1 susp_ref) := {
2085 pDU_BSSGP_SUSPEND_ACK := {
2086 bssgpPduType := '0C'O,
2087 tLLI := tr_BSSGP_TLLI(tlli),
2088 routeing_Area := ts_BSSGP_RA_ID(ra_id),
2089 suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref)
2090 }
2091 }
2092
Harald Welte14ac3462021-01-16 13:20:31 +01002093 /* 10.3.8 */
Harald Welte23989a62019-03-21 21:32:45 +01002094 template (value) PDU_BSSGP ts_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
2095 template (omit) BssgpCause cause) := {
2096 pDU_BSSGP_SUSPEND_NACK := {
2097 bssgpPduType := '0D'O,
2098 tLLI := ts_BSSGP_TLLI(tlli),
2099 routeing_Area := ts_BSSGP_RA_ID(ra_id),
2100 cause := ts_BSSGP_CAUSE(cause)
2101 }
2102 }
2103 template PDU_BSSGP tr_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
2104 template BssgpCause cause) := {
2105 pDU_BSSGP_SUSPEND_NACK := {
2106 bssgpPduType := '0D'O,
2107 tLLI := tr_BSSGP_TLLI(tlli),
2108 routeing_Area := ts_BSSGP_RA_ID(ra_id),
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002109 cause := tr_BSSGP_CAUSE(cause)
Harald Welte23989a62019-03-21 21:32:45 +01002110 }
2111 }
2112
2113
Harald Welte14ac3462021-01-16 13:20:31 +01002114 /* 10.3.9 */
Harald Welte23989a62019-03-21 21:32:45 +01002115 template (value) PDU_BSSGP ts_BSSGP_RESUME(GprsTlli tlli, RoutingAreaIdentification ra_id,
2116 OCT1 susp_ref) := {
2117 pDU_BSSGP_RESUME := {
2118 bssgpPduType := '0E'O,
2119 tLLI := ts_BSSGP_TLLI(tlli),
2120 routeing_Area := ts_BSSGP_RA_ID(ra_id),
2121 suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref)
2122 }
2123 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002124 template PDU_BSSGP tr_BSSGP_RESUME(template (present) GprsTlli tlli, RoutingAreaIdentification ra_id,
Harald Welte23989a62019-03-21 21:32:45 +01002125 template OCT1 susp_ref) := {
2126 pDU_BSSGP_RESUME := {
2127 bssgpPduType := '0E'O,
2128 tLLI := tr_BSSGP_TLLI(tlli),
2129 routeing_Area := ts_BSSGP_RA_ID(ra_id),
2130 suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref)
2131 }
2132 }
2133
Harald Welte14ac3462021-01-16 13:20:31 +01002134 /* 10.3.10 */
Harald Welte23989a62019-03-21 21:32:45 +01002135 template (value) PDU_BSSGP ts_BSSGP_RESUME_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id)
2136 := {
2137 pDU_BSSGP_RESUME_ACK := {
2138 bssgpPduType := '0F'O,
2139 tLLI := ts_BSSGP_TLLI(tlli),
2140 routeing_Area := ts_BSSGP_RA_ID(ra_id)
2141 }
2142 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002143 template PDU_BSSGP tr_BSSGP_RESUME_ACK(template (present) GprsTlli tlli,
Harald Welte23989a62019-03-21 21:32:45 +01002144 RoutingAreaIdentification ra_id) := {
2145 pDU_BSSGP_RESUME_ACK := {
2146 bssgpPduType := '0F'O,
2147 tLLI := tr_BSSGP_TLLI(tlli),
2148 routeing_Area := ts_BSSGP_RA_ID(ra_id)
2149 }
2150 }
2151
Harald Welte14ac3462021-01-16 13:20:31 +01002152 /* 10.3.11 */
Harald Welte23989a62019-03-21 21:32:45 +01002153 template (value) PDU_BSSGP ts_BSSGP_RESUME_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
2154 template (omit) BssgpCause cause) := {
2155 pDU_BSSGP_RESUME_NACK := {
2156 bssgpPduType := '10'O,
2157 tLLI := ts_BSSGP_TLLI(tlli),
2158 routeing_Area := ts_BSSGP_RA_ID(ra_id),
2159 cause := ts_BSSGP_CAUSE(cause)
2160 }
2161 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002162 template PDU_BSSGP tr_BSSGP_RESUME_NACK(template (present) GprsTlli tlli,
Harald Welte23989a62019-03-21 21:32:45 +01002163 RoutingAreaIdentification ra_id,
2164 template BssgpCause cause) := {
2165 pDU_BSSGP_RESUME_NACK := {
2166 bssgpPduType := '10'O,
2167 tLLI := tr_BSSGP_TLLI(tlli),
2168 routeing_Area := ts_BSSGP_RA_ID(ra_id),
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002169 cause := tr_BSSGP_CAUSE(cause)
Harald Welte23989a62019-03-21 21:32:45 +01002170 }
2171 }
2172
Harald Weltebe9bf1e2021-01-16 15:17:23 +01002173 /* 10.3.12 */
2174 template (value) PDU_BSSGP ts_BSSGP_DUMMY_PAGING_PS(hexstring imsi,
2175 template (omit) RoutingAreaIdentification ra) := {
2176 pDU_BSSGP_DUMMY_PAGING_PS := {
2177 bssgpPduType := '12'O,
2178 iMSI := ts_BSSGP_IMSI(imsi),
2179 routeing_Area := f_ts_BSSGP_RA_ID(ra),
2180 eDRX_Paremeters := omit
2181 }
2182 }
2183 template (present) PDU_BSSGP tr_BSSGP_DUMMY_PAGING_PS(hexstring imsi,
2184 template RoutingAreaIdentification ra) := {
2185 pDU_BSSGP_DUMMY_PAGING_PS := {
2186 bssgpPduType := '12'O,
2187 iMSI := tr_BSSGP_IMSI(imsi),
2188 routeing_Area := f_tr_BSSGP_RA_ID(ra),
2189 eDRX_Paremeters := omit
2190 }
2191 }
2192
2193 template (value) Time_Until_Next_Paging_Occasion ts_TimeNextPag(uint8_t mins, uint8_t secs) := {
2194 iEI := '93'O,
2195 ext := '1'B,
2196 lengthIndicator := {
2197 length1 := 2
2198 },
2199 minutes := mins,
2200 spare := '00'B,
2201 seconds := secs,
2202 spare2 := '00'B
2203 }
2204 template (present) Time_Until_Next_Paging_Occasion tr_TimeNextPag(template (present) uint8_t mins,
2205 template (present) uint8_t secs) := {
2206 iEI := '93'O,
2207 ext := '1'B,
2208 lengthIndicator := {
2209 length1 := 2
2210 },
2211 minutes := mins,
2212 spare := ?,
2213 seconds := secs,
2214 spare2 := ?
2215 }
2216
2217 /* 10.3.13 */
2218 template (value) PDU_BSSGP ts_BSSGP_DUMMY_PAGING_PS_RESP(hexstring imsi, uint8_t mins, uint8_t secs) := {
2219 pDU_BSSGP_DUMMY_PAGING_PS_RESPONSE := {
2220 bssgpPduType := '13'O,
2221 iMSI := ts_BSSGP_IMSI(imsi),
2222 time_Until_Next_Paging_Occasion := ts_TimeNextPag(mins, secs)
2223 }
2224 }
2225 template (present) PDU_BSSGP tr_BSSGP_DUMMY_PAGING_PS_RESP(hexstring imsi,
2226 template (present) uint8_t mins,
2227 template (present) uint8_t secs) := {
2228 pDU_BSSGP_DUMMY_PAGING_PS_RESPONSE := {
2229 bssgpPduType := '13'O,
2230 iMSI := tr_BSSGP_IMSI(imsi),
2231 time_Until_Next_Paging_Occasion := tr_TimeNextPag(mins, secs)
2232 }
2233 }
2234
2235 /* 10.3.14 */
2236 template (value) PDU_BSSGP ts_BSSGP_PAGING_PS_REJ(hexstring imsi, uint8_t mins, uint8_t secs,
2237 template (omit) GsmTmsi tmsi) := {
2238 pDU_BSSGP_PAGING_PS_REJECT := {
2239 bssgpPduType := '11'O,
2240 iMSI := ts_BSSGP_IMSI(imsi),
2241 pTMSI := f_ts_BSSGP_TMSI(tmsi),
2242 time_Until_Next_Paging_Occasion := ts_TimeNextPag(mins, secs)
2243 }
2244 }
2245 template (present) PDU_BSSGP tr_BSSGP_PAGING_PS_REJ(hexstring imsi,
2246 template (present) uint8_t mins,
2247 template (present) uint8_t secs,
2248 template GsmTmsi tmsi) := {
2249 pDU_BSSGP_PAGING_PS_REJECT := {
2250 bssgpPduType := '11'O,
2251 iMSI := tr_BSSGP_IMSI(imsi),
2252 pTMSI := f_tr_BSSGP_TMSI(tmsi),
2253 time_Until_Next_Paging_Occasion := tr_TimeNextPag(mins, secs)
2254 }
2255 }
2256
2257 /* 10.3.15 */
2258 template (value) PDU_BSSGP ts_BSSGP_MS_REG_ENQ(hexstring imsi) := {
2259 pDU_BSSGP_MS_REGISTRATION_ENQUIRY := {
2260 bssgpPduType := '14'O,
2261 iMSI := ts_BSSGP_IMSI(imsi),
2262 mME_Query := omit
2263 }
2264 }
2265 template (present) PDU_BSSGP tr_BSSGP_MS_REG_ENQ(hexstring imsi) := {
2266 pDU_BSSGP_MS_REGISTRATION_ENQUIRY := {
2267 bssgpPduType := '14'O,
2268 iMSI := tr_BSSGP_IMSI(imsi),
2269 mME_Query := *
2270 }
2271 }
2272
2273 /* 11.3.126 */
2274 template (value) PLMN_Identity ts_BSSGP_PlmnId(template (value) BcdMccMnc mccmnc) := {
2275 iEI := '96'O,
2276 ext := '1'B,
2277 lengthIndicator := {
2278 length1 := 3
2279 },
2280 mccDigit1 := mccmnc[0],
2281 mccDigit2 := mccmnc[1],
2282 mccDigit3 := mccmnc[2],
2283 mncDigit3 := mccmnc[5],
2284 mncDigit1 := mccmnc[3],
2285 mncDigit2 := mccmnc[4]
2286 }
2287 template (present) PLMN_Identity tr_BSSGP_PlmnId(template (present) BcdMccMnc mccmnc) := {
2288 iEI := '96'O,
2289 ext := '1'B,
2290 lengthIndicator := {
2291 length1 := 3
2292 },
2293 mccDigit1 := mccmnc[0],
2294 mccDigit2 := mccmnc[1],
2295 mccDigit3 := mccmnc[2],
2296 mncDigit3 := mccmnc[5],
2297 mncDigit1 := mccmnc[3],
2298 mncDigit2 := mccmnc[4]
2299 }
2300 private function f_ts_BSSGP_PlmnId(template (omit) BcdMccMnc mccmnc)
2301 return template (omit) PLMN_Identity {
2302 if (istemplatekind(mccmnc, "omit")) {
2303 return omit;
2304 } else {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002305 return ts_BSSGP_PlmnId(valueof(mccmnc));
Harald Weltebe9bf1e2021-01-16 15:17:23 +01002306 }
2307 }
2308 private function f_tr_BSSGP_PlmnId(template BcdMccMnc mccmnc)
2309 return template PLMN_Identity {
2310 if (istemplatekind(mccmnc, "omit")) {
2311 return omit;
2312 } else if (istemplatekind(mccmnc, "*")) {
2313 return *;
2314 } else if (istemplatekind(mccmnc, "?")) {
2315 return ?;
2316 } else {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002317 return ts_BSSGP_PlmnId(valueof(mccmnc));
Harald Weltebe9bf1e2021-01-16 15:17:23 +01002318 }
2319 }
2320
2321 /* 10.3.16 */
2322 template (value) PDU_BSSGP ts_BSSGP_MS_REW_ENQ_RESP(hexstring imsi, template (omit) BcdMccMnc mccmnc) := {
2323 pDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE := {
2324 bssgpPduType := '15'O,
2325 iMSI := ts_BSSGP_IMSI(imsi),
2326 pS_Registered_Operator := f_ts_BSSGP_PlmnId(mccmnc)
2327 }
2328 }
2329 template (present) PDU_BSSGP tr_BSSGP_MS_REW_ENQ_RESP(hexstring imsi, template BcdMccMnc mccmnc) := {
2330 pDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE := {
2331 bssgpPduType := '15'O,
2332 iMSI := tr_BSSGP_IMSI(imsi),
2333 pS_Registered_Operator := f_tr_BSSGP_PlmnId(mccmnc)
2334 }
2335 }
2336
Daniel Willmann379fc252020-11-20 18:34:22 +01002337 /* 10.4.1 */
2338 template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL(GprsTlli tlli, template (value) BssgpBvci bvci_old,
2339 template (omit) BssgpBvci bvci_new := omit,
2340 template (omit) Nsei nsei := omit) := {
2341 pDU_BSSGP_FLUSH_LL := {
2342 bssgpPduType := '2A'O,
2343 tLLI := ts_BSSGP_TLLI(tlli),
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002344 bVCI_old := ts_BSSGP_BVCI(bvci_old),
2345 bVCI_new := f_ts_BSSGP_BVCI(bvci_new),
2346 nSEI := f_ts_BSSGP_NSEI(nsei)
Daniel Willmann379fc252020-11-20 18:34:22 +01002347 }
2348 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002349 template PDU_BSSGP tr_BSSGP_FLUSH_LL(template (present) GprsTlli tlli, template BssgpBvci bvci_old,
Daniel Willmann379fc252020-11-20 18:34:22 +01002350 template (omit) BssgpBvci bvci_new := omit,
2351 template (omit) Nsei nsei := omit) := {
2352 pDU_BSSGP_FLUSH_LL := {
2353 bssgpPduType := '2A'O,
2354 tLLI := tr_BSSGP_TLLI(tlli),
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002355 bVCI_old := tr_BSSGP_BVCI(bvci_old),
2356 bVCI_new := f_ts_BSSGP_BVCI(bvci_new),
2357 nSEI := f_ts_BSSGP_NSEI(nsei)
Daniel Willmann379fc252020-11-20 18:34:22 +01002358 }
2359 }
2360
Daniel Willmann7f1d78e2020-11-24 14:42:40 +01002361 /* 10.4.2 */
2362 template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL_ACK(GprsTlli tlli, template (value) OCT1 act,
2363 template (value) integer oct_affected,
2364 template (omit) BssgpBvci bvci_new := omit,
2365 template (omit) Nsei nsei := omit) := {
2366 pDU_BSSGP_FLUSH_LL_ACK := {
2367 bssgpPduType := '2B'O,
2368 tLLI := ts_BSSGP_TLLI(tlli),
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002369 flush_Action := ts_FLUSH_ACTION(act),
2370 bVCI_new := f_ts_BSSGP_BVCI(bvci_new),
2371 number_of_octets_affected := ts_NO_OCT_AFF(oct_affected),
2372 nSEI := f_ts_BSSGP_NSEI(nsei)
Daniel Willmann7f1d78e2020-11-24 14:42:40 +01002373 }
2374 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002375 template PDU_BSSGP tr_BSSGP_FLUSH_LL_ACK(template (present) GprsTlli tlli, template OCT1 act,
Daniel Willmann7f1d78e2020-11-24 14:42:40 +01002376 template integer oct_affected,
2377 template (omit) BssgpBvci bvci_new := omit,
2378 template (omit) Nsei nsei := omit) := {
2379 pDU_BSSGP_FLUSH_LL_ACK := {
2380 bssgpPduType := '2B'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002381 tLLI := tr_BSSGP_TLLI(tlli),
2382 flush_Action := tr_FLUSH_ACTION(act),
2383 bVCI_new := f_ts_BSSGP_BVCI(bvci_new),
2384 number_of_octets_affected := tr_NO_OCT_AFF(oct_affected),
2385 nSEI := f_ts_BSSGP_NSEI(nsei)
Daniel Willmann7f1d78e2020-11-24 14:42:40 +01002386 }
2387 }
2388
Daniel Willmann00c0bbf2020-11-24 18:37:49 +01002389 /* 10.4.3 */
2390 template (value) PDU_BSSGP ts_BSSGP_LLC_DISCARDED(GprsTlli tlli, template (value) integer frames_discarded,
2391 template (value) BssgpBvci bvci,
2392 template (value) integer oct_deleted) := {
2393 pDU_BSSGP_LLC_DISCARDED := {
2394 bssgpPduType := '2C'O,
2395 tLLI := ts_BSSGP_TLLI(tlli),
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002396 lLC_Frames_Discarded := ts_LLC_FRAMES_DISCARDED(frames_discarded),
2397 bVCI := ts_BSSGP_BVCI(bvci),
2398 number_of_octets_deleted := ts_NO_OCT_AFF(oct_deleted),
Daniel Willmann00c0bbf2020-11-24 18:37:49 +01002399 pFI := omit
2400 }
2401 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002402 template PDU_BSSGP tr_BSSGP_LLC_DISCARDED(template (present) GprsTlli tlli, template integer frames_discarded,
Daniel Willmann00c0bbf2020-11-24 18:37:49 +01002403 template BssgpBvci bvci,
2404 template integer oct_deleted) := {
2405 pDU_BSSGP_LLC_DISCARDED := {
2406 bssgpPduType := '2C'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002407 tLLI := tr_BSSGP_TLLI(tlli),
2408 lLC_Frames_Discarded := tr_LLC_FRAMES_DISCARDED(frames_discarded),
2409 bVCI := tr_BSSGP_BVCI(bvci),
2410 number_of_octets_deleted := tr_NO_OCT_AFF(oct_deleted),
Daniel Willmann00c0bbf2020-11-24 18:37:49 +01002411 pFI := *
2412 }
2413 }
2414
Daniel Willmann670bbc02020-11-19 16:39:39 +01002415 /* 10.2.3 */
2416 template (value) PDU_BSSGP ts_BSSGP_RA_CAP(GprsTlli tlli,
2417 template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := {
2418 pDU_BSSGP_RA_CAPABILITY := {
2419 bssgpPduType := '02'O,
2420 tLLI := ts_BSSGP_TLLI(tlli),
2421 mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap)
2422 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002423 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002424 template (present) PDU_BSSGP tr_BSSGP_RA_CAP(template (present) GprsTlli tlli,
2425 template MSRadioAccessCapabilityV_BSSGP racap) := {
2426 pDU_BSSGP_RA_CAPABILITY := {
2427 bssgpPduType := '02'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002428 tLLI := tr_BSSGP_TLLI(tlli),
Daniel Willmann670bbc02020-11-19 16:39:39 +01002429 mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap)
2430 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002431 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002432
2433
Daniel Willmann670bbc02020-11-19 16:39:39 +01002434 /* 10.3.3 */
2435 template (value) PDU_BSSGP ts_BSSGP_RA_CAP_UPD(GprsTlli tlli, OCT1 tag) := {
2436 pDU_BSSGP_RA_CAPABILITY_UPDATE := {
2437 bssgpPduType := '08'O,
2438 tLLI := ts_BSSGP_TLLI(tlli),
2439 tag := ts_BSSGP_IE_Tag(tag)
2440 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002441 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002442 template (present) PDU_BSSGP tr_BSSGP_RA_CAP_UPD(template (present) GprsTlli tlli,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002443 template (present) OCT1 tag) := {
Daniel Willmann670bbc02020-11-19 16:39:39 +01002444 pDU_BSSGP_RA_CAPABILITY_UPDATE := {
2445 bssgpPduType := '08'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002446 tLLI := tr_BSSGP_TLLI(tlli),
Daniel Willmann670bbc02020-11-19 16:39:39 +01002447 tag := tr_BSSGP_IE_Tag(tag)
2448 }
Daniel Willmannace3ece2020-11-16 19:53:26 +01002449 }
Daniel Willmannace3ece2020-11-16 19:53:26 +01002450
Harald Welte6dc2ac42020-11-16 09:16:17 +01002451
Daniel Willmann670bbc02020-11-19 16:39:39 +01002452 /* 10.3.4 */
2453 template (value) PDU_BSSGP
2454 ts_BSSGP_RA_CAP_UPD_ACK(GprsTlli tlli, OCT1 tag, template (value) OCT1 cause,
2455 template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := {
2456 pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := {
2457 bssgpPduType := '09'O,
2458 tLLI := ts_BSSGP_TLLI(tlli),
2459 tag := ts_BSSGP_IE_Tag(tag),
2460 iMSI := omit,
2461 rA_Cap_UPDATE_CAUSE := ts_BSSGP_IE_RACU_Cause(cause),
2462 mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap)
2463 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002464 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002465 template (present) PDU_BSSGP
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002466 tr_BSSGP_RA_CAP_UPD_ACK(template (present) GprsTlli tlli, template (present) OCT1 tag, template (present) OCT1 cause,
Daniel Willmann670bbc02020-11-19 16:39:39 +01002467 template MSRadioAccessCapabilityV_BSSGP racap := omit) := {
2468 pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := {
2469 bssgpPduType := '09'O,
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002470 tLLI := tr_BSSGP_TLLI(tlli),
Daniel Willmann670bbc02020-11-19 16:39:39 +01002471 tag := tr_BSSGP_IE_Tag(tag),
2472 iMSI := omit,
2473 rA_Cap_UPDATE_CAUSE := tr_BSSGP_IE_RACU_Cause(cause),
2474 mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap)
2475 }
Daniel Willmannace3ece2020-11-16 19:53:26 +01002476 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002477
Daniel Willmann670bbc02020-11-19 16:39:39 +01002478 type enumerated BssgpRadioCause {
2479 BSSGP_RADIO_CAUSE_CONTACT_LOST ('00'H),
2480 BSSGP_RADIO_CAUSE_LINK_QUAL_INSUFF ('01'H),
2481 BSSGP_RADIO_CAUSE_CELL_RESEL_ORDERED ('02'H),
2482 BSSGP_RADIO_CAUSE_CELL_RESEL_PREPARE ('03'H),
2483 BSSGP_RADIO_CAUSE_CELL_RESEL_FAILURE ('04'H)
2484 } with { variant "FIELDLENGTH(8)" };
Harald Welte6dc2ac42020-11-16 09:16:17 +01002485
Harald Welte0e188242020-11-22 21:46:48 +01002486 function ts_BSSGP_RADIO_CAUSE(template (omit) BssgpRadioCause cause) return template (omit) Radio_Cause {
Daniel Willmann670bbc02020-11-19 16:39:39 +01002487 var template (omit) Radio_Cause ret;
2488 if (istemplatekind(cause, "omit")) {
2489 ret := omit;
2490 } else {
2491 ret.iEI := '19'O;
2492 ret.ext := '1'B;
2493 ret.lengthIndicator := { length1 := 1 };
2494 ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1);
2495 }
2496 return ret;
2497 }
2498 function tr_BSSGP_RADIO_CAUSE(template BssgpRadioCause cause) return template (present) Radio_Cause {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002499 var template (present) Radio_Cause ret;
Daniel Willmann05d46382020-11-19 14:20:33 +01002500 ret.iEI := '19'O;
2501 ret.ext := '1'B;
2502 ret.lengthIndicator := { length1 := 1 };
Daniel Willmann670bbc02020-11-19 16:39:39 +01002503 if (isvalue(cause)) {
2504 ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1);
2505 } else {
2506 ret.radio_Cause_Value := ?
2507 }
2508 return ret;
Daniel Willmann05d46382020-11-19 14:20:33 +01002509 }
Daniel Willmann05d46382020-11-19 14:20:33 +01002510
Daniel Willmann670bbc02020-11-19 16:39:39 +01002511 /* 10.3.5 */
2512 template (value) PDU_BSSGP
Harald Welte112bc142021-01-17 11:10:30 +01002513 ts_BSSGP_RADIO_STATUS(template (omit) GprsTlli tlli, template (value) BssgpRadioCause cause,
2514 template (omit) GsmTmsi tmsi := omit,
2515 template (omit) hexstring imsi := omit) := {
Daniel Willmann670bbc02020-11-19 16:39:39 +01002516 pDU_BSSGP_RADIO_STATUS := {
2517 bssgpPduType := '0a'O,
Harald Welte112bc142021-01-17 11:10:30 +01002518 tLLI := f_ts_BSSGP_TLLI(tlli),
2519 tMSI := f_ts_BSSGP_TMSI(tmsi),
2520 iMSI := f_ts_BSSGP_IMSI(imsi),
Daniel Willmann670bbc02020-11-19 16:39:39 +01002521 radio_Cause := ts_BSSGP_RADIO_CAUSE(cause)
Harald Welte5339b2e2020-10-04 22:52:56 +02002522 }
2523 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002524 template (present) PDU_BSSGP
Harald Welte112bc142021-01-17 11:10:30 +01002525 tr_BSSGP_RADIO_STATUS(template GprsTlli tlli, template (present) BssgpRadioCause cause,
2526 template GsmTmsi tmsi := *, template hexstring imsi := *) := {
Daniel Willmann670bbc02020-11-19 16:39:39 +01002527 pDU_BSSGP_RADIO_STATUS := {
2528 bssgpPduType := '0a'O,
Harald Welte112bc142021-01-17 11:10:30 +01002529 tLLI := f_tr_BSSGP_TLLI(tlli),
2530 tMSI := f_tr_BSSGP_TMSI(tmsi),
2531 iMSI := f_tr_BSSGP_IMSI(imsi),
Daniel Willmann670bbc02020-11-19 16:39:39 +01002532 radio_Cause := tr_BSSGP_RADIO_CAUSE(cause)
2533 }
Harald Welte5339b2e2020-10-04 22:52:56 +02002534 }
Harald Welte23989a62019-03-21 21:32:45 +01002535
Harald Weltef8e5c5d2020-11-27 22:37:23 +01002536 /* 10.4.15 */
2537 template (value) PDU_BSSGP
2538 ts_BSSGP_INVOKE_TRACE(OCT1 eq_trace, OCT2 ref) := {
2539 pDU_BSSGP_SGSN_INVOKE_TRACE := {
2540 bssgpPduType := '40'O,
2541 traceType := {
2542 iEI := '22'O,
2543 ext := '1'B,
2544 lengthIndicator := {
2545 length1 := 1
2546 },
2547 equipment_Trace := eq_trace
2548 },
2549 traceReference := {
2550 iEI := '21'O,
2551 ext := '1'B,
2552 lengthIndicator := {
2553 length1 := 2
2554 },
2555 trace_Reference := ref
2556 },
2557 triggerId := omit,
2558 mobileId := omit,
2559 omcId := omit,
2560 transactionId := omit
2561 }
2562 }
2563 template (present) PDU_BSSGP
2564 tr_BSSGP_INVOKE_TRACE(template (present) OCT1 eq_trace, template (present) OCT2 ref) := {
2565 pDU_BSSGP_SGSN_INVOKE_TRACE := {
2566 bssgpPduType := '40'O,
2567 traceType := {
2568 iEI := '22'O,
2569 ext := '1'B,
2570 lengthIndicator := {
2571 length1 := 1
2572 },
2573 equipment_Trace := eq_trace
2574 },
2575 traceReference := {
2576 iEI := '21'O,
2577 ext := '1'B,
2578 lengthIndicator := {
2579 length1 := 2
2580 },
2581 trace_Reference := ref
2582 },
2583 triggerId := *,
2584 mobileId := *,
2585 omcId := *,
2586 transactionId := *
2587 }
2588 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002589
Harald Weltef20af412020-11-28 16:11:11 +01002590 /* 10.4.36 */
2591 template (value) PDU_BSSGP
2592 ts_OVERLOAD(template (value) BIT1 priority_class) := {
2593 pDU_BSSGP_OVERLOAD := {
2594 bssgpPduType := '42'O,
2595 priority_Class_Indicator := {
2596 iEI := '8f'O,
2597 ext := '1'B,
2598 lengthIndicator := {
2599 length1 := 1
2600 },
2601 priority_Class_Indicator_Value := priority_class,
2602 spare := '0000000'B
2603 }
2604 }
2605 }
2606 template (present) PDU_BSSGP
2607 tr_OVERLOAD(template (present) BIT1 priority_class) := {
2608 pDU_BSSGP_OVERLOAD := {
2609 bssgpPduType := '42'O,
2610 priority_Class_Indicator := {
2611 iEI := '8f'O,
2612 ext := '1'B,
2613 lengthIndicator := {
2614 length1 := 1
2615 },
2616 priority_Class_Indicator_Value := priority_class,
2617 spare := '0000000'B
2618 }
2619 }
2620 }
2621
Philipp Maierb76a2792020-12-07 16:54:35 +01002622 /* 3GPP TS 48.018 11.3.61 */
2623 const OCT1 RIM_APP_ID_NACC := '01'O;
2624 const OCT1 RIM_APP_ID_SI3 := '02'O;
2625 const OCT1 RIM_APP_ID_MBMS_DATA_CH := '03'O;
2626 const OCT1 RIM_APP_ID_SON_TRANSF := '04'O;
2627 const OCT1 RIM_APP_ID_UTRA_SI := '05'O;
2628 template (value) RIM_Application_Identity ts_RIM_Application_Identity(OCT1 app_id) := {
2629 iEI := '4B'O,
2630 ext := '1'B,
2631 lengthIndicator := {
2632 length1 := 1
2633 },
2634 rIMApplicationIdentity := app_id
2635 }
Philipp Maiere00776c2021-01-26 23:01:47 +01002636 template RIM_Application_Identity tr_RIM_Application_Identity(template OCT1 app_id := ?) := {
2637 iEI := '4B'O,
2638 ext := '1'B,
2639 lengthIndicator := {
2640 length1 := 1
2641 },
2642 rIMApplicationIdentity := app_id
2643 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002644
2645 /* 3GPP TS 48.018 11.3.62 */
2646 template (value) RIM_Sequence_Number ts_RIM_Sequence_Number(integer seq) := {
2647 iEI := '4C'O,
2648 ext := '1'B,
2649 lengthIndicator := {
2650 length1 := 4
2651 },
2652 rIMSequenceNumber := int2oct(seq, 4)
2653 }
Philipp Maiere00776c2021-01-26 23:01:47 +01002654 function tr_RIM_Sequence_Number(template integer seq := ?) return template RIM_Sequence_Number {
2655 var template RIM_Sequence_Number ret;
2656 ret.iEI := '4C'O;
2657 ret.ext := '1'B;
2658 ret.lengthIndicator := { length1 := 4 };
2659 if (istemplatekind(seq, "*")) {
2660 ret.rIMSequenceNumber := *;
2661 } else if (istemplatekind(seq, "?")) {
2662 ret.rIMSequenceNumber := ?;
2663 } else {
2664 ret.rIMSequenceNumber := int2oct(valueof(seq), 4);
2665 }
2666 return ret;
2667 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002668
2669 /* 3GPP TS 48.018 11.3.62a.1 */
2670 template (value) RAN_Information_Request_RIM_Container
2671 ts_RAN_Information_Request_RIM_Container(template (value) RIM_Application_Identity app_id,
2672 template (value) RIM_Sequence_Number seq,
2673 template (value) RIM_PDU_Indications ind,
2674 template (omit) RIM_Protocol_Version_Number ver := omit,
2675 template (omit) RAN_Information_Request_Application_Container app_cont := omit,
2676 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2677 iEI := '57'O,
2678 ext := '1'B,
2679 lengthIndicator := {
2680 length1 := 0 /* overwritten */
2681 },
2682 rIM_Application_Identity := app_id,
2683 rIM_Sequence_Number := seq,
2684 rIM_PDU_Indications := ind,
2685 rIM_Protocol_Version_Number := ver,
2686 application_Container := app_cont,
2687 sON_Transfer_Application_Identity_TLV := son_app_id
2688 }
2689 template RAN_Information_Request_RIM_Container
2690 tr_RAN_Information_Request_RIM_Container(template RIM_Application_Identity app_id := ?,
2691 template RIM_Sequence_Number seq := ?,
2692 template RIM_PDU_Indications ind := ?,
2693 template RIM_Protocol_Version_Number ver := *,
2694 template RAN_Information_Request_Application_Container app_cont := *,
2695 template SON_Transfer_Application_Identity_TLV son_app_id := *) := {
2696 iEI := '57'O,
2697 ext := '1'B,
2698 lengthIndicator := {
2699 length1 := ?
2700 },
2701 rIM_Application_Identity := app_id,
2702 rIM_Sequence_Number := seq,
2703 rIM_PDU_Indications := ind,
2704 rIM_Protocol_Version_Number := ver,
2705 application_Container := app_cont,
2706 sON_Transfer_Application_Identity_TLV := son_app_id
2707 }
2708
2709
2710 /* 3GPP TS 48.018 11.3.62a.2 */
2711 template (value) RAN_Information_RIM_Container
2712 ts_RAN_Information_RIM_Container(template (value) RIM_Application_Identity app_id,
2713 template (value) RIM_Sequence_Number seq,
2714 template (value) RIM_PDU_Indications ind,
2715 template (omit) RIM_Protocol_Version_Number ver := omit,
2716 template (omit) ApplContainer_or_ApplErrContainer app_cont_or_app_err := omit,
2717 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2718
2719 iEI := '58'O,
2720 ext := '1'B,
2721 lengthIndicator := {
2722 length1 := 0 /* overwritten */
2723 },
2724 rIM_Application_Identity := app_id,
2725 rIM_Sequence_Number := seq,
2726 rIM_PDU_Indications := ind,
2727 rIM_Protocol_Version_Number := ver,
2728 applContainer_or_ApplErrContainer := app_cont_or_app_err,
2729 sON_Transfer_Application_Identity := son_app_id
2730 }
Philipp Maiere00776c2021-01-26 23:01:47 +01002731 template RAN_Information_RIM_Container
2732 tr_RAN_Information_RIM_Container(template RIM_Application_Identity app_id := ?,
2733 template RIM_Sequence_Number seq := ?,
2734 template RIM_PDU_Indications ind := ?,
2735 template RIM_Protocol_Version_Number ver := omit,
2736 template ApplContainer_or_ApplErrContainer app_cont_or_app_err := omit,
2737 template SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2738
2739 iEI := '58'O,
2740 ext := '1'B,
2741 lengthIndicator := {
2742 length1 := ?
2743 },
2744 rIM_Application_Identity := app_id,
2745 rIM_Sequence_Number := seq,
2746 rIM_PDU_Indications := ind,
2747 rIM_Protocol_Version_Number := ver,
2748 applContainer_or_ApplErrContainer := app_cont_or_app_err,
2749 sON_Transfer_Application_Identity := son_app_id
2750 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002751 template (value) ApplContainer_or_ApplErrContainer
2752 tsu_ApplContainer_or_ApplErrContainer_NACC(template (value) ApplContainer_or_ApplErrContainer_NACC cont) := {
2753 nacc := cont
2754 }
Philipp Maiere00776c2021-01-26 23:01:47 +01002755 template ApplContainer_or_ApplErrContainer
2756 tru_ApplContainer_or_ApplErrContainer_NACC(template ApplContainer_or_ApplErrContainer_NACC cont := ?) := {
2757 nacc := cont
2758 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002759 template (value) ApplContainer_or_ApplErrContainer
2760 tsu_ApplContainer_or_ApplErrContainer_SI3(template (value) ApplContainer_or_ApplErrContainer_SI3 cont) := {
2761 si3 := cont
2762 }
2763 template (value) ApplContainer_or_ApplErrContainer
2764 tsu_ApplContainer_or_ApplErrContainer_MBMS_data_channel(template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel cont) := {
2765 mBMS_data_channel := cont
2766 }
2767 template (value) ApplContainer_or_ApplErrContainer_NACC
2768 tsu_ApplContainer_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
2769 application_Container := ts_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi)
2770 }
Philipp Maiere00776c2021-01-26 23:01:47 +01002771 template ApplContainer_or_ApplErrContainer_NACC
2772 tru_ApplContainer_NACC(template BssgpCellId cid := ?, template boolean psi_type := ?, template integer si_psi_num := ?, template octetstring si_psi := ?) := {
2773 application_Container := tr_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi)
2774 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002775 template (value) ApplContainer_or_ApplErrContainer_NACC
2776 tsu_ApplErrContainer_NACC(template (value) BssgpCellId cid,
2777 integer cause,
2778 template (value) Application_Container_IE_NACC app_cont) := {
2779 application_Error_Container := ts_Application_Error_Container_NACC(cid, cause, app_cont)
2780 }
2781 template (value) ApplContainer_or_ApplErrContainer_SI3
2782 tsu_ApplContainer_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := {
2783 application_Container := ts_RAN_Information_Application_Container_SI3(cid, si3)
2784 }
2785 template (value) ApplContainer_or_ApplErrContainer_SI3
2786 tsu_ApplErrContainer_SI3(template (value) BssgpCellId cid,
2787 integer cause,
2788 template (value) Application_Container_IE_SI3 app_cont) := {
2789 application_Error_Container := ts_Application_Error_Container_SI3(cid, cause, app_cont)
2790 }
2791 template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel
2792 tsu_ApplContainer_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := {
2793 application_Container := ts_RAN_Information_Application_Container_MBMS_data_channel(cid, data_ch_report)
2794 }
2795 template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel
2796 tsu_ApplErrContainer_MBMS_data_channel(template (value) BssgpCellId cid,
2797 integer cause,
2798 template (value) Application_Container_IE_MBMS_data_channel app_cont) := {
2799 application_Error_Container := ts_Application_Error_Container_MBMS_data_channel(cid, cause, app_cont)
2800 }
2801
2802 /* 3GPP TS 48.018 11.3.62a.3 */
2803 template (value) RAN_Information_Ack_RIM_Container
2804 ts_RAN_Information_Ack_RIM_Container(template (value) RIM_Application_Identity app_id,
2805 template (value) RIM_Sequence_Number seq,
2806 template (omit) RIM_Protocol_Version_Number ver := omit,
2807 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2808 iEI := '5A'O,
2809 ext := '1'B,
2810 lengthIndicator := {
2811 length1 := 0 /* overwritten */
2812 },
2813 rIM_Application_Identity := app_id,
2814 rIM_Sequence_Number := seq,
2815 rIM_Protocol_Version_Number := ver,
2816 sON_Transfer_Application_Identity := son_app_id
2817 }
Philipp Maier14d3a8e2021-01-28 21:43:16 +01002818 template RAN_Information_Ack_RIM_Container
2819 tr_RAN_Information_Ack_RIM_Container(template RIM_Application_Identity app_id := ?,
2820 template RIM_Sequence_Number seq := ?,
2821 template RIM_Protocol_Version_Number ver := omit,
2822 template SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2823 iEI := '5A'O,
2824 ext := '1'B,
2825 lengthIndicator := {
2826 length1 := ?
2827 },
2828 rIM_Application_Identity := app_id,
2829 rIM_Sequence_Number := seq,
2830 rIM_Protocol_Version_Number := ver,
2831 sON_Transfer_Application_Identity := son_app_id
2832 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002833
2834 /* 3GPP TS 48.018 11.3.62a.4 */
2835 template (value) RAN_Information_Error_RIM_Container
2836 ts_RAN_Information_Error_RIM_Container(template (value) RIM_Application_Identity app_id,
2837 template (value) Cause_BSSGP cause,
2838 template (omit) RIM_Protocol_Version_Number ver := omit,
2839 PDU_BSSGP pdu,
2840 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2841 iEI := '5B'O,
2842 ext := '1'B,
2843 lengthIndicator := {
2844 length1 := 0 /* overwritten */
2845 },
2846 rIM_Application_Identity := app_id,
2847 rIM_cause := cause,
2848 rIM_Protocol_Version_Number := ver,
2849 pDU_in_Error:= {
2850 iEI := '15'O,
2851 ext := '1'B,
2852 lengthIndicator := {
2853 length1 := 0 /* overwritten */
2854 },
2855 erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu)
2856 },
2857 sON_Transfer_Application_Identity := son_app_id
2858 }
Philipp Maier14d3a8e2021-01-28 21:43:16 +01002859 template RAN_Information_Error_RIM_Container
2860 tr_RAN_Information_Error_RIM_Container(template RIM_Application_Identity app_id := ?,
2861 template Cause_BSSGP cause := ?,
2862 template RIM_Protocol_Version_Number ver := omit,
2863 template octetstring pdu := ?,
2864 template SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2865 iEI := '5B'O,
2866 ext := '1'B,
2867 lengthIndicator := {
2868 length1 := ?
2869 },
2870 rIM_Application_Identity := app_id,
2871 rIM_cause := cause,
2872 rIM_Protocol_Version_Number := ver,
2873 pDU_in_Error:= {
2874 iEI := '15'O,
2875 ext := '1'B,
2876 lengthIndicator := {
2877 length1 := ?
2878 },
2879 erroneous_BSSGP_PDU := pdu
2880 },
2881 sON_Transfer_Application_Identity := son_app_id
2882 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002883
2884 /* 3GPP TS 48.018 11.3.62a.5 */
2885 template (value) RAN_Information_Application_Error_RIM_Container
2886 ts_RAN_Information_Application_Error_RIM_Container(template (value) RIM_Application_Identity app_id,
2887 template (value) RIM_Sequence_Number seq,
2888 template (value) RIM_PDU_Indications ind,
2889 template (omit) RIM_Protocol_Version_Number ver := omit,
2890 template (value) Application_Error_Container cont,
2891 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2892 iEI := '59'O,
2893 ext := '1'B,
2894 lengthIndicator := {
2895 length1 := 0 /* overwritten */
2896 },
2897 rIM_Application_Identity := app_id,
2898 rIM_Sequence_Number := seq,
2899 rIM_PDU_Indications := ind,
2900 rIM_Protocol_Version_Number := ver,
2901 application_Error_Container := cont,
2902 sON_Transfer_Application_Identity := son_app_id
2903 }
Philipp Maier14d3a8e2021-01-28 21:43:16 +01002904 template RAN_Information_Application_Error_RIM_Container
2905 tr_RAN_Information_Application_Error_RIM_Container(template RIM_Application_Identity app_id := ?,
2906 template RIM_Sequence_Number seq := ?,
2907 template RIM_PDU_Indications ind := ?,
2908 template RIM_Protocol_Version_Number ver := omit,
2909 template Application_Error_Container cont := ?,
2910 template SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2911 iEI := '59'O,
2912 ext := '1'B,
2913 lengthIndicator := {
2914 length1 := ?
2915 },
2916 rIM_Application_Identity := app_id,
2917 rIM_Sequence_Number := seq,
2918 rIM_PDU_Indications := ind,
2919 rIM_Protocol_Version_Number := ver,
2920 application_Error_Container := cont,
2921 sON_Transfer_Application_Identity := son_app_id
2922 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002923
2924
2925 /* 3GPP TS 48.018 11.3.63.1 */
2926 template (value) RAN_Information_Request_Application_Container
2927 tsu_RAN_Information_Request_Application_Container_NACC(template (value) BssgpCellId cid) := {
2928 nacc := ts_RAN_Information_Request_Application_Container_NACC(cid)
2929 }
2930 template (value) RAN_Information_Request_Application_Container
2931 tsu_RAN_Information_Request_Application_Container_SI3(template (value) BssgpCellId cid) := {
2932 si3 := ts_RAN_Information_Request_Application_Container_SI3(cid)
2933 }
2934 template (value) RAN_Information_Request_Application_Container
2935 tsu_RAN_Information_Request_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid) := {
2936 mBMS_data_channel := ts_RAN_Information_Request_Application_Container_MBMS_data_channel(cid)
2937 }
2938
2939 /* NOTE: The type description of reporting_Cell_Identifier in chapter 11.3.63.1, version V10.6.0 (2012-07) of
2940 * 3GPP TS 48.018 clearly states: "Reporting Cell Identifier: This field is encoded as the Cell Identifier
2941 * defined in sub-clause 11.3.9". However this seems to be an error in the specification, because the
2942 * specifiction in Table 11.3.63.1.1 already has a length field an an IEI defined. Keeping the IEI and lenght
2943 * of the BSSGP cell identifier in addition would no make sense. Also in the chapters below the specifiction
2944 * of the IEs are similar and there it says "Reporting Cell Identifier: This field is encoded as the value
2945 * part of the Cell Identifier IE defined in sub-clause 11.3.9, not including IEI and Length Indicator.",
2946 * which actually makes sense. */
2947
2948 /* 3GPP TS 48.018 11.3.63.1.1 */
2949 template (value) RAN_Information_Request_Application_Container_NACC
2950 ts_RAN_Information_Request_Application_Container_NACC(template (value) BssgpCellId cid) := {
2951 iEI := '4D'O,
2952 ext := '1'B,
2953 lengthIndicator := {
2954 length1 := 0 /* overwritten */
2955 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002956 reporting_Cell_Identifier := ts_Cell_Identifier_V(cid)
Philipp Maierb76a2792020-12-07 16:54:35 +01002957 }
Philipp Maier14d3a8e2021-01-28 21:43:16 +01002958 template RAN_Information_Request_Application_Container_NACC
2959 tr_RAN_Information_Request_Application_Container_NACC(template BssgpCellId cid := ?) := {
2960 iEI := '4D'O,
2961 ext := '1'B,
2962 lengthIndicator := {
2963 length1 := ?
2964 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002965 reporting_Cell_Identifier := tr_Cell_Identifier_V(cid)
Philipp Maier14d3a8e2021-01-28 21:43:16 +01002966 }
Philipp Maierb76a2792020-12-07 16:54:35 +01002967
2968 /* 3GPP TS 48.018 11.3.63.1.2 */
2969 template (value) RAN_Information_Request_Application_Container_SI3
2970 ts_RAN_Information_Request_Application_Container_SI3(template (value) BssgpCellId cid) := {
2971 iEI := '4D'O,
2972 ext := '1'B,
2973 lengthIndicator := {
2974 length1 := 0 /* overwritten */
2975 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002976 reporting_Cell_Identifier := ts_Cell_Identifier_V(cid)
Philipp Maierb76a2792020-12-07 16:54:35 +01002977 }
2978
2979 /* 3GPP TS 48.018 11.3.63.1.3 */
2980 template (value) RAN_Information_Request_Application_Container_MBMS_data_channel
2981 ts_RAN_Information_Request_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid) := {
2982 iEI := '4D'O,
2983 ext := '1'B,
2984 lengthIndicator := {
2985 length1 := 0 /* overwritten */
2986 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002987 reporting_Cell_Identifier := ts_Cell_Identifier_V(cid)
Philipp Maierb76a2792020-12-07 16:54:35 +01002988 }
2989
2990 /* 3GPP TS 48.018 11.3.63.2.1 */
2991 template (value) RAN_Information_Application_Container_NACC
2992 ts_RAN_Information_Application_Container_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
2993 iEI := '4E'O,
2994 ext := '1'B,
2995 lengthIndicator := {
2996 length1 := 0 /* overwritten */
2997 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01002998 reporting_Cell_Identifier := ts_Cell_Identifier_V(cid),
Philipp Maierb76a2792020-12-07 16:54:35 +01002999 typeBit := bool2bit(psi_type),
3000 number_of_SI_PSI := int2bit(si_psi_num, 7),
3001 sI_PSI := si_psi
3002 }
Philipp Maiere00776c2021-01-26 23:01:47 +01003003 function tr_RAN_Information_Application_Container_NACC(template BssgpCellId cid := ?, template boolean psi_type := ?,
3004 template integer si_psi_num := ?, template octetstring si_psi := ?)
3005 return template RAN_Information_Application_Container_NACC {
3006 var template RAN_Information_Application_Container_NACC ret;
3007 ret.iEI := '4E'O;
3008 ret.ext := '1'B;
3009 ret.lengthIndicator := { length1 := ? };
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01003010 ret.reporting_Cell_Identifier := tr_Cell_Identifier_V(cid);
Philipp Maiere00776c2021-01-26 23:01:47 +01003011 if (istemplatekind(psi_type, "*")) {
3012 ret.typeBit := *;
3013 } else if (istemplatekind(psi_type, "?")) {
3014 ret.typeBit := ?;
3015 } else {
3016 ret.typeBit := bool2bit(valueof(psi_type));
3017 }
3018 if (istemplatekind(si_psi_num, "*")) {
3019 ret.number_of_SI_PSI := *;
3020 } else if (istemplatekind(si_psi_num, "?")) {
3021 ret.number_of_SI_PSI := ?;
3022 } else {
3023 ret.number_of_SI_PSI := int2bit(valueof(si_psi_num), 7);
3024 }
3025 ret.sI_PSI := si_psi;
3026 return ret;
3027 }
Philipp Maierb76a2792020-12-07 16:54:35 +01003028
3029 /* 3GPP TS 48.018 11.3.63.2.2 */
3030 template (value) RAN_Information_Application_Container_SI3
3031 ts_RAN_Information_Application_Container_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := {
3032 iEI := '4E'O,
3033 ext := '1'B,
3034 lengthIndicator := {
3035 length1 := 0 /* overwritten */
3036 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01003037 reporting_Cell_Identifier := ts_Cell_Identifier_V(cid),
Philipp Maierb76a2792020-12-07 16:54:35 +01003038 sI3 := si3
3039 }
3040
3041 /* 3GPP TS 48.018 11.3.63.2.3 */
3042 template (value) RAN_Information_Application_Container_MBMS_data_channel
3043 ts_RAN_Information_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := {
3044 iEI := '4E'O,
3045 ext := '1'B,
3046 lengthIndicator := {
3047 length1 := 0 /* overwritten */
3048 },
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01003049 reporting_Cell_Identifier := ts_Cell_Identifier_V(cid),
Philipp Maierb76a2792020-12-07 16:54:35 +01003050 mBMS_data_channel_report := data_ch_report
3051 }
3052
3053
3054 /* 3GPP TS 48.018 11.3.64 */
3055 template (value) Application_Error_Container
3056 tsu_Application_Error_Container_NACC(template (value) BssgpCellId cid,
3057 integer cause,
3058 template (value) Application_Container_IE_NACC app_cont) := {
3059 nacc := ts_Application_Error_Container_NACC(cid, cause, app_cont)
3060 }
Philipp Maier14d3a8e2021-01-28 21:43:16 +01003061 template Application_Error_Container
3062 rsu_Application_Error_Container_NACC(template BssgpCellId cid := ?,
3063 template integer cause := ?,
3064 template Application_Container_IE_NACC app_cont := ?) := {
3065 nacc := tr_Application_Error_Container_NACC(cid, cause, app_cont)
3066 }
Philipp Maierb76a2792020-12-07 16:54:35 +01003067 template (value) Application_Error_Container
3068 tsu_Application_Error_Container_SI3(template (value) BssgpCellId cid,
3069 integer cause,
3070 template (value) Application_Container_IE_SI3 app_cont) := {
3071 si3 := ts_Application_Error_Container_SI3(cid, cause, app_cont)
3072 }
3073 template (value) Application_Error_Container
3074 tsu_Application_Error_Container_MBMS_data_channel(template (value) BssgpCellId cid,
3075 integer cause,
3076 template (value) Application_Container_IE_MBMS_data_channel app_cont) := {
3077 mBMS_data_channel := ts_Application_Error_Container_MBMS_data_channel(cid, cause, app_cont)
3078 }
3079
3080 /* 3GPP TS 48.018 11.3.64.1 */
3081 template (value) Application_Error_Container_NACC
3082 ts_Application_Error_Container_NACC(template (value) BssgpCellId cid,
3083 integer cause,
3084 template (value) Application_Container_IE_NACC app_cont) := {
3085 iEI := '56'O,
3086 ext := '1'B,
3087 lengthIndicator := {
3088 length1 := 0 /* overwritten */
3089 },
3090 nACC_cause := int2oct(cause, 1),
3091 erroneousApplicationContainer := app_cont
3092 }
Philipp Maier14d3a8e2021-01-28 21:43:16 +01003093 function tr_Application_Error_Container_NACC(template BssgpCellId cid := ?,
3094 template integer cause := ?,
3095 template Application_Container_IE_NACC app_cont := ?)
3096 return template Application_Error_Container_NACC {
3097 var template Application_Error_Container_NACC ret;
3098 ret.iEI := '56'O;
3099 ret.ext := '1'B;
3100 ret.lengthIndicator := { length1 := ? };
3101 ret.erroneousApplicationContainer := app_cont;
3102 if (istemplatekind(cause, "*")) {
3103 ret.nACC_cause := *;
3104 } else if (istemplatekind(cause, "?")) {
3105 ret.nACC_cause := ?;
3106 } else {
3107 ret.nACC_cause := int2oct(valueof(cause), 1);
3108 }
3109 return ret;
3110 }
3111
Philipp Maierb76a2792020-12-07 16:54:35 +01003112 template (value) Application_Container_IE_NACC
3113 tsu_Application_Container_IE_NACC_req(template (value) BssgpCellId cid) := {
3114 rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_NACC(cid)
3115 }
Philipp Maier14d3a8e2021-01-28 21:43:16 +01003116 template Application_Container_IE_NACC
3117 rsu_Application_Container_IE_NACC_req(template BssgpCellId cid := ?) := {
3118 rAN_Information_Request_Application_Container := tr_RAN_Information_Request_Application_Container_NACC(cid)
3119 }
Philipp Maierb76a2792020-12-07 16:54:35 +01003120 template (value) Application_Container_IE_NACC
3121 tsu_Application_Container_IE_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
3122 rAN_Information_Application_Container := ts_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi)
3123 }
3124
3125 /* 3GPP TS 48.018 11.3.64.2 */
3126 template (value) Application_Error_Container_SI3
3127 ts_Application_Error_Container_SI3(template (value) BssgpCellId cid,
3128 integer cause,
3129 template (value) Application_Container_IE_SI3 app_cont) := {
3130 iEI := '56'O,
3131 ext := '1'B,
3132 lengthIndicator := {
3133 length1 := 0 /* overwritten */
3134 },
3135 sI3_cause := int2oct(cause, 1),
3136 erroneousApplicationContainer := app_cont
3137 }
3138 template (value) Application_Container_IE_SI3
3139 tsu_Application_Container_IE_SI3_req(template (value) BssgpCellId cid) := {
3140 rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_SI3(cid)
3141 }
3142 template (value) Application_Container_IE_SI3
3143 tsu_Application_Container_IE_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := {
3144 rAN_Information_Application_Container := ts_RAN_Information_Application_Container_SI3(cid, si3)
3145 }
3146
3147 /* 3GPP TS 48.018 11.3.64.3 */
3148 template (value) Application_Error_Container_MBMS_data_channel
3149 ts_Application_Error_Container_MBMS_data_channel(template (value) BssgpCellId cid,
3150 integer cause,
3151 template (value) Application_Container_IE_MBMS_data_channel app_cont) := {
3152 iEI := '56'O,
3153 ext := '1'B,
3154 lengthIndicator := {
3155 length1 := 0 /* overwritten */
3156 },
3157 mBMS_data_channel_cause := int2oct(cause, 1),
3158 erroneousApplicationContainer := app_cont
3159 }
3160 template (value) Application_Container_IE_MBMS_data_channel
3161 tsu_Application_Container_IE_MBMS_data_channel_req(template (value) BssgpCellId cid) := {
3162 rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_MBMS_data_channel(cid)
3163 }
3164 template (value) Application_Container_IE_MBMS_data_channel
3165 tsu_Application_Container_IE_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := {
3166 rAN_Information_Application_Container := ts_RAN_Information_Application_Container_MBMS_data_channel(cid, data_ch_report)
3167 }
3168
3169
3170 /* 3GPP TS 44.018 10.5.1.3 -> 3GPP TS 24.008 10.5.1.3 */
3171 function t_LocationAreaIdentification(template BssgpCellId cid) return template BSSGP_Types.LocationAreaIdentification {
3172 var template BSSGP_Types.LocationAreaIdentification ret := {
3173 mccDigit1 := ?,
3174 mccDigit2 := ?,
3175 mccDigit3 := ?,
3176 mncDigit3 := ?,
3177 mncDigit1 := ?,
3178 mncDigit2 := ?,
3179 lac := ?
3180 }
3181 if (istemplatekind(cid, "omit")) {
3182 return omit;
3183 } else if (istemplatekind(cid, "*")) {
3184 return *;
3185 } else if (istemplatekind(cid, "?")) {
3186 return ?;
3187 }
3188 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
3189 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
3190 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
3191 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
3192 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
3193 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
3194 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
3195 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
3196 }
3197 if (isvalue(cid.ra_id.lai.lac)) {
3198 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
3199 }
3200 }
3201 return ret;
3202 }
3203
3204 /* 3GPP TS 44.018 10.5.2.11 */
3205 template (value) ControlChannelDescription ts_ControlChannelDescription(integer ccch_conf,
3206 integer bs_ag_blks_res,
3207 boolean att,
3208 boolean mscr,
3209 integer bs_pa_mfrms,
3210 BIT2 cbq3,
3211 integer t3212) := {
3212 cCCH_Conf := int2bit(ccch_conf, 3),
3213 bS_AG_BLKS_RES := int2bit(bs_ag_blks_res, 3),
3214 aTT := bool2bit(att),
3215 mSCR := bool2bit(mscr),
3216 bS_PA_MFRMS := int2bit(bs_pa_mfrms, 3),
3217 spare1 := '00'B,
3218 cBQ3 := cbq3,
3219 spare2 := '0'B,
3220 t3212 := int2oct(t3212, 1)
3221 }
3222
3223 /* 3GPP TS 44.018 10.5.2.3 */
3224 template (value) CellOptions ts_CellOptions(integer radio_link_timeout,
3225 BIT3 dtx,
3226 boolean pwrc) := {
3227 radioLinkTimeout := int2bit(radio_link_timeout, 4),
3228 dTX1 := dtx[0] & dtx[1],
3229 pWRC := bool2bit(pwrc),
3230 dtx2 := dtx[2]
3231 }
3232
3233 /* 3GPP TS 44.018 10.5.2.4 */
3234 template (value) CellSelectionParameters ts_CellSelectionParameters(integer ms_txpwr_max_cch,
3235 integer cell_reselection_hysteresis,
3236 integer rxlev_access_min,
3237 boolean neci,
3238 boolean acs) := {
3239 mS_TXPWR_MAX_CCH := int2bit(ms_txpwr_max_cch, 5),
3240 cellReselectHysterisis := int2bit(cell_reselection_hysteresis, 3),
3241 rXLEV_Access_Min := int2bit(rxlev_access_min, 6),
3242 nECI := bool2bit(neci),
3243 aCS := bool2bit(acs)
3244 }
3245
3246 /* 3GPP TS 44.018 10.5.2.29 */
3247 template (value) RACHControlParameters ts_RACHControlParameters(boolean re,
3248 boolean cell_barr_access,
3249 integer tx_integer,
3250 integer max_retrans,
3251 integer ac_15_to_8,
3252 integer ac_7_to_0) := {
3253 rE := bool2bit(re),
3254 cellBarrAccess := bool2bit(cell_barr_access),
3255 tX_Integer := int2bit(tx_integer, 4),
3256 maxRetrans := int2bit(max_retrans, 2),
3257 aC_15_to_8 := int2oct(ac_15_to_8, 1),
3258 aC_7_to_0 := int2oct(ac_7_to_0, 1)
3259 }
3260
3261 /* 3GPP TS 44.018 9.1.35 */
3262 template (value) SI3 ts_SI3(integer cell_id,
3263 template (value) BSSGP_Types.LocationAreaIdentification lai,
3264 template (value) ControlChannelDescription cch_descr,
3265 template (value) CellOptions cell_opt,
3266 template (value) CellSelectionParameters cell_sel_par,
3267 template (value) RACHControlParameters rach_ctrl_par,
3268 OCT4 rest_octets) := {
3269 sI3MessageType := '1B'O,
3270 cellIdentity := int2oct(cell_id, 2),
3271 locationAreaIdentification := lai,
3272 controlChannelDescription := cch_descr,
3273 cellOptions := cell_opt,
3274 cellSelectionParameters := cell_sel_par,
3275 rACHControlParameters := rach_ctrl_par,
3276 sI3RestOctets := rest_octets
3277 }
3278
3279
3280 /* 3GPP TS 48.018 11.3.65 */
3281 const BIT3 RIM_PDU_TYPE_STOP := '000'B;
3282 const BIT3 RIM_PDU_TYPE_SING_REP := '001'B;
3283 const BIT3 RIM_PDU_TYPE_MULT_REP := '010'B;
3284 template (value) RIM_PDU_Indications ts_RIM_PDU_Indications(boolean ack, BIT3 type_ext) := {
3285 iEI := '4F'O,
3286 ext := '1'B,
3287 lengthIndicator := {
3288 length1 := 1
3289 },
3290 ack := bool2bit(ack),
3291 pDU_Type_Extension := type_ext,
3292 reserved := '0000'B
3293 }
Philipp Maiere00776c2021-01-26 23:01:47 +01003294 function tr_RIM_PDU_Indications(template boolean ack := ?, template BIT3 type_ext := ?) return template RIM_PDU_Indications {
3295 var template RIM_PDU_Indications ret;
3296 ret.iEI := '4F'O;
3297 ret.ext := '1'B;
3298 ret.lengthIndicator := { length1 := 1 };
3299 if (istemplatekind(ack, "*")) {
3300 ret.ack := *;
3301 } else if (istemplatekind(ack, "?")) {
3302 ret.ack := ?;
3303 } else {
3304 ret.ack := bool2bit(valueof(ack));
3305 }
3306 if (istemplatekind(type_ext, "*")) {
3307 ret.pDU_Type_Extension := *;
3308 } else if (istemplatekind(type_ext, "?")) {
3309 ret.pDU_Type_Extension := ?;
3310 } else {
3311 ret.pDU_Type_Extension := valueof(type_ext);
3312 }
3313 ret.reserved := '0000'B;
3314 return ret;
3315 }
Philipp Maierb76a2792020-12-07 16:54:35 +01003316
3317 /* 3GPP TS 48.018 11.3.67 */
3318 template (value) RIM_Protocol_Version_Number ts_RIM_Protocol_Version_Number(integer ver) := {
3319 iEI := '55'O,
3320 ext := '1'B,
3321 lengthIndicator := {
3322 length1 := 1
3323 },
3324 rIMProtocolVersionNumber := int2oct(ver, 1)
3325 }
Philipp Maiere00776c2021-01-26 23:01:47 +01003326 function tr_RIM_Protocol_Version_Number(template integer ver := ?) return template RIM_Protocol_Version_Number {
3327 var template RIM_Protocol_Version_Number ret;
3328 ret.iEI := '55'O;
3329 ret.ext := '1'B;
3330 ret.lengthIndicator := { length1 := 1 };
3331 if (istemplatekind(ver, "*")) {
3332 ret.rIMProtocolVersionNumber := *;
3333 } else if (istemplatekind(ver, "?")) {
3334 ret.rIMProtocolVersionNumber := ?;
3335 } else {
3336 ret.rIMProtocolVersionNumber := int2oct(valueof(ver), 1);
3337 }
3338 return ret;
3339 }
Philipp Maierb76a2792020-12-07 16:54:35 +01003340
3341 /* 3GPP TS 48.018 11.3.70 */
3342 const HEX1 RIM_ADDR_GERAN_CELL_ID := '0'H;
3343 const HEX1 RIM_ADDR_UTRAN_RNC_ID := '1'H;
3344 const HEX1 RIM_ADDR_EUTRAN_NODEB_ID := '2'H;
3345 const HEX1 RIM_ADDR_EHRPD_SECTOR_ID := '3'H;
3346 template (value) RIM_Routing_Information ts_RIM_Routing_Information(HEX1 addr_discr, template (value) RIM_Routing_Address addr) := {
3347 iEI := '54'O,
3348 ext := '1'B,
3349 lengthIndicator := {
3350 length1 := 0 /* overwritten */
3351 },
3352 rIMRoutingAddressDiscriminator := addr_discr,
3353 spare := '0'H,
3354 rIM_Routing_Address := addr
3355 }
3356 template RIM_Routing_Information tr_RIM_Routing_Information(template HEX1 addr_discr := ?, template RIM_Routing_Address addr := ?) := {
3357 iEI := '54'O,
3358 ext := '1'B,
3359 lengthIndicator := {
3360 length1 := ?
3361 },
3362 rIMRoutingAddressDiscriminator := addr_discr,
3363 spare := '0'H,
3364 rIM_Routing_Address := addr
3365 }
3366
3367 template RIM_Routing_Address t_RIM_Routing_Address_cid(template BssgpCellId cid := ?) := {
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01003368 cell_Identifier := tr_Cell_Identifier_V(cid)
Philipp Maierb76a2792020-12-07 16:54:35 +01003369 }
3370 template RIM_Routing_Address t_RIM_Routing_Address_rncid(template BssgpCellId cid := ?, template integer rnc_id := ?) := {
3371 globalRNCID := t_GlobalRNC_ID_BSSGP(cid, rnc_id)
3372 }
3373 template RIM_Routing_Address t_RIM_Routing_Address_enbid(template BssgpCellId cid := ?, template integer tac := ?, template octetstring gnbid := ?) := {
3374 eNB_Identifier := t_ENB_Identifier_V(cid, tac, gnbid)
3375 }
3376 template RIM_Routing_Address t_RIM_Routing_Address_sector(template octetstring sector := ?) := {
3377 eHRPD_SectorID := sector
3378 }
3379
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01003380 function tr_Cell_Identifier_V(template BssgpCellId cid) return template Cell_Identifier_V {
Philipp Maierb76a2792020-12-07 16:54:35 +01003381 var template Cell_Identifier_V ret := {
3382 mccDigit1 := ?,
3383 mccDigit2 := ?,
3384 mccDigit3 := ?,
3385 mncDigit3 := ?,
3386 mncDigit1 := ?,
3387 mncDigit2 := ?,
3388 lac := ?,
3389 rac := ?,
3390 cI_value := ?
3391 }
3392 if (istemplatekind(cid, "omit")) {
3393 return omit;
3394 } else if (istemplatekind(cid, "*")) {
3395 return *;
3396 } else if (istemplatekind(cid, "?")) {
3397 return ?;
3398 }
3399 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
3400 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
3401 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
3402 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
3403 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
3404 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
3405 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
3406 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
3407 }
3408 if (isvalue(cid.ra_id.lai.lac)) {
3409 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
3410 }
3411 }
3412 if (isvalue(cid) and isvalue(cid.ra_id)) {
3413 ret.rac := f_oct_or_wc(cid.ra_id.rac, 1);
3414 }
3415 if (isvalue(cid)) {
3416 ret.cI_value := f_oct_or_wc(cid.cell_id, 2);
3417 }
3418 return ret;
3419 }
Pau Espin Pedrol6ee01262021-02-05 13:05:06 +01003420 template (value) Cell_Identifier_V ts_Cell_Identifier_V(template (value) BssgpCellId cid) := {
3421 mccDigit1 := cid.ra_id.lai.mcc_mnc[0],
3422 mccDigit2 := cid.ra_id.lai.mcc_mnc[1],
3423 mccDigit3 := cid.ra_id.lai.mcc_mnc[2],
3424 mncDigit3 := cid.ra_id.lai.mcc_mnc[3],
3425 mncDigit1 := cid.ra_id.lai.mcc_mnc[4],
3426 mncDigit2 := cid.ra_id.lai.mcc_mnc[5],
3427 lac := int2oct(valueof(cid.ra_id.lai.lac), 2),
3428 rac := int2oct(valueof(cid.ra_id.rac), 1),
3429 cI_value := int2oct(valueof(cid.cell_id), 2)
3430 }
Philipp Maierb76a2792020-12-07 16:54:35 +01003431
3432 function t_GlobalRNC_ID_BSSGP(template BssgpCellId cid, template integer rnc_id) return template GlobalRNC_ID_BSSGP {
3433 var template GlobalRNC_ID_BSSGP ret := {
3434 mccDigit1 := ?,
3435 mccDigit2 := ?,
3436 mccDigit3 := ?,
3437 mncDigit3 := ?,
3438 mncDigit1 := ?,
3439 mncDigit2 := ?,
3440 lac := ?,
3441 rac := ?,
3442 spare := ?,
3443 rNC_ID := ?
3444 }
3445 if (istemplatekind(cid, "omit") and istemplatekind(rnc_id, "omit")) {
3446 return omit;
3447 } else if (istemplatekind(cid, "*") and istemplatekind(rnc_id, "*")) {
3448 return *;
3449 } else if (istemplatekind(cid, "?") and istemplatekind(rnc_id, "?")) {
3450 return ?;
3451 }
3452 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
3453 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
3454 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
3455 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
3456 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
3457 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
3458 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
3459 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
3460 }
3461 if (isvalue(cid.ra_id.lai.lac)) {
3462 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
3463 }
3464 }
3465 if (isvalue(cid) and isvalue(cid.ra_id)) {
3466 ret.rac := f_oct_or_wc(cid.ra_id.rac, 1);
3467 }
3468 if (isvalue(rnc_id)) {
3469 ret.spare := '0'H;
3470 ret.rNC_ID := rnc_id;
3471 }
3472
3473 return ret;
3474 }
3475
3476 function t_ENB_Identifier_V(template BssgpCellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier_V {
3477 var template ENB_Identifier_V ret := {
3478 mccDigit1 := ?,
3479 mccDigit2 := ?,
3480 mccDigit3 := ?,
3481 mncDigit3 := ?,
3482 mncDigit1 := ?,
3483 mncDigit2 := ?,
3484 tac := ?,
3485 globaleNBID := ?
3486 }
3487 if (istemplatekind(cid, "omit") and istemplatekind(tac, "omit") and istemplatekind(gnbid, "omit")) {
3488 return omit;
3489 } else if (istemplatekind(cid, "*") and istemplatekind(tac, "*") and istemplatekind(gnbid, "*")) {
3490 return *;
3491 } else if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) {
3492 return ?;
3493 }
3494 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
3495 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
3496 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
3497 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
3498 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
3499 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
3500 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
3501 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
3502 }
3503 }
3504 if (isvalue(tac)) {
3505 ret.tac := int2oct(valueof(tac), 2);
3506 }
3507 if (isvalue(gnbid)) {
3508 ret.globaleNBID := gnbid;
3509 }
3510
3511 return ret;
3512 }
3513
3514 /* 3GPP TS 48.018 11.3.108 */
3515 template (value) SON_Transfer_Application_Identity_TLV ts_SON_Transfer_Application_Identity_TLV(template (value) octetstring app_id) := {
3516 iEI := '84'O,
3517 ext := '1'B,
3518 lengthIndicator := {
3519 length1 := 0 /* overwritten */
3520 },
3521 sON_Transfer_Application_Identity := app_id
3522 }
3523
3524
3525 /* 3GPP TS 48.018 10.6.1 */
3526 template (value) PDU_BSSGP
3527 ts_RAN_INFORMATION_REQUEST(template (value) RIM_Routing_Information dst,
3528 template (value) RIM_Routing_Information src,
3529 template (value) RAN_Information_Request_RIM_Container cont) := {
3530 pDU_BSSGP_RAN_INFORMATION_REQUEST := {
3531 bssgpPduType := '71'O,
3532 destination_Cell_Identifier := dst,
3533 source_Cell_Identifier := src,
3534 rIM_Container := cont
3535 }
3536 }
3537 template PDU_BSSGP
3538 tr_RAN_INFORMATION_REQUEST(template RIM_Routing_Information dst := ?,
3539 template RIM_Routing_Information src := ?,
3540 template RAN_Information_Request_RIM_Container cont := ?) := {
3541 pDU_BSSGP_RAN_INFORMATION_REQUEST := {
3542 bssgpPduType := '71'O,
3543 destination_Cell_Identifier := dst,
3544 source_Cell_Identifier := src,
3545 rIM_Container := cont
3546 }
3547 }
3548
3549 /* 3GPP TS 48.018 10.6.2 */
3550 template (value) PDU_BSSGP
3551 ts_PDU_BSSGP_RAN_INFORMATION(template (value) RIM_Routing_Information dst,
3552 template (value) RIM_Routing_Information src,
3553 template (value) RAN_Information_RIM_Container cont) := {
3554 pDU_BSSGP_RAN_INFORMATION := {
3555 bssgpPduType := '70'O,
3556 destination_Cell_Identifier := dst,
3557 source_Cell_Identifier := src,
3558 rIM_Container := cont
3559 }
3560 }
3561 template PDU_BSSGP
3562 tr_PDU_BSSGP_RAN_INFORMATION(template RIM_Routing_Information dst := ?,
3563 template RIM_Routing_Information src := ?,
3564 template RAN_Information_RIM_Container cont := ?) := {
3565 pDU_BSSGP_RAN_INFORMATION := {
3566 bssgpPduType := '70'O,
3567 destination_Cell_Identifier := dst,
3568 source_Cell_Identifier := src,
3569 rIM_Container := cont
3570 }
3571 }
3572
3573 /* 3GPP TS 48.018 10.6.3 */
3574 template (value) PDU_BSSGP
3575 ts_PDU_BSSGP_RAN_INFORMATION_ACK(template (value) RIM_Routing_Information dst,
3576 template (value) RIM_Routing_Information src,
3577 template (value) RAN_Information_Ack_RIM_Container cont) := {
3578 pDU_BSSGP_RAN_INFORMATION_ACK := {
3579 bssgpPduType := '72'O,
3580 destination_Cell_Identifier := dst,
3581 source_Cell_Identifier := src,
3582 rIM_Container := cont
3583 }
3584 }
3585 template PDU_BSSGP
3586 tr_PDU_BSSGP_RAN_INFORMATION_ACK(template RIM_Routing_Information dst := ?,
3587 template RIM_Routing_Information src := ?,
3588 template RAN_Information_Ack_RIM_Container cont := ?) := {
3589 pDU_BSSGP_RAN_INFORMATION_ACK := {
3590 bssgpPduType := '72'O,
3591 destination_Cell_Identifier := dst,
3592 source_Cell_Identifier := src,
3593 rIM_Container := cont
3594 }
3595 }
3596
3597 /* 3GPP TS 48.018 10.6.4 */
3598 template (value) PDU_BSSGP
3599 ts_PDU_BSSGP_RAN_INFORMATION_ERROR(template (value) RIM_Routing_Information dst,
3600 template (value) RIM_Routing_Information src,
3601 template (value) RAN_Information_Error_RIM_Container cont) := {
3602 pDU_BSSGP_RAN_INFORMATION_ERROR := {
3603 bssgpPduType := '73'O,
3604 destination_Cell_Identifier := dst,
3605 source_Cell_Identifier := src,
3606 rIM_Container := cont
3607 }
3608 }
3609 template PDU_BSSGP
3610 tr_PDU_BSSGP_RAN_INFORMATION_ERROR(template RIM_Routing_Information dst := ?,
3611 template RIM_Routing_Information src := ?,
3612 template RAN_Information_Error_RIM_Container cont := ?) := {
3613 pDU_BSSGP_RAN_INFORMATION_ERROR := {
3614 bssgpPduType := '73'O,
3615 destination_Cell_Identifier := dst,
3616 source_Cell_Identifier := src,
3617 rIM_Container := cont
3618 }
3619 }
3620
3621 /* 3GPP TS 48.018 10.6.5 */
3622 template (value) PDU_BSSGP
3623 ts_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR(template (value) RIM_Routing_Information dst,
3624 template (value) RIM_Routing_Information src,
3625 template (value) RAN_Information_Application_Error_RIM_Container cont) := {
3626 pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := {
3627 bssgpPduType := '74'O,
3628 destination_Cell_Identifier := dst,
3629 source_Cell_Identifier := src,
3630 rIM_Container := cont
3631 }
3632 }
3633 template PDU_BSSGP
3634 tr_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR(template RIM_Routing_Information dst := ?,
3635 template RIM_Routing_Information src := ?,
3636 template RAN_Information_Application_Error_RIM_Container cont := ?) := {
3637 pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := {
3638 bssgpPduType := '74'O,
3639 destination_Cell_Identifier := dst,
3640 source_Cell_Identifier := src,
3641 rIM_Container := cont
3642 }
3643 }
3644
Daniel Willmann670bbc02020-11-19 16:39:39 +01003645 /* PDU permitted on PTP BVC only (TS 48.018 Section 5.4.1) */
3646 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP_ONLY := (
3647 {pDU_BSSGP_DL_UNITDATA := ?},
3648 {pDU_BSSGP_UL_UNITDATA := ?},
3649 {pDU_BSSGP_RA_CAPABILITY := ?},
3650 {pDU_BSSGP_RA_CAPABILITY_UPDATE := ?},
3651 {pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := ?},
3652 {pDU_BSSGP_RADIO_STATUS := ?},
3653 {pDU_BSSGP_FLOW_CONTROL_BVC := ?},
3654 {pDU_BSSGP_FLOW_CONTROL_BVC_ACK := ?},
3655 {pDU_BSSGP_FLOW_CONTROL_MS := ?},
3656 {pDU_BSSGP_FLOW_CONTROL_MS_ACK := ?},
3657 {pDU_BSSGP_FLOW_CONTROL_PFC := ?},
3658 {pDU_BSSGP_FLOW_CONTROL_PFC_ACK := ?},
3659 {pDU_BSSGP_DOWNLOAD_BSS_PFC := ?},
3660 {pDU_BSSGP_CREATE_BSS_PFC := ?},
3661 {pDU_BSSGP_CREATE_BSS_PFC_ACK := ?},
3662 {pDU_BSSGP_CREATE_BSS_PFC_NACK := ?},
3663 {pDU_BSSGP_MODIFY_BSS_PFC := ?},
3664 {pDU_BSSGP_MODIFY_BSS_PFC_ACK := ?},
3665 {pDU_BSSGP_DELETE_BSS_PFC := ?},
3666 {pDU_BSSGP_DELETE_BSS_PFC_ACK := ?},
3667 {pDU_BSSGP_DELETE_BSS_PFC_REQ := ?},
3668 {pDU_BSSGP_PS_HANDOVER_REQUIRED := ?},
3669 {pDU_BSSGP_PS_HANDOVER_REQUIRED_ACK := ?},
3670 {pDU_BSSGP_PS_HANDOVER_REQUIRED_NACK := ?},
3671 {pDU_BSSGP_PS_HANDOVER_REQUEST := ?},
3672 {pDU_BSSGP_PS_HANDOVER_REQUEST_ACK := ?},
3673 {pDU_BSSGP_PS_HANDOVER_REQUEST_NACK := ?},
3674 {pDU_BSSGP_PS_HANDOVER_COMPLETE := ?},
3675 {pDU_BSSGP_PS_HANDOVER_COMPLETE_ACK := ?},
3676 {pDU_BSSGP_PS_HANDOVER_CANCEL := ?}
3677 );
3678
3679 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP := (
3680 tr_BSSGP_PERMITTED_PTP_ONLY,
3681 {pDU_BSSGP_PAGING_PS := ?},
3682 {pDU_BSSGP_PAGING_CS := ?},
3683 {pDU_BSSGP_STATUS := ?}
3684 );
3685
3686 /* PDU permitted on Signaling BVC only (TS 48.018 Section 5.4.1) */
3687 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN_ONLY := (
3688 {pDU_BSSGP_SUSPEND := ?},
3689 {pDU_BSSGP_SUSPEND_ACK := ?},
3690 {pDU_BSSGP_SUSPEND_NACK := ?},
3691 {pDU_BSSGP_RESUME := ?},
3692 {pDU_BSSGP_RESUME_ACK := ?},
3693 {pDU_BSSGP_RESUME_NACK := ?},
3694 {pDU_BSSGP_FLUSH_LL := ?},
3695 {pDU_BSSGP_FLUSH_LL_ACK := ?},
3696 {pDU_BSSGP_LLC_DISCARDED := ?},
3697 {pDU_BSSGP_BVC_BLOCK := ?},
3698 {pDU_BSSGP_BVC_BLOCK_ACK := ?},
3699 {pDU_BSSGP_BVC_UNBLOCK := ?},
3700 {pDU_BSSGP_BVC_UNBLOCK_ACK := ?},
3701 {pDU_BSSGP_BVC_RESET := ?},
3702 {pDU_BSSGP_BVC_RESET_ACK := ?},
3703 {pDU_BSSGP_SGSN_INVOKE_TRACE := ?},
3704 {pDU_BSSGP_PERFORM_LOCATION_REQUEST := ?},
3705 {pDU_BSSGP_PERFORM_LOCATION_RESPONSE := ?},
3706 {pDU_BSSGP_PERFORM_LOCATION_ABORT := ?},
3707 {pDU_BSSGP_POSITION_COMMAND := ?},
3708 {pDU_BSSGP_POSITION_RESPONSE := ?},
3709 {pDU_BSSGP_RAN_INFORMATION := ?},
3710 {pDU_BSSGP_RAN_INFORMATION_REQUEST := ?},
3711 {pDU_BSSGP_RAN_INFORMATION_ACK := ?},
3712 {pDU_BSSGP_RAN_INFORMATION_ERROR := ?},
3713 {pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := ?},
3714 {pDU_BSSGP_MBMS_SESSION_START_REQUEST := ?},
3715 {pDU_BSSGP_MBMS_SESSION_START_RESPONSE := ?},
3716 {pDU_BSSGP_MBMS_SESSION_STOP_REQUEST := ?},
3717 {pDU_BSSGP_MBMS_STOP_RESPONSE := ?},
3718 {pDU_BSSGP_SESSION_UPDATE_REQUEST := ?},
3719 {pDU_BSSGP_SESSION_UPDATE_RESPONSE := ?}
3720 );
3721
3722 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN := (
3723 tr_BSSGP_PERMITTED_SIGN_ONLY,
3724 {pDU_BSSGP_PAGING_PS := ?},
3725 {pDU_BSSGP_PAGING_CS := ?},
3726 {pDU_BSSGP_SUSPEND := ?},
3727 {pDU_BSSGP_STATUS := ?}
3728 );
3729
3730 /* PDU permitted on PTM BVC only (TS 48.018 Section 5.4.1) */
3731 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM_ONLY := (
3732 {pDU_BSSGP_DL_MBMS_UNITDATA := ?},
3733 {pDU_BSSGP_UL_MBMS_UNITDATA := ?}
3734 );
3735
3736 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM := (
3737 tr_BSSGP_PERMITTED_PTM_ONLY,
3738 {pDU_BSSGP_STATUS := ?}
3739 );
3740
3741
3742 /* Template for any PTP BVCI IE */
3743 template (present) BVCI tr_BSSGP_IE_PtpBvci := {
3744 iEI := '04'O,
3745 ext := '1'B,
3746 lengthIndicator := {
3747 length1 := 2
3748 },
3749 unstructured_value := complement ('0000'O, '0001'O)
Harald Welte8f66af12020-11-12 17:27:58 +01003750 }
Harald Welte8f66af12020-11-12 17:27:58 +01003751
Daniel Willmann670bbc02020-11-19 16:39:39 +01003752 /* message on signaling PTP but containing a ptp BVC */
3753 /*
3754 template PDU_BSSGP tr_BSSGP_SIG_FOR_PTP(template Bvci bvci) := (
3755 {pDU_BSSGP_FLUSH_LL:{?,?,tr_BSSGP_IE_PtpBvci, *, *}},
3756 {pDU_BSSGP_FLUSH_LL_ACK:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}},
3757 {pDU_BSSGP_LLC_DISCARDED:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}},
3758 {pDU_BSSGP_BVC_BLOCK:{?,tr_BSSGP_IE_PtpBvci, ?}},
3759 {pDU_BSSGP_BVC_BLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}},
3760 {pDU_BSSGP_BVC_UNBLOCK:{?,tr_BSSGP_IE_PtpBvci}},
3761 {pDU_BSSGP_BVC_UNBLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}},
3762 {pDU_BSSGP_BVC_RESET:{?,tr_BSSGP_IE_PtpBvci,?,*,*,*}},
3763 {pDU_BSSGP_BVC_RESET_ACK:{?,tr_BSSGP_IE_PtpBvci,*,*,*}},
3764 {pDU_BSSGP_STATUS:{?,?,tr_BSSGP_IE_PtpBvci,*}},
3765 {pDU_BSSGP_PERFORM_LOCATION_REQUEST:{?,?,?,*,tr_BSSGP_IE_PtpBvci,?,?,?,*,*,*,*,*,*,*,*,*}},
3766 {pDU_BSSGP_PERFORM_LOCATION_RESPONSE:{?,?,tr_BSSGP_IE_PtpBvci,*,*,*,*,*,*}},
3767 {pDU_BSSGP_PERFORM_LOCATION_ABORT:{?,?,tr_BSSGP_IE_PtpBvci,?}},
3768 {pDU_BSSGP_POSITION_COMMAND:{
3769 );
3770 */
Harald Welte8f66af12020-11-12 17:27:58 +01003771
Daniel Willmann670bbc02020-11-19 16:39:39 +01003772 /* extract the BVCI IE of given PDU + return it */
3773 function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI {
3774 select (pdu) {
3775 case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) {
3776 return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old;
3777 }
3778 case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) {
3779 return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new;
3780 }
3781 case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) {
3782 return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI;
3783 }
3784 case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) {
3785 return pdu.pDU_BSSGP_BVC_BLOCK.bVCI;
3786 }
3787 case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) {
3788 return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI;
3789 }
3790 case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) {
3791 return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI;
3792 }
3793 case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) {
3794 return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI;
3795 }
3796 case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) {
3797 return pdu.pDU_BSSGP_BVC_RESET.bVCI;
3798 }
3799 case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) {
3800 return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI;
3801 }
3802 case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) {
3803 return pdu.pDU_BSSGP_STATUS.bVCI;
3804 }
3805 case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) {
3806 return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI;
3807 }
3808 case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) {
3809 return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI;
3810 }
3811 case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) {
3812 return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI;
3813 }
3814 case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) {
3815 return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI;
3816 }
3817 case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) {
3818 return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI;
3819 }
3820 case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) {
3821 return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI;
3822 }
3823 case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) {
3824 return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI;
3825 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01003826 }
Pau Espin Pedrol7e88ce92021-02-05 16:01:36 +01003827 return omit;
Daniel Willmann670bbc02020-11-19 16:39:39 +01003828 }
Harald Welte8f66af12020-11-12 17:27:58 +01003829
Daniel Willmann670bbc02020-11-19 16:39:39 +01003830 /* extract the BVCI IE of given PDU + convert it to integer value */
3831 function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci {
3832 var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu);
3833 if (istemplatekind(bvci_raw, "omit")) {
3834 return omit;
3835 }
3836 return oct2int(valueof(bvci_raw.unstructured_value));
3837 }
3838
3839 /* 3GPP TS 23.003 2.6 */
3840 type enumerated TlliType {
3841 TLLI_LOCAL,
3842 TLLI_FOREIGN,
3843 TLLI_RANDOM,
3844 TLLI_AUXILIARY,
3845 TLLI_RESERVED,
3846 TLLI_G_RNTI,
3847 TLLI_RAND_G_RNTI
3848 }
3849
3850 /* 3GPP TS 23.003 2.6 */
3851 function f_gprs_tlli_type(OCT4 tlli) return TlliType {
3852 var bitstring tllib := oct2bit(tlli);
3853 if (substr(tllib, 0, 2) == '11'B) {
3854 return TLLI_LOCAL;
3855 } else if (substr(tllib, 0, 2) == '10'B) {
3856 return TLLI_FOREIGN;
3857 } else if (substr(tllib, 0, 5) == '01111'B) {
3858 return TLLI_RANDOM;
3859 } else if (substr(tllib, 0, 4) == '0110'B) {
3860 return TLLI_RESERVED;
3861 } else if (substr(tllib, 0, 3) == '010'B) {
3862 return TLLI_RESERVED;
3863 } else if (substr(tllib, 0, 4) == '0000'B) {
3864 return TLLI_G_RNTI;
3865 } else if (substr(tllib, 0, 4) == '0001'B) {
3866 return TLLI_RAND_G_RNTI;
3867 } else {
Pau Espin Pedrol7e88ce92021-02-05 16:01:36 +01003868 Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
3869 log2str("Unknonw TLLI Type ", tllib));
3870 return TLLI_LOCAL;
Daniel Willmann670bbc02020-11-19 16:39:39 +01003871 }
3872 }
3873
Harald Weltedbd5e672021-01-14 21:03:14 +01003874 /* build a TLLI of specified type from the given (P)TMSI */
3875 function f_gprs_tlli_from_tmsi(OCT4 tmsi, TlliType tlli_type) return OCT4 {
3876 var bitstring tmsi_bits := oct2bit(tmsi);
3877 var bitstring prefix;
3878 select (tlli_type) {
3879 case (TLLI_LOCAL) { prefix := '11'B }
3880 case (TLLI_FOREIGN) { prefix := '01111'B }
3881 case (TLLI_RANDOM) { prefix := '0110'B }
3882 case (TLLI_RESERVED) { prefix := '010'B }
3883 case (TLLI_G_RNTI) { prefix := '0000'B }
3884 case (TLLI_RAND_G_RNTI) { prefix := '0001'B }
3885 case else {
Pau Espin Pedrol7e88ce92021-02-05 16:01:36 +01003886 Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
3887 log2str("Unknonw TLLI Type ", tlli_type));
3888 return '00000000'O;
Harald Weltedbd5e672021-01-14 21:03:14 +01003889 }
3890 }
3891 return bit2oct(prefix & substr(tmsi_bits, lengthof(prefix), 32-lengthof(prefix)));
3892 }
3893
Daniel Willmann670bbc02020-11-19 16:39:39 +01003894 function f_gprs_tlli_random() return OCT4 {
3895 var OCT4 tlli := f_rnd_octstring(4);
3896 return tlli or4b 'c0000000'O;
3897 }
Harald Weltee0abc472018-02-05 09:13:31 +01003898
3899} with { encode "RAW" };