9b07ba70d55ada8af4b967495bfb6c11c9b045a8
[sim/e2-interface.git] / e2sim / asn1c / NgENB-ID.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2SM-COMMON-IEs"
4  *      found in "e2sm-v03.01.asn"
5  *      `asn1c -pdu=auto -fincludes-quoted -fcompound-names -findirect-choice -fno-include-deps -no-gen-example -no-gen-OER -D /tmp/workspace/oransim-gerrit/e2sim/asn1c/`
6  */
7
8 #include "NgENB-ID.h"
9
10 static int
11 memb_macroNgENB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
14         size_t size;
15         
16         if(!sptr) {
17                 ASN__CTFAIL(app_key, td, sptr,
18                         "%s: value not given (%s:%d)",
19                         td->name, __FILE__, __LINE__);
20                 return -1;
21         }
22         
23         if(st->size > 0) {
24                 /* Size in bits */
25                 size = 8 * st->size - (st->bits_unused & 0x07);
26         } else {
27                 size = 0;
28         }
29         
30         if((size == 20UL)) {
31                 /* Constraint check succeeded */
32                 return 0;
33         } else {
34                 ASN__CTFAIL(app_key, td, sptr,
35                         "%s: constraint failed (%s:%d)",
36                         td->name, __FILE__, __LINE__);
37                 return -1;
38         }
39 }
40
41 static int
42 memb_shortMacroNgENB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
43                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
45         size_t size;
46         
47         if(!sptr) {
48                 ASN__CTFAIL(app_key, td, sptr,
49                         "%s: value not given (%s:%d)",
50                         td->name, __FILE__, __LINE__);
51                 return -1;
52         }
53         
54         if(st->size > 0) {
55                 /* Size in bits */
56                 size = 8 * st->size - (st->bits_unused & 0x07);
57         } else {
58                 size = 0;
59         }
60         
61         if((size == 18UL)) {
62                 /* Constraint check succeeded */
63                 return 0;
64         } else {
65                 ASN__CTFAIL(app_key, td, sptr,
66                         "%s: constraint failed (%s:%d)",
67                         td->name, __FILE__, __LINE__);
68                 return -1;
69         }
70 }
71
72 static int
73 memb_longMacroNgENB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
74                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
75         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
76         size_t size;
77         
78         if(!sptr) {
79                 ASN__CTFAIL(app_key, td, sptr,
80                         "%s: value not given (%s:%d)",
81                         td->name, __FILE__, __LINE__);
82                 return -1;
83         }
84         
85         if(st->size > 0) {
86                 /* Size in bits */
87                 size = 8 * st->size - (st->bits_unused & 0x07);
88         } else {
89                 size = 0;
90         }
91         
92         if((size == 21UL)) {
93                 /* Constraint check succeeded */
94                 return 0;
95         } else {
96                 ASN__CTFAIL(app_key, td, sptr,
97                         "%s: constraint failed (%s:%d)",
98                         td->name, __FILE__, __LINE__);
99                 return -1;
100         }
101 }
102
103 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
104 static asn_per_constraints_t asn_PER_memb_macroNgENB_ID_constr_2 CC_NOTUSED = {
105         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
106         { APC_CONSTRAINED,       0,  0,  20,  20 }      /* (SIZE(20..20)) */,
107         0, 0    /* No PER value map */
108 };
109 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
110 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
111 static asn_per_constraints_t asn_PER_memb_shortMacroNgENB_ID_constr_3 CC_NOTUSED = {
112         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
113         { APC_CONSTRAINED,       0,  0,  18,  18 }      /* (SIZE(18..18)) */,
114         0, 0    /* No PER value map */
115 };
116 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
117 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
118 static asn_per_constraints_t asn_PER_memb_longMacroNgENB_ID_constr_4 CC_NOTUSED = {
119         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
120         { APC_CONSTRAINED,       0,  0,  21,  21 }      /* (SIZE(21..21)) */,
121         0, 0    /* No PER value map */
122 };
123 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
124 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
125 asn_per_constraints_t asn_PER_type_NgENB_ID_constr_1 CC_NOTUSED = {
126         { APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }    /* (0..2,...) */,
127         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
128         0, 0    /* No PER value map */
129 };
130 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
131 asn_TYPE_member_t asn_MBR_NgENB_ID_1[] = {
132         { ATF_NOFLAGS, 0, offsetof(struct NgENB_ID, choice.macroNgENB_ID),
133                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
134                 -1,     /* IMPLICIT tag at current level */
135                 &asn_DEF_BIT_STRING,
136                 0,
137                 {
138 #if !defined(ASN_DISABLE_OER_SUPPORT)
139                         0,
140 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
141 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
142                         &asn_PER_memb_macroNgENB_ID_constr_2,
143 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
144                         memb_macroNgENB_ID_constraint_1
145                 },
146                 0, 0, /* No default value */
147                 "macroNgENB-ID"
148                 },
149         { ATF_NOFLAGS, 0, offsetof(struct NgENB_ID, choice.shortMacroNgENB_ID),
150                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
151                 -1,     /* IMPLICIT tag at current level */
152                 &asn_DEF_BIT_STRING,
153                 0,
154                 {
155 #if !defined(ASN_DISABLE_OER_SUPPORT)
156                         0,
157 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
158 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
159                         &asn_PER_memb_shortMacroNgENB_ID_constr_3,
160 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
161                         memb_shortMacroNgENB_ID_constraint_1
162                 },
163                 0, 0, /* No default value */
164                 "shortMacroNgENB-ID"
165                 },
166         { ATF_NOFLAGS, 0, offsetof(struct NgENB_ID, choice.longMacroNgENB_ID),
167                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
168                 -1,     /* IMPLICIT tag at current level */
169                 &asn_DEF_BIT_STRING,
170                 0,
171                 {
172 #if !defined(ASN_DISABLE_OER_SUPPORT)
173                         0,
174 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
175 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
176                         &asn_PER_memb_longMacroNgENB_ID_constr_4,
177 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
178                         memb_longMacroNgENB_ID_constraint_1
179                 },
180                 0, 0, /* No default value */
181                 "longMacroNgENB-ID"
182                 },
183 };
184 static const asn_TYPE_tag2member_t asn_MAP_NgENB_ID_tag2el_1[] = {
185     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* macroNgENB-ID */
186     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* shortMacroNgENB-ID */
187     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* longMacroNgENB-ID */
188 };
189 asn_CHOICE_specifics_t asn_SPC_NgENB_ID_specs_1 = {
190         sizeof(struct NgENB_ID),
191         offsetof(struct NgENB_ID, _asn_ctx),
192         offsetof(struct NgENB_ID, present),
193         sizeof(((struct NgENB_ID *)0)->present),
194         asn_MAP_NgENB_ID_tag2el_1,
195         3,      /* Count of tags in the map */
196         0, 0,
197         3       /* Extensions start */
198 };
199 asn_TYPE_descriptor_t asn_DEF_NgENB_ID = {
200         "NgENB-ID",
201         "NgENB-ID",
202         &asn_OP_CHOICE,
203         0,      /* No effective tags (pointer) */
204         0,      /* No effective tags (count) */
205         0,      /* No tags (pointer) */
206         0,      /* No tags (count) */
207         {
208 #if !defined(ASN_DISABLE_OER_SUPPORT)
209                 0,
210 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
211 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
212                 &asn_PER_type_NgENB_ID_constr_1,
213 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
214                 CHOICE_constraint
215         },
216         asn_MBR_NgENB_ID_1,
217         3,      /* Elements count */
218         &asn_SPC_NgENB_ID_specs_1       /* Additional specs */
219 };
220