Moving in e2sim originally from it/test/simulators
[sim/e2-interface.git] / e2sim / ASN1c / E-RABUsageReport-Item.c
1 /*****************************************************************************
2 #                                                                            *
3 # Copyright 2019 AT&T Intellectual Property                                  *
4 #                                                                            *
5 # Licensed under the Apache License, Version 2.0 (the "License");            *
6 # you may not use this file except in compliance with the License.           *
7 # You may obtain a copy of the License at                                    *
8 #                                                                            *
9 #      http://www.apache.org/licenses/LICENSE-2.0                            *
10 #                                                                            *
11 # Unless required by applicable law or agreed to in writing, software        *
12 # distributed under the License is distributed on an "AS IS" BASIS,          *
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
14 # See the License for the specific language governing permissions and        *
15 # limitations under the License.                                             *
16 #                                                                            *
17 ******************************************************************************/
18
19 /*
20  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
21  * From ASN.1 module "X2AP-IEs"
22  *      found in "../../asnFiles/X2AP-IEs.asn"
23  *      `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D.`
24  */
25
26 #include "E-RABUsageReport-Item.h"
27
28 #include "ProtocolExtensionContainer.h"
29 static int
30 usageCountUL_4_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
31                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
32         
33         if(!sptr) {
34                 ASN__CTFAIL(app_key, td, sptr,
35                         "%s: value not given (%s:%d)",
36                         td->name, __FILE__, __LINE__);
37                 return -1;
38         }
39         
40         
41         /* Constraint check succeeded */
42         return 0;
43 }
44
45 /*
46  * This type is implemented using NativeInteger,
47  * so here we adjust the DEF accordingly.
48  */
49 static int
50 usageCountDL_5_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
51                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
52         
53         if(!sptr) {
54                 ASN__CTFAIL(app_key, td, sptr,
55                         "%s: value not given (%s:%d)",
56                         td->name, __FILE__, __LINE__);
57                 return -1;
58         }
59         
60         
61         /* Constraint check succeeded */
62         return 0;
63 }
64
65 /*
66  * This type is implemented using NativeInteger,
67  * so here we adjust the DEF accordingly.
68  */
69 static int
70 memb_startTimeStamp_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
71                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
72         const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
73         size_t size;
74         
75         if(!sptr) {
76                 ASN__CTFAIL(app_key, td, sptr,
77                         "%s: value not given (%s:%d)",
78                         td->name, __FILE__, __LINE__);
79                 return -1;
80         }
81         
82         size = st->size;
83         
84         if((size == 4)) {
85                 /* Constraint check succeeded */
86                 return 0;
87         } else {
88                 ASN__CTFAIL(app_key, td, sptr,
89                         "%s: constraint failed (%s:%d)",
90                         td->name, __FILE__, __LINE__);
91                 return -1;
92         }
93 }
94
95 static int
96 memb_endTimeStamp_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
97                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
98         const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
99         size_t size;
100         
101         if(!sptr) {
102                 ASN__CTFAIL(app_key, td, sptr,
103                         "%s: value not given (%s:%d)",
104                         td->name, __FILE__, __LINE__);
105                 return -1;
106         }
107         
108         size = st->size;
109         
110         if((size == 4)) {
111                 /* Constraint check succeeded */
112                 return 0;
113         } else {
114                 ASN__CTFAIL(app_key, td, sptr,
115                         "%s: constraint failed (%s:%d)",
116                         td->name, __FILE__, __LINE__);
117                 return -1;
118         }
119 }
120
121 static int
122 memb_usageCountUL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
123                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
124         
125         if(!sptr) {
126                 ASN__CTFAIL(app_key, td, sptr,
127                         "%s: value not given (%s:%d)",
128                         td->name, __FILE__, __LINE__);
129                 return -1;
130         }
131         
132         
133         /* Constraint check succeeded */
134         return 0;
135 }
136
137 static int
138 memb_usageCountDL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
139                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
140         
141         if(!sptr) {
142                 ASN__CTFAIL(app_key, td, sptr,
143                         "%s: value not given (%s:%d)",
144                         td->name, __FILE__, __LINE__);
145                 return -1;
146         }
147         
148         
149         /* Constraint check succeeded */
150         return 0;
151 }
152
153 static asn_per_constraints_t asn_PER_type_usageCountUL_constr_4 CC_NOTUSED = {
154         { APC_CONSTRAINED,       32, -1,  0,  4294967295 }      /* (0..4294967295) */,
155         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
156         0, 0    /* No PER value map */
157 };
158 static asn_per_constraints_t asn_PER_type_usageCountDL_constr_5 CC_NOTUSED = {
159         { APC_CONSTRAINED,       32, -1,  0,  4294967295 }      /* (0..4294967295) */,
160         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
161         0, 0    /* No PER value map */
162 };
163 static asn_per_constraints_t asn_PER_memb_startTimeStamp_constr_2 CC_NOTUSED = {
164         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
165         { APC_CONSTRAINED,       0,  0,  4,  4 }        /* (SIZE(4..4)) */,
166         0, 0    /* No PER value map */
167 };
168 static asn_per_constraints_t asn_PER_memb_endTimeStamp_constr_3 CC_NOTUSED = {
169         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
170         { APC_CONSTRAINED,       0,  0,  4,  4 }        /* (SIZE(4..4)) */,
171         0, 0    /* No PER value map */
172 };
173 static asn_per_constraints_t asn_PER_memb_usageCountUL_constr_4 CC_NOTUSED = {
174         { APC_CONSTRAINED,       32, -1,  0,  4294967295 }      /* (0..4294967295) */,
175         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
176         0, 0    /* No PER value map */
177 };
178 static asn_per_constraints_t asn_PER_memb_usageCountDL_constr_5 CC_NOTUSED = {
179         { APC_CONSTRAINED,       32, -1,  0,  4294967295 }      /* (0..4294967295) */,
180         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
181         0, 0    /* No PER value map */
182 };
183 static const asn_INTEGER_specifics_t asn_SPC_usageCountUL_specs_4 = {
184         0,      0,      0,      0,      0,
185         0,      /* Native long size */
186         1       /* Unsigned representation */
187 };
188 static const ber_tlv_tag_t asn_DEF_usageCountUL_tags_4[] = {
189         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
190         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
191 };
192 static /* Use -fall-defs-global to expose */
193 asn_TYPE_descriptor_t asn_DEF_usageCountUL_4 = {
194         "usageCountUL",
195         "usageCountUL",
196         &asn_OP_NativeInteger,
197         asn_DEF_usageCountUL_tags_4,
198         sizeof(asn_DEF_usageCountUL_tags_4)
199                 /sizeof(asn_DEF_usageCountUL_tags_4[0]) - 1, /* 1 */
200         asn_DEF_usageCountUL_tags_4,    /* Same as above */
201         sizeof(asn_DEF_usageCountUL_tags_4)
202                 /sizeof(asn_DEF_usageCountUL_tags_4[0]), /* 2 */
203         { 0, &asn_PER_type_usageCountUL_constr_4, usageCountUL_4_constraint },
204         0, 0,   /* No members */
205         &asn_SPC_usageCountUL_specs_4   /* Additional specs */
206 };
207
208 static const asn_INTEGER_specifics_t asn_SPC_usageCountDL_specs_5 = {
209         0,      0,      0,      0,      0,
210         0,      /* Native long size */
211         1       /* Unsigned representation */
212 };
213 static const ber_tlv_tag_t asn_DEF_usageCountDL_tags_5[] = {
214         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
215         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
216 };
217 static /* Use -fall-defs-global to expose */
218 asn_TYPE_descriptor_t asn_DEF_usageCountDL_5 = {
219         "usageCountDL",
220         "usageCountDL",
221         &asn_OP_NativeInteger,
222         asn_DEF_usageCountDL_tags_5,
223         sizeof(asn_DEF_usageCountDL_tags_5)
224                 /sizeof(asn_DEF_usageCountDL_tags_5[0]) - 1, /* 1 */
225         asn_DEF_usageCountDL_tags_5,    /* Same as above */
226         sizeof(asn_DEF_usageCountDL_tags_5)
227                 /sizeof(asn_DEF_usageCountDL_tags_5[0]), /* 2 */
228         { 0, &asn_PER_type_usageCountDL_constr_5, usageCountDL_5_constraint },
229         0, 0,   /* No members */
230         &asn_SPC_usageCountDL_specs_5   /* Additional specs */
231 };
232
233 asn_TYPE_member_t asn_MBR_E_RABUsageReport_Item_1[] = {
234         { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, startTimeStamp),
235                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
236                 -1,     /* IMPLICIT tag at current level */
237                 &asn_DEF_OCTET_STRING,
238                 0,
239                 { 0, &asn_PER_memb_startTimeStamp_constr_2,  memb_startTimeStamp_constraint_1 },
240                 0, 0, /* No default value */
241                 "startTimeStamp"
242                 },
243         { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, endTimeStamp),
244                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
245                 -1,     /* IMPLICIT tag at current level */
246                 &asn_DEF_OCTET_STRING,
247                 0,
248                 { 0, &asn_PER_memb_endTimeStamp_constr_3,  memb_endTimeStamp_constraint_1 },
249                 0, 0, /* No default value */
250                 "endTimeStamp"
251                 },
252         { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, usageCountUL),
253                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
254                 -1,     /* IMPLICIT tag at current level */
255                 &asn_DEF_usageCountUL_4,
256                 0,
257                 { 0, &asn_PER_memb_usageCountUL_constr_4,  memb_usageCountUL_constraint_1 },
258                 0, 0, /* No default value */
259                 "usageCountUL"
260                 },
261         { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, usageCountDL),
262                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
263                 -1,     /* IMPLICIT tag at current level */
264                 &asn_DEF_usageCountDL_5,
265                 0,
266                 { 0, &asn_PER_memb_usageCountDL_constr_5,  memb_usageCountDL_constraint_1 },
267                 0, 0, /* No default value */
268                 "usageCountDL"
269                 },
270         { ATF_POINTER, 1, offsetof(struct E_RABUsageReport_Item, iE_Extensions),
271                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
272                 -1,     /* IMPLICIT tag at current level */
273                 &asn_DEF_ProtocolExtensionContainer_170P141,
274                 0,
275                 { 0, 0, 0 },
276                 0, 0, /* No default value */
277                 "iE-Extensions"
278                 },
279 };
280 static const int asn_MAP_E_RABUsageReport_Item_oms_1[] = { 4 };
281 static const ber_tlv_tag_t asn_DEF_E_RABUsageReport_Item_tags_1[] = {
282         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
283 };
284 static const asn_TYPE_tag2member_t asn_MAP_E_RABUsageReport_Item_tag2el_1[] = {
285     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* startTimeStamp */
286     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* endTimeStamp */
287     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* usageCountUL */
288     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* usageCountDL */
289     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iE-Extensions */
290 };
291 asn_SEQUENCE_specifics_t asn_SPC_E_RABUsageReport_Item_specs_1 = {
292         sizeof(struct E_RABUsageReport_Item),
293         offsetof(struct E_RABUsageReport_Item, _asn_ctx),
294         asn_MAP_E_RABUsageReport_Item_tag2el_1,
295         5,      /* Count of tags in the map */
296         asn_MAP_E_RABUsageReport_Item_oms_1,    /* Optional members */
297         1, 0,   /* Root/Additions */
298         5,      /* First extension addition */
299 };
300 asn_TYPE_descriptor_t asn_DEF_E_RABUsageReport_Item = {
301         "E-RABUsageReport-Item",
302         "E-RABUsageReport-Item",
303         &asn_OP_SEQUENCE,
304         asn_DEF_E_RABUsageReport_Item_tags_1,
305         sizeof(asn_DEF_E_RABUsageReport_Item_tags_1)
306                 /sizeof(asn_DEF_E_RABUsageReport_Item_tags_1[0]), /* 1 */
307         asn_DEF_E_RABUsageReport_Item_tags_1,   /* Same as above */
308         sizeof(asn_DEF_E_RABUsageReport_Item_tags_1)
309                 /sizeof(asn_DEF_E_RABUsageReport_Item_tags_1[0]), /* 1 */
310         { 0, 0, SEQUENCE_constraint },
311         asn_MBR_E_RABUsageReport_Item_1,
312         5,      /* Elements count */
313         &asn_SPC_E_RABUsageReport_Item_specs_1  /* Additional specs */
314 };
315