[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-423] Modified RRC asn structures
[o-du/l2.git] / src / codec_utils / RRC / SSB-MTC.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "../../../rrc_15.3_asn.asn1"
5  *      `asn1c -D ./25_02_2022_RRC/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "SSB-MTC.h"
9
10 static int
11 memb_sf5_constraint_2(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 <= 4)) {
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_sf10_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
37                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
38         long value;
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         value = *(const long *)sptr;
48         
49         if((value >= 0 && value <= 9)) {
50                 /* Constraint check succeeded */
51                 return 0;
52         } else {
53                 ASN__CTFAIL(app_key, td, sptr,
54                         "%s: constraint failed (%s:%d)",
55                         td->name, __FILE__, __LINE__);
56                 return -1;
57         }
58 }
59
60 static int
61 memb_sf20_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
62                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
63         long value;
64         
65         if(!sptr) {
66                 ASN__CTFAIL(app_key, td, sptr,
67                         "%s: value not given (%s:%d)",
68                         td->name, __FILE__, __LINE__);
69                 return -1;
70         }
71         
72         value = *(const long *)sptr;
73         
74         if((value >= 0 && value <= 19)) {
75                 /* Constraint check succeeded */
76                 return 0;
77         } else {
78                 ASN__CTFAIL(app_key, td, sptr,
79                         "%s: constraint failed (%s:%d)",
80                         td->name, __FILE__, __LINE__);
81                 return -1;
82         }
83 }
84
85 static int
86 memb_sf40_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
87                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
88         long value;
89         
90         if(!sptr) {
91                 ASN__CTFAIL(app_key, td, sptr,
92                         "%s: value not given (%s:%d)",
93                         td->name, __FILE__, __LINE__);
94                 return -1;
95         }
96         
97         value = *(const long *)sptr;
98         
99         if((value >= 0 && value <= 39)) {
100                 /* Constraint check succeeded */
101                 return 0;
102         } else {
103                 ASN__CTFAIL(app_key, td, sptr,
104                         "%s: constraint failed (%s:%d)",
105                         td->name, __FILE__, __LINE__);
106                 return -1;
107         }
108 }
109
110 static int
111 memb_sf80_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
112                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
113         long value;
114         
115         if(!sptr) {
116                 ASN__CTFAIL(app_key, td, sptr,
117                         "%s: value not given (%s:%d)",
118                         td->name, __FILE__, __LINE__);
119                 return -1;
120         }
121         
122         value = *(const long *)sptr;
123         
124         if((value >= 0 && value <= 79)) {
125                 /* Constraint check succeeded */
126                 return 0;
127         } else {
128                 ASN__CTFAIL(app_key, td, sptr,
129                         "%s: constraint failed (%s:%d)",
130                         td->name, __FILE__, __LINE__);
131                 return -1;
132         }
133 }
134
135 static int
136 memb_sf160_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
137                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
138         long value;
139         
140         if(!sptr) {
141                 ASN__CTFAIL(app_key, td, sptr,
142                         "%s: value not given (%s:%d)",
143                         td->name, __FILE__, __LINE__);
144                 return -1;
145         }
146         
147         value = *(const long *)sptr;
148         
149         if((value >= 0 && value <= 159)) {
150                 /* Constraint check succeeded */
151                 return 0;
152         } else {
153                 ASN__CTFAIL(app_key, td, sptr,
154                         "%s: constraint failed (%s:%d)",
155                         td->name, __FILE__, __LINE__);
156                 return -1;
157         }
158 }
159
160 /*
161  * This type is implemented using NativeEnumerated,
162  * so here we adjust the DEF accordingly.
163  */
164 static asn_oer_constraints_t asn_OER_memb_sf5_constr_3 CC_NOTUSED = {
165         { 1, 1 }        /* (0..4) */,
166         -1};
167 static asn_per_constraints_t asn_PER_memb_sf5_constr_3 CC_NOTUSED = {
168         { APC_CONSTRAINED,       3,  3,  0,  4 }        /* (0..4) */,
169         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
170         0, 0    /* No PER value map */
171 };
172 static asn_oer_constraints_t asn_OER_memb_sf10_constr_4 CC_NOTUSED = {
173         { 1, 1 }        /* (0..9) */,
174         -1};
175 static asn_per_constraints_t asn_PER_memb_sf10_constr_4 CC_NOTUSED = {
176         { APC_CONSTRAINED,       4,  4,  0,  9 }        /* (0..9) */,
177         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
178         0, 0    /* No PER value map */
179 };
180 static asn_oer_constraints_t asn_OER_memb_sf20_constr_5 CC_NOTUSED = {
181         { 1, 1 }        /* (0..19) */,
182         -1};
183 static asn_per_constraints_t asn_PER_memb_sf20_constr_5 CC_NOTUSED = {
184         { APC_CONSTRAINED,       5,  5,  0,  19 }       /* (0..19) */,
185         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
186         0, 0    /* No PER value map */
187 };
188 static asn_oer_constraints_t asn_OER_memb_sf40_constr_6 CC_NOTUSED = {
189         { 1, 1 }        /* (0..39) */,
190         -1};
191 static asn_per_constraints_t asn_PER_memb_sf40_constr_6 CC_NOTUSED = {
192         { APC_CONSTRAINED,       6,  6,  0,  39 }       /* (0..39) */,
193         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
194         0, 0    /* No PER value map */
195 };
196 static asn_oer_constraints_t asn_OER_memb_sf80_constr_7 CC_NOTUSED = {
197         { 1, 1 }        /* (0..79) */,
198         -1};
199 static asn_per_constraints_t asn_PER_memb_sf80_constr_7 CC_NOTUSED = {
200         { APC_CONSTRAINED,       7,  7,  0,  79 }       /* (0..79) */,
201         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
202         0, 0    /* No PER value map */
203 };
204 static asn_oer_constraints_t asn_OER_memb_sf160_constr_8 CC_NOTUSED = {
205         { 1, 1 }        /* (0..159) */,
206         -1};
207 static asn_per_constraints_t asn_PER_memb_sf160_constr_8 CC_NOTUSED = {
208         { APC_CONSTRAINED,       8,  8,  0,  159 }      /* (0..159) */,
209         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
210         0, 0    /* No PER value map */
211 };
212 static asn_oer_constraints_t asn_OER_type_periodicityAndOffset_constr_2 CC_NOTUSED = {
213         { 0, 0 },
214         -1};
215 static asn_per_constraints_t asn_PER_type_periodicityAndOffset_constr_2 CC_NOTUSED = {
216         { APC_CONSTRAINED,       3,  3,  0,  5 }        /* (0..5) */,
217         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
218         0, 0    /* No PER value map */
219 };
220 static asn_oer_constraints_t asn_OER_type_duration_constr_9 CC_NOTUSED = {
221         { 0, 0 },
222         -1};
223 static asn_per_constraints_t asn_PER_type_duration_constr_9 CC_NOTUSED = {
224         { APC_CONSTRAINED,       3,  3,  0,  4 }        /* (0..4) */,
225         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
226         0, 0    /* No PER value map */
227 };
228 static asn_TYPE_member_t asn_MBR_periodicityAndOffset_2[] = {
229         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC__periodicityAndOffset, choice.sf5),
230                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
231                 -1,     /* IMPLICIT tag at current level */
232                 &asn_DEF_NativeInteger,
233                 0,
234                 { &asn_OER_memb_sf5_constr_3, &asn_PER_memb_sf5_constr_3,  memb_sf5_constraint_2 },
235                 0, 0, /* No default value */
236                 "sf5"
237                 },
238         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC__periodicityAndOffset, choice.sf10),
239                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
240                 -1,     /* IMPLICIT tag at current level */
241                 &asn_DEF_NativeInteger,
242                 0,
243                 { &asn_OER_memb_sf10_constr_4, &asn_PER_memb_sf10_constr_4,  memb_sf10_constraint_2 },
244                 0, 0, /* No default value */
245                 "sf10"
246                 },
247         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC__periodicityAndOffset, choice.sf20),
248                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
249                 -1,     /* IMPLICIT tag at current level */
250                 &asn_DEF_NativeInteger,
251                 0,
252                 { &asn_OER_memb_sf20_constr_5, &asn_PER_memb_sf20_constr_5,  memb_sf20_constraint_2 },
253                 0, 0, /* No default value */
254                 "sf20"
255                 },
256         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC__periodicityAndOffset, choice.sf40),
257                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
258                 -1,     /* IMPLICIT tag at current level */
259                 &asn_DEF_NativeInteger,
260                 0,
261                 { &asn_OER_memb_sf40_constr_6, &asn_PER_memb_sf40_constr_6,  memb_sf40_constraint_2 },
262                 0, 0, /* No default value */
263                 "sf40"
264                 },
265         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC__periodicityAndOffset, choice.sf80),
266                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
267                 -1,     /* IMPLICIT tag at current level */
268                 &asn_DEF_NativeInteger,
269                 0,
270                 { &asn_OER_memb_sf80_constr_7, &asn_PER_memb_sf80_constr_7,  memb_sf80_constraint_2 },
271                 0, 0, /* No default value */
272                 "sf80"
273                 },
274         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC__periodicityAndOffset, choice.sf160),
275                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
276                 -1,     /* IMPLICIT tag at current level */
277                 &asn_DEF_NativeInteger,
278                 0,
279                 { &asn_OER_memb_sf160_constr_8, &asn_PER_memb_sf160_constr_8,  memb_sf160_constraint_2 },
280                 0, 0, /* No default value */
281                 "sf160"
282                 },
283 };
284 static const asn_TYPE_tag2member_t asn_MAP_periodicityAndOffset_tag2el_2[] = {
285     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sf5 */
286     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* sf10 */
287     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sf20 */
288     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* sf40 */
289     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* sf80 */
290     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* sf160 */
291 };
292 static asn_CHOICE_specifics_t asn_SPC_periodicityAndOffset_specs_2 = {
293         sizeof(struct SSB_MTC__periodicityAndOffset),
294         offsetof(struct SSB_MTC__periodicityAndOffset, _asn_ctx),
295         offsetof(struct SSB_MTC__periodicityAndOffset, present),
296         sizeof(((struct SSB_MTC__periodicityAndOffset *)0)->present),
297         asn_MAP_periodicityAndOffset_tag2el_2,
298         6,      /* Count of tags in the map */
299         0, 0,
300         -1      /* Extensions start */
301 };
302 static /* Use -fall-defs-global to expose */
303 asn_TYPE_descriptor_t asn_DEF_periodicityAndOffset_2 = {
304         "periodicityAndOffset",
305         "periodicityAndOffset",
306         &asn_OP_CHOICE,
307         0,      /* No effective tags (pointer) */
308         0,      /* No effective tags (count) */
309         0,      /* No tags (pointer) */
310         0,      /* No tags (count) */
311         { &asn_OER_type_periodicityAndOffset_constr_2, &asn_PER_type_periodicityAndOffset_constr_2, CHOICE_constraint },
312         asn_MBR_periodicityAndOffset_2,
313         6,      /* Elements count */
314         &asn_SPC_periodicityAndOffset_specs_2   /* Additional specs */
315 };
316
317 static const asn_INTEGER_enum_map_t asn_MAP_duration_value2enum_9[] = {
318         { 0,    3,      "sf1" },
319         { 1,    3,      "sf2" },
320         { 2,    3,      "sf3" },
321         { 3,    3,      "sf4" },
322         { 4,    3,      "sf5" }
323 };
324 static const unsigned int asn_MAP_duration_enum2value_9[] = {
325         0,      /* sf1(0) */
326         1,      /* sf2(1) */
327         2,      /* sf3(2) */
328         3,      /* sf4(3) */
329         4       /* sf5(4) */
330 };
331 static const asn_INTEGER_specifics_t asn_SPC_duration_specs_9 = {
332         asn_MAP_duration_value2enum_9,  /* "tag" => N; sorted by tag */
333         asn_MAP_duration_enum2value_9,  /* N => "tag"; sorted by N */
334         5,      /* Number of elements in the maps */
335         0,      /* Enumeration is not extensible */
336         1,      /* Strict enumeration */
337         0,      /* Native long size */
338         0
339 };
340 static const ber_tlv_tag_t asn_DEF_duration_tags_9[] = {
341         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
342         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
343 };
344 static /* Use -fall-defs-global to expose */
345 asn_TYPE_descriptor_t asn_DEF_duration_9 = {
346         "duration",
347         "duration",
348         &asn_OP_NativeEnumerated,
349         asn_DEF_duration_tags_9,
350         sizeof(asn_DEF_duration_tags_9)
351                 /sizeof(asn_DEF_duration_tags_9[0]) - 1, /* 1 */
352         asn_DEF_duration_tags_9,        /* Same as above */
353         sizeof(asn_DEF_duration_tags_9)
354                 /sizeof(asn_DEF_duration_tags_9[0]), /* 2 */
355         { &asn_OER_type_duration_constr_9, &asn_PER_type_duration_constr_9, NativeEnumerated_constraint },
356         0, 0,   /* Defined elsewhere */
357         &asn_SPC_duration_specs_9       /* Additional specs */
358 };
359
360 asn_TYPE_member_t asn_MBR_SSB_MTC_1[] = {
361         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC, periodicityAndOffset),
362                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
363                 +1,     /* EXPLICIT tag at current level */
364                 &asn_DEF_periodicityAndOffset_2,
365                 0,
366                 { 0, 0, 0 },
367                 0, 0, /* No default value */
368                 "periodicityAndOffset"
369                 },
370         { ATF_NOFLAGS, 0, offsetof(struct SSB_MTC, duration),
371                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
372                 -1,     /* IMPLICIT tag at current level */
373                 &asn_DEF_duration_9,
374                 0,
375                 { 0, 0, 0 },
376                 0, 0, /* No default value */
377                 "duration"
378                 },
379 };
380 static const ber_tlv_tag_t asn_DEF_SSB_MTC_tags_1[] = {
381         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
382 };
383 static const asn_TYPE_tag2member_t asn_MAP_SSB_MTC_tag2el_1[] = {
384     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* periodicityAndOffset */
385     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* duration */
386 };
387 asn_SEQUENCE_specifics_t asn_SPC_SSB_MTC_specs_1 = {
388         sizeof(struct SSB_MTC),
389         offsetof(struct SSB_MTC, _asn_ctx),
390         asn_MAP_SSB_MTC_tag2el_1,
391         2,      /* Count of tags in the map */
392         0, 0, 0,        /* Optional elements (not needed) */
393         -1,     /* First extension addition */
394 };
395 asn_TYPE_descriptor_t asn_DEF_SSB_MTC = {
396         "SSB-MTC",
397         "SSB-MTC",
398         &asn_OP_SEQUENCE,
399         asn_DEF_SSB_MTC_tags_1,
400         sizeof(asn_DEF_SSB_MTC_tags_1)
401                 /sizeof(asn_DEF_SSB_MTC_tags_1[0]), /* 1 */
402         asn_DEF_SSB_MTC_tags_1, /* Same as above */
403         sizeof(asn_DEF_SSB_MTC_tags_1)
404                 /sizeof(asn_DEF_SSB_MTC_tags_1[0]), /* 1 */
405         { 0, 0, SEQUENCE_constraint },
406         asn_MBR_SSB_MTC_1,
407         2,      /* Elements count */
408         &asn_SPC_SSB_MTC_specs_1        /* Additional specs */
409 };
410