[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / codec_utils / RRC / ServingCellConfigCommonSIB.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "../ASN1_Input/rrc_15_3_asn.asn1"
5  *      `asn1c -D ../RRC_output_14Nov/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
6  */
7
8 #include "ServingCellConfigCommonSIB.h"
9
10 #include "UplinkConfigCommonSIB.h"
11 #include "TDD-UL-DL-ConfigCommon.h"
12 /*
13  * This type is implemented using NativeEnumerated,
14  * so here we adjust the DEF accordingly.
15  */
16 static int
17 memb_inOneGroup_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
18                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
19         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
20         size_t size;
21         
22         if(!sptr) {
23                 ASN__CTFAIL(app_key, td, sptr,
24                         "%s: value not given (%s:%d)",
25                         td->name, __FILE__, __LINE__);
26                 return -1;
27         }
28         
29         if(st->size > 0) {
30                 /* Size in bits */
31                 size = 8 * st->size - (st->bits_unused & 0x07);
32         } else {
33                 size = 0;
34         }
35         
36         if((size == 8)) {
37                 /* Constraint check succeeded */
38                 return 0;
39         } else {
40                 ASN__CTFAIL(app_key, td, sptr,
41                         "%s: constraint failed (%s:%d)",
42                         td->name, __FILE__, __LINE__);
43                 return -1;
44         }
45 }
46
47 static int
48 memb_groupPresence_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
49                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
50         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
51         size_t size;
52         
53         if(!sptr) {
54                 ASN__CTFAIL(app_key, td, sptr,
55                         "%s: value not given (%s:%d)",
56                         td->name, __FILE__, __LINE__);
57                 return -1;
58         }
59         
60         if(st->size > 0) {
61                 /* Size in bits */
62                 size = 8 * st->size - (st->bits_unused & 0x07);
63         } else {
64                 size = 0;
65         }
66         
67         if((size == 8)) {
68                 /* Constraint check succeeded */
69                 return 0;
70         } else {
71                 ASN__CTFAIL(app_key, td, sptr,
72                         "%s: constraint failed (%s:%d)",
73                         td->name, __FILE__, __LINE__);
74                 return -1;
75         }
76 }
77
78 /*
79  * This type is implemented using NativeEnumerated,
80  * so here we adjust the DEF accordingly.
81  */
82 static int
83 memb_ss_PBCH_BlockPower_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
84                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
85         long value;
86         
87         if(!sptr) {
88                 ASN__CTFAIL(app_key, td, sptr,
89                         "%s: value not given (%s:%d)",
90                         td->name, __FILE__, __LINE__);
91                 return -1;
92         }
93         
94         value = *(const long *)sptr;
95         
96         if((value >= -60 && value <= 50)) {
97                 /* Constraint check succeeded */
98                 return 0;
99         } else {
100                 ASN__CTFAIL(app_key, td, sptr,
101                         "%s: constraint failed (%s:%d)",
102                         td->name, __FILE__, __LINE__);
103                 return -1;
104         }
105 }
106
107 static asn_oer_constraints_t asn_OER_type_n_TimingAdvanceOffset_constr_5 CC_NOTUSED = {
108         { 0, 0 },
109         -1};
110 static asn_per_constraints_t asn_PER_type_n_TimingAdvanceOffset_constr_5 CC_NOTUSED = {
111         { APC_CONSTRAINED,       2,  2,  0,  2 }        /* (0..2) */,
112         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
113         0, 0    /* No PER value map */
114 };
115 static asn_oer_constraints_t asn_OER_memb_inOneGroup_constr_10 CC_NOTUSED = {
116         { 0, 0 },
117         8       /* (SIZE(8..8)) */};
118 static asn_per_constraints_t asn_PER_memb_inOneGroup_constr_10 CC_NOTUSED = {
119         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
120         { APC_CONSTRAINED,       0,  0,  8,  8 }        /* (SIZE(8..8)) */,
121         0, 0    /* No PER value map */
122 };
123 static asn_oer_constraints_t asn_OER_memb_groupPresence_constr_11 CC_NOTUSED = {
124         { 0, 0 },
125         8       /* (SIZE(8..8)) */};
126 static asn_per_constraints_t asn_PER_memb_groupPresence_constr_11 CC_NOTUSED = {
127         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
128         { APC_CONSTRAINED,       0,  0,  8,  8 }        /* (SIZE(8..8)) */,
129         0, 0    /* No PER value map */
130 };
131 static asn_oer_constraints_t asn_OER_type_ssb_PeriodicityServingCell_constr_12 CC_NOTUSED = {
132         { 0, 0 },
133         -1};
134 static asn_per_constraints_t asn_PER_type_ssb_PeriodicityServingCell_constr_12 CC_NOTUSED = {
135         { APC_CONSTRAINED,       3,  3,  0,  5 }        /* (0..5) */,
136         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
137         0, 0    /* No PER value map */
138 };
139 static asn_oer_constraints_t asn_OER_memb_ss_PBCH_BlockPower_constr_20 CC_NOTUSED = {
140         { 1, 0 }        /* (-60..50) */,
141         -1};
142 static asn_per_constraints_t asn_PER_memb_ss_PBCH_BlockPower_constr_20 CC_NOTUSED = {
143         { APC_CONSTRAINED,       7,  7, -60,  50 }      /* (-60..50) */,
144         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
145         0, 0    /* No PER value map */
146 };
147 static const asn_INTEGER_enum_map_t asn_MAP_n_TimingAdvanceOffset_value2enum_5[] = {
148         { 0,    2,      "n0" },
149         { 1,    6,      "n25560" },
150         { 2,    6,      "n39936" }
151 };
152 static const unsigned int asn_MAP_n_TimingAdvanceOffset_enum2value_5[] = {
153         0,      /* n0(0) */
154         1,      /* n25560(1) */
155         2       /* n39936(2) */
156 };
157 static const asn_INTEGER_specifics_t asn_SPC_n_TimingAdvanceOffset_specs_5 = {
158         asn_MAP_n_TimingAdvanceOffset_value2enum_5,     /* "tag" => N; sorted by tag */
159         asn_MAP_n_TimingAdvanceOffset_enum2value_5,     /* N => "tag"; sorted by N */
160         3,      /* Number of elements in the maps */
161         0,      /* Enumeration is not extensible */
162         1,      /* Strict enumeration */
163         0,      /* Native long size */
164         0
165 };
166 static const ber_tlv_tag_t asn_DEF_n_TimingAdvanceOffset_tags_5[] = {
167         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
168         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
169 };
170 static /* Use -fall-defs-global to expose */
171 asn_TYPE_descriptor_t asn_DEF_n_TimingAdvanceOffset_5 = {
172         "n-TimingAdvanceOffset",
173         "n-TimingAdvanceOffset",
174         &asn_OP_NativeEnumerated,
175         asn_DEF_n_TimingAdvanceOffset_tags_5,
176         sizeof(asn_DEF_n_TimingAdvanceOffset_tags_5)
177                 /sizeof(asn_DEF_n_TimingAdvanceOffset_tags_5[0]) - 1, /* 1 */
178         asn_DEF_n_TimingAdvanceOffset_tags_5,   /* Same as above */
179         sizeof(asn_DEF_n_TimingAdvanceOffset_tags_5)
180                 /sizeof(asn_DEF_n_TimingAdvanceOffset_tags_5[0]), /* 2 */
181         { &asn_OER_type_n_TimingAdvanceOffset_constr_5, &asn_PER_type_n_TimingAdvanceOffset_constr_5, NativeEnumerated_constraint },
182         0, 0,   /* Defined elsewhere */
183         &asn_SPC_n_TimingAdvanceOffset_specs_5  /* Additional specs */
184 };
185
186 static asn_TYPE_member_t asn_MBR_ssb_PositionsInBurst_9[] = {
187         { ATF_NOFLAGS, 0, offsetof(struct ServingCellConfigCommonSIB__ssb_PositionsInBurst, inOneGroup),
188                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
189                 -1,     /* IMPLICIT tag at current level */
190                 &asn_DEF_BIT_STRING,
191                 0,
192                 { &asn_OER_memb_inOneGroup_constr_10, &asn_PER_memb_inOneGroup_constr_10,  memb_inOneGroup_constraint_9 },
193                 0, 0, /* No default value */
194                 "inOneGroup"
195                 },
196         { ATF_POINTER, 1, offsetof(struct ServingCellConfigCommonSIB__ssb_PositionsInBurst, groupPresence),
197                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
198                 -1,     /* IMPLICIT tag at current level */
199                 &asn_DEF_BIT_STRING,
200                 0,
201                 { &asn_OER_memb_groupPresence_constr_11, &asn_PER_memb_groupPresence_constr_11,  memb_groupPresence_constraint_9 },
202                 0, 0, /* No default value */
203                 "groupPresence"
204                 },
205 };
206 static const int asn_MAP_ssb_PositionsInBurst_oms_9[] = { 1 };
207 static const ber_tlv_tag_t asn_DEF_ssb_PositionsInBurst_tags_9[] = {
208         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
209         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
210 };
211 static const asn_TYPE_tag2member_t asn_MAP_ssb_PositionsInBurst_tag2el_9[] = {
212     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* inOneGroup */
213     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* groupPresence */
214 };
215 static asn_SEQUENCE_specifics_t asn_SPC_ssb_PositionsInBurst_specs_9 = {
216         sizeof(struct ServingCellConfigCommonSIB__ssb_PositionsInBurst),
217         offsetof(struct ServingCellConfigCommonSIB__ssb_PositionsInBurst, _asn_ctx),
218         asn_MAP_ssb_PositionsInBurst_tag2el_9,
219         2,      /* Count of tags in the map */
220         asn_MAP_ssb_PositionsInBurst_oms_9,     /* Optional members */
221         1, 0,   /* Root/Additions */
222         -1,     /* First extension addition */
223 };
224 static /* Use -fall-defs-global to expose */
225 asn_TYPE_descriptor_t asn_DEF_ssb_PositionsInBurst_9 = {
226         "ssb-PositionsInBurst",
227         "ssb-PositionsInBurst",
228         &asn_OP_SEQUENCE,
229         asn_DEF_ssb_PositionsInBurst_tags_9,
230         sizeof(asn_DEF_ssb_PositionsInBurst_tags_9)
231                 /sizeof(asn_DEF_ssb_PositionsInBurst_tags_9[0]) - 1, /* 1 */
232         asn_DEF_ssb_PositionsInBurst_tags_9,    /* Same as above */
233         sizeof(asn_DEF_ssb_PositionsInBurst_tags_9)
234                 /sizeof(asn_DEF_ssb_PositionsInBurst_tags_9[0]), /* 2 */
235         { 0, 0, SEQUENCE_constraint },
236         asn_MBR_ssb_PositionsInBurst_9,
237         2,      /* Elements count */
238         &asn_SPC_ssb_PositionsInBurst_specs_9   /* Additional specs */
239 };
240
241 static const asn_INTEGER_enum_map_t asn_MAP_ssb_PeriodicityServingCell_value2enum_12[] = {
242         { 0,    3,      "ms5" },
243         { 1,    4,      "ms10" },
244         { 2,    4,      "ms20" },
245         { 3,    4,      "ms40" },
246         { 4,    4,      "ms80" },
247         { 5,    5,      "ms160" }
248 };
249 static const unsigned int asn_MAP_ssb_PeriodicityServingCell_enum2value_12[] = {
250         1,      /* ms10(1) */
251         5,      /* ms160(5) */
252         2,      /* ms20(2) */
253         3,      /* ms40(3) */
254         0,      /* ms5(0) */
255         4       /* ms80(4) */
256 };
257 static const asn_INTEGER_specifics_t asn_SPC_ssb_PeriodicityServingCell_specs_12 = {
258         asn_MAP_ssb_PeriodicityServingCell_value2enum_12,       /* "tag" => N; sorted by tag */
259         asn_MAP_ssb_PeriodicityServingCell_enum2value_12,       /* N => "tag"; sorted by N */
260         6,      /* Number of elements in the maps */
261         0,      /* Enumeration is not extensible */
262         1,      /* Strict enumeration */
263         0,      /* Native long size */
264         0
265 };
266 static const ber_tlv_tag_t asn_DEF_ssb_PeriodicityServingCell_tags_12[] = {
267         (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
268         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
269 };
270 static /* Use -fall-defs-global to expose */
271 asn_TYPE_descriptor_t asn_DEF_ssb_PeriodicityServingCell_12 = {
272         "ssb-PeriodicityServingCell",
273         "ssb-PeriodicityServingCell",
274         &asn_OP_NativeEnumerated,
275         asn_DEF_ssb_PeriodicityServingCell_tags_12,
276         sizeof(asn_DEF_ssb_PeriodicityServingCell_tags_12)
277                 /sizeof(asn_DEF_ssb_PeriodicityServingCell_tags_12[0]) - 1, /* 1 */
278         asn_DEF_ssb_PeriodicityServingCell_tags_12,     /* Same as above */
279         sizeof(asn_DEF_ssb_PeriodicityServingCell_tags_12)
280                 /sizeof(asn_DEF_ssb_PeriodicityServingCell_tags_12[0]), /* 2 */
281         { &asn_OER_type_ssb_PeriodicityServingCell_constr_12, &asn_PER_type_ssb_PeriodicityServingCell_constr_12, NativeEnumerated_constraint },
282         0, 0,   /* Defined elsewhere */
283         &asn_SPC_ssb_PeriodicityServingCell_specs_12    /* Additional specs */
284 };
285
286 asn_TYPE_member_t asn_MBR_ServingCellConfigCommonSIB_1[] = {
287         { ATF_NOFLAGS, 0, offsetof(struct ServingCellConfigCommonSIB, downlinkConfigCommon),
288                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
289                 -1,     /* IMPLICIT tag at current level */
290                 &asn_DEF_DownlinkConfigCommonSIB,
291                 0,
292                 { 0, 0, 0 },
293                 0, 0, /* No default value */
294                 "downlinkConfigCommon"
295                 },
296         { ATF_POINTER, 3, offsetof(struct ServingCellConfigCommonSIB, uplinkConfigCommon),
297                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
298                 -1,     /* IMPLICIT tag at current level */
299                 &asn_DEF_UplinkConfigCommonSIB,
300                 0,
301                 { 0, 0, 0 },
302                 0, 0, /* No default value */
303                 "uplinkConfigCommon"
304                 },
305         { ATF_POINTER, 2, offsetof(struct ServingCellConfigCommonSIB, supplementaryUplink),
306                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
307                 -1,     /* IMPLICIT tag at current level */
308                 &asn_DEF_UplinkConfigCommonSIB,
309                 0,
310                 { 0, 0, 0 },
311                 0, 0, /* No default value */
312                 "supplementaryUplink"
313                 },
314         { ATF_POINTER, 1, offsetof(struct ServingCellConfigCommonSIB, n_TimingAdvanceOffset),
315                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
316                 -1,     /* IMPLICIT tag at current level */
317                 &asn_DEF_n_TimingAdvanceOffset_5,
318                 0,
319                 { 0, 0, 0 },
320                 0, 0, /* No default value */
321                 "n-TimingAdvanceOffset"
322                 },
323         { ATF_NOFLAGS, 0, offsetof(struct ServingCellConfigCommonSIB, ssb_PositionsInBurst),
324                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
325                 0,
326                 &asn_DEF_ssb_PositionsInBurst_9,
327                 0,
328                 { 0, 0, 0 },
329                 0, 0, /* No default value */
330                 "ssb-PositionsInBurst"
331                 },
332         { ATF_NOFLAGS, 0, offsetof(struct ServingCellConfigCommonSIB, ssb_PeriodicityServingCell),
333                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
334                 -1,     /* IMPLICIT tag at current level */
335                 &asn_DEF_ssb_PeriodicityServingCell_12,
336                 0,
337                 { 0, 0, 0 },
338                 0, 0, /* No default value */
339                 "ssb-PeriodicityServingCell"
340                 },
341         { ATF_POINTER, 1, offsetof(struct ServingCellConfigCommonSIB, tdd_UL_DL_ConfigurationCommon),
342                 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
343                 -1,     /* IMPLICIT tag at current level */
344                 &asn_DEF_TDD_UL_DL_ConfigCommon,
345                 0,
346                 { 0, 0, 0 },
347                 0, 0, /* No default value */
348                 "tdd-UL-DL-ConfigurationCommon"
349                 },
350         { ATF_NOFLAGS, 0, offsetof(struct ServingCellConfigCommonSIB, ss_PBCH_BlockPower),
351                 (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
352                 -1,     /* IMPLICIT tag at current level */
353                 &asn_DEF_NativeInteger,
354                 0,
355                 { &asn_OER_memb_ss_PBCH_BlockPower_constr_20, &asn_PER_memb_ss_PBCH_BlockPower_constr_20,  memb_ss_PBCH_BlockPower_constraint_1 },
356                 0, 0, /* No default value */
357                 "ss-PBCH-BlockPower"
358                 },
359 };
360 static const int asn_MAP_ServingCellConfigCommonSIB_oms_1[] = { 1, 2, 3, 6 };
361 static const ber_tlv_tag_t asn_DEF_ServingCellConfigCommonSIB_tags_1[] = {
362         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
363 };
364 static const asn_TYPE_tag2member_t asn_MAP_ServingCellConfigCommonSIB_tag2el_1[] = {
365     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* downlinkConfigCommon */
366     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* uplinkConfigCommon */
367     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* supplementaryUplink */
368     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* n-TimingAdvanceOffset */
369     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* ssb-PositionsInBurst */
370     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* ssb-PeriodicityServingCell */
371     { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* tdd-UL-DL-ConfigurationCommon */
372     { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 } /* ss-PBCH-BlockPower */
373 };
374 asn_SEQUENCE_specifics_t asn_SPC_ServingCellConfigCommonSIB_specs_1 = {
375         sizeof(struct ServingCellConfigCommonSIB),
376         offsetof(struct ServingCellConfigCommonSIB, _asn_ctx),
377         asn_MAP_ServingCellConfigCommonSIB_tag2el_1,
378         8,      /* Count of tags in the map */
379         asn_MAP_ServingCellConfigCommonSIB_oms_1,       /* Optional members */
380         4, 0,   /* Root/Additions */
381         8,      /* First extension addition */
382 };
383 asn_TYPE_descriptor_t asn_DEF_ServingCellConfigCommonSIB = {
384         "ServingCellConfigCommonSIB",
385         "ServingCellConfigCommonSIB",
386         &asn_OP_SEQUENCE,
387         asn_DEF_ServingCellConfigCommonSIB_tags_1,
388         sizeof(asn_DEF_ServingCellConfigCommonSIB_tags_1)
389                 /sizeof(asn_DEF_ServingCellConfigCommonSIB_tags_1[0]), /* 1 */
390         asn_DEF_ServingCellConfigCommonSIB_tags_1,      /* Same as above */
391         sizeof(asn_DEF_ServingCellConfigCommonSIB_tags_1)
392                 /sizeof(asn_DEF_ServingCellConfigCommonSIB_tags_1[0]), /* 1 */
393         { 0, 0, SEQUENCE_constraint },
394         asn_MBR_ServingCellConfigCommonSIB_1,
395         8,      /* Elements count */
396         &asn_SPC_ServingCellConfigCommonSIB_specs_1     /* Additional specs */
397 };
398