blob: 8d498256d08664915cefb6342a51e7495488a36c [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,
Lev Walkin67a30122017-08-10 05:48:54 -070079 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +000080 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040081 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000082 .per_constraints = 0, /* No PER visible constraints */
83 .default_value = 0,
84 .name = "null"
85 },
86 { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int),
87 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
88 .tag_mode = 0,
Lev Walkin2a744a72013-03-27 01:56:23 -070089 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -070090 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +000091 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040092 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000093 .per_constraints = 0, /* No PER visible constraints */
94 .default_value = 0,
95 .name = "int"
96 },
97};
Lev Walkin18660d22017-08-12 20:45:23 -070098static const unsigned asn_MAP_ch_cmap_4[] = { 1, 0 };
Lev Walkina7591b52014-10-12 18:37:35 -070099static const asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700100 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int */
101 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null */
Lev Walkin59b176e2005-11-26 11:25:14 +0000102};
103static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = {
104 sizeof(struct ch),
105 offsetof(struct ch, _asn_ctx),
106 offsetof(struct ch, present),
107 sizeof(((struct ch *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700108 .tag2el = asn_MAP_ch_tag2el_4,
109 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000110 .canonical_order = asn_MAP_ch_cmap_4, /* Canonically sorted */
111 .ext_start = -1 /* Extensions start */
112};
Lev Walkin59b176e2005-11-26 11:25:14 +0000113static /* Use -fall-defs-global to expose */
114asn_TYPE_descriptor_t asn_DEF_ch_4 = {
115 "ch",
116 "ch",
117 CHOICE_free,
118 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700119 CHOICE_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000120 CHOICE_constraint,
121 CHOICE_decode_ber,
122 CHOICE_encode_der,
123 CHOICE_decode_xer,
124 CHOICE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400125 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000126 CHOICE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000127 CHOICE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000128 CHOICE_outmost_tag,
129 0, /* No effective tags (pointer) */
130 0, /* No effective tags (count) */
131 0, /* No tags (pointer) */
132 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400133 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000134 &asn_PER_type_ch_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +0000135 asn_MBR_ch_4,
136 2, /* Elements count */
137 &asn_SPC_ch_specs_4 /* Additional specs */
138};
139
Lev Walkin59b176e2005-11-26 11:25:14 +0000140static asn_TYPE_member_t asn_MBR_Choice_1[] = {
141 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid),
142 .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
143 .tag_mode = 0,
144 .type = &asn_DEF_RELATIVE_OID,
Lev Walkin67a30122017-08-10 05:48:54 -0700145 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000146 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400147 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000148 .per_constraints = 0, /* No PER visible constraints */
149 .default_value = 0,
150 .name = "roid"
151 },
152 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr),
153 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
154 .tag_mode = 0,
155 .type = &asn_DEF_BIT_STRING,
Lev Walkin67a30122017-08-10 05:48:54 -0700156 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000157 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400158 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000159 .per_constraints = 0, /* No PER visible constraints */
160 .default_value = 0,
161 .name = "bitstr"
162 },
163 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch),
164 .tag = -1 /* Ambiguous tag (CHOICE?) */,
165 .tag_mode = 0,
166 .type = &asn_DEF_ch_4,
Lev Walkin67a30122017-08-10 05:48:54 -0700167 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000168 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400169 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin07aaa342006-10-09 12:52:15 +0000170 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000171 .default_value = 0,
172 .name = "ch"
173 },
Lev Walkin2a744a72013-03-27 01:56:23 -0700174 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +0000175 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
176 .tag_mode = 0,
177 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -0700178 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000179 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400180 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000181 .per_constraints = 0, /* No PER visible constraints */
182 .default_value = 0,
183 .name = "bool"
184 },
185};
Lev Walkin18660d22017-08-12 20:45:23 -0700186static const unsigned asn_MAP_Choice_cmap_1[] = { 2, 1, 0, 3 };
Lev Walkina7591b52014-10-12 18:37:35 -0700187static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700188 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
189 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int */
190 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr */
191 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null */
192 { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid */
Lev Walkin59b176e2005-11-26 11:25:14 +0000193};
194static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = {
195 sizeof(struct Choice),
196 offsetof(struct Choice, _asn_ctx),
197 offsetof(struct Choice, present),
198 sizeof(((struct Choice *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700199 .tag2el = asn_MAP_Choice_tag2el_1,
200 .tag2el_count = 5, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000201 .canonical_order = asn_MAP_Choice_cmap_1, /* Canonically sorted */
202 .ext_start = 3 /* Extensions start */
203};
Lev Walkin59b176e2005-11-26 11:25:14 +0000204asn_TYPE_descriptor_t asn_DEF_Choice = {
205 "Choice",
206 "Choice",
207 CHOICE_free,
208 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700209 CHOICE_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000210 CHOICE_constraint,
211 CHOICE_decode_ber,
212 CHOICE_encode_der,
213 CHOICE_decode_xer,
214 CHOICE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400215 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000216 CHOICE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000217 CHOICE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000218 CHOICE_outmost_tag,
219 0, /* No effective tags (pointer) */
220 0, /* No effective tags (count) */
221 0, /* No tags (pointer) */
222 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400223 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000224 &asn_PER_type_Choice_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000225 asn_MBR_Choice_1,
226 4, /* Elements count */
227 &asn_SPC_Choice_specs_1 /* Additional specs */
228};
229
230
231/*** <<< INCLUDES [Choice2] >>> ***/
232
233#include <BIT_STRING.h>
234#include <RELATIVE-OID.h>
235#include <constr_CHOICE.h>
236
237/*** <<< DEPS [Choice2] >>> ***/
238
239typedef enum Choice2_PR {
240 Choice2_PR_NOTHING, /* No components present */
241 Choice2_PR_bitstr,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000242 Choice2_PR_roid
Lev Walkin59b176e2005-11-26 11:25:14 +0000243} Choice2_PR;
244
245/*** <<< TYPE-DECLS [Choice2] >>> ***/
246
247typedef struct Choice2 {
248 Choice2_PR present;
249 union Choice2_u {
250 BIT_STRING_t bitstr;
251 RELATIVE_OID_t roid;
252 } choice;
253
254 /* Context for parsing across buffer boundaries */
255 asn_struct_ctx_t _asn_ctx;
256} Choice2_t;
257
258/*** <<< FUNC-DECLS [Choice2] >>> ***/
259
260extern asn_TYPE_descriptor_t asn_DEF_Choice2;
261
Lev Walkin725883b2006-10-09 12:07:58 +0000262/*** <<< CTDEFS [Choice2] >>> ***/
263
Lev Walkin2fce55d2013-03-28 05:00:39 -0700264static asn_per_constraints_t asn_PER_type_Choice2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000265 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
266 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
267 0, 0 /* No PER value map */
268};
269
Lev Walkin59b176e2005-11-26 11:25:14 +0000270/*** <<< STAT-DEFS [Choice2] >>> ***/
271
272static asn_TYPE_member_t asn_MBR_Choice2_1[] = {
273 { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr),
274 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
275 .tag_mode = +1, /* EXPLICIT tag at current level */
276 .type = &asn_DEF_BIT_STRING,
Lev Walkin67a30122017-08-10 05:48:54 -0700277 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000278 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400279 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000280 .per_constraints = 0, /* No PER visible constraints */
281 .default_value = 0,
282 .name = "bitstr"
283 },
284 { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid),
285 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
286 .tag_mode = +1, /* EXPLICIT tag at current level */
287 .type = &asn_DEF_RELATIVE_OID,
Lev Walkin67a30122017-08-10 05:48:54 -0700288 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000289 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400290 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000291 .per_constraints = 0, /* No PER visible constraints */
292 .default_value = 0,
293 .name = "roid"
294 },
295};
Lev Walkina7591b52014-10-12 18:37:35 -0700296static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700297 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr */
298 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid */
Lev Walkin59b176e2005-11-26 11:25:14 +0000299};
300static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
301 sizeof(struct Choice2),
302 offsetof(struct Choice2, _asn_ctx),
303 offsetof(struct Choice2, present),
304 sizeof(((struct Choice2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700305 .tag2el = asn_MAP_Choice2_tag2el_1,
306 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000307 .canonical_order = 0,
308 .ext_start = -1 /* Extensions start */
309};
Lev Walkin59b176e2005-11-26 11:25:14 +0000310asn_TYPE_descriptor_t asn_DEF_Choice2 = {
311 "Choice2",
312 "Choice2",
313 CHOICE_free,
314 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700315 CHOICE_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000316 CHOICE_constraint,
317 CHOICE_decode_ber,
318 CHOICE_encode_der,
319 CHOICE_decode_xer,
320 CHOICE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400321 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000322 CHOICE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000323 CHOICE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000324 CHOICE_outmost_tag,
325 0, /* No effective tags (pointer) */
326 0, /* No effective tags (count) */
327 0, /* No tags (pointer) */
328 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400329 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000330 &asn_PER_type_Choice2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000331 asn_MBR_Choice2_1,
332 2, /* Elements count */
333 &asn_SPC_Choice2_specs_1 /* Additional specs */
334};
335