[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-423] Modified RRC asn structures
[o-du/l2.git] / src / codec_utils / RRC / CSI-RS-CellMobility.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-RS-CellMobility.h"
9
10 #include "CSI-RS-Resource-Mobility.h"
11 /*
12  * This type is implemented using NativeEnumerated,
13  * so here we adjust the DEF accordingly.
14  */
15 static int
16 memb_startPRB_constraint_3(const asn_TYPE_descriptor_t *td, const void *sptr,
17                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
18         long value;
19         
20         if(!sptr) {
21                 ASN__CTFAIL(app_key, td, sptr,
22                         "%s: value not given (%s:%d)",
23                         td->name, __FILE__, __LINE__);
24                 return -1;
25         }
26         
27         value = *(const long *)sptr;
28         
29         if((value >= 0 && value <= 2169)) {
30                 /* Constraint check succeeded */
31                 return 0;
32         } else {
33                 ASN__CTFAIL(app_key, td, sptr,
34                         "%s: constraint failed (%s:%d)",
35                         td->name, __FILE__, __LINE__);
36                 return -1;
37         }
38 }
39
40 /*
41  * This type is implemented using NativeEnumerated,
42  * so here we adjust the DEF accordingly.
43  */
44 static int
45 memb_csi_rs_ResourceList_Mobility_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
46                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
47         size_t size;
48         
49         if(!sptr) {
50                 ASN__CTFAIL(app_key, td, sptr,
51                         "%s: value not given (%s:%d)",
52                         td->name, __FILE__, __LINE__);
53                 return -1;
54         }
55         
56         /* Determine the number of elements */
57         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
58         
59         if((size >= 1 && size <= 96)) {
60                 /* Perform validation of the inner elements */
61                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
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_nrofPRBs_constr_4 CC_NOTUSED = {
71         { 0, 0 },
72         -1};
73 static asn_per_constraints_t asn_PER_type_nrofPRBs_constr_4 CC_NOTUSED = {
74         { APC_CONSTRAINED,       3,  3,  0,  4 }        /* (0..4) */,
75         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
76         0, 0    /* No PER value map */
77 };
78 static asn_oer_constraints_t asn_OER_memb_startPRB_constr_10 CC_NOTUSED = {
79         { 2, 1 }        /* (0..2169) */,
80         -1};
81 static asn_per_constraints_t asn_PER_memb_startPRB_constr_10 CC_NOTUSED = {
82         { APC_CONSTRAINED,       12,  12,  0,  2169 }   /* (0..2169) */,
83         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
84         0, 0    /* No PER value map */
85 };
86 static asn_oer_constraints_t asn_OER_type_density_constr_11 CC_NOTUSED = {
87         { 0, 0 },
88         -1};
89 static asn_per_constraints_t asn_PER_type_density_constr_11 CC_NOTUSED = {
90         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
91         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
92         0, 0    /* No PER value map */
93 };
94 static asn_oer_constraints_t asn_OER_type_csi_rs_ResourceList_Mobility_constr_14 CC_NOTUSED = {
95         { 0, 0 },
96         -1      /* (SIZE(1..96)) */};
97 static asn_per_constraints_t asn_PER_type_csi_rs_ResourceList_Mobility_constr_14 CC_NOTUSED = {
98         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
99         { APC_CONSTRAINED,       7,  7,  1,  96 }       /* (SIZE(1..96)) */,
100         0, 0    /* No PER value map */
101 };
102 static asn_oer_constraints_t asn_OER_memb_csi_rs_ResourceList_Mobility_constr_14 CC_NOTUSED = {
103         { 0, 0 },
104         -1      /* (SIZE(1..96)) */};
105 static asn_per_constraints_t asn_PER_memb_csi_rs_ResourceList_Mobility_constr_14 CC_NOTUSED = {
106         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
107         { APC_CONSTRAINED,       7,  7,  1,  96 }       /* (SIZE(1..96)) */,
108         0, 0    /* No PER value map */
109 };
110 static const asn_INTEGER_enum_map_t asn_MAP_nrofPRBs_value2enum_4[] = {
111         { 0,    6,      "size24" },
112         { 1,    6,      "size48" },
113         { 2,    6,      "size96" },
114         { 3,    7,      "size192" },
115         { 4,    7,      "size264" }
116 };
117 static const unsigned int asn_MAP_nrofPRBs_enum2value_4[] = {
118         3,      /* size192(3) */
119         0,      /* size24(0) */
120         4,      /* size264(4) */
121         1,      /* size48(1) */
122         2       /* size96(2) */
123 };
124 static const asn_INTEGER_specifics_t asn_SPC_nrofPRBs_specs_4 = {
125         asn_MAP_nrofPRBs_value2enum_4,  /* "tag" => N; sorted by tag */
126         asn_MAP_nrofPRBs_enum2value_4,  /* N => "tag"; sorted by N */
127         5,      /* Number of elements in the maps */
128         0,      /* Enumeration is not extensible */
129         1,      /* Strict enumeration */
130         0,      /* Native long size */
131         0
132 };
133 static const ber_tlv_tag_t asn_DEF_nrofPRBs_tags_4[] = {
134         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
135         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
136 };
137 static /* Use -fall-defs-global to expose */
138 asn_TYPE_descriptor_t asn_DEF_nrofPRBs_4 = {
139         "nrofPRBs",
140         "nrofPRBs",
141         &asn_OP_NativeEnumerated,
142         asn_DEF_nrofPRBs_tags_4,
143         sizeof(asn_DEF_nrofPRBs_tags_4)
144                 /sizeof(asn_DEF_nrofPRBs_tags_4[0]) - 1, /* 1 */
145         asn_DEF_nrofPRBs_tags_4,        /* Same as above */
146         sizeof(asn_DEF_nrofPRBs_tags_4)
147                 /sizeof(asn_DEF_nrofPRBs_tags_4[0]), /* 2 */
148         { &asn_OER_type_nrofPRBs_constr_4, &asn_PER_type_nrofPRBs_constr_4, NativeEnumerated_constraint },
149         0, 0,   /* Defined elsewhere */
150         &asn_SPC_nrofPRBs_specs_4       /* Additional specs */
151 };
152
153 static asn_TYPE_member_t asn_MBR_csi_rs_MeasurementBW_3[] = {
154         { ATF_NOFLAGS, 0, offsetof(struct CSI_RS_CellMobility__csi_rs_MeasurementBW, nrofPRBs),
155                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
156                 -1,     /* IMPLICIT tag at current level */
157                 &asn_DEF_nrofPRBs_4,
158                 0,
159                 { 0, 0, 0 },
160                 0, 0, /* No default value */
161                 "nrofPRBs"
162                 },
163         { ATF_NOFLAGS, 0, offsetof(struct CSI_RS_CellMobility__csi_rs_MeasurementBW, startPRB),
164                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
165                 -1,     /* IMPLICIT tag at current level */
166                 &asn_DEF_NativeInteger,
167                 0,
168                 { &asn_OER_memb_startPRB_constr_10, &asn_PER_memb_startPRB_constr_10,  memb_startPRB_constraint_3 },
169                 0, 0, /* No default value */
170                 "startPRB"
171                 },
172 };
173 static const ber_tlv_tag_t asn_DEF_csi_rs_MeasurementBW_tags_3[] = {
174         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
175         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
176 };
177 static const asn_TYPE_tag2member_t asn_MAP_csi_rs_MeasurementBW_tag2el_3[] = {
178     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nrofPRBs */
179     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* startPRB */
180 };
181 static asn_SEQUENCE_specifics_t asn_SPC_csi_rs_MeasurementBW_specs_3 = {
182         sizeof(struct CSI_RS_CellMobility__csi_rs_MeasurementBW),
183         offsetof(struct CSI_RS_CellMobility__csi_rs_MeasurementBW, _asn_ctx),
184         asn_MAP_csi_rs_MeasurementBW_tag2el_3,
185         2,      /* Count of tags in the map */
186         0, 0, 0,        /* Optional elements (not needed) */
187         -1,     /* First extension addition */
188 };
189 static /* Use -fall-defs-global to expose */
190 asn_TYPE_descriptor_t asn_DEF_csi_rs_MeasurementBW_3 = {
191         "csi-rs-MeasurementBW",
192         "csi-rs-MeasurementBW",
193         &asn_OP_SEQUENCE,
194         asn_DEF_csi_rs_MeasurementBW_tags_3,
195         sizeof(asn_DEF_csi_rs_MeasurementBW_tags_3)
196                 /sizeof(asn_DEF_csi_rs_MeasurementBW_tags_3[0]) - 1, /* 1 */
197         asn_DEF_csi_rs_MeasurementBW_tags_3,    /* Same as above */
198         sizeof(asn_DEF_csi_rs_MeasurementBW_tags_3)
199                 /sizeof(asn_DEF_csi_rs_MeasurementBW_tags_3[0]), /* 2 */
200         { 0, 0, SEQUENCE_constraint },
201         asn_MBR_csi_rs_MeasurementBW_3,
202         2,      /* Elements count */
203         &asn_SPC_csi_rs_MeasurementBW_specs_3   /* Additional specs */
204 };
205
206 static const asn_INTEGER_enum_map_t asn_MAP_density_value2enum_11[] = {
207         { 0,    2,      "d1" },
208         { 1,    2,      "d3" }
209 };
210 static const unsigned int asn_MAP_density_enum2value_11[] = {
211         0,      /* d1(0) */
212         1       /* d3(1) */
213 };
214 static const asn_INTEGER_specifics_t asn_SPC_density_specs_11 = {
215         asn_MAP_density_value2enum_11,  /* "tag" => N; sorted by tag */
216         asn_MAP_density_enum2value_11,  /* N => "tag"; sorted by N */
217         2,      /* Number of elements in the maps */
218         0,      /* Enumeration is not extensible */
219         1,      /* Strict enumeration */
220         0,      /* Native long size */
221         0
222 };
223 static const ber_tlv_tag_t asn_DEF_density_tags_11[] = {
224         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
225         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
226 };
227 static /* Use -fall-defs-global to expose */
228 asn_TYPE_descriptor_t asn_DEF_density_11 = {
229         "density",
230         "density",
231         &asn_OP_NativeEnumerated,
232         asn_DEF_density_tags_11,
233         sizeof(asn_DEF_density_tags_11)
234                 /sizeof(asn_DEF_density_tags_11[0]) - 1, /* 1 */
235         asn_DEF_density_tags_11,        /* Same as above */
236         sizeof(asn_DEF_density_tags_11)
237                 /sizeof(asn_DEF_density_tags_11[0]), /* 2 */
238         { &asn_OER_type_density_constr_11, &asn_PER_type_density_constr_11, NativeEnumerated_constraint },
239         0, 0,   /* Defined elsewhere */
240         &asn_SPC_density_specs_11       /* Additional specs */
241 };
242
243 static asn_TYPE_member_t asn_MBR_csi_rs_ResourceList_Mobility_14[] = {
244         { ATF_POINTER, 0, 0,
245                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
246                 0,
247                 &asn_DEF_CSI_RS_Resource_Mobility,
248                 0,
249                 { 0, 0, 0 },
250                 0, 0, /* No default value */
251                 ""
252                 },
253 };
254 static const ber_tlv_tag_t asn_DEF_csi_rs_ResourceList_Mobility_tags_14[] = {
255         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
256         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
257 };
258 static asn_SET_OF_specifics_t asn_SPC_csi_rs_ResourceList_Mobility_specs_14 = {
259         sizeof(struct CSI_RS_CellMobility__csi_rs_ResourceList_Mobility),
260         offsetof(struct CSI_RS_CellMobility__csi_rs_ResourceList_Mobility, _asn_ctx),
261         0,      /* XER encoding is XMLDelimitedItemList */
262 };
263 static /* Use -fall-defs-global to expose */
264 asn_TYPE_descriptor_t asn_DEF_csi_rs_ResourceList_Mobility_14 = {
265         "csi-rs-ResourceList-Mobility",
266         "csi-rs-ResourceList-Mobility",
267         &asn_OP_SEQUENCE_OF,
268         asn_DEF_csi_rs_ResourceList_Mobility_tags_14,
269         sizeof(asn_DEF_csi_rs_ResourceList_Mobility_tags_14)
270                 /sizeof(asn_DEF_csi_rs_ResourceList_Mobility_tags_14[0]) - 1, /* 1 */
271         asn_DEF_csi_rs_ResourceList_Mobility_tags_14,   /* Same as above */
272         sizeof(asn_DEF_csi_rs_ResourceList_Mobility_tags_14)
273                 /sizeof(asn_DEF_csi_rs_ResourceList_Mobility_tags_14[0]), /* 2 */
274         { &asn_OER_type_csi_rs_ResourceList_Mobility_constr_14, &asn_PER_type_csi_rs_ResourceList_Mobility_constr_14, SEQUENCE_OF_constraint },
275         asn_MBR_csi_rs_ResourceList_Mobility_14,
276         1,      /* Single element */
277         &asn_SPC_csi_rs_ResourceList_Mobility_specs_14  /* Additional specs */
278 };
279
280 asn_TYPE_member_t asn_MBR_CSI_RS_CellMobility_1[] = {
281         { ATF_NOFLAGS, 0, offsetof(struct CSI_RS_CellMobility, cellId),
282                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
283                 -1,     /* IMPLICIT tag at current level */
284                 &asn_DEF_PhysCellId,
285                 0,
286                 { 0, 0, 0 },
287                 0, 0, /* No default value */
288                 "cellId"
289                 },
290         { ATF_NOFLAGS, 0, offsetof(struct CSI_RS_CellMobility, csi_rs_MeasurementBW),
291                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
292                 0,
293                 &asn_DEF_csi_rs_MeasurementBW_3,
294                 0,
295                 { 0, 0, 0 },
296                 0, 0, /* No default value */
297                 "csi-rs-MeasurementBW"
298                 },
299         { ATF_POINTER, 1, offsetof(struct CSI_RS_CellMobility, density),
300                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
301                 -1,     /* IMPLICIT tag at current level */
302                 &asn_DEF_density_11,
303                 0,
304                 { 0, 0, 0 },
305                 0, 0, /* No default value */
306                 "density"
307                 },
308         { ATF_NOFLAGS, 0, offsetof(struct CSI_RS_CellMobility, csi_rs_ResourceList_Mobility),
309                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
310                 0,
311                 &asn_DEF_csi_rs_ResourceList_Mobility_14,
312                 0,
313                 { &asn_OER_memb_csi_rs_ResourceList_Mobility_constr_14, &asn_PER_memb_csi_rs_ResourceList_Mobility_constr_14,  memb_csi_rs_ResourceList_Mobility_constraint_1 },
314                 0, 0, /* No default value */
315                 "csi-rs-ResourceList-Mobility"
316                 },
317 };
318 static const int asn_MAP_CSI_RS_CellMobility_oms_1[] = { 2 };
319 static const ber_tlv_tag_t asn_DEF_CSI_RS_CellMobility_tags_1[] = {
320         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
321 };
322 static const asn_TYPE_tag2member_t asn_MAP_CSI_RS_CellMobility_tag2el_1[] = {
323     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cellId */
324     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* csi-rs-MeasurementBW */
325     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* density */
326     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* csi-rs-ResourceList-Mobility */
327 };
328 asn_SEQUENCE_specifics_t asn_SPC_CSI_RS_CellMobility_specs_1 = {
329         sizeof(struct CSI_RS_CellMobility),
330         offsetof(struct CSI_RS_CellMobility, _asn_ctx),
331         asn_MAP_CSI_RS_CellMobility_tag2el_1,
332         4,      /* Count of tags in the map */
333         asn_MAP_CSI_RS_CellMobility_oms_1,      /* Optional members */
334         1, 0,   /* Root/Additions */
335         -1,     /* First extension addition */
336 };
337 asn_TYPE_descriptor_t asn_DEF_CSI_RS_CellMobility = {
338         "CSI-RS-CellMobility",
339         "CSI-RS-CellMobility",
340         &asn_OP_SEQUENCE,
341         asn_DEF_CSI_RS_CellMobility_tags_1,
342         sizeof(asn_DEF_CSI_RS_CellMobility_tags_1)
343                 /sizeof(asn_DEF_CSI_RS_CellMobility_tags_1[0]), /* 1 */
344         asn_DEF_CSI_RS_CellMobility_tags_1,     /* Same as above */
345         sizeof(asn_DEF_CSI_RS_CellMobility_tags_1)
346                 /sizeof(asn_DEF_CSI_RS_CellMobility_tags_1[0]), /* 1 */
347         { 0, 0, SEQUENCE_constraint },
348         asn_MBR_CSI_RS_CellMobility_1,
349         4,      /* Elements count */
350         &asn_SPC_CSI_RS_CellMobility_specs_1    /* Additional specs */
351 };
352