blob: c658e4c3d8762e357f738ea54005fcc1f7d0f0e1 [file] [log] [blame]
Lev Walkin59b176e2005-11-26 11:25:14 +00001
2/*** <<< INCLUDES [Choice] >>> ***/
3
4#include <RELATIVE-OID.h>
5#include <BIT_STRING.h>
6#include <BOOLEAN.h>
7#include <NULL.h>
Lev Walkin2a744a72013-03-27 01:56:23 -07008#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00009#include <constr_CHOICE.h>
10
11/*** <<< DEPS [Choice] >>> ***/
12
13typedef enum Choice_PR {
14 Choice_PR_NOTHING, /* No components present */
15 Choice_PR_roid,
16 Choice_PR_bitstr,
17 Choice_PR_ch,
18 /* Extensions may appear below */
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000019 Choice_PR_bool
Lev Walkin59b176e2005-11-26 11:25:14 +000020} Choice_PR;
21typedef enum ch_PR {
22 ch_PR_NOTHING, /* No components present */
23 ch_PR_null,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000024 ch_PR_int
Lev Walkin59b176e2005-11-26 11:25:14 +000025} ch_PR;
26
27/*** <<< TYPE-DECLS [Choice] >>> ***/
28
29typedef struct Choice {
30 Choice_PR present;
31 union Choice_u {
32 RELATIVE_OID_t roid;
33 BIT_STRING_t bitstr;
34 struct ch {
35 ch_PR present;
36 union Choice__ch_u {
37 NULL_t null;
Lev Walkin2a744a72013-03-27 01:56:23 -070038 long Int;
Lev Walkin59b176e2005-11-26 11:25:14 +000039 } choice;
40
41 /* Context for parsing across buffer boundaries */
42 asn_struct_ctx_t _asn_ctx;
43 } ch;
44 /*
45 * This type is extensible,
46 * possible extensions are below.
47 */
Lev Walkin2a744a72013-03-27 01:56:23 -070048 BOOLEAN_t Bool;
Lev Walkin59b176e2005-11-26 11:25:14 +000049 } choice;
50
51 /* Context for parsing across buffer boundaries */
52 asn_struct_ctx_t _asn_ctx;
53} Choice_t;
54
55/*** <<< FUNC-DECLS [Choice] >>> ***/
56
57extern asn_TYPE_descriptor_t asn_DEF_Choice;
58
Lev Walkin725883b2006-10-09 12:07:58 +000059/*** <<< CTDEFS [Choice] >>> ***/
60
Lev Walkin2fce55d2013-03-28 05:00:39 -070061static asn_per_constraints_t asn_PER_type_ch_constr_4 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +000062 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
63 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
64 0, 0 /* No PER value map */
65};
Lev Walkin2fce55d2013-03-28 05:00:39 -070066static asn_per_constraints_t asn_PER_type_Choice_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +000067 { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */,
68 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
69 0, 0 /* No PER value map */
70};
71
Lev Walkin59b176e2005-11-26 11:25:14 +000072/*** <<< STAT-DEFS [Choice] >>> ***/
73
74static asn_TYPE_member_t asn_MBR_ch_4[] = {
75 { ATF_NOFLAGS, 0, offsetof(struct ch, choice.null),
76 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
77 .tag_mode = 0,
78 .type = &asn_DEF_NULL,
79 .memb_constraints = 0, /* Defer constraints checking to the member type */
80 .per_constraints = 0, /* No PER visible constraints */
81 .default_value = 0,
82 .name = "null"
83 },
84 { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int),
85 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
86 .tag_mode = 0,
Lev Walkin2a744a72013-03-27 01:56:23 -070087 .type = &asn_DEF_NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +000088 .memb_constraints = 0, /* Defer constraints checking to the member type */
89 .per_constraints = 0, /* No PER visible constraints */
90 .default_value = 0,
91 .name = "int"
92 },
93};
Lev Walkina7591b52014-10-12 18:37:35 -070094static const int asn_MAP_ch_cmap_4[] = { 1, 0 };
95static const asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070096 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int */
97 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null */
Lev Walkin59b176e2005-11-26 11:25:14 +000098};
99static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = {
100 sizeof(struct ch),
101 offsetof(struct ch, _asn_ctx),
102 offsetof(struct ch, present),
103 sizeof(((struct ch *)0)->present),
104 asn_MAP_ch_tag2el_4,
105 2, /* Count of tags in the map */
106 .canonical_order = asn_MAP_ch_cmap_4, /* Canonically sorted */
107 .ext_start = -1 /* Extensions start */
108};
Lev Walkin59b176e2005-11-26 11:25:14 +0000109static /* Use -fall-defs-global to expose */
110asn_TYPE_descriptor_t asn_DEF_ch_4 = {
111 "ch",
112 "ch",
113 CHOICE_free,
114 CHOICE_print,
115 CHOICE_constraint,
116 CHOICE_decode_ber,
117 CHOICE_encode_der,
118 CHOICE_decode_xer,
119 CHOICE_encode_xer,
120 CHOICE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000121 CHOICE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000122 CHOICE_outmost_tag,
123 0, /* No effective tags (pointer) */
124 0, /* No effective tags (count) */
125 0, /* No tags (pointer) */
126 0, /* No tags (count) */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000127 &asn_PER_type_ch_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +0000128 asn_MBR_ch_4,
129 2, /* Elements count */
130 &asn_SPC_ch_specs_4 /* Additional specs */
131};
132
Lev Walkin59b176e2005-11-26 11:25:14 +0000133static asn_TYPE_member_t asn_MBR_Choice_1[] = {
134 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid),
135 .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
136 .tag_mode = 0,
137 .type = &asn_DEF_RELATIVE_OID,
138 .memb_constraints = 0, /* Defer constraints checking to the member type */
139 .per_constraints = 0, /* No PER visible constraints */
140 .default_value = 0,
141 .name = "roid"
142 },
143 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr),
144 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
145 .tag_mode = 0,
146 .type = &asn_DEF_BIT_STRING,
147 .memb_constraints = 0, /* Defer constraints checking to the member type */
148 .per_constraints = 0, /* No PER visible constraints */
149 .default_value = 0,
150 .name = "bitstr"
151 },
152 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch),
153 .tag = -1 /* Ambiguous tag (CHOICE?) */,
154 .tag_mode = 0,
155 .type = &asn_DEF_ch_4,
156 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin07aaa342006-10-09 12:52:15 +0000157 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000158 .default_value = 0,
159 .name = "ch"
160 },
Lev Walkin2a744a72013-03-27 01:56:23 -0700161 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +0000162 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
163 .tag_mode = 0,
164 .type = &asn_DEF_BOOLEAN,
165 .memb_constraints = 0, /* Defer constraints checking to the member type */
166 .per_constraints = 0, /* No PER visible constraints */
167 .default_value = 0,
168 .name = "bool"
169 },
170};
Lev Walkina7591b52014-10-12 18:37:35 -0700171static const int asn_MAP_Choice_cmap_1[] = { 2, 1, 0, 3 };
172static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700173 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
174 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int */
175 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr */
176 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null */
177 { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid */
Lev Walkin59b176e2005-11-26 11:25:14 +0000178};
179static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = {
180 sizeof(struct Choice),
181 offsetof(struct Choice, _asn_ctx),
182 offsetof(struct Choice, present),
183 sizeof(((struct Choice *)0)->present),
184 asn_MAP_Choice_tag2el_1,
185 5, /* Count of tags in the map */
186 .canonical_order = asn_MAP_Choice_cmap_1, /* Canonically sorted */
187 .ext_start = 3 /* Extensions start */
188};
Lev Walkin59b176e2005-11-26 11:25:14 +0000189asn_TYPE_descriptor_t asn_DEF_Choice = {
190 "Choice",
191 "Choice",
192 CHOICE_free,
193 CHOICE_print,
194 CHOICE_constraint,
195 CHOICE_decode_ber,
196 CHOICE_encode_der,
197 CHOICE_decode_xer,
198 CHOICE_encode_xer,
199 CHOICE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000200 CHOICE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000201 CHOICE_outmost_tag,
202 0, /* No effective tags (pointer) */
203 0, /* No effective tags (count) */
204 0, /* No tags (pointer) */
205 0, /* No tags (count) */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000206 &asn_PER_type_Choice_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000207 asn_MBR_Choice_1,
208 4, /* Elements count */
209 &asn_SPC_Choice_specs_1 /* Additional specs */
210};
211
212
213/*** <<< INCLUDES [Choice2] >>> ***/
214
215#include <BIT_STRING.h>
216#include <RELATIVE-OID.h>
217#include <constr_CHOICE.h>
218
219/*** <<< DEPS [Choice2] >>> ***/
220
221typedef enum Choice2_PR {
222 Choice2_PR_NOTHING, /* No components present */
223 Choice2_PR_bitstr,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000224 Choice2_PR_roid
Lev Walkin59b176e2005-11-26 11:25:14 +0000225} Choice2_PR;
226
227/*** <<< TYPE-DECLS [Choice2] >>> ***/
228
229typedef struct Choice2 {
230 Choice2_PR present;
231 union Choice2_u {
232 BIT_STRING_t bitstr;
233 RELATIVE_OID_t roid;
234 } choice;
235
236 /* Context for parsing across buffer boundaries */
237 asn_struct_ctx_t _asn_ctx;
238} Choice2_t;
239
240/*** <<< FUNC-DECLS [Choice2] >>> ***/
241
242extern asn_TYPE_descriptor_t asn_DEF_Choice2;
243
Lev Walkin725883b2006-10-09 12:07:58 +0000244/*** <<< CTDEFS [Choice2] >>> ***/
245
Lev Walkin2fce55d2013-03-28 05:00:39 -0700246static asn_per_constraints_t asn_PER_type_Choice2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000247 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
248 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
249 0, 0 /* No PER value map */
250};
251
Lev Walkin59b176e2005-11-26 11:25:14 +0000252/*** <<< STAT-DEFS [Choice2] >>> ***/
253
254static asn_TYPE_member_t asn_MBR_Choice2_1[] = {
255 { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr),
256 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
257 .tag_mode = +1, /* EXPLICIT tag at current level */
258 .type = &asn_DEF_BIT_STRING,
259 .memb_constraints = 0, /* Defer constraints checking to the member type */
260 .per_constraints = 0, /* No PER visible constraints */
261 .default_value = 0,
262 .name = "bitstr"
263 },
264 { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid),
265 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
266 .tag_mode = +1, /* EXPLICIT tag at current level */
267 .type = &asn_DEF_RELATIVE_OID,
268 .memb_constraints = 0, /* Defer constraints checking to the member type */
269 .per_constraints = 0, /* No PER visible constraints */
270 .default_value = 0,
271 .name = "roid"
272 },
273};
Lev Walkina7591b52014-10-12 18:37:35 -0700274static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700275 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr */
276 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid */
Lev Walkin59b176e2005-11-26 11:25:14 +0000277};
278static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
279 sizeof(struct Choice2),
280 offsetof(struct Choice2, _asn_ctx),
281 offsetof(struct Choice2, present),
282 sizeof(((struct Choice2 *)0)->present),
283 asn_MAP_Choice2_tag2el_1,
284 2, /* Count of tags in the map */
285 .canonical_order = 0,
286 .ext_start = -1 /* Extensions start */
287};
Lev Walkin59b176e2005-11-26 11:25:14 +0000288asn_TYPE_descriptor_t asn_DEF_Choice2 = {
289 "Choice2",
290 "Choice2",
291 CHOICE_free,
292 CHOICE_print,
293 CHOICE_constraint,
294 CHOICE_decode_ber,
295 CHOICE_encode_der,
296 CHOICE_decode_xer,
297 CHOICE_encode_xer,
298 CHOICE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000299 CHOICE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000300 CHOICE_outmost_tag,
301 0, /* No effective tags (pointer) */
302 0, /* No effective tags (count) */
303 0, /* No tags (pointer) */
304 0, /* No tags (count) */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000305 &asn_PER_type_Choice2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000306 asn_MBR_Choice2_1,
307 2, /* Elements count */
308 &asn_SPC_Choice2_specs_1 /* Additional specs */
309};
310