408d8d39c587d700f2f109e4f2273aca87df65aa
[ric-plt/resource-status-manager.git] / RSM / 3rdparty / asn1codec / e2ap_engine / ENB-ID.c
1 /*
2  * Copyright 2019 AT&T Intellectual Property
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * This source code is part of the near-RT RIC (RAN Intelligent Controller)
19  * platform project (RICP).
20  */
21
22
23
24 /*
25  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
26  * From ASN.1 module "X2AP-IEs"
27  *      found in "../../asnFiles/X2AP-IEs.asn"
28  *      `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D.`
29  */
30
31 #include "ENB-ID.h"
32
33 static int
34 memb_macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
35                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
36         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
37         size_t size;
38         
39         if(!sptr) {
40                 ASN__CTFAIL(app_key, td, sptr,
41                         "%s: value not given (%s:%d)",
42                         td->name, __FILE__, __LINE__);
43                 return -1;
44         }
45         
46         if(st->size > 0) {
47                 /* Size in bits */
48                 size = 8 * st->size - (st->bits_unused & 0x07);
49         } else {
50                 size = 0;
51         }
52         
53         if((size == 20)) {
54                 /* Constraint check succeeded */
55                 return 0;
56         } else {
57                 ASN__CTFAIL(app_key, td, sptr,
58                         "%s: constraint failed (%s:%d)",
59                         td->name, __FILE__, __LINE__);
60                 return -1;
61         }
62 }
63
64 static int
65 memb_home_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
66                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
67         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
68         size_t size;
69         
70         if(!sptr) {
71                 ASN__CTFAIL(app_key, td, sptr,
72                         "%s: value not given (%s:%d)",
73                         td->name, __FILE__, __LINE__);
74                 return -1;
75         }
76         
77         if(st->size > 0) {
78                 /* Size in bits */
79                 size = 8 * st->size - (st->bits_unused & 0x07);
80         } else {
81                 size = 0;
82         }
83         
84         if((size == 28)) {
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_short_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
97                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
98         const BIT_STRING_t *st = (const BIT_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         if(st->size > 0) {
109                 /* Size in bits */
110                 size = 8 * st->size - (st->bits_unused & 0x07);
111         } else {
112                 size = 0;
113         }
114         
115         if((size == 18)) {
116                 /* Constraint check succeeded */
117                 return 0;
118         } else {
119                 ASN__CTFAIL(app_key, td, sptr,
120                         "%s: constraint failed (%s:%d)",
121                         td->name, __FILE__, __LINE__);
122                 return -1;
123         }
124 }
125
126 static int
127 memb_long_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
128                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
129         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
130         size_t size;
131         
132         if(!sptr) {
133                 ASN__CTFAIL(app_key, td, sptr,
134                         "%s: value not given (%s:%d)",
135                         td->name, __FILE__, __LINE__);
136                 return -1;
137         }
138         
139         if(st->size > 0) {
140                 /* Size in bits */
141                 size = 8 * st->size - (st->bits_unused & 0x07);
142         } else {
143                 size = 0;
144         }
145         
146         if((size == 21)) {
147                 /* Constraint check succeeded */
148                 return 0;
149         } else {
150                 ASN__CTFAIL(app_key, td, sptr,
151                         "%s: constraint failed (%s:%d)",
152                         td->name, __FILE__, __LINE__);
153                 return -1;
154         }
155 }
156
157 static asn_per_constraints_t asn_PER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
158         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
159         { APC_CONSTRAINED,       0,  0,  20,  20 }      /* (SIZE(20..20)) */,
160         0, 0    /* No PER value map */
161 };
162 static asn_per_constraints_t asn_PER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
163         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
164         { APC_CONSTRAINED,       0,  0,  28,  28 }      /* (SIZE(28..28)) */,
165         0, 0    /* No PER value map */
166 };
167 static asn_per_constraints_t asn_PER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
168         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
169         { APC_CONSTRAINED,       0,  0,  18,  18 }      /* (SIZE(18..18)) */,
170         0, 0    /* No PER value map */
171 };
172 static asn_per_constraints_t asn_PER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
173         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
174         { APC_CONSTRAINED,       0,  0,  21,  21 }      /* (SIZE(21..21)) */,
175         0, 0    /* No PER value map */
176 };
177 asn_per_constraints_t asn_PER_type_ENB_ID_constr_1 CC_NOTUSED = {
178         { APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }    /* (0..1,...) */,
179         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
180         0, 0    /* No PER value map */
181 };
182 asn_TYPE_member_t asn_MBR_ENB_ID_1[] = {
183         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.macro_eNB_ID),
184                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
185                 -1,     /* IMPLICIT tag at current level */
186                 &asn_DEF_BIT_STRING,
187                 0,
188                 { 0, &asn_PER_memb_macro_eNB_ID_constr_2,  memb_macro_eNB_ID_constraint_1 },
189                 0, 0, /* No default value */
190                 "macro-eNB-ID"
191                 },
192         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.home_eNB_ID),
193                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
194                 -1,     /* IMPLICIT tag at current level */
195                 &asn_DEF_BIT_STRING,
196                 0,
197                 { 0, &asn_PER_memb_home_eNB_ID_constr_3,  memb_home_eNB_ID_constraint_1 },
198                 0, 0, /* No default value */
199                 "home-eNB-ID"
200                 },
201         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.short_Macro_eNB_ID),
202                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
203                 -1,     /* IMPLICIT tag at current level */
204                 &asn_DEF_BIT_STRING,
205                 0,
206                 { 0, &asn_PER_memb_short_Macro_eNB_ID_constr_5,  memb_short_Macro_eNB_ID_constraint_1 },
207                 0, 0, /* No default value */
208                 "short-Macro-eNB-ID"
209                 },
210         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.long_Macro_eNB_ID),
211                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
212                 -1,     /* IMPLICIT tag at current level */
213                 &asn_DEF_BIT_STRING,
214                 0,
215                 { 0, &asn_PER_memb_long_Macro_eNB_ID_constr_6,  memb_long_Macro_eNB_ID_constraint_1 },
216                 0, 0, /* No default value */
217                 "long-Macro-eNB-ID"
218                 },
219 };
220 static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_tag2el_1[] = {
221     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* macro-eNB-ID */
222     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* home-eNB-ID */
223     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* short-Macro-eNB-ID */
224     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* long-Macro-eNB-ID */
225 };
226 asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1 = {
227         sizeof(struct ENB_ID),
228         offsetof(struct ENB_ID, _asn_ctx),
229         offsetof(struct ENB_ID, present),
230         sizeof(((struct ENB_ID *)0)->present),
231         asn_MAP_ENB_ID_tag2el_1,
232         4,      /* Count of tags in the map */
233         0, 0,
234         2       /* Extensions start */
235 };
236 asn_TYPE_descriptor_t asn_DEF_ENB_ID = {
237         "ENB-ID",
238         "ENB-ID",
239         &asn_OP_CHOICE,
240         0,      /* No effective tags (pointer) */
241         0,      /* No effective tags (count) */
242         0,      /* No tags (pointer) */
243         0,      /* No tags (count) */
244         { 0, &asn_PER_type_ENB_ID_constr_1, CHOICE_constraint },
245         asn_MBR_ENB_ID_1,
246         4,      /* Elements count */
247         &asn_SPC_ENB_ID_specs_1 /* Additional specs */
248 };
249