Add User-level metrics
[sim/e2-interface.git] / e2sim / e2apv1sim / ASN1c / ENB-ID-Choice.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2SM-KPM-IEs"
4  *      found in "/home/rshacham/e2sm-kpm-v01.02.asn"
5  *      `asn1c -fcompound-names`
6  */
7
8 #include "ENB-ID-Choice.h"
9
10 static int
11 memb_enb_ID_macro_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 == 20)) {
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_enb_ID_shortmacro_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 == 18)) {
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_enb_ID_longmacro_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 == 21)) {
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 static asn_oer_constraints_t asn_OER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
104         { 0, 0 },
105         20      /* (SIZE(20..20)) */};
106 static asn_per_constraints_t asn_PER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
107         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
108         { APC_CONSTRAINED,       0,  0,  20,  20 }      /* (SIZE(20..20)) */,
109         0, 0    /* No PER value map */
110 };
111 static asn_oer_constraints_t asn_OER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
112         { 0, 0 },
113         18      /* (SIZE(18..18)) */};
114 static asn_per_constraints_t asn_PER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
115         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
116         { APC_CONSTRAINED,       0,  0,  18,  18 }      /* (SIZE(18..18)) */,
117         0, 0    /* No PER value map */
118 };
119 static asn_oer_constraints_t asn_OER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
120         { 0, 0 },
121         21      /* (SIZE(21..21)) */};
122 static asn_per_constraints_t asn_PER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
123         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
124         { APC_CONSTRAINED,       0,  0,  21,  21 }      /* (SIZE(21..21)) */,
125         0, 0    /* No PER value map */
126 };
127 static asn_oer_constraints_t asn_OER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
128         { 0, 0 },
129         -1};
130 asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
131         { APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }    /* (0..2,...) */,
132         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
133         0, 0    /* No PER value map */
134 };
135 asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[] = {
136         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_macro),
137                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
138                 -1,     /* IMPLICIT tag at current level */
139                 &asn_DEF_BIT_STRING,
140                 0,
141                 { &asn_OER_memb_enb_ID_macro_constr_2, &asn_PER_memb_enb_ID_macro_constr_2,  memb_enb_ID_macro_constraint_1 },
142                 0, 0, /* No default value */
143                 "enb-ID-macro"
144                 },
145         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_shortmacro),
146                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
147                 -1,     /* IMPLICIT tag at current level */
148                 &asn_DEF_BIT_STRING,
149                 0,
150                 { &asn_OER_memb_enb_ID_shortmacro_constr_3, &asn_PER_memb_enb_ID_shortmacro_constr_3,  memb_enb_ID_shortmacro_constraint_1 },
151                 0, 0, /* No default value */
152                 "enb-ID-shortmacro"
153                 },
154         { ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_longmacro),
155                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
156                 -1,     /* IMPLICIT tag at current level */
157                 &asn_DEF_BIT_STRING,
158                 0,
159                 { &asn_OER_memb_enb_ID_longmacro_constr_4, &asn_PER_memb_enb_ID_longmacro_constr_4,  memb_enb_ID_longmacro_constraint_1 },
160                 0, 0, /* No default value */
161                 "enb-ID-longmacro"
162                 },
163 };
164 static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_Choice_tag2el_1[] = {
165     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* enb-ID-macro */
166     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* enb-ID-shortmacro */
167     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* enb-ID-longmacro */
168 };
169 asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1 = {
170         sizeof(struct ENB_ID_Choice),
171         offsetof(struct ENB_ID_Choice, _asn_ctx),
172         offsetof(struct ENB_ID_Choice, present),
173         sizeof(((struct ENB_ID_Choice *)0)->present),
174         asn_MAP_ENB_ID_Choice_tag2el_1,
175         3,      /* Count of tags in the map */
176         0, 0,
177         3       /* Extensions start */
178 };
179 asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice = {
180         "ENB-ID-Choice",
181         "ENB-ID-Choice",
182         &asn_OP_CHOICE,
183         0,      /* No effective tags (pointer) */
184         0,      /* No effective tags (count) */
185         0,      /* No tags (pointer) */
186         0,      /* No tags (count) */
187         { &asn_OER_type_ENB_ID_Choice_constr_1, &asn_PER_type_ENB_ID_Choice_constr_1, CHOICE_constraint },
188         asn_MBR_ENB_ID_Choice_1,
189         3,      /* Elements count */
190         &asn_SPC_ENB_ID_Choice_specs_1  /* Additional specs */
191 };
192