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