blob: b83131d0c01d1ffff077b9d52417d2fb33d12a81 [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;
8 import from GSM_Types all;
Harald Weltee0abc472018-02-05 09:13:31 +01009 import from BSSGP_Types all
10 import from NS_Types all
Harald Weltef4bf1312018-06-30 11:05:20 +020011 import from Native_Functions all;
Harald Weltee0abc472018-02-05 09:13:31 +010012
13 type uint16_t Nsvci;
14 type uint16_t Nsei;
15 type uint16_t BssgpBvci;
16
17 /* TS 48.016 10.3.7 */
18 type enumerated NsPduType {
19 NS_PDUT_NS_UNITDATA ('00000000'B),
20 NS_PDUT_NS_RESET ('00000010'B),
21 NS_PDUT_NS_RESET_ACK ('00000011'B),
22 NS_PDUT_NS_BLOCK ('00000100'B),
23 NS_PDUT_NS_BLOCK_ACK ('00000101'B),
24 NS_PDUT_NS_UNBLOCK ('00000110'B),
25 NS_PDUT_NS_UNBLOCK_ACK ('00000111'B),
26 NS_PDUT_NS_STATUS ('00001000'B),
27 NS_PDUT_NS_ALIVE ('00001010'B),
28 NS_PDUT_NS_ALIVE_ACK ('00001011'B)
29 /* FIXME: SNS */
30 } with { variant "FIELDLENGTH(8)" };
31
32 /* TS 48.016 10.3 */
33 type enumerated NsIEI {
34 NS_IEI_CAUSE ('00000000'B),
35 NS_IEI_NSVCI ('00000001'B),
36 NS_IEI_NS_PDU ('00000010'B),
37 NS_IEI_BVCI ('00000011'B),
38 NS_IEI_NSEI ('00000100'B),
39 NS_IEI_LIST_IPv4 ('00000101'B),
40 NS_IEI_LIST_IPv6 ('00000110'B),
41 NS_IEI_MAX_NUM_NSVC ('00000111'B),
42 NS_IEI_NUM_IPv4_EP ('00001000'B),
43 NS_IEI_NUM_IPv6_EP ('00001001'B),
44 NS_IEI_RESET_FLAG ('00001010'B),
45 NS_IEI_IP_ADDRESS ('00001011'B)
46 } with { variant "FIELDLENGTH(8)" };
47
48 /* TS 48.016 10.3.2 */
49 type enumerated NsCause {
50 NS_CAUSE_TRANSIT_NETWORK_FAILURE ('00000000'B),
51 NS_CAUSE_OM_INTERVENTION ('00000001'B),
52 NS_CAUSE_EQUIPMENT_FAILURE ('00000010'B),
53 NS_CAUSE_NSVC_BLOCKED ('00000011'B),
54 NS_CAUSE_NSVC_UNKNOWN ('00000100'B),
55 NS_CAUSE_BVCI_UNKNOWN_AT_NSE ('00000101'B),
56 NS_CAUSE_SEMANTICALLY_INCORRECT_PDU ('00001000'B),
57 NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('00001010'B),
58 NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED ('00001011'B),
59 NS_CAUSE_INVALID_ESSENTIAL_IE ('00001100'B),
60 NS_CAUSE_MISSING_ESSENTIAL_IE ('00001101'B),
61 NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS ('00001110'B),
62 NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS ('00001111'B),
63 NS_CAUSE_INVALID_NR_OF_NSVCS ('00010000'B),
64 NS_CAUSE_INVALID_WEIGHTS ('00010001'B),
65 NS_CAUSE_UNKNOWN_IP_ENDPOINT ('00010010'B),
66 NS_CAUSE_UNKNOWN_IP_ADDRESS ('00010011'B),
67 NS_CAUSE_IP_TEST_FAILEDA ('00010100'B)
68 } with { variant "FIELDLENGTH(8)" };
69
Harald Welte387ab372018-06-30 10:27:06 +020070 template (value) NS_SDU_ControlBits t_SduCtrlB := {
Harald Weltee0abc472018-02-05 09:13:31 +010071 rBit := '0'B,
72 cBit := '0'B,
73 spare := '000000'B
74 }
75
Harald Welte387ab372018-06-30 10:27:06 +020076 template (value) CauseNS ts_NS_IE_CAUSE(NsCause cause) := {
77 iEI := '00'O,
78 ext := '1'B,
79 lengthIndicator := {
80 length1 := 1
81 },
82 cause := int2oct(enum2int(valueof(cause)), 1)
83 }
Harald Weltef4bf1312018-06-30 11:05:20 +020084 function ts_NS_IE_CAUSE_omit(template (omit) NsCause cause) return template (omit) CauseNS {
85 var template (omit) CauseNS ret;
86 if (istemplatekind(cause, "omit")) {
87 return omit;
88 } else {
89 ret := {
90 iEI := '00'O,
91 ext := '1'B,
92 lengthIndicator := {
93 length1 := 1
94 },
95 cause := int2oct(enum2int(valueof(cause)), 1)
96 }
97 return ret;
98 }
99 }
Harald Welte387ab372018-06-30 10:27:06 +0200100
101 function tr_NS_IE_CAUSE(template NsCause cause) return template CauseNS {
Harald Weltee0abc472018-02-05 09:13:31 +0100102 var template CauseNS ret;
103 ret.iEI := '00'O;
104 ret.ext := '1'B;
105 ret.lengthIndicator := { length1 := 1 };
Harald Weltef4bf1312018-06-30 11:05:20 +0200106 if (istemplatekind(cause, "omit")) {
107 return omit;
108 } else if (istemplatekind(cause, "*")) {
109 return *;
110 } else if (istemplatekind(cause, "?")) {
Harald Weltee0abc472018-02-05 09:13:31 +0100111 ret.cause := ?
Harald Weltef4bf1312018-06-30 11:05:20 +0200112 } else {
113 ret.cause := int2oct(enum2int(valueof(cause)), 1);
Harald Weltee0abc472018-02-05 09:13:31 +0100114 }
115 return ret;
116 }
117
Harald Welte630d0e62019-02-22 23:26:40 +0100118 function ts_SNS_IP_ADDR(template (omit) IPAddress ip) return template (omit) IP_Address_NS {
119 var template (omit) IP_Address_NS ret;
120 if (istemplatekind(ip, "omit")) {
121 return omit;
122 } else {
123 ret.iEI := '0B'O;
124 ret.ipAddress := ip;
125 if (ischosen(ip.ip4Address)) {
126 ret.addressType := '01'O;
127 } else {
128 ret.addressType := '02'O;
129 }
130 }
131 return ret;
132 }
133 function tr_SNS_IP_ADDR(template IPAddress ip) return template IP_Address_NS {
134 var template IP_Address_NS ret;
135 ret.iEI := '0B'O;
136 if (istemplatekind(ip, "omit")) {
137 return omit;
138 } else if (istemplatekind(ip, "*")) {
139 return *;
140 } else if (istemplatekind(ip, "?")) {
141 return ?;
142 } else {
143 ret.ipAddress := ip;
144 if (ischosen(ip.ip4Address)) {
145 ret.addressType := '01'O;
146 } else {
147 ret.addressType := '02'O;
148 }
149 }
150 return ret;
151 }
152
Harald Weltee0abc472018-02-05 09:13:31 +0100153 private function f_oct_or_wc(template integer inp, integer len) return template octetstring {
Harald Weltef4bf1312018-06-30 11:05:20 +0200154 if (istemplatekind(inp, "omit")) {
155 return omit;
156 } else if (istemplatekind(inp, "*")) {
157 return *;
158 } else if (istemplatekind(inp, "?")) {
159 return ?;
Harald Weltee0abc472018-02-05 09:13:31 +0100160 }
Harald Weltef4bf1312018-06-30 11:05:20 +0200161 return int2oct(valueof(inp), len);
Harald Weltee0abc472018-02-05 09:13:31 +0100162 }
163
Daniel Willmann00c0bbf2020-11-24 18:37:49 +0100164 private function f_hex_or_wc(template integer inp, integer len) return template hexstring {
165 if (istemplatekind(inp, "omit")) {
166 return omit;
167 } else if (istemplatekind(inp, "*")) {
168 return *;
169 } else if (istemplatekind(inp, "?")) {
170 return ?;
171 }
172 return int2hex(valueof(inp), len);
173 }
174
Harald Welte387ab372018-06-30 10:27:06 +0200175 template (value) NS_VCI ts_NS_IE_NSVCI(Nsvci nsvci) := {
176 iEI := '01'O,
177 ext := '1'B,
178 lengthIndicator := {
179 length1 := 2
180 },
181 nS_VCI := int2oct(nsvci, 2)
182 }
183 template NS_VCI tr_NS_IE_NSVCI(template Nsvci nsvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100184 iEI := '01'O,
185 ext := '1'B,
186 lengthIndicator := {
187 length1 := 2
188 },
189 nS_VCI := f_oct_or_wc(nsvci, 2)
190 }
191
Harald Welte387ab372018-06-30 10:27:06 +0200192 template (value) NSEI_NS ts_NS_IE_NSEI(Nsei nsei) := {
193 iEI:= '04'O,
194 ext := '1'B,
195 lengthIndicator := {
196 length1 := 2
197 },
198 nSEI := int2oct(nsei, 2)
199 }
200 template NSEI_NS tr_NS_IE_NSEI(template Nsei nsei) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100201 iEI:= '04'O,
202 ext := '1'B,
203 lengthIndicator := {
204 length1 := 2
205 },
206 nSEI := f_oct_or_wc(nsei, 2)
207 }
208
Harald Weltef4bf1312018-06-30 11:05:20 +0200209 template (value) IP4_Element ts_SNS_IPv4(charstring ip, integer udp_port,
210 uint8_t sig_weight := 1, uint8_t data_weight := 1) := {
211 ipAddress := f_inet_addr(ip),
212 uDP_Port := int2oct(udp_port, 2),
213 signallingWeight := int2oct(sig_weight, 1),
214 dataWeight := int2oct(data_weight, 1)
215 }
216 function tr_SNS_IPv4(template charstring ip, template integer udp_port,
217 template uint8_t sig_weight := ?, template uint8_t data_weight := ?)
218 return template IP4_Element {
219 var template IP4_Element e;
220 if (istemplatekind(ip, "?")) {
221 e.ipAddress := ?;
222 } else {
223 e.ipAddress := f_inet_addr(valueof(ip));
224 }
225 if (istemplatekind(udp_port, "?")) {
226 e.uDP_Port := ?;
227 } else {
228 e.uDP_Port := int2oct(valueof(udp_port), 2);
229 }
230 if (istemplatekind(sig_weight, "?")) {
231 e.signallingWeight := ?;
232 } else {
233 e.signallingWeight := int2oct(valueof(sig_weight), 1);
234 }
235 if (istemplatekind(data_weight, "?")) {
236 e.dataWeight := ?;
237 } else {
238 e.dataWeight := int2oct(valueof(data_weight), 1);
239 }
240 return e;
241 }
242
Alexander Couzens7b1e44f2020-08-25 23:33:17 +0200243 template (value) IP6_Element ts_SNS_IPv6(charstring ip, integer udp_port,
244 uint8_t sig_weight := 1, uint8_t data_weight := 1) := {
245 ipAddress := f_inet6_addr(ip),
246 uDP_Port := int2oct(udp_port, 2),
247 signallingWeight := int2oct(sig_weight, 1),
248 dataWeight := int2oct(data_weight, 1)
249 }
250 function tr_SNS_IPv6(template charstring ip, template integer udp_port,
251 template uint8_t sig_weight := ?, template uint8_t data_weight := ?)
252 return template IP6_Element {
253 var template IP6_Element e;
254 if (istemplatekind(ip, "?")) {
255 e.ipAddress := ?;
256 } else {
257 e.ipAddress := f_inet6_addr(valueof(ip));
258 }
259 if (istemplatekind(udp_port, "?")) {
260 e.uDP_Port := ?;
261 } else {
262 e.uDP_Port := int2oct(valueof(udp_port), 2);
263 }
264 if (istemplatekind(sig_weight, "?")) {
265 e.signallingWeight := ?;
266 } else {
267 e.signallingWeight := int2oct(valueof(sig_weight), 1);
268 }
269 if (istemplatekind(data_weight, "?")) {
270 e.dataWeight := ?;
271 } else {
272 e.dataWeight := int2oct(valueof(data_weight), 1);
273 }
274 return e;
275 }
276
Harald Welte387ab372018-06-30 10:27:06 +0200277
278 template (value) PDU_NS ts_NS_RESET(NsCause cause, Nsvci nsvci, Nsei nsei) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100279 pDU_NS_Reset := {
280 nsPduType := '02'O,
Harald Welte387ab372018-06-30 10:27:06 +0200281 causeNS := ts_NS_IE_CAUSE(cause),
282 nS_VCI := ts_NS_IE_NSVCI(nsvci),
283 nSEI_NS := ts_NS_IE_NSEI(nsei)
284 }
285 }
286 template PDU_NS tr_NS_RESET(template NsCause cause, template Nsvci nsvci, template Nsei nsei) := {
287 pDU_NS_Reset := {
288 nsPduType := '02'O,
289 causeNS := tr_NS_IE_CAUSE(cause),
290 nS_VCI := tr_NS_IE_NSVCI(nsvci),
291 nSEI_NS := tr_NS_IE_NSEI(nsei)
Harald Weltee0abc472018-02-05 09:13:31 +0100292 }
293 }
294
Harald Welte387ab372018-06-30 10:27:06 +0200295 template (value) PDU_NS ts_NS_RESET_ACK(Nsvci nsvci, Nsei nsei) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100296 pDU_NS_Reset_Ack := {
297 nsPduType := '03'O,
Harald Welte387ab372018-06-30 10:27:06 +0200298 nS_VCI := ts_NS_IE_NSVCI(nsvci),
299 nSEI_NS := ts_NS_IE_NSEI(nsei)
300 }
301 }
302 template PDU_NS tr_NS_RESET_ACK(template Nsvci nsvci, template Nsei nsei) := {
303 pDU_NS_Reset_Ack := {
304 nsPduType := '03'O,
305 nS_VCI := tr_NS_IE_NSVCI(nsvci),
306 nSEI_NS := tr_NS_IE_NSEI(nsei)
Harald Weltee0abc472018-02-05 09:13:31 +0100307 }
308 }
309
Harald Welte387ab372018-06-30 10:27:06 +0200310 template (value) PDU_NS ts_NS_BLOCK(NsCause cause, Nsvci nsvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100311 pDU_NS_Block := {
312 nsPduType := '04'O,
Harald Welte387ab372018-06-30 10:27:06 +0200313 causeNS := ts_NS_IE_CAUSE(cause),
314 nS_VCI := ts_NS_IE_NSVCI(nsvci)
315 }
316 }
317 template PDU_NS tr_NS_BLOCK(template NsCause cause, template Nsvci nsvci) := {
318 pDU_NS_Block := {
319 nsPduType := '04'O,
320 causeNS := tr_NS_IE_CAUSE(cause),
321 nS_VCI := tr_NS_IE_NSVCI(nsvci)
Harald Weltee0abc472018-02-05 09:13:31 +0100322 }
323 }
324
Harald Welte387ab372018-06-30 10:27:06 +0200325 template (value) PDU_NS ts_NS_BLOCK_ACK(Nsvci nsvci) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100326 pDU_NS_Block_Ack := {
327 nsPduType := '05'O,
Harald Welte387ab372018-06-30 10:27:06 +0200328 nS_VCI := ts_NS_IE_NSVCI(nsvci)
329 }
330 }
331 template PDU_NS tr_NS_BLOCK_ACK(template Nsvci nsvci) := {
332 pDU_NS_Block_Ack := {
333 nsPduType := '05'O,
334 nS_VCI := tr_NS_IE_NSVCI(nsvci)
Harald Weltee0abc472018-02-05 09:13:31 +0100335 }
336 }
337
338 template PDU_NS t_NS_UNBLOCK := {
339 pDU_NS_Unblock := {
340 nsPduType := '06'O
341 }
342 }
343
344 template PDU_NS t_NS_UNBLOCK_ACK := {
345 pDU_NS_Unblock_Ack := {
346 nsPduType := '07'O
347 }
348 }
349
350 template PDU_NS t_NS_ALIVE := {
351 pDU_NS_Alive := {
352 nsPduType := '0A'O
353 }
354 }
355
356 template PDU_NS t_NS_ALIVE_ACK := {
357 pDU_NS_Alive_Ack := {
358 nsPduType := '0B'O
359 }
360 }
361
Harald Welte387ab372018-06-30 10:27:06 +0200362 template (value) PDU_NS ts_NS_STATUS(NsCause cause, PDU_NS pdu) := {
Harald Weltee0abc472018-02-05 09:13:31 +0100363 pDU_NS_Status := {
364 nsPduType := '08'O,
Harald Welte387ab372018-06-30 10:27:06 +0200365 causeNS := ts_NS_IE_CAUSE(cause),
Harald Weltee0abc472018-02-05 09:13:31 +0100366 nS_VCI := omit,
367 nS_PDU := {
368 iEI := '02'O,
369 ext := '1'B,
370 lengthIndicator := {
371 length1 := 0 /* overwritten */
372 },
373 ns_PDU := enc_PDU_NS(pdu)
374 },
375 bVCI_NS := omit,
376 listofIP4Elements := omit,
377 listofIP6Elements := omit
378 }
379 }
380
Alexander Couzens9843b662020-09-07 05:20:54 +0200381 template PDU_NS tr_NS_STATUS(template NsCause cause) := {
382 pDU_NS_Status := {
383 nsPduType := '08'O,
384 causeNS := tr_NS_IE_CAUSE(cause),
385 nS_VCI := *,
386 nS_PDU := *,
387 bVCI_NS := *,
388 listofIP4Elements := *,
389 listofIP6Elements := *
390 }
391 }
392
Harald Welte387ab372018-06-30 10:27:06 +0200393 template (value) PDU_NS ts_NS_UNITDATA(template (value) NS_SDU_ControlBits bits, BssgpBvci bvci, octetstring sdu) := {
394 pDU_NS_Unitdata := {
395 nsPduType := '00'O,
396 nS_SDU_ControlBits := bits,
397 bVCI := int2oct(bvci, 2),
398 nS_SDU := sdu
399 }
400 }
401 template PDU_NS tr_NS_UNITDATA(template NS_SDU_ControlBits bits, template BssgpBvci bvci, template
Harald Weltee0abc472018-02-05 09:13:31 +0100402octetstring sdu) := {
403 pDU_NS_Unitdata := {
404 nsPduType := '00'O,
405 nS_SDU_ControlBits := bits,
406 bVCI := f_oct_or_wc(bvci, 2),
407 nS_SDU := sdu
408 }
409 }
410
411
Harald Weltef4bf1312018-06-30 11:05:20 +0200412
413 private function ts_num_of_ep(OCT1 iei, template (omit) uint16_t num_ep)
414 return template (omit) NumberOfIP_Endpoints {
415 var template (omit) NumberOfIP_Endpoints t;
416 if (istemplatekind(num_ep, "omit")) {
417 return omit;
418 } else {
419 t.iEI := iei;
420 t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2);
421 return t;
422 }
423 }
424 private function tr_num_of_ep(OCT1 iei, template uint16_t num_ep)
425 return template NumberOfIP_Endpoints {
426 var template NumberOfIP_Endpoints t;
427 if (istemplatekind(num_ep, "omit")) {
428 return omit;
429 } else if (istemplatekind(num_ep, "*")) {
430 return *;
431 } else if (istemplatekind(num_ep, "?")) {
432 return ?;
433 } else {
434 t.iEI := iei;
435 t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2);
436 return t;
437 }
438 }
439
440
441 template (value) ResetFlag ts_SNS_IE_ResetFlag(boolean rst) := {
442 iEI := '0A'O,
443 resetBIT := bool2bit(rst),
444 spare := '0000000'B
445 }
446 template ResetFlag tr_SNS_IE_ResetFlag(template boolean rst) := {
447 iEI := '0A'O,
448 resetBIT := bool2bit_tmpl(rst),
449 spare := '0000000'B
450 }
451
452 template (value) EndFlag ts_SNS_IE_EndFlag(boolean end) := {
453 eBIT := bool2bit(end),
454 spare := '0000000'B
455 }
456 template EndFlag tr_SNS_IE_EndFlag(template boolean end) := {
457 eBIT := bool2bit_tmpl(end),
458 spare := '0000000'B
459 }
460
461 template (value) MaxNumberOfNSVCs ts_SNS_IE_MaxNumOfNSVCs(uint16_t num) := {
462 iEI := '07'O,
463 maxNumberOfNSVCs := int2oct(num, 2)
464 }
465 template MaxNumberOfNSVCs tr_SNS_IE_MaxNumOfNSVCs(template uint16_t num) := {
466 iEI := '07'O,
467 maxNumberOfNSVCs := f_oct_or_wc(num, 2)
468 }
469
470 template (value) PDU_NS ts_SNS_SIZE(Nsei nsei, boolean rst_flag := true,
471 uint16_t max_nsvcs := 2,
472 template (omit) uint16_t num_v4 := 1,
473 template (omit) uint16_t num_v6 := omit) := {
474 pDU_SNS_Size := {
475 nsPduType := '12'O,
476 nSEI_NS := ts_NS_IE_NSEI(nsei),
477 resetFlag := ts_SNS_IE_ResetFlag(rst_flag),
478 maxNumberOfNSVCs := ts_SNS_IE_MaxNumOfNSVCs(max_nsvcs),
479 numberOfIP4_Endpoints := ts_num_of_ep('08'O, num_v4),
480 numberOfIP6_Endpoints := ts_num_of_ep('09'O, num_v6)
481 }
482 }
483 template PDU_NS tr_SNS_SIZE(template Nsei nsei, template boolean rst_flag := ?,
484 template uint16_t max_nsvcs := ?,
485 template uint16_t num_v4 := ?,
486 template uint16_t num_v6 := *) := {
487 pDU_SNS_Size := {
488 nsPduType := '12'O,
489 nSEI_NS := tr_NS_IE_NSEI(nsei),
490 resetFlag := tr_SNS_IE_ResetFlag(rst_flag),
491 maxNumberOfNSVCs := tr_SNS_IE_MaxNumOfNSVCs(max_nsvcs),
492 numberOfIP4_Endpoints := tr_num_of_ep('08'O, num_v4),
493 numberOfIP6_Endpoints := tr_num_of_ep('09'O, num_v6)
494 }
495 }
496
497 template PDU_NS ts_SNS_SIZE_ACK(Nsei nsei, template (omit) NsCause cause) := {
498 pDU_SNS_Size_Ack := {
499 nsPduType := '13'O,
500 nSEI_NS := ts_NS_IE_NSEI(nsei),
501 causeNS := ts_NS_IE_CAUSE_omit(cause)
502 }
503 }
504 template PDU_NS tr_SNS_SIZE_ACK(template Nsei nsei, template NsCause cause) := {
505 pDU_SNS_Size_Ack := {
506 nsPduType := '13'O,
507 nSEI_NS := tr_NS_IE_NSEI(nsei),
508 causeNS := tr_NS_IE_CAUSE(cause)
509 }
510 }
511
512 private function ts_SNS_IE_ListIP4(template (omit) IP4_Elements elem)
513 return template (omit) ListofIP4Elements {
514 var template (omit) ListofIP4Elements r;
515 if (istemplatekind(elem, "omit")) {
516 return omit;
517 } else {
518 r := {
519 iEI := '05'O,
520 ext := '1'B,
521 lengthIndicator := {
522 length1 := 0 /* overwritten */
523 },
524 iP4_Elements := elem
525 }
526 return r;
527 }
528 }
529 private function tr_SNS_IE_ListIP4(template IP4_Elements elem)
530 return template ListofIP4Elements {
531 var template ListofIP4Elements r;
532 if (istemplatekind(elem, "omit")) {
533 return omit;
534 } else {
535 r := {
536 iEI := '05'O,
537 ext := '1'B,
538 lengthIndicator := {
539 length1 := ? /* overwritten */
540 },
541 iP4_Elements := elem
542 }
543 return r;
544 }
545 }
546
547 private function ts_SNS_IE_ListIP6(template (omit) IP6_Elements elem)
548 return template (omit) ListofIP6Elements {
549 var template (omit) ListofIP6Elements r;
550 if (istemplatekind(elem, "omit")) {
551 return omit;
552 } else {
553 r := {
554 iEI := '06'O,
555 ext := '1'B,
556 lengthIndicator := {
557 length1 := 0 /* overwritten */
558 },
559 iP6_Elements := elem
560 }
561 return r;
562 }
563 }
564 private function tr_SNS_IE_ListIP6(template IP6_Elements elem)
565 return template ListofIP6Elements {
566 var template ListofIP6Elements r;
567 if (istemplatekind(elem, "omit")) {
568 return omit;
Harald Welte630d0e62019-02-22 23:26:40 +0100569 } else if (istemplatekind(elem, "*")) {
570 return *;
Harald Weltef4bf1312018-06-30 11:05:20 +0200571 } else {
572 r := {
573 iEI := '06'O,
574 ext := '1'B,
575 lengthIndicator := {
576 length1 := ? /* overwritten */
577 },
578 iP6_Elements := elem
579 }
580 return r;
581 }
582 }
583
584 template (value) PDU_NS ts_SNS_CONFIG(Nsei nsei, boolean end_flag,
Alexander Couzens7b1e44f2020-08-25 23:33:17 +0200585 template (omit) IP4_Elements v4 := omit,
Harald Weltef4bf1312018-06-30 11:05:20 +0200586 template (omit) IP6_Elements v6 := omit) := {
587 pDU_SNS_Config := {
588 nsPduType := '0F'O,
589 endFlag := ts_SNS_IE_EndFlag(end_flag),
590 nSEI_NS := ts_NS_IE_NSEI(nsei),
591 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
592 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
593 }
594 }
595 template PDU_NS tr_SNS_CONFIG(template Nsei nsei, template boolean end_flag,
Alexander Couzens7b1e44f2020-08-25 23:33:17 +0200596 template IP4_Elements v4 := omit,
Harald Weltef4bf1312018-06-30 11:05:20 +0200597 template IP6_Elements v6 := omit) := {
598 pDU_SNS_Config := {
599 nsPduType := '0F'O,
600 endFlag := tr_SNS_IE_EndFlag(end_flag),
601 nSEI_NS := tr_NS_IE_NSEI(nsei),
602 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
603 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
604 }
605 }
606
607 template (value) PDU_NS ts_SNS_CONFIG_ACK(Nsei nsei, template (omit) NsCause cause) := {
608 pDU_SNS_Config_Ack := {
609 nsPduType := '10'O,
610 nSEI_NS := ts_NS_IE_NSEI(nsei),
611 causeNS := ts_NS_IE_CAUSE_omit(cause)
612 }
613 }
614 template PDU_NS tr_SNS_CONFIG_ACK(template Nsei nsei, template NsCause cause) := {
615 pDU_SNS_Config_Ack := {
616 nsPduType := '10'O,
617 nSEI_NS := tr_NS_IE_NSEI(nsei),
618 causeNS := tr_NS_IE_CAUSE(cause)
619 }
620 }
621
Harald Welte630d0e62019-02-22 23:26:40 +0100622 template (value) PDU_NS ts_SNS_ADD(Nsei nsei, uint8_t trans_id,
623 template (omit) IP4_Elements v4,
624 template (omit) IP6_Elements v6 := omit) := {
625 pDU_SNS_Add := {
626 nsPduType := '0D'O,
627 nSEI_NS := ts_NS_IE_NSEI(nsei),
628 transactionID := trans_id,
629 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
630 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
631 }
632 }
633 template PDU_NS tr_SNS_ADD(template Nsei nsei, template uint8_t trans_id,
634 template IP4_Elements v4,
635 template IP6_Elements v6 := omit) := {
636 pDU_SNS_Add := {
637 nsPduType := '0D'O,
638 nSEI_NS := tr_NS_IE_NSEI(nsei),
639 transactionID := trans_id,
640 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
641 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
642 }
643 }
644
645 template (value) PDU_NS ts_SNS_DEL(Nsei nsei, uint8_t trans_id,
646 template (omit) IPAddress ip_sns,
647 template (omit) IP4_Elements v4,
648 template (omit) IP6_Elements v6 := omit) := {
649 pDU_SNS_Delete := {
650 nsPduType := '11'O,
651 nSEI_NS := ts_NS_IE_NSEI(nsei),
652 transactionID := trans_id,
653 iP_Address_NS := ts_SNS_IP_ADDR(ip_sns),
654 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
655 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
656 }
657 }
658 template PDU_NS tr_SNS_DEL(template Nsei nsei, template uint8_t trans_id,
659 template IPAddress ip_sns,
660 template IP4_Elements v4,
661 template IP6_Elements v6 := omit) := {
662 pDU_SNS_Delete := {
663 nsPduType := '11'O,
664 nSEI_NS := tr_NS_IE_NSEI(nsei),
665 transactionID := trans_id,
666 iP_Address_NS := tr_SNS_IP_ADDR(ip_sns),
667 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
668 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
669 }
670 }
671
Harald Welte72099552019-02-23 15:09:22 +0100672 template (value) PDU_NS ts_SNS_CHG_WEIGHT(Nsei nsei, uint8_t trans_id,
673 template (omit) IP4_Elements v4,
674 template (omit) IP6_Elements v6 := omit) := {
675 pDU_SNS_ChangeWeight := {
676 nsPduType := '0E'O,
677 nSEI_NS := ts_NS_IE_NSEI(nsei),
678 transactionID := trans_id,
679 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
680 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
681 }
682 }
683 template PDU_NS tr_SNS_CHG_WEIGHT(template Nsei nsei, template uint8_t trans_id,
684 template IP4_Elements v4,
685 template IP6_Elements v6 := omit) := {
686 pDU_SNS_ChangeWeight := {
687 nsPduType := '0E'O,
688 nSEI_NS := tr_NS_IE_NSEI(nsei),
689 transactionID := trans_id,
690 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
691 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
692 }
693 }
694
Harald Welte630d0e62019-02-22 23:26:40 +0100695
696 template (value) PDU_NS ts_SNS_ACK(Nsei nsei, uint8_t trans_id,
697 template (omit) NsCause cause := omit,
698 template (omit) IP4_Elements v4 := omit,
699 template (omit) IP6_Elements v6 := omit) := {
700 pDU_SNS_Ack := {
701 nsPduType := '0C'O,
702 nSEI_NS := ts_NS_IE_NSEI(nsei),
703 transactionID := trans_id,
704 causeNS := ts_NS_IE_CAUSE_omit(cause),
705 iP_Address_NS := omit,
706 listofIP4Elements := ts_SNS_IE_ListIP4(v4),
707 listofIP6Elements := ts_SNS_IE_ListIP6(v6)
708 }
709 }
710 template PDU_NS tr_SNS_ACK(template Nsei nsei, template uint8_t trans_id := ?,
711 template NsCause cause := omit,
712 template IP4_Elements v4 := *,
713 template IP6_Elements v6 := *) := {
714 pDU_SNS_Ack := {
715 nsPduType := '0C'O,
716 nSEI_NS := tr_NS_IE_NSEI(nsei),
717 transactionID := trans_id,
718 causeNS := tr_NS_IE_CAUSE(cause),
719 iP_Address_NS := omit,
720 listofIP4Elements := tr_SNS_IE_ListIP4(v4),
721 listofIP6Elements := tr_SNS_IE_ListIP6(v6)
722 }
723 }
724
725
726
727
728
729
730
Harald Weltee0abc472018-02-05 09:13:31 +0100731 type record BssgpCellId {
732 RoutingAreaIdentification ra_id,
733 CellIdentity cell_id
734 } with { variant "" };
735
736 type enumerated BssgpCause {
737 BSSGP_CAUSE_PROC_OVERLOAD ('00'H),
738 BSSGP_CAUSE_EQUIMENT_FAILURE ('01'H),
739 BSSGP_CAUSE_TRANSIT_NETWORK_FAILURE ('02'H),
740 BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS ('03'H),
741 BSSGP_CAUSE_UNKNOWN_MS ('04'H),
742 BSSGP_CAUSE_BVCI_UNKNOWN ('05'H),
743 BSSGP_CAUSE_CELL_TRAFFIC_CONGESTION ('06'H),
744 BSSGP_CAUSE_SGSN_CONGESTION ('07'H),
745 BSSGP_CAUSE_OM_INTERVENTION ('08'H),
746 BSSGP_CAUSE_BVCI_BLOCKED ('09'H),
747 BSSGP_CAUSE_PFC_CREATE_FAILURE ('0a'H),
748 BSSGP_CAUSE_PFC_PREEMPTED ('0b'H),
749 BSSGP_CAUSE_ABQP_NO_MORE_SUPPORTED ('0c'H),
750 BSSGP_CAUSE_SEMANTICALLY_INCORRECT_PDU ('20'H),
751 BSSGP_CAUSE_INVALID_MANDATORY_IE ('21'H),
752 BSSGP_CAUSE_MISSING_MANDATORY_IE ('22'H),
753 BSSGP_CAUSE_MISSING_CONDITIONAL_IE ('23'H),
754 BSSGP_CAUSE_UNEXPECTED_CONDITIONAL_IE ('24'H),
755 BSSGP_CAUSE_CONDITIONAL_IE_ERROR ('25'H),
756 BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('26'H),
757 BSSGP_CAUSE_PROTOCOL_ERROR_UNSPECIFIED ('27'H),
758 BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_FEATURE_SET ('28'H),
759 BSSGP_CAUSE_REQUESTED_INFO_NOT_AVAILABLE ('29'H),
760 BSSGP_CAUSE_UNKNOWN_DESTINATION_ADDRESS ('2a'H),
761 BSSGP_CAUSE_UNKNOWN_RIM_APP_IDENTITY ('2b'H),
762 BSSGP_CAUSE_INVALID_CONTAINER_UNIT_INFO ('2c'H),
763 BSSGP_CAUSE_PFC_QUEUING ('2d'H),
764 BSSGP_CAUSE_PFC_CREATED_SUCCESSFULLY ('2e'H),
765 BSSGP_CAUSE_T12_EXPIRY ('2f'H),
766 BSSGP_CAUSE_MS_UNDER_PS_HANDOVER_TREATMENT ('30'H),
767 BSSGP_CAUSE_UPLINK_QUALITY ('31'H),
768 BSSGP_CAUSE_UPLINK_STRENGTH ('32'H),
769 BSSGP_CAUSE_DOWNLINK_QUALITY ('33'H),
770 BSSGP_CAUSE_DOWNLINK_STRENGTH ('34'H),
771 BSSGP_CAUSE_DISTANCE ('35'H),
772 BSSGP_CAUSE_BETTER_CELL ('36'H),
773 BSSGP_CAUSE_TRAFFIC ('37'H),
774 BSSGP_CAUSE_OM_INTERVENTION2 ('38'H),
775 BSSGP_CAUSE_MS_BACK_ON_OLD_CHANNEL ('39'H),
776 BSSGP_CAUSE_T13_EXPIRY ('3a'H),
777 BSSGP_CAUSE_T14_EXPIRY ('3b'H),
778 BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED ('3c'H)
779 } with { variant "FIELDLENGTH(8)" };
780
Daniel Willmann7f1d78e2020-11-24 14:42:40 +0100781 private function t_FLUSH_ACTION(template OCT1 act)
782 return template Flush_Action {
783 var template Flush_Action r;
784 if (istemplatekind(act, "omit")) {
785 return omit;
786 } else if (istemplatekind(act, "*")) {
787 return *;
788 } else {
789 r := {
790 iEI := '0C'O,
791 ext := '1'B,
792 lengthIndicator := {
793 length1 := 1
794 },
795 actionValue := act
796 }
797 return r;
798 }
799 }
800 private function t_NO_OCT_AFF(template integer oct_aff)
801 return template Number_of_octets_affected {
802 var template Number_of_octets_affected r;
803 if (istemplatekind(oct_aff, "omit")) {
804 return omit;
805 } else if (istemplatekind(oct_aff, "*")) {
806 return *;
807 } else {
808 r := {
809 iEI := '25'O,
810 ext := '1'B,
811 lengthIndicator := {
812 length1 := 3
813 },
814 number_of_octets_transfered_or_deleted := f_oct_or_wc(oct_aff, 3)
815 }
816 return r;
817 }
818 }
Harald Weltee0abc472018-02-05 09:13:31 +0100819
Daniel Willmann00c0bbf2020-11-24 18:37:49 +0100820 private function t_LLC_FRAMES_DISCARDED(template integer frames_discarded)
821 return template LLC_Frames_Discarded {
822 var template LLC_Frames_Discarded r;
823 if (istemplatekind(frames_discarded, "omit")) {
824 return omit;
825 } else if (istemplatekind(frames_discarded, "*")) {
826 return *;
827 } else {
828 r := {
829 iEI := '0F'O,
830 ext := '1'B,
831 lengthIndicator := {
Harald Weltec0351d12020-11-27 22:49:02 +0100832 length1 := 1
Daniel Willmann00c0bbf2020-11-24 18:37:49 +0100833 },
834 number_of_frames_discarded := f_hex_or_wc(frames_discarded, 2)
835 }
836 return r;
837 }
838 }
839
Daniel Willmann379fc252020-11-20 18:34:22 +0100840 private function t_BSSGP_BVCI(template BssgpBvci bvci)
841 return template BVCI {
842 var template BVCI r;
843 if (istemplatekind(bvci, "omit")) {
844 return omit;
845 } else if (istemplatekind(bvci, "*")) {
846 return *;
847 } else {
848 r := {
849 iEI := '04'O,
850 ext := '1'B,
851 lengthIndicator := {
852 length1 := 2
853 },
854 unstructured_value := f_oct_or_wc(bvci, 2)
855 }
856 return r;
857 }
858 }
859 private function t_BSSGP_NSEI(template Nsei nsei)
860 return template NSEI_BSSGP {
861 var template NSEI_BSSGP r;
862 if (istemplatekind(nsei, "omit")) {
863 return omit;
864 } else if (istemplatekind(nsei, "*")) {
865 return *;
866 } else {
867 r := {
868 iEI:= '3E'O,
869 ext := '1'B,
870 lengthIndicator := {
871 length1 := 2
872 },
873 nSEI := f_oct_or_wc(nsei, 2)
874 }
875 return r;
876 }
Harald Weltee0abc472018-02-05 09:13:31 +0100877 }
878
Harald Welte23989a62019-03-21 21:32:45 +0100879 template (value) TLLI_BSSGP ts_BSSGP_TLLI(template (value) GprsTlli tlli) := {
880 iEI := '1F'O,
881 ext := '1'B,
882 lengthIndicator := {
883 length1 := 4
884 },
885 tLLI_Value := tlli
886 }
887 template TLLI_BSSGP tr_BSSGP_TLLI(template GprsTlli tlli) := {
888 iEI := '1F'O,
889 ext := '1'B,
890 lengthIndicator := {
891 length1 := 4
892 },
893 tLLI_Value := tlli
894 }
895
896 template (value) Suspend_Reference_Number ts_BSSGP_SUSP_REF(template (value) OCT1 susp_ref) := {
897 iEI := '1D'O,
898 ext := '1'B,
899 lengthIndicator := {
900 length1 := 1
901 },
902 suspend_Reference_Number_value := susp_ref
903 }
904 template Suspend_Reference_Number tr_BSSGP_SUSP_REF(template OCT1 susp_ref) := {
905 iEI := '1D'O,
906 ext := '1'B,
907 lengthIndicator := {
908 length1 := 1
909 },
910 suspend_Reference_Number_value := susp_ref
911 }
912
Harald Weltee0abc472018-02-05 09:13:31 +0100913 template IMSI_BSSGP tr_BSSGP_IMSI(template hexstring imsi) := {
914 iEI := '0D'O,
915 ext := '1'B,
916 lengthIndicator := ?,
917 type_of_Identity := '001'B,
918 oddevenIndicator := ?,
919 digits := imsi
920 }
921
922 template IMSI_BSSGP ts_BSSGP_IMSI(hexstring imsi) := {
923 iEI := '0D'O,
924 ext := '1'B,
925 lengthIndicator := { length1 := 0 /* overwritten */ },
926 type_of_Identity := '001'B,
927 oddevenIndicator := f_hex_is_odd_length(imsi),
928 digits := imsi
929 }
930
Harald Welte0e188242020-11-22 21:46:48 +0100931 template (present) TMSI_BSSGP tr_BSSGP_TMSI(GsmTmsi tmsi) := {
932 iEI := '20'O,
933 ext := '1'B,
934 lengthIndicator := { length1 := 4 },
935 tMSI_Value := int2oct(tmsi, 4)
936 }
937
Harald Weltee0abc472018-02-05 09:13:31 +0100938 template TMSI_BSSGP ts_BSSGP_TMSI(GsmTmsi tmsi) := {
939 iEI := '20'O,
940 ext := '1'B,
941 lengthIndicator := { length1 := 4 },
942 tMSI_Value := int2oct(tmsi, 4)
943 }
944
945 function f_bssgp_length_ind(integer len) return LIN2_2a {
946 var LIN2_2a ret;
947 if (len > 255) {
948 ret := { length2 := len };
949 } else {
950 ret := { length1 := len };
951 }
952 return ret;
953 }
954
955 template LLC_PDU ts_BSSGP_LLC_PDU(octetstring pdu) := {
956 iEI := '0D'O,
957 ext := '1'B,
958 lengthIndicator := f_bssgp_length_ind(lengthof(pdu)),
959 lLC_PDU := pdu
960 }
961
962 template LLC_PDU tr_BSSGP_LLC_PDU(template octetstring pdu := ?) := {
Harald Welte7024baa2018-03-02 23:37:51 +0100963 iEI := '0E'O,
964 ext := ?,
Harald Weltee0abc472018-02-05 09:13:31 +0100965 lengthIndicator := ?,
966 lLC_PDU := pdu
967 }
968
Harald Welte23989a62019-03-21 21:32:45 +0100969 function ts_BSSGP_CAUSE(template (omit) BssgpCause cause) return template (omit) Cause_BSSGP {
970 var template (omit) Cause_BSSGP ret;
971 if (istemplatekind(cause, "omit")) {
972 ret := omit;
973 } else {
974 ret.iEI := '07'O;
975 ret.ext := '1'B;
976 ret.lengthIndicator := { length1 := 1 };
977 ret.cause_Value := int2oct(enum2int(valueof(cause)), 1);
978 }
979 return ret;
980 }
Harald Weltee0abc472018-02-05 09:13:31 +0100981 function t_BSSGP_CAUSE(template BssgpCause cause) return template Cause_BSSGP {
982 var template Cause_BSSGP ret;
Harald Weltebacca282018-03-02 16:03:59 +0100983 ret.iEI := '07'O;
Harald Weltee0abc472018-02-05 09:13:31 +0100984 ret.ext := '1'B;
985 ret.lengthIndicator := { length1 := 1 };
986 if (isvalue(cause)) {
987 ret.cause_Value := int2oct(enum2int(valueof(cause)), 1);
988 } else {
989 ret.cause_Value := ?
990 }
991 return ret;
992 }
993
994 function t_BSSGP_IE_CellId(template BssgpCellId cid) return template Cell_Identifier {
995 var template Cell_Identifier ret := {
996 iEI := '08'O,
997 ext := '1'B,
998 lengthIndicator := { length1 := 8 },
999 mccDigit1 := ?,
1000 mccDigit2 := ?,
1001 mccDigit3 := ?,
1002 mncDigit3 := ?,
1003 mncDigit1 := ?,
1004 mncDigit2 := ?,
1005 lac := ?,
1006 rac := ?,
1007 cI_value := ?
1008 }
1009 if (istemplatekind(cid, "omit")) {
1010 return omit;
1011 } else if (istemplatekind(cid, "*")) {
1012 return *;
1013 } else if (istemplatekind(cid, "?")) {
1014 return ?;
1015 }
1016 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
1017 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
1018 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
1019 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
1020 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
Harald Welte797ab3a2019-03-21 21:33:28 +01001021 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
Harald Welte797ab3a2019-03-21 21:33:28 +01001022 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
Alexander Couzensc7dddbd2019-04-11 19:18:35 +02001023 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
Harald Weltee0abc472018-02-05 09:13:31 +01001024 }
1025 if (isvalue(cid.ra_id.lai.lac)) {
1026 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
1027 }
1028 }
1029 if (isvalue(cid) and isvalue(cid.ra_id)) {
1030 ret.rac := f_oct_or_wc(cid.ra_id.rac, 1);
1031 }
1032 if (isvalue(cid)) {
1033 ret.cI_value := f_oct_or_wc(cid.cell_id, 2);
1034 }
1035 return ret;
1036 }
1037
Daniel Willmann670bbc02020-11-19 16:39:39 +01001038 template (value) Tag ts_BSSGP_IE_Tag(OCT1 tag) := {
1039 iEI := '1E'O,
1040 ext := '1'B,
1041 lengthIndicator := {
1042 length1 := 1
1043 },
1044 unstructured_Value := tag
1045 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001046
Daniel Willmann670bbc02020-11-19 16:39:39 +01001047 template (present) Tag tr_BSSGP_IE_Tag(template (present) OCT1 tag) := {
1048 iEI := '1E'O,
1049 ext := '1'B,
1050 lengthIndicator := {
1051 length1 := 1
1052 },
1053 unstructured_Value := tag
1054 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001055
Daniel Willmann670bbc02020-11-19 16:39:39 +01001056 template (value) RA_Cap_UPD_CAUSE ts_BSSGP_IE_RACU_Cause(template (value) OCT1 cause) := {
1057 iEI := '1A'O,
1058 ext := '1'B,
1059 lengthIndicator := {
1060 length1 := 1
1061 },
1062 rA_CAP_UPD_Cause_value := cause
1063 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001064
Daniel Willmann670bbc02020-11-19 16:39:39 +01001065 template (present) RA_Cap_UPD_CAUSE tr_BSSGP_IE_RACU_Cause(template (present) OCT1 cause) := {
1066 iEI := '1A'O,
1067 ext := '1'B,
1068 lengthIndicator := {
1069 length1 := 1
1070 },
1071 rA_CAP_UPD_Cause_value := cause
1072 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01001073
1074
Harald Weltee0abc472018-02-05 09:13:31 +01001075 template PDU_BSSGP ts_BVC_RESET(BssgpCause cause, BssgpBvci bvci,
1076 template BssgpCellId cell_id) := {
1077 pDU_BSSGP_BVC_RESET := {
1078 bssgpPduType := '22'O,
1079 bVCI := t_BSSGP_BVCI(bvci),
Harald Welte23989a62019-03-21 21:32:45 +01001080 cause := ts_BSSGP_CAUSE(cause),
Harald Weltee0abc472018-02-05 09:13:31 +01001081 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
1082 feature_bitmap := omit,
1083 extended_Feature_Bitmap := omit
1084 }
1085 }
1086
1087 template PDU_BSSGP tr_BVC_RESET(template BssgpCause cause, template BssgpBvci bvci,
1088 template BssgpCellId cell_id) := {
1089 pDU_BSSGP_BVC_RESET := {
1090 bssgpPduType := '22'O,
1091 bVCI := t_BSSGP_BVCI(bvci),
1092 cause := t_BSSGP_CAUSE(cause),
1093 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
1094 feature_bitmap := *,
1095 extended_Feature_Bitmap := *
1096 }
1097 }
1098
1099 template PDU_BSSGP ts_BVC_RESET_ACK(BssgpBvci bvci, template BssgpCellId cell_id) := {
1100 pDU_BSSGP_BVC_RESET_ACK := {
1101 bssgpPduType := '23'O,
1102 bVCI := t_BSSGP_BVCI(bvci),
1103 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
1104 feature_bitmap := omit,
1105 extended_Feature_Bitmap := omit
1106 }
1107 }
1108
1109 template PDU_BSSGP tr_BVC_RESET_ACK(template BssgpBvci bvci, template BssgpCellId cell_id) := {
1110 pDU_BSSGP_BVC_RESET_ACK := {
1111 bssgpPduType := '23'O,
1112 bVCI := t_BSSGP_BVCI(bvci),
1113 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
1114 feature_bitmap := *,
1115 extended_Feature_Bitmap := *
1116 }
1117 }
1118
1119
1120 template PDU_BSSGP t_BVC_UNBLOCK(template BssgpBvci bvci) := {
1121 pDU_BSSGP_BVC_UNBLOCK := {
1122 bssgpPduType := '24'O,
1123 bVCI := t_BSSGP_BVCI(bvci)
1124 }
1125 }
1126
1127 template PDU_BSSGP t_BVC_UNBLOCK_ACK(template BssgpBvci bvci) := {
1128 pDU_BSSGP_BVC_UNBLOCK_ACK := {
1129 bssgpPduType := '25'O,
1130 bVCI := t_BSSGP_BVCI(bvci)
1131 }
1132 }
1133
1134 template PDU_BSSGP t_BVC_BLOCK(template BssgpBvci bvci, template BssgpCause cause) := {
1135 pDU_BSSGP_BVC_BLOCK := {
1136 bssgpPduType := '20'O,
1137 bVCI := t_BSSGP_BVCI(bvci),
1138 cause := t_BSSGP_CAUSE(cause)
1139 }
1140 }
1141
1142 template PDU_BSSGP t_BVC_BLOCK_ACK(template BssgpBvci bvci) := {
1143 pDU_BSSGP_BVC_BLOCK_ACK := {
1144 bssgpPduType := '21'O,
1145 bVCI := t_BSSGP_BVCI(bvci)
1146 }
1147 }
1148
1149 template PDU_BSSGP t_BVC_FC_BVC(uint16_t bmax, uint16_t bucket_leak_rate,
1150 uint16_t bmax_default_ms, uint16_t r_default_ms, OCT1 tag) := {
1151 pDU_BSSGP_FLOW_CONTROL_BVC := {
1152 bssgpPduType := '26'O,
1153 tag := {
1154 iEI := '1E'O,
1155 ext := '1'B,
1156 lengthIndicator := {
Harald Welteedcdd902018-03-02 22:04:54 +01001157 length1 := 1
Harald Weltee0abc472018-02-05 09:13:31 +01001158 },
1159 unstructured_Value := tag
1160 },
1161 bVC_Bucket_Size := {
1162 iEI := '05'O,
1163 ext := '1'B,
1164 lengthIndicator := {
1165 length1 := 2
1166 },
1167 bmax := f_oct_or_wc(bmax, 2)
1168 },
1169 bucket_Leak_Rate := {
1170 iEI := '03'O,
1171 ext := '1'B,
1172 lengthIndicator := {
Harald Welteedcdd902018-03-02 22:04:54 +01001173 length1 := 2
Harald Weltee0abc472018-02-05 09:13:31 +01001174 },
1175 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
1176 },
1177 bmax_default_MS := {
1178 iEI := '01'O,
1179 ext := '1'B,
1180 lengthIndicator := {
1181 length1 := 2
1182 },
1183 bmax := f_oct_or_wc(bmax_default_ms, 2)
1184 },
1185 r_default_MS := {
1186 iEI := '1C'O,
1187 ext := '1'B,
1188 lengthIndicator := {
1189 length1 := 2
1190 },
1191 r_default_MS_value := f_oct_or_wc(r_default_ms, 2)
1192 },
1193 bucket_Full_Ratio := omit,
1194 bVC_Measurement := omit,
1195 flow_Control_Granularity := omit
1196 }
1197 }
Harald Welteedcdd902018-03-02 22:04:54 +01001198 template PDU_BSSGP tr_BVC_FC_BVC(template uint16_t bmax := ?,
1199 template uint16_t bucket_leak_rate := ?,
1200 template uint16_t bmax_default_ms := ?,
1201 template uint16_t r_default_ms := ?,
1202 template OCT1 tag := ?) := {
1203 pDU_BSSGP_FLOW_CONTROL_BVC := {
1204 bssgpPduType := '26'O,
1205 tag := {
1206 iEI := '1E'O,
1207 ext := '1'B,
1208 lengthIndicator := {
1209 length1 := 1
1210 },
1211 unstructured_Value := tag
1212 },
1213 bVC_Bucket_Size := {
1214 iEI := '05'O,
1215 ext := '1'B,
1216 lengthIndicator := {
1217 length1 := 2
1218 },
1219 bmax := f_oct_or_wc(bmax, 2)
1220 },
1221 bucket_Leak_Rate := {
1222 iEI := '03'O,
1223 ext := '1'B,
1224 lengthIndicator := {
1225 length1 := 2
1226 },
1227 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
1228 },
1229 bmax_default_MS := {
1230 iEI := '01'O,
1231 ext := '1'B,
1232 lengthIndicator := {
1233 length1 := 2
1234 },
1235 bmax := f_oct_or_wc(bmax_default_ms, 2)
1236 },
1237 r_default_MS := {
1238 iEI := '1C'O,
1239 ext := '1'B,
1240 lengthIndicator := {
1241 length1 := 2
1242 },
1243 r_default_MS_value := f_oct_or_wc(r_default_ms, 2)
1244 },
1245 bucket_Full_Ratio := *,
1246 bVC_Measurement := *,
1247 flow_Control_Granularity := *
1248 }
1249 }
1250
Harald Weltee0abc472018-02-05 09:13:31 +01001251 template PDU_BSSGP t_BVC_FC_BVC_ACK(template OCT1 tag) := {
1252 pDU_BSSGP_FLOW_CONTROL_BVC_ACK := {
1253 bssgpPduType := '27'O,
1254 tag := {
1255 iEI := '1E'O,
1256 ext := '1'B,
1257 lengthIndicator := {
Harald Welte86bdcaa2020-12-09 15:05:32 +01001258 length1 := 1
Harald Weltee0abc472018-02-05 09:13:31 +01001259 },
1260 unstructured_Value := tag
1261 }
1262 }
1263 }
1264
Harald Weltecc3894b2020-12-09 16:50:12 +01001265 template (value) PDU_BSSGP ts_BVC_FC_MS(GprsTlli tlli, uint16_t bmax, uint16_t bucket_leak_rate,
1266 OCT1 tag) := {
1267 pDU_BSSGP_FLOW_CONTROL_MS := {
1268 bssgpPduType := '28'O,
1269 tLLI := ts_BSSGP_TLLI(tlli),
1270 tag := {
1271 iEI := '1E'O,
1272 ext := '1'B,
1273 lengthIndicator := {
1274 length1 := 1
1275 },
1276 unstructured_Value := tag
1277 },
1278 mS_Bucket_Size := {
1279 iEI := '12'O,
1280 ext := '1'B,
1281 lengthIndicator := {
1282 length1 := 2
1283 },
1284 bmax := f_oct_or_wc(bmax, 2)
1285 },
1286 bucket_Leak_Rate := {
1287 iEI := '03'O,
1288 ext := '1'B,
1289 lengthIndicator := {
1290 length1 := 2
1291 },
1292 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
1293 },
1294 bucket_Full_Ratio := omit,
1295 flow_Control_Granularity := omit
1296 }
1297 }
1298 template (present) PDU_BSSGP tr_BVC_FC_MS(template (present) GprsTlli tlli := ?,
1299 template (present) uint16_t bmax := ?,
1300 template (present) uint16_t bucket_leak_rate := ?,
1301 template (present) OCT1 tag := ?) := {
1302 pDU_BSSGP_FLOW_CONTROL_MS := {
1303 bssgpPduType := '28'O,
1304 tLLI := ts_BSSGP_TLLI(tlli),
1305 tag := {
1306 iEI := '1E'O,
1307 ext := '1'B,
1308 lengthIndicator := {
1309 length1 := 1
1310 },
1311 unstructured_Value := tag
1312 },
1313 mS_Bucket_Size := {
1314 iEI := '12'O,
1315 ext := '1'B,
1316 lengthIndicator := {
1317 length1 := 2
1318 },
1319 bmax := f_oct_or_wc(bmax, 2)
1320 },
1321 bucket_Leak_Rate := {
1322 iEI := '03'O,
1323 ext := '1'B,
1324 lengthIndicator := {
1325 length1 := 2
1326 },
1327 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
1328 },
1329 bucket_Full_Ratio := *,
1330 flow_Control_Granularity := *
1331 }
1332 }
1333
1334 template (value) PDU_BSSGP ts_BVC_FC_MS_ACK(template (value) GprsTlli tlli,
1335 template (value) OCT1 tag) := {
1336
1337 pDU_BSSGP_FLOW_CONTROL_MS_ACK := {
1338 bssgpPduType := '29'O,
1339 tLLI := ts_BSSGP_TLLI(tlli),
1340 tag := {
1341 iEI := '1E'O,
1342 ext := '1'B,
1343 lengthIndicator := {
1344 length1 := 1
1345 },
1346 unstructured_Value := tag
1347 }
1348 }
1349 }
1350 template (present) PDU_BSSGP tr_BVC_FC_MS_ACK(template (present) GprsTlli tlli,
1351 template (present) OCT1 tag := ?) := {
1352
1353 pDU_BSSGP_FLOW_CONTROL_MS_ACK := {
1354 bssgpPduType := '29'O,
1355 tLLI := tr_BSSGP_TLLI(tlli),
1356 tag := {
1357 iEI := '1E'O,
1358 ext := '1'B,
1359 lengthIndicator := {
1360 length1 := 1
1361 },
1362 unstructured_Value := tag
1363 }
1364 }
1365 }
1366
Harald Weltee0abc472018-02-05 09:13:31 +01001367 template PDU_BSSGP ts_BSSGP_STATUS(template BssgpBvci bvci, template BssgpCause cause,
1368 PDU_BSSGP pdu) := {
1369 pDU_BSSGP_STATUS := {
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001370 bssgpPduType := '41'O,
Harald Weltee0abc472018-02-05 09:13:31 +01001371 cause := t_BSSGP_CAUSE(cause),
1372 bVCI := t_BSSGP_BVCI(bvci),
1373 pDU_in_Error := {
1374 iEI := '15'O,
1375 ext := '1'B,
1376 lengthIndicator := {
1377 length1 := 0 /* overwritten */
1378 },
1379 erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu)
1380 }
1381 }
1382 }
1383
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001384 template PDU_BSSGP tr_BSSGP_STATUS(template BVCI bvci := ?, template BssgpCause cause := ?,
1385 template octetstring pdu := ?) := {
1386 pDU_BSSGP_STATUS := {
1387 bssgpPduType := '41'O,
1388 cause := t_BSSGP_CAUSE(cause),
1389 bVCI := bvci,
1390 pDU_in_Error := {
1391 iEI := '15'O,
1392 ext := '1'B,
1393 lengthIndicator := {
1394 length1 := ?
1395 },
1396 erroneous_BSSGP_PDU := pdu
1397 }
1398 }
1399 }
1400
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001401 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 +01001402 if (istemplatekind(mscap_gprs, "omit")) {
1403 return '0'B;
1404 }
1405 return '1'B;
1406 }
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001407 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 +01001408 if (istemplatekind(mscap_egprs, "omit")) {
1409 return '0'B;
1410 }
1411 return '1'B;
1412 }
1413 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) := {
1414 mSRACapabilityValues := {
1415 mSRACapabilityValuesExclude1111 := {
1416 accessTechnType := att, /* E-GSM */
1417 accessCapabilities := {
1418 lengthIndicator := 0, /* overwritten */
1419 accessCapabilities := {
1420 rfPowerCapability := '001'B, /* FIXME */
1421 presenceBitA5 := '0'B,
1422 a5bits := omit,
1423 esind := '1'B,
1424 psbit := '0'B,
1425 vgcs := '0'B,
1426 vbs := '0'B,
1427 presenceBitMultislot := '1'B,
1428 multislotcap := {
1429 presenceBitHscsd := '0'B,
1430 hscsdmultislotclass := omit,
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001431 presenceBitGprs := f_presence_bit_MultislotCap_GPRS_BSSGP(mscap_gprs),
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001432 gprsmultislot := mscap_gprs,
1433 presenceBitSms := '0'B,
1434 multislotCap_SMS := omit,
1435 multislotCapAdditionsAfterRel97 := {
1436 presenceBitEcsdmulti := '0'B,
1437 ecsdmultislotclass := omit,
Pau Espin Pedrol1860bf82020-04-25 16:23:35 +02001438 presenceBitEgprsmulti := f_presence_bit_MultislotCap_EGPRS_BSSGP(mscap_egprs),
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001439 multislotCap_EGPRS := mscap_egprs,
1440 presenceBitDtmGprsmulti := '0'B,
1441 multislotCapdtmgprsmultislotsubclass := omit
1442 }
1443 },
1444 accessCapAdditionsAfterRel97 := omit
1445 },
1446 spare_bits := omit
1447 }
1448 }
1449 },
1450 presenceBitMSRACap := '0'B
1451 };
Harald Welte6dc2ac42020-11-16 09:16:17 +01001452 template (present) MSRACapabilityValuesRecord_BSSGP
1453 tr_RaCapRec_BSSGP(template (present) BIT4 att := '0001'B /* E-GSM */, template MultislotCap_GPRS_BSSGP mscap_gprs := *,
1454 template MultislotCap_EGPRS_BSSGP mscap_egprs := *) := {
1455 mSRACapabilityValues := {
1456 mSRACapabilityValuesExclude1111 := {
1457 accessTechnType := att, /* E-GSM */
1458 accessCapabilities := {
1459 lengthIndicator := ?, /* overwritten */
1460 accessCapabilities := {
1461 rfPowerCapability := '001'B, /* FIXME */
1462 presenceBitA5 := ?,
1463 a5bits := *,
1464 esind := '1'B,
1465 psbit := '0'B,
1466 vgcs := '0'B,
1467 vbs := '0'B,
1468 presenceBitMultislot := '1'B,
1469 multislotcap := {
1470 presenceBitHscsd := '0'B,
1471 hscsdmultislotclass := omit,
1472 presenceBitGprs := ?,
1473 gprsmultislot := mscap_gprs,
1474 presenceBitSms := '0'B,
1475 multislotCap_SMS := omit,
1476 multislotCapAdditionsAfterRel97 := {
1477 presenceBitEcsdmulti := '0'B,
1478 ecsdmultislotclass := *,
1479 presenceBitEgprsmulti := ?,
1480 multislotCap_EGPRS := mscap_egprs,
1481 presenceBitDtmGprsmulti := ?,
1482 multislotCapdtmgprsmultislotsubclass := *
1483 }
1484 },
1485 accessCapAdditionsAfterRel97 := *
1486 },
1487 spare_bits := *
1488 }
1489 }
1490 },
1491 presenceBitMSRACap := '0'B
1492 };
1493
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001494
Harald Weltee0abc472018-02-05 09:13:31 +01001495 template QoS_Profile_V t_defaultQos := {
1496 peak_Bit_Rate := int2oct(80, 2),
1497 precedence := '000'B,
1498 a_bit := '0'B,
1499 t_bit := '0'B,
1500 c_r_bit := '0'B,
1501 peakBitRateGranularity := '00'B
1502 }
1503
1504 template QoS_Profile ts_QoS_TLV(template QoS_Profile_V qos) := {
1505 iEI := '18'O,
1506 ext := '1'B,
1507 lengthIndicator := { length1 := 3 },
1508 peak_Bit_Rate := qos.peak_Bit_Rate,
1509 precedence := qos.precedence,
1510 a_bit := qos.a_bit,
1511 t_bit := qos.t_bit,
1512 c_r_bit := qos.c_r_bit,
1513 peakBitRateGranularity := qos.peakBitRateGranularity
1514 }
1515
1516 template PDU_Lifetime t_DefaultLifetime(uint16_t delay := 65535) := {
1517 iEI := '16'O,
1518 ext := '1'B,
1519 lengthIndicator := {
1520 length1 := 2
1521 },
1522 delay_Value := f_oct_or_wc(delay, 2)
1523 }
1524
Pau Espin Pedrol88bf5372019-12-09 21:12:28 +01001525 template DRX_Parameters t_defaultDRXparam := {
1526 iEI := '0A'O,
1527 ext := '1'B,
1528 lengthIndicator := {
1529 length1 := 2
1530 },
1531 splitPG_CycleCode := '00'O,
1532 nonDRXTimer := '000'B,
1533 splitOnCCCH := '0'B,
1534 cnSpecificDRXCycleLength := '0000'B
1535 }
1536
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001537 function ts_BSSGP_IE_MSRAcap_omit(template (omit) MSRadioAccessCapabilityV_BSSGP racap) return template (omit) MS_Radio_Access_Capability {
1538 var template (omit) MS_Radio_Access_Capability ret;
1539 if (istemplatekind(racap, "omit")) {
1540 return omit;
1541 } else {
1542 ret := {
Harald Welte6dc2ac42020-11-16 09:16:17 +01001543 iEI := '13'O,
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001544 ext := '1'B,
1545 lengthIndicator := {
1546 length1 := 1
1547 },
1548 mSRadioAccessCapabilityV_BSSGP := racap
1549 }
1550 return ret;
1551 }
1552 }
1553
Harald Welte6dc2ac42020-11-16 09:16:17 +01001554 function tr_BSSGP_IE_MSRAcap(template MSRadioAccessCapabilityV_BSSGP racap) return template MS_Radio_Access_Capability {
1555 var template MS_Radio_Access_Capability ret;
1556 if (istemplatekind(racap, "omit")) {
1557 return omit;
1558 } else {
1559 ret := {
1560 iEI := '13'O,
1561 ext := ?,
1562 lengthIndicator := ?,
1563 mSRadioAccessCapabilityV_BSSGP := racap
1564 }
1565 return ret;
1566 }
1567 }
1568
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001569 template PDU_BSSGP ts_BSSGP_DL_UD(GprsTlli tlli, octetstring pdu,
1570 template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit,
1571 template (omit) IMSI_BSSGP imsi := omit) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001572 pDU_BSSGP_DL_UNITDATA := {
1573 bssgpPduType := '00'O,
Harald Welteacc93ab2018-03-02 21:39:09 +01001574 tLLI_current := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +01001575 qoS_Profile := t_defaultQos,
1576 pDU_Lifetime := t_DefaultLifetime(65535),
Pau Espin Pedrol2422d1f2020-01-23 17:51:04 +01001577 mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap),
Harald Weltee0abc472018-02-05 09:13:31 +01001578 priority := omit,
1579 dRX_Parameters := omit,
Pau Espin Pedrolc03eb122020-08-27 18:54:24 +02001580 iMSI := imsi,
Harald Weltee0abc472018-02-05 09:13:31 +01001581 tLLI_old := omit,
1582 pFI := omit,
1583 lSA_Information := omit,
1584 service_UTRAN_CCO := omit,
1585 service_Class_Indicator := omit,
1586 subscriber_Profile_ID_For_RAT_Priority := omit,
1587 redirection_Indication := omit,
1588 redirection_Completed := omit,
1589 unconfirmed_Send_State_Variable := omit,
1590 sCI := omit,
1591 gGSN_PGW_Location := omit,
1592 eDRX_Paremeters := omit,
1593 old_Routing_Area_Identification := omit,
1594 attach_Indicator := omit,
1595 alignment_octets := omit,
1596 lLC_PDU := ts_BSSGP_LLC_PDU(pdu),
1597 initialLLC_PDU := omit
1598 }
1599 }
1600
Harald Welte2436fb52020-11-15 22:38:47 +01001601 template PDU_BSSGP tr_BSSGP_DL_UD(template (present) GprsTlli tlli, template (present) octetstring pdu,
1602 template IMSI_BSSGP imsi := omit) := {
Harald Weltee0abc472018-02-05 09:13:31 +01001603 pDU_BSSGP_DL_UNITDATA := {
1604 bssgpPduType := '00'O,
Harald Welte2436fb52020-11-15 22:38:47 +01001605 tLLI_current := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +01001606 qoS_Profile := ?,
1607 pDU_Lifetime := ?,
1608 mS_Radio_Access_Capability := *,
1609 priority := *,
1610 dRX_Parameters := *,
Harald Welte2436fb52020-11-15 22:38:47 +01001611 iMSI := imsi,
Harald Weltee0abc472018-02-05 09:13:31 +01001612 tLLI_old := *,
1613 pFI := *,
1614 lSA_Information := *,
1615 service_UTRAN_CCO := *,
1616 service_Class_Indicator := *,
1617 subscriber_Profile_ID_For_RAT_Priority := *,
1618 redirection_Indication := *,
1619 redirection_Completed := *,
1620 unconfirmed_Send_State_Variable := *,
1621 sCI := *,
1622 gGSN_PGW_Location := *,
1623 eDRX_Paremeters := *,
1624 old_Routing_Area_Identification := *,
1625 attach_Indicator := *,
1626 alignment_octets := *,
Harald Welte2436fb52020-11-15 22:38:47 +01001627 lLC_PDU := tr_BSSGP_LLC_PDU(pdu),
Harald Weltee0abc472018-02-05 09:13:31 +01001628 initialLLC_PDU := *
1629 }
1630 }
1631
Harald Welteacc93ab2018-03-02 21:39:09 +01001632 template PDU_BSSGP ts_BSSGP_UL_UD(GprsTlli tlli, BssgpCellId cell_id, octetstring payload) := {
Harald Welte78d9f272018-02-16 18:13:45 +01001633 pDU_BSSGP_UL_UNITDATA := {
1634 bssgpPduType := '01'O,
1635 tLLI := tlli,
1636 qoS_Profile := t_defaultQos,
1637 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
1638 pFI := omit,
1639 lSA_Identifier_List := omit,
1640 redirect_Attempt_Flag := omit,
1641 iMSI_BSSGP := omit,
1642 unconfirmed_Send_State_Variable := omit,
1643 selected_PLMN_ID := omit,
1644 selected_Operator := omit,
1645 cS_Registered_Operator := omit,
1646 alignment_octets := omit,
1647 lLC_PDU := ts_BSSGP_LLC_PDU(payload)
1648 }
1649 }
1650
Harald Weltee0abc472018-02-05 09:13:31 +01001651 template PDU_BSSGP tr_BSSGP_UL_UD(template GprsTlli tlli := ?, template BssgpCellId cell_id := ?,
1652 template octetstring payload := ?) := {
1653 pDU_BSSGP_UL_UNITDATA := {
1654 bssgpPduType := '01'O,
Harald Welteacc93ab2018-03-02 21:39:09 +01001655 tLLI := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +01001656 qoS_Profile := ?,
1657 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
1658 pFI := *,
1659 lSA_Identifier_List := *,
1660 redirect_Attempt_Flag := *,
1661 iMSI_BSSGP := *,
1662 unconfirmed_Send_State_Variable := *,
1663 selected_PLMN_ID := *,
1664 selected_Operator := *,
1665 cS_Registered_Operator := *,
1666 alignment_octets := *,
1667 lLC_PDU := tr_BSSGP_LLC_PDU(payload)
1668 }
1669 }
1670
Pau Espin Pedrol88bf5372019-12-09 21:12:28 +01001671 template PDU_BSSGP tr_BSSGP_CS_PAGING(BssgpBvci bvci) := {
1672 pDU_BSSGP_PAGING_CS := {
1673 bssgpPduType := '07'O,
1674 iMSI := ?,
1675 dRX_Parameters := ?,
1676 paging_Field4 := {
1677 bVCI := t_BSSGP_BVCI(bvci)
1678 },
1679 tLLI := *,
1680 channel_needed := *,
1681 eMLPP_Priority := *,
1682 tMSI := *,
1683 global_CN_Id := *
1684 }
1685 }
1686
1687 template PDU_BSSGP ts_BSSGP_CS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := {
1688 pDU_BSSGP_PAGING_CS := {
1689 bssgpPduType := '07'O,
1690 iMSI := ts_BSSGP_IMSI(imsi),
1691 dRX_Parameters := t_defaultDRXparam,
1692 paging_Field4 := {
1693 bVCI := t_BSSGP_BVCI(bvci)
1694 },
1695 tLLI := omit,
1696 channel_needed := omit,
1697 eMLPP_Priority := omit,
1698 tMSI := omit,
1699 global_CN_Id := omit
1700 }
1701 }
1702
Vadim Yanitskiy7b224212020-03-26 02:43:55 +07001703 template PDU_BSSGP ts_BSSGP_CS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := {
1704 pDU_BSSGP_PAGING_CS := {
1705 bssgpPduType := '07'O,
1706 iMSI := ts_BSSGP_IMSI(imsi),
1707 dRX_Parameters := t_defaultDRXparam,
1708 paging_Field4 := {
1709 bVCI := t_BSSGP_BVCI(bvci)
1710 },
1711 tLLI := omit,
1712 channel_needed := omit,
1713 eMLPP_Priority := omit,
1714 tMSI := ts_BSSGP_TMSI(tmsi),
1715 global_CN_Id := omit
1716 }
1717 }
1718
Harald Weltea36b2462020-06-17 22:11:08 +02001719 template PDU_BSSGP tr_BSSGP_PS_PAGING(template BssgpBvci bvci) := {
Harald Welte78d9f272018-02-16 18:13:45 +01001720 pDU_BSSGP_PAGING_PS := {
1721 bssgpPduType := '06'O,
1722 iMSI := ?,
1723 dRX_Parameters := *,
1724 paging_Field4 := {
1725 bVCI := t_BSSGP_BVCI(bvci)
1726 },
1727 pFI := *,
1728 aBQP := *,
1729 qoS_Profile := ?,
1730 pTMSI := *,
1731 eDRX_Paremeters := *
1732 }
1733 }
1734
Harald Weltee0abc472018-02-05 09:13:31 +01001735 template PDU_BSSGP ts_BSSGP_PS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := {
1736 pDU_BSSGP_PAGING_PS := {
1737 bssgpPduType := '06'O,
1738 iMSI := ts_BSSGP_IMSI(imsi),
1739 dRX_Parameters := omit,
1740 paging_Field4 := {
1741 bVCI := t_BSSGP_BVCI(bvci)
1742 },
1743 pFI := omit,
1744 aBQP := omit,
1745 qoS_Profile := ts_QoS_TLV(t_defaultQos),
1746 pTMSI := omit,
1747 eDRX_Paremeters := omit
1748 }
1749 }
1750
1751 template PDU_BSSGP ts_BSSGP_PS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := {
1752 pDU_BSSGP_PAGING_PS := {
1753 bssgpPduType := '06'O,
1754 iMSI := ts_BSSGP_IMSI(imsi),
1755 dRX_Parameters := omit,
1756 paging_Field4 := {
1757 bVCI := t_BSSGP_BVCI(bvci)
1758 },
1759 pFI := omit,
1760 aBQP := omit,
1761 qoS_Profile := ts_QoS_TLV(t_defaultQos),
1762 pTMSI := ts_BSSGP_TMSI(tmsi),
1763 eDRX_Paremeters := omit
1764 }
1765 }
1766
Harald Welte0e188242020-11-22 21:46:48 +01001767 template (value) Paging_Field4 ts_BssgpP4BssArea := {
1768 bSS_Area_Indication := {
1769 iEI := '02'O,
1770 ext := '1'B,
1771 lengthIndicator := {
1772 length1 := 1
1773 },
1774 bSS_indicator := '00'O
1775 }
1776 }
1777
1778 template (value) Paging_Field4 ts_BssgpP4LAC(GSM_Types.LocationAreaIdentification lai) := {
1779 location_Area := ts_BSSGP_LA_ID(lai)
1780 }
1781
1782 template (value) Paging_Field4 ts_BssgpP4RAC(GSM_Types.RoutingAreaIdentification rai) := {
1783 routeing_Area := ts_BSSGP_RA_ID(rai)
1784 }
1785
1786 template (value) Paging_Field4 ts_BssgpP4Bvci(BssgpBvci bvci) := {
1787 bVCI := t_BSSGP_BVCI(bvci)
1788 }
1789
1790 template (value) Location_Area ts_BSSGP_LA_ID(GSM_Types.LocationAreaIdentification input) := {
1791 iEI := '10'O,
1792 ext := '1'B,
1793 lengthIndicator := {
1794 length1 := 5
1795 },
1796 mccDigit1 := input.mcc_mnc[0],
1797 mccDigit2 := input.mcc_mnc[1],
1798 mccDigit3 := input.mcc_mnc[2],
1799 mncDigit3 := input.mcc_mnc[3],
1800 mncDigit1 := input.mcc_mnc[4],
1801 mncDigit2 := input.mcc_mnc[5],
1802 lac := int2oct(input.lac, 2)
1803 }
1804
1805 template (value) Routeing_Area ts_BSSGP_RA_ID(GSM_Types.RoutingAreaIdentification input) := {
Harald Welte23989a62019-03-21 21:32:45 +01001806 iEI := '1B'O,
1807 ext := '1'B,
1808 lengthIndicator := {
1809 length1 := 6
1810 },
1811 mccDigit1 := input.lai.mcc_mnc[0],
1812 mccDigit2 := input.lai.mcc_mnc[1],
1813 mccDigit3 := input.lai.mcc_mnc[2],
1814 mncDigit3 := input.lai.mcc_mnc[3],
1815 mncDigit1 := input.lai.mcc_mnc[4],
1816 mncDigit2 := input.lai.mcc_mnc[5],
1817 lac := int2oct(input.lai.lac, 2),
1818 rac := int2oct(input.rac, 1)
1819 }
1820
1821 template (value) PDU_BSSGP ts_BSSGP_SUSPEND(GprsTlli tlli, RoutingAreaIdentification ra_id) := {
1822 pDU_BSSGP_SUSPEND := {
1823 bssgpPduType := '0B'O,
1824 tLLI := ts_BSSGP_TLLI(tlli),
1825 routeing_Area := ts_BSSGP_RA_ID(ra_id)
1826 }
1827 }
1828 template PDU_BSSGP tr_BSSGP_SUSPEND(template GprsTlli tlli, RoutingAreaIdentification ra_id) := {
1829 pDU_BSSGP_SUSPEND := {
1830 bssgpPduType := '0B'O,
1831 tLLI := tr_BSSGP_TLLI(tlli),
1832 routeing_Area := ts_BSSGP_RA_ID(ra_id)
1833 }
1834 }
1835
1836 template (value) PDU_BSSGP ts_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
1837 template (value) OCT1 susp_ref) := {
1838 pDU_BSSGP_SUSPEND_ACK := {
1839 bssgpPduType := '0C'O,
1840 tLLI := ts_BSSGP_TLLI(tlli),
1841 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1842 suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref)
1843 }
1844 }
1845 template PDU_BSSGP tr_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
1846 template OCT1 susp_ref) := {
1847 pDU_BSSGP_SUSPEND_ACK := {
1848 bssgpPduType := '0C'O,
1849 tLLI := tr_BSSGP_TLLI(tlli),
1850 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1851 suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref)
1852 }
1853 }
1854
1855 template (value) PDU_BSSGP ts_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
1856 template (omit) BssgpCause cause) := {
1857 pDU_BSSGP_SUSPEND_NACK := {
1858 bssgpPduType := '0D'O,
1859 tLLI := ts_BSSGP_TLLI(tlli),
1860 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1861 cause := ts_BSSGP_CAUSE(cause)
1862 }
1863 }
1864 template PDU_BSSGP tr_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
1865 template BssgpCause cause) := {
1866 pDU_BSSGP_SUSPEND_NACK := {
1867 bssgpPduType := '0D'O,
1868 tLLI := tr_BSSGP_TLLI(tlli),
1869 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1870 cause := t_BSSGP_CAUSE(cause)
1871 }
1872 }
1873
1874
1875
1876 template (value) PDU_BSSGP ts_BSSGP_RESUME(GprsTlli tlli, RoutingAreaIdentification ra_id,
1877 OCT1 susp_ref) := {
1878 pDU_BSSGP_RESUME := {
1879 bssgpPduType := '0E'O,
1880 tLLI := ts_BSSGP_TLLI(tlli),
1881 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1882 suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref)
1883 }
1884 }
1885 template PDU_BSSGP tr_BSSGP_RESUME(template GprsTlli tlli, RoutingAreaIdentification ra_id,
1886 template OCT1 susp_ref) := {
1887 pDU_BSSGP_RESUME := {
1888 bssgpPduType := '0E'O,
1889 tLLI := tr_BSSGP_TLLI(tlli),
1890 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1891 suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref)
1892 }
1893 }
1894
1895 template (value) PDU_BSSGP ts_BSSGP_RESUME_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id)
1896 := {
1897 pDU_BSSGP_RESUME_ACK := {
1898 bssgpPduType := '0F'O,
1899 tLLI := ts_BSSGP_TLLI(tlli),
1900 routeing_Area := ts_BSSGP_RA_ID(ra_id)
1901 }
1902 }
1903 template PDU_BSSGP tr_BSSGP_RESUME_ACK(template GprsTlli tlli,
1904 RoutingAreaIdentification ra_id) := {
1905 pDU_BSSGP_RESUME_ACK := {
1906 bssgpPduType := '0F'O,
1907 tLLI := tr_BSSGP_TLLI(tlli),
1908 routeing_Area := ts_BSSGP_RA_ID(ra_id)
1909 }
1910 }
1911
1912 template (value) PDU_BSSGP ts_BSSGP_RESUME_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id,
1913 template (omit) BssgpCause cause) := {
1914 pDU_BSSGP_RESUME_NACK := {
1915 bssgpPduType := '10'O,
1916 tLLI := ts_BSSGP_TLLI(tlli),
1917 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1918 cause := ts_BSSGP_CAUSE(cause)
1919 }
1920 }
1921 template PDU_BSSGP tr_BSSGP_RESUME_NACK(template GprsTlli tlli,
1922 RoutingAreaIdentification ra_id,
1923 template BssgpCause cause) := {
1924 pDU_BSSGP_RESUME_NACK := {
1925 bssgpPduType := '10'O,
1926 tLLI := tr_BSSGP_TLLI(tlli),
1927 routeing_Area := ts_BSSGP_RA_ID(ra_id),
1928 cause := t_BSSGP_CAUSE(cause)
1929 }
1930 }
1931
Daniel Willmann379fc252020-11-20 18:34:22 +01001932 /* 10.4.1 */
1933 template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL(GprsTlli tlli, template (value) BssgpBvci bvci_old,
1934 template (omit) BssgpBvci bvci_new := omit,
1935 template (omit) Nsei nsei := omit) := {
1936 pDU_BSSGP_FLUSH_LL := {
1937 bssgpPduType := '2A'O,
1938 tLLI := ts_BSSGP_TLLI(tlli),
1939 bVCI_old := t_BSSGP_BVCI(bvci_old),
1940 bVCI_new := t_BSSGP_BVCI(bvci_new),
1941 nSEI := t_BSSGP_NSEI(nsei)
1942 }
1943 }
1944 template PDU_BSSGP tr_BSSGP_FLUSH_LL(template GprsTlli tlli, template BssgpBvci bvci_old,
1945 template (omit) BssgpBvci bvci_new := omit,
1946 template (omit) Nsei nsei := omit) := {
1947 pDU_BSSGP_FLUSH_LL := {
1948 bssgpPduType := '2A'O,
1949 tLLI := tr_BSSGP_TLLI(tlli),
1950 bVCI_old := t_BSSGP_BVCI(bvci_old),
1951 bVCI_new := t_BSSGP_BVCI(bvci_new),
1952 nSEI := t_BSSGP_NSEI(nsei)
1953 }
1954 }
1955
Daniel Willmann7f1d78e2020-11-24 14:42:40 +01001956 /* 10.4.2 */
1957 template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL_ACK(GprsTlli tlli, template (value) OCT1 act,
1958 template (value) integer oct_affected,
1959 template (omit) BssgpBvci bvci_new := omit,
1960 template (omit) Nsei nsei := omit) := {
1961 pDU_BSSGP_FLUSH_LL_ACK := {
1962 bssgpPduType := '2B'O,
1963 tLLI := ts_BSSGP_TLLI(tlli),
1964 flush_Action := t_FLUSH_ACTION(act),
1965 bVCI_new := t_BSSGP_BVCI(bvci_new),
1966 number_of_octets_affected := t_NO_OCT_AFF(oct_affected),
1967 nSEI := t_BSSGP_NSEI(nsei)
1968 }
1969 }
1970 template PDU_BSSGP tr_BSSGP_FLUSH_LL_ACK(template GprsTlli tlli, template OCT1 act,
1971 template integer oct_affected,
1972 template (omit) BssgpBvci bvci_new := omit,
1973 template (omit) Nsei nsei := omit) := {
1974 pDU_BSSGP_FLUSH_LL_ACK := {
1975 bssgpPduType := '2B'O,
1976 tLLI := ts_BSSGP_TLLI(tlli),
1977 flush_Action := t_FLUSH_ACTION(act),
1978 bVCI_new := t_BSSGP_BVCI(bvci_new),
1979 number_of_octets_affected := t_NO_OCT_AFF(oct_affected),
1980 nSEI := t_BSSGP_NSEI(nsei)
1981 }
1982 }
1983
Daniel Willmann00c0bbf2020-11-24 18:37:49 +01001984 /* 10.4.3 */
1985 template (value) PDU_BSSGP ts_BSSGP_LLC_DISCARDED(GprsTlli tlli, template (value) integer frames_discarded,
1986 template (value) BssgpBvci bvci,
1987 template (value) integer oct_deleted) := {
1988 pDU_BSSGP_LLC_DISCARDED := {
1989 bssgpPduType := '2C'O,
1990 tLLI := ts_BSSGP_TLLI(tlli),
1991 lLC_Frames_Discarded := t_LLC_FRAMES_DISCARDED(frames_discarded),
1992 bVCI := t_BSSGP_BVCI(bvci),
1993 number_of_octets_deleted := t_NO_OCT_AFF(oct_deleted),
1994 pFI := omit
1995 }
1996 }
1997 template PDU_BSSGP tr_BSSGP_LLC_DISCARDED(template GprsTlli tlli, template integer frames_discarded,
1998 template BssgpBvci bvci,
1999 template integer oct_deleted) := {
2000 pDU_BSSGP_LLC_DISCARDED := {
2001 bssgpPduType := '2C'O,
2002 tLLI := ts_BSSGP_TLLI(tlli),
2003 lLC_Frames_Discarded := t_LLC_FRAMES_DISCARDED(frames_discarded),
2004 bVCI := t_BSSGP_BVCI(bvci),
2005 number_of_octets_deleted := t_NO_OCT_AFF(oct_deleted),
2006 pFI := *
2007 }
2008 }
2009
Daniel Willmann670bbc02020-11-19 16:39:39 +01002010 /* 10.2.3 */
2011 template (value) PDU_BSSGP ts_BSSGP_RA_CAP(GprsTlli tlli,
2012 template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := {
2013 pDU_BSSGP_RA_CAPABILITY := {
2014 bssgpPduType := '02'O,
2015 tLLI := ts_BSSGP_TLLI(tlli),
2016 mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap)
2017 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002018 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002019 template (present) PDU_BSSGP tr_BSSGP_RA_CAP(template (present) GprsTlli tlli,
2020 template MSRadioAccessCapabilityV_BSSGP racap) := {
2021 pDU_BSSGP_RA_CAPABILITY := {
2022 bssgpPduType := '02'O,
2023 tLLI := ts_BSSGP_TLLI(tlli),
2024 mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap)
2025 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002026 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002027
2028
Daniel Willmann670bbc02020-11-19 16:39:39 +01002029 /* 10.3.3 */
2030 template (value) PDU_BSSGP ts_BSSGP_RA_CAP_UPD(GprsTlli tlli, OCT1 tag) := {
2031 pDU_BSSGP_RA_CAPABILITY_UPDATE := {
2032 bssgpPduType := '08'O,
2033 tLLI := ts_BSSGP_TLLI(tlli),
2034 tag := ts_BSSGP_IE_Tag(tag)
2035 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002036 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002037 template (present) PDU_BSSGP tr_BSSGP_RA_CAP_UPD(template (present) GprsTlli tlli,
2038 template OCT1 tag) := {
2039 pDU_BSSGP_RA_CAPABILITY_UPDATE := {
2040 bssgpPduType := '08'O,
2041 tLLI := ts_BSSGP_TLLI(tlli),
2042 tag := tr_BSSGP_IE_Tag(tag)
2043 }
Daniel Willmannace3ece2020-11-16 19:53:26 +01002044 }
Daniel Willmannace3ece2020-11-16 19:53:26 +01002045
Harald Welte6dc2ac42020-11-16 09:16:17 +01002046
Daniel Willmann670bbc02020-11-19 16:39:39 +01002047 /* 10.3.4 */
2048 template (value) PDU_BSSGP
2049 ts_BSSGP_RA_CAP_UPD_ACK(GprsTlli tlli, OCT1 tag, template (value) OCT1 cause,
2050 template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := {
2051 pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := {
2052 bssgpPduType := '09'O,
2053 tLLI := ts_BSSGP_TLLI(tlli),
2054 tag := ts_BSSGP_IE_Tag(tag),
2055 iMSI := omit,
2056 rA_Cap_UPDATE_CAUSE := ts_BSSGP_IE_RACU_Cause(cause),
2057 mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap)
2058 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002059 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002060 template (present) PDU_BSSGP
2061 tr_BSSGP_RA_CAP_UPD_ACK(template (present) GprsTlli tlli, template OCT1 tag, template (present) OCT1 cause,
2062 template MSRadioAccessCapabilityV_BSSGP racap := omit) := {
2063 pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := {
2064 bssgpPduType := '09'O,
2065 tLLI := ts_BSSGP_TLLI(tlli),
2066 tag := tr_BSSGP_IE_Tag(tag),
2067 iMSI := omit,
2068 rA_Cap_UPDATE_CAUSE := tr_BSSGP_IE_RACU_Cause(cause),
2069 mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap)
2070 }
Daniel Willmannace3ece2020-11-16 19:53:26 +01002071 }
Harald Welte6dc2ac42020-11-16 09:16:17 +01002072
Daniel Willmann670bbc02020-11-19 16:39:39 +01002073 type enumerated BssgpRadioCause {
2074 BSSGP_RADIO_CAUSE_CONTACT_LOST ('00'H),
2075 BSSGP_RADIO_CAUSE_LINK_QUAL_INSUFF ('01'H),
2076 BSSGP_RADIO_CAUSE_CELL_RESEL_ORDERED ('02'H),
2077 BSSGP_RADIO_CAUSE_CELL_RESEL_PREPARE ('03'H),
2078 BSSGP_RADIO_CAUSE_CELL_RESEL_FAILURE ('04'H)
2079 } with { variant "FIELDLENGTH(8)" };
Harald Welte6dc2ac42020-11-16 09:16:17 +01002080
Harald Welte0e188242020-11-22 21:46:48 +01002081 function ts_BSSGP_RADIO_CAUSE(template (omit) BssgpRadioCause cause) return template (omit) Radio_Cause {
Daniel Willmann670bbc02020-11-19 16:39:39 +01002082 var template (omit) Radio_Cause ret;
2083 if (istemplatekind(cause, "omit")) {
2084 ret := omit;
2085 } else {
2086 ret.iEI := '19'O;
2087 ret.ext := '1'B;
2088 ret.lengthIndicator := { length1 := 1 };
2089 ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1);
2090 }
2091 return ret;
2092 }
2093 function tr_BSSGP_RADIO_CAUSE(template BssgpRadioCause cause) return template (present) Radio_Cause {
2094 var template Radio_Cause ret;
Daniel Willmann05d46382020-11-19 14:20:33 +01002095 ret.iEI := '19'O;
2096 ret.ext := '1'B;
2097 ret.lengthIndicator := { length1 := 1 };
Daniel Willmann670bbc02020-11-19 16:39:39 +01002098 if (isvalue(cause)) {
2099 ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1);
2100 } else {
2101 ret.radio_Cause_Value := ?
2102 }
2103 return ret;
Daniel Willmann05d46382020-11-19 14:20:33 +01002104 }
Daniel Willmann05d46382020-11-19 14:20:33 +01002105
Daniel Willmann670bbc02020-11-19 16:39:39 +01002106 /* 10.3.5 */
2107 template (value) PDU_BSSGP
2108 ts_BSSGP_RADIO_STATUS(GprsTlli tlli, template (value) BssgpRadioCause cause) := {
2109 pDU_BSSGP_RADIO_STATUS := {
2110 bssgpPduType := '0a'O,
2111 tLLI := ts_BSSGP_TLLI(tlli),
2112 tMSI := omit,
2113 iMSI := omit,
2114 radio_Cause := ts_BSSGP_RADIO_CAUSE(cause)
Harald Welte5339b2e2020-10-04 22:52:56 +02002115 }
2116 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002117 template (present) PDU_BSSGP
2118 tr_BSSGP_RADIO_STATUS(template (present) GprsTlli tlli, template (present) BssgpRadioCause cause) := {
2119 pDU_BSSGP_RADIO_STATUS := {
2120 bssgpPduType := '0a'O,
2121 tLLI := ts_BSSGP_TLLI(tlli),
2122 tMSI := omit,
2123 iMSI := omit,
2124 radio_Cause := tr_BSSGP_RADIO_CAUSE(cause)
2125 }
Harald Welte5339b2e2020-10-04 22:52:56 +02002126 }
Harald Welte23989a62019-03-21 21:32:45 +01002127
Harald Weltef8e5c5d2020-11-27 22:37:23 +01002128 /* 10.4.15 */
2129 template (value) PDU_BSSGP
2130 ts_BSSGP_INVOKE_TRACE(OCT1 eq_trace, OCT2 ref) := {
2131 pDU_BSSGP_SGSN_INVOKE_TRACE := {
2132 bssgpPduType := '40'O,
2133 traceType := {
2134 iEI := '22'O,
2135 ext := '1'B,
2136 lengthIndicator := {
2137 length1 := 1
2138 },
2139 equipment_Trace := eq_trace
2140 },
2141 traceReference := {
2142 iEI := '21'O,
2143 ext := '1'B,
2144 lengthIndicator := {
2145 length1 := 2
2146 },
2147 trace_Reference := ref
2148 },
2149 triggerId := omit,
2150 mobileId := omit,
2151 omcId := omit,
2152 transactionId := omit
2153 }
2154 }
2155 template (present) PDU_BSSGP
2156 tr_BSSGP_INVOKE_TRACE(template (present) OCT1 eq_trace, template (present) OCT2 ref) := {
2157 pDU_BSSGP_SGSN_INVOKE_TRACE := {
2158 bssgpPduType := '40'O,
2159 traceType := {
2160 iEI := '22'O,
2161 ext := '1'B,
2162 lengthIndicator := {
2163 length1 := 1
2164 },
2165 equipment_Trace := eq_trace
2166 },
2167 traceReference := {
2168 iEI := '21'O,
2169 ext := '1'B,
2170 lengthIndicator := {
2171 length1 := 2
2172 },
2173 trace_Reference := ref
2174 },
2175 triggerId := *,
2176 mobileId := *,
2177 omcId := *,
2178 transactionId := *
2179 }
2180 }
Daniel Willmann670bbc02020-11-19 16:39:39 +01002181
Harald Weltef20af412020-11-28 16:11:11 +01002182 /* 10.4.36 */
2183 template (value) PDU_BSSGP
2184 ts_OVERLOAD(template (value) BIT1 priority_class) := {
2185 pDU_BSSGP_OVERLOAD := {
2186 bssgpPduType := '42'O,
2187 priority_Class_Indicator := {
2188 iEI := '8f'O,
2189 ext := '1'B,
2190 lengthIndicator := {
2191 length1 := 1
2192 },
2193 priority_Class_Indicator_Value := priority_class,
2194 spare := '0000000'B
2195 }
2196 }
2197 }
2198 template (present) PDU_BSSGP
2199 tr_OVERLOAD(template (present) BIT1 priority_class) := {
2200 pDU_BSSGP_OVERLOAD := {
2201 bssgpPduType := '42'O,
2202 priority_Class_Indicator := {
2203 iEI := '8f'O,
2204 ext := '1'B,
2205 lengthIndicator := {
2206 length1 := 1
2207 },
2208 priority_Class_Indicator_Value := priority_class,
2209 spare := '0000000'B
2210 }
2211 }
2212 }
2213
Philipp Maierb76a2792020-12-07 16:54:35 +01002214 /* 3GPP TS 48.018 11.3.61 */
2215 const OCT1 RIM_APP_ID_NACC := '01'O;
2216 const OCT1 RIM_APP_ID_SI3 := '02'O;
2217 const OCT1 RIM_APP_ID_MBMS_DATA_CH := '03'O;
2218 const OCT1 RIM_APP_ID_SON_TRANSF := '04'O;
2219 const OCT1 RIM_APP_ID_UTRA_SI := '05'O;
2220 template (value) RIM_Application_Identity ts_RIM_Application_Identity(OCT1 app_id) := {
2221 iEI := '4B'O,
2222 ext := '1'B,
2223 lengthIndicator := {
2224 length1 := 1
2225 },
2226 rIMApplicationIdentity := app_id
2227 }
2228
2229
2230 /* 3GPP TS 48.018 11.3.62 */
2231 template (value) RIM_Sequence_Number ts_RIM_Sequence_Number(integer seq) := {
2232 iEI := '4C'O,
2233 ext := '1'B,
2234 lengthIndicator := {
2235 length1 := 4
2236 },
2237 rIMSequenceNumber := int2oct(seq, 4)
2238 }
2239
2240 /* 3GPP TS 48.018 11.3.62a.1 */
2241 template (value) RAN_Information_Request_RIM_Container
2242 ts_RAN_Information_Request_RIM_Container(template (value) RIM_Application_Identity app_id,
2243 template (value) RIM_Sequence_Number seq,
2244 template (value) RIM_PDU_Indications ind,
2245 template (omit) RIM_Protocol_Version_Number ver := omit,
2246 template (omit) RAN_Information_Request_Application_Container app_cont := omit,
2247 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2248 iEI := '57'O,
2249 ext := '1'B,
2250 lengthIndicator := {
2251 length1 := 0 /* overwritten */
2252 },
2253 rIM_Application_Identity := app_id,
2254 rIM_Sequence_Number := seq,
2255 rIM_PDU_Indications := ind,
2256 rIM_Protocol_Version_Number := ver,
2257 application_Container := app_cont,
2258 sON_Transfer_Application_Identity_TLV := son_app_id
2259 }
2260 template RAN_Information_Request_RIM_Container
2261 tr_RAN_Information_Request_RIM_Container(template RIM_Application_Identity app_id := ?,
2262 template RIM_Sequence_Number seq := ?,
2263 template RIM_PDU_Indications ind := ?,
2264 template RIM_Protocol_Version_Number ver := *,
2265 template RAN_Information_Request_Application_Container app_cont := *,
2266 template SON_Transfer_Application_Identity_TLV son_app_id := *) := {
2267 iEI := '57'O,
2268 ext := '1'B,
2269 lengthIndicator := {
2270 length1 := ?
2271 },
2272 rIM_Application_Identity := app_id,
2273 rIM_Sequence_Number := seq,
2274 rIM_PDU_Indications := ind,
2275 rIM_Protocol_Version_Number := ver,
2276 application_Container := app_cont,
2277 sON_Transfer_Application_Identity_TLV := son_app_id
2278 }
2279
2280
2281 /* 3GPP TS 48.018 11.3.62a.2 */
2282 template (value) RAN_Information_RIM_Container
2283 ts_RAN_Information_RIM_Container(template (value) RIM_Application_Identity app_id,
2284 template (value) RIM_Sequence_Number seq,
2285 template (value) RIM_PDU_Indications ind,
2286 template (omit) RIM_Protocol_Version_Number ver := omit,
2287 template (omit) ApplContainer_or_ApplErrContainer app_cont_or_app_err := omit,
2288 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2289
2290 iEI := '58'O,
2291 ext := '1'B,
2292 lengthIndicator := {
2293 length1 := 0 /* overwritten */
2294 },
2295 rIM_Application_Identity := app_id,
2296 rIM_Sequence_Number := seq,
2297 rIM_PDU_Indications := ind,
2298 rIM_Protocol_Version_Number := ver,
2299 applContainer_or_ApplErrContainer := app_cont_or_app_err,
2300 sON_Transfer_Application_Identity := son_app_id
2301 }
2302 template (value) ApplContainer_or_ApplErrContainer
2303 tsu_ApplContainer_or_ApplErrContainer_NACC(template (value) ApplContainer_or_ApplErrContainer_NACC cont) := {
2304 nacc := cont
2305 }
2306 template (value) ApplContainer_or_ApplErrContainer
2307 tsu_ApplContainer_or_ApplErrContainer_SI3(template (value) ApplContainer_or_ApplErrContainer_SI3 cont) := {
2308 si3 := cont
2309 }
2310 template (value) ApplContainer_or_ApplErrContainer
2311 tsu_ApplContainer_or_ApplErrContainer_MBMS_data_channel(template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel cont) := {
2312 mBMS_data_channel := cont
2313 }
2314 template (value) ApplContainer_or_ApplErrContainer_NACC
2315 tsu_ApplContainer_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
2316 application_Container := ts_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi)
2317 }
2318 template (value) ApplContainer_or_ApplErrContainer_NACC
2319 tsu_ApplErrContainer_NACC(template (value) BssgpCellId cid,
2320 integer cause,
2321 template (value) Application_Container_IE_NACC app_cont) := {
2322 application_Error_Container := ts_Application_Error_Container_NACC(cid, cause, app_cont)
2323 }
2324 template (value) ApplContainer_or_ApplErrContainer_SI3
2325 tsu_ApplContainer_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := {
2326 application_Container := ts_RAN_Information_Application_Container_SI3(cid, si3)
2327 }
2328 template (value) ApplContainer_or_ApplErrContainer_SI3
2329 tsu_ApplErrContainer_SI3(template (value) BssgpCellId cid,
2330 integer cause,
2331 template (value) Application_Container_IE_SI3 app_cont) := {
2332 application_Error_Container := ts_Application_Error_Container_SI3(cid, cause, app_cont)
2333 }
2334 template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel
2335 tsu_ApplContainer_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := {
2336 application_Container := ts_RAN_Information_Application_Container_MBMS_data_channel(cid, data_ch_report)
2337 }
2338 template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel
2339 tsu_ApplErrContainer_MBMS_data_channel(template (value) BssgpCellId cid,
2340 integer cause,
2341 template (value) Application_Container_IE_MBMS_data_channel app_cont) := {
2342 application_Error_Container := ts_Application_Error_Container_MBMS_data_channel(cid, cause, app_cont)
2343 }
2344
2345 /* 3GPP TS 48.018 11.3.62a.3 */
2346 template (value) RAN_Information_Ack_RIM_Container
2347 ts_RAN_Information_Ack_RIM_Container(template (value) RIM_Application_Identity app_id,
2348 template (value) RIM_Sequence_Number seq,
2349 template (omit) RIM_Protocol_Version_Number ver := omit,
2350 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2351 iEI := '5A'O,
2352 ext := '1'B,
2353 lengthIndicator := {
2354 length1 := 0 /* overwritten */
2355 },
2356 rIM_Application_Identity := app_id,
2357 rIM_Sequence_Number := seq,
2358 rIM_Protocol_Version_Number := ver,
2359 sON_Transfer_Application_Identity := son_app_id
2360 }
2361
2362 /* 3GPP TS 48.018 11.3.62a.4 */
2363 template (value) RAN_Information_Error_RIM_Container
2364 ts_RAN_Information_Error_RIM_Container(template (value) RIM_Application_Identity app_id,
2365 template (value) Cause_BSSGP cause,
2366 template (omit) RIM_Protocol_Version_Number ver := omit,
2367 PDU_BSSGP pdu,
2368 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2369 iEI := '5B'O,
2370 ext := '1'B,
2371 lengthIndicator := {
2372 length1 := 0 /* overwritten */
2373 },
2374 rIM_Application_Identity := app_id,
2375 rIM_cause := cause,
2376 rIM_Protocol_Version_Number := ver,
2377 pDU_in_Error:= {
2378 iEI := '15'O,
2379 ext := '1'B,
2380 lengthIndicator := {
2381 length1 := 0 /* overwritten */
2382 },
2383 erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu)
2384 },
2385 sON_Transfer_Application_Identity := son_app_id
2386 }
2387
2388 /* 3GPP TS 48.018 11.3.62a.5 */
2389 template (value) RAN_Information_Application_Error_RIM_Container
2390 ts_RAN_Information_Application_Error_RIM_Container(template (value) RIM_Application_Identity app_id,
2391 template (value) RIM_Sequence_Number seq,
2392 template (value) RIM_PDU_Indications ind,
2393 template (omit) RIM_Protocol_Version_Number ver := omit,
2394 template (value) Application_Error_Container cont,
2395 template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
2396 iEI := '59'O,
2397 ext := '1'B,
2398 lengthIndicator := {
2399 length1 := 0 /* overwritten */
2400 },
2401 rIM_Application_Identity := app_id,
2402 rIM_Sequence_Number := seq,
2403 rIM_PDU_Indications := ind,
2404 rIM_Protocol_Version_Number := ver,
2405 application_Error_Container := cont,
2406 sON_Transfer_Application_Identity := son_app_id
2407 }
2408
2409
2410 /* 3GPP TS 48.018 11.3.63.1 */
2411 template (value) RAN_Information_Request_Application_Container
2412 tsu_RAN_Information_Request_Application_Container_NACC(template (value) BssgpCellId cid) := {
2413 nacc := ts_RAN_Information_Request_Application_Container_NACC(cid)
2414 }
2415 template (value) RAN_Information_Request_Application_Container
2416 tsu_RAN_Information_Request_Application_Container_SI3(template (value) BssgpCellId cid) := {
2417 si3 := ts_RAN_Information_Request_Application_Container_SI3(cid)
2418 }
2419 template (value) RAN_Information_Request_Application_Container
2420 tsu_RAN_Information_Request_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid) := {
2421 mBMS_data_channel := ts_RAN_Information_Request_Application_Container_MBMS_data_channel(cid)
2422 }
2423
2424 /* NOTE: The type description of reporting_Cell_Identifier in chapter 11.3.63.1, version V10.6.0 (2012-07) of
2425 * 3GPP TS 48.018 clearly states: "Reporting Cell Identifier: This field is encoded as the Cell Identifier
2426 * defined in sub-clause 11.3.9". However this seems to be an error in the specification, because the
2427 * specifiction in Table 11.3.63.1.1 already has a length field an an IEI defined. Keeping the IEI and lenght
2428 * of the BSSGP cell identifier in addition would no make sense. Also in the chapters below the specifiction
2429 * of the IEs are similar and there it says "Reporting Cell Identifier: This field is encoded as the value
2430 * part of the Cell Identifier IE defined in sub-clause 11.3.9, not including IEI and Length Indicator.",
2431 * which actually makes sense. */
2432
2433 /* 3GPP TS 48.018 11.3.63.1.1 */
2434 template (value) RAN_Information_Request_Application_Container_NACC
2435 ts_RAN_Information_Request_Application_Container_NACC(template (value) BssgpCellId cid) := {
2436 iEI := '4D'O,
2437 ext := '1'B,
2438 lengthIndicator := {
2439 length1 := 0 /* overwritten */
2440 },
2441 reporting_Cell_Identifier := t_Cell_Identifier_V(cid)
2442 }
2443
2444 /* 3GPP TS 48.018 11.3.63.1.2 */
2445 template (value) RAN_Information_Request_Application_Container_SI3
2446 ts_RAN_Information_Request_Application_Container_SI3(template (value) BssgpCellId cid) := {
2447 iEI := '4D'O,
2448 ext := '1'B,
2449 lengthIndicator := {
2450 length1 := 0 /* overwritten */
2451 },
2452 reporting_Cell_Identifier := t_Cell_Identifier_V(cid)
2453 }
2454
2455 /* 3GPP TS 48.018 11.3.63.1.3 */
2456 template (value) RAN_Information_Request_Application_Container_MBMS_data_channel
2457 ts_RAN_Information_Request_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid) := {
2458 iEI := '4D'O,
2459 ext := '1'B,
2460 lengthIndicator := {
2461 length1 := 0 /* overwritten */
2462 },
2463 reporting_Cell_Identifier := t_Cell_Identifier_V(cid)
2464 }
2465
2466 /* 3GPP TS 48.018 11.3.63.2.1 */
2467 template (value) RAN_Information_Application_Container_NACC
2468 ts_RAN_Information_Application_Container_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
2469 iEI := '4E'O,
2470 ext := '1'B,
2471 lengthIndicator := {
2472 length1 := 0 /* overwritten */
2473 },
2474 reporting_Cell_Identifier := t_Cell_Identifier_V(cid),
2475 typeBit := bool2bit(psi_type),
2476 number_of_SI_PSI := int2bit(si_psi_num, 7),
2477 sI_PSI := si_psi
2478 }
2479
2480 /* 3GPP TS 48.018 11.3.63.2.2 */
2481 template (value) RAN_Information_Application_Container_SI3
2482 ts_RAN_Information_Application_Container_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := {
2483 iEI := '4E'O,
2484 ext := '1'B,
2485 lengthIndicator := {
2486 length1 := 0 /* overwritten */
2487 },
2488 reporting_Cell_Identifier := t_Cell_Identifier_V(cid),
2489 sI3 := si3
2490 }
2491
2492 /* 3GPP TS 48.018 11.3.63.2.3 */
2493 template (value) RAN_Information_Application_Container_MBMS_data_channel
2494 ts_RAN_Information_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := {
2495 iEI := '4E'O,
2496 ext := '1'B,
2497 lengthIndicator := {
2498 length1 := 0 /* overwritten */
2499 },
2500 reporting_Cell_Identifier := t_Cell_Identifier_V(cid),
2501 mBMS_data_channel_report := data_ch_report
2502 }
2503
2504
2505 /* 3GPP TS 48.018 11.3.64 */
2506 template (value) Application_Error_Container
2507 tsu_Application_Error_Container_NACC(template (value) BssgpCellId cid,
2508 integer cause,
2509 template (value) Application_Container_IE_NACC app_cont) := {
2510 nacc := ts_Application_Error_Container_NACC(cid, cause, app_cont)
2511 }
2512 template (value) Application_Error_Container
2513 tsu_Application_Error_Container_SI3(template (value) BssgpCellId cid,
2514 integer cause,
2515 template (value) Application_Container_IE_SI3 app_cont) := {
2516 si3 := ts_Application_Error_Container_SI3(cid, cause, app_cont)
2517 }
2518 template (value) Application_Error_Container
2519 tsu_Application_Error_Container_MBMS_data_channel(template (value) BssgpCellId cid,
2520 integer cause,
2521 template (value) Application_Container_IE_MBMS_data_channel app_cont) := {
2522 mBMS_data_channel := ts_Application_Error_Container_MBMS_data_channel(cid, cause, app_cont)
2523 }
2524
2525 /* 3GPP TS 48.018 11.3.64.1 */
2526 template (value) Application_Error_Container_NACC
2527 ts_Application_Error_Container_NACC(template (value) BssgpCellId cid,
2528 integer cause,
2529 template (value) Application_Container_IE_NACC app_cont) := {
2530 iEI := '56'O,
2531 ext := '1'B,
2532 lengthIndicator := {
2533 length1 := 0 /* overwritten */
2534 },
2535 nACC_cause := int2oct(cause, 1),
2536 erroneousApplicationContainer := app_cont
2537 }
2538 template (value) Application_Container_IE_NACC
2539 tsu_Application_Container_IE_NACC_req(template (value) BssgpCellId cid) := {
2540 rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_NACC(cid)
2541 }
2542 template (value) Application_Container_IE_NACC
2543 tsu_Application_Container_IE_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
2544 rAN_Information_Application_Container := ts_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi)
2545 }
2546
2547 /* 3GPP TS 48.018 11.3.64.2 */
2548 template (value) Application_Error_Container_SI3
2549 ts_Application_Error_Container_SI3(template (value) BssgpCellId cid,
2550 integer cause,
2551 template (value) Application_Container_IE_SI3 app_cont) := {
2552 iEI := '56'O,
2553 ext := '1'B,
2554 lengthIndicator := {
2555 length1 := 0 /* overwritten */
2556 },
2557 sI3_cause := int2oct(cause, 1),
2558 erroneousApplicationContainer := app_cont
2559 }
2560 template (value) Application_Container_IE_SI3
2561 tsu_Application_Container_IE_SI3_req(template (value) BssgpCellId cid) := {
2562 rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_SI3(cid)
2563 }
2564 template (value) Application_Container_IE_SI3
2565 tsu_Application_Container_IE_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := {
2566 rAN_Information_Application_Container := ts_RAN_Information_Application_Container_SI3(cid, si3)
2567 }
2568
2569 /* 3GPP TS 48.018 11.3.64.3 */
2570 template (value) Application_Error_Container_MBMS_data_channel
2571 ts_Application_Error_Container_MBMS_data_channel(template (value) BssgpCellId cid,
2572 integer cause,
2573 template (value) Application_Container_IE_MBMS_data_channel app_cont) := {
2574 iEI := '56'O,
2575 ext := '1'B,
2576 lengthIndicator := {
2577 length1 := 0 /* overwritten */
2578 },
2579 mBMS_data_channel_cause := int2oct(cause, 1),
2580 erroneousApplicationContainer := app_cont
2581 }
2582 template (value) Application_Container_IE_MBMS_data_channel
2583 tsu_Application_Container_IE_MBMS_data_channel_req(template (value) BssgpCellId cid) := {
2584 rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_MBMS_data_channel(cid)
2585 }
2586 template (value) Application_Container_IE_MBMS_data_channel
2587 tsu_Application_Container_IE_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := {
2588 rAN_Information_Application_Container := ts_RAN_Information_Application_Container_MBMS_data_channel(cid, data_ch_report)
2589 }
2590
2591
2592 /* 3GPP TS 44.018 10.5.1.3 -> 3GPP TS 24.008 10.5.1.3 */
2593 function t_LocationAreaIdentification(template BssgpCellId cid) return template BSSGP_Types.LocationAreaIdentification {
2594 var template BSSGP_Types.LocationAreaIdentification ret := {
2595 mccDigit1 := ?,
2596 mccDigit2 := ?,
2597 mccDigit3 := ?,
2598 mncDigit3 := ?,
2599 mncDigit1 := ?,
2600 mncDigit2 := ?,
2601 lac := ?
2602 }
2603 if (istemplatekind(cid, "omit")) {
2604 return omit;
2605 } else if (istemplatekind(cid, "*")) {
2606 return *;
2607 } else if (istemplatekind(cid, "?")) {
2608 return ?;
2609 }
2610 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
2611 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
2612 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
2613 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
2614 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
2615 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
2616 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
2617 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
2618 }
2619 if (isvalue(cid.ra_id.lai.lac)) {
2620 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
2621 }
2622 }
2623 return ret;
2624 }
2625
2626 /* 3GPP TS 44.018 10.5.2.11 */
2627 template (value) ControlChannelDescription ts_ControlChannelDescription(integer ccch_conf,
2628 integer bs_ag_blks_res,
2629 boolean att,
2630 boolean mscr,
2631 integer bs_pa_mfrms,
2632 BIT2 cbq3,
2633 integer t3212) := {
2634 cCCH_Conf := int2bit(ccch_conf, 3),
2635 bS_AG_BLKS_RES := int2bit(bs_ag_blks_res, 3),
2636 aTT := bool2bit(att),
2637 mSCR := bool2bit(mscr),
2638 bS_PA_MFRMS := int2bit(bs_pa_mfrms, 3),
2639 spare1 := '00'B,
2640 cBQ3 := cbq3,
2641 spare2 := '0'B,
2642 t3212 := int2oct(t3212, 1)
2643 }
2644
2645 /* 3GPP TS 44.018 10.5.2.3 */
2646 template (value) CellOptions ts_CellOptions(integer radio_link_timeout,
2647 BIT3 dtx,
2648 boolean pwrc) := {
2649 radioLinkTimeout := int2bit(radio_link_timeout, 4),
2650 dTX1 := dtx[0] & dtx[1],
2651 pWRC := bool2bit(pwrc),
2652 dtx2 := dtx[2]
2653 }
2654
2655 /* 3GPP TS 44.018 10.5.2.4 */
2656 template (value) CellSelectionParameters ts_CellSelectionParameters(integer ms_txpwr_max_cch,
2657 integer cell_reselection_hysteresis,
2658 integer rxlev_access_min,
2659 boolean neci,
2660 boolean acs) := {
2661 mS_TXPWR_MAX_CCH := int2bit(ms_txpwr_max_cch, 5),
2662 cellReselectHysterisis := int2bit(cell_reselection_hysteresis, 3),
2663 rXLEV_Access_Min := int2bit(rxlev_access_min, 6),
2664 nECI := bool2bit(neci),
2665 aCS := bool2bit(acs)
2666 }
2667
2668 /* 3GPP TS 44.018 10.5.2.29 */
2669 template (value) RACHControlParameters ts_RACHControlParameters(boolean re,
2670 boolean cell_barr_access,
2671 integer tx_integer,
2672 integer max_retrans,
2673 integer ac_15_to_8,
2674 integer ac_7_to_0) := {
2675 rE := bool2bit(re),
2676 cellBarrAccess := bool2bit(cell_barr_access),
2677 tX_Integer := int2bit(tx_integer, 4),
2678 maxRetrans := int2bit(max_retrans, 2),
2679 aC_15_to_8 := int2oct(ac_15_to_8, 1),
2680 aC_7_to_0 := int2oct(ac_7_to_0, 1)
2681 }
2682
2683 /* 3GPP TS 44.018 9.1.35 */
2684 template (value) SI3 ts_SI3(integer cell_id,
2685 template (value) BSSGP_Types.LocationAreaIdentification lai,
2686 template (value) ControlChannelDescription cch_descr,
2687 template (value) CellOptions cell_opt,
2688 template (value) CellSelectionParameters cell_sel_par,
2689 template (value) RACHControlParameters rach_ctrl_par,
2690 OCT4 rest_octets) := {
2691 sI3MessageType := '1B'O,
2692 cellIdentity := int2oct(cell_id, 2),
2693 locationAreaIdentification := lai,
2694 controlChannelDescription := cch_descr,
2695 cellOptions := cell_opt,
2696 cellSelectionParameters := cell_sel_par,
2697 rACHControlParameters := rach_ctrl_par,
2698 sI3RestOctets := rest_octets
2699 }
2700
2701
2702 /* 3GPP TS 48.018 11.3.65 */
2703 const BIT3 RIM_PDU_TYPE_STOP := '000'B;
2704 const BIT3 RIM_PDU_TYPE_SING_REP := '001'B;
2705 const BIT3 RIM_PDU_TYPE_MULT_REP := '010'B;
2706 template (value) RIM_PDU_Indications ts_RIM_PDU_Indications(boolean ack, BIT3 type_ext) := {
2707 iEI := '4F'O,
2708 ext := '1'B,
2709 lengthIndicator := {
2710 length1 := 1
2711 },
2712 ack := bool2bit(ack),
2713 pDU_Type_Extension := type_ext,
2714 reserved := '0000'B
2715 }
2716
2717 /* 3GPP TS 48.018 11.3.67 */
2718 template (value) RIM_Protocol_Version_Number ts_RIM_Protocol_Version_Number(integer ver) := {
2719 iEI := '55'O,
2720 ext := '1'B,
2721 lengthIndicator := {
2722 length1 := 1
2723 },
2724 rIMProtocolVersionNumber := int2oct(ver, 1)
2725 }
2726
2727 /* 3GPP TS 48.018 11.3.70 */
2728 const HEX1 RIM_ADDR_GERAN_CELL_ID := '0'H;
2729 const HEX1 RIM_ADDR_UTRAN_RNC_ID := '1'H;
2730 const HEX1 RIM_ADDR_EUTRAN_NODEB_ID := '2'H;
2731 const HEX1 RIM_ADDR_EHRPD_SECTOR_ID := '3'H;
2732 template (value) RIM_Routing_Information ts_RIM_Routing_Information(HEX1 addr_discr, template (value) RIM_Routing_Address addr) := {
2733 iEI := '54'O,
2734 ext := '1'B,
2735 lengthIndicator := {
2736 length1 := 0 /* overwritten */
2737 },
2738 rIMRoutingAddressDiscriminator := addr_discr,
2739 spare := '0'H,
2740 rIM_Routing_Address := addr
2741 }
2742 template RIM_Routing_Information tr_RIM_Routing_Information(template HEX1 addr_discr := ?, template RIM_Routing_Address addr := ?) := {
2743 iEI := '54'O,
2744 ext := '1'B,
2745 lengthIndicator := {
2746 length1 := ?
2747 },
2748 rIMRoutingAddressDiscriminator := addr_discr,
2749 spare := '0'H,
2750 rIM_Routing_Address := addr
2751 }
2752
2753 template RIM_Routing_Address t_RIM_Routing_Address_cid(template BssgpCellId cid := ?) := {
2754 cell_Identifier := t_Cell_Identifier_V(cid)
2755 }
2756 template RIM_Routing_Address t_RIM_Routing_Address_rncid(template BssgpCellId cid := ?, template integer rnc_id := ?) := {
2757 globalRNCID := t_GlobalRNC_ID_BSSGP(cid, rnc_id)
2758 }
2759 template RIM_Routing_Address t_RIM_Routing_Address_enbid(template BssgpCellId cid := ?, template integer tac := ?, template octetstring gnbid := ?) := {
2760 eNB_Identifier := t_ENB_Identifier_V(cid, tac, gnbid)
2761 }
2762 template RIM_Routing_Address t_RIM_Routing_Address_sector(template octetstring sector := ?) := {
2763 eHRPD_SectorID := sector
2764 }
2765
2766 function t_Cell_Identifier_V(template BssgpCellId cid) return template Cell_Identifier_V {
2767 var template Cell_Identifier_V ret := {
2768 mccDigit1 := ?,
2769 mccDigit2 := ?,
2770 mccDigit3 := ?,
2771 mncDigit3 := ?,
2772 mncDigit1 := ?,
2773 mncDigit2 := ?,
2774 lac := ?,
2775 rac := ?,
2776 cI_value := ?
2777 }
2778 if (istemplatekind(cid, "omit")) {
2779 return omit;
2780 } else if (istemplatekind(cid, "*")) {
2781 return *;
2782 } else if (istemplatekind(cid, "?")) {
2783 return ?;
2784 }
2785 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
2786 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
2787 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
2788 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
2789 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
2790 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
2791 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
2792 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
2793 }
2794 if (isvalue(cid.ra_id.lai.lac)) {
2795 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
2796 }
2797 }
2798 if (isvalue(cid) and isvalue(cid.ra_id)) {
2799 ret.rac := f_oct_or_wc(cid.ra_id.rac, 1);
2800 }
2801 if (isvalue(cid)) {
2802 ret.cI_value := f_oct_or_wc(cid.cell_id, 2);
2803 }
2804 return ret;
2805 }
2806
2807 function t_GlobalRNC_ID_BSSGP(template BssgpCellId cid, template integer rnc_id) return template GlobalRNC_ID_BSSGP {
2808 var template GlobalRNC_ID_BSSGP ret := {
2809 mccDigit1 := ?,
2810 mccDigit2 := ?,
2811 mccDigit3 := ?,
2812 mncDigit3 := ?,
2813 mncDigit1 := ?,
2814 mncDigit2 := ?,
2815 lac := ?,
2816 rac := ?,
2817 spare := ?,
2818 rNC_ID := ?
2819 }
2820 if (istemplatekind(cid, "omit") and istemplatekind(rnc_id, "omit")) {
2821 return omit;
2822 } else if (istemplatekind(cid, "*") and istemplatekind(rnc_id, "*")) {
2823 return *;
2824 } else if (istemplatekind(cid, "?") and istemplatekind(rnc_id, "?")) {
2825 return ?;
2826 }
2827 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
2828 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
2829 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
2830 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
2831 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
2832 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
2833 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
2834 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
2835 }
2836 if (isvalue(cid.ra_id.lai.lac)) {
2837 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
2838 }
2839 }
2840 if (isvalue(cid) and isvalue(cid.ra_id)) {
2841 ret.rac := f_oct_or_wc(cid.ra_id.rac, 1);
2842 }
2843 if (isvalue(rnc_id)) {
2844 ret.spare := '0'H;
2845 ret.rNC_ID := rnc_id;
2846 }
2847
2848 return ret;
2849 }
2850
2851 function t_ENB_Identifier_V(template BssgpCellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier_V {
2852 var template ENB_Identifier_V ret := {
2853 mccDigit1 := ?,
2854 mccDigit2 := ?,
2855 mccDigit3 := ?,
2856 mncDigit3 := ?,
2857 mncDigit1 := ?,
2858 mncDigit2 := ?,
2859 tac := ?,
2860 globaleNBID := ?
2861 }
2862 if (istemplatekind(cid, "omit") and istemplatekind(tac, "omit") and istemplatekind(gnbid, "omit")) {
2863 return omit;
2864 } else if (istemplatekind(cid, "*") and istemplatekind(tac, "*") and istemplatekind(gnbid, "*")) {
2865 return *;
2866 } else if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) {
2867 return ?;
2868 }
2869 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
2870 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
2871 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
2872 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
2873 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
2874 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
2875 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
2876 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
2877 }
2878 }
2879 if (isvalue(tac)) {
2880 ret.tac := int2oct(valueof(tac), 2);
2881 }
2882 if (isvalue(gnbid)) {
2883 ret.globaleNBID := gnbid;
2884 }
2885
2886 return ret;
2887 }
2888
2889 /* 3GPP TS 48.018 11.3.108 */
2890 template (value) SON_Transfer_Application_Identity_TLV ts_SON_Transfer_Application_Identity_TLV(template (value) octetstring app_id) := {
2891 iEI := '84'O,
2892 ext := '1'B,
2893 lengthIndicator := {
2894 length1 := 0 /* overwritten */
2895 },
2896 sON_Transfer_Application_Identity := app_id
2897 }
2898
2899
2900 /* 3GPP TS 48.018 10.6.1 */
2901 template (value) PDU_BSSGP
2902 ts_RAN_INFORMATION_REQUEST(template (value) RIM_Routing_Information dst,
2903 template (value) RIM_Routing_Information src,
2904 template (value) RAN_Information_Request_RIM_Container cont) := {
2905 pDU_BSSGP_RAN_INFORMATION_REQUEST := {
2906 bssgpPduType := '71'O,
2907 destination_Cell_Identifier := dst,
2908 source_Cell_Identifier := src,
2909 rIM_Container := cont
2910 }
2911 }
2912 template PDU_BSSGP
2913 tr_RAN_INFORMATION_REQUEST(template RIM_Routing_Information dst := ?,
2914 template RIM_Routing_Information src := ?,
2915 template RAN_Information_Request_RIM_Container cont := ?) := {
2916 pDU_BSSGP_RAN_INFORMATION_REQUEST := {
2917 bssgpPduType := '71'O,
2918 destination_Cell_Identifier := dst,
2919 source_Cell_Identifier := src,
2920 rIM_Container := cont
2921 }
2922 }
2923
2924 /* 3GPP TS 48.018 10.6.2 */
2925 template (value) PDU_BSSGP
2926 ts_PDU_BSSGP_RAN_INFORMATION(template (value) RIM_Routing_Information dst,
2927 template (value) RIM_Routing_Information src,
2928 template (value) RAN_Information_RIM_Container cont) := {
2929 pDU_BSSGP_RAN_INFORMATION := {
2930 bssgpPduType := '70'O,
2931 destination_Cell_Identifier := dst,
2932 source_Cell_Identifier := src,
2933 rIM_Container := cont
2934 }
2935 }
2936 template PDU_BSSGP
2937 tr_PDU_BSSGP_RAN_INFORMATION(template RIM_Routing_Information dst := ?,
2938 template RIM_Routing_Information src := ?,
2939 template RAN_Information_RIM_Container cont := ?) := {
2940 pDU_BSSGP_RAN_INFORMATION := {
2941 bssgpPduType := '70'O,
2942 destination_Cell_Identifier := dst,
2943 source_Cell_Identifier := src,
2944 rIM_Container := cont
2945 }
2946 }
2947
2948 /* 3GPP TS 48.018 10.6.3 */
2949 template (value) PDU_BSSGP
2950 ts_PDU_BSSGP_RAN_INFORMATION_ACK(template (value) RIM_Routing_Information dst,
2951 template (value) RIM_Routing_Information src,
2952 template (value) RAN_Information_Ack_RIM_Container cont) := {
2953 pDU_BSSGP_RAN_INFORMATION_ACK := {
2954 bssgpPduType := '72'O,
2955 destination_Cell_Identifier := dst,
2956 source_Cell_Identifier := src,
2957 rIM_Container := cont
2958 }
2959 }
2960 template PDU_BSSGP
2961 tr_PDU_BSSGP_RAN_INFORMATION_ACK(template RIM_Routing_Information dst := ?,
2962 template RIM_Routing_Information src := ?,
2963 template RAN_Information_Ack_RIM_Container cont := ?) := {
2964 pDU_BSSGP_RAN_INFORMATION_ACK := {
2965 bssgpPduType := '72'O,
2966 destination_Cell_Identifier := dst,
2967 source_Cell_Identifier := src,
2968 rIM_Container := cont
2969 }
2970 }
2971
2972 /* 3GPP TS 48.018 10.6.4 */
2973 template (value) PDU_BSSGP
2974 ts_PDU_BSSGP_RAN_INFORMATION_ERROR(template (value) RIM_Routing_Information dst,
2975 template (value) RIM_Routing_Information src,
2976 template (value) RAN_Information_Error_RIM_Container cont) := {
2977 pDU_BSSGP_RAN_INFORMATION_ERROR := {
2978 bssgpPduType := '73'O,
2979 destination_Cell_Identifier := dst,
2980 source_Cell_Identifier := src,
2981 rIM_Container := cont
2982 }
2983 }
2984 template PDU_BSSGP
2985 tr_PDU_BSSGP_RAN_INFORMATION_ERROR(template RIM_Routing_Information dst := ?,
2986 template RIM_Routing_Information src := ?,
2987 template RAN_Information_Error_RIM_Container cont := ?) := {
2988 pDU_BSSGP_RAN_INFORMATION_ERROR := {
2989 bssgpPduType := '73'O,
2990 destination_Cell_Identifier := dst,
2991 source_Cell_Identifier := src,
2992 rIM_Container := cont
2993 }
2994 }
2995
2996 /* 3GPP TS 48.018 10.6.5 */
2997 template (value) PDU_BSSGP
2998 ts_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR(template (value) RIM_Routing_Information dst,
2999 template (value) RIM_Routing_Information src,
3000 template (value) RAN_Information_Application_Error_RIM_Container cont) := {
3001 pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := {
3002 bssgpPduType := '74'O,
3003 destination_Cell_Identifier := dst,
3004 source_Cell_Identifier := src,
3005 rIM_Container := cont
3006 }
3007 }
3008 template PDU_BSSGP
3009 tr_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR(template RIM_Routing_Information dst := ?,
3010 template RIM_Routing_Information src := ?,
3011 template RAN_Information_Application_Error_RIM_Container cont := ?) := {
3012 pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := {
3013 bssgpPduType := '74'O,
3014 destination_Cell_Identifier := dst,
3015 source_Cell_Identifier := src,
3016 rIM_Container := cont
3017 }
3018 }
3019
Daniel Willmann670bbc02020-11-19 16:39:39 +01003020 /* PDU permitted on PTP BVC only (TS 48.018 Section 5.4.1) */
3021 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP_ONLY := (
3022 {pDU_BSSGP_DL_UNITDATA := ?},
3023 {pDU_BSSGP_UL_UNITDATA := ?},
3024 {pDU_BSSGP_RA_CAPABILITY := ?},
3025 {pDU_BSSGP_RA_CAPABILITY_UPDATE := ?},
3026 {pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := ?},
3027 {pDU_BSSGP_RADIO_STATUS := ?},
3028 {pDU_BSSGP_FLOW_CONTROL_BVC := ?},
3029 {pDU_BSSGP_FLOW_CONTROL_BVC_ACK := ?},
3030 {pDU_BSSGP_FLOW_CONTROL_MS := ?},
3031 {pDU_BSSGP_FLOW_CONTROL_MS_ACK := ?},
3032 {pDU_BSSGP_FLOW_CONTROL_PFC := ?},
3033 {pDU_BSSGP_FLOW_CONTROL_PFC_ACK := ?},
3034 {pDU_BSSGP_DOWNLOAD_BSS_PFC := ?},
3035 {pDU_BSSGP_CREATE_BSS_PFC := ?},
3036 {pDU_BSSGP_CREATE_BSS_PFC_ACK := ?},
3037 {pDU_BSSGP_CREATE_BSS_PFC_NACK := ?},
3038 {pDU_BSSGP_MODIFY_BSS_PFC := ?},
3039 {pDU_BSSGP_MODIFY_BSS_PFC_ACK := ?},
3040 {pDU_BSSGP_DELETE_BSS_PFC := ?},
3041 {pDU_BSSGP_DELETE_BSS_PFC_ACK := ?},
3042 {pDU_BSSGP_DELETE_BSS_PFC_REQ := ?},
3043 {pDU_BSSGP_PS_HANDOVER_REQUIRED := ?},
3044 {pDU_BSSGP_PS_HANDOVER_REQUIRED_ACK := ?},
3045 {pDU_BSSGP_PS_HANDOVER_REQUIRED_NACK := ?},
3046 {pDU_BSSGP_PS_HANDOVER_REQUEST := ?},
3047 {pDU_BSSGP_PS_HANDOVER_REQUEST_ACK := ?},
3048 {pDU_BSSGP_PS_HANDOVER_REQUEST_NACK := ?},
3049 {pDU_BSSGP_PS_HANDOVER_COMPLETE := ?},
3050 {pDU_BSSGP_PS_HANDOVER_COMPLETE_ACK := ?},
3051 {pDU_BSSGP_PS_HANDOVER_CANCEL := ?}
3052 );
3053
3054 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP := (
3055 tr_BSSGP_PERMITTED_PTP_ONLY,
3056 {pDU_BSSGP_PAGING_PS := ?},
3057 {pDU_BSSGP_PAGING_CS := ?},
3058 {pDU_BSSGP_STATUS := ?}
3059 );
3060
3061 /* PDU permitted on Signaling BVC only (TS 48.018 Section 5.4.1) */
3062 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN_ONLY := (
3063 {pDU_BSSGP_SUSPEND := ?},
3064 {pDU_BSSGP_SUSPEND_ACK := ?},
3065 {pDU_BSSGP_SUSPEND_NACK := ?},
3066 {pDU_BSSGP_RESUME := ?},
3067 {pDU_BSSGP_RESUME_ACK := ?},
3068 {pDU_BSSGP_RESUME_NACK := ?},
3069 {pDU_BSSGP_FLUSH_LL := ?},
3070 {pDU_BSSGP_FLUSH_LL_ACK := ?},
3071 {pDU_BSSGP_LLC_DISCARDED := ?},
3072 {pDU_BSSGP_BVC_BLOCK := ?},
3073 {pDU_BSSGP_BVC_BLOCK_ACK := ?},
3074 {pDU_BSSGP_BVC_UNBLOCK := ?},
3075 {pDU_BSSGP_BVC_UNBLOCK_ACK := ?},
3076 {pDU_BSSGP_BVC_RESET := ?},
3077 {pDU_BSSGP_BVC_RESET_ACK := ?},
3078 {pDU_BSSGP_SGSN_INVOKE_TRACE := ?},
3079 {pDU_BSSGP_PERFORM_LOCATION_REQUEST := ?},
3080 {pDU_BSSGP_PERFORM_LOCATION_RESPONSE := ?},
3081 {pDU_BSSGP_PERFORM_LOCATION_ABORT := ?},
3082 {pDU_BSSGP_POSITION_COMMAND := ?},
3083 {pDU_BSSGP_POSITION_RESPONSE := ?},
3084 {pDU_BSSGP_RAN_INFORMATION := ?},
3085 {pDU_BSSGP_RAN_INFORMATION_REQUEST := ?},
3086 {pDU_BSSGP_RAN_INFORMATION_ACK := ?},
3087 {pDU_BSSGP_RAN_INFORMATION_ERROR := ?},
3088 {pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := ?},
3089 {pDU_BSSGP_MBMS_SESSION_START_REQUEST := ?},
3090 {pDU_BSSGP_MBMS_SESSION_START_RESPONSE := ?},
3091 {pDU_BSSGP_MBMS_SESSION_STOP_REQUEST := ?},
3092 {pDU_BSSGP_MBMS_STOP_RESPONSE := ?},
3093 {pDU_BSSGP_SESSION_UPDATE_REQUEST := ?},
3094 {pDU_BSSGP_SESSION_UPDATE_RESPONSE := ?}
3095 );
3096
3097 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN := (
3098 tr_BSSGP_PERMITTED_SIGN_ONLY,
3099 {pDU_BSSGP_PAGING_PS := ?},
3100 {pDU_BSSGP_PAGING_CS := ?},
3101 {pDU_BSSGP_SUSPEND := ?},
3102 {pDU_BSSGP_STATUS := ?}
3103 );
3104
3105 /* PDU permitted on PTM BVC only (TS 48.018 Section 5.4.1) */
3106 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM_ONLY := (
3107 {pDU_BSSGP_DL_MBMS_UNITDATA := ?},
3108 {pDU_BSSGP_UL_MBMS_UNITDATA := ?}
3109 );
3110
3111 template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM := (
3112 tr_BSSGP_PERMITTED_PTM_ONLY,
3113 {pDU_BSSGP_STATUS := ?}
3114 );
3115
3116
3117 /* Template for any PTP BVCI IE */
3118 template (present) BVCI tr_BSSGP_IE_PtpBvci := {
3119 iEI := '04'O,
3120 ext := '1'B,
3121 lengthIndicator := {
3122 length1 := 2
3123 },
3124 unstructured_value := complement ('0000'O, '0001'O)
Harald Welte8f66af12020-11-12 17:27:58 +01003125 }
Harald Welte8f66af12020-11-12 17:27:58 +01003126
Daniel Willmann670bbc02020-11-19 16:39:39 +01003127 /* message on signaling PTP but containing a ptp BVC */
3128 /*
3129 template PDU_BSSGP tr_BSSGP_SIG_FOR_PTP(template Bvci bvci) := (
3130 {pDU_BSSGP_FLUSH_LL:{?,?,tr_BSSGP_IE_PtpBvci, *, *}},
3131 {pDU_BSSGP_FLUSH_LL_ACK:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}},
3132 {pDU_BSSGP_LLC_DISCARDED:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}},
3133 {pDU_BSSGP_BVC_BLOCK:{?,tr_BSSGP_IE_PtpBvci, ?}},
3134 {pDU_BSSGP_BVC_BLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}},
3135 {pDU_BSSGP_BVC_UNBLOCK:{?,tr_BSSGP_IE_PtpBvci}},
3136 {pDU_BSSGP_BVC_UNBLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}},
3137 {pDU_BSSGP_BVC_RESET:{?,tr_BSSGP_IE_PtpBvci,?,*,*,*}},
3138 {pDU_BSSGP_BVC_RESET_ACK:{?,tr_BSSGP_IE_PtpBvci,*,*,*}},
3139 {pDU_BSSGP_STATUS:{?,?,tr_BSSGP_IE_PtpBvci,*}},
3140 {pDU_BSSGP_PERFORM_LOCATION_REQUEST:{?,?,?,*,tr_BSSGP_IE_PtpBvci,?,?,?,*,*,*,*,*,*,*,*,*}},
3141 {pDU_BSSGP_PERFORM_LOCATION_RESPONSE:{?,?,tr_BSSGP_IE_PtpBvci,*,*,*,*,*,*}},
3142 {pDU_BSSGP_PERFORM_LOCATION_ABORT:{?,?,tr_BSSGP_IE_PtpBvci,?}},
3143 {pDU_BSSGP_POSITION_COMMAND:{
3144 );
3145 */
Harald Welte8f66af12020-11-12 17:27:58 +01003146
Daniel Willmann670bbc02020-11-19 16:39:39 +01003147 /* extract the BVCI IE of given PDU + return it */
3148 function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI {
3149 select (pdu) {
3150 case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) {
3151 return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old;
3152 }
3153 case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) {
3154 return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new;
3155 }
3156 case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) {
3157 return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI;
3158 }
3159 case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) {
3160 return pdu.pDU_BSSGP_BVC_BLOCK.bVCI;
3161 }
3162 case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) {
3163 return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI;
3164 }
3165 case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) {
3166 return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI;
3167 }
3168 case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) {
3169 return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI;
3170 }
3171 case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) {
3172 return pdu.pDU_BSSGP_BVC_RESET.bVCI;
3173 }
3174 case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) {
3175 return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI;
3176 }
3177 case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) {
3178 return pdu.pDU_BSSGP_STATUS.bVCI;
3179 }
3180 case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) {
3181 return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI;
3182 }
3183 case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) {
3184 return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI;
3185 }
3186 case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) {
3187 return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI;
3188 }
3189 case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) {
3190 return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI;
3191 }
3192 case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) {
3193 return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI;
3194 }
3195 case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) {
3196 return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI;
3197 }
3198 case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) {
3199 return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI;
3200 }
3201 case else {
3202 return omit;
3203 }
3204 }
3205 }
Harald Welte8f66af12020-11-12 17:27:58 +01003206
Daniel Willmann670bbc02020-11-19 16:39:39 +01003207 /* extract the BVCI IE of given PDU + convert it to integer value */
3208 function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci {
3209 var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu);
3210 if (istemplatekind(bvci_raw, "omit")) {
3211 return omit;
3212 }
3213 return oct2int(valueof(bvci_raw.unstructured_value));
3214 }
3215
3216 /* 3GPP TS 23.003 2.6 */
3217 type enumerated TlliType {
3218 TLLI_LOCAL,
3219 TLLI_FOREIGN,
3220 TLLI_RANDOM,
3221 TLLI_AUXILIARY,
3222 TLLI_RESERVED,
3223 TLLI_G_RNTI,
3224 TLLI_RAND_G_RNTI
3225 }
3226
3227 /* 3GPP TS 23.003 2.6 */
3228 function f_gprs_tlli_type(OCT4 tlli) return TlliType {
3229 var bitstring tllib := oct2bit(tlli);
3230 if (substr(tllib, 0, 2) == '11'B) {
3231 return TLLI_LOCAL;
3232 } else if (substr(tllib, 0, 2) == '10'B) {
3233 return TLLI_FOREIGN;
3234 } else if (substr(tllib, 0, 5) == '01111'B) {
3235 return TLLI_RANDOM;
3236 } else if (substr(tllib, 0, 4) == '0110'B) {
3237 return TLLI_RESERVED;
3238 } else if (substr(tllib, 0, 3) == '010'B) {
3239 return TLLI_RESERVED;
3240 } else if (substr(tllib, 0, 4) == '0000'B) {
3241 return TLLI_G_RNTI;
3242 } else if (substr(tllib, 0, 4) == '0001'B) {
3243 return TLLI_RAND_G_RNTI;
3244 } else {
3245 setverdict(fail, "Unknonw TLLI Type ", tllib);
3246 mtc.stop;
3247 }
3248 }
3249
3250 function f_gprs_tlli_random() return OCT4 {
3251 var OCT4 tlli := f_rnd_octstring(4);
3252 return tlli or4b 'c0000000'O;
3253 }
Harald Weltee0abc472018-02-05 09:13:31 +01003254
3255} with { encode "RAW" };