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; |
Pau Espin Pedrol | 28652d8 | 2021-02-09 20:20:17 +0100 | [diff] [blame] | 18 | import from RLCMAC_CSN1_Types all; |
Vadim Yanitskiy | 150d6d1 | 2022-10-20 19:10:04 +0700 | [diff] [blame] | 19 | import from GSM_Types all; |
| 20 | |
| 21 | /* 10.5.2.16 IA (Immediate Assignment) Rest Octets */ |
| 22 | type record IaRestOctets { |
| 23 | BIT2 presence, |
| 24 | IaRestOctLL ll optional, |
| 25 | IaRestOctLH lh optional, |
| 26 | IaRestOctHL hl optional, |
| 27 | IaRestOctHH hh optional |
| 28 | } with { |
| 29 | variant (presence) "CSN.1 L/H" |
| 30 | variant (ll) "PRESENCE(presence = '00'B)" |
| 31 | variant (lh) "PRESENCE(presence = '01'B)" |
| 32 | variant (hl) "PRESENCE(presence = '10'B)" |
| 33 | variant (hh) "PRESENCE(presence = '11'B)" |
| 34 | |
| 35 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 36 | * so we should make sure that unused bits contain proper padding. */ |
| 37 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 38 | }; |
| 39 | |
| 40 | type record IaRestOctLL { |
| 41 | BIT1 compressed_irat_ho_info_ind |
| 42 | } with { |
| 43 | variant (compressed_irat_ho_info_ind) "CSN.1 L/H" |
| 44 | }; |
| 45 | |
| 46 | type record IaRestOctLH { |
| 47 | BIT2 presence, |
| 48 | EgprsUlAss egprs_ul optional, |
| 49 | octetstring multiblock_dl_ass optional /* TODO */ |
| 50 | } with { |
| 51 | variant (egprs_ul) "PRESENCE(presence = '00'B)" |
| 52 | variant (multiblock_dl_ass) "PRESENCE(presence = '01'B)" |
| 53 | }; |
| 54 | |
| 55 | /* EGPRS Packet Uplink Assignment */ |
| 56 | type record EgprsUlAss { |
| 57 | BIT5 ext_ra, |
| 58 | BIT1 ats_present, |
| 59 | AccessTechnologiesRequestRepetition ats optional, |
| 60 | BIT1 presence, |
| 61 | EgprsUlAssignDyn dynamic optional, |
| 62 | EgprsUlAssignMultiblock multiblock optional |
| 63 | } with { |
| 64 | variant (ats) "PRESENCE(ats_present = '1'B)" |
| 65 | variant (dynamic) "PRESENCE(presence = '1'B)" |
| 66 | variant (multiblock) "PRESENCE(presence = '0'B)" |
| 67 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ |
| 68 | variant (ext_ra) "BYTEORDER(last)" // FIXME: should be first |
| 69 | }; |
| 70 | |
| 71 | type record EgprsUlAssignDyn { |
| 72 | uint5_t tfi_assignment, |
| 73 | BIT1 polling, |
| 74 | BIT1 spare ('0'B), |
| 75 | uint3_t usf, |
| 76 | BIT1 usf_granularity, |
| 77 | BIT1 p0_present, |
| 78 | uint4_t p0 optional, |
| 79 | BIT1 pr_mode optional, |
| 80 | EgprsChCodingCommand egprs_ch_coding_cmd, |
| 81 | BIT1 tlli_block_chan_coding, |
| 82 | BIT1 bep_period2_present, |
| 83 | BIT4 bep_period2 optional, |
| 84 | BIT1 resegment, |
| 85 | EgprsWindowSize egprs_window_size, |
| 86 | BIT1 alpha_present, |
| 87 | uint4_t alpha optional, |
| 88 | uint5_t gamma, |
| 89 | BIT1 ta_index_present, |
| 90 | uint4_t ta_index optional, |
| 91 | BIT1 tbf_starting_time_present, |
| 92 | TbfStartingTime tbf_starting_time optional |
| 93 | /* TODO: Additions for Rel-7 */ |
| 94 | } with { |
| 95 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 96 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 97 | variant (bep_period2) "PRESENCE(bep_period2_present = '1'B)" |
| 98 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 99 | variant (ta_index) "PRESENCE(ta_index_present = '1'B)" |
| 100 | variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" |
| 101 | }; |
| 102 | |
| 103 | type record EgprsUlAssignMultiblock { |
| 104 | BIT1 alpha_present, |
| 105 | uint4_t alpha optional, |
| 106 | uint5_t gamma, |
| 107 | TbfStartingTime tbf_starting_time, |
| 108 | BIT2 nr_radio_blocks_allocated, |
| 109 | BIT1 p0_present, |
| 110 | uint4_t p0 optional, |
| 111 | BIT1 spare ('0'B) optional, |
| 112 | BIT1 pr_mode optional |
| 113 | /* TDO: Additions for Rel-6 */ |
| 114 | } with { |
| 115 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 116 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 117 | variant (spare) "PRESENCE(p0_present = '1'B)" |
| 118 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 119 | }; |
| 120 | |
| 121 | type record IaRestOctHL { |
| 122 | uint6_t freq_par_len, |
| 123 | BIT2 padding ('00'B) optional, |
| 124 | uint6_t maio optional, |
| 125 | octetstring mobile_allocation optional |
| 126 | } with { |
| 127 | variant (freq_par_len) "LENGTHTO(mobile_allocation,maio,padding)" |
| 128 | /* |
| 129 | variant (padding) "PRESENCE(freq_par_len != 0)" |
| 130 | variant (maio) "PRESENCE(freq_par_len != 0)" |
| 131 | variant (mobile_allocation) "PRESENCE(freq_par_len != 0)" |
| 132 | */ |
| 133 | }; |
| 134 | |
| 135 | type record IaRestOctHH { |
| 136 | /* Packet Assignment discriminator: |
| 137 | * Packet Uplink / Downlink Assignment (0) |
| 138 | * Second Part Packet Assignment (1) */ |
| 139 | BIT1 pa_disc, |
| 140 | PacketAssignUnion pa |
| 141 | } with { |
| 142 | variant (pa) "CROSSTAG(spa, pa_disc = '1'B; uldl, pa_disc = '0'B)" |
| 143 | }; |
| 144 | |
| 145 | type union PacketAssignUnion { |
| 146 | SecondPartAssign spa, |
| 147 | PacketUlDlAssign uldl |
| 148 | }; |
| 149 | |
| 150 | type record SecondPartAssign { |
| 151 | BIT1 r99, /* L / H */ |
| 152 | BIT1 presence optional, |
| 153 | BIT5 ext_ra optional |
| 154 | } with { |
| 155 | variant (r99) "CSN.1 L/H" |
| 156 | variant (presence) "PRESENCE(r99 = '1'B)" /* H */ |
| 157 | variant (ext_ra) "PRESENCE(presence = '1'B)" |
| 158 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ |
| 159 | variant (ext_ra) "BYTEORDER(last)" // FIXME: should be first |
| 160 | }; |
| 161 | |
| 162 | type record PacketUlDlAssign { |
| 163 | BIT1 ass_disc, |
| 164 | PacketUlDlAssignUnion ass |
| 165 | } with { |
| 166 | variant (ass) "CROSSTAG(dl, ass_disc = '1'B; ul, ass_disc = '0'B)" |
| 167 | }; |
| 168 | |
| 169 | type union PacketUlDlAssignUnion { |
| 170 | PacketUlAssign ul, |
| 171 | PacketDlAssign dl |
| 172 | }; |
| 173 | |
| 174 | type record PacketUlAssign { |
| 175 | BIT1 presence, |
| 176 | PacketUlAssignDyn dynamic optional, |
| 177 | PacketUlAssignSgl single optional |
| 178 | /* TODO: Estended RA, PFI */ |
| 179 | } with { |
| 180 | variant (dynamic) "PRESENCE(presence = '1'B)" |
| 181 | variant (single) "PRESENCE(presence = '0'B)" |
| 182 | }; |
| 183 | |
| 184 | type record PacketUlAssignDyn { |
| 185 | uint5_t tfi_assignment, |
| 186 | BIT1 polling, |
| 187 | BIT1 spare ('0'B), |
| 188 | uint3_t usf, |
| 189 | BIT1 usf_granularity, |
| 190 | BIT1 p0_present, |
| 191 | uint4_t p0 optional, |
| 192 | BIT1 pr_mode optional, |
| 193 | ChCodingCommand ch_coding_cmd, |
| 194 | BIT1 tlli_block_chan_coding, |
| 195 | BIT1 alpha_present, |
| 196 | uint4_t alpha optional, |
| 197 | uint5_t gamma, |
| 198 | BIT1 ta_index_present, |
| 199 | uint4_t ta_index optional, |
| 200 | BIT1 tbf_starting_time_present, |
| 201 | TbfStartingTime tbf_starting_time optional |
| 202 | } with { |
| 203 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 204 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 205 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 206 | variant (ta_index) "PRESENCE(ta_index_present = '1'B)" |
| 207 | variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" |
| 208 | }; |
| 209 | |
| 210 | type record PacketUlAssignSgl { |
| 211 | BIT1 alpha_present, |
| 212 | uint4_t alpha optional, |
| 213 | uint5_t gamma, |
| 214 | BIT2 padding ('01'B), |
| 215 | TbfStartingTime tbf_starting_time |
| 216 | /* TODO: P0 / PR_MODE */ |
| 217 | } with { |
| 218 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 219 | }; |
| 220 | |
| 221 | type record PacketDlAssign { |
| 222 | GprsTlli tlli, |
| 223 | BIT1 group1_present, |
| 224 | PacketDlAssG1 group1 optional, |
| 225 | BIT1 ta_index_present, |
| 226 | uint4_t ta_index optional, |
| 227 | BIT1 tbf_starting_time_present, |
| 228 | TbfStartingTime tbf_starting_time optional, |
| 229 | BIT1 p0_present, |
| 230 | uint4_t p0 optional, |
| 231 | BIT1 pr_mode optional |
| 232 | /* TODO: EGPRS window size, etc. */ |
| 233 | } with { |
| 234 | variant (group1) "PRESENCE(group1_present = '1'B)" |
| 235 | variant (ta_index) "PRESENCE(ta_index_present = '1'B)" |
| 236 | variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" |
| 237 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 238 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 239 | }; |
| 240 | |
| 241 | type record PacketDlAssG1 { |
| 242 | uint5_t tfi_assignment, |
| 243 | BIT1 rlc_mode, |
| 244 | BIT1 alpha_present, |
| 245 | uint4_t alpha optional, |
| 246 | uint5_t gamma, |
| 247 | BIT1 polling, |
| 248 | BIT1 ta_valid |
| 249 | } with { variant "" }; |
| 250 | |
| 251 | type record TbfStartingTime { |
| 252 | uint5_t t1, |
| 253 | uint6_t t3, |
| 254 | uint5_t t2 |
| 255 | }; |
| 256 | |
| 257 | /* 10.5.2.17 IAR (Immediate Assignment Reject) Rest Octets */ |
| 258 | type record IARRestOctets { |
| 259 | ExtRAList ext_ra_list, |
| 260 | BIT1 rel13_ind, // L/H |
| 261 | uint3_t rcc optional |
| 262 | /* Addition in Rel-15: PEO IMM Cell Group Details struct */ |
| 263 | } with { |
| 264 | variant (rel13_ind) "CSN.1 L/H" |
| 265 | variant (rcc) "PRESENCE(rel13_ind = '1'B)" |
| 266 | |
| 267 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 268 | * so we should make sure that unused bits contain proper padding. */ |
| 269 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 270 | }; |
| 271 | |
| 272 | /* Optional extended RA: 0 | 1 < Extended RA 1 : bit (5) > */ |
| 273 | type record length(4) of ExtRAOpt ExtRAList; |
| 274 | type record ExtRAOpt { |
| 275 | BIT1 presence, // L/H |
| 276 | BIT5 ext_ra optional |
| 277 | } with { |
| 278 | variant (presence) "CSN.1 L/H" |
| 279 | variant (ext_ra) "PRESENCE(presence = '1'B)" |
| 280 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ |
| 281 | variant (ext_ra) "BYTEORDER(last)" |
| 282 | }; |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 283 | |
Vadim Yanitskiy | 382138e | 2022-10-21 16:09:42 +0700 | [diff] [blame] | 284 | template PacketDlAssign tr_PacketDlAssign(template GprsTlli tlli) := { |
| 285 | tlli := tlli, |
| 286 | group1_present := ?, |
| 287 | group1 := *, |
| 288 | ta_index_present := ?, |
| 289 | ta_index := *, |
| 290 | tbf_starting_time_present := ?, |
| 291 | tbf_starting_time := *, |
| 292 | p0_present := ?, |
| 293 | p0 := *, |
| 294 | pr_mode := * |
| 295 | }; |
| 296 | |
| 297 | template IaRestOctets tr_IaRestOctets_DLAss(template PacketDlAssign dl_ass) := { |
| 298 | presence := '11'B, /* HH */ |
| 299 | ll := omit, lh := omit, hl := omit, |
| 300 | hh := { |
| 301 | pa_disc := '0'B, /* Packet Assignment (0) */ |
| 302 | pa := { |
| 303 | uldl := { |
| 304 | ass_disc := '1'B, /* Downlink Assignment (1) */ |
| 305 | ass := { dl := dl_ass } |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | }; |
| 310 | |
| 311 | template PacketUlAssign tr_PacketUlDynAssign(template uint5_t tfi := ?, |
| 312 | template BIT1 polling := ?, |
| 313 | template uint3_t usf := ?, |
| 314 | template BIT1 usf_granularity := ?, |
| 315 | template ChCodingCommand cs := ?) := { |
| 316 | presence := '1'B, /* Dynamic Block Allocation */ |
| 317 | dynamic := { |
| 318 | tfi_assignment := tfi, |
| 319 | polling := polling, |
| 320 | spare := '0'B, /* Dynamic Block Allocation (mandatory after Rel-4) */ |
| 321 | usf := usf, |
| 322 | usf_granularity := usf_granularity, |
| 323 | p0_present := ?, |
| 324 | p0 := *, |
| 325 | pr_mode := *, |
| 326 | ch_coding_cmd := cs, |
| 327 | tlli_block_chan_coding := ?, |
| 328 | alpha_present := ?, |
| 329 | alpha := *, |
| 330 | gamma := ?, |
| 331 | /* TODO: add to parameters */ |
| 332 | ta_index_present := ?, |
| 333 | ta_index := *, |
| 334 | tbf_starting_time_present := ?, |
| 335 | tbf_starting_time := * |
| 336 | }, |
| 337 | single := omit |
| 338 | }; |
| 339 | |
| 340 | template PacketUlAssign tr_PacketUlSglAssign := { |
| 341 | presence := '0'B, /* Single Block Allocation */ |
| 342 | dynamic := omit, |
| 343 | single := { |
| 344 | alpha_present := ?, |
| 345 | alpha := *, |
| 346 | gamma := ?, |
| 347 | padding := '01'B, |
| 348 | tbf_starting_time := ? |
| 349 | } |
| 350 | }; |
| 351 | |
| 352 | template IaRestOctets tr_IaRestOctets_ULAss(template PacketUlAssign ul_ass) := { |
| 353 | presence := '11'B, /* HH */ |
| 354 | ll := omit, lh := omit, hl := omit, |
| 355 | hh := { |
| 356 | pa_disc := '0'B, /* Packet Assignment (0) */ |
| 357 | pa := { |
| 358 | uldl := { |
| 359 | ass_disc := '0'B, /* Uplink Assignment (0) */ |
| 360 | ass := { ul := ul_ass } |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | }; |
| 365 | |
| 366 | template EgprsUlAss tr_EgprsUlAssDynamic(template (present) BIT5 ext_ra := ?, |
| 367 | template EgprsUlAssignDyn dyn_ass := ?) := { |
| 368 | ext_ra := ext_ra, |
| 369 | ats_present := ?, |
| 370 | ats := *, |
| 371 | presence := '1'B, |
| 372 | dynamic := dyn_ass, |
| 373 | multiblock := omit |
| 374 | }; |
| 375 | template EgprsUlAss tr_EgprsUlAssMultiblock(template (present) BIT5 ext_ra := ?, |
| 376 | template EgprsUlAssignMultiblock mb_ass := ?) := { |
| 377 | ext_ra := ext_ra, |
| 378 | ats_present := ?, |
| 379 | ats := *, |
| 380 | presence := '0'B, |
| 381 | dynamic := omit, |
| 382 | multiblock := mb_ass |
| 383 | }; |
| 384 | |
| 385 | template IaRestOctets tr_IaRestOctets_EGPRSULAss(template EgprsUlAss ul_ass) := { |
| 386 | presence := '01'B, /* LH */ |
| 387 | ll := omit, |
| 388 | lh := { |
| 389 | presence := '00'B, |
| 390 | egprs_ul := ul_ass, |
| 391 | multiblock_dl_ass := omit |
| 392 | }, |
| 393 | hl := omit, |
| 394 | hh := omit |
| 395 | }; |
| 396 | |
| 397 | template IARRestOctets tr_IARRestOctets(template ExtRAList ext_ra_list := ?, |
| 398 | template uint3_t rcc := ?) := { |
| 399 | ext_ra_list := ext_ra_list, |
| 400 | rel13_ind := ?, |
| 401 | rcc := rcc ifpresent |
| 402 | }; |
| 403 | |
| 404 | template ExtRAOpt tr_ExtRAOpt(template BIT5 ext_ra := ?) := { |
| 405 | presence := '1'B, // L/H |
| 406 | ext_ra := ext_ra |
| 407 | }; |
| 408 | |
Vadim Yanitskiy | a193def | 2022-10-21 15:18:55 +0700 | [diff] [blame] | 409 | |
| 410 | external function enc_IaRestOctets(in IaRestOctets ro) return octetstring |
| 411 | with { extension "prototype(convert) encode(RAW)" }; |
| 412 | external function dec_IaRestOctets(in octetstring stream) return IaRestOctets |
| 413 | with { extension "prototype(convert) decode(RAW)" }; |
| 414 | |
| 415 | external function enc_IARRestOctets(in IARRestOctets ro) return octetstring |
| 416 | with { extension "prototype(convert) encode(RAW)" }; |
| 417 | external function dec_IARRestOctets(in octetstring stream) return IARRestOctets |
| 418 | with { extension "prototype(convert) decode(RAW)" }; |
| 419 | |
| 420 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 421 | /* 10.5.2.33b SI 2quater Rest Octets */ |
| 422 | type record SI2quaterRestOctets { |
| 423 | BIT1 ba_ind, |
| 424 | BIT1 ba_3g_ind, |
| 425 | BIT1 mp_change_mark, |
| 426 | uint4_t si2quater_index, |
| 427 | uint4_t si2quater_count, |
| 428 | |
| 429 | /* Measurement Parameters Description */ |
| 430 | MeasParamsDescOpt meas_params_desc, |
| 431 | /* GPRS specific parameters */ |
| 432 | record { |
| 433 | GPRS_RealTimeDiffDescOpt rt_diff_desc, |
| 434 | GPRS_BSICDescOpt bsic_desc, |
| 435 | GPRS_ReportPrioDescOpt rep_prio_desc, |
| 436 | MeasParamsDescOpt meas_params_desc |
| 437 | } gprs, |
| 438 | /* NC Measurement Parameters Description */ |
| 439 | NCMeasParamsOpt nc_meas_params, |
| 440 | /* SI2quater Extension Information */ |
| 441 | SI2quaterExtInfoOpt ext_info, |
| 442 | |
| 443 | /* 3G Neighbour Cell Description */ |
| 444 | UTRAN_NeighDescOpt utran_neigh_desc, |
| 445 | /* 3G Measurement Parameters Description */ |
| 446 | UTRAN_MeasParamsDescOpt utran_meas_params_desc, |
| 447 | /* GPRS 3G Measurement Parameters Description */ |
| 448 | UTRAN_GPRSMeasParamsDescOpt utran_gprs_meas_params_desc, |
| 449 | |
| 450 | /* SI2quater Rel-{5,6,7,8,9,10} Additions (Matrioshka!) */ |
| 451 | SI2quaterAdditions rel_additions |
| 452 | } with { |
| 453 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 454 | * so we should make sure that unused bits contain proper padding. */ |
| 455 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 456 | }; |
Neels Hofmeyr | ad132f2 | 2020-07-08 02:20:16 +0200 | [diff] [blame] | 457 | type record of SI2quaterRestOctets SI2quaterRestOctetsList; |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 458 | |
| 459 | /* Measurement Parameters Description */ |
| 460 | private type record MeasParamsDescOpt { |
| 461 | BIT1 presence, // 0/1 |
| 462 | MeasParamsDesc desc optional |
| 463 | } with { |
| 464 | variant (desc) "PRESENCE(presence = '1'B)" |
| 465 | }; |
| 466 | |
| 467 | private type record MeasParamsDesc { |
| 468 | BIT1 report_type, |
| 469 | BIT2 serving_band_reporting |
| 470 | } with { variant "" }; |
| 471 | |
| 472 | /* GPRS Real Time Difference Description (not implemented) */ |
| 473 | private type record GPRS_RealTimeDiffDescOpt { |
| 474 | BIT1 presence ('0'B), // 0/1 |
| 475 | bitstring desc optional // TODO |
| 476 | } with { |
| 477 | variant (desc) "PRESENCE(presence = '1'B)" |
| 478 | }; |
| 479 | |
| 480 | /* GPRS BSIC Description (not implemented) */ |
| 481 | private type record GPRS_BSICDescOpt { |
| 482 | BIT1 presence ('0'B), // 0/1 |
| 483 | bitstring desc optional // TODO |
| 484 | } with { |
| 485 | variant (desc) "PRESENCE(presence = '1'B)" |
| 486 | }; |
| 487 | |
| 488 | /* GPRS Report Priority Description (not implemented) */ |
| 489 | private type record GPRS_ReportPrioDescOpt { |
| 490 | BIT1 presence ('0'B), // 0/1 |
| 491 | bitstring desc optional // TODO |
| 492 | } with { |
| 493 | variant (desc) "PRESENCE(presence = '1'B)" |
| 494 | }; |
| 495 | |
| 496 | /* NC (Network Controlled?) Measurement Parameters */ |
| 497 | private type record NCMeasParams { |
| 498 | /* Network Control Order */ |
| 499 | BIT2 nco, |
| 500 | BIT1 p_presence, |
| 501 | NCMeasPeriods p optional |
| 502 | } with { |
| 503 | variant (p) "PRESENCE(p_presence = '1'B)" |
| 504 | }; |
| 505 | |
| 506 | /* NC Measurement Periods */ |
| 507 | private type record NCMeasParamsOpt { |
| 508 | BIT1 presence, // 0/1 |
| 509 | NCMeasParams params optional |
| 510 | } with { |
| 511 | variant (params) "PRESENCE(presence = '1'B)" |
| 512 | }; |
| 513 | |
| 514 | private type record NCMeasPeriods { |
| 515 | BIT3 non_drx_period, |
| 516 | BIT3 rep_period_i, |
| 517 | BIT3 rep_period_t |
| 518 | } with { variant "" }; |
| 519 | |
| 520 | /* SI2quater Extersion Information */ |
| 521 | private type record SI2quaterExtInfoOpt { |
| 522 | BIT1 presence, // 0/1 |
| 523 | SI2quaterExtInfo info optional |
| 524 | } with { |
| 525 | variant (info) "PRESENCE(presence = '1'B)" |
| 526 | }; |
| 527 | |
| 528 | private type record SI2quaterExtInfo { |
| 529 | uint8_t len, |
| 530 | CCNSupportDescOpt ccn_supp_desc optional, |
| 531 | bitstring padding /* Octet alignment? */ |
| 532 | } with { |
| 533 | variant (len) "LENGTHTO(ccn_supp_desc,padding) + 1" |
| 534 | variant (len) "UNIT(bits)" |
| 535 | }; |
| 536 | |
| 537 | /* CCN Support Description */ |
| 538 | private type record CCNSupportDescOpt { |
| 539 | BIT1 presence, // 0/1 |
| 540 | CCNSupportDesc desc optional |
| 541 | } with { |
| 542 | variant (desc) "PRESENCE(presence = '1'B)" |
| 543 | }; |
| 544 | |
| 545 | private type record CCNSupportDesc { |
| 546 | uint7_t nr_of_cells, |
| 547 | bitstring ccn_supported |
| 548 | } with { |
| 549 | variant (nr_of_cells) "LENGTHTO(ccn_supported)" |
| 550 | variant (nr_of_cells) "UNIT(bits)" |
| 551 | }; |
| 552 | |
| 553 | /* 3G Neighbour Cell Description */ |
| 554 | private type record UTRAN_NeighDescOpt { |
| 555 | BIT1 presence, // 0/1 |
| 556 | UTRAN_NeighDesc desc optional |
| 557 | } with { |
| 558 | variant (desc) "PRESENCE(presence = '1'B)" |
| 559 | }; |
| 560 | |
| 561 | private type record UTRAN_NeighDesc { |
| 562 | BIT1 idx_start_3g_presence, |
| 563 | uint7_t idx_start_3g optional, |
| 564 | BIT1 abs_idx_start_emr_presence, |
| 565 | uint7_t abs_idx_start_emr optional, |
| 566 | UTRAN_FDDDescOpt fdd_desc, |
| 567 | UTRAN_TDDDescOpt tdd_desc |
| 568 | } with { |
| 569 | variant (idx_start_3g) "PRESENCE(idx_start_3g_presence = '1'B)" |
| 570 | variant (abs_idx_start_emr) "PRESENCE(abs_idx_start_emr_presence = '1'B)" |
| 571 | }; |
| 572 | |
| 573 | /* UTRAN (3G) FDD/TDD Description (not implementaed). |
| 574 | * |
| 575 | * TODO: Repeated UTRAN FDD/TDD Neighbour Cells structure contains a variable length |
| 576 | * field, that needs to be computed using tables (see 9.1.54.1a and 9.1.54.1b) with |
| 577 | * magic numbers. This cannot be described uing TITAN's RAW codec attributes. */ |
| 578 | private type record UTRAN_FDDDescOpt { |
| 579 | BIT1 presence ('0'B), // 0/1 |
| 580 | bitstring desc optional // TODO |
| 581 | } with { |
| 582 | variant (desc) "PRESENCE(presence = '1'B)" |
| 583 | }; |
| 584 | |
| 585 | private type record UTRAN_TDDDescOpt { |
| 586 | BIT1 presence ('0'B), // 0/1 |
| 587 | bitstring desc optional // TODO |
| 588 | } with { |
| 589 | variant (desc) "PRESENCE(presence = '1'B)" |
| 590 | }; |
| 591 | |
| 592 | /* 3G Measurement Parameters Description (not implemented) */ |
| 593 | private type record UTRAN_MeasParamsDescOpt { |
| 594 | BIT1 presence ('0'B), // 0/1 |
| 595 | bitstring desc optional // TODO |
| 596 | } with { |
| 597 | variant (desc) "PRESENCE(presence = '1'B)" |
| 598 | }; |
| 599 | |
| 600 | /* GPRS 3G Measurement Parameters Description (not implemented) */ |
| 601 | private type record UTRAN_GPRSMeasParamsDescOpt { |
| 602 | BIT1 presence ('0'B), // 0/1 |
| 603 | bitstring desc optional // TODO |
| 604 | } with { |
| 605 | variant (desc) "PRESENCE(presence = '1'B)" |
| 606 | }; |
| 607 | |
| 608 | /* SI2quater Rel-{5,6,7,8,9,10} Additions */ |
| 609 | private type record SI2quaterAdditions { |
| 610 | BIT1 rel5_presence, // L/H |
| 611 | SI2quaterR5Additions rel5 optional |
| 612 | } with { |
| 613 | variant (rel5_presence) "CSN.1 L/H" |
| 614 | variant (rel5) "PRESENCE(rel5_presence = '1'B)" |
| 615 | }; |
| 616 | |
| 617 | /* SI2quater Rel-5 and Rel-{6,7,8,9,10} Additions */ |
| 618 | private type record SI2quaterR5Additions { |
| 619 | UMTS_AddMeasParamsDescOpt umts_add_meas_params_desc, |
| 620 | UMTS_AddMeasParamsDesc2Opt umts_add_meas_params_desc2, |
| 621 | BIT1 rel6_presence, // L/H |
| 622 | SI2quaterR6Additions rel6 optional |
| 623 | } with { |
| 624 | variant (rel6_presence) "CSN.1 L/H" |
| 625 | variant (rel6) "PRESENCE(rel6_presence = '1'B)" |
| 626 | }; |
| 627 | |
| 628 | /* 3G Additional Measurement Parameters Description */ |
| 629 | private type record UMTS_AddMeasParamsDescOpt { |
| 630 | BIT1 presence, // 0/1 |
| 631 | UMTS_AddMeasParamsDesc desc optional |
| 632 | } with { |
| 633 | variant (desc) "PRESENCE(presence = '1'B)" |
| 634 | }; |
| 635 | |
| 636 | private type record UMTS_AddMeasParamsDesc { |
| 637 | BIT3 fdd_qmin_offset, |
| 638 | BIT4 fdd_rscpmin |
| 639 | } with { variant "" }; |
| 640 | |
| 641 | /* 3G Additional Measurement Parameters Description 2 */ |
| 642 | private type record UMTS_AddMeasParamsDesc2Opt { |
| 643 | BIT1 presence, // 0/1 |
| 644 | UMTS_AddMeasParamsDesc desc optional |
| 645 | } with { |
| 646 | variant (desc) "PRESENCE(presence = '1'B)" |
| 647 | }; |
| 648 | |
| 649 | private type record UMTS_AddMeasParamsDesc2 { |
| 650 | /* FDD Reporting Threshold 2 */ |
| 651 | BIT1 presence, // 0/1 |
| 652 | uint6_t threshold optional |
| 653 | } with { |
| 654 | variant (threshold) "PRESENCE(presence = '1'B)" |
| 655 | }; |
| 656 | |
| 657 | /* SI2quater Rel-6 and Rel-{7,8,9,10} Additions */ |
| 658 | private type record SI2quaterR6Additions { |
| 659 | BIT1 umts_ccn_active, |
| 660 | BIT1 rel7_presence, // L/H |
| 661 | SI2quaterR7Additions rel7 optional |
| 662 | } with { |
| 663 | variant (rel7_presence) "CSN.1 L/H" |
| 664 | variant (rel7) "PRESENCE(rel7_presence = '1'B)" |
| 665 | }; |
| 666 | |
| 667 | /* SI2quater Rel-7 and Rel-{8,9,10} Additions */ |
| 668 | private type record SI2quaterR7Additions { |
| 669 | Rel7RepOffseThresholdOpt rep700, |
| 670 | Rel7RepOffseThresholdOpt rep810, |
| 671 | BIT1 rel8_presence, // L/H |
| 672 | SI2quaterR8Additions rel8 optional |
| 673 | } with { |
| 674 | variant (rel8_presence) "CSN.1 L/H" |
| 675 | variant (rel8) "PRESENCE(rel8_presence = '1'B)" |
| 676 | }; |
| 677 | |
| 678 | /* Additions in Rel-7: Reporting Offset & Threshold */ |
| 679 | private type record Rel7RepOffseThresholdOpt { |
| 680 | BIT1 presence, // 0/1 |
| 681 | Rel7RepOffseThreshold val optional |
| 682 | } with { |
| 683 | variant (val) "PRESENCE(presence = '1'B)" |
| 684 | }; |
| 685 | |
| 686 | private type record Rel7RepOffseThreshold { |
| 687 | BIT3 offset, |
| 688 | BIT3 threshold |
| 689 | } with { variant "" }; |
| 690 | |
| 691 | /* SI2quater Rel-8 and Rel-{9,10} Additions */ |
| 692 | private type record SI2quaterR8Additions { |
| 693 | Rel8PrioEUTRANParamsDescOpt prio_eutran_params_desc, |
| 694 | Rel8UTRANCSGDescOpt utran_csg_desc, |
| 695 | Rel8EUTRANCSGDescOpt eutran_csg_desc |
| 696 | // TODO: Rel9 Additions (not implemented) |
| 697 | } with { variant "" }; |
| 698 | |
| 699 | /* Additions in Rel-8: Priority and E-UTRAN Parameters Description */ |
| 700 | private type record Rel8PrioEUTRANParamsDescOpt { |
| 701 | BIT1 presence, // 0/1 |
| 702 | Rel8PrioEUTRANParamsDesc desc optional |
| 703 | } with { |
| 704 | variant (desc) "PRESENCE(presence = '1'B)" |
| 705 | }; |
| 706 | |
| 707 | private type record Rel8PrioEUTRANParamsDesc { |
| 708 | ServingCellPrioParamsDescOpt sc_prio_params_desc, |
| 709 | UTRAN_PrioParamsDescOpt utran_prio_params_desc, |
| 710 | EUTRAN_ParamsDescOpt eutran_params_desc |
| 711 | } with { variant "" }; |
| 712 | |
| 713 | /* Serving Cell Priority Parameters Description */ |
| 714 | private type record ServingCellPrioParamsDescOpt { |
| 715 | BIT1 presence, // 0/1 |
| 716 | ServingCellPrioParamsDesc desc optional |
| 717 | } with { |
| 718 | variant (desc) "PRESENCE(presence = '1'B)" |
| 719 | }; |
| 720 | |
| 721 | private type record ServingCellPrioParamsDesc { |
| 722 | uint3_t geran_priority, |
| 723 | uint4_t thresh_priority_search, |
| 724 | uint4_t thresh_gsm_low, |
| 725 | uint2_t h_prio, |
| 726 | uint2_t t_reselection |
| 727 | } with { variant "" }; |
| 728 | |
| 729 | /* 3G Priority Parameters Description (not implemented) */ |
| 730 | private type record UTRAN_PrioParamsDescOpt { |
| 731 | BIT1 presence, // 0/1 |
| 732 | bitstring desc optional // TODO |
| 733 | } with { |
| 734 | variant (desc) "PRESENCE(presence = '1'B)" |
| 735 | }; |
| 736 | |
| 737 | /* E-UTRAN Parameters Description */ |
| 738 | private type record EUTRAN_ParamsDescOpt { |
| 739 | BIT1 presence, // 0/1 |
| 740 | EUTRAN_ParamsDesc desc optional |
| 741 | } with { |
| 742 | variant (desc) "PRESENCE(presence = '1'B)" |
| 743 | }; |
| 744 | |
| 745 | private type record EUTRAN_ParamsDesc { |
| 746 | BIT1 ccn_active, |
| 747 | BIT1 e_start, |
| 748 | BIT1 e_stop, |
| 749 | |
| 750 | /* E-UTRAN Measurement Parameters Description */ |
| 751 | EUTRAN_MeasParamsDescOpt meas_params_desc, |
| 752 | /* GPRS E-UTRAN Measurement Parameters Description */ |
| 753 | EUTRAN_GPRSMeasParamsDescOpt gprs_meas_params_desc, |
| 754 | |
| 755 | /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */ |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 756 | EUTRAN_RepeatedNeighbourCells repeated_neigh_cells optional, |
| 757 | BIT1 repeated_neigh_cells_term ('0'B), |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 758 | /* { 1 < Repeated E-UTRAN Not Allowed Cells > } ** 0 */ |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 759 | EUTRAN_RepeatedNotAllowedCells repeated_not_allowed_cells optional, |
| 760 | BIT1 repeated_not_allowed_cells_term ('0'B), |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 761 | /* { 1 < Repeated E-UTRAN PCID to TA mapping > } ** 0 */ |
| 762 | EUTRAN_PCID2TAMaps pcid2ta_map_list optional, |
| 763 | BIT1 pcid2ta_map_list_term ('0'B) |
| 764 | } with { variant "" }; |
| 765 | |
| 766 | /* E-UTRAN Measurement Parameters Description (not implemented) */ |
| 767 | private type record EUTRAN_MeasParamsDescOpt { |
| 768 | BIT1 presence, // 0/1 |
| 769 | bitstring desc optional // TODO |
| 770 | } with { |
| 771 | variant (desc) "PRESENCE(presence = '1'B)" |
| 772 | }; |
| 773 | |
| 774 | /* GPRS E-UTRAN Measurement Parameters Description (not implemented) */ |
| 775 | private type record EUTRAN_GPRSMeasParamsDescOpt { |
| 776 | BIT1 presence, // 0/1 |
| 777 | bitstring desc optional // TODO |
| 778 | } with { |
| 779 | variant (desc) "PRESENCE(presence = '1'B)" |
| 780 | }; |
| 781 | |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 782 | /* Repeated E-UTRAN Neighbour Cells */ |
| 783 | private type record of EUTRAN_NeighbourCells EUTRAN_RepeatedNeighbourCells; |
Vadim Yanitskiy | eacec8a | 2020-07-03 06:44:40 +0700 | [diff] [blame] | 784 | type record EUTRAN_NeighbourCells { |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 785 | BIT1 item_ind ('1'B), |
| 786 | /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */ |
| 787 | EUTRAN_CellDescs cell_desc_list optional, |
| 788 | BIT1 cell_desc_list_term ('0'B), |
| 789 | BIT1 prio_presence, // 0/1 |
| 790 | uint3_t prio optional, |
| 791 | uint5_t thresh_high, |
| 792 | BIT1 thresh_low_presence, // 0/1 |
| 793 | uint5_t thresh_low optional, |
| 794 | BIT1 qrxlevmin_presence, // 0/1 |
| 795 | uint5_t qrxlevmin optional |
| 796 | } with { |
| 797 | variant "PRESENCE(item_ind = '1'B)" |
| 798 | variant (prio) "PRESENCE(prio_presence = '1'B)" |
| 799 | variant (thresh_low) "PRESENCE(thresh_low_presence = '1'B)" |
| 800 | variant (qrxlevmin) "PRESENCE(qrxlevmin_presence = '1'B)" |
| 801 | }; |
| 802 | |
| 803 | /* Repeated E-UTRAN Cell Description (E-ARFCN & Measurement Bandwidth) List */ |
Vadim Yanitskiy | eacec8a | 2020-07-03 06:44:40 +0700 | [diff] [blame] | 804 | type record of EUTRAN_CellDesc EUTRAN_CellDescs; |
| 805 | type record EUTRAN_CellDesc { |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 806 | BIT1 item_ind ('1'B), |
| 807 | uint16_t e_arfcn, |
| 808 | BIT1 meas_bw_presence, // 0/1 |
| 809 | uint3_t meas_bw optional |
| 810 | } with { |
| 811 | variant "PRESENCE(item_ind = '1'B)" |
| 812 | variant (meas_bw) "PRESENCE(meas_bw_presence = '1'B)" |
| 813 | }; |
| 814 | |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 815 | /* Repeated E-UTRAN Not Allowed Cells */ |
| 816 | private type record of EUTRAN_NotAllowedCells EUTRAN_RepeatedNotAllowedCells; |
| 817 | private type record EUTRAN_NotAllowedCells { |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 818 | BIT1 item_ind ('1'B), |
| 819 | /* FIXME: Not Allowed Cells : < PCID Group IE > (not implemented) */ |
| 820 | BIT1 pcid_group_presence ('0'B), |
| 821 | /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */ |
| 822 | EUTRAN_FreqIndexes freq_idx_list optional, |
| 823 | BIT1 freq_idx_list_term ('0'B) |
| 824 | } with { |
| 825 | variant "PRESENCE(item_ind = '1'B)" |
| 826 | }; |
| 827 | |
| 828 | /* Repeated E-UTRAN PCID to TA mapping List */ |
| 829 | private type record of EUTRAN_PCID2TAMap EUTRAN_PCID2TAMaps; |
| 830 | private type record EUTRAN_PCID2TAMap { |
| 831 | BIT1 item_ind ('1'B), |
| 832 | /* FIXME: PCID to TA mapping : < PCID Group IE > (not implemented) */ |
| 833 | BIT1 pcid_group_presence ('0'B), |
| 834 | /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */ |
| 835 | EUTRAN_FreqIndexes freq_idx_list optional, |
| 836 | BIT1 freq_idx_list_term ('0'B) |
| 837 | } with { |
| 838 | variant "PRESENCE(item_ind = '1'B)" |
| 839 | }; |
| 840 | |
| 841 | /* Repeated E-UTRAN Frequency Index List */ |
| 842 | private type record of EUTRAN_FreqIndex EUTRAN_FreqIndexes; |
| 843 | private type record EUTRAN_FreqIndex { |
| 844 | BIT1 item_ind ('1'B), |
| 845 | uint3_t idx |
| 846 | } with { |
| 847 | variant "PRESENCE(item_ind = '1'B)" |
| 848 | }; |
| 849 | |
| 850 | /* Additions in Rel-8: 3G CSG Description (not implemented) */ |
| 851 | private type record Rel8UTRANCSGDescOpt { |
| 852 | BIT1 presence, // 0/1 |
| 853 | bitstring desc optional // TODO |
| 854 | } with { |
| 855 | variant (desc) "PRESENCE(presence = '1'B)" |
| 856 | }; |
| 857 | |
| 858 | /* Additions in Rel-8: E-UTRAN CSG Description (not implemented) */ |
| 859 | private type record Rel8EUTRANCSGDescOpt { |
| 860 | BIT1 presence, // 0/1 |
| 861 | bitstring desc optional // TODO |
| 862 | } with { |
| 863 | variant (desc) "PRESENCE(presence = '1'B)" |
| 864 | }; |
| 865 | |
| 866 | |
| 867 | /* Basic any-/omit-matching templates. To be inherited by other templates (see below). |
| 868 | * The point is that you cannot fit everything into 20 octets, so usually several kinds |
| 869 | * of SI2quater are being sub-multiplexed by the BTS. This is achieved using both |
| 870 | * 'si2quater_index' and 'si2quater_count' fields. */ |
| 871 | template SI2quaterRestOctets tra_SI2quaterRestOctets_base := { |
| 872 | ba_ind := ?, |
| 873 | ba_3g_ind := ?, |
| 874 | mp_change_mark := ?, |
| 875 | si2quater_index := ?, |
| 876 | si2quater_count := ?, |
| 877 | |
| 878 | meas_params_desc := { presence := ?, desc := * }, |
| 879 | gprs := { |
| 880 | rt_diff_desc := { presence := ?, desc := * }, |
| 881 | bsic_desc := { presence := ?, desc := * }, |
| 882 | rep_prio_desc := { presence := ?, desc := * }, |
| 883 | meas_params_desc := { presence := ?, desc := * } |
| 884 | }, |
| 885 | nc_meas_params := { presence := ?, params := * }, |
| 886 | ext_info := { presence := ?, info := * }, |
| 887 | |
| 888 | utran_neigh_desc := { presence := ?, desc := * }, |
| 889 | utran_meas_params_desc := { presence := ?, desc := * }, |
| 890 | utran_gprs_meas_params_desc := { presence := ?, desc := * }, |
| 891 | |
| 892 | rel_additions := ? |
| 893 | }; |
| 894 | |
| 895 | template SI2quaterRestOctets tro_SI2quaterRestOctets_base := { |
| 896 | ba_ind := ?, |
| 897 | ba_3g_ind := ?, |
| 898 | mp_change_mark := ?, |
| 899 | si2quater_index := ?, |
| 900 | si2quater_count := ?, |
| 901 | |
| 902 | meas_params_desc := { presence := '0'B, desc := omit }, |
| 903 | gprs := { |
| 904 | rt_diff_desc := { presence := '0'B, desc := omit }, |
| 905 | bsic_desc := { presence := '0'B, desc := omit }, |
| 906 | rep_prio_desc := { presence := '0'B, desc := omit }, |
| 907 | meas_params_desc := { presence := '0'B, desc := omit } |
| 908 | }, |
| 909 | nc_meas_params := { presence := '0'B, params := omit }, |
| 910 | ext_info := { presence := '0'B, info := omit }, |
| 911 | |
| 912 | utran_neigh_desc := { presence := '0'B, desc := omit }, |
| 913 | utran_meas_params_desc := { presence := '0'B, desc := omit }, |
| 914 | utran_gprs_meas_params_desc := { presence := '0'B, desc := omit }, |
| 915 | |
| 916 | rel_additions := { rel5_presence := CSN1_L, rel5 := omit } |
| 917 | }; |
| 918 | |
Vadim Yanitskiy | eacec8a | 2020-07-03 06:44:40 +0700 | [diff] [blame] | 919 | template SI2quaterRestOctets tro_SI2quaterRestOctets_rel8_EUTRAN |
| 920 | modifies tro_SI2quaterRestOctets_base |
| 921 | := { |
| 922 | ba_ind := ?, |
| 923 | ba_3g_ind := ?, |
| 924 | mp_change_mark := ?, |
| 925 | si2quater_index := ?, |
| 926 | si2quater_count := ?, |
| 927 | |
| 928 | rel_additions := { |
| 929 | rel5_presence := CSN1_H, |
| 930 | rel5 := { |
| 931 | umts_add_meas_params_desc := { presence := '0'B, desc := omit }, |
| 932 | umts_add_meas_params_desc2 := { presence := '0'B, desc := omit }, |
| 933 | rel6_presence := CSN1_H, |
| 934 | rel6 := { |
| 935 | umts_ccn_active := '0'B, |
| 936 | rel7_presence := CSN1_H, |
| 937 | rel7 := { |
| 938 | rep700 := { presence := '0'B, val := omit }, |
| 939 | rep810 := { presence := '0'B, val := omit }, |
| 940 | rel8_presence := CSN1_H, |
| 941 | rel8 := { |
| 942 | prio_eutran_params_desc := { |
| 943 | presence := '1'B, |
| 944 | desc := { |
| 945 | sc_prio_params_desc := { presence := '0'B, desc := omit }, |
| 946 | utran_prio_params_desc := { presence := '0'B, desc := omit }, |
| 947 | eutran_params_desc := { |
| 948 | presence := '1'B, |
| 949 | desc := { |
| 950 | ccn_active := ?, |
| 951 | e_start := ?, |
| 952 | e_stop := ?, |
| 953 | meas_params_desc := { presence := '0'B, desc := omit }, |
| 954 | gprs_meas_params_desc := { presence := '0'B, desc := omit }, |
| 955 | repeated_neigh_cells := *, |
| 956 | repeated_neigh_cells_term := '0'B, |
| 957 | repeated_not_allowed_cells := omit, |
| 958 | repeated_not_allowed_cells_term := '0'B, |
| 959 | pcid2ta_map_list := omit, |
| 960 | pcid2ta_map_list_term := '0'B |
| 961 | } |
| 962 | } |
| 963 | } |
| 964 | }, |
| 965 | utran_csg_desc := { presence := '0'B, desc := omit }, |
| 966 | eutran_csg_desc := { presence := '0'B, desc := omit } |
| 967 | } |
| 968 | } |
| 969 | } |
| 970 | } |
| 971 | } |
| 972 | }; |
| 973 | |
| 974 | template EUTRAN_CellDesc tr_EUTRAN_CellDesc(template (present) uint16_t e_arfcn := ?, |
| 975 | template (present) BIT1 meas_bw_presence := ?, |
| 976 | template uint3_t meas_bw := *) |
| 977 | := { |
| 978 | item_ind := '1'B, |
| 979 | e_arfcn := e_arfcn, |
| 980 | meas_bw_presence := meas_bw_presence, |
| 981 | meas_bw := meas_bw |
| 982 | } |
| 983 | |
| 984 | /* Defaults correspond to osmo-bsc cfg: |
| 985 | * si2quater neighbor-list add earfcn 111 thresh-hi 20 thresh-lo 10 prio 3 qrxlv 22 meas 3 |
| 986 | */ |
| 987 | template EUTRAN_NeighbourCells tr_EUTRAN_NeighbourCells(template (present) EUTRAN_CellDescs cell_desc_list := { tr_EUTRAN_CellDesc }, |
| 988 | template (present) BIT1 prio_presence := ?, |
| 989 | template uint3_t prio := *, |
| 990 | template (present) uint5_t thresh_high := ?, |
| 991 | template (present) BIT1 thresh_low_presence := ?, |
| 992 | template uint5_t thresh_low := *, |
| 993 | template (present) BIT1 qrxlevmin_presence := ?, |
| 994 | template uint5_t qrxlevmin := *) |
| 995 | := { |
| 996 | item_ind := '1'B, |
| 997 | cell_desc_list := cell_desc_list, |
| 998 | cell_desc_list_term := '0'B, |
| 999 | prio_presence := prio_presence, |
| 1000 | prio := prio, |
| 1001 | thresh_high := thresh_high, |
| 1002 | thresh_low_presence := thresh_low_presence, |
| 1003 | thresh_low := thresh_low, |
| 1004 | qrxlevmin_presence := qrxlevmin_presence, |
| 1005 | qrxlevmin := qrxlevmin |
| 1006 | }; |
| 1007 | |
| 1008 | template SI2quaterRestOctets tr_SI2quaterRestOctets_EUTRAN( |
| 1009 | template integer index := 0, |
| 1010 | template integer count := 0, |
| 1011 | template EUTRAN_RepeatedNeighbourCells repeated_neigh_cells := { tr_EUTRAN_NeighbourCells } |
| 1012 | ) modifies tro_SI2quaterRestOctets_rel8_EUTRAN := { |
| 1013 | si2quater_index := index, |
| 1014 | si2quater_count := count, |
| 1015 | rel_additions := { |
| 1016 | rel5 := { |
| 1017 | rel6 := { |
| 1018 | rel7 := { |
| 1019 | rel8 := { |
| 1020 | prio_eutran_params_desc := { |
| 1021 | desc := { |
| 1022 | sc_prio_params_desc := { |
| 1023 | presence := '1'B, |
| 1024 | desc := { |
| 1025 | geran_priority := 0, |
| 1026 | thresh_priority_search := 0, |
| 1027 | thresh_gsm_low := 0, |
| 1028 | h_prio := 0, |
| 1029 | t_reselection := 0 |
| 1030 | } |
| 1031 | }, |
| 1032 | eutran_params_desc := { |
| 1033 | desc := { |
| 1034 | ccn_active := '0'B, |
| 1035 | e_start := '1'B, |
| 1036 | e_stop := '1'B, |
| 1037 | repeated_neigh_cells := repeated_neigh_cells |
| 1038 | } |
| 1039 | } |
| 1040 | } |
| 1041 | } |
| 1042 | } |
| 1043 | } |
| 1044 | } |
| 1045 | } |
| 1046 | } |
| 1047 | }; |
| 1048 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 1049 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1050 | /* 10.5.2.34 SI 3 Rest Octets */ |
| 1051 | type record SI3RestOctets { |
| 1052 | SelectionParamsOpt sel_params, |
| 1053 | PowerOffsetOpt pwr_offset, |
| 1054 | BIT1 si_2ter_ind, |
| 1055 | BIT1 early_cm_ind, |
| 1056 | SchedIfAndWhere sched_where, |
| 1057 | GPRSIndicatorOpt gprs_ind, |
| 1058 | BIT1 umts_early_cm_ind, |
| 1059 | SI2quaterIndicatorOpt si2_quater_ind, |
| 1060 | BIT1 iu_mode_ind ('1'B) optional, |
| 1061 | SI21IndicatorOpt si21_ind optional |
| 1062 | /* ... spare padding ... */ |
| 1063 | } with { |
| 1064 | variant (si_2ter_ind) "CSN.1 L/H" |
| 1065 | variant (early_cm_ind) "CSN.1 L/H" |
| 1066 | variant (umts_early_cm_ind) "CSN.1 L/H" |
| 1067 | |
| 1068 | /* If Iu mode is not supported in the cell, the Iu Indicator is not sent |
| 1069 | * within this cell. Iu Indicator is included if and only if GPRS is |
| 1070 | * not supported, and Iu mode is supported in the cell. */ |
| 1071 | variant (iu_mode_ind) "PRESENCE(gprs_ind.presence = '0'B)" |
| 1072 | /* SI21 field is only present if 'WHERE' information is not present. */ |
| 1073 | variant (si21_ind) "PRESENCE(sched_where.presence = '0'B)" |
Vadim Yanitskiy | 135b45e | 2020-05-04 19:54:02 +0700 | [diff] [blame] | 1074 | |
| 1075 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 1076 | * so we should make sure that unused bits contain proper padding. */ |
| 1077 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1078 | }; |
| 1079 | |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 1080 | /* 10.5.2.35 SI 4 Rest Octets (O & S) */ |
| 1081 | type record SI4RestOctets { |
| 1082 | SelectionParamsOpt sel_params, |
| 1083 | PowerOffsetOpt pwr_offset, |
| 1084 | GPRSIndicatorOpt gprs_ind, |
| 1085 | BIT1 s_presence, // L/H |
| 1086 | /* TODO: optional "Rest Octets S" part */ |
| 1087 | bitstring s optional |
| 1088 | } with { |
| 1089 | variant (s_presence) "CSN.1 L/H" |
| 1090 | variant (s) "PRESENCE(s_presence = '1'B)" |
Vadim Yanitskiy | 135b45e | 2020-05-04 19:54:02 +0700 | [diff] [blame] | 1091 | |
| 1092 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 1093 | * so we should make sure that unused bits contain proper padding. */ |
| 1094 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 1095 | }; |
| 1096 | |
Vadim Yanitskiy | dbd2f61 | 2022-03-10 17:03:26 +0300 | [diff] [blame] | 1097 | /* 10.5.2.35a SI 6 Rest Octets */ |
| 1098 | type record SI6RestOctets { |
| 1099 | PchAndNchInfoOpt pch_nch_info, |
| 1100 | VbsVgcsOptionsOpt vbs_vgcs_options, |
| 1101 | BIT1 dtm_support, // L/H |
| 1102 | uint8_t rac optional, |
| 1103 | uint3_t max_lapdm optional, |
| 1104 | BIT1 band_ind // L/H (DCS/PCS) |
| 1105 | /* TODO: add more fields */ |
| 1106 | } with { |
| 1107 | variant (dtm_support) "CSN.1 L/H" |
| 1108 | variant (rac) "PRESENCE(dtm_support = '1'B)" |
| 1109 | variant (max_lapdm) "PRESENCE(dtm_support = '1'B)" |
| 1110 | variant (band_ind) "CSN.1 L/H" |
| 1111 | |
| 1112 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 1113 | * so we should make sure that unused bits contain proper padding. */ |
| 1114 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 1115 | }; |
| 1116 | |
| 1117 | /* Optional PCH and NCH info: L | H < PCH and NCH info > */ |
| 1118 | type record PchAndNchInfoOpt { |
| 1119 | BIT1 presence, // L/H |
| 1120 | PchAndNchInfo info optional |
| 1121 | } with { |
| 1122 | variant (presence) "CSN.1 L/H" |
| 1123 | variant (info) "PRESENCE(presence = '1'B)" |
| 1124 | }; |
| 1125 | |
| 1126 | /* PCH and NCH info */ |
| 1127 | type record PchAndNchInfo { |
| 1128 | BIT1 pag_chan_restruct, |
| 1129 | uint2_t nln_sacch, |
| 1130 | BIT1 call_prio_presence, |
| 1131 | uint3_t call_prio optional, |
| 1132 | BIT1 nln_status_sacch |
| 1133 | } with { |
| 1134 | variant (call_prio) "PRESENCE(call_prio_presence = '1'B)" |
| 1135 | }; |
| 1136 | |
| 1137 | /* Optional VBS/VGCS options: L | H < VBS/VGCS options > */ |
| 1138 | type record VbsVgcsOptionsOpt { |
| 1139 | BIT1 presence, // L/H |
| 1140 | BIT2 options optional |
| 1141 | } with { |
| 1142 | variant (presence) "CSN.1 L/H" |
| 1143 | variant (options) "PRESENCE(presence = '1'B)" |
| 1144 | }; |
| 1145 | |
Pau Espin Pedrol | 28652d8 | 2021-02-09 20:20:17 +0100 | [diff] [blame] | 1146 | /* 10.5.2.37b SI 13 Rest Octets (O & S) */ |
| 1147 | type record SI13RestOctets { |
| 1148 | BIT1 presence, // L/H |
| 1149 | uint3_t bcch_change_mark, |
| 1150 | BIT4 si_change_field, |
| 1151 | BIT1 presence2, |
| 1152 | BIT2 si13_change_mark optional, |
| 1153 | GprsMobileAllocation gprs_ma optional, |
| 1154 | BIT1 zero ('0'B), /* PBCCH not present in cell */ |
| 1155 | uint8_t rac, |
| 1156 | BIT1 spgc_ccch_sup, |
| 1157 | BIT3 priority_access_thr, |
| 1158 | BIT2 network_control_order, |
| 1159 | GprsCellOptions gprs_cell_opts, |
| 1160 | GprsPowerControlParameters gprs_pwr_ctrl_params |
| 1161 | /* TODO: Additions in release 99 */ |
| 1162 | } with { |
| 1163 | |
| 1164 | variant (presence) "CSN.1 L/H" |
| 1165 | /* TODO: for all fields after presencte: variant (<field>) "PRESENCE(presence = '1'B)" */ |
| 1166 | variant (si13_change_mark) "PRESENCE(presence2 = '1'B)" |
| 1167 | variant (gprs_ma) "PRESENCE(presence2 = '1'B)" |
| 1168 | |
| 1169 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 1170 | * so we should make sure that unused bits contain proper padding. */ |
| 1171 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 1172 | }; |
| 1173 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1174 | /* Selection Parameters */ |
| 1175 | type record SelectionParams { |
| 1176 | boolean cbq, |
| 1177 | uint6_t cr_offset, |
| 1178 | uint3_t temp_offset, |
| 1179 | uint5_t penalty_time |
| 1180 | } with { |
| 1181 | variant (cbq) "FIELDLENGTH(1)" |
| 1182 | }; |
| 1183 | |
| 1184 | /* Optional Selection Parameters: L | H < Selection Parameters > */ |
| 1185 | type record SelectionParamsOpt { |
| 1186 | BIT1 presence, // L/H |
| 1187 | SelectionParams params optional |
| 1188 | } with { |
| 1189 | variant (presence) "CSN.1 L/H" |
| 1190 | variant (params) "PRESENCE(presence = '1'B)" |
| 1191 | }; |
| 1192 | |
| 1193 | /* Optional Power Offset: L | H < Power Offset bit(2) > */ |
| 1194 | type record PowerOffsetOpt { |
| 1195 | BIT1 presence, // L/H |
| 1196 | uint2_t offset optional |
| 1197 | } with { |
| 1198 | variant (presence) "CSN.1 L/H" |
| 1199 | variant (offset) "PRESENCE(presence = '1'B)" |
| 1200 | }; |
| 1201 | |
| 1202 | /* Scheduling if and where: L | H < WHERE bit(3) > */ |
| 1203 | type record SchedIfAndWhere { |
| 1204 | BIT1 presence, // L/H |
| 1205 | uint3_t where optional |
| 1206 | } with { |
| 1207 | variant (presence) "CSN.1 L/H" |
| 1208 | variant (where) "PRESENCE(presence = '1'B)" |
| 1209 | }; |
| 1210 | |
| 1211 | type record GPRSIndicator { |
| 1212 | uint3_t ra_colour, |
| 1213 | BIT1 si13_pos |
| 1214 | } with { variant "" }; |
| 1215 | |
| 1216 | /* Optional GPRS Indicator: L | H < GPRS Indicator > */ |
| 1217 | type record GPRSIndicatorOpt { |
| 1218 | BIT1 presence, // L/H |
| 1219 | GPRSIndicator ind optional |
| 1220 | } with { |
| 1221 | variant (presence) "CSN.1 L/H" |
| 1222 | variant (ind) "PRESENCE(presence = '1'B)" |
| 1223 | }; |
| 1224 | |
| 1225 | /* Optional SI2quater Indicator: L | H < SI2quater Indicator > */ |
| 1226 | type record SI2quaterIndicatorOpt { |
| 1227 | BIT1 presence, // L/H |
| 1228 | BIT1 ind optional |
| 1229 | } with { |
| 1230 | variant (presence) "CSN.1 L/H" |
| 1231 | variant (ind) "PRESENCE(presence = '1'B)" |
| 1232 | }; |
| 1233 | |
| 1234 | /* Optional SI21 Indicator: L | H < SI21 Position > */ |
| 1235 | type record SI21IndicatorOpt { |
| 1236 | BIT1 presence, // L/H |
| 1237 | BIT1 pos optional |
| 1238 | } with { |
| 1239 | variant (presence) "CSN.1 L/H" |
| 1240 | variant (pos) "PRESENCE(presence = '1'B)" |
| 1241 | }; |
| 1242 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 1243 | |
| 1244 | external function enc_SI2quaterRestOctets(in SI2quaterRestOctets ro) return octetstring |
| 1245 | with { extension "prototype(convert) encode(RAW)" }; |
| 1246 | external function dec_SI2quaterRestOctets(in octetstring stream) return SI2quaterRestOctets |
| 1247 | with { extension "prototype(convert) decode(RAW)" }; |
| 1248 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1249 | external function enc_SI3RestOctets(in SI3RestOctets ro) return octetstring |
| 1250 | with { extension "prototype(convert) encode(RAW)" }; |
| 1251 | external function dec_SI3RestOctets(in octetstring stream) return SI3RestOctets |
| 1252 | with { extension "prototype(convert) decode(RAW)" }; |
| 1253 | |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 1254 | external function enc_SI4RestOctets(in SI4RestOctets ro) return octetstring |
| 1255 | with { extension "prototype(convert) encode(RAW)" }; |
| 1256 | external function dec_SI4RestOctets(in octetstring stream) return SI4RestOctets |
| 1257 | with { extension "prototype(convert) decode(RAW)" }; |
| 1258 | |
Vadim Yanitskiy | dbd2f61 | 2022-03-10 17:03:26 +0300 | [diff] [blame] | 1259 | external function enc_SI6RestOctets(in SI4RestOctets ro) return octetstring |
| 1260 | with { extension "prototype(convert) encode(RAW)" }; |
| 1261 | external function dec_SI6RestOctets(in octetstring stream) return SI6RestOctets |
| 1262 | with { extension "prototype(convert) decode(RAW)" }; |
| 1263 | |
Pau Espin Pedrol | 28652d8 | 2021-02-09 20:20:17 +0100 | [diff] [blame] | 1264 | external function enc_SI13RestOctets(in SI13RestOctets ro) return octetstring |
| 1265 | with { extension "prototype(convert) encode(RAW)" }; |
| 1266 | external function dec_SI13RestOctets(in octetstring stream) return SI13RestOctets |
| 1267 | with { extension "prototype(convert) decode(RAW)" }; |
| 1268 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1269 | |
Vadim Yanitskiy | 12cf3d9 | 2020-05-05 00:19:50 +0700 | [diff] [blame] | 1270 | /* Basic templates to be extended in place */ |
| 1271 | template (value) SI3RestOctets ts_SI3RestOctets := { |
| 1272 | sel_params := { |
| 1273 | presence := CSN1_L, |
| 1274 | params := omit |
| 1275 | }, |
| 1276 | pwr_offset := { |
| 1277 | presence := CSN1_L, |
| 1278 | offset := omit |
| 1279 | }, |
| 1280 | si_2ter_ind := CSN1_L, |
| 1281 | early_cm_ind := CSN1_L, |
| 1282 | sched_where := { |
| 1283 | presence := CSN1_L, |
| 1284 | where := omit |
| 1285 | }, |
| 1286 | gprs_ind := { |
| 1287 | presence := CSN1_L, |
| 1288 | ind := omit |
| 1289 | }, |
| 1290 | umts_early_cm_ind := CSN1_L, |
| 1291 | si2_quater_ind := { |
| 1292 | presence := CSN1_L, |
| 1293 | ind := omit |
| 1294 | }, |
| 1295 | iu_mode_ind := omit, |
| 1296 | si21_ind := { |
| 1297 | presence := CSN1_L, |
| 1298 | pos := omit |
| 1299 | } |
| 1300 | } |
| 1301 | |
| 1302 | template (value) SI4RestOctets ts_SI4RestOctets := { |
| 1303 | sel_params := { |
| 1304 | presence := CSN1_L, |
| 1305 | params := omit |
| 1306 | }, |
| 1307 | pwr_offset := { |
| 1308 | presence := CSN1_L, |
| 1309 | offset := omit |
| 1310 | }, |
| 1311 | gprs_ind := { |
| 1312 | presence := CSN1_L, |
| 1313 | ind := omit |
| 1314 | }, |
| 1315 | s_presence := CSN1_L, |
| 1316 | s := omit |
| 1317 | } |
| 1318 | |
| 1319 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1320 | } with { encode "RAW"; variant "FIELDORDER(msb)" } |