[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-423] Modified RRC asn structures
[o-du/l2.git] / src / codec_utils / RRC / CSI-IM-Resource.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 "CSI-IM-Resource.h"
9
10 #include "CSI-FrequencyOccupation.h"
11 #include "CSI-ResourcePeriodicityAndOffset.h"
12 /*
13  * This type is implemented using NativeEnumerated,
14  * so here we adjust the DEF accordingly.
15  */
16 static int
17 memb_symbolLocation_p0_constraint_4(const asn_TYPE_descriptor_t *td, const void *sptr,
18                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
19         long value;
20         
21         if(!sptr) {
22                 ASN__CTFAIL(app_key, td, sptr,
23                         "%s: value not given (%s:%d)",
24                         td->name, __FILE__, __LINE__);
25                 return -1;
26         }
27         
28         value = *(const long *)sptr;
29         
30         if((value >= 0 && value <= 12)) {
31                 /* Constraint check succeeded */
32                 return 0;
33         } else {
34                 ASN__CTFAIL(app_key, td, sptr,
35                         "%s: constraint failed (%s:%d)",
36                         td->name, __FILE__, __LINE__);
37                 return -1;
38         }
39 }
40
41 /*
42  * This type is implemented using NativeEnumerated,
43  * so here we adjust the DEF accordingly.
44  */
45 static int
46 memb_symbolLocation_p1_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
47                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
48         long value;
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         value = *(const long *)sptr;
58         
59         if((value >= 0 && value <= 13)) {
60                 /* Constraint check succeeded */
61                 return 0;
62         } else {
63                 ASN__CTFAIL(app_key, td, sptr,
64                         "%s: constraint failed (%s:%d)",
65                         td->name, __FILE__, __LINE__);
66                 return -1;
67         }
68 }
69
70 static asn_oer_constraints_t asn_OER_type_subcarrierLocation_p0_constr_5 CC_NOTUSED = {
71         { 0, 0 },
72         -1};
73 static asn_per_constraints_t asn_PER_type_subcarrierLocation_p0_constr_5 CC_NOTUSED = {
74         { APC_CONSTRAINED,       3,  3,  0,  5 }        /* (0..5) */,
75         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
76         0, 0    /* No PER value map */
77 };
78 static asn_oer_constraints_t asn_OER_memb_symbolLocation_p0_constr_12 CC_NOTUSED = {
79         { 1, 1 }        /* (0..12) */,
80         -1};
81 static asn_per_constraints_t asn_PER_memb_symbolLocation_p0_constr_12 CC_NOTUSED = {
82         { APC_CONSTRAINED,       4,  4,  0,  12 }       /* (0..12) */,
83         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
84         0, 0    /* No PER value map */
85 };
86 static asn_oer_constraints_t asn_OER_type_subcarrierLocation_p1_constr_14 CC_NOTUSED = {
87         { 0, 0 },
88         -1};
89 static asn_per_constraints_t asn_PER_type_subcarrierLocation_p1_constr_14 CC_NOTUSED = {
90         { APC_CONSTRAINED,       2,  2,  0,  2 }        /* (0..2) */,
91         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
92         0, 0    /* No PER value map */
93 };
94 static asn_oer_constraints_t asn_OER_memb_symbolLocation_p1_constr_18 CC_NOTUSED = {
95         { 1, 1 }        /* (0..13) */,
96         -1};
97 static asn_per_constraints_t asn_PER_memb_symbolLocation_p1_constr_18 CC_NOTUSED = {
98         { APC_CONSTRAINED,       4,  4,  0,  13 }       /* (0..13) */,
99         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
100         0, 0    /* No PER value map */
101 };
102 static asn_oer_constraints_t asn_OER_type_csi_IM_ResourceElementPattern_constr_3 CC_NOTUSED = {
103         { 0, 0 },
104         -1};
105 static asn_per_constraints_t asn_PER_type_csi_IM_ResourceElementPattern_constr_3 CC_NOTUSED = {
106         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
107         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
108         0, 0    /* No PER value map */
109 };
110 static const asn_INTEGER_enum_map_t asn_MAP_subcarrierLocation_p0_value2enum_5[] = {
111         { 0,    2,      "s0" },
112         { 1,    2,      "s2" },
113         { 2,    2,      "s4" },
114         { 3,    2,      "s6" },
115         { 4,    2,      "s8" },
116         { 5,    3,      "s10" }
117 };
118 static const unsigned int asn_MAP_subcarrierLocation_p0_enum2value_5[] = {
119         0,      /* s0(0) */
120         5,      /* s10(5) */
121         1,      /* s2(1) */
122         2,      /* s4(2) */
123         3,      /* s6(3) */
124         4       /* s8(4) */
125 };
126 static const asn_INTEGER_specifics_t asn_SPC_subcarrierLocation_p0_specs_5 = {
127         asn_MAP_subcarrierLocation_p0_value2enum_5,     /* "tag" => N; sorted by tag */
128         asn_MAP_subcarrierLocation_p0_enum2value_5,     /* N => "tag"; sorted by N */
129         6,      /* Number of elements in the maps */
130         0,      /* Enumeration is not extensible */
131         1,      /* Strict enumeration */
132         0,      /* Native long size */
133         0
134 };
135 static const ber_tlv_tag_t asn_DEF_subcarrierLocation_p0_tags_5[] = {
136         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
137         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
138 };
139 static /* Use -fall-defs-global to expose */
140 asn_TYPE_descriptor_t asn_DEF_subcarrierLocation_p0_5 = {
141         "subcarrierLocation-p0",
142         "subcarrierLocation-p0",
143         &asn_OP_NativeEnumerated,
144         asn_DEF_subcarrierLocation_p0_tags_5,
145         sizeof(asn_DEF_subcarrierLocation_p0_tags_5)
146                 /sizeof(asn_DEF_subcarrierLocation_p0_tags_5[0]) - 1, /* 1 */
147         asn_DEF_subcarrierLocation_p0_tags_5,   /* Same as above */
148         sizeof(asn_DEF_subcarrierLocation_p0_tags_5)
149                 /sizeof(asn_DEF_subcarrierLocation_p0_tags_5[0]), /* 2 */
150         { &asn_OER_type_subcarrierLocation_p0_constr_5, &asn_PER_type_subcarrierLocation_p0_constr_5, NativeEnumerated_constraint },
151         0, 0,   /* Defined elsewhere */
152         &asn_SPC_subcarrierLocation_p0_specs_5  /* Additional specs */
153 };
154
155 static asn_TYPE_member_t asn_MBR_pattern0_4[] = {
156         { ATF_NOFLAGS, 0, offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern0, subcarrierLocation_p0),
157                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
158                 -1,     /* IMPLICIT tag at current level */
159                 &asn_DEF_subcarrierLocation_p0_5,
160                 0,
161                 { 0, 0, 0 },
162                 0, 0, /* No default value */
163                 "subcarrierLocation-p0"
164                 },
165         { ATF_NOFLAGS, 0, offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern0, symbolLocation_p0),
166                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
167                 -1,     /* IMPLICIT tag at current level */
168                 &asn_DEF_NativeInteger,
169                 0,
170                 { &asn_OER_memb_symbolLocation_p0_constr_12, &asn_PER_memb_symbolLocation_p0_constr_12,  memb_symbolLocation_p0_constraint_4 },
171                 0, 0, /* No default value */
172                 "symbolLocation-p0"
173                 },
174 };
175 static const ber_tlv_tag_t asn_DEF_pattern0_tags_4[] = {
176         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
177         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
178 };
179 static const asn_TYPE_tag2member_t asn_MAP_pattern0_tag2el_4[] = {
180     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* subcarrierLocation-p0 */
181     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* symbolLocation-p0 */
182 };
183 static asn_SEQUENCE_specifics_t asn_SPC_pattern0_specs_4 = {
184         sizeof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern0),
185         offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern0, _asn_ctx),
186         asn_MAP_pattern0_tag2el_4,
187         2,      /* Count of tags in the map */
188         0, 0, 0,        /* Optional elements (not needed) */
189         -1,     /* First extension addition */
190 };
191 static /* Use -fall-defs-global to expose */
192 asn_TYPE_descriptor_t asn_DEF_pattern0_4 = {
193         "pattern0",
194         "pattern0",
195         &asn_OP_SEQUENCE,
196         asn_DEF_pattern0_tags_4,
197         sizeof(asn_DEF_pattern0_tags_4)
198                 /sizeof(asn_DEF_pattern0_tags_4[0]) - 1, /* 1 */
199         asn_DEF_pattern0_tags_4,        /* Same as above */
200         sizeof(asn_DEF_pattern0_tags_4)
201                 /sizeof(asn_DEF_pattern0_tags_4[0]), /* 2 */
202         { 0, 0, SEQUENCE_constraint },
203         asn_MBR_pattern0_4,
204         2,      /* Elements count */
205         &asn_SPC_pattern0_specs_4       /* Additional specs */
206 };
207
208 static const asn_INTEGER_enum_map_t asn_MAP_subcarrierLocation_p1_value2enum_14[] = {
209         { 0,    2,      "s0" },
210         { 1,    2,      "s4" },
211         { 2,    2,      "s8" }
212 };
213 static const unsigned int asn_MAP_subcarrierLocation_p1_enum2value_14[] = {
214         0,      /* s0(0) */
215         1,      /* s4(1) */
216         2       /* s8(2) */
217 };
218 static const asn_INTEGER_specifics_t asn_SPC_subcarrierLocation_p1_specs_14 = {
219         asn_MAP_subcarrierLocation_p1_value2enum_14,    /* "tag" => N; sorted by tag */
220         asn_MAP_subcarrierLocation_p1_enum2value_14,    /* N => "tag"; sorted by N */
221         3,      /* Number of elements in the maps */
222         0,      /* Enumeration is not extensible */
223         1,      /* Strict enumeration */
224         0,      /* Native long size */
225         0
226 };
227 static const ber_tlv_tag_t asn_DEF_subcarrierLocation_p1_tags_14[] = {
228         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
229         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
230 };
231 static /* Use -fall-defs-global to expose */
232 asn_TYPE_descriptor_t asn_DEF_subcarrierLocation_p1_14 = {
233         "subcarrierLocation-p1",
234         "subcarrierLocation-p1",
235         &asn_OP_NativeEnumerated,
236         asn_DEF_subcarrierLocation_p1_tags_14,
237         sizeof(asn_DEF_subcarrierLocation_p1_tags_14)
238                 /sizeof(asn_DEF_subcarrierLocation_p1_tags_14[0]) - 1, /* 1 */
239         asn_DEF_subcarrierLocation_p1_tags_14,  /* Same as above */
240         sizeof(asn_DEF_subcarrierLocation_p1_tags_14)
241                 /sizeof(asn_DEF_subcarrierLocation_p1_tags_14[0]), /* 2 */
242         { &asn_OER_type_subcarrierLocation_p1_constr_14, &asn_PER_type_subcarrierLocation_p1_constr_14, NativeEnumerated_constraint },
243         0, 0,   /* Defined elsewhere */
244         &asn_SPC_subcarrierLocation_p1_specs_14 /* Additional specs */
245 };
246
247 static asn_TYPE_member_t asn_MBR_pattern1_13[] = {
248         { ATF_NOFLAGS, 0, offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1, subcarrierLocation_p1),
249                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
250                 -1,     /* IMPLICIT tag at current level */
251                 &asn_DEF_subcarrierLocation_p1_14,
252                 0,
253                 { 0, 0, 0 },
254                 0, 0, /* No default value */
255                 "subcarrierLocation-p1"
256                 },
257         { ATF_NOFLAGS, 0, offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1, symbolLocation_p1),
258                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
259                 -1,     /* IMPLICIT tag at current level */
260                 &asn_DEF_NativeInteger,
261                 0,
262                 { &asn_OER_memb_symbolLocation_p1_constr_18, &asn_PER_memb_symbolLocation_p1_constr_18,  memb_symbolLocation_p1_constraint_13 },
263                 0, 0, /* No default value */
264                 "symbolLocation-p1"
265                 },
266 };
267 static const ber_tlv_tag_t asn_DEF_pattern1_tags_13[] = {
268         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
269         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
270 };
271 static const asn_TYPE_tag2member_t asn_MAP_pattern1_tag2el_13[] = {
272     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* subcarrierLocation-p1 */
273     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* symbolLocation-p1 */
274 };
275 static asn_SEQUENCE_specifics_t asn_SPC_pattern1_specs_13 = {
276         sizeof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1),
277         offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1, _asn_ctx),
278         asn_MAP_pattern1_tag2el_13,
279         2,      /* Count of tags in the map */
280         0, 0, 0,        /* Optional elements (not needed) */
281         -1,     /* First extension addition */
282 };
283 static /* Use -fall-defs-global to expose */
284 asn_TYPE_descriptor_t asn_DEF_pattern1_13 = {
285         "pattern1",
286         "pattern1",
287         &asn_OP_SEQUENCE,
288         asn_DEF_pattern1_tags_13,
289         sizeof(asn_DEF_pattern1_tags_13)
290                 /sizeof(asn_DEF_pattern1_tags_13[0]) - 1, /* 1 */
291         asn_DEF_pattern1_tags_13,       /* Same as above */
292         sizeof(asn_DEF_pattern1_tags_13)
293                 /sizeof(asn_DEF_pattern1_tags_13[0]), /* 2 */
294         { 0, 0, SEQUENCE_constraint },
295         asn_MBR_pattern1_13,
296         2,      /* Elements count */
297         &asn_SPC_pattern1_specs_13      /* Additional specs */
298 };
299
300 static asn_TYPE_member_t asn_MBR_csi_IM_ResourceElementPattern_3[] = {
301         { ATF_POINTER, 0, offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern, choice.pattern0),
302                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
303                 0,
304                 &asn_DEF_pattern0_4,
305                 0,
306                 { 0, 0, 0 },
307                 0, 0, /* No default value */
308                 "pattern0"
309                 },
310         { ATF_POINTER, 0, offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern, choice.pattern1),
311                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
312                 0,
313                 &asn_DEF_pattern1_13,
314                 0,
315                 { 0, 0, 0 },
316                 0, 0, /* No default value */
317                 "pattern1"
318                 },
319 };
320 static const asn_TYPE_tag2member_t asn_MAP_csi_IM_ResourceElementPattern_tag2el_3[] = {
321     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pattern0 */
322     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* pattern1 */
323 };
324 static asn_CHOICE_specifics_t asn_SPC_csi_IM_ResourceElementPattern_specs_3 = {
325         sizeof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern),
326         offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern, _asn_ctx),
327         offsetof(struct CSI_IM_Resource__csi_IM_ResourceElementPattern, present),
328         sizeof(((struct CSI_IM_Resource__csi_IM_ResourceElementPattern *)0)->present),
329         asn_MAP_csi_IM_ResourceElementPattern_tag2el_3,
330         2,      /* Count of tags in the map */
331         0, 0,
332         -1      /* Extensions start */
333 };
334 static /* Use -fall-defs-global to expose */
335 asn_TYPE_descriptor_t asn_DEF_csi_IM_ResourceElementPattern_3 = {
336         "csi-IM-ResourceElementPattern",
337         "csi-IM-ResourceElementPattern",
338         &asn_OP_CHOICE,
339         0,      /* No effective tags (pointer) */
340         0,      /* No effective tags (count) */
341         0,      /* No tags (pointer) */
342         0,      /* No tags (count) */
343         { &asn_OER_type_csi_IM_ResourceElementPattern_constr_3, &asn_PER_type_csi_IM_ResourceElementPattern_constr_3, CHOICE_constraint },
344         asn_MBR_csi_IM_ResourceElementPattern_3,
345         2,      /* Elements count */
346         &asn_SPC_csi_IM_ResourceElementPattern_specs_3  /* Additional specs */
347 };
348
349 asn_TYPE_member_t asn_MBR_CSI_IM_Resource_1[] = {
350         { ATF_NOFLAGS, 0, offsetof(struct CSI_IM_Resource, csi_IM_ResourceId),
351                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
352                 -1,     /* IMPLICIT tag at current level */
353                 &asn_DEF_CSI_IM_ResourceId,
354                 0,
355                 { 0, 0, 0 },
356                 0, 0, /* No default value */
357                 "csi-IM-ResourceId"
358                 },
359         { ATF_POINTER, 3, offsetof(struct CSI_IM_Resource, csi_IM_ResourceElementPattern),
360                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
361                 +1,     /* EXPLICIT tag at current level */
362                 &asn_DEF_csi_IM_ResourceElementPattern_3,
363                 0,
364                 { 0, 0, 0 },
365                 0, 0, /* No default value */
366                 "csi-IM-ResourceElementPattern"
367                 },
368         { ATF_POINTER, 2, offsetof(struct CSI_IM_Resource, freqBand),
369                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
370                 -1,     /* IMPLICIT tag at current level */
371                 &asn_DEF_CSI_FrequencyOccupation,
372                 0,
373                 { 0, 0, 0 },
374                 0, 0, /* No default value */
375                 "freqBand"
376                 },
377         { ATF_POINTER, 1, offsetof(struct CSI_IM_Resource, periodicityAndOffset),
378                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
379                 +1,     /* EXPLICIT tag at current level */
380                 &asn_DEF_CSI_ResourcePeriodicityAndOffset,
381                 0,
382                 { 0, 0, 0 },
383                 0, 0, /* No default value */
384                 "periodicityAndOffset"
385                 },
386 };
387 static const int asn_MAP_CSI_IM_Resource_oms_1[] = { 1, 2, 3 };
388 static const ber_tlv_tag_t asn_DEF_CSI_IM_Resource_tags_1[] = {
389         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
390 };
391 static const asn_TYPE_tag2member_t asn_MAP_CSI_IM_Resource_tag2el_1[] = {
392     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* csi-IM-ResourceId */
393     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* csi-IM-ResourceElementPattern */
394     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* freqBand */
395     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* periodicityAndOffset */
396 };
397 asn_SEQUENCE_specifics_t asn_SPC_CSI_IM_Resource_specs_1 = {
398         sizeof(struct CSI_IM_Resource),
399         offsetof(struct CSI_IM_Resource, _asn_ctx),
400         asn_MAP_CSI_IM_Resource_tag2el_1,
401         4,      /* Count of tags in the map */
402         asn_MAP_CSI_IM_Resource_oms_1,  /* Optional members */
403         3, 0,   /* Root/Additions */
404         4,      /* First extension addition */
405 };
406 asn_TYPE_descriptor_t asn_DEF_CSI_IM_Resource = {
407         "CSI-IM-Resource",
408         "CSI-IM-Resource",
409         &asn_OP_SEQUENCE,
410         asn_DEF_CSI_IM_Resource_tags_1,
411         sizeof(asn_DEF_CSI_IM_Resource_tags_1)
412                 /sizeof(asn_DEF_CSI_IM_Resource_tags_1[0]), /* 1 */
413         asn_DEF_CSI_IM_Resource_tags_1, /* Same as above */
414         sizeof(asn_DEF_CSI_IM_Resource_tags_1)
415                 /sizeof(asn_DEF_CSI_IM_Resource_tags_1[0]), /* 1 */
416         { 0, 0, SEQUENCE_constraint },
417         asn_MBR_CSI_IM_Resource_1,
418         4,      /* Elements count */
419         &asn_SPC_CSI_IM_Resource_specs_1        /* Additional specs */
420 };
421