blob: 2b437518c435b4fb141c2693f19538306a635cc1 [file] [log] [blame]
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +07001/**
2 * GSM Rest Octets definitions as per 3GPP TS 44.018.
3 *
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +07004 * (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +07005 * (C) 2020 Vadim Yanitskiy <axilirator@gmail.com>
6 * All rights reserved.
7 *
8 * Released under the terms of GNU General Public License, Version 2 or
9 * (at your option) any later version.
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 */
13
14module GSM_RestOctets {
15
16import from General_Types all;
17import from Osmocom_Types all;
18
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +070019/* 10.5.2.33b SI 2quater Rest Octets */
20type record SI2quaterRestOctets {
21 BIT1 ba_ind,
22 BIT1 ba_3g_ind,
23 BIT1 mp_change_mark,
24 uint4_t si2quater_index,
25 uint4_t si2quater_count,
26
27 /* Measurement Parameters Description */
28 MeasParamsDescOpt meas_params_desc,
29 /* GPRS specific parameters */
30 record {
31 GPRS_RealTimeDiffDescOpt rt_diff_desc,
32 GPRS_BSICDescOpt bsic_desc,
33 GPRS_ReportPrioDescOpt rep_prio_desc,
34 MeasParamsDescOpt meas_params_desc
35 } gprs,
36 /* NC Measurement Parameters Description */
37 NCMeasParamsOpt nc_meas_params,
38 /* SI2quater Extension Information */
39 SI2quaterExtInfoOpt ext_info,
40
41 /* 3G Neighbour Cell Description */
42 UTRAN_NeighDescOpt utran_neigh_desc,
43 /* 3G Measurement Parameters Description */
44 UTRAN_MeasParamsDescOpt utran_meas_params_desc,
45 /* GPRS 3G Measurement Parameters Description */
46 UTRAN_GPRSMeasParamsDescOpt utran_gprs_meas_params_desc,
47
48 /* SI2quater Rel-{5,6,7,8,9,10} Additions (Matrioshka!) */
49 SI2quaterAdditions rel_additions
50} with {
51 /* The TITAN's RAW encoder generates an octet-aligned octetstring,
52 * so we should make sure that unused bits contain proper padding. */
53 variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
54};
55
56/* Measurement Parameters Description */
57private type record MeasParamsDescOpt {
58 BIT1 presence, // 0/1
59 MeasParamsDesc desc optional
60} with {
61 variant (desc) "PRESENCE(presence = '1'B)"
62};
63
64private type record MeasParamsDesc {
65 BIT1 report_type,
66 BIT2 serving_band_reporting
67} with { variant "" };
68
69/* GPRS Real Time Difference Description (not implemented) */
70private type record GPRS_RealTimeDiffDescOpt {
71 BIT1 presence ('0'B), // 0/1
72 bitstring desc optional // TODO
73} with {
74 variant (desc) "PRESENCE(presence = '1'B)"
75};
76
77/* GPRS BSIC Description (not implemented) */
78private type record GPRS_BSICDescOpt {
79 BIT1 presence ('0'B), // 0/1
80 bitstring desc optional // TODO
81} with {
82 variant (desc) "PRESENCE(presence = '1'B)"
83};
84
85/* GPRS Report Priority Description (not implemented) */
86private type record GPRS_ReportPrioDescOpt {
87 BIT1 presence ('0'B), // 0/1
88 bitstring desc optional // TODO
89} with {
90 variant (desc) "PRESENCE(presence = '1'B)"
91};
92
93/* NC (Network Controlled?) Measurement Parameters */
94private type record NCMeasParams {
95 /* Network Control Order */
96 BIT2 nco,
97 BIT1 p_presence,
98 NCMeasPeriods p optional
99} with {
100 variant (p) "PRESENCE(p_presence = '1'B)"
101};
102
103/* NC Measurement Periods */
104private type record NCMeasParamsOpt {
105 BIT1 presence, // 0/1
106 NCMeasParams params optional
107} with {
108 variant (params) "PRESENCE(presence = '1'B)"
109};
110
111private type record NCMeasPeriods {
112 BIT3 non_drx_period,
113 BIT3 rep_period_i,
114 BIT3 rep_period_t
115} with { variant "" };
116
117/* SI2quater Extersion Information */
118private type record SI2quaterExtInfoOpt {
119 BIT1 presence, // 0/1
120 SI2quaterExtInfo info optional
121} with {
122 variant (info) "PRESENCE(presence = '1'B)"
123};
124
125private type record SI2quaterExtInfo {
126 uint8_t len,
127 CCNSupportDescOpt ccn_supp_desc optional,
128 bitstring padding /* Octet alignment? */
129} with {
130 variant (len) "LENGTHTO(ccn_supp_desc,padding) + 1"
131 variant (len) "UNIT(bits)"
132};
133
134/* CCN Support Description */
135private type record CCNSupportDescOpt {
136 BIT1 presence, // 0/1
137 CCNSupportDesc desc optional
138} with {
139 variant (desc) "PRESENCE(presence = '1'B)"
140};
141
142private type record CCNSupportDesc {
143 uint7_t nr_of_cells,
144 bitstring ccn_supported
145} with {
146 variant (nr_of_cells) "LENGTHTO(ccn_supported)"
147 variant (nr_of_cells) "UNIT(bits)"
148};
149
150/* 3G Neighbour Cell Description */
151private type record UTRAN_NeighDescOpt {
152 BIT1 presence, // 0/1
153 UTRAN_NeighDesc desc optional
154} with {
155 variant (desc) "PRESENCE(presence = '1'B)"
156};
157
158private type record UTRAN_NeighDesc {
159 BIT1 idx_start_3g_presence,
160 uint7_t idx_start_3g optional,
161 BIT1 abs_idx_start_emr_presence,
162 uint7_t abs_idx_start_emr optional,
163 UTRAN_FDDDescOpt fdd_desc,
164 UTRAN_TDDDescOpt tdd_desc
165} with {
166 variant (idx_start_3g) "PRESENCE(idx_start_3g_presence = '1'B)"
167 variant (abs_idx_start_emr) "PRESENCE(abs_idx_start_emr_presence = '1'B)"
168};
169
170/* UTRAN (3G) FDD/TDD Description (not implementaed).
171 *
172 * TODO: Repeated UTRAN FDD/TDD Neighbour Cells structure contains a variable length
173 * field, that needs to be computed using tables (see 9.1.54.1a and 9.1.54.1b) with
174 * magic numbers. This cannot be described uing TITAN's RAW codec attributes. */
175private type record UTRAN_FDDDescOpt {
176 BIT1 presence ('0'B), // 0/1
177 bitstring desc optional // TODO
178} with {
179 variant (desc) "PRESENCE(presence = '1'B)"
180};
181
182private type record UTRAN_TDDDescOpt {
183 BIT1 presence ('0'B), // 0/1
184 bitstring desc optional // TODO
185} with {
186 variant (desc) "PRESENCE(presence = '1'B)"
187};
188
189/* 3G Measurement Parameters Description (not implemented) */
190private type record UTRAN_MeasParamsDescOpt {
191 BIT1 presence ('0'B), // 0/1
192 bitstring desc optional // TODO
193} with {
194 variant (desc) "PRESENCE(presence = '1'B)"
195};
196
197/* GPRS 3G Measurement Parameters Description (not implemented) */
198private type record UTRAN_GPRSMeasParamsDescOpt {
199 BIT1 presence ('0'B), // 0/1
200 bitstring desc optional // TODO
201} with {
202 variant (desc) "PRESENCE(presence = '1'B)"
203};
204
205/* SI2quater Rel-{5,6,7,8,9,10} Additions */
206private type record SI2quaterAdditions {
207 BIT1 rel5_presence, // L/H
208 SI2quaterR5Additions rel5 optional
209} with {
210 variant (rel5_presence) "CSN.1 L/H"
211 variant (rel5) "PRESENCE(rel5_presence = '1'B)"
212};
213
214/* SI2quater Rel-5 and Rel-{6,7,8,9,10} Additions */
215private type record SI2quaterR5Additions {
216 UMTS_AddMeasParamsDescOpt umts_add_meas_params_desc,
217 UMTS_AddMeasParamsDesc2Opt umts_add_meas_params_desc2,
218 BIT1 rel6_presence, // L/H
219 SI2quaterR6Additions rel6 optional
220} with {
221 variant (rel6_presence) "CSN.1 L/H"
222 variant (rel6) "PRESENCE(rel6_presence = '1'B)"
223};
224
225/* 3G Additional Measurement Parameters Description */
226private type record UMTS_AddMeasParamsDescOpt {
227 BIT1 presence, // 0/1
228 UMTS_AddMeasParamsDesc desc optional
229} with {
230 variant (desc) "PRESENCE(presence = '1'B)"
231};
232
233private type record UMTS_AddMeasParamsDesc {
234 BIT3 fdd_qmin_offset,
235 BIT4 fdd_rscpmin
236} with { variant "" };
237
238/* 3G Additional Measurement Parameters Description 2 */
239private type record UMTS_AddMeasParamsDesc2Opt {
240 BIT1 presence, // 0/1
241 UMTS_AddMeasParamsDesc desc optional
242} with {
243 variant (desc) "PRESENCE(presence = '1'B)"
244};
245
246private type record UMTS_AddMeasParamsDesc2 {
247 /* FDD Reporting Threshold 2 */
248 BIT1 presence, // 0/1
249 uint6_t threshold optional
250} with {
251 variant (threshold) "PRESENCE(presence = '1'B)"
252};
253
254/* SI2quater Rel-6 and Rel-{7,8,9,10} Additions */
255private type record SI2quaterR6Additions {
256 BIT1 umts_ccn_active,
257 BIT1 rel7_presence, // L/H
258 SI2quaterR7Additions rel7 optional
259} with {
260 variant (rel7_presence) "CSN.1 L/H"
261 variant (rel7) "PRESENCE(rel7_presence = '1'B)"
262};
263
264/* SI2quater Rel-7 and Rel-{8,9,10} Additions */
265private type record SI2quaterR7Additions {
266 Rel7RepOffseThresholdOpt rep700,
267 Rel7RepOffseThresholdOpt rep810,
268 BIT1 rel8_presence, // L/H
269 SI2quaterR8Additions rel8 optional
270} with {
271 variant (rel8_presence) "CSN.1 L/H"
272 variant (rel8) "PRESENCE(rel8_presence = '1'B)"
273};
274
275/* Additions in Rel-7: Reporting Offset & Threshold */
276private type record Rel7RepOffseThresholdOpt {
277 BIT1 presence, // 0/1
278 Rel7RepOffseThreshold val optional
279} with {
280 variant (val) "PRESENCE(presence = '1'B)"
281};
282
283private type record Rel7RepOffseThreshold {
284 BIT3 offset,
285 BIT3 threshold
286} with { variant "" };
287
288/* SI2quater Rel-8 and Rel-{9,10} Additions */
289private type record SI2quaterR8Additions {
290 Rel8PrioEUTRANParamsDescOpt prio_eutran_params_desc,
291 Rel8UTRANCSGDescOpt utran_csg_desc,
292 Rel8EUTRANCSGDescOpt eutran_csg_desc
293 // TODO: Rel9 Additions (not implemented)
294} with { variant "" };
295
296/* Additions in Rel-8: Priority and E-UTRAN Parameters Description */
297private type record Rel8PrioEUTRANParamsDescOpt {
298 BIT1 presence, // 0/1
299 Rel8PrioEUTRANParamsDesc desc optional
300} with {
301 variant (desc) "PRESENCE(presence = '1'B)"
302};
303
304private type record Rel8PrioEUTRANParamsDesc {
305 ServingCellPrioParamsDescOpt sc_prio_params_desc,
306 UTRAN_PrioParamsDescOpt utran_prio_params_desc,
307 EUTRAN_ParamsDescOpt eutran_params_desc
308} with { variant "" };
309
310/* Serving Cell Priority Parameters Description */
311private type record ServingCellPrioParamsDescOpt {
312 BIT1 presence, // 0/1
313 ServingCellPrioParamsDesc desc optional
314} with {
315 variant (desc) "PRESENCE(presence = '1'B)"
316};
317
318private type record ServingCellPrioParamsDesc {
319 uint3_t geran_priority,
320 uint4_t thresh_priority_search,
321 uint4_t thresh_gsm_low,
322 uint2_t h_prio,
323 uint2_t t_reselection
324} with { variant "" };
325
326/* 3G Priority Parameters Description (not implemented) */
327private type record UTRAN_PrioParamsDescOpt {
328 BIT1 presence, // 0/1
329 bitstring desc optional // TODO
330} with {
331 variant (desc) "PRESENCE(presence = '1'B)"
332};
333
334/* E-UTRAN Parameters Description */
335private type record EUTRAN_ParamsDescOpt {
336 BIT1 presence, // 0/1
337 EUTRAN_ParamsDesc desc optional
338} with {
339 variant (desc) "PRESENCE(presence = '1'B)"
340};
341
342private type record EUTRAN_ParamsDesc {
343 BIT1 ccn_active,
344 BIT1 e_start,
345 BIT1 e_stop,
346
347 /* E-UTRAN Measurement Parameters Description */
348 EUTRAN_MeasParamsDescOpt meas_params_desc,
349 /* GPRS E-UTRAN Measurement Parameters Description */
350 EUTRAN_GPRSMeasParamsDescOpt gprs_meas_params_desc,
351
352 /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200353 EUTRAN_RepeatedNeighbourCells repeated_neigh_cells optional,
354 BIT1 repeated_neigh_cells_term ('0'B),
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700355 /* { 1 < Repeated E-UTRAN Not Allowed Cells > } ** 0 */
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200356 EUTRAN_RepeatedNotAllowedCells repeated_not_allowed_cells optional,
357 BIT1 repeated_not_allowed_cells_term ('0'B),
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700358 /* { 1 < Repeated E-UTRAN PCID to TA mapping > } ** 0 */
359 EUTRAN_PCID2TAMaps pcid2ta_map_list optional,
360 BIT1 pcid2ta_map_list_term ('0'B)
361} with { variant "" };
362
363/* E-UTRAN Measurement Parameters Description (not implemented) */
364private type record EUTRAN_MeasParamsDescOpt {
365 BIT1 presence, // 0/1
366 bitstring desc optional // TODO
367} with {
368 variant (desc) "PRESENCE(presence = '1'B)"
369};
370
371/* GPRS E-UTRAN Measurement Parameters Description (not implemented) */
372private type record EUTRAN_GPRSMeasParamsDescOpt {
373 BIT1 presence, // 0/1
374 bitstring desc optional // TODO
375} with {
376 variant (desc) "PRESENCE(presence = '1'B)"
377};
378
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200379/* Repeated E-UTRAN Neighbour Cells */
380private type record of EUTRAN_NeighbourCells EUTRAN_RepeatedNeighbourCells;
Vadim Yanitskiyeacec8a2020-07-03 06:44:40 +0700381type record EUTRAN_NeighbourCells {
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700382 BIT1 item_ind ('1'B),
383 /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */
384 EUTRAN_CellDescs cell_desc_list optional,
385 BIT1 cell_desc_list_term ('0'B),
386 BIT1 prio_presence, // 0/1
387 uint3_t prio optional,
388 uint5_t thresh_high,
389 BIT1 thresh_low_presence, // 0/1
390 uint5_t thresh_low optional,
391 BIT1 qrxlevmin_presence, // 0/1
392 uint5_t qrxlevmin optional
393} with {
394 variant "PRESENCE(item_ind = '1'B)"
395 variant (prio) "PRESENCE(prio_presence = '1'B)"
396 variant (thresh_low) "PRESENCE(thresh_low_presence = '1'B)"
397 variant (qrxlevmin) "PRESENCE(qrxlevmin_presence = '1'B)"
398};
399
400/* Repeated E-UTRAN Cell Description (E-ARFCN & Measurement Bandwidth) List */
Vadim Yanitskiyeacec8a2020-07-03 06:44:40 +0700401type record of EUTRAN_CellDesc EUTRAN_CellDescs;
402type record EUTRAN_CellDesc {
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700403 BIT1 item_ind ('1'B),
404 uint16_t e_arfcn,
405 BIT1 meas_bw_presence, // 0/1
406 uint3_t meas_bw optional
407} with {
408 variant "PRESENCE(item_ind = '1'B)"
409 variant (meas_bw) "PRESENCE(meas_bw_presence = '1'B)"
410};
411
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200412/* Repeated E-UTRAN Not Allowed Cells */
413private type record of EUTRAN_NotAllowedCells EUTRAN_RepeatedNotAllowedCells;
414private type record EUTRAN_NotAllowedCells {
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700415 BIT1 item_ind ('1'B),
416 /* FIXME: Not Allowed Cells : < PCID Group IE > (not implemented) */
417 BIT1 pcid_group_presence ('0'B),
418 /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */
419 EUTRAN_FreqIndexes freq_idx_list optional,
420 BIT1 freq_idx_list_term ('0'B)
421} with {
422 variant "PRESENCE(item_ind = '1'B)"
423};
424
425/* Repeated E-UTRAN PCID to TA mapping List */
426private type record of EUTRAN_PCID2TAMap EUTRAN_PCID2TAMaps;
427private type record EUTRAN_PCID2TAMap {
428 BIT1 item_ind ('1'B),
429 /* FIXME: PCID to TA mapping : < PCID Group IE > (not implemented) */
430 BIT1 pcid_group_presence ('0'B),
431 /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */
432 EUTRAN_FreqIndexes freq_idx_list optional,
433 BIT1 freq_idx_list_term ('0'B)
434} with {
435 variant "PRESENCE(item_ind = '1'B)"
436};
437
438/* Repeated E-UTRAN Frequency Index List */
439private type record of EUTRAN_FreqIndex EUTRAN_FreqIndexes;
440private type record EUTRAN_FreqIndex {
441 BIT1 item_ind ('1'B),
442 uint3_t idx
443} with {
444 variant "PRESENCE(item_ind = '1'B)"
445};
446
447/* Additions in Rel-8: 3G CSG Description (not implemented) */
448private type record Rel8UTRANCSGDescOpt {
449 BIT1 presence, // 0/1
450 bitstring desc optional // TODO
451} with {
452 variant (desc) "PRESENCE(presence = '1'B)"
453};
454
455/* Additions in Rel-8: E-UTRAN CSG Description (not implemented) */
456private type record Rel8EUTRANCSGDescOpt {
457 BIT1 presence, // 0/1
458 bitstring desc optional // TODO
459} with {
460 variant (desc) "PRESENCE(presence = '1'B)"
461};
462
463
464/* Basic any-/omit-matching templates. To be inherited by other templates (see below).
465 * The point is that you cannot fit everything into 20 octets, so usually several kinds
466 * of SI2quater are being sub-multiplexed by the BTS. This is achieved using both
467 * 'si2quater_index' and 'si2quater_count' fields. */
468template SI2quaterRestOctets tra_SI2quaterRestOctets_base := {
469 ba_ind := ?,
470 ba_3g_ind := ?,
471 mp_change_mark := ?,
472 si2quater_index := ?,
473 si2quater_count := ?,
474
475 meas_params_desc := { presence := ?, desc := * },
476 gprs := {
477 rt_diff_desc := { presence := ?, desc := * },
478 bsic_desc := { presence := ?, desc := * },
479 rep_prio_desc := { presence := ?, desc := * },
480 meas_params_desc := { presence := ?, desc := * }
481 },
482 nc_meas_params := { presence := ?, params := * },
483 ext_info := { presence := ?, info := * },
484
485 utran_neigh_desc := { presence := ?, desc := * },
486 utran_meas_params_desc := { presence := ?, desc := * },
487 utran_gprs_meas_params_desc := { presence := ?, desc := * },
488
489 rel_additions := ?
490};
491
492template SI2quaterRestOctets tro_SI2quaterRestOctets_base := {
493 ba_ind := ?,
494 ba_3g_ind := ?,
495 mp_change_mark := ?,
496 si2quater_index := ?,
497 si2quater_count := ?,
498
499 meas_params_desc := { presence := '0'B, desc := omit },
500 gprs := {
501 rt_diff_desc := { presence := '0'B, desc := omit },
502 bsic_desc := { presence := '0'B, desc := omit },
503 rep_prio_desc := { presence := '0'B, desc := omit },
504 meas_params_desc := { presence := '0'B, desc := omit }
505 },
506 nc_meas_params := { presence := '0'B, params := omit },
507 ext_info := { presence := '0'B, info := omit },
508
509 utran_neigh_desc := { presence := '0'B, desc := omit },
510 utran_meas_params_desc := { presence := '0'B, desc := omit },
511 utran_gprs_meas_params_desc := { presence := '0'B, desc := omit },
512
513 rel_additions := { rel5_presence := CSN1_L, rel5 := omit }
514};
515
Vadim Yanitskiyeacec8a2020-07-03 06:44:40 +0700516template SI2quaterRestOctets tro_SI2quaterRestOctets_rel8_EUTRAN
517modifies tro_SI2quaterRestOctets_base
518:= {
519 ba_ind := ?,
520 ba_3g_ind := ?,
521 mp_change_mark := ?,
522 si2quater_index := ?,
523 si2quater_count := ?,
524
525 rel_additions := {
526 rel5_presence := CSN1_H,
527 rel5 := {
528 umts_add_meas_params_desc := { presence := '0'B, desc := omit },
529 umts_add_meas_params_desc2 := { presence := '0'B, desc := omit },
530 rel6_presence := CSN1_H,
531 rel6 := {
532 umts_ccn_active := '0'B,
533 rel7_presence := CSN1_H,
534 rel7 := {
535 rep700 := { presence := '0'B, val := omit },
536 rep810 := { presence := '0'B, val := omit },
537 rel8_presence := CSN1_H,
538 rel8 := {
539 prio_eutran_params_desc := {
540 presence := '1'B,
541 desc := {
542 sc_prio_params_desc := { presence := '0'B, desc := omit },
543 utran_prio_params_desc := { presence := '0'B, desc := omit },
544 eutran_params_desc := {
545 presence := '1'B,
546 desc := {
547 ccn_active := ?,
548 e_start := ?,
549 e_stop := ?,
550 meas_params_desc := { presence := '0'B, desc := omit },
551 gprs_meas_params_desc := { presence := '0'B, desc := omit },
552 repeated_neigh_cells := *,
553 repeated_neigh_cells_term := '0'B,
554 repeated_not_allowed_cells := omit,
555 repeated_not_allowed_cells_term := '0'B,
556 pcid2ta_map_list := omit,
557 pcid2ta_map_list_term := '0'B
558 }
559 }
560 }
561 },
562 utran_csg_desc := { presence := '0'B, desc := omit },
563 eutran_csg_desc := { presence := '0'B, desc := omit }
564 }
565 }
566 }
567 }
568 }
569};
570
571template EUTRAN_CellDesc tr_EUTRAN_CellDesc(template (present) uint16_t e_arfcn := ?,
572 template (present) BIT1 meas_bw_presence := ?,
573 template uint3_t meas_bw := *)
574:= {
575 item_ind := '1'B,
576 e_arfcn := e_arfcn,
577 meas_bw_presence := meas_bw_presence,
578 meas_bw := meas_bw
579}
580
581/* Defaults correspond to osmo-bsc cfg:
582 * si2quater neighbor-list add earfcn 111 thresh-hi 20 thresh-lo 10 prio 3 qrxlv 22 meas 3
583 */
584template EUTRAN_NeighbourCells tr_EUTRAN_NeighbourCells(template (present) EUTRAN_CellDescs cell_desc_list := { tr_EUTRAN_CellDesc },
585 template (present) BIT1 prio_presence := ?,
586 template uint3_t prio := *,
587 template (present) uint5_t thresh_high := ?,
588 template (present) BIT1 thresh_low_presence := ?,
589 template uint5_t thresh_low := *,
590 template (present) BIT1 qrxlevmin_presence := ?,
591 template uint5_t qrxlevmin := *)
592:= {
593 item_ind := '1'B,
594 cell_desc_list := cell_desc_list,
595 cell_desc_list_term := '0'B,
596 prio_presence := prio_presence,
597 prio := prio,
598 thresh_high := thresh_high,
599 thresh_low_presence := thresh_low_presence,
600 thresh_low := thresh_low,
601 qrxlevmin_presence := qrxlevmin_presence,
602 qrxlevmin := qrxlevmin
603};
604
605template SI2quaterRestOctets tr_SI2quaterRestOctets_EUTRAN(
606 template integer index := 0,
607 template integer count := 0,
608 template EUTRAN_RepeatedNeighbourCells repeated_neigh_cells := { tr_EUTRAN_NeighbourCells }
609) modifies tro_SI2quaterRestOctets_rel8_EUTRAN := {
610 si2quater_index := index,
611 si2quater_count := count,
612 rel_additions := {
613 rel5 := {
614 rel6 := {
615 rel7 := {
616 rel8 := {
617 prio_eutran_params_desc := {
618 desc := {
619 sc_prio_params_desc := {
620 presence := '1'B,
621 desc := {
622 geran_priority := 0,
623 thresh_priority_search := 0,
624 thresh_gsm_low := 0,
625 h_prio := 0,
626 t_reselection := 0
627 }
628 },
629 eutran_params_desc := {
630 desc := {
631 ccn_active := '0'B,
632 e_start := '1'B,
633 e_stop := '1'B,
634 repeated_neigh_cells := repeated_neigh_cells
635 }
636 }
637 }
638 }
639 }
640 }
641 }
642 }
643 }
644};
645
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700646
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700647/* 10.5.2.34 SI 3 Rest Octets */
648type record SI3RestOctets {
649 SelectionParamsOpt sel_params,
650 PowerOffsetOpt pwr_offset,
651 BIT1 si_2ter_ind,
652 BIT1 early_cm_ind,
653 SchedIfAndWhere sched_where,
654 GPRSIndicatorOpt gprs_ind,
655 BIT1 umts_early_cm_ind,
656 SI2quaterIndicatorOpt si2_quater_ind,
657 BIT1 iu_mode_ind ('1'B) optional,
658 SI21IndicatorOpt si21_ind optional
659 /* ... spare padding ... */
660} with {
661 variant (si_2ter_ind) "CSN.1 L/H"
662 variant (early_cm_ind) "CSN.1 L/H"
663 variant (umts_early_cm_ind) "CSN.1 L/H"
664
665 /* If Iu mode is not supported in the cell, the Iu Indicator is not sent
666 * within this cell. Iu Indicator is included if and only if GPRS is
667 * not supported, and Iu mode is supported in the cell. */
668 variant (iu_mode_ind) "PRESENCE(gprs_ind.presence = '0'B)"
669 /* SI21 field is only present if 'WHERE' information is not present. */
670 variant (si21_ind) "PRESENCE(sched_where.presence = '0'B)"
Vadim Yanitskiy135b45e2020-05-04 19:54:02 +0700671
672 /* The TITAN's RAW encoder generates an octet-aligned octetstring,
673 * so we should make sure that unused bits contain proper padding. */
674 variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700675};
676
Vadim Yanitskiy72add6d2020-05-03 21:46:42 +0700677/* 10.5.2.35 SI 4 Rest Octets (O & S) */
678type record SI4RestOctets {
679 SelectionParamsOpt sel_params,
680 PowerOffsetOpt pwr_offset,
681 GPRSIndicatorOpt gprs_ind,
682 BIT1 s_presence, // L/H
683 /* TODO: optional "Rest Octets S" part */
684 bitstring s optional
685} with {
686 variant (s_presence) "CSN.1 L/H"
687 variant (s) "PRESENCE(s_presence = '1'B)"
Vadim Yanitskiy135b45e2020-05-04 19:54:02 +0700688
689 /* The TITAN's RAW encoder generates an octet-aligned octetstring,
690 * so we should make sure that unused bits contain proper padding. */
691 variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
Vadim Yanitskiy72add6d2020-05-03 21:46:42 +0700692};
693
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700694/* Selection Parameters */
695type record SelectionParams {
696 boolean cbq,
697 uint6_t cr_offset,
698 uint3_t temp_offset,
699 uint5_t penalty_time
700} with {
701 variant (cbq) "FIELDLENGTH(1)"
702};
703
704/* Optional Selection Parameters: L | H < Selection Parameters > */
705type record SelectionParamsOpt {
706 BIT1 presence, // L/H
707 SelectionParams params optional
708} with {
709 variant (presence) "CSN.1 L/H"
710 variant (params) "PRESENCE(presence = '1'B)"
711};
712
713/* Optional Power Offset: L | H < Power Offset bit(2) > */
714type record PowerOffsetOpt {
715 BIT1 presence, // L/H
716 uint2_t offset optional
717} with {
718 variant (presence) "CSN.1 L/H"
719 variant (offset) "PRESENCE(presence = '1'B)"
720};
721
722/* Scheduling if and where: L | H < WHERE bit(3) > */
723type record SchedIfAndWhere {
724 BIT1 presence, // L/H
725 uint3_t where optional
726} with {
727 variant (presence) "CSN.1 L/H"
728 variant (where) "PRESENCE(presence = '1'B)"
729};
730
731type record GPRSIndicator {
732 uint3_t ra_colour,
733 BIT1 si13_pos
734} with { variant "" };
735
736/* Optional GPRS Indicator: L | H < GPRS Indicator > */
737type record GPRSIndicatorOpt {
738 BIT1 presence, // L/H
739 GPRSIndicator ind optional
740} with {
741 variant (presence) "CSN.1 L/H"
742 variant (ind) "PRESENCE(presence = '1'B)"
743};
744
745/* Optional SI2quater Indicator: L | H < SI2quater Indicator > */
746type record SI2quaterIndicatorOpt {
747 BIT1 presence, // L/H
748 BIT1 ind optional
749} with {
750 variant (presence) "CSN.1 L/H"
751 variant (ind) "PRESENCE(presence = '1'B)"
752};
753
754/* Optional SI21 Indicator: L | H < SI21 Position > */
755type record SI21IndicatorOpt {
756 BIT1 presence, // L/H
757 BIT1 pos optional
758} with {
759 variant (presence) "CSN.1 L/H"
760 variant (pos) "PRESENCE(presence = '1'B)"
761};
762
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700763
764external function enc_SI2quaterRestOctets(in SI2quaterRestOctets ro) return octetstring
765 with { extension "prototype(convert) encode(RAW)" };
766external function dec_SI2quaterRestOctets(in octetstring stream) return SI2quaterRestOctets
767 with { extension "prototype(convert) decode(RAW)" };
768
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700769external function enc_SI3RestOctets(in SI3RestOctets ro) return octetstring
770 with { extension "prototype(convert) encode(RAW)" };
771external function dec_SI3RestOctets(in octetstring stream) return SI3RestOctets
772 with { extension "prototype(convert) decode(RAW)" };
773
Vadim Yanitskiy72add6d2020-05-03 21:46:42 +0700774external function enc_SI4RestOctets(in SI4RestOctets ro) return octetstring
775 with { extension "prototype(convert) encode(RAW)" };
776external function dec_SI4RestOctets(in octetstring stream) return SI4RestOctets
777 with { extension "prototype(convert) decode(RAW)" };
778
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700779
Vadim Yanitskiy12cf3d92020-05-05 00:19:50 +0700780/* Basic templates to be extended in place */
781template (value) SI3RestOctets ts_SI3RestOctets := {
782 sel_params := {
783 presence := CSN1_L,
784 params := omit
785 },
786 pwr_offset := {
787 presence := CSN1_L,
788 offset := omit
789 },
790 si_2ter_ind := CSN1_L,
791 early_cm_ind := CSN1_L,
792 sched_where := {
793 presence := CSN1_L,
794 where := omit
795 },
796 gprs_ind := {
797 presence := CSN1_L,
798 ind := omit
799 },
800 umts_early_cm_ind := CSN1_L,
801 si2_quater_ind := {
802 presence := CSN1_L,
803 ind := omit
804 },
805 iu_mode_ind := omit,
806 si21_ind := {
807 presence := CSN1_L,
808 pos := omit
809 }
810}
811
812template (value) SI4RestOctets ts_SI4RestOctets := {
813 sel_params := {
814 presence := CSN1_L,
815 params := omit
816 },
817 pwr_offset := {
818 presence := CSN1_L,
819 offset := omit
820 },
821 gprs_ind := {
822 presence := CSN1_L,
823 ind := omit
824 },
825 s_presence := CSN1_L,
826 s := omit
827}
828
829
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700830} with { encode "RAW"; variant "FIELDORDER(msb)" }