Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1 | /** |
| 2 | * GSM Rest Octets definitions as per 3GPP TS 44.018. |
| 3 | * |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 4 | * (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 5 | * (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 | |
| 14 | module GSM_RestOctets { |
| 15 | |
| 16 | import from General_Types all; |
| 17 | import from Osmocom_Types all; |
| 18 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 19 | /* 10.5.2.33b SI 2quater Rest Octets */ |
| 20 | type 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 */ |
| 57 | private type record MeasParamsDescOpt { |
| 58 | BIT1 presence, // 0/1 |
| 59 | MeasParamsDesc desc optional |
| 60 | } with { |
| 61 | variant (desc) "PRESENCE(presence = '1'B)" |
| 62 | }; |
| 63 | |
| 64 | private type record MeasParamsDesc { |
| 65 | BIT1 report_type, |
| 66 | BIT2 serving_band_reporting |
| 67 | } with { variant "" }; |
| 68 | |
| 69 | /* GPRS Real Time Difference Description (not implemented) */ |
| 70 | private 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) */ |
| 78 | private 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) */ |
| 86 | private 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 */ |
| 94 | private 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 */ |
| 104 | private type record NCMeasParamsOpt { |
| 105 | BIT1 presence, // 0/1 |
| 106 | NCMeasParams params optional |
| 107 | } with { |
| 108 | variant (params) "PRESENCE(presence = '1'B)" |
| 109 | }; |
| 110 | |
| 111 | private 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 */ |
| 118 | private type record SI2quaterExtInfoOpt { |
| 119 | BIT1 presence, // 0/1 |
| 120 | SI2quaterExtInfo info optional |
| 121 | } with { |
| 122 | variant (info) "PRESENCE(presence = '1'B)" |
| 123 | }; |
| 124 | |
| 125 | private 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 */ |
| 135 | private type record CCNSupportDescOpt { |
| 136 | BIT1 presence, // 0/1 |
| 137 | CCNSupportDesc desc optional |
| 138 | } with { |
| 139 | variant (desc) "PRESENCE(presence = '1'B)" |
| 140 | }; |
| 141 | |
| 142 | private 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 */ |
| 151 | private 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 | |
| 158 | private 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. */ |
| 175 | private 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 | |
| 182 | private 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) */ |
| 190 | private 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) */ |
| 198 | private 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 */ |
| 206 | private 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 */ |
| 215 | private 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 */ |
| 226 | private 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 | |
| 233 | private type record UMTS_AddMeasParamsDesc { |
| 234 | BIT3 fdd_qmin_offset, |
| 235 | BIT4 fdd_rscpmin |
| 236 | } with { variant "" }; |
| 237 | |
| 238 | /* 3G Additional Measurement Parameters Description 2 */ |
| 239 | private 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 | |
| 246 | private 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 */ |
| 255 | private 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 */ |
| 265 | private 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 */ |
| 276 | private type record Rel7RepOffseThresholdOpt { |
| 277 | BIT1 presence, // 0/1 |
| 278 | Rel7RepOffseThreshold val optional |
| 279 | } with { |
| 280 | variant (val) "PRESENCE(presence = '1'B)" |
| 281 | }; |
| 282 | |
| 283 | private type record Rel7RepOffseThreshold { |
| 284 | BIT3 offset, |
| 285 | BIT3 threshold |
| 286 | } with { variant "" }; |
| 287 | |
| 288 | /* SI2quater Rel-8 and Rel-{9,10} Additions */ |
| 289 | private 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 */ |
| 297 | private type record Rel8PrioEUTRANParamsDescOpt { |
| 298 | BIT1 presence, // 0/1 |
| 299 | Rel8PrioEUTRANParamsDesc desc optional |
| 300 | } with { |
| 301 | variant (desc) "PRESENCE(presence = '1'B)" |
| 302 | }; |
| 303 | |
| 304 | private 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 */ |
| 311 | private type record ServingCellPrioParamsDescOpt { |
| 312 | BIT1 presence, // 0/1 |
| 313 | ServingCellPrioParamsDesc desc optional |
| 314 | } with { |
| 315 | variant (desc) "PRESENCE(presence = '1'B)" |
| 316 | }; |
| 317 | |
| 318 | private 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) */ |
| 327 | private 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 */ |
| 335 | private 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 | |
| 342 | private 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 */ |
| 353 | EUTRAN_NeighbourCells neigh_cell_list optional, |
| 354 | BIT1 neigh_cell_list_term ('0'B), |
| 355 | /* { 1 < Repeated E-UTRAN Not Allowed Cells > } ** 0 */ |
| 356 | EUTRAN_NotAllowedCells not_allowed_cell_list optional, |
| 357 | BIT1 not_allowed_cell_list_term ('0'B), |
| 358 | /* { 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) */ |
| 364 | private 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) */ |
| 372 | private 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 | |
| 379 | /* Repeated E-UTRAN Neighbour Cell List */ |
| 380 | private type record of EUTRAN_NeighbourCell EUTRAN_NeighbourCells; |
| 381 | private type record EUTRAN_NeighbourCell { |
| 382 | 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 */ |
| 401 | private type record of EUTRAN_CellDesc EUTRAN_CellDescs; |
| 402 | private type record EUTRAN_CellDesc { |
| 403 | 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 | |
| 412 | /* Repeated E-UTRAN Not Allowed Cell List */ |
| 413 | private type record of EUTRAN_NotAllowedCell EUTRAN_NotAllowedCells; |
| 414 | private type record EUTRAN_NotAllowedCell { |
| 415 | 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 */ |
| 426 | private type record of EUTRAN_PCID2TAMap EUTRAN_PCID2TAMaps; |
| 427 | private 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 */ |
| 439 | private type record of EUTRAN_FreqIndex EUTRAN_FreqIndexes; |
| 440 | private 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) */ |
| 448 | private 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) */ |
| 456 | private 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. */ |
| 468 | template 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 | |
| 492 | template 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 | |
| 516 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 517 | /* 10.5.2.34 SI 3 Rest Octets */ |
| 518 | type record SI3RestOctets { |
| 519 | SelectionParamsOpt sel_params, |
| 520 | PowerOffsetOpt pwr_offset, |
| 521 | BIT1 si_2ter_ind, |
| 522 | BIT1 early_cm_ind, |
| 523 | SchedIfAndWhere sched_where, |
| 524 | GPRSIndicatorOpt gprs_ind, |
| 525 | BIT1 umts_early_cm_ind, |
| 526 | SI2quaterIndicatorOpt si2_quater_ind, |
| 527 | BIT1 iu_mode_ind ('1'B) optional, |
| 528 | SI21IndicatorOpt si21_ind optional |
| 529 | /* ... spare padding ... */ |
| 530 | } with { |
| 531 | variant (si_2ter_ind) "CSN.1 L/H" |
| 532 | variant (early_cm_ind) "CSN.1 L/H" |
| 533 | variant (umts_early_cm_ind) "CSN.1 L/H" |
| 534 | |
| 535 | /* If Iu mode is not supported in the cell, the Iu Indicator is not sent |
| 536 | * within this cell. Iu Indicator is included if and only if GPRS is |
| 537 | * not supported, and Iu mode is supported in the cell. */ |
| 538 | variant (iu_mode_ind) "PRESENCE(gprs_ind.presence = '0'B)" |
| 539 | /* SI21 field is only present if 'WHERE' information is not present. */ |
| 540 | variant (si21_ind) "PRESENCE(sched_where.presence = '0'B)" |
Vadim Yanitskiy | 135b45e | 2020-05-04 19:54:02 +0700 | [diff] [blame] | 541 | |
| 542 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 543 | * so we should make sure that unused bits contain proper padding. */ |
| 544 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 545 | }; |
| 546 | |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 547 | /* 10.5.2.35 SI 4 Rest Octets (O & S) */ |
| 548 | type record SI4RestOctets { |
| 549 | SelectionParamsOpt sel_params, |
| 550 | PowerOffsetOpt pwr_offset, |
| 551 | GPRSIndicatorOpt gprs_ind, |
| 552 | BIT1 s_presence, // L/H |
| 553 | /* TODO: optional "Rest Octets S" part */ |
| 554 | bitstring s optional |
| 555 | } with { |
| 556 | variant (s_presence) "CSN.1 L/H" |
| 557 | variant (s) "PRESENCE(s_presence = '1'B)" |
Vadim Yanitskiy | 135b45e | 2020-05-04 19:54:02 +0700 | [diff] [blame] | 558 | |
| 559 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 560 | * so we should make sure that unused bits contain proper padding. */ |
| 561 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 562 | }; |
| 563 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 564 | /* Selection Parameters */ |
| 565 | type record SelectionParams { |
| 566 | boolean cbq, |
| 567 | uint6_t cr_offset, |
| 568 | uint3_t temp_offset, |
| 569 | uint5_t penalty_time |
| 570 | } with { |
| 571 | variant (cbq) "FIELDLENGTH(1)" |
| 572 | }; |
| 573 | |
| 574 | /* Optional Selection Parameters: L | H < Selection Parameters > */ |
| 575 | type record SelectionParamsOpt { |
| 576 | BIT1 presence, // L/H |
| 577 | SelectionParams params optional |
| 578 | } with { |
| 579 | variant (presence) "CSN.1 L/H" |
| 580 | variant (params) "PRESENCE(presence = '1'B)" |
| 581 | }; |
| 582 | |
| 583 | /* Optional Power Offset: L | H < Power Offset bit(2) > */ |
| 584 | type record PowerOffsetOpt { |
| 585 | BIT1 presence, // L/H |
| 586 | uint2_t offset optional |
| 587 | } with { |
| 588 | variant (presence) "CSN.1 L/H" |
| 589 | variant (offset) "PRESENCE(presence = '1'B)" |
| 590 | }; |
| 591 | |
| 592 | /* Scheduling if and where: L | H < WHERE bit(3) > */ |
| 593 | type record SchedIfAndWhere { |
| 594 | BIT1 presence, // L/H |
| 595 | uint3_t where optional |
| 596 | } with { |
| 597 | variant (presence) "CSN.1 L/H" |
| 598 | variant (where) "PRESENCE(presence = '1'B)" |
| 599 | }; |
| 600 | |
| 601 | type record GPRSIndicator { |
| 602 | uint3_t ra_colour, |
| 603 | BIT1 si13_pos |
| 604 | } with { variant "" }; |
| 605 | |
| 606 | /* Optional GPRS Indicator: L | H < GPRS Indicator > */ |
| 607 | type record GPRSIndicatorOpt { |
| 608 | BIT1 presence, // L/H |
| 609 | GPRSIndicator ind optional |
| 610 | } with { |
| 611 | variant (presence) "CSN.1 L/H" |
| 612 | variant (ind) "PRESENCE(presence = '1'B)" |
| 613 | }; |
| 614 | |
| 615 | /* Optional SI2quater Indicator: L | H < SI2quater Indicator > */ |
| 616 | type record SI2quaterIndicatorOpt { |
| 617 | BIT1 presence, // L/H |
| 618 | BIT1 ind optional |
| 619 | } with { |
| 620 | variant (presence) "CSN.1 L/H" |
| 621 | variant (ind) "PRESENCE(presence = '1'B)" |
| 622 | }; |
| 623 | |
| 624 | /* Optional SI21 Indicator: L | H < SI21 Position > */ |
| 625 | type record SI21IndicatorOpt { |
| 626 | BIT1 presence, // L/H |
| 627 | BIT1 pos optional |
| 628 | } with { |
| 629 | variant (presence) "CSN.1 L/H" |
| 630 | variant (pos) "PRESENCE(presence = '1'B)" |
| 631 | }; |
| 632 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 633 | |
| 634 | external function enc_SI2quaterRestOctets(in SI2quaterRestOctets ro) return octetstring |
| 635 | with { extension "prototype(convert) encode(RAW)" }; |
| 636 | external function dec_SI2quaterRestOctets(in octetstring stream) return SI2quaterRestOctets |
| 637 | with { extension "prototype(convert) decode(RAW)" }; |
| 638 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 639 | external function enc_SI3RestOctets(in SI3RestOctets ro) return octetstring |
| 640 | with { extension "prototype(convert) encode(RAW)" }; |
| 641 | external function dec_SI3RestOctets(in octetstring stream) return SI3RestOctets |
| 642 | with { extension "prototype(convert) decode(RAW)" }; |
| 643 | |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 644 | external function enc_SI4RestOctets(in SI4RestOctets ro) return octetstring |
| 645 | with { extension "prototype(convert) encode(RAW)" }; |
| 646 | external function dec_SI4RestOctets(in octetstring stream) return SI4RestOctets |
| 647 | with { extension "prototype(convert) decode(RAW)" }; |
| 648 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 649 | |
Vadim Yanitskiy | 12cf3d9 | 2020-05-05 00:19:50 +0700 | [diff] [blame] | 650 | /* Basic templates to be extended in place */ |
| 651 | template (value) SI3RestOctets ts_SI3RestOctets := { |
| 652 | sel_params := { |
| 653 | presence := CSN1_L, |
| 654 | params := omit |
| 655 | }, |
| 656 | pwr_offset := { |
| 657 | presence := CSN1_L, |
| 658 | offset := omit |
| 659 | }, |
| 660 | si_2ter_ind := CSN1_L, |
| 661 | early_cm_ind := CSN1_L, |
| 662 | sched_where := { |
| 663 | presence := CSN1_L, |
| 664 | where := omit |
| 665 | }, |
| 666 | gprs_ind := { |
| 667 | presence := CSN1_L, |
| 668 | ind := omit |
| 669 | }, |
| 670 | umts_early_cm_ind := CSN1_L, |
| 671 | si2_quater_ind := { |
| 672 | presence := CSN1_L, |
| 673 | ind := omit |
| 674 | }, |
| 675 | iu_mode_ind := omit, |
| 676 | si21_ind := { |
| 677 | presence := CSN1_L, |
| 678 | pos := omit |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | template (value) SI4RestOctets ts_SI4RestOctets := { |
| 683 | sel_params := { |
| 684 | presence := CSN1_L, |
| 685 | params := omit |
| 686 | }, |
| 687 | pwr_offset := { |
| 688 | presence := CSN1_L, |
| 689 | offset := omit |
| 690 | }, |
| 691 | gprs_ind := { |
| 692 | presence := CSN1_L, |
| 693 | ind := omit |
| 694 | }, |
| 695 | s_presence := CSN1_L, |
| 696 | s := omit |
| 697 | } |
| 698 | |
| 699 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 700 | } with { encode "RAW"; variant "FIELDORDER(msb)" } |