[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / codec_utils / RRC / SIB7.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 "SIB7.h"
9
10 /*
11  * This type is implemented using NativeEnumerated,
12  * so here we adjust the DEF accordingly.
13  */
14 static int
15 memb_messageIdentifier_constraint_1(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 == 16)) {
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_serialNumber_constraint_1(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 == 16)) {
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_warningMessageSegmentNumber_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
78                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
79         long value;
80         
81         if(!sptr) {
82                 ASN__CTFAIL(app_key, td, sptr,
83                         "%s: value not given (%s:%d)",
84                         td->name, __FILE__, __LINE__);
85                 return -1;
86         }
87         
88         value = *(const long *)sptr;
89         
90         if((value >= 0 && value <= 63)) {
91                 /* Constraint check succeeded */
92                 return 0;
93         } else {
94                 ASN__CTFAIL(app_key, td, sptr,
95                         "%s: constraint failed (%s:%d)",
96                         td->name, __FILE__, __LINE__);
97                 return -1;
98         }
99 }
100
101 static int
102 memb_dataCodingScheme_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
103                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
104         const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
105         size_t size;
106         
107         if(!sptr) {
108                 ASN__CTFAIL(app_key, td, sptr,
109                         "%s: value not given (%s:%d)",
110                         td->name, __FILE__, __LINE__);
111                 return -1;
112         }
113         
114         size = st->size;
115         
116         if((size == 1)) {
117                 /* Constraint check succeeded */
118                 return 0;
119         } else {
120                 ASN__CTFAIL(app_key, td, sptr,
121                         "%s: constraint failed (%s:%d)",
122                         td->name, __FILE__, __LINE__);
123                 return -1;
124         }
125 }
126
127 static asn_oer_constraints_t asn_OER_type_warningMessageSegmentType_constr_4 CC_NOTUSED = {
128         { 0, 0 },
129         -1};
130 static asn_per_constraints_t asn_PER_type_warningMessageSegmentType_constr_4 CC_NOTUSED = {
131         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
132         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
133         0, 0    /* No PER value map */
134 };
135 static asn_oer_constraints_t asn_OER_memb_messageIdentifier_constr_2 CC_NOTUSED = {
136         { 0, 0 },
137         16      /* (SIZE(16..16)) */};
138 static asn_per_constraints_t asn_PER_memb_messageIdentifier_constr_2 CC_NOTUSED = {
139         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
140         { APC_CONSTRAINED,       0,  0,  16,  16 }      /* (SIZE(16..16)) */,
141         0, 0    /* No PER value map */
142 };
143 static asn_oer_constraints_t asn_OER_memb_serialNumber_constr_3 CC_NOTUSED = {
144         { 0, 0 },
145         16      /* (SIZE(16..16)) */};
146 static asn_per_constraints_t asn_PER_memb_serialNumber_constr_3 CC_NOTUSED = {
147         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
148         { APC_CONSTRAINED,       0,  0,  16,  16 }      /* (SIZE(16..16)) */,
149         0, 0    /* No PER value map */
150 };
151 static asn_oer_constraints_t asn_OER_memb_warningMessageSegmentNumber_constr_7 CC_NOTUSED = {
152         { 1, 1 }        /* (0..63) */,
153         -1};
154 static asn_per_constraints_t asn_PER_memb_warningMessageSegmentNumber_constr_7 CC_NOTUSED = {
155         { APC_CONSTRAINED,       6,  6,  0,  63 }       /* (0..63) */,
156         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
157         0, 0    /* No PER value map */
158 };
159 static asn_oer_constraints_t asn_OER_memb_dataCodingScheme_constr_9 CC_NOTUSED = {
160         { 0, 0 },
161         1       /* (SIZE(1..1)) */};
162 static asn_per_constraints_t asn_PER_memb_dataCodingScheme_constr_9 CC_NOTUSED = {
163         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
164         { APC_CONSTRAINED,       0,  0,  1,  1 }        /* (SIZE(1..1)) */,
165         0, 0    /* No PER value map */
166 };
167 static const asn_INTEGER_enum_map_t asn_MAP_warningMessageSegmentType_value2enum_4[] = {
168         { 0,    14,     "notLastSegment" },
169         { 1,    11,     "lastSegment" }
170 };
171 static const unsigned int asn_MAP_warningMessageSegmentType_enum2value_4[] = {
172         1,      /* lastSegment(1) */
173         0       /* notLastSegment(0) */
174 };
175 static const asn_INTEGER_specifics_t asn_SPC_warningMessageSegmentType_specs_4 = {
176         asn_MAP_warningMessageSegmentType_value2enum_4, /* "tag" => N; sorted by tag */
177         asn_MAP_warningMessageSegmentType_enum2value_4, /* N => "tag"; sorted by N */
178         2,      /* Number of elements in the maps */
179         0,      /* Enumeration is not extensible */
180         1,      /* Strict enumeration */
181         0,      /* Native long size */
182         0
183 };
184 static const ber_tlv_tag_t asn_DEF_warningMessageSegmentType_tags_4[] = {
185         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
186         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
187 };
188 static /* Use -fall-defs-global to expose */
189 asn_TYPE_descriptor_t asn_DEF_warningMessageSegmentType_4 = {
190         "warningMessageSegmentType",
191         "warningMessageSegmentType",
192         &asn_OP_NativeEnumerated,
193         asn_DEF_warningMessageSegmentType_tags_4,
194         sizeof(asn_DEF_warningMessageSegmentType_tags_4)
195                 /sizeof(asn_DEF_warningMessageSegmentType_tags_4[0]) - 1, /* 1 */
196         asn_DEF_warningMessageSegmentType_tags_4,       /* Same as above */
197         sizeof(asn_DEF_warningMessageSegmentType_tags_4)
198                 /sizeof(asn_DEF_warningMessageSegmentType_tags_4[0]), /* 2 */
199         { &asn_OER_type_warningMessageSegmentType_constr_4, &asn_PER_type_warningMessageSegmentType_constr_4, NativeEnumerated_constraint },
200         0, 0,   /* Defined elsewhere */
201         &asn_SPC_warningMessageSegmentType_specs_4      /* Additional specs */
202 };
203
204 asn_TYPE_member_t asn_MBR_SIB7_1[] = {
205         { ATF_NOFLAGS, 0, offsetof(struct SIB7, messageIdentifier),
206                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
207                 -1,     /* IMPLICIT tag at current level */
208                 &asn_DEF_BIT_STRING,
209                 0,
210                 { &asn_OER_memb_messageIdentifier_constr_2, &asn_PER_memb_messageIdentifier_constr_2,  memb_messageIdentifier_constraint_1 },
211                 0, 0, /* No default value */
212                 "messageIdentifier"
213                 },
214         { ATF_NOFLAGS, 0, offsetof(struct SIB7, serialNumber),
215                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
216                 -1,     /* IMPLICIT tag at current level */
217                 &asn_DEF_BIT_STRING,
218                 0,
219                 { &asn_OER_memb_serialNumber_constr_3, &asn_PER_memb_serialNumber_constr_3,  memb_serialNumber_constraint_1 },
220                 0, 0, /* No default value */
221                 "serialNumber"
222                 },
223         { ATF_NOFLAGS, 0, offsetof(struct SIB7, warningMessageSegmentType),
224                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
225                 -1,     /* IMPLICIT tag at current level */
226                 &asn_DEF_warningMessageSegmentType_4,
227                 0,
228                 { 0, 0, 0 },
229                 0, 0, /* No default value */
230                 "warningMessageSegmentType"
231                 },
232         { ATF_NOFLAGS, 0, offsetof(struct SIB7, warningMessageSegmentNumber),
233                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
234                 -1,     /* IMPLICIT tag at current level */
235                 &asn_DEF_NativeInteger,
236                 0,
237                 { &asn_OER_memb_warningMessageSegmentNumber_constr_7, &asn_PER_memb_warningMessageSegmentNumber_constr_7,  memb_warningMessageSegmentNumber_constraint_1 },
238                 0, 0, /* No default value */
239                 "warningMessageSegmentNumber"
240                 },
241         { ATF_NOFLAGS, 0, offsetof(struct SIB7, warningMessageSegment),
242                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
243                 -1,     /* IMPLICIT tag at current level */
244                 &asn_DEF_OCTET_STRING,
245                 0,
246                 { 0, 0, 0 },
247                 0, 0, /* No default value */
248                 "warningMessageSegment"
249                 },
250         { ATF_POINTER, 2, offsetof(struct SIB7, dataCodingScheme),
251                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
252                 -1,     /* IMPLICIT tag at current level */
253                 &asn_DEF_OCTET_STRING,
254                 0,
255                 { &asn_OER_memb_dataCodingScheme_constr_9, &asn_PER_memb_dataCodingScheme_constr_9,  memb_dataCodingScheme_constraint_1 },
256                 0, 0, /* No default value */
257                 "dataCodingScheme"
258                 },
259         { ATF_POINTER, 1, offsetof(struct SIB7, lateNonCriticalExtension),
260                 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
261                 -1,     /* IMPLICIT tag at current level */
262                 &asn_DEF_OCTET_STRING,
263                 0,
264                 { 0, 0, 0 },
265                 0, 0, /* No default value */
266                 "lateNonCriticalExtension"
267                 },
268 };
269 static const int asn_MAP_SIB7_oms_1[] = { 5, 6 };
270 static const ber_tlv_tag_t asn_DEF_SIB7_tags_1[] = {
271         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
272 };
273 static const asn_TYPE_tag2member_t asn_MAP_SIB7_tag2el_1[] = {
274     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* messageIdentifier */
275     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* serialNumber */
276     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* warningMessageSegmentType */
277     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* warningMessageSegmentNumber */
278     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* warningMessageSegment */
279     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* dataCodingScheme */
280     { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* lateNonCriticalExtension */
281 };
282 asn_SEQUENCE_specifics_t asn_SPC_SIB7_specs_1 = {
283         sizeof(struct SIB7),
284         offsetof(struct SIB7, _asn_ctx),
285         asn_MAP_SIB7_tag2el_1,
286         7,      /* Count of tags in the map */
287         asn_MAP_SIB7_oms_1,     /* Optional members */
288         2, 0,   /* Root/Additions */
289         7,      /* First extension addition */
290 };
291 asn_TYPE_descriptor_t asn_DEF_SIB7 = {
292         "SIB7",
293         "SIB7",
294         &asn_OP_SEQUENCE,
295         asn_DEF_SIB7_tags_1,
296         sizeof(asn_DEF_SIB7_tags_1)
297                 /sizeof(asn_DEF_SIB7_tags_1[0]), /* 1 */
298         asn_DEF_SIB7_tags_1,    /* Same as above */
299         sizeof(asn_DEF_SIB7_tags_1)
300                 /sizeof(asn_DEF_SIB7_tags_1[0]), /* 1 */
301         { 0, 0, SEQUENCE_constraint },
302         asn_MBR_SIB7_1,
303         7,      /* Elements count */
304         &asn_SPC_SIB7_specs_1   /* Additional specs */
305 };
306