[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-441]: Update name of Paging RRC Codec
[o-du/l2.git] / src / codec_utils / RRC / SI-SchedulingInfo.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 "SI-SchedulingInfo.h"
9
10 #include "SI-RequestConfig.h"
11 #include "SchedulingInfo.h"
12 /*
13  * This type is implemented using NativeEnumerated,
14  * so here we adjust the DEF accordingly.
15  */
16 static int
17 memb_schedulingInfoList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
18                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
19         size_t size;
20         
21         if(!sptr) {
22                 ASN__CTFAIL(app_key, td, sptr,
23                         "%s: value not given (%s:%d)",
24                         td->name, __FILE__, __LINE__);
25                 return -1;
26         }
27         
28         /* Determine the number of elements */
29         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
30         
31         if((size >= 1 && size <= 32)) {
32                 /* Perform validation of the inner elements */
33                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
34         } else {
35                 ASN__CTFAIL(app_key, td, sptr,
36                         "%s: constraint failed (%s:%d)",
37                         td->name, __FILE__, __LINE__);
38                 return -1;
39         }
40 }
41
42 static int
43 memb_systemInformationAreaID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
44                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
45         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
46         size_t size;
47         
48         if(!sptr) {
49                 ASN__CTFAIL(app_key, td, sptr,
50                         "%s: value not given (%s:%d)",
51                         td->name, __FILE__, __LINE__);
52                 return -1;
53         }
54         
55         if(st->size > 0) {
56                 /* Size in bits */
57                 size = 8 * st->size - (st->bits_unused & 0x07);
58         } else {
59                 size = 0;
60         }
61         
62         if((size == 24)) {
63                 /* Constraint check succeeded */
64                 return 0;
65         } else {
66                 ASN__CTFAIL(app_key, td, sptr,
67                         "%s: constraint failed (%s:%d)",
68                         td->name, __FILE__, __LINE__);
69                 return -1;
70         }
71 }
72
73 static asn_oer_constraints_t asn_OER_type_schedulingInfoList_constr_2 CC_NOTUSED = {
74         { 0, 0 },
75         -1      /* (SIZE(1..32)) */};
76 static asn_per_constraints_t asn_PER_type_schedulingInfoList_constr_2 CC_NOTUSED = {
77         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
78         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
79         0, 0    /* No PER value map */
80 };
81 static asn_oer_constraints_t asn_OER_type_si_WindowLength_constr_4 CC_NOTUSED = {
82         { 0, 0 },
83         -1};
84 static asn_per_constraints_t asn_PER_type_si_WindowLength_constr_4 CC_NOTUSED = {
85         { APC_CONSTRAINED,       4,  4,  0,  8 }        /* (0..8) */,
86         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
87         0, 0    /* No PER value map */
88 };
89 static asn_oer_constraints_t asn_OER_memb_schedulingInfoList_constr_2 CC_NOTUSED = {
90         { 0, 0 },
91         -1      /* (SIZE(1..32)) */};
92 static asn_per_constraints_t asn_PER_memb_schedulingInfoList_constr_2 CC_NOTUSED = {
93         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
94         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
95         0, 0    /* No PER value map */
96 };
97 static asn_oer_constraints_t asn_OER_memb_systemInformationAreaID_constr_16 CC_NOTUSED = {
98         { 0, 0 },
99         24      /* (SIZE(24..24)) */};
100 static asn_per_constraints_t asn_PER_memb_systemInformationAreaID_constr_16 CC_NOTUSED = {
101         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
102         { APC_CONSTRAINED,       0,  0,  24,  24 }      /* (SIZE(24..24)) */,
103         0, 0    /* No PER value map */
104 };
105 static asn_TYPE_member_t asn_MBR_schedulingInfoList_2[] = {
106         { ATF_POINTER, 0, 0,
107                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
108                 0,
109                 &asn_DEF_SchedulingInfo,
110                 0,
111                 { 0, 0, 0 },
112                 0, 0, /* No default value */
113                 ""
114                 },
115 };
116 static const ber_tlv_tag_t asn_DEF_schedulingInfoList_tags_2[] = {
117         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
118         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
119 };
120 static asn_SET_OF_specifics_t asn_SPC_schedulingInfoList_specs_2 = {
121         sizeof(struct SI_SchedulingInfo__schedulingInfoList),
122         offsetof(struct SI_SchedulingInfo__schedulingInfoList, _asn_ctx),
123         0,      /* XER encoding is XMLDelimitedItemList */
124 };
125 static /* Use -fall-defs-global to expose */
126 asn_TYPE_descriptor_t asn_DEF_schedulingInfoList_2 = {
127         "schedulingInfoList",
128         "schedulingInfoList",
129         &asn_OP_SEQUENCE_OF,
130         asn_DEF_schedulingInfoList_tags_2,
131         sizeof(asn_DEF_schedulingInfoList_tags_2)
132                 /sizeof(asn_DEF_schedulingInfoList_tags_2[0]) - 1, /* 1 */
133         asn_DEF_schedulingInfoList_tags_2,      /* Same as above */
134         sizeof(asn_DEF_schedulingInfoList_tags_2)
135                 /sizeof(asn_DEF_schedulingInfoList_tags_2[0]), /* 2 */
136         { &asn_OER_type_schedulingInfoList_constr_2, &asn_PER_type_schedulingInfoList_constr_2, SEQUENCE_OF_constraint },
137         asn_MBR_schedulingInfoList_2,
138         1,      /* Single element */
139         &asn_SPC_schedulingInfoList_specs_2     /* Additional specs */
140 };
141
142 static const asn_INTEGER_enum_map_t asn_MAP_si_WindowLength_value2enum_4[] = {
143         { 0,    2,      "s5" },
144         { 1,    3,      "s10" },
145         { 2,    3,      "s20" },
146         { 3,    3,      "s40" },
147         { 4,    3,      "s80" },
148         { 5,    4,      "s160" },
149         { 6,    4,      "s320" },
150         { 7,    4,      "s640" },
151         { 8,    5,      "s1280" }
152 };
153 static const unsigned int asn_MAP_si_WindowLength_enum2value_4[] = {
154         1,      /* s10(1) */
155         8,      /* s1280(8) */
156         5,      /* s160(5) */
157         2,      /* s20(2) */
158         6,      /* s320(6) */
159         3,      /* s40(3) */
160         0,      /* s5(0) */
161         7,      /* s640(7) */
162         4       /* s80(4) */
163 };
164 static const asn_INTEGER_specifics_t asn_SPC_si_WindowLength_specs_4 = {
165         asn_MAP_si_WindowLength_value2enum_4,   /* "tag" => N; sorted by tag */
166         asn_MAP_si_WindowLength_enum2value_4,   /* N => "tag"; sorted by N */
167         9,      /* Number of elements in the maps */
168         0,      /* Enumeration is not extensible */
169         1,      /* Strict enumeration */
170         0,      /* Native long size */
171         0
172 };
173 static const ber_tlv_tag_t asn_DEF_si_WindowLength_tags_4[] = {
174         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
175         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
176 };
177 static /* Use -fall-defs-global to expose */
178 asn_TYPE_descriptor_t asn_DEF_si_WindowLength_4 = {
179         "si-WindowLength",
180         "si-WindowLength",
181         &asn_OP_NativeEnumerated,
182         asn_DEF_si_WindowLength_tags_4,
183         sizeof(asn_DEF_si_WindowLength_tags_4)
184                 /sizeof(asn_DEF_si_WindowLength_tags_4[0]) - 1, /* 1 */
185         asn_DEF_si_WindowLength_tags_4, /* Same as above */
186         sizeof(asn_DEF_si_WindowLength_tags_4)
187                 /sizeof(asn_DEF_si_WindowLength_tags_4[0]), /* 2 */
188         { &asn_OER_type_si_WindowLength_constr_4, &asn_PER_type_si_WindowLength_constr_4, NativeEnumerated_constraint },
189         0, 0,   /* Defined elsewhere */
190         &asn_SPC_si_WindowLength_specs_4        /* Additional specs */
191 };
192
193 asn_TYPE_member_t asn_MBR_SI_SchedulingInfo_1[] = {
194         { ATF_NOFLAGS, 0, offsetof(struct SI_SchedulingInfo, schedulingInfoList),
195                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
196                 0,
197                 &asn_DEF_schedulingInfoList_2,
198                 0,
199                 { &asn_OER_memb_schedulingInfoList_constr_2, &asn_PER_memb_schedulingInfoList_constr_2,  memb_schedulingInfoList_constraint_1 },
200                 0, 0, /* No default value */
201                 "schedulingInfoList"
202                 },
203         { ATF_NOFLAGS, 0, offsetof(struct SI_SchedulingInfo, si_WindowLength),
204                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
205                 -1,     /* IMPLICIT tag at current level */
206                 &asn_DEF_si_WindowLength_4,
207                 0,
208                 { 0, 0, 0 },
209                 0, 0, /* No default value */
210                 "si-WindowLength"
211                 },
212         { ATF_POINTER, 3, offsetof(struct SI_SchedulingInfo, si_RequestConfig),
213                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
214                 -1,     /* IMPLICIT tag at current level */
215                 &asn_DEF_SI_RequestConfig,
216                 0,
217                 { 0, 0, 0 },
218                 0, 0, /* No default value */
219                 "si-RequestConfig"
220                 },
221         { ATF_POINTER, 2, offsetof(struct SI_SchedulingInfo, si_RequestConfigSUL),
222                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
223                 -1,     /* IMPLICIT tag at current level */
224                 &asn_DEF_SI_RequestConfig,
225                 0,
226                 { 0, 0, 0 },
227                 0, 0, /* No default value */
228                 "si-RequestConfigSUL"
229                 },
230         { ATF_POINTER, 1, offsetof(struct SI_SchedulingInfo, systemInformationAreaID),
231                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
232                 -1,     /* IMPLICIT tag at current level */
233                 &asn_DEF_BIT_STRING,
234                 0,
235                 { &asn_OER_memb_systemInformationAreaID_constr_16, &asn_PER_memb_systemInformationAreaID_constr_16,  memb_systemInformationAreaID_constraint_1 },
236                 0, 0, /* No default value */
237                 "systemInformationAreaID"
238                 },
239 };
240 static const int asn_MAP_SI_SchedulingInfo_oms_1[] = { 2, 3, 4 };
241 static const ber_tlv_tag_t asn_DEF_SI_SchedulingInfo_tags_1[] = {
242         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
243 };
244 static const asn_TYPE_tag2member_t asn_MAP_SI_SchedulingInfo_tag2el_1[] = {
245     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* schedulingInfoList */
246     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* si-WindowLength */
247     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* si-RequestConfig */
248     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* si-RequestConfigSUL */
249     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* systemInformationAreaID */
250 };
251 asn_SEQUENCE_specifics_t asn_SPC_SI_SchedulingInfo_specs_1 = {
252         sizeof(struct SI_SchedulingInfo),
253         offsetof(struct SI_SchedulingInfo, _asn_ctx),
254         asn_MAP_SI_SchedulingInfo_tag2el_1,
255         5,      /* Count of tags in the map */
256         asn_MAP_SI_SchedulingInfo_oms_1,        /* Optional members */
257         3, 0,   /* Root/Additions */
258         5,      /* First extension addition */
259 };
260 asn_TYPE_descriptor_t asn_DEF_SI_SchedulingInfo = {
261         "SI-SchedulingInfo",
262         "SI-SchedulingInfo",
263         &asn_OP_SEQUENCE,
264         asn_DEF_SI_SchedulingInfo_tags_1,
265         sizeof(asn_DEF_SI_SchedulingInfo_tags_1)
266                 /sizeof(asn_DEF_SI_SchedulingInfo_tags_1[0]), /* 1 */
267         asn_DEF_SI_SchedulingInfo_tags_1,       /* Same as above */
268         sizeof(asn_DEF_SI_SchedulingInfo_tags_1)
269                 /sizeof(asn_DEF_SI_SchedulingInfo_tags_1[0]), /* 1 */
270         { 0, 0, SEQUENCE_constraint },
271         asn_MBR_SI_SchedulingInfo_1,
272         5,      /* Elements count */
273         &asn_SPC_SI_SchedulingInfo_specs_1      /* Additional specs */
274 };
275