[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / codec_utils / RRC / SlotFormatCombination.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "../ASN1_Input/rrc_15_3_asn.asn1"
5  *      `asn1c -D ../RRC_output_14Nov/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
6  */
7
8 #include "SlotFormatCombination.h"
9
10 static int
11 memb_NativeInteger_constraint_3(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         long value;
14         
15         if(!sptr) {
16                 ASN__CTFAIL(app_key, td, sptr,
17                         "%s: value not given (%s:%d)",
18                         td->name, __FILE__, __LINE__);
19                 return -1;
20         }
21         
22         value = *(const long *)sptr;
23         
24         if((value >= 0 && value <= 255)) {
25                 /* Constraint check succeeded */
26                 return 0;
27         } else {
28                 ASN__CTFAIL(app_key, td, sptr,
29                         "%s: constraint failed (%s:%d)",
30                         td->name, __FILE__, __LINE__);
31                 return -1;
32         }
33 }
34
35 static int
36 memb_slotFormats_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
37                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
38         size_t size;
39         
40         if(!sptr) {
41                 ASN__CTFAIL(app_key, td, sptr,
42                         "%s: value not given (%s:%d)",
43                         td->name, __FILE__, __LINE__);
44                 return -1;
45         }
46         
47         /* Determine the number of elements */
48         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
49         
50         if((size >= 1 && size <= 256)) {
51                 /* Perform validation of the inner elements */
52                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
53         } else {
54                 ASN__CTFAIL(app_key, td, sptr,
55                         "%s: constraint failed (%s:%d)",
56                         td->name, __FILE__, __LINE__);
57                 return -1;
58         }
59 }
60
61 static asn_oer_constraints_t asn_OER_memb_Member_constr_4 CC_NOTUSED = {
62         { 1, 1 }        /* (0..255) */,
63         -1};
64 static asn_per_constraints_t asn_PER_memb_Member_constr_4 CC_NOTUSED = {
65         { APC_CONSTRAINED,       8,  8,  0,  255 }      /* (0..255) */,
66         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
67         0, 0    /* No PER value map */
68 };
69 static asn_oer_constraints_t asn_OER_type_slotFormats_constr_3 CC_NOTUSED = {
70         { 0, 0 },
71         -1      /* (SIZE(1..256)) */};
72 static asn_per_constraints_t asn_PER_type_slotFormats_constr_3 CC_NOTUSED = {
73         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
74         { APC_CONSTRAINED,       8,  8,  1,  256 }      /* (SIZE(1..256)) */,
75         0, 0    /* No PER value map */
76 };
77 static asn_oer_constraints_t asn_OER_memb_slotFormats_constr_3 CC_NOTUSED = {
78         { 0, 0 },
79         -1      /* (SIZE(1..256)) */};
80 static asn_per_constraints_t asn_PER_memb_slotFormats_constr_3 CC_NOTUSED = {
81         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
82         { APC_CONSTRAINED,       8,  8,  1,  256 }      /* (SIZE(1..256)) */,
83         0, 0    /* No PER value map */
84 };
85 static asn_TYPE_member_t asn_MBR_slotFormats_3[] = {
86         { ATF_POINTER, 0, 0,
87                 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
88                 0,
89                 &asn_DEF_NativeInteger,
90                 0,
91                 { &asn_OER_memb_Member_constr_4, &asn_PER_memb_Member_constr_4,  memb_NativeInteger_constraint_3 },
92                 0, 0, /* No default value */
93                 ""
94                 },
95 };
96 static const ber_tlv_tag_t asn_DEF_slotFormats_tags_3[] = {
97         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
98         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
99 };
100 static asn_SET_OF_specifics_t asn_SPC_slotFormats_specs_3 = {
101         sizeof(struct SlotFormatCombination__slotFormats),
102         offsetof(struct SlotFormatCombination__slotFormats, _asn_ctx),
103         0,      /* XER encoding is XMLDelimitedItemList */
104 };
105 static /* Use -fall-defs-global to expose */
106 asn_TYPE_descriptor_t asn_DEF_slotFormats_3 = {
107         "slotFormats",
108         "slotFormats",
109         &asn_OP_SEQUENCE_OF,
110         asn_DEF_slotFormats_tags_3,
111         sizeof(asn_DEF_slotFormats_tags_3)
112                 /sizeof(asn_DEF_slotFormats_tags_3[0]) - 1, /* 1 */
113         asn_DEF_slotFormats_tags_3,     /* Same as above */
114         sizeof(asn_DEF_slotFormats_tags_3)
115                 /sizeof(asn_DEF_slotFormats_tags_3[0]), /* 2 */
116         { &asn_OER_type_slotFormats_constr_3, &asn_PER_type_slotFormats_constr_3, SEQUENCE_OF_constraint },
117         asn_MBR_slotFormats_3,
118         1,      /* Single element */
119         &asn_SPC_slotFormats_specs_3    /* Additional specs */
120 };
121
122 asn_TYPE_member_t asn_MBR_SlotFormatCombination_1[] = {
123         { ATF_NOFLAGS, 0, offsetof(struct SlotFormatCombination, slotFormatCombinationId),
124                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
125                 -1,     /* IMPLICIT tag at current level */
126                 &asn_DEF_SlotFormatCombinationId,
127                 0,
128                 { 0, 0, 0 },
129                 0, 0, /* No default value */
130                 "slotFormatCombinationId"
131                 },
132         { ATF_NOFLAGS, 0, offsetof(struct SlotFormatCombination, slotFormats),
133                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
134                 0,
135                 &asn_DEF_slotFormats_3,
136                 0,
137                 { &asn_OER_memb_slotFormats_constr_3, &asn_PER_memb_slotFormats_constr_3,  memb_slotFormats_constraint_1 },
138                 0, 0, /* No default value */
139                 "slotFormats"
140                 },
141 };
142 static const ber_tlv_tag_t asn_DEF_SlotFormatCombination_tags_1[] = {
143         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
144 };
145 static const asn_TYPE_tag2member_t asn_MAP_SlotFormatCombination_tag2el_1[] = {
146     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* slotFormatCombinationId */
147     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* slotFormats */
148 };
149 asn_SEQUENCE_specifics_t asn_SPC_SlotFormatCombination_specs_1 = {
150         sizeof(struct SlotFormatCombination),
151         offsetof(struct SlotFormatCombination, _asn_ctx),
152         asn_MAP_SlotFormatCombination_tag2el_1,
153         2,      /* Count of tags in the map */
154         0, 0, 0,        /* Optional elements (not needed) */
155         -1,     /* First extension addition */
156 };
157 asn_TYPE_descriptor_t asn_DEF_SlotFormatCombination = {
158         "SlotFormatCombination",
159         "SlotFormatCombination",
160         &asn_OP_SEQUENCE,
161         asn_DEF_SlotFormatCombination_tags_1,
162         sizeof(asn_DEF_SlotFormatCombination_tags_1)
163                 /sizeof(asn_DEF_SlotFormatCombination_tags_1[0]), /* 1 */
164         asn_DEF_SlotFormatCombination_tags_1,   /* Same as above */
165         sizeof(asn_DEF_SlotFormatCombination_tags_1)
166                 /sizeof(asn_DEF_SlotFormatCombination_tags_1[0]), /* 1 */
167         { 0, 0, SEQUENCE_constraint },
168         asn_MBR_SlotFormatCombination_1,
169         2,      /* Elements count */
170         &asn_SPC_SlotFormatCombination_specs_1  /* Additional specs */
171 };
172