[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / codec_utils / RRC / BandCombination.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 "BandCombination.h"
9
10 #include "CA-ParametersEUTRA.h"
11 #include "CA-ParametersNR.h"
12 #include "MRDC-Parameters.h"
13 #include "BandParameters.h"
14 /*
15  * This type is implemented using NativeEnumerated,
16  * so here we adjust the DEF accordingly.
17  */
18 static int
19 memb_bandList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
20                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
21         size_t size;
22         
23         if(!sptr) {
24                 ASN__CTFAIL(app_key, td, sptr,
25                         "%s: value not given (%s:%d)",
26                         td->name, __FILE__, __LINE__);
27                 return -1;
28         }
29         
30         /* Determine the number of elements */
31         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
32         
33         if((size >= 1 && size <= 32)) {
34                 /* Perform validation of the inner elements */
35                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
36         } else {
37                 ASN__CTFAIL(app_key, td, sptr,
38                         "%s: constraint failed (%s:%d)",
39                         td->name, __FILE__, __LINE__);
40                 return -1;
41         }
42 }
43
44 static int
45 memb_supportedBandwidthCombinationSet_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
46                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
47         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
48         size_t size;
49         
50         if(!sptr) {
51                 ASN__CTFAIL(app_key, td, sptr,
52                         "%s: value not given (%s:%d)",
53                         td->name, __FILE__, __LINE__);
54                 return -1;
55         }
56         
57         if(st->size > 0) {
58                 /* Size in bits */
59                 size = 8 * st->size - (st->bits_unused & 0x07);
60         } else {
61                 size = 0;
62         }
63         
64         if((size >= 1 && size <= 32)) {
65                 /* Constraint check succeeded */
66                 return 0;
67         } else {
68                 ASN__CTFAIL(app_key, td, sptr,
69                         "%s: constraint failed (%s:%d)",
70                         td->name, __FILE__, __LINE__);
71                 return -1;
72         }
73 }
74
75 static asn_oer_constraints_t asn_OER_type_bandList_constr_2 CC_NOTUSED = {
76         { 0, 0 },
77         -1      /* (SIZE(1..32)) */};
78 static asn_per_constraints_t asn_PER_type_bandList_constr_2 CC_NOTUSED = {
79         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
80         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
81         0, 0    /* No PER value map */
82 };
83 static asn_oer_constraints_t asn_OER_type_powerClass_v1530_constr_9 CC_NOTUSED = {
84         { 0, 0 },
85         -1};
86 static asn_per_constraints_t asn_PER_type_powerClass_v1530_constr_9 CC_NOTUSED = {
87         { APC_CONSTRAINED,       0,  0,  0,  0 }        /* (0..0) */,
88         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
89         0, 0    /* No PER value map */
90 };
91 static asn_oer_constraints_t asn_OER_memb_bandList_constr_2 CC_NOTUSED = {
92         { 0, 0 },
93         -1      /* (SIZE(1..32)) */};
94 static asn_per_constraints_t asn_PER_memb_bandList_constr_2 CC_NOTUSED = {
95         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
96         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
97         0, 0    /* No PER value map */
98 };
99 static asn_oer_constraints_t asn_OER_memb_supportedBandwidthCombinationSet_constr_8 CC_NOTUSED = {
100         { 0, 0 },
101         -1      /* (SIZE(1..32)) */};
102 static asn_per_constraints_t asn_PER_memb_supportedBandwidthCombinationSet_constr_8 CC_NOTUSED = {
103         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
104         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
105         0, 0    /* No PER value map */
106 };
107 static asn_TYPE_member_t asn_MBR_bandList_2[] = {
108         { ATF_POINTER, 0, 0,
109                 -1 /* Ambiguous tag (CHOICE?) */,
110                 0,
111                 &asn_DEF_BandParameters,
112                 0,
113                 { 0, 0, 0 },
114                 0, 0, /* No default value */
115                 ""
116                 },
117 };
118 static const ber_tlv_tag_t asn_DEF_bandList_tags_2[] = {
119         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
120         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
121 };
122 static asn_SET_OF_specifics_t asn_SPC_bandList_specs_2 = {
123         sizeof(struct BandCombination__bandList),
124         offsetof(struct BandCombination__bandList, _asn_ctx),
125         2,      /* XER encoding is XMLValueList */
126 };
127 static /* Use -fall-defs-global to expose */
128 asn_TYPE_descriptor_t asn_DEF_bandList_2 = {
129         "bandList",
130         "bandList",
131         &asn_OP_SEQUENCE_OF,
132         asn_DEF_bandList_tags_2,
133         sizeof(asn_DEF_bandList_tags_2)
134                 /sizeof(asn_DEF_bandList_tags_2[0]) - 1, /* 1 */
135         asn_DEF_bandList_tags_2,        /* Same as above */
136         sizeof(asn_DEF_bandList_tags_2)
137                 /sizeof(asn_DEF_bandList_tags_2[0]), /* 2 */
138         { &asn_OER_type_bandList_constr_2, &asn_PER_type_bandList_constr_2, SEQUENCE_OF_constraint },
139         asn_MBR_bandList_2,
140         1,      /* Single element */
141         &asn_SPC_bandList_specs_2       /* Additional specs */
142 };
143
144 static const asn_INTEGER_enum_map_t asn_MAP_powerClass_v1530_value2enum_9[] = {
145         { 0,    3,      "pc2" }
146 };
147 static const unsigned int asn_MAP_powerClass_v1530_enum2value_9[] = {
148         0       /* pc2(0) */
149 };
150 static const asn_INTEGER_specifics_t asn_SPC_powerClass_v1530_specs_9 = {
151         asn_MAP_powerClass_v1530_value2enum_9,  /* "tag" => N; sorted by tag */
152         asn_MAP_powerClass_v1530_enum2value_9,  /* N => "tag"; sorted by N */
153         1,      /* Number of elements in the maps */
154         0,      /* Enumeration is not extensible */
155         1,      /* Strict enumeration */
156         0,      /* Native long size */
157         0
158 };
159 static const ber_tlv_tag_t asn_DEF_powerClass_v1530_tags_9[] = {
160         (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
161         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
162 };
163 static /* Use -fall-defs-global to expose */
164 asn_TYPE_descriptor_t asn_DEF_powerClass_v1530_9 = {
165         "powerClass-v1530",
166         "powerClass-v1530",
167         &asn_OP_NativeEnumerated,
168         asn_DEF_powerClass_v1530_tags_9,
169         sizeof(asn_DEF_powerClass_v1530_tags_9)
170                 /sizeof(asn_DEF_powerClass_v1530_tags_9[0]) - 1, /* 1 */
171         asn_DEF_powerClass_v1530_tags_9,        /* Same as above */
172         sizeof(asn_DEF_powerClass_v1530_tags_9)
173                 /sizeof(asn_DEF_powerClass_v1530_tags_9[0]), /* 2 */
174         { &asn_OER_type_powerClass_v1530_constr_9, &asn_PER_type_powerClass_v1530_constr_9, NativeEnumerated_constraint },
175         0, 0,   /* Defined elsewhere */
176         &asn_SPC_powerClass_v1530_specs_9       /* Additional specs */
177 };
178
179 asn_TYPE_member_t asn_MBR_BandCombination_1[] = {
180         { ATF_NOFLAGS, 0, offsetof(struct BandCombination, bandList),
181                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
182                 0,
183                 &asn_DEF_bandList_2,
184                 0,
185                 { &asn_OER_memb_bandList_constr_2, &asn_PER_memb_bandList_constr_2,  memb_bandList_constraint_1 },
186                 0, 0, /* No default value */
187                 "bandList"
188                 },
189         { ATF_NOFLAGS, 0, offsetof(struct BandCombination, featureSetCombination),
190                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
191                 -1,     /* IMPLICIT tag at current level */
192                 &asn_DEF_FeatureSetCombinationId,
193                 0,
194                 { 0, 0, 0 },
195                 0, 0, /* No default value */
196                 "featureSetCombination"
197                 },
198         { ATF_POINTER, 5, offsetof(struct BandCombination, ca_ParametersEUTRA),
199                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
200                 -1,     /* IMPLICIT tag at current level */
201                 &asn_DEF_CA_ParametersEUTRA,
202                 0,
203                 { 0, 0, 0 },
204                 0, 0, /* No default value */
205                 "ca-ParametersEUTRA"
206                 },
207         { ATF_POINTER, 4, offsetof(struct BandCombination, ca_ParametersNR),
208                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
209                 -1,     /* IMPLICIT tag at current level */
210                 &asn_DEF_CA_ParametersNR,
211                 0,
212                 { 0, 0, 0 },
213                 0, 0, /* No default value */
214                 "ca-ParametersNR"
215                 },
216         { ATF_POINTER, 3, offsetof(struct BandCombination, mrdc_Parameters),
217                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
218                 -1,     /* IMPLICIT tag at current level */
219                 &asn_DEF_MRDC_Parameters,
220                 0,
221                 { 0, 0, 0 },
222                 0, 0, /* No default value */
223                 "mrdc-Parameters"
224                 },
225         { ATF_POINTER, 2, offsetof(struct BandCombination, supportedBandwidthCombinationSet),
226                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
227                 -1,     /* IMPLICIT tag at current level */
228                 &asn_DEF_BIT_STRING,
229                 0,
230                 { &asn_OER_memb_supportedBandwidthCombinationSet_constr_8, &asn_PER_memb_supportedBandwidthCombinationSet_constr_8,  memb_supportedBandwidthCombinationSet_constraint_1 },
231                 0, 0, /* No default value */
232                 "supportedBandwidthCombinationSet"
233                 },
234         { ATF_POINTER, 1, offsetof(struct BandCombination, powerClass_v1530),
235                 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
236                 -1,     /* IMPLICIT tag at current level */
237                 &asn_DEF_powerClass_v1530_9,
238                 0,
239                 { 0, 0, 0 },
240                 0, 0, /* No default value */
241                 "powerClass-v1530"
242                 },
243 };
244 static const int asn_MAP_BandCombination_oms_1[] = { 2, 3, 4, 5, 6 };
245 static const ber_tlv_tag_t asn_DEF_BandCombination_tags_1[] = {
246         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
247 };
248 static const asn_TYPE_tag2member_t asn_MAP_BandCombination_tag2el_1[] = {
249     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bandList */
250     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* featureSetCombination */
251     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ca-ParametersEUTRA */
252     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ca-ParametersNR */
253     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* mrdc-Parameters */
254     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* supportedBandwidthCombinationSet */
255     { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* powerClass-v1530 */
256 };
257 asn_SEQUENCE_specifics_t asn_SPC_BandCombination_specs_1 = {
258         sizeof(struct BandCombination),
259         offsetof(struct BandCombination, _asn_ctx),
260         asn_MAP_BandCombination_tag2el_1,
261         7,      /* Count of tags in the map */
262         asn_MAP_BandCombination_oms_1,  /* Optional members */
263         5, 0,   /* Root/Additions */
264         -1,     /* First extension addition */
265 };
266 asn_TYPE_descriptor_t asn_DEF_BandCombination = {
267         "BandCombination",
268         "BandCombination",
269         &asn_OP_SEQUENCE,
270         asn_DEF_BandCombination_tags_1,
271         sizeof(asn_DEF_BandCombination_tags_1)
272                 /sizeof(asn_DEF_BandCombination_tags_1[0]), /* 1 */
273         asn_DEF_BandCombination_tags_1, /* Same as above */
274         sizeof(asn_DEF_BandCombination_tags_1)
275                 /sizeof(asn_DEF_BandCombination_tags_1[0]), /* 1 */
276         { 0, 0, SEQUENCE_constraint },
277         asn_MBR_BandCombination_1,
278         7,      /* Elements count */
279         &asn_SPC_BandCombination_specs_1        /* Additional specs */
280 };
281