[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-423] Modified RRC asn structures
[o-du/l2.git] / src / codec_utils / RRC / TypeI-SinglePanelCodebook.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 "TypeI-SinglePanelCodebook.h"
9
10 /*
11  * This type is implemented using NativeEnumerated,
12  * so here we adjust the DEF accordingly.
13  */
14 /*
15  * This type is implemented using NativeEnumerated,
16  * so here we adjust the DEF accordingly.
17  */
18 static int
19 memb_maxNumberResources_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
20                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
21         long value;
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         value = *(const long *)sptr;
31         
32         if((value >= 1 && value <= 64)) {
33                 /* Constraint check succeeded */
34                 return 0;
35         } else {
36                 ASN__CTFAIL(app_key, td, sptr,
37                         "%s: constraint failed (%s:%d)",
38                         td->name, __FILE__, __LINE__);
39                 return -1;
40         }
41 }
42
43 static int
44 memb_totalNumberTxPorts_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
45                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
46         long value;
47         
48         if(!sptr) {
49                 ASN__CTFAIL(app_key, td, sptr,
50                         "%s: value not given (%s:%d)",
51                         td->name, __FILE__, __LINE__);
52                 return -1;
53         }
54         
55         value = *(const long *)sptr;
56         
57         if((value >= 2 && value <= 256)) {
58                 /* Constraint check succeeded */
59                 return 0;
60         } else {
61                 ASN__CTFAIL(app_key, td, sptr,
62                         "%s: constraint failed (%s:%d)",
63                         td->name, __FILE__, __LINE__);
64                 return -1;
65         }
66 }
67
68 static int
69 memb_maxNumberCSI_RS_PerResourceSet_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
70                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
71         long value;
72         
73         if(!sptr) {
74                 ASN__CTFAIL(app_key, td, sptr,
75                         "%s: value not given (%s:%d)",
76                         td->name, __FILE__, __LINE__);
77                 return -1;
78         }
79         
80         value = *(const long *)sptr;
81         
82         if((value >= 1 && value <= 8)) {
83                 /* Constraint check succeeded */
84                 return 0;
85         } else {
86                 ASN__CTFAIL(app_key, td, sptr,
87                         "%s: constraint failed (%s:%d)",
88                         td->name, __FILE__, __LINE__);
89                 return -1;
90         }
91 }
92
93 static asn_oer_constraints_t asn_OER_type_maxNumberTxPortsPerResource_constr_2 CC_NOTUSED = {
94         { 0, 0 },
95         -1};
96 static asn_per_constraints_t asn_PER_type_maxNumberTxPortsPerResource_constr_2 CC_NOTUSED = {
97         { APC_CONSTRAINED,       3,  3,  0,  6 }        /* (0..6) */,
98         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
99         0, 0    /* No PER value map */
100 };
101 static asn_oer_constraints_t asn_OER_type_supportedCodebookMode_constr_12 CC_NOTUSED = {
102         { 0, 0 },
103         -1};
104 static asn_per_constraints_t asn_PER_type_supportedCodebookMode_constr_12 CC_NOTUSED = {
105         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
106         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
107         0, 0    /* No PER value map */
108 };
109 static asn_oer_constraints_t asn_OER_memb_maxNumberResources_constr_10 CC_NOTUSED = {
110         { 1, 1 }        /* (1..64) */,
111         -1};
112 static asn_per_constraints_t asn_PER_memb_maxNumberResources_constr_10 CC_NOTUSED = {
113         { APC_CONSTRAINED,       6,  6,  1,  64 }       /* (1..64) */,
114         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
115         0, 0    /* No PER value map */
116 };
117 static asn_oer_constraints_t asn_OER_memb_totalNumberTxPorts_constr_11 CC_NOTUSED = {
118         { 2, 1 }        /* (2..256) */,
119         -1};
120 static asn_per_constraints_t asn_PER_memb_totalNumberTxPorts_constr_11 CC_NOTUSED = {
121         { APC_CONSTRAINED,       8,  8,  2,  256 }      /* (2..256) */,
122         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
123         0, 0    /* No PER value map */
124 };
125 static asn_oer_constraints_t asn_OER_memb_maxNumberCSI_RS_PerResourceSet_constr_15 CC_NOTUSED = {
126         { 1, 1 }        /* (1..8) */,
127         -1};
128 static asn_per_constraints_t asn_PER_memb_maxNumberCSI_RS_PerResourceSet_constr_15 CC_NOTUSED = {
129         { APC_CONSTRAINED,       3,  3,  1,  8 }        /* (1..8) */,
130         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
131         0, 0    /* No PER value map */
132 };
133 static const asn_INTEGER_enum_map_t asn_MAP_maxNumberTxPortsPerResource_value2enum_2[] = {
134         { 0,    2,      "p2" },
135         { 1,    2,      "p4" },
136         { 2,    2,      "p8" },
137         { 3,    3,      "p12" },
138         { 4,    3,      "p16" },
139         { 5,    3,      "p24" },
140         { 6,    3,      "p32" }
141 };
142 static const unsigned int asn_MAP_maxNumberTxPortsPerResource_enum2value_2[] = {
143         3,      /* p12(3) */
144         4,      /* p16(4) */
145         0,      /* p2(0) */
146         5,      /* p24(5) */
147         6,      /* p32(6) */
148         1,      /* p4(1) */
149         2       /* p8(2) */
150 };
151 static const asn_INTEGER_specifics_t asn_SPC_maxNumberTxPortsPerResource_specs_2 = {
152         asn_MAP_maxNumberTxPortsPerResource_value2enum_2,       /* "tag" => N; sorted by tag */
153         asn_MAP_maxNumberTxPortsPerResource_enum2value_2,       /* N => "tag"; sorted by N */
154         7,      /* Number of elements in the maps */
155         0,      /* Enumeration is not extensible */
156         1,      /* Strict enumeration */
157         0,      /* Native long size */
158         0
159 };
160 static const ber_tlv_tag_t asn_DEF_maxNumberTxPortsPerResource_tags_2[] = {
161         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
162         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
163 };
164 static /* Use -fall-defs-global to expose */
165 asn_TYPE_descriptor_t asn_DEF_maxNumberTxPortsPerResource_2 = {
166         "maxNumberTxPortsPerResource",
167         "maxNumberTxPortsPerResource",
168         &asn_OP_NativeEnumerated,
169         asn_DEF_maxNumberTxPortsPerResource_tags_2,
170         sizeof(asn_DEF_maxNumberTxPortsPerResource_tags_2)
171                 /sizeof(asn_DEF_maxNumberTxPortsPerResource_tags_2[0]) - 1, /* 1 */
172         asn_DEF_maxNumberTxPortsPerResource_tags_2,     /* Same as above */
173         sizeof(asn_DEF_maxNumberTxPortsPerResource_tags_2)
174                 /sizeof(asn_DEF_maxNumberTxPortsPerResource_tags_2[0]), /* 2 */
175         { &asn_OER_type_maxNumberTxPortsPerResource_constr_2, &asn_PER_type_maxNumberTxPortsPerResource_constr_2, NativeEnumerated_constraint },
176         0, 0,   /* Defined elsewhere */
177         &asn_SPC_maxNumberTxPortsPerResource_specs_2    /* Additional specs */
178 };
179
180 static const asn_INTEGER_enum_map_t asn_MAP_supportedCodebookMode_value2enum_12[] = {
181         { 0,    5,      "mode1" },
182         { 1,    13,     "mode1AndMode2" }
183 };
184 static const unsigned int asn_MAP_supportedCodebookMode_enum2value_12[] = {
185         0,      /* mode1(0) */
186         1       /* mode1AndMode2(1) */
187 };
188 static const asn_INTEGER_specifics_t asn_SPC_supportedCodebookMode_specs_12 = {
189         asn_MAP_supportedCodebookMode_value2enum_12,    /* "tag" => N; sorted by tag */
190         asn_MAP_supportedCodebookMode_enum2value_12,    /* N => "tag"; sorted by N */
191         2,      /* Number of elements in the maps */
192         0,      /* Enumeration is not extensible */
193         1,      /* Strict enumeration */
194         0,      /* Native long size */
195         0
196 };
197 static const ber_tlv_tag_t asn_DEF_supportedCodebookMode_tags_12[] = {
198         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
199         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
200 };
201 static /* Use -fall-defs-global to expose */
202 asn_TYPE_descriptor_t asn_DEF_supportedCodebookMode_12 = {
203         "supportedCodebookMode",
204         "supportedCodebookMode",
205         &asn_OP_NativeEnumerated,
206         asn_DEF_supportedCodebookMode_tags_12,
207         sizeof(asn_DEF_supportedCodebookMode_tags_12)
208                 /sizeof(asn_DEF_supportedCodebookMode_tags_12[0]) - 1, /* 1 */
209         asn_DEF_supportedCodebookMode_tags_12,  /* Same as above */
210         sizeof(asn_DEF_supportedCodebookMode_tags_12)
211                 /sizeof(asn_DEF_supportedCodebookMode_tags_12[0]), /* 2 */
212         { &asn_OER_type_supportedCodebookMode_constr_12, &asn_PER_type_supportedCodebookMode_constr_12, NativeEnumerated_constraint },
213         0, 0,   /* Defined elsewhere */
214         &asn_SPC_supportedCodebookMode_specs_12 /* Additional specs */
215 };
216
217 asn_TYPE_member_t asn_MBR_TypeI_SinglePanelCodebook_1[] = {
218         { ATF_NOFLAGS, 0, offsetof(struct TypeI_SinglePanelCodebook, maxNumberTxPortsPerResource),
219                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
220                 -1,     /* IMPLICIT tag at current level */
221                 &asn_DEF_maxNumberTxPortsPerResource_2,
222                 0,
223                 { 0, 0, 0 },
224                 0, 0, /* No default value */
225                 "maxNumberTxPortsPerResource"
226                 },
227         { ATF_NOFLAGS, 0, offsetof(struct TypeI_SinglePanelCodebook, maxNumberResources),
228                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
229                 -1,     /* IMPLICIT tag at current level */
230                 &asn_DEF_NativeInteger,
231                 0,
232                 { &asn_OER_memb_maxNumberResources_constr_10, &asn_PER_memb_maxNumberResources_constr_10,  memb_maxNumberResources_constraint_1 },
233                 0, 0, /* No default value */
234                 "maxNumberResources"
235                 },
236         { ATF_NOFLAGS, 0, offsetof(struct TypeI_SinglePanelCodebook, totalNumberTxPorts),
237                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
238                 -1,     /* IMPLICIT tag at current level */
239                 &asn_DEF_NativeInteger,
240                 0,
241                 { &asn_OER_memb_totalNumberTxPorts_constr_11, &asn_PER_memb_totalNumberTxPorts_constr_11,  memb_totalNumberTxPorts_constraint_1 },
242                 0, 0, /* No default value */
243                 "totalNumberTxPorts"
244                 },
245         { ATF_NOFLAGS, 0, offsetof(struct TypeI_SinglePanelCodebook, supportedCodebookMode),
246                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
247                 -1,     /* IMPLICIT tag at current level */
248                 &asn_DEF_supportedCodebookMode_12,
249                 0,
250                 { 0, 0, 0 },
251                 0, 0, /* No default value */
252                 "supportedCodebookMode"
253                 },
254         { ATF_NOFLAGS, 0, offsetof(struct TypeI_SinglePanelCodebook, maxNumberCSI_RS_PerResourceSet),
255                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
256                 -1,     /* IMPLICIT tag at current level */
257                 &asn_DEF_NativeInteger,
258                 0,
259                 { &asn_OER_memb_maxNumberCSI_RS_PerResourceSet_constr_15, &asn_PER_memb_maxNumberCSI_RS_PerResourceSet_constr_15,  memb_maxNumberCSI_RS_PerResourceSet_constraint_1 },
260                 0, 0, /* No default value */
261                 "maxNumberCSI-RS-PerResourceSet"
262                 },
263 };
264 static const ber_tlv_tag_t asn_DEF_TypeI_SinglePanelCodebook_tags_1[] = {
265         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
266 };
267 static const asn_TYPE_tag2member_t asn_MAP_TypeI_SinglePanelCodebook_tag2el_1[] = {
268     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* maxNumberTxPortsPerResource */
269     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* maxNumberResources */
270     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* totalNumberTxPorts */
271     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* supportedCodebookMode */
272     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* maxNumberCSI-RS-PerResourceSet */
273 };
274 asn_SEQUENCE_specifics_t asn_SPC_TypeI_SinglePanelCodebook_specs_1 = {
275         sizeof(struct TypeI_SinglePanelCodebook),
276         offsetof(struct TypeI_SinglePanelCodebook, _asn_ctx),
277         asn_MAP_TypeI_SinglePanelCodebook_tag2el_1,
278         5,      /* Count of tags in the map */
279         0, 0, 0,        /* Optional elements (not needed) */
280         -1,     /* First extension addition */
281 };
282 asn_TYPE_descriptor_t asn_DEF_TypeI_SinglePanelCodebook = {
283         "TypeI-SinglePanelCodebook",
284         "TypeI-SinglePanelCodebook",
285         &asn_OP_SEQUENCE,
286         asn_DEF_TypeI_SinglePanelCodebook_tags_1,
287         sizeof(asn_DEF_TypeI_SinglePanelCodebook_tags_1)
288                 /sizeof(asn_DEF_TypeI_SinglePanelCodebook_tags_1[0]), /* 1 */
289         asn_DEF_TypeI_SinglePanelCodebook_tags_1,       /* Same as above */
290         sizeof(asn_DEF_TypeI_SinglePanelCodebook_tags_1)
291                 /sizeof(asn_DEF_TypeI_SinglePanelCodebook_tags_1[0]), /* 1 */
292         { 0, 0, SEQUENCE_constraint },
293         asn_MBR_TypeI_SinglePanelCodebook_1,
294         5,      /* Elements count */
295         &asn_SPC_TypeI_SinglePanelCodebook_specs_1      /* Additional specs */
296 };
297