[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-441]: Update name of Paging RRC Codec
[o-du/l2.git] / src / codec_utils / RRC / SRS-CarrierSwitching.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "./22April22_Paging/rrc_15.3_asn.asn1"
5  *      `asn1c -D ./22April22_Paging -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "SRS-CarrierSwitching.h"
9
10 #include "SRS-TPC-PDCCH-Config.h"
11 /*
12  * This type is implemented using NativeEnumerated,
13  * so here we adjust the DEF accordingly.
14  */
15 static int
16 memb_typeA_constraint_6(const asn_TYPE_descriptor_t *td, const void *sptr,
17                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
18         size_t size;
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         /* Determine the number of elements */
28         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
29         
30         if((size >= 1 && size <= 32)) {
31                 /* Perform validation of the inner elements */
32                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
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 static int
42 memb_srs_SwitchFromServCellIndex_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
43                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44         long value;
45         
46         if(!sptr) {
47                 ASN__CTFAIL(app_key, td, sptr,
48                         "%s: value not given (%s:%d)",
49                         td->name, __FILE__, __LINE__);
50                 return -1;
51         }
52         
53         value = *(const long *)sptr;
54         
55         if((value >= 0 && value <= 31)) {
56                 /* Constraint check succeeded */
57                 return 0;
58         } else {
59                 ASN__CTFAIL(app_key, td, sptr,
60                         "%s: constraint failed (%s:%d)",
61                         td->name, __FILE__, __LINE__);
62                 return -1;
63         }
64 }
65
66 static int
67 memb_monitoringCells_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
68                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
69         size_t size;
70         
71         if(!sptr) {
72                 ASN__CTFAIL(app_key, td, sptr,
73                         "%s: value not given (%s:%d)",
74                         td->name, __FILE__, __LINE__);
75                 return -1;
76         }
77         
78         /* Determine the number of elements */
79         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
80         
81         if((size >= 1 && size <= 32)) {
82                 /* Perform validation of the inner elements */
83                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
84         } else {
85                 ASN__CTFAIL(app_key, td, sptr,
86                         "%s: constraint failed (%s:%d)",
87                         td->name, __FILE__, __LINE__);
88                 return -1;
89         }
90 }
91
92 static asn_oer_constraints_t asn_OER_type_srs_SwitchFromCarrier_constr_3 CC_NOTUSED = {
93         { 0, 0 },
94         -1};
95 static asn_per_constraints_t asn_PER_type_srs_SwitchFromCarrier_constr_3 CC_NOTUSED = {
96         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
97         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
98         0, 0    /* No PER value map */
99 };
100 static asn_oer_constraints_t asn_OER_type_typeA_constr_7 CC_NOTUSED = {
101         { 0, 0 },
102         -1      /* (SIZE(1..32)) */};
103 static asn_per_constraints_t asn_PER_type_typeA_constr_7 CC_NOTUSED = {
104         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
105         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
106         0, 0    /* No PER value map */
107 };
108 static asn_oer_constraints_t asn_OER_memb_typeA_constr_7 CC_NOTUSED = {
109         { 0, 0 },
110         -1      /* (SIZE(1..32)) */};
111 static asn_per_constraints_t asn_PER_memb_typeA_constr_7 CC_NOTUSED = {
112         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
113         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
114         0, 0    /* No PER value map */
115 };
116 static asn_oer_constraints_t asn_OER_type_srs_TPC_PDCCH_Group_constr_6 CC_NOTUSED = {
117         { 0, 0 },
118         -1};
119 static asn_per_constraints_t asn_PER_type_srs_TPC_PDCCH_Group_constr_6 CC_NOTUSED = {
120         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
121         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
122         0, 0    /* No PER value map */
123 };
124 static asn_oer_constraints_t asn_OER_type_monitoringCells_constr_10 CC_NOTUSED = {
125         { 0, 0 },
126         -1      /* (SIZE(1..32)) */};
127 static asn_per_constraints_t asn_PER_type_monitoringCells_constr_10 CC_NOTUSED = {
128         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
129         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
130         0, 0    /* No PER value map */
131 };
132 static asn_oer_constraints_t asn_OER_memb_srs_SwitchFromServCellIndex_constr_2 CC_NOTUSED = {
133         { 1, 1 }        /* (0..31) */,
134         -1};
135 static asn_per_constraints_t asn_PER_memb_srs_SwitchFromServCellIndex_constr_2 CC_NOTUSED = {
136         { APC_CONSTRAINED,       5,  5,  0,  31 }       /* (0..31) */,
137         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
138         0, 0    /* No PER value map */
139 };
140 static asn_oer_constraints_t asn_OER_memb_monitoringCells_constr_10 CC_NOTUSED = {
141         { 0, 0 },
142         -1      /* (SIZE(1..32)) */};
143 static asn_per_constraints_t asn_PER_memb_monitoringCells_constr_10 CC_NOTUSED = {
144         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
145         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
146         0, 0    /* No PER value map */
147 };
148 static const asn_INTEGER_enum_map_t asn_MAP_srs_SwitchFromCarrier_value2enum_3[] = {
149         { 0,    3,      "sUL" },
150         { 1,    3,      "nUL" }
151 };
152 static const unsigned int asn_MAP_srs_SwitchFromCarrier_enum2value_3[] = {
153         1,      /* nUL(1) */
154         0       /* sUL(0) */
155 };
156 static const asn_INTEGER_specifics_t asn_SPC_srs_SwitchFromCarrier_specs_3 = {
157         asn_MAP_srs_SwitchFromCarrier_value2enum_3,     /* "tag" => N; sorted by tag */
158         asn_MAP_srs_SwitchFromCarrier_enum2value_3,     /* N => "tag"; sorted by N */
159         2,      /* Number of elements in the maps */
160         0,      /* Enumeration is not extensible */
161         1,      /* Strict enumeration */
162         0,      /* Native long size */
163         0
164 };
165 static const ber_tlv_tag_t asn_DEF_srs_SwitchFromCarrier_tags_3[] = {
166         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
167         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
168 };
169 static /* Use -fall-defs-global to expose */
170 asn_TYPE_descriptor_t asn_DEF_srs_SwitchFromCarrier_3 = {
171         "srs-SwitchFromCarrier",
172         "srs-SwitchFromCarrier",
173         &asn_OP_NativeEnumerated,
174         asn_DEF_srs_SwitchFromCarrier_tags_3,
175         sizeof(asn_DEF_srs_SwitchFromCarrier_tags_3)
176                 /sizeof(asn_DEF_srs_SwitchFromCarrier_tags_3[0]) - 1, /* 1 */
177         asn_DEF_srs_SwitchFromCarrier_tags_3,   /* Same as above */
178         sizeof(asn_DEF_srs_SwitchFromCarrier_tags_3)
179                 /sizeof(asn_DEF_srs_SwitchFromCarrier_tags_3[0]), /* 2 */
180         { &asn_OER_type_srs_SwitchFromCarrier_constr_3, &asn_PER_type_srs_SwitchFromCarrier_constr_3, NativeEnumerated_constraint },
181         0, 0,   /* Defined elsewhere */
182         &asn_SPC_srs_SwitchFromCarrier_specs_3  /* Additional specs */
183 };
184
185 static asn_TYPE_member_t asn_MBR_typeA_7[] = {
186         { ATF_POINTER, 0, 0,
187                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
188                 0,
189                 &asn_DEF_SRS_TPC_PDCCH_Config,
190                 0,
191                 { 0, 0, 0 },
192                 0, 0, /* No default value */
193                 ""
194                 },
195 };
196 static const ber_tlv_tag_t asn_DEF_typeA_tags_7[] = {
197         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
198         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
199 };
200 static asn_SET_OF_specifics_t asn_SPC_typeA_specs_7 = {
201         sizeof(struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group__typeA),
202         offsetof(struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group__typeA, _asn_ctx),
203         0,      /* XER encoding is XMLDelimitedItemList */
204 };
205 static /* Use -fall-defs-global to expose */
206 asn_TYPE_descriptor_t asn_DEF_typeA_7 = {
207         "typeA",
208         "typeA",
209         &asn_OP_SEQUENCE_OF,
210         asn_DEF_typeA_tags_7,
211         sizeof(asn_DEF_typeA_tags_7)
212                 /sizeof(asn_DEF_typeA_tags_7[0]) - 1, /* 1 */
213         asn_DEF_typeA_tags_7,   /* Same as above */
214         sizeof(asn_DEF_typeA_tags_7)
215                 /sizeof(asn_DEF_typeA_tags_7[0]), /* 2 */
216         { &asn_OER_type_typeA_constr_7, &asn_PER_type_typeA_constr_7, SEQUENCE_OF_constraint },
217         asn_MBR_typeA_7,
218         1,      /* Single element */
219         &asn_SPC_typeA_specs_7  /* Additional specs */
220 };
221
222 static asn_TYPE_member_t asn_MBR_srs_TPC_PDCCH_Group_6[] = {
223         { ATF_POINTER, 0, offsetof(struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group, choice.typeA),
224                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
225                 0,
226                 &asn_DEF_typeA_7,
227                 0,
228                 { &asn_OER_memb_typeA_constr_7, &asn_PER_memb_typeA_constr_7,  memb_typeA_constraint_6 },
229                 0, 0, /* No default value */
230                 "typeA"
231                 },
232         { ATF_POINTER, 0, offsetof(struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group, choice.typeB),
233                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
234                 -1,     /* IMPLICIT tag at current level */
235                 &asn_DEF_SRS_TPC_PDCCH_Config,
236                 0,
237                 { 0, 0, 0 },
238                 0, 0, /* No default value */
239                 "typeB"
240                 },
241 };
242 static const asn_TYPE_tag2member_t asn_MAP_srs_TPC_PDCCH_Group_tag2el_6[] = {
243     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* typeA */
244     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* typeB */
245 };
246 static asn_CHOICE_specifics_t asn_SPC_srs_TPC_PDCCH_Group_specs_6 = {
247         sizeof(struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group),
248         offsetof(struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group, _asn_ctx),
249         offsetof(struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group, present),
250         sizeof(((struct SRS_CarrierSwitching__srs_TPC_PDCCH_Group *)0)->present),
251         asn_MAP_srs_TPC_PDCCH_Group_tag2el_6,
252         2,      /* Count of tags in the map */
253         0, 0,
254         -1      /* Extensions start */
255 };
256 static /* Use -fall-defs-global to expose */
257 asn_TYPE_descriptor_t asn_DEF_srs_TPC_PDCCH_Group_6 = {
258         "srs-TPC-PDCCH-Group",
259         "srs-TPC-PDCCH-Group",
260         &asn_OP_CHOICE,
261         0,      /* No effective tags (pointer) */
262         0,      /* No effective tags (count) */
263         0,      /* No tags (pointer) */
264         0,      /* No tags (count) */
265         { &asn_OER_type_srs_TPC_PDCCH_Group_constr_6, &asn_PER_type_srs_TPC_PDCCH_Group_constr_6, CHOICE_constraint },
266         asn_MBR_srs_TPC_PDCCH_Group_6,
267         2,      /* Elements count */
268         &asn_SPC_srs_TPC_PDCCH_Group_specs_6    /* Additional specs */
269 };
270
271 static asn_TYPE_member_t asn_MBR_monitoringCells_10[] = {
272         { ATF_POINTER, 0, 0,
273                 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
274                 0,
275                 &asn_DEF_ServCellIndex,
276                 0,
277                 { 0, 0, 0 },
278                 0, 0, /* No default value */
279                 ""
280                 },
281 };
282 static const ber_tlv_tag_t asn_DEF_monitoringCells_tags_10[] = {
283         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
284         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
285 };
286 static asn_SET_OF_specifics_t asn_SPC_monitoringCells_specs_10 = {
287         sizeof(struct SRS_CarrierSwitching__monitoringCells),
288         offsetof(struct SRS_CarrierSwitching__monitoringCells, _asn_ctx),
289         0,      /* XER encoding is XMLDelimitedItemList */
290 };
291 static /* Use -fall-defs-global to expose */
292 asn_TYPE_descriptor_t asn_DEF_monitoringCells_10 = {
293         "monitoringCells",
294         "monitoringCells",
295         &asn_OP_SEQUENCE_OF,
296         asn_DEF_monitoringCells_tags_10,
297         sizeof(asn_DEF_monitoringCells_tags_10)
298                 /sizeof(asn_DEF_monitoringCells_tags_10[0]) - 1, /* 1 */
299         asn_DEF_monitoringCells_tags_10,        /* Same as above */
300         sizeof(asn_DEF_monitoringCells_tags_10)
301                 /sizeof(asn_DEF_monitoringCells_tags_10[0]), /* 2 */
302         { &asn_OER_type_monitoringCells_constr_10, &asn_PER_type_monitoringCells_constr_10, SEQUENCE_OF_constraint },
303         asn_MBR_monitoringCells_10,
304         1,      /* Single element */
305         &asn_SPC_monitoringCells_specs_10       /* Additional specs */
306 };
307
308 asn_TYPE_member_t asn_MBR_SRS_CarrierSwitching_1[] = {
309         { ATF_POINTER, 1, offsetof(struct SRS_CarrierSwitching, srs_SwitchFromServCellIndex),
310                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
311                 -1,     /* IMPLICIT tag at current level */
312                 &asn_DEF_NativeInteger,
313                 0,
314                 { &asn_OER_memb_srs_SwitchFromServCellIndex_constr_2, &asn_PER_memb_srs_SwitchFromServCellIndex_constr_2,  memb_srs_SwitchFromServCellIndex_constraint_1 },
315                 0, 0, /* No default value */
316                 "srs-SwitchFromServCellIndex"
317                 },
318         { ATF_NOFLAGS, 0, offsetof(struct SRS_CarrierSwitching, srs_SwitchFromCarrier),
319                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
320                 -1,     /* IMPLICIT tag at current level */
321                 &asn_DEF_srs_SwitchFromCarrier_3,
322                 0,
323                 { 0, 0, 0 },
324                 0, 0, /* No default value */
325                 "srs-SwitchFromCarrier"
326                 },
327         { ATF_POINTER, 2, offsetof(struct SRS_CarrierSwitching, srs_TPC_PDCCH_Group),
328                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
329                 +1,     /* EXPLICIT tag at current level */
330                 &asn_DEF_srs_TPC_PDCCH_Group_6,
331                 0,
332                 { 0, 0, 0 },
333                 0, 0, /* No default value */
334                 "srs-TPC-PDCCH-Group"
335                 },
336         { ATF_POINTER, 1, offsetof(struct SRS_CarrierSwitching, monitoringCells),
337                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
338                 0,
339                 &asn_DEF_monitoringCells_10,
340                 0,
341                 { &asn_OER_memb_monitoringCells_constr_10, &asn_PER_memb_monitoringCells_constr_10,  memb_monitoringCells_constraint_1 },
342                 0, 0, /* No default value */
343                 "monitoringCells"
344                 },
345 };
346 static const int asn_MAP_SRS_CarrierSwitching_oms_1[] = { 0, 2, 3 };
347 static const ber_tlv_tag_t asn_DEF_SRS_CarrierSwitching_tags_1[] = {
348         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
349 };
350 static const asn_TYPE_tag2member_t asn_MAP_SRS_CarrierSwitching_tag2el_1[] = {
351     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* srs-SwitchFromServCellIndex */
352     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* srs-SwitchFromCarrier */
353     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* srs-TPC-PDCCH-Group */
354     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* monitoringCells */
355 };
356 asn_SEQUENCE_specifics_t asn_SPC_SRS_CarrierSwitching_specs_1 = {
357         sizeof(struct SRS_CarrierSwitching),
358         offsetof(struct SRS_CarrierSwitching, _asn_ctx),
359         asn_MAP_SRS_CarrierSwitching_tag2el_1,
360         4,      /* Count of tags in the map */
361         asn_MAP_SRS_CarrierSwitching_oms_1,     /* Optional members */
362         3, 0,   /* Root/Additions */
363         4,      /* First extension addition */
364 };
365 asn_TYPE_descriptor_t asn_DEF_SRS_CarrierSwitching = {
366         "SRS-CarrierSwitching",
367         "SRS-CarrierSwitching",
368         &asn_OP_SEQUENCE,
369         asn_DEF_SRS_CarrierSwitching_tags_1,
370         sizeof(asn_DEF_SRS_CarrierSwitching_tags_1)
371                 /sizeof(asn_DEF_SRS_CarrierSwitching_tags_1[0]), /* 1 */
372         asn_DEF_SRS_CarrierSwitching_tags_1,    /* Same as above */
373         sizeof(asn_DEF_SRS_CarrierSwitching_tags_1)
374                 /sizeof(asn_DEF_SRS_CarrierSwitching_tags_1[0]), /* 1 */
375         { 0, 0, SEQUENCE_constraint },
376         asn_MBR_SRS_CarrierSwitching_1,
377         4,      /* Elements count */
378         &asn_SPC_SRS_CarrierSwitching_specs_1   /* Additional specs */
379 };
380