blob: 3de74271775648d7967c7a24189514e6669ba6a8 [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;
9 import from GSM_RR_Types all;
10 import from BSSGP_Types all
11 import from NS_Types all
12
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
70 template NS_SDU_ControlBits t_SduCtrlB := {
71 rBit := '0'B,
72 cBit := '0'B,
73 spare := '000000'B
74 }
75
76 function t_NS_IE_CAUSE(template NsCause cause) return template CauseNS {
77 var template CauseNS ret;
78 ret.iEI := '00'O;
79 ret.ext := '1'B;
80 ret.lengthIndicator := { length1 := 1 };
81 if (isvalue(cause)) {
82 ret.cause := int2oct(enum2int(valueof(cause)), 1);
83 } else {
84 ret.cause := ?
85 }
86 return ret;
87 }
88
89 private function f_oct_or_wc(template integer inp, integer len) return template octetstring {
90 if (isvalue(inp)) {
91 return int2oct(valueof(inp), len);
92 } else {
93 return ?
94 }
95 }
96
97 template NS_VCI t_NS_IE_NSVCI(template Nsvci nsvci) := {
98 iEI := '01'O,
99 ext := '1'B,
100 lengthIndicator := {
101 length1 := 2
102 },
103 nS_VCI := f_oct_or_wc(nsvci, 2)
104 }
105
106 template NSEI_NS t_NS_IE_NSEI(template Nsei nsei) := {
107 iEI:= '04'O,
108 ext := '1'B,
109 lengthIndicator := {
110 length1 := 2
111 },
112 nSEI := f_oct_or_wc(nsei, 2)
113 }
114
115 template PDU_NS t_NS_RESET(template NsCause cause, template Nsvci nsvci, template Nsei nsei) := {
116 pDU_NS_Reset := {
117 nsPduType := '02'O,
118 causeNS := t_NS_IE_CAUSE(cause),
119 nS_VCI := t_NS_IE_NSVCI(nsvci),
120 nSEI_NS := t_NS_IE_NSEI(nsei)
121 }
122 }
123
124 template PDU_NS t_NS_RESET_ACK(template Nsvci nsvci, template Nsei nsei) := {
125 pDU_NS_Reset_Ack := {
126 nsPduType := '03'O,
127 nS_VCI := t_NS_IE_NSVCI(nsvci),
128 nSEI_NS := t_NS_IE_NSEI(nsei)
129 }
130 }
131
132 template PDU_NS t_NS_BLOCK(template NsCause cause, template Nsvci nsvci) := {
133 pDU_NS_Block := {
134 nsPduType := '04'O,
135 causeNS := t_NS_IE_CAUSE(cause),
136 nS_VCI := t_NS_IE_NSVCI(nsvci)
137 }
138 }
139
140 template PDU_NS t_NS_BLOCK_ACK(template Nsvci nsvci) := {
141 pDU_NS_Block_Ack := {
142 nsPduType := '05'O,
143 nS_VCI := t_NS_IE_NSVCI(nsvci)
144 }
145 }
146
147 template PDU_NS t_NS_UNBLOCK := {
148 pDU_NS_Unblock := {
149 nsPduType := '06'O
150 }
151 }
152
153 template PDU_NS t_NS_UNBLOCK_ACK := {
154 pDU_NS_Unblock_Ack := {
155 nsPduType := '07'O
156 }
157 }
158
159 template PDU_NS t_NS_ALIVE := {
160 pDU_NS_Alive := {
161 nsPduType := '0A'O
162 }
163 }
164
165 template PDU_NS t_NS_ALIVE_ACK := {
166 pDU_NS_Alive_Ack := {
167 nsPduType := '0B'O
168 }
169 }
170
171 template PDU_NS ts_NS_STATUS(NsCause cause, PDU_NS pdu) := {
172 pDU_NS_Status := {
173 nsPduType := '08'O,
174 causeNS := t_NS_IE_CAUSE(cause),
175 nS_VCI := omit,
176 nS_PDU := {
177 iEI := '02'O,
178 ext := '1'B,
179 lengthIndicator := {
180 length1 := 0 /* overwritten */
181 },
182 ns_PDU := enc_PDU_NS(pdu)
183 },
184 bVCI_NS := omit,
185 listofIP4Elements := omit,
186 listofIP6Elements := omit
187 }
188 }
189
190 template PDU_NS t_NS_UNITDATA(template NS_SDU_ControlBits bits, template BssgpBvci bvci, template
191octetstring sdu) := {
192 pDU_NS_Unitdata := {
193 nsPduType := '00'O,
194 nS_SDU_ControlBits := bits,
195 bVCI := f_oct_or_wc(bvci, 2),
196 nS_SDU := sdu
197 }
198 }
199
200
201 type record BssgpCellId {
202 RoutingAreaIdentification ra_id,
203 CellIdentity cell_id
204 } with { variant "" };
205
206 type enumerated BssgpCause {
207 BSSGP_CAUSE_PROC_OVERLOAD ('00'H),
208 BSSGP_CAUSE_EQUIMENT_FAILURE ('01'H),
209 BSSGP_CAUSE_TRANSIT_NETWORK_FAILURE ('02'H),
210 BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS ('03'H),
211 BSSGP_CAUSE_UNKNOWN_MS ('04'H),
212 BSSGP_CAUSE_BVCI_UNKNOWN ('05'H),
213 BSSGP_CAUSE_CELL_TRAFFIC_CONGESTION ('06'H),
214 BSSGP_CAUSE_SGSN_CONGESTION ('07'H),
215 BSSGP_CAUSE_OM_INTERVENTION ('08'H),
216 BSSGP_CAUSE_BVCI_BLOCKED ('09'H),
217 BSSGP_CAUSE_PFC_CREATE_FAILURE ('0a'H),
218 BSSGP_CAUSE_PFC_PREEMPTED ('0b'H),
219 BSSGP_CAUSE_ABQP_NO_MORE_SUPPORTED ('0c'H),
220 BSSGP_CAUSE_SEMANTICALLY_INCORRECT_PDU ('20'H),
221 BSSGP_CAUSE_INVALID_MANDATORY_IE ('21'H),
222 BSSGP_CAUSE_MISSING_MANDATORY_IE ('22'H),
223 BSSGP_CAUSE_MISSING_CONDITIONAL_IE ('23'H),
224 BSSGP_CAUSE_UNEXPECTED_CONDITIONAL_IE ('24'H),
225 BSSGP_CAUSE_CONDITIONAL_IE_ERROR ('25'H),
226 BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('26'H),
227 BSSGP_CAUSE_PROTOCOL_ERROR_UNSPECIFIED ('27'H),
228 BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_FEATURE_SET ('28'H),
229 BSSGP_CAUSE_REQUESTED_INFO_NOT_AVAILABLE ('29'H),
230 BSSGP_CAUSE_UNKNOWN_DESTINATION_ADDRESS ('2a'H),
231 BSSGP_CAUSE_UNKNOWN_RIM_APP_IDENTITY ('2b'H),
232 BSSGP_CAUSE_INVALID_CONTAINER_UNIT_INFO ('2c'H),
233 BSSGP_CAUSE_PFC_QUEUING ('2d'H),
234 BSSGP_CAUSE_PFC_CREATED_SUCCESSFULLY ('2e'H),
235 BSSGP_CAUSE_T12_EXPIRY ('2f'H),
236 BSSGP_CAUSE_MS_UNDER_PS_HANDOVER_TREATMENT ('30'H),
237 BSSGP_CAUSE_UPLINK_QUALITY ('31'H),
238 BSSGP_CAUSE_UPLINK_STRENGTH ('32'H),
239 BSSGP_CAUSE_DOWNLINK_QUALITY ('33'H),
240 BSSGP_CAUSE_DOWNLINK_STRENGTH ('34'H),
241 BSSGP_CAUSE_DISTANCE ('35'H),
242 BSSGP_CAUSE_BETTER_CELL ('36'H),
243 BSSGP_CAUSE_TRAFFIC ('37'H),
244 BSSGP_CAUSE_OM_INTERVENTION2 ('38'H),
245 BSSGP_CAUSE_MS_BACK_ON_OLD_CHANNEL ('39'H),
246 BSSGP_CAUSE_T13_EXPIRY ('3a'H),
247 BSSGP_CAUSE_T14_EXPIRY ('3b'H),
248 BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED ('3c'H)
249 } with { variant "FIELDLENGTH(8)" };
250
251
252 template BVCI t_BSSGP_BVCI(template BssgpBvci bvci) := {
253 iEI := '04'O,
254 ext := '1'B,
255 lengthIndicator := {
256 length1 := 2
257 },
258 unstructured_value := f_oct_or_wc(bvci, 2)
259 }
260
261 template IMSI_BSSGP tr_BSSGP_IMSI(template hexstring imsi) := {
262 iEI := '0D'O,
263 ext := '1'B,
264 lengthIndicator := ?,
265 type_of_Identity := '001'B,
266 oddevenIndicator := ?,
267 digits := imsi
268 }
269
270 template IMSI_BSSGP ts_BSSGP_IMSI(hexstring imsi) := {
271 iEI := '0D'O,
272 ext := '1'B,
273 lengthIndicator := { length1 := 0 /* overwritten */ },
274 type_of_Identity := '001'B,
275 oddevenIndicator := f_hex_is_odd_length(imsi),
276 digits := imsi
277 }
278
279 template TMSI_BSSGP ts_BSSGP_TMSI(GsmTmsi tmsi) := {
280 iEI := '20'O,
281 ext := '1'B,
282 lengthIndicator := { length1 := 4 },
283 tMSI_Value := int2oct(tmsi, 4)
284 }
285
286 function f_bssgp_length_ind(integer len) return LIN2_2a {
287 var LIN2_2a ret;
288 if (len > 255) {
289 ret := { length2 := len };
290 } else {
291 ret := { length1 := len };
292 }
293 return ret;
294 }
295
296 template LLC_PDU ts_BSSGP_LLC_PDU(octetstring pdu) := {
297 iEI := '0D'O,
298 ext := '1'B,
299 lengthIndicator := f_bssgp_length_ind(lengthof(pdu)),
300 lLC_PDU := pdu
301 }
302
303 template LLC_PDU tr_BSSGP_LLC_PDU(template octetstring pdu := ?) := {
Harald Welte7024baa2018-03-02 23:37:51 +0100304 iEI := '0E'O,
305 ext := ?,
Harald Weltee0abc472018-02-05 09:13:31 +0100306 lengthIndicator := ?,
307 lLC_PDU := pdu
308 }
309
310 function t_BSSGP_CAUSE(template BssgpCause cause) return template Cause_BSSGP {
311 var template Cause_BSSGP ret;
Harald Weltebacca282018-03-02 16:03:59 +0100312 ret.iEI := '07'O;
Harald Weltee0abc472018-02-05 09:13:31 +0100313 ret.ext := '1'B;
314 ret.lengthIndicator := { length1 := 1 };
315 if (isvalue(cause)) {
316 ret.cause_Value := int2oct(enum2int(valueof(cause)), 1);
317 } else {
318 ret.cause_Value := ?
319 }
320 return ret;
321 }
322
323 function t_BSSGP_IE_CellId(template BssgpCellId cid) return template Cell_Identifier {
324 var template Cell_Identifier ret := {
325 iEI := '08'O,
326 ext := '1'B,
327 lengthIndicator := { length1 := 8 },
328 mccDigit1 := ?,
329 mccDigit2 := ?,
330 mccDigit3 := ?,
331 mncDigit3 := ?,
332 mncDigit1 := ?,
333 mncDigit2 := ?,
334 lac := ?,
335 rac := ?,
336 cI_value := ?
337 }
338 if (istemplatekind(cid, "omit")) {
339 return omit;
340 } else if (istemplatekind(cid, "*")) {
341 return *;
342 } else if (istemplatekind(cid, "?")) {
343 return ?;
344 }
345 if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) {
346 if (isvalue(cid.ra_id.lai.mcc_mnc)) {
347 ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0];
348 ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
349 ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
350 ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[5];
351 ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[4];
352 ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[3];
353 }
354 if (isvalue(cid.ra_id.lai.lac)) {
355 ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
356 }
357 }
358 if (isvalue(cid) and isvalue(cid.ra_id)) {
359 ret.rac := f_oct_or_wc(cid.ra_id.rac, 1);
360 }
361 if (isvalue(cid)) {
362 ret.cI_value := f_oct_or_wc(cid.cell_id, 2);
363 }
364 return ret;
365 }
366
367 template PDU_BSSGP ts_BVC_RESET(BssgpCause cause, BssgpBvci bvci,
368 template BssgpCellId cell_id) := {
369 pDU_BSSGP_BVC_RESET := {
370 bssgpPduType := '22'O,
371 bVCI := t_BSSGP_BVCI(bvci),
372 cause := t_BSSGP_CAUSE(cause),
373 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
374 feature_bitmap := omit,
375 extended_Feature_Bitmap := omit
376 }
377 }
378
379 template PDU_BSSGP tr_BVC_RESET(template BssgpCause cause, template BssgpBvci bvci,
380 template BssgpCellId cell_id) := {
381 pDU_BSSGP_BVC_RESET := {
382 bssgpPduType := '22'O,
383 bVCI := t_BSSGP_BVCI(bvci),
384 cause := t_BSSGP_CAUSE(cause),
385 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
386 feature_bitmap := *,
387 extended_Feature_Bitmap := *
388 }
389 }
390
391 template PDU_BSSGP ts_BVC_RESET_ACK(BssgpBvci bvci, template BssgpCellId cell_id) := {
392 pDU_BSSGP_BVC_RESET_ACK := {
393 bssgpPduType := '23'O,
394 bVCI := t_BSSGP_BVCI(bvci),
395 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
396 feature_bitmap := omit,
397 extended_Feature_Bitmap := omit
398 }
399 }
400
401 template PDU_BSSGP tr_BVC_RESET_ACK(template BssgpBvci bvci, template BssgpCellId cell_id) := {
402 pDU_BSSGP_BVC_RESET_ACK := {
403 bssgpPduType := '23'O,
404 bVCI := t_BSSGP_BVCI(bvci),
405 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
406 feature_bitmap := *,
407 extended_Feature_Bitmap := *
408 }
409 }
410
411
412 template PDU_BSSGP t_BVC_UNBLOCK(template BssgpBvci bvci) := {
413 pDU_BSSGP_BVC_UNBLOCK := {
414 bssgpPduType := '24'O,
415 bVCI := t_BSSGP_BVCI(bvci)
416 }
417 }
418
419 template PDU_BSSGP t_BVC_UNBLOCK_ACK(template BssgpBvci bvci) := {
420 pDU_BSSGP_BVC_UNBLOCK_ACK := {
421 bssgpPduType := '25'O,
422 bVCI := t_BSSGP_BVCI(bvci)
423 }
424 }
425
426 template PDU_BSSGP t_BVC_BLOCK(template BssgpBvci bvci, template BssgpCause cause) := {
427 pDU_BSSGP_BVC_BLOCK := {
428 bssgpPduType := '20'O,
429 bVCI := t_BSSGP_BVCI(bvci),
430 cause := t_BSSGP_CAUSE(cause)
431 }
432 }
433
434 template PDU_BSSGP t_BVC_BLOCK_ACK(template BssgpBvci bvci) := {
435 pDU_BSSGP_BVC_BLOCK_ACK := {
436 bssgpPduType := '21'O,
437 bVCI := t_BSSGP_BVCI(bvci)
438 }
439 }
440
441 template PDU_BSSGP t_BVC_FC_BVC(uint16_t bmax, uint16_t bucket_leak_rate,
442 uint16_t bmax_default_ms, uint16_t r_default_ms, OCT1 tag) := {
443 pDU_BSSGP_FLOW_CONTROL_BVC := {
444 bssgpPduType := '26'O,
445 tag := {
446 iEI := '1E'O,
447 ext := '1'B,
448 lengthIndicator := {
Harald Welteedcdd902018-03-02 22:04:54 +0100449 length1 := 1
Harald Weltee0abc472018-02-05 09:13:31 +0100450 },
451 unstructured_Value := tag
452 },
453 bVC_Bucket_Size := {
454 iEI := '05'O,
455 ext := '1'B,
456 lengthIndicator := {
457 length1 := 2
458 },
459 bmax := f_oct_or_wc(bmax, 2)
460 },
461 bucket_Leak_Rate := {
462 iEI := '03'O,
463 ext := '1'B,
464 lengthIndicator := {
Harald Welteedcdd902018-03-02 22:04:54 +0100465 length1 := 2
Harald Weltee0abc472018-02-05 09:13:31 +0100466 },
467 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
468 },
469 bmax_default_MS := {
470 iEI := '01'O,
471 ext := '1'B,
472 lengthIndicator := {
473 length1 := 2
474 },
475 bmax := f_oct_or_wc(bmax_default_ms, 2)
476 },
477 r_default_MS := {
478 iEI := '1C'O,
479 ext := '1'B,
480 lengthIndicator := {
481 length1 := 2
482 },
483 r_default_MS_value := f_oct_or_wc(r_default_ms, 2)
484 },
485 bucket_Full_Ratio := omit,
486 bVC_Measurement := omit,
487 flow_Control_Granularity := omit
488 }
489 }
Harald Welteedcdd902018-03-02 22:04:54 +0100490 template PDU_BSSGP tr_BVC_FC_BVC(template uint16_t bmax := ?,
491 template uint16_t bucket_leak_rate := ?,
492 template uint16_t bmax_default_ms := ?,
493 template uint16_t r_default_ms := ?,
494 template OCT1 tag := ?) := {
495 pDU_BSSGP_FLOW_CONTROL_BVC := {
496 bssgpPduType := '26'O,
497 tag := {
498 iEI := '1E'O,
499 ext := '1'B,
500 lengthIndicator := {
501 length1 := 1
502 },
503 unstructured_Value := tag
504 },
505 bVC_Bucket_Size := {
506 iEI := '05'O,
507 ext := '1'B,
508 lengthIndicator := {
509 length1 := 2
510 },
511 bmax := f_oct_or_wc(bmax, 2)
512 },
513 bucket_Leak_Rate := {
514 iEI := '03'O,
515 ext := '1'B,
516 lengthIndicator := {
517 length1 := 2
518 },
519 r_Value := f_oct_or_wc(bucket_leak_rate, 2)
520 },
521 bmax_default_MS := {
522 iEI := '01'O,
523 ext := '1'B,
524 lengthIndicator := {
525 length1 := 2
526 },
527 bmax := f_oct_or_wc(bmax_default_ms, 2)
528 },
529 r_default_MS := {
530 iEI := '1C'O,
531 ext := '1'B,
532 lengthIndicator := {
533 length1 := 2
534 },
535 r_default_MS_value := f_oct_or_wc(r_default_ms, 2)
536 },
537 bucket_Full_Ratio := *,
538 bVC_Measurement := *,
539 flow_Control_Granularity := *
540 }
541 }
542
Harald Weltee0abc472018-02-05 09:13:31 +0100543 template PDU_BSSGP t_BVC_FC_BVC_ACK(template OCT1 tag) := {
544 pDU_BSSGP_FLOW_CONTROL_BVC_ACK := {
545 bssgpPduType := '27'O,
546 tag := {
547 iEI := '1E'O,
548 ext := '1'B,
549 lengthIndicator := {
550 length1 := 2
551 },
552 unstructured_Value := tag
553 }
554 }
555 }
556
557 template PDU_BSSGP ts_BSSGP_STATUS(template BssgpBvci bvci, template BssgpCause cause,
558 PDU_BSSGP pdu) := {
559 pDU_BSSGP_STATUS := {
560 bssgpPduType := '0A'O,
561 cause := t_BSSGP_CAUSE(cause),
562 bVCI := t_BSSGP_BVCI(bvci),
563 pDU_in_Error := {
564 iEI := '15'O,
565 ext := '1'B,
566 lengthIndicator := {
567 length1 := 0 /* overwritten */
568 },
569 erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu)
570 }
571 }
572 }
573
574 template QoS_Profile_V t_defaultQos := {
575 peak_Bit_Rate := int2oct(80, 2),
576 precedence := '000'B,
577 a_bit := '0'B,
578 t_bit := '0'B,
579 c_r_bit := '0'B,
580 peakBitRateGranularity := '00'B
581 }
582
583 template QoS_Profile ts_QoS_TLV(template QoS_Profile_V qos) := {
584 iEI := '18'O,
585 ext := '1'B,
586 lengthIndicator := { length1 := 3 },
587 peak_Bit_Rate := qos.peak_Bit_Rate,
588 precedence := qos.precedence,
589 a_bit := qos.a_bit,
590 t_bit := qos.t_bit,
591 c_r_bit := qos.c_r_bit,
592 peakBitRateGranularity := qos.peakBitRateGranularity
593 }
594
595 template PDU_Lifetime t_DefaultLifetime(uint16_t delay := 65535) := {
596 iEI := '16'O,
597 ext := '1'B,
598 lengthIndicator := {
599 length1 := 2
600 },
601 delay_Value := f_oct_or_wc(delay, 2)
602 }
603
604 template PDU_BSSGP ts_BSSGP_DL_UD(GprsTlli tlli, octetstring pdu) := {
605 pDU_BSSGP_DL_UNITDATA := {
606 bssgpPduType := '00'O,
Harald Welteacc93ab2018-03-02 21:39:09 +0100607 tLLI_current := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +0100608 qoS_Profile := t_defaultQos,
609 pDU_Lifetime := t_DefaultLifetime(65535),
610 mS_Radio_Access_Capability := omit,
611 priority := omit,
612 dRX_Parameters := omit,
613 iMSI := omit,
614 tLLI_old := omit,
615 pFI := omit,
616 lSA_Information := omit,
617 service_UTRAN_CCO := omit,
618 service_Class_Indicator := omit,
619 subscriber_Profile_ID_For_RAT_Priority := omit,
620 redirection_Indication := omit,
621 redirection_Completed := omit,
622 unconfirmed_Send_State_Variable := omit,
623 sCI := omit,
624 gGSN_PGW_Location := omit,
625 eDRX_Paremeters := omit,
626 old_Routing_Area_Identification := omit,
627 attach_Indicator := omit,
628 alignment_octets := omit,
629 lLC_PDU := ts_BSSGP_LLC_PDU(pdu),
630 initialLLC_PDU := omit
631 }
632 }
633
634 template PDU_BSSGP tr_BSSGP_DL_UD := {
635 pDU_BSSGP_DL_UNITDATA := {
636 bssgpPduType := '00'O,
637 tLLI_current := ?,
638 qoS_Profile := ?,
639 pDU_Lifetime := ?,
640 mS_Radio_Access_Capability := *,
641 priority := *,
642 dRX_Parameters := *,
643 iMSI := *,
644 tLLI_old := *,
645 pFI := *,
646 lSA_Information := *,
647 service_UTRAN_CCO := *,
648 service_Class_Indicator := *,
649 subscriber_Profile_ID_For_RAT_Priority := *,
650 redirection_Indication := *,
651 redirection_Completed := *,
652 unconfirmed_Send_State_Variable := *,
653 sCI := *,
654 gGSN_PGW_Location := *,
655 eDRX_Paremeters := *,
656 old_Routing_Area_Identification := *,
657 attach_Indicator := *,
658 alignment_octets := *,
659 lLC_PDU := tr_BSSGP_LLC_PDU,
660 initialLLC_PDU := *
661 }
662 }
663
Harald Welteacc93ab2018-03-02 21:39:09 +0100664 template PDU_BSSGP ts_BSSGP_UL_UD(GprsTlli tlli, BssgpCellId cell_id, octetstring payload) := {
Harald Welte78d9f272018-02-16 18:13:45 +0100665 pDU_BSSGP_UL_UNITDATA := {
666 bssgpPduType := '01'O,
667 tLLI := tlli,
668 qoS_Profile := t_defaultQos,
669 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
670 pFI := omit,
671 lSA_Identifier_List := omit,
672 redirect_Attempt_Flag := omit,
673 iMSI_BSSGP := omit,
674 unconfirmed_Send_State_Variable := omit,
675 selected_PLMN_ID := omit,
676 selected_Operator := omit,
677 cS_Registered_Operator := omit,
678 alignment_octets := omit,
679 lLC_PDU := ts_BSSGP_LLC_PDU(payload)
680 }
681 }
682
Harald Weltee0abc472018-02-05 09:13:31 +0100683 template PDU_BSSGP tr_BSSGP_UL_UD(template GprsTlli tlli := ?, template BssgpCellId cell_id := ?,
684 template octetstring payload := ?) := {
685 pDU_BSSGP_UL_UNITDATA := {
686 bssgpPduType := '01'O,
Harald Welteacc93ab2018-03-02 21:39:09 +0100687 tLLI := tlli,
Harald Weltee0abc472018-02-05 09:13:31 +0100688 qoS_Profile := ?,
689 cell_Identifier := t_BSSGP_IE_CellId(cell_id),
690 pFI := *,
691 lSA_Identifier_List := *,
692 redirect_Attempt_Flag := *,
693 iMSI_BSSGP := *,
694 unconfirmed_Send_State_Variable := *,
695 selected_PLMN_ID := *,
696 selected_Operator := *,
697 cS_Registered_Operator := *,
698 alignment_octets := *,
699 lLC_PDU := tr_BSSGP_LLC_PDU(payload)
700 }
701 }
702
Harald Welte78d9f272018-02-16 18:13:45 +0100703 template PDU_BSSGP tr_BSSGP_PS_PAGING(BssgpBvci bvci) := {
704 pDU_BSSGP_PAGING_PS := {
705 bssgpPduType := '06'O,
706 iMSI := ?,
707 dRX_Parameters := *,
708 paging_Field4 := {
709 bVCI := t_BSSGP_BVCI(bvci)
710 },
711 pFI := *,
712 aBQP := *,
713 qoS_Profile := ?,
714 pTMSI := *,
715 eDRX_Paremeters := *
716 }
717 }
718
Harald Weltee0abc472018-02-05 09:13:31 +0100719 template PDU_BSSGP ts_BSSGP_PS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := {
720 pDU_BSSGP_PAGING_PS := {
721 bssgpPduType := '06'O,
722 iMSI := ts_BSSGP_IMSI(imsi),
723 dRX_Parameters := omit,
724 paging_Field4 := {
725 bVCI := t_BSSGP_BVCI(bvci)
726 },
727 pFI := omit,
728 aBQP := omit,
729 qoS_Profile := ts_QoS_TLV(t_defaultQos),
730 pTMSI := omit,
731 eDRX_Paremeters := omit
732 }
733 }
734
735 template PDU_BSSGP ts_BSSGP_PS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := {
736 pDU_BSSGP_PAGING_PS := {
737 bssgpPduType := '06'O,
738 iMSI := ts_BSSGP_IMSI(imsi),
739 dRX_Parameters := omit,
740 paging_Field4 := {
741 bVCI := t_BSSGP_BVCI(bvci)
742 },
743 pFI := omit,
744 aBQP := omit,
745 qoS_Profile := ts_QoS_TLV(t_defaultQos),
746 pTMSI := ts_BSSGP_TMSI(tmsi),
747 eDRX_Paremeters := omit
748 }
749 }
750
751
752} with { encode "RAW" };