[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / codec_utils / RRC / DownlinkPreemption.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 "DownlinkPreemption.h"
9
10 #include "INT-ConfigurationPerServingCell.h"
11 /*
12  * This type is implemented using NativeEnumerated,
13  * so here we adjust the DEF accordingly.
14  */
15 static int
16 memb_dci_PayloadSize_constraint_1(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 <= 126)) {
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 static int
41 memb_int_ConfigurationPerServingCell_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
42                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
43         size_t size;
44         
45         if(!sptr) {
46                 ASN__CTFAIL(app_key, td, sptr,
47                         "%s: value not given (%s:%d)",
48                         td->name, __FILE__, __LINE__);
49                 return -1;
50         }
51         
52         /* Determine the number of elements */
53         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
54         
55         if((size >= 1 && size <= 32)) {
56                 /* Perform validation of the inner elements */
57                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
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 asn_oer_constraints_t asn_OER_type_timeFrequencySet_constr_3 CC_NOTUSED = {
67         { 0, 0 },
68         -1};
69 static asn_per_constraints_t asn_PER_type_timeFrequencySet_constr_3 CC_NOTUSED = {
70         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
71         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
72         0, 0    /* No PER value map */
73 };
74 static asn_oer_constraints_t asn_OER_type_int_ConfigurationPerServingCell_constr_7 CC_NOTUSED = {
75         { 0, 0 },
76         -1      /* (SIZE(1..32)) */};
77 static asn_per_constraints_t asn_PER_type_int_ConfigurationPerServingCell_constr_7 CC_NOTUSED = {
78         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
79         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
80         0, 0    /* No PER value map */
81 };
82 static asn_oer_constraints_t asn_OER_memb_dci_PayloadSize_constr_6 CC_NOTUSED = {
83         { 1, 1 }        /* (0..126) */,
84         -1};
85 static asn_per_constraints_t asn_PER_memb_dci_PayloadSize_constr_6 CC_NOTUSED = {
86         { APC_CONSTRAINED,       7,  7,  0,  126 }      /* (0..126) */,
87         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
88         0, 0    /* No PER value map */
89 };
90 static asn_oer_constraints_t asn_OER_memb_int_ConfigurationPerServingCell_constr_7 CC_NOTUSED = {
91         { 0, 0 },
92         -1      /* (SIZE(1..32)) */};
93 static asn_per_constraints_t asn_PER_memb_int_ConfigurationPerServingCell_constr_7 CC_NOTUSED = {
94         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
95         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
96         0, 0    /* No PER value map */
97 };
98 static const asn_INTEGER_enum_map_t asn_MAP_timeFrequencySet_value2enum_3[] = {
99         { 0,    4,      "set0" },
100         { 1,    4,      "set1" }
101 };
102 static const unsigned int asn_MAP_timeFrequencySet_enum2value_3[] = {
103         0,      /* set0(0) */
104         1       /* set1(1) */
105 };
106 static const asn_INTEGER_specifics_t asn_SPC_timeFrequencySet_specs_3 = {
107         asn_MAP_timeFrequencySet_value2enum_3,  /* "tag" => N; sorted by tag */
108         asn_MAP_timeFrequencySet_enum2value_3,  /* N => "tag"; sorted by N */
109         2,      /* Number of elements in the maps */
110         0,      /* Enumeration is not extensible */
111         1,      /* Strict enumeration */
112         0,      /* Native long size */
113         0
114 };
115 static const ber_tlv_tag_t asn_DEF_timeFrequencySet_tags_3[] = {
116         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
117         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
118 };
119 static /* Use -fall-defs-global to expose */
120 asn_TYPE_descriptor_t asn_DEF_timeFrequencySet_3 = {
121         "timeFrequencySet",
122         "timeFrequencySet",
123         &asn_OP_NativeEnumerated,
124         asn_DEF_timeFrequencySet_tags_3,
125         sizeof(asn_DEF_timeFrequencySet_tags_3)
126                 /sizeof(asn_DEF_timeFrequencySet_tags_3[0]) - 1, /* 1 */
127         asn_DEF_timeFrequencySet_tags_3,        /* Same as above */
128         sizeof(asn_DEF_timeFrequencySet_tags_3)
129                 /sizeof(asn_DEF_timeFrequencySet_tags_3[0]), /* 2 */
130         { &asn_OER_type_timeFrequencySet_constr_3, &asn_PER_type_timeFrequencySet_constr_3, NativeEnumerated_constraint },
131         0, 0,   /* Defined elsewhere */
132         &asn_SPC_timeFrequencySet_specs_3       /* Additional specs */
133 };
134
135 static asn_TYPE_member_t asn_MBR_int_ConfigurationPerServingCell_7[] = {
136         { ATF_POINTER, 0, 0,
137                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
138                 0,
139                 &asn_DEF_INT_ConfigurationPerServingCell,
140                 0,
141                 { 0, 0, 0 },
142                 0, 0, /* No default value */
143                 ""
144                 },
145 };
146 static const ber_tlv_tag_t asn_DEF_int_ConfigurationPerServingCell_tags_7[] = {
147         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
148         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
149 };
150 static asn_SET_OF_specifics_t asn_SPC_int_ConfigurationPerServingCell_specs_7 = {
151         sizeof(struct DownlinkPreemption__int_ConfigurationPerServingCell),
152         offsetof(struct DownlinkPreemption__int_ConfigurationPerServingCell, _asn_ctx),
153         0,      /* XER encoding is XMLDelimitedItemList */
154 };
155 static /* Use -fall-defs-global to expose */
156 asn_TYPE_descriptor_t asn_DEF_int_ConfigurationPerServingCell_7 = {
157         "int-ConfigurationPerServingCell",
158         "int-ConfigurationPerServingCell",
159         &asn_OP_SEQUENCE_OF,
160         asn_DEF_int_ConfigurationPerServingCell_tags_7,
161         sizeof(asn_DEF_int_ConfigurationPerServingCell_tags_7)
162                 /sizeof(asn_DEF_int_ConfigurationPerServingCell_tags_7[0]) - 1, /* 1 */
163         asn_DEF_int_ConfigurationPerServingCell_tags_7, /* Same as above */
164         sizeof(asn_DEF_int_ConfigurationPerServingCell_tags_7)
165                 /sizeof(asn_DEF_int_ConfigurationPerServingCell_tags_7[0]), /* 2 */
166         { &asn_OER_type_int_ConfigurationPerServingCell_constr_7, &asn_PER_type_int_ConfigurationPerServingCell_constr_7, SEQUENCE_OF_constraint },
167         asn_MBR_int_ConfigurationPerServingCell_7,
168         1,      /* Single element */
169         &asn_SPC_int_ConfigurationPerServingCell_specs_7        /* Additional specs */
170 };
171
172 asn_TYPE_member_t asn_MBR_DownlinkPreemption_1[] = {
173         { ATF_NOFLAGS, 0, offsetof(struct DownlinkPreemption, int_RNTI),
174                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
175                 -1,     /* IMPLICIT tag at current level */
176                 &asn_DEF_RNTI_Value,
177                 0,
178                 { 0, 0, 0 },
179                 0, 0, /* No default value */
180                 "int-RNTI"
181                 },
182         { ATF_NOFLAGS, 0, offsetof(struct DownlinkPreemption, timeFrequencySet),
183                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
184                 -1,     /* IMPLICIT tag at current level */
185                 &asn_DEF_timeFrequencySet_3,
186                 0,
187                 { 0, 0, 0 },
188                 0, 0, /* No default value */
189                 "timeFrequencySet"
190                 },
191         { ATF_NOFLAGS, 0, offsetof(struct DownlinkPreemption, dci_PayloadSize),
192                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
193                 -1,     /* IMPLICIT tag at current level */
194                 &asn_DEF_NativeInteger,
195                 0,
196                 { &asn_OER_memb_dci_PayloadSize_constr_6, &asn_PER_memb_dci_PayloadSize_constr_6,  memb_dci_PayloadSize_constraint_1 },
197                 0, 0, /* No default value */
198                 "dci-PayloadSize"
199                 },
200         { ATF_NOFLAGS, 0, offsetof(struct DownlinkPreemption, int_ConfigurationPerServingCell),
201                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
202                 0,
203                 &asn_DEF_int_ConfigurationPerServingCell_7,
204                 0,
205                 { &asn_OER_memb_int_ConfigurationPerServingCell_constr_7, &asn_PER_memb_int_ConfigurationPerServingCell_constr_7,  memb_int_ConfigurationPerServingCell_constraint_1 },
206                 0, 0, /* No default value */
207                 "int-ConfigurationPerServingCell"
208                 },
209 };
210 static const ber_tlv_tag_t asn_DEF_DownlinkPreemption_tags_1[] = {
211         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
212 };
213 static const asn_TYPE_tag2member_t asn_MAP_DownlinkPreemption_tag2el_1[] = {
214     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* int-RNTI */
215     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* timeFrequencySet */
216     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* dci-PayloadSize */
217     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* int-ConfigurationPerServingCell */
218 };
219 asn_SEQUENCE_specifics_t asn_SPC_DownlinkPreemption_specs_1 = {
220         sizeof(struct DownlinkPreemption),
221         offsetof(struct DownlinkPreemption, _asn_ctx),
222         asn_MAP_DownlinkPreemption_tag2el_1,
223         4,      /* Count of tags in the map */
224         0, 0, 0,        /* Optional elements (not needed) */
225         4,      /* First extension addition */
226 };
227 asn_TYPE_descriptor_t asn_DEF_DownlinkPreemption = {
228         "DownlinkPreemption",
229         "DownlinkPreemption",
230         &asn_OP_SEQUENCE,
231         asn_DEF_DownlinkPreemption_tags_1,
232         sizeof(asn_DEF_DownlinkPreemption_tags_1)
233                 /sizeof(asn_DEF_DownlinkPreemption_tags_1[0]), /* 1 */
234         asn_DEF_DownlinkPreemption_tags_1,      /* Same as above */
235         sizeof(asn_DEF_DownlinkPreemption_tags_1)
236                 /sizeof(asn_DEF_DownlinkPreemption_tags_1[0]), /* 1 */
237         { 0, 0, SEQUENCE_constraint },
238         asn_MBR_DownlinkPreemption_1,
239         4,      /* Elements count */
240         &asn_SPC_DownlinkPreemption_specs_1     /* Additional specs */
241 };
242