Moving in e2sim originally from it/test/simulators
[sim/e2-interface.git] / e2sim / ASN1c / ENB-ID.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 "ENB-ID.h"
27
28 static int
29 memb_macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
30                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
31         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
32         size_t size;
33         
34         if(!sptr) {
35                 ASN__CTFAIL(app_key, td, sptr,
36                         "%s: value not given (%s:%d)",
37                         td->name, __FILE__, __LINE__);
38                 return -1;
39         }
40         
41         if(st->size > 0) {
42                 /* Size in bits */
43                 size = 8 * st->size - (st->bits_unused & 0x07);
44         } else {
45                 size = 0;
46         }
47         
48         if((size == 20)) {
49                 /* Constraint check succeeded */
50                 return 0;
51         } else {
52                 ASN__CTFAIL(app_key, td, sptr,
53                         "%s: constraint failed (%s:%d)",
54                         td->name, __FILE__, __LINE__);
55                 return -1;
56         }
57 }
58
59 static int
60 memb_home_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
61                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
62         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
63         size_t size;
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         if(st->size > 0) {
73                 /* Size in bits */
74                 size = 8 * st->size - (st->bits_unused & 0x07);
75         } else {
76                 size = 0;
77         }
78         
79         if((size == 28)) {
80                 /* Constraint check succeeded */
81                 return 0;
82         } else {
83                 ASN__CTFAIL(app_key, td, sptr,
84                         "%s: constraint failed (%s:%d)",
85                         td->name, __FILE__, __LINE__);
86                 return -1;
87         }
88 }
89
90 static int
91 memb_short_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
92                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
93         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
94         size_t size;
95         
96         if(!sptr) {
97                 ASN__CTFAIL(app_key, td, sptr,
98                         "%s: value not given (%s:%d)",
99                         td->name, __FILE__, __LINE__);
100                 return -1;
101         }
102         
103         if(st->size > 0) {
104                 /* Size in bits */
105                 size = 8 * st->size - (st->bits_unused & 0x07);
106         } else {
107                 size = 0;
108         }
109         
110         if((size == 18)) {
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_long_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
123                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
124         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
125         size_t size;
126         
127         if(!sptr) {
128                 ASN__CTFAIL(app_key, td, sptr,
129                         "%s: value not given (%s:%d)",
130                         td->name, __FILE__, __LINE__);
131                 return -1;
132         }
133         
134         if(st->size > 0) {
135                 /* Size in bits */
136                 size = 8 * st->size - (st->bits_unused & 0x07);
137         } else {
138                 size = 0;
139         }
140         
141         if((size == 21)) {
142                 /* Constraint check succeeded */
143                 return 0;
144         } else {
145                 ASN__CTFAIL(app_key, td, sptr,
146                         "%s: constraint failed (%s:%d)",
147                         td->name, __FILE__, __LINE__);
148                 return -1;
149         }
150 }
151
152 static asn_per_constraints_t asn_PER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
153         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
154         { APC_CONSTRAINED,       0,  0,  20,  20 }      /* (SIZE(20..20)) */,
155         0, 0    /* No PER value map */
156 };
157 static asn_per_constraints_t asn_PER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
158         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
159         { APC_CONSTRAINED,       0,  0,  28,  28 }      /* (SIZE(28..28)) */,
160         0, 0    /* No PER value map */
161 };
162 static asn_per_constraints_t asn_PER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
163         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
164         { APC_CONSTRAINED,       0,  0,  18,  18 }      /* (SIZE(18..18)) */,
165         0, 0    /* No PER value map */
166 };
167 static asn_per_constraints_t asn_PER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
168         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
169         { APC_CONSTRAINED,       0,  0,  21,  21 }      /* (SIZE(21..21)) */,
170         0, 0    /* No PER value map */
171 };
172 asn_per_constraints_t asn_PER_type_ENB_ID_constr_1 CC_NOTUSED = {
173         { APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }    /* (0..1,...) */,
174         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
175         0, 0    /* No PER value map */
176 };
177 asn_TYPE_member_t asn_MBR_ENB_ID_1[] = {
178         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.macro_eNB_ID),
179                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
180                 -1,     /* IMPLICIT tag at current level */
181                 &asn_DEF_BIT_STRING,
182                 0,
183                 { 0, &asn_PER_memb_macro_eNB_ID_constr_2,  memb_macro_eNB_ID_constraint_1 },
184                 0, 0, /* No default value */
185                 "macro-eNB-ID"
186                 },
187         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.home_eNB_ID),
188                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
189                 -1,     /* IMPLICIT tag at current level */
190                 &asn_DEF_BIT_STRING,
191                 0,
192                 { 0, &asn_PER_memb_home_eNB_ID_constr_3,  memb_home_eNB_ID_constraint_1 },
193                 0, 0, /* No default value */
194                 "home-eNB-ID"
195                 },
196         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.short_Macro_eNB_ID),
197                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
198                 -1,     /* IMPLICIT tag at current level */
199                 &asn_DEF_BIT_STRING,
200                 0,
201                 { 0, &asn_PER_memb_short_Macro_eNB_ID_constr_5,  memb_short_Macro_eNB_ID_constraint_1 },
202                 0, 0, /* No default value */
203                 "short-Macro-eNB-ID"
204                 },
205         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.long_Macro_eNB_ID),
206                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
207                 -1,     /* IMPLICIT tag at current level */
208                 &asn_DEF_BIT_STRING,
209                 0,
210                 { 0, &asn_PER_memb_long_Macro_eNB_ID_constr_6,  memb_long_Macro_eNB_ID_constraint_1 },
211                 0, 0, /* No default value */
212                 "long-Macro-eNB-ID"
213                 },
214 };
215 static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_tag2el_1[] = {
216     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* macro-eNB-ID */
217     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* home-eNB-ID */
218     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* short-Macro-eNB-ID */
219     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* long-Macro-eNB-ID */
220 };
221 asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1 = {
222         sizeof(struct ENB_ID),
223         offsetof(struct ENB_ID, _asn_ctx),
224         offsetof(struct ENB_ID, present),
225         sizeof(((struct ENB_ID *)0)->present),
226         asn_MAP_ENB_ID_tag2el_1,
227         4,      /* Count of tags in the map */
228         0, 0,
229         2       /* Extensions start */
230 };
231 asn_TYPE_descriptor_t asn_DEF_ENB_ID = {
232         "ENB-ID",
233         "ENB-ID",
234         &asn_OP_CHOICE,
235         0,      /* No effective tags (pointer) */
236         0,      /* No effective tags (count) */
237         0,      /* No tags (pointer) */
238         0,      /* No tags (count) */
239         { 0, &asn_PER_type_ENB_ID_constr_1, CHOICE_constraint },
240         asn_MBR_ENB_ID_1,
241         4,      /* Elements count */
242         &asn_SPC_ENB_ID_specs_1 /* Additional specs */
243 };
244