[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-441]: Update name of Paging RRC Codec
[o-du/l2.git] / src / codec_utils / RRC / SIB9.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 "SIB9.h"
9
10 static int
11 memb_timeInfoUTC_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         const INTEGER_t *st = (const INTEGER_t *)sptr;
14         long value;
15         
16         if(!sptr) {
17                 ASN__CTFAIL(app_key, td, sptr,
18                         "%s: value not given (%s:%d)",
19                         td->name, __FILE__, __LINE__);
20                 return -1;
21         }
22         
23         if(asn_INTEGER2long(st, &value)) {
24                 ASN__CTFAIL(app_key, td, sptr,
25                         "%s: value too large (%s:%d)",
26                         td->name, __FILE__, __LINE__);
27                 return -1;
28         }
29         
30         if((value >= 0 && value <= 549755813887)) {
31                 /* Constraint check succeeded */
32                 return 0;
33         } else {
34                 ASN__CTFAIL(app_key, td, sptr,
35                         "%s: constraint failed (%s:%d)",
36                         td->name, __FILE__, __LINE__);
37                 return -1;
38         }
39 }
40
41 static int
42 memb_dayLightSavingTime_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
43                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
45         size_t size;
46         
47         if(!sptr) {
48                 ASN__CTFAIL(app_key, td, sptr,
49                         "%s: value not given (%s:%d)",
50                         td->name, __FILE__, __LINE__);
51                 return -1;
52         }
53         
54         if(st->size > 0) {
55                 /* Size in bits */
56                 size = 8 * st->size - (st->bits_unused & 0x07);
57         } else {
58                 size = 0;
59         }
60         
61         if((size == 2)) {
62                 /* Constraint check succeeded */
63                 return 0;
64         } else {
65                 ASN__CTFAIL(app_key, td, sptr,
66                         "%s: constraint failed (%s:%d)",
67                         td->name, __FILE__, __LINE__);
68                 return -1;
69         }
70 }
71
72 static int
73 memb_leapSeconds_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
74                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
75         long value;
76         
77         if(!sptr) {
78                 ASN__CTFAIL(app_key, td, sptr,
79                         "%s: value not given (%s:%d)",
80                         td->name, __FILE__, __LINE__);
81                 return -1;
82         }
83         
84         value = *(const long *)sptr;
85         
86         if((value >= -127 && value <= 128)) {
87                 /* Constraint check succeeded */
88                 return 0;
89         } else {
90                 ASN__CTFAIL(app_key, td, sptr,
91                         "%s: constraint failed (%s:%d)",
92                         td->name, __FILE__, __LINE__);
93                 return -1;
94         }
95 }
96
97 static int
98 memb_localTimeOffset_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
99                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
100         long value;
101         
102         if(!sptr) {
103                 ASN__CTFAIL(app_key, td, sptr,
104                         "%s: value not given (%s:%d)",
105                         td->name, __FILE__, __LINE__);
106                 return -1;
107         }
108         
109         value = *(const long *)sptr;
110         
111         if((value >= -63 && value <= 64)) {
112                 /* Constraint check succeeded */
113                 return 0;
114         } else {
115                 ASN__CTFAIL(app_key, td, sptr,
116                         "%s: constraint failed (%s:%d)",
117                         td->name, __FILE__, __LINE__);
118                 return -1;
119         }
120 }
121
122 static asn_oer_constraints_t asn_OER_memb_timeInfoUTC_constr_3 CC_NOTUSED = {
123         { 8, 1 }        /* (0..549755813887) */,
124         -1};
125 static asn_per_constraints_t asn_PER_memb_timeInfoUTC_constr_3 CC_NOTUSED = {
126         { APC_CONSTRAINED,       39, -1,  0,  549755813887 }    /* (0..549755813887) */,
127         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
128         0, 0    /* No PER value map */
129 };
130 static asn_oer_constraints_t asn_OER_memb_dayLightSavingTime_constr_4 CC_NOTUSED = {
131         { 0, 0 },
132         2       /* (SIZE(2..2)) */};
133 static asn_per_constraints_t asn_PER_memb_dayLightSavingTime_constr_4 CC_NOTUSED = {
134         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
135         { APC_CONSTRAINED,       0,  0,  2,  2 }        /* (SIZE(2..2)) */,
136         0, 0    /* No PER value map */
137 };
138 static asn_oer_constraints_t asn_OER_memb_leapSeconds_constr_5 CC_NOTUSED = {
139         { 2, 0 }        /* (-127..128) */,
140         -1};
141 static asn_per_constraints_t asn_PER_memb_leapSeconds_constr_5 CC_NOTUSED = {
142         { APC_CONSTRAINED,       8,  8, -127,  128 }    /* (-127..128) */,
143         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
144         0, 0    /* No PER value map */
145 };
146 static asn_oer_constraints_t asn_OER_memb_localTimeOffset_constr_6 CC_NOTUSED = {
147         { 1, 0 }        /* (-63..64) */,
148         -1};
149 static asn_per_constraints_t asn_PER_memb_localTimeOffset_constr_6 CC_NOTUSED = {
150         { APC_CONSTRAINED,       7,  7, -63,  64 }      /* (-63..64) */,
151         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
152         0, 0    /* No PER value map */
153 };
154 static asn_TYPE_member_t asn_MBR_timeInfo_2[] = {
155         { ATF_NOFLAGS, 0, offsetof(struct SIB9__timeInfo, timeInfoUTC),
156                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
157                 -1,     /* IMPLICIT tag at current level */
158                 &asn_DEF_INTEGER,
159                 0,
160                 { &asn_OER_memb_timeInfoUTC_constr_3, &asn_PER_memb_timeInfoUTC_constr_3,  memb_timeInfoUTC_constraint_2 },
161                 0, 0, /* No default value */
162                 "timeInfoUTC"
163                 },
164         { ATF_POINTER, 3, offsetof(struct SIB9__timeInfo, dayLightSavingTime),
165                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
166                 -1,     /* IMPLICIT tag at current level */
167                 &asn_DEF_BIT_STRING,
168                 0,
169                 { &asn_OER_memb_dayLightSavingTime_constr_4, &asn_PER_memb_dayLightSavingTime_constr_4,  memb_dayLightSavingTime_constraint_2 },
170                 0, 0, /* No default value */
171                 "dayLightSavingTime"
172                 },
173         { ATF_POINTER, 2, offsetof(struct SIB9__timeInfo, leapSeconds),
174                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
175                 -1,     /* IMPLICIT tag at current level */
176                 &asn_DEF_NativeInteger,
177                 0,
178                 { &asn_OER_memb_leapSeconds_constr_5, &asn_PER_memb_leapSeconds_constr_5,  memb_leapSeconds_constraint_2 },
179                 0, 0, /* No default value */
180                 "leapSeconds"
181                 },
182         { ATF_POINTER, 1, offsetof(struct SIB9__timeInfo, localTimeOffset),
183                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
184                 -1,     /* IMPLICIT tag at current level */
185                 &asn_DEF_NativeInteger,
186                 0,
187                 { &asn_OER_memb_localTimeOffset_constr_6, &asn_PER_memb_localTimeOffset_constr_6,  memb_localTimeOffset_constraint_2 },
188                 0, 0, /* No default value */
189                 "localTimeOffset"
190                 },
191 };
192 static const int asn_MAP_timeInfo_oms_2[] = { 1, 2, 3 };
193 static const ber_tlv_tag_t asn_DEF_timeInfo_tags_2[] = {
194         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
195         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
196 };
197 static const asn_TYPE_tag2member_t asn_MAP_timeInfo_tag2el_2[] = {
198     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* timeInfoUTC */
199     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* dayLightSavingTime */
200     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* leapSeconds */
201     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* localTimeOffset */
202 };
203 static asn_SEQUENCE_specifics_t asn_SPC_timeInfo_specs_2 = {
204         sizeof(struct SIB9__timeInfo),
205         offsetof(struct SIB9__timeInfo, _asn_ctx),
206         asn_MAP_timeInfo_tag2el_2,
207         4,      /* Count of tags in the map */
208         asn_MAP_timeInfo_oms_2, /* Optional members */
209         3, 0,   /* Root/Additions */
210         -1,     /* First extension addition */
211 };
212 static /* Use -fall-defs-global to expose */
213 asn_TYPE_descriptor_t asn_DEF_timeInfo_2 = {
214         "timeInfo",
215         "timeInfo",
216         &asn_OP_SEQUENCE,
217         asn_DEF_timeInfo_tags_2,
218         sizeof(asn_DEF_timeInfo_tags_2)
219                 /sizeof(asn_DEF_timeInfo_tags_2[0]) - 1, /* 1 */
220         asn_DEF_timeInfo_tags_2,        /* Same as above */
221         sizeof(asn_DEF_timeInfo_tags_2)
222                 /sizeof(asn_DEF_timeInfo_tags_2[0]), /* 2 */
223         { 0, 0, SEQUENCE_constraint },
224         asn_MBR_timeInfo_2,
225         4,      /* Elements count */
226         &asn_SPC_timeInfo_specs_2       /* Additional specs */
227 };
228
229 asn_TYPE_member_t asn_MBR_SIB9_1[] = {
230         { ATF_POINTER, 2, offsetof(struct SIB9, timeInfo),
231                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
232                 0,
233                 &asn_DEF_timeInfo_2,
234                 0,
235                 { 0, 0, 0 },
236                 0, 0, /* No default value */
237                 "timeInfo"
238                 },
239         { ATF_POINTER, 1, offsetof(struct SIB9, lateNonCriticalExtension),
240                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
241                 -1,     /* IMPLICIT tag at current level */
242                 &asn_DEF_OCTET_STRING,
243                 0,
244                 { 0, 0, 0 },
245                 0, 0, /* No default value */
246                 "lateNonCriticalExtension"
247                 },
248 };
249 static const int asn_MAP_SIB9_oms_1[] = { 0, 1 };
250 static const ber_tlv_tag_t asn_DEF_SIB9_tags_1[] = {
251         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
252 };
253 static const asn_TYPE_tag2member_t asn_MAP_SIB9_tag2el_1[] = {
254     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* timeInfo */
255     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* lateNonCriticalExtension */
256 };
257 asn_SEQUENCE_specifics_t asn_SPC_SIB9_specs_1 = {
258         sizeof(struct SIB9),
259         offsetof(struct SIB9, _asn_ctx),
260         asn_MAP_SIB9_tag2el_1,
261         2,      /* Count of tags in the map */
262         asn_MAP_SIB9_oms_1,     /* Optional members */
263         2, 0,   /* Root/Additions */
264         2,      /* First extension addition */
265 };
266 asn_TYPE_descriptor_t asn_DEF_SIB9 = {
267         "SIB9",
268         "SIB9",
269         &asn_OP_SEQUENCE,
270         asn_DEF_SIB9_tags_1,
271         sizeof(asn_DEF_SIB9_tags_1)
272                 /sizeof(asn_DEF_SIB9_tags_1[0]), /* 1 */
273         asn_DEF_SIB9_tags_1,    /* Same as above */
274         sizeof(asn_DEF_SIB9_tags_1)
275                 /sizeof(asn_DEF_SIB9_tags_1[0]), /* 1 */
276         { 0, 0, SEQUENCE_constraint },
277         asn_MBR_SIB9_1,
278         2,      /* Elements count */
279         &asn_SPC_SIB9_specs_1   /* Additional specs */
280 };
281