[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-423] Modified RRC asn structures
[o-du/l2.git] / src / codec_utils / RRC / PTRS-DownlinkConfig.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "../../../rrc_15.3_asn.asn1"
5  *      `asn1c -D ./25_02_2022_RRC/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "PTRS-DownlinkConfig.h"
9
10 static int
11 memb_NativeInteger_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         long value;
14         
15         if(!sptr) {
16                 ASN__CTFAIL(app_key, td, sptr,
17                         "%s: value not given (%s:%d)",
18                         td->name, __FILE__, __LINE__);
19                 return -1;
20         }
21         
22         value = *(const long *)sptr;
23         
24         if((value >= 1 && value <= 276)) {
25                 /* Constraint check succeeded */
26                 return 0;
27         } else {
28                 ASN__CTFAIL(app_key, td, sptr,
29                         "%s: constraint failed (%s:%d)",
30                         td->name, __FILE__, __LINE__);
31                 return -1;
32         }
33 }
34
35 static int
36 memb_NativeInteger_constraint_4(const asn_TYPE_descriptor_t *td, const void *sptr,
37                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
38         long value;
39         
40         if(!sptr) {
41                 ASN__CTFAIL(app_key, td, sptr,
42                         "%s: value not given (%s:%d)",
43                         td->name, __FILE__, __LINE__);
44                 return -1;
45         }
46         
47         value = *(const long *)sptr;
48         
49         if((value >= 0 && value <= 29)) {
50                 /* Constraint check succeeded */
51                 return 0;
52         } else {
53                 ASN__CTFAIL(app_key, td, sptr,
54                         "%s: constraint failed (%s:%d)",
55                         td->name, __FILE__, __LINE__);
56                 return -1;
57         }
58 }
59
60 /*
61  * This type is implemented using NativeEnumerated,
62  * so here we adjust the DEF accordingly.
63  */
64 static int
65 memb_frequencyDensity_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
66                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
67         size_t size;
68         
69         if(!sptr) {
70                 ASN__CTFAIL(app_key, td, sptr,
71                         "%s: value not given (%s:%d)",
72                         td->name, __FILE__, __LINE__);
73                 return -1;
74         }
75         
76         /* Determine the number of elements */
77         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
78         
79         if((size == 2)) {
80                 /* Perform validation of the inner elements */
81                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
82         } else {
83                 ASN__CTFAIL(app_key, td, sptr,
84                         "%s: constraint failed (%s:%d)",
85                         td->name, __FILE__, __LINE__);
86                 return -1;
87         }
88 }
89
90 static int
91 memb_timeDensity_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
92                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
93         size_t size;
94         
95         if(!sptr) {
96                 ASN__CTFAIL(app_key, td, sptr,
97                         "%s: value not given (%s:%d)",
98                         td->name, __FILE__, __LINE__);
99                 return -1;
100         }
101         
102         /* Determine the number of elements */
103         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
104         
105         if((size == 3)) {
106                 /* Perform validation of the inner elements */
107                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
108         } else {
109                 ASN__CTFAIL(app_key, td, sptr,
110                         "%s: constraint failed (%s:%d)",
111                         td->name, __FILE__, __LINE__);
112                 return -1;
113         }
114 }
115
116 static int
117 memb_epre_Ratio_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
118                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
119         long value;
120         
121         if(!sptr) {
122                 ASN__CTFAIL(app_key, td, sptr,
123                         "%s: value not given (%s:%d)",
124                         td->name, __FILE__, __LINE__);
125                 return -1;
126         }
127         
128         value = *(const long *)sptr;
129         
130         if((value >= 0 && value <= 3)) {
131                 /* Constraint check succeeded */
132                 return 0;
133         } else {
134                 ASN__CTFAIL(app_key, td, sptr,
135                         "%s: constraint failed (%s:%d)",
136                         td->name, __FILE__, __LINE__);
137                 return -1;
138         }
139 }
140
141 static asn_oer_constraints_t asn_OER_memb_Member_constr_3 CC_NOTUSED = {
142         { 2, 1 }        /* (1..276) */,
143         -1};
144 static asn_per_constraints_t asn_PER_memb_Member_constr_3 CC_NOTUSED = {
145         { APC_CONSTRAINED,       9,  9,  1,  276 }      /* (1..276) */,
146         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
147         0, 0    /* No PER value map */
148 };
149 static asn_oer_constraints_t asn_OER_type_frequencyDensity_constr_2 CC_NOTUSED = {
150         { 0, 0 },
151         2       /* (SIZE(2..2)) */};
152 static asn_per_constraints_t asn_PER_type_frequencyDensity_constr_2 CC_NOTUSED = {
153         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
154         { APC_CONSTRAINED,       0,  0,  2,  2 }        /* (SIZE(2..2)) */,
155         0, 0    /* No PER value map */
156 };
157 static asn_oer_constraints_t asn_OER_memb_Member_constr_5 CC_NOTUSED = {
158         { 1, 1 }        /* (0..29) */,
159         -1};
160 static asn_per_constraints_t asn_PER_memb_Member_constr_5 CC_NOTUSED = {
161         { APC_CONSTRAINED,       5,  5,  0,  29 }       /* (0..29) */,
162         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
163         0, 0    /* No PER value map */
164 };
165 static asn_oer_constraints_t asn_OER_type_timeDensity_constr_4 CC_NOTUSED = {
166         { 0, 0 },
167         3       /* (SIZE(3..3)) */};
168 static asn_per_constraints_t asn_PER_type_timeDensity_constr_4 CC_NOTUSED = {
169         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
170         { APC_CONSTRAINED,       0,  0,  3,  3 }        /* (SIZE(3..3)) */,
171         0, 0    /* No PER value map */
172 };
173 static asn_oer_constraints_t asn_OER_type_resourceElementOffset_constr_7 CC_NOTUSED = {
174         { 0, 0 },
175         -1};
176 static asn_per_constraints_t asn_PER_type_resourceElementOffset_constr_7 CC_NOTUSED = {
177         { APC_CONSTRAINED,       2,  2,  0,  2 }        /* (0..2) */,
178         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
179         0, 0    /* No PER value map */
180 };
181 static asn_oer_constraints_t asn_OER_memb_frequencyDensity_constr_2 CC_NOTUSED = {
182         { 0, 0 },
183         2       /* (SIZE(2..2)) */};
184 static asn_per_constraints_t asn_PER_memb_frequencyDensity_constr_2 CC_NOTUSED = {
185         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
186         { APC_CONSTRAINED,       0,  0,  2,  2 }        /* (SIZE(2..2)) */,
187         0, 0    /* No PER value map */
188 };
189 static asn_oer_constraints_t asn_OER_memb_timeDensity_constr_4 CC_NOTUSED = {
190         { 0, 0 },
191         3       /* (SIZE(3..3)) */};
192 static asn_per_constraints_t asn_PER_memb_timeDensity_constr_4 CC_NOTUSED = {
193         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
194         { APC_CONSTRAINED,       0,  0,  3,  3 }        /* (SIZE(3..3)) */,
195         0, 0    /* No PER value map */
196 };
197 static asn_oer_constraints_t asn_OER_memb_epre_Ratio_constr_6 CC_NOTUSED = {
198         { 1, 1 }        /* (0..3) */,
199         -1};
200 static asn_per_constraints_t asn_PER_memb_epre_Ratio_constr_6 CC_NOTUSED = {
201         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (0..3) */,
202         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
203         0, 0    /* No PER value map */
204 };
205 static asn_TYPE_member_t asn_MBR_frequencyDensity_2[] = {
206         { ATF_POINTER, 0, 0,
207                 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
208                 0,
209                 &asn_DEF_NativeInteger,
210                 0,
211                 { &asn_OER_memb_Member_constr_3, &asn_PER_memb_Member_constr_3,  memb_NativeInteger_constraint_2 },
212                 0, 0, /* No default value */
213                 ""
214                 },
215 };
216 static const ber_tlv_tag_t asn_DEF_frequencyDensity_tags_2[] = {
217         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
218         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
219 };
220 static asn_SET_OF_specifics_t asn_SPC_frequencyDensity_specs_2 = {
221         sizeof(struct PTRS_DownlinkConfig__frequencyDensity),
222         offsetof(struct PTRS_DownlinkConfig__frequencyDensity, _asn_ctx),
223         0,      /* XER encoding is XMLDelimitedItemList */
224 };
225 static /* Use -fall-defs-global to expose */
226 asn_TYPE_descriptor_t asn_DEF_frequencyDensity_2 = {
227         "frequencyDensity",
228         "frequencyDensity",
229         &asn_OP_SEQUENCE_OF,
230         asn_DEF_frequencyDensity_tags_2,
231         sizeof(asn_DEF_frequencyDensity_tags_2)
232                 /sizeof(asn_DEF_frequencyDensity_tags_2[0]) - 1, /* 1 */
233         asn_DEF_frequencyDensity_tags_2,        /* Same as above */
234         sizeof(asn_DEF_frequencyDensity_tags_2)
235                 /sizeof(asn_DEF_frequencyDensity_tags_2[0]), /* 2 */
236         { &asn_OER_type_frequencyDensity_constr_2, &asn_PER_type_frequencyDensity_constr_2, SEQUENCE_OF_constraint },
237         asn_MBR_frequencyDensity_2,
238         1,      /* Single element */
239         &asn_SPC_frequencyDensity_specs_2       /* Additional specs */
240 };
241
242 static asn_TYPE_member_t asn_MBR_timeDensity_4[] = {
243         { ATF_POINTER, 0, 0,
244                 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
245                 0,
246                 &asn_DEF_NativeInteger,
247                 0,
248                 { &asn_OER_memb_Member_constr_5, &asn_PER_memb_Member_constr_5,  memb_NativeInteger_constraint_4 },
249                 0, 0, /* No default value */
250                 ""
251                 },
252 };
253 static const ber_tlv_tag_t asn_DEF_timeDensity_tags_4[] = {
254         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
255         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
256 };
257 static asn_SET_OF_specifics_t asn_SPC_timeDensity_specs_4 = {
258         sizeof(struct PTRS_DownlinkConfig__timeDensity),
259         offsetof(struct PTRS_DownlinkConfig__timeDensity, _asn_ctx),
260         0,      /* XER encoding is XMLDelimitedItemList */
261 };
262 static /* Use -fall-defs-global to expose */
263 asn_TYPE_descriptor_t asn_DEF_timeDensity_4 = {
264         "timeDensity",
265         "timeDensity",
266         &asn_OP_SEQUENCE_OF,
267         asn_DEF_timeDensity_tags_4,
268         sizeof(asn_DEF_timeDensity_tags_4)
269                 /sizeof(asn_DEF_timeDensity_tags_4[0]) - 1, /* 1 */
270         asn_DEF_timeDensity_tags_4,     /* Same as above */
271         sizeof(asn_DEF_timeDensity_tags_4)
272                 /sizeof(asn_DEF_timeDensity_tags_4[0]), /* 2 */
273         { &asn_OER_type_timeDensity_constr_4, &asn_PER_type_timeDensity_constr_4, SEQUENCE_OF_constraint },
274         asn_MBR_timeDensity_4,
275         1,      /* Single element */
276         &asn_SPC_timeDensity_specs_4    /* Additional specs */
277 };
278
279 static const asn_INTEGER_enum_map_t asn_MAP_resourceElementOffset_value2enum_7[] = {
280         { 0,    8,      "offset01" },
281         { 1,    8,      "offset10" },
282         { 2,    8,      "offset11" }
283 };
284 static const unsigned int asn_MAP_resourceElementOffset_enum2value_7[] = {
285         0,      /* offset01(0) */
286         1,      /* offset10(1) */
287         2       /* offset11(2) */
288 };
289 static const asn_INTEGER_specifics_t asn_SPC_resourceElementOffset_specs_7 = {
290         asn_MAP_resourceElementOffset_value2enum_7,     /* "tag" => N; sorted by tag */
291         asn_MAP_resourceElementOffset_enum2value_7,     /* N => "tag"; sorted by N */
292         3,      /* Number of elements in the maps */
293         0,      /* Enumeration is not extensible */
294         1,      /* Strict enumeration */
295         0,      /* Native long size */
296         0
297 };
298 static const ber_tlv_tag_t asn_DEF_resourceElementOffset_tags_7[] = {
299         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
300         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
301 };
302 static /* Use -fall-defs-global to expose */
303 asn_TYPE_descriptor_t asn_DEF_resourceElementOffset_7 = {
304         "resourceElementOffset",
305         "resourceElementOffset",
306         &asn_OP_NativeEnumerated,
307         asn_DEF_resourceElementOffset_tags_7,
308         sizeof(asn_DEF_resourceElementOffset_tags_7)
309                 /sizeof(asn_DEF_resourceElementOffset_tags_7[0]) - 1, /* 1 */
310         asn_DEF_resourceElementOffset_tags_7,   /* Same as above */
311         sizeof(asn_DEF_resourceElementOffset_tags_7)
312                 /sizeof(asn_DEF_resourceElementOffset_tags_7[0]), /* 2 */
313         { &asn_OER_type_resourceElementOffset_constr_7, &asn_PER_type_resourceElementOffset_constr_7, NativeEnumerated_constraint },
314         0, 0,   /* Defined elsewhere */
315         &asn_SPC_resourceElementOffset_specs_7  /* Additional specs */
316 };
317
318 asn_TYPE_member_t asn_MBR_PTRS_DownlinkConfig_1[] = {
319         { ATF_POINTER, 4, offsetof(struct PTRS_DownlinkConfig, frequencyDensity),
320                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
321                 0,
322                 &asn_DEF_frequencyDensity_2,
323                 0,
324                 { &asn_OER_memb_frequencyDensity_constr_2, &asn_PER_memb_frequencyDensity_constr_2,  memb_frequencyDensity_constraint_1 },
325                 0, 0, /* No default value */
326                 "frequencyDensity"
327                 },
328         { ATF_POINTER, 3, offsetof(struct PTRS_DownlinkConfig, timeDensity),
329                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
330                 0,
331                 &asn_DEF_timeDensity_4,
332                 0,
333                 { &asn_OER_memb_timeDensity_constr_4, &asn_PER_memb_timeDensity_constr_4,  memb_timeDensity_constraint_1 },
334                 0, 0, /* No default value */
335                 "timeDensity"
336                 },
337         { ATF_POINTER, 2, offsetof(struct PTRS_DownlinkConfig, epre_Ratio),
338                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
339                 -1,     /* IMPLICIT tag at current level */
340                 &asn_DEF_NativeInteger,
341                 0,
342                 { &asn_OER_memb_epre_Ratio_constr_6, &asn_PER_memb_epre_Ratio_constr_6,  memb_epre_Ratio_constraint_1 },
343                 0, 0, /* No default value */
344                 "epre-Ratio"
345                 },
346         { ATF_POINTER, 1, offsetof(struct PTRS_DownlinkConfig, resourceElementOffset),
347                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
348                 -1,     /* IMPLICIT tag at current level */
349                 &asn_DEF_resourceElementOffset_7,
350                 0,
351                 { 0, 0, 0 },
352                 0, 0, /* No default value */
353                 "resourceElementOffset"
354                 },
355 };
356 static const int asn_MAP_PTRS_DownlinkConfig_oms_1[] = { 0, 1, 2, 3 };
357 static const ber_tlv_tag_t asn_DEF_PTRS_DownlinkConfig_tags_1[] = {
358         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
359 };
360 static const asn_TYPE_tag2member_t asn_MAP_PTRS_DownlinkConfig_tag2el_1[] = {
361     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* frequencyDensity */
362     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* timeDensity */
363     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* epre-Ratio */
364     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* resourceElementOffset */
365 };
366 asn_SEQUENCE_specifics_t asn_SPC_PTRS_DownlinkConfig_specs_1 = {
367         sizeof(struct PTRS_DownlinkConfig),
368         offsetof(struct PTRS_DownlinkConfig, _asn_ctx),
369         asn_MAP_PTRS_DownlinkConfig_tag2el_1,
370         4,      /* Count of tags in the map */
371         asn_MAP_PTRS_DownlinkConfig_oms_1,      /* Optional members */
372         4, 0,   /* Root/Additions */
373         4,      /* First extension addition */
374 };
375 asn_TYPE_descriptor_t asn_DEF_PTRS_DownlinkConfig = {
376         "PTRS-DownlinkConfig",
377         "PTRS-DownlinkConfig",
378         &asn_OP_SEQUENCE,
379         asn_DEF_PTRS_DownlinkConfig_tags_1,
380         sizeof(asn_DEF_PTRS_DownlinkConfig_tags_1)
381                 /sizeof(asn_DEF_PTRS_DownlinkConfig_tags_1[0]), /* 1 */
382         asn_DEF_PTRS_DownlinkConfig_tags_1,     /* Same as above */
383         sizeof(asn_DEF_PTRS_DownlinkConfig_tags_1)
384                 /sizeof(asn_DEF_PTRS_DownlinkConfig_tags_1[0]), /* 1 */
385         { 0, 0, SEQUENCE_constraint },
386         asn_MBR_PTRS_DownlinkConfig_1,
387         4,      /* Elements count */
388         &asn_SPC_PTRS_DownlinkConfig_specs_1    /* Additional specs */
389 };
390