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