[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-441]: Update name of Paging RRC Codec
[o-du/l2.git] / src / codec_utils / RRC / SIB8.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 "SIB8.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_SIB8_1[] = {
205         { ATF_NOFLAGS, 0, offsetof(struct SIB8, 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 SIB8, 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 SIB8, 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 SIB8, 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 SIB8, 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, 3, offsetof(struct SIB8, 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, 2, offsetof(struct SIB8, warningAreaCoordinatesSegment),
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                 "warningAreaCoordinatesSegment"
267                 },
268         { ATF_POINTER, 1, offsetof(struct SIB8, lateNonCriticalExtension),
269                 (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
270                 -1,     /* IMPLICIT tag at current level */
271                 &asn_DEF_OCTET_STRING,
272                 0,
273                 { 0, 0, 0 },
274                 0, 0, /* No default value */
275                 "lateNonCriticalExtension"
276                 },
277 };
278 static const int asn_MAP_SIB8_oms_1[] = { 5, 6, 7 };
279 static const ber_tlv_tag_t asn_DEF_SIB8_tags_1[] = {
280         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
281 };
282 static const asn_TYPE_tag2member_t asn_MAP_SIB8_tag2el_1[] = {
283     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* messageIdentifier */
284     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* serialNumber */
285     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* warningMessageSegmentType */
286     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* warningMessageSegmentNumber */
287     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* warningMessageSegment */
288     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* dataCodingScheme */
289     { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* warningAreaCoordinatesSegment */
290     { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 } /* lateNonCriticalExtension */
291 };
292 asn_SEQUENCE_specifics_t asn_SPC_SIB8_specs_1 = {
293         sizeof(struct SIB8),
294         offsetof(struct SIB8, _asn_ctx),
295         asn_MAP_SIB8_tag2el_1,
296         8,      /* Count of tags in the map */
297         asn_MAP_SIB8_oms_1,     /* Optional members */
298         3, 0,   /* Root/Additions */
299         8,      /* First extension addition */
300 };
301 asn_TYPE_descriptor_t asn_DEF_SIB8 = {
302         "SIB8",
303         "SIB8",
304         &asn_OP_SEQUENCE,
305         asn_DEF_SIB8_tags_1,
306         sizeof(asn_DEF_SIB8_tags_1)
307                 /sizeof(asn_DEF_SIB8_tags_1[0]), /* 1 */
308         asn_DEF_SIB8_tags_1,    /* Same as above */
309         sizeof(asn_DEF_SIB8_tags_1)
310                 /sizeof(asn_DEF_SIB8_tags_1[0]), /* 1 */
311         { 0, 0, SEQUENCE_constraint },
312         asn_MBR_SIB8_1,
313         8,      /* Elements count */
314         &asn_SPC_SIB8_specs_1   /* Additional specs */
315 };
316