[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-441]: Update name of Paging RRC Codec
[o-du/l2.git] / src / codec_utils / RRC / EUTRA-MBSFN-SubframeConfig.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 "EUTRA-MBSFN-SubframeConfig.h"
9
10 /*
11  * This type is implemented using NativeEnumerated,
12  * so here we adjust the DEF accordingly.
13  */
14 static int
15 memb_oneFrame_constraint_10(const asn_TYPE_descriptor_t *td, const void *sptr,
16                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
17         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
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         if(st->size > 0) {
28                 /* Size in bits */
29                 size = 8 * st->size - (st->bits_unused & 0x07);
30         } else {
31                 size = 0;
32         }
33         
34         if((size == 6)) {
35                 /* Constraint check succeeded */
36                 return 0;
37         } else {
38                 ASN__CTFAIL(app_key, td, sptr,
39                         "%s: constraint failed (%s:%d)",
40                         td->name, __FILE__, __LINE__);
41                 return -1;
42         }
43 }
44
45 static int
46 memb_fourFrames_constraint_10(const asn_TYPE_descriptor_t *td, const void *sptr,
47                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
48         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
49         size_t size;
50         
51         if(!sptr) {
52                 ASN__CTFAIL(app_key, td, sptr,
53                         "%s: value not given (%s:%d)",
54                         td->name, __FILE__, __LINE__);
55                 return -1;
56         }
57         
58         if(st->size > 0) {
59                 /* Size in bits */
60                 size = 8 * st->size - (st->bits_unused & 0x07);
61         } else {
62                 size = 0;
63         }
64         
65         if((size == 24)) {
66                 /* Constraint check succeeded */
67                 return 0;
68         } else {
69                 ASN__CTFAIL(app_key, td, sptr,
70                         "%s: constraint failed (%s:%d)",
71                         td->name, __FILE__, __LINE__);
72                 return -1;
73         }
74 }
75
76 static int
77 memb_oneFrame_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
78                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
79         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
80         size_t size;
81         
82         if(!sptr) {
83                 ASN__CTFAIL(app_key, td, sptr,
84                         "%s: value not given (%s:%d)",
85                         td->name, __FILE__, __LINE__);
86                 return -1;
87         }
88         
89         if(st->size > 0) {
90                 /* Size in bits */
91                 size = 8 * st->size - (st->bits_unused & 0x07);
92         } else {
93                 size = 0;
94         }
95         
96         if((size == 2)) {
97                 /* Constraint check succeeded */
98                 return 0;
99         } else {
100                 ASN__CTFAIL(app_key, td, sptr,
101                         "%s: constraint failed (%s:%d)",
102                         td->name, __FILE__, __LINE__);
103                 return -1;
104         }
105 }
106
107 static int
108 memb_fourFrames_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
109                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
110         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
111         size_t size;
112         
113         if(!sptr) {
114                 ASN__CTFAIL(app_key, td, sptr,
115                         "%s: value not given (%s:%d)",
116                         td->name, __FILE__, __LINE__);
117                 return -1;
118         }
119         
120         if(st->size > 0) {
121                 /* Size in bits */
122                 size = 8 * st->size - (st->bits_unused & 0x07);
123         } else {
124                 size = 0;
125         }
126         
127         if((size == 8)) {
128                 /* Constraint check succeeded */
129                 return 0;
130         } else {
131                 ASN__CTFAIL(app_key, td, sptr,
132                         "%s: constraint failed (%s:%d)",
133                         td->name, __FILE__, __LINE__);
134                 return -1;
135         }
136 }
137
138 static int
139 memb_radioframeAllocationOffset_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
140                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
141         long value;
142         
143         if(!sptr) {
144                 ASN__CTFAIL(app_key, td, sptr,
145                         "%s: value not given (%s:%d)",
146                         td->name, __FILE__, __LINE__);
147                 return -1;
148         }
149         
150         value = *(const long *)sptr;
151         
152         if((value >= 0 && value <= 7)) {
153                 /* Constraint check succeeded */
154                 return 0;
155         } else {
156                 ASN__CTFAIL(app_key, td, sptr,
157                         "%s: constraint failed (%s:%d)",
158                         td->name, __FILE__, __LINE__);
159                 return -1;
160         }
161 }
162
163 static asn_oer_constraints_t asn_OER_type_radioframeAllocationPeriod_constr_2 CC_NOTUSED = {
164         { 0, 0 },
165         -1};
166 static asn_per_constraints_t asn_PER_type_radioframeAllocationPeriod_constr_2 CC_NOTUSED = {
167         { APC_CONSTRAINED,       3,  3,  0,  5 }        /* (0..5) */,
168         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
169         0, 0    /* No PER value map */
170 };
171 static asn_oer_constraints_t asn_OER_memb_oneFrame_constr_11 CC_NOTUSED = {
172         { 0, 0 },
173         6       /* (SIZE(6..6)) */};
174 static asn_per_constraints_t asn_PER_memb_oneFrame_constr_11 CC_NOTUSED = {
175         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
176         { APC_CONSTRAINED,       0,  0,  6,  6 }        /* (SIZE(6..6)) */,
177         0, 0    /* No PER value map */
178 };
179 static asn_oer_constraints_t asn_OER_memb_fourFrames_constr_12 CC_NOTUSED = {
180         { 0, 0 },
181         24      /* (SIZE(24..24)) */};
182 static asn_per_constraints_t asn_PER_memb_fourFrames_constr_12 CC_NOTUSED = {
183         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
184         { APC_CONSTRAINED,       0,  0,  24,  24 }      /* (SIZE(24..24)) */,
185         0, 0    /* No PER value map */
186 };
187 static asn_oer_constraints_t asn_OER_type_subframeAllocation1_constr_10 CC_NOTUSED = {
188         { 0, 0 },
189         -1};
190 static asn_per_constraints_t asn_PER_type_subframeAllocation1_constr_10 CC_NOTUSED = {
191         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
192         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
193         0, 0    /* No PER value map */
194 };
195 static asn_oer_constraints_t asn_OER_memb_oneFrame_constr_14 CC_NOTUSED = {
196         { 0, 0 },
197         2       /* (SIZE(2..2)) */};
198 static asn_per_constraints_t asn_PER_memb_oneFrame_constr_14 CC_NOTUSED = {
199         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
200         { APC_CONSTRAINED,       0,  0,  2,  2 }        /* (SIZE(2..2)) */,
201         0, 0    /* No PER value map */
202 };
203 static asn_oer_constraints_t asn_OER_memb_fourFrames_constr_15 CC_NOTUSED = {
204         { 0, 0 },
205         8       /* (SIZE(8..8)) */};
206 static asn_per_constraints_t asn_PER_memb_fourFrames_constr_15 CC_NOTUSED = {
207         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
208         { APC_CONSTRAINED,       0,  0,  8,  8 }        /* (SIZE(8..8)) */,
209         0, 0    /* No PER value map */
210 };
211 static asn_oer_constraints_t asn_OER_type_subframeAllocation2_constr_13 CC_NOTUSED = {
212         { 0, 0 },
213         -1};
214 static asn_per_constraints_t asn_PER_type_subframeAllocation2_constr_13 CC_NOTUSED = {
215         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
216         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
217         0, 0    /* No PER value map */
218 };
219 static asn_oer_constraints_t asn_OER_memb_radioframeAllocationOffset_constr_9 CC_NOTUSED = {
220         { 1, 1 }        /* (0..7) */,
221         -1};
222 static asn_per_constraints_t asn_PER_memb_radioframeAllocationOffset_constr_9 CC_NOTUSED = {
223         { APC_CONSTRAINED,       3,  3,  0,  7 }        /* (0..7) */,
224         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
225         0, 0    /* No PER value map */
226 };
227 static const asn_INTEGER_enum_map_t asn_MAP_radioframeAllocationPeriod_value2enum_2[] = {
228         { 0,    2,      "n1" },
229         { 1,    2,      "n2" },
230         { 2,    2,      "n4" },
231         { 3,    2,      "n8" },
232         { 4,    3,      "n16" },
233         { 5,    3,      "n32" }
234 };
235 static const unsigned int asn_MAP_radioframeAllocationPeriod_enum2value_2[] = {
236         0,      /* n1(0) */
237         4,      /* n16(4) */
238         1,      /* n2(1) */
239         5,      /* n32(5) */
240         2,      /* n4(2) */
241         3       /* n8(3) */
242 };
243 static const asn_INTEGER_specifics_t asn_SPC_radioframeAllocationPeriod_specs_2 = {
244         asn_MAP_radioframeAllocationPeriod_value2enum_2,        /* "tag" => N; sorted by tag */
245         asn_MAP_radioframeAllocationPeriod_enum2value_2,        /* N => "tag"; sorted by N */
246         6,      /* Number of elements in the maps */
247         0,      /* Enumeration is not extensible */
248         1,      /* Strict enumeration */
249         0,      /* Native long size */
250         0
251 };
252 static const ber_tlv_tag_t asn_DEF_radioframeAllocationPeriod_tags_2[] = {
253         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
254         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
255 };
256 static /* Use -fall-defs-global to expose */
257 asn_TYPE_descriptor_t asn_DEF_radioframeAllocationPeriod_2 = {
258         "radioframeAllocationPeriod",
259         "radioframeAllocationPeriod",
260         &asn_OP_NativeEnumerated,
261         asn_DEF_radioframeAllocationPeriod_tags_2,
262         sizeof(asn_DEF_radioframeAllocationPeriod_tags_2)
263                 /sizeof(asn_DEF_radioframeAllocationPeriod_tags_2[0]) - 1, /* 1 */
264         asn_DEF_radioframeAllocationPeriod_tags_2,      /* Same as above */
265         sizeof(asn_DEF_radioframeAllocationPeriod_tags_2)
266                 /sizeof(asn_DEF_radioframeAllocationPeriod_tags_2[0]), /* 2 */
267         { &asn_OER_type_radioframeAllocationPeriod_constr_2, &asn_PER_type_radioframeAllocationPeriod_constr_2, NativeEnumerated_constraint },
268         0, 0,   /* Defined elsewhere */
269         &asn_SPC_radioframeAllocationPeriod_specs_2     /* Additional specs */
270 };
271
272 static asn_TYPE_member_t asn_MBR_subframeAllocation1_10[] = {
273         { ATF_NOFLAGS, 0, offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation1, choice.oneFrame),
274                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
275                 -1,     /* IMPLICIT tag at current level */
276                 &asn_DEF_BIT_STRING,
277                 0,
278                 { &asn_OER_memb_oneFrame_constr_11, &asn_PER_memb_oneFrame_constr_11,  memb_oneFrame_constraint_10 },
279                 0, 0, /* No default value */
280                 "oneFrame"
281                 },
282         { ATF_NOFLAGS, 0, offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation1, choice.fourFrames),
283                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
284                 -1,     /* IMPLICIT tag at current level */
285                 &asn_DEF_BIT_STRING,
286                 0,
287                 { &asn_OER_memb_fourFrames_constr_12, &asn_PER_memb_fourFrames_constr_12,  memb_fourFrames_constraint_10 },
288                 0, 0, /* No default value */
289                 "fourFrames"
290                 },
291 };
292 static const asn_TYPE_tag2member_t asn_MAP_subframeAllocation1_tag2el_10[] = {
293     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* oneFrame */
294     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* fourFrames */
295 };
296 static asn_CHOICE_specifics_t asn_SPC_subframeAllocation1_specs_10 = {
297         sizeof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation1),
298         offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation1, _asn_ctx),
299         offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation1, present),
300         sizeof(((struct EUTRA_MBSFN_SubframeConfig__subframeAllocation1 *)0)->present),
301         asn_MAP_subframeAllocation1_tag2el_10,
302         2,      /* Count of tags in the map */
303         0, 0,
304         -1      /* Extensions start */
305 };
306 static /* Use -fall-defs-global to expose */
307 asn_TYPE_descriptor_t asn_DEF_subframeAllocation1_10 = {
308         "subframeAllocation1",
309         "subframeAllocation1",
310         &asn_OP_CHOICE,
311         0,      /* No effective tags (pointer) */
312         0,      /* No effective tags (count) */
313         0,      /* No tags (pointer) */
314         0,      /* No tags (count) */
315         { &asn_OER_type_subframeAllocation1_constr_10, &asn_PER_type_subframeAllocation1_constr_10, CHOICE_constraint },
316         asn_MBR_subframeAllocation1_10,
317         2,      /* Elements count */
318         &asn_SPC_subframeAllocation1_specs_10   /* Additional specs */
319 };
320
321 static asn_TYPE_member_t asn_MBR_subframeAllocation2_13[] = {
322         { ATF_NOFLAGS, 0, offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation2, choice.oneFrame),
323                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
324                 -1,     /* IMPLICIT tag at current level */
325                 &asn_DEF_BIT_STRING,
326                 0,
327                 { &asn_OER_memb_oneFrame_constr_14, &asn_PER_memb_oneFrame_constr_14,  memb_oneFrame_constraint_13 },
328                 0, 0, /* No default value */
329                 "oneFrame"
330                 },
331         { ATF_NOFLAGS, 0, offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation2, choice.fourFrames),
332                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
333                 -1,     /* IMPLICIT tag at current level */
334                 &asn_DEF_BIT_STRING,
335                 0,
336                 { &asn_OER_memb_fourFrames_constr_15, &asn_PER_memb_fourFrames_constr_15,  memb_fourFrames_constraint_13 },
337                 0, 0, /* No default value */
338                 "fourFrames"
339                 },
340 };
341 static const asn_TYPE_tag2member_t asn_MAP_subframeAllocation2_tag2el_13[] = {
342     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* oneFrame */
343     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* fourFrames */
344 };
345 static asn_CHOICE_specifics_t asn_SPC_subframeAllocation2_specs_13 = {
346         sizeof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation2),
347         offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation2, _asn_ctx),
348         offsetof(struct EUTRA_MBSFN_SubframeConfig__subframeAllocation2, present),
349         sizeof(((struct EUTRA_MBSFN_SubframeConfig__subframeAllocation2 *)0)->present),
350         asn_MAP_subframeAllocation2_tag2el_13,
351         2,      /* Count of tags in the map */
352         0, 0,
353         -1      /* Extensions start */
354 };
355 static /* Use -fall-defs-global to expose */
356 asn_TYPE_descriptor_t asn_DEF_subframeAllocation2_13 = {
357         "subframeAllocation2",
358         "subframeAllocation2",
359         &asn_OP_CHOICE,
360         0,      /* No effective tags (pointer) */
361         0,      /* No effective tags (count) */
362         0,      /* No tags (pointer) */
363         0,      /* No tags (count) */
364         { &asn_OER_type_subframeAllocation2_constr_13, &asn_PER_type_subframeAllocation2_constr_13, CHOICE_constraint },
365         asn_MBR_subframeAllocation2_13,
366         2,      /* Elements count */
367         &asn_SPC_subframeAllocation2_specs_13   /* Additional specs */
368 };
369
370 asn_TYPE_member_t asn_MBR_EUTRA_MBSFN_SubframeConfig_1[] = {
371         { ATF_NOFLAGS, 0, offsetof(struct EUTRA_MBSFN_SubframeConfig, radioframeAllocationPeriod),
372                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
373                 -1,     /* IMPLICIT tag at current level */
374                 &asn_DEF_radioframeAllocationPeriod_2,
375                 0,
376                 { 0, 0, 0 },
377                 0, 0, /* No default value */
378                 "radioframeAllocationPeriod"
379                 },
380         { ATF_NOFLAGS, 0, offsetof(struct EUTRA_MBSFN_SubframeConfig, radioframeAllocationOffset),
381                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
382                 -1,     /* IMPLICIT tag at current level */
383                 &asn_DEF_NativeInteger,
384                 0,
385                 { &asn_OER_memb_radioframeAllocationOffset_constr_9, &asn_PER_memb_radioframeAllocationOffset_constr_9,  memb_radioframeAllocationOffset_constraint_1 },
386                 0, 0, /* No default value */
387                 "radioframeAllocationOffset"
388                 },
389         { ATF_NOFLAGS, 0, offsetof(struct EUTRA_MBSFN_SubframeConfig, subframeAllocation1),
390                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
391                 +1,     /* EXPLICIT tag at current level */
392                 &asn_DEF_subframeAllocation1_10,
393                 0,
394                 { 0, 0, 0 },
395                 0, 0, /* No default value */
396                 "subframeAllocation1"
397                 },
398         { ATF_POINTER, 1, offsetof(struct EUTRA_MBSFN_SubframeConfig, subframeAllocation2),
399                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
400                 +1,     /* EXPLICIT tag at current level */
401                 &asn_DEF_subframeAllocation2_13,
402                 0,
403                 { 0, 0, 0 },
404                 0, 0, /* No default value */
405                 "subframeAllocation2"
406                 },
407 };
408 static const int asn_MAP_EUTRA_MBSFN_SubframeConfig_oms_1[] = { 3 };
409 static const ber_tlv_tag_t asn_DEF_EUTRA_MBSFN_SubframeConfig_tags_1[] = {
410         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
411 };
412 static const asn_TYPE_tag2member_t asn_MAP_EUTRA_MBSFN_SubframeConfig_tag2el_1[] = {
413     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* radioframeAllocationPeriod */
414     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* radioframeAllocationOffset */
415     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* subframeAllocation1 */
416     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* subframeAllocation2 */
417 };
418 asn_SEQUENCE_specifics_t asn_SPC_EUTRA_MBSFN_SubframeConfig_specs_1 = {
419         sizeof(struct EUTRA_MBSFN_SubframeConfig),
420         offsetof(struct EUTRA_MBSFN_SubframeConfig, _asn_ctx),
421         asn_MAP_EUTRA_MBSFN_SubframeConfig_tag2el_1,
422         4,      /* Count of tags in the map */
423         asn_MAP_EUTRA_MBSFN_SubframeConfig_oms_1,       /* Optional members */
424         1, 0,   /* Root/Additions */
425         4,      /* First extension addition */
426 };
427 asn_TYPE_descriptor_t asn_DEF_EUTRA_MBSFN_SubframeConfig = {
428         "EUTRA-MBSFN-SubframeConfig",
429         "EUTRA-MBSFN-SubframeConfig",
430         &asn_OP_SEQUENCE,
431         asn_DEF_EUTRA_MBSFN_SubframeConfig_tags_1,
432         sizeof(asn_DEF_EUTRA_MBSFN_SubframeConfig_tags_1)
433                 /sizeof(asn_DEF_EUTRA_MBSFN_SubframeConfig_tags_1[0]), /* 1 */
434         asn_DEF_EUTRA_MBSFN_SubframeConfig_tags_1,      /* Same as above */
435         sizeof(asn_DEF_EUTRA_MBSFN_SubframeConfig_tags_1)
436                 /sizeof(asn_DEF_EUTRA_MBSFN_SubframeConfig_tags_1[0]), /* 1 */
437         { 0, 0, SEQUENCE_constraint },
438         asn_MBR_EUTRA_MBSFN_SubframeConfig_1,
439         4,      /* Elements count */
440         &asn_SPC_EUTRA_MBSFN_SubframeConfig_specs_1     /* Additional specs */
441 };
442