blob: ae45367b83774e14144016334863456b094aae28 [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 Walkin0479e042017-09-26 18:39:58 -070061static asn_per_constraints_t asn_PER_type_ch_constr_4 CC_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 Walkin0479e042017-09-26 18:39:58 -070066static asn_per_constraints_t asn_PER_type_Choice_constr_1 CC_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 Walkin0bfea562017-09-29 23:16:48 -070080 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070081 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +000082 .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 Walkin67a30122017-08-10 05:48:54 -070088 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070089 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070090 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +000091 .name = "int"
92 },
93};
Lev Walkin20696a42017-10-17 21:27:33 -070094static const unsigned asn_MAP_ch_to_canonical_4[] = { 1, 0 };
95static const unsigned asn_MAP_ch_from_canonical_4[] = { 1, 0 };
Lev Walkina7591b52014-10-12 18:37:35 -070096static const asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070097 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int */
98 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null */
Lev Walkin59b176e2005-11-26 11:25:14 +000099};
100static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = {
101 sizeof(struct ch),
102 offsetof(struct ch, _asn_ctx),
103 offsetof(struct ch, present),
104 sizeof(((struct ch *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700105 .tag2el = asn_MAP_ch_tag2el_4,
106 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700107 .to_canonical_order = asn_MAP_ch_to_canonical_4,
108 .from_canonical_order = asn_MAP_ch_from_canonical_4,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700109 .first_extension = -1 /* Extensions start */
Lev Walkin59b176e2005-11-26 11:25:14 +0000110};
Lev Walkin59b176e2005-11-26 11:25:14 +0000111static /* Use -fall-defs-global to expose */
112asn_TYPE_descriptor_t asn_DEF_ch_4 = {
113 "ch",
114 "ch",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800115 &asn_OP_CHOICE,
Lev Walkin59b176e2005-11-26 11:25:14 +0000116 0, /* No effective tags (pointer) */
117 0, /* No effective tags (count) */
118 0, /* No tags (pointer) */
119 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700120 { 0, &asn_PER_type_ch_constr_4, CHOICE_constraint },
Lev Walkin59b176e2005-11-26 11:25:14 +0000121 asn_MBR_ch_4,
122 2, /* Elements count */
123 &asn_SPC_ch_specs_4 /* Additional specs */
124};
125
Lev Walkin59b176e2005-11-26 11:25:14 +0000126static asn_TYPE_member_t asn_MBR_Choice_1[] = {
127 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid),
128 .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
129 .tag_mode = 0,
130 .type = &asn_DEF_RELATIVE_OID,
Lev Walkin67a30122017-08-10 05:48:54 -0700131 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700132 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700133 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000134 .name = "roid"
135 },
136 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr),
137 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
138 .tag_mode = 0,
139 .type = &asn_DEF_BIT_STRING,
Lev Walkin67a30122017-08-10 05:48:54 -0700140 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700141 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700142 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000143 .name = "bitstr"
144 },
145 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch),
146 .tag = -1 /* Ambiguous tag (CHOICE?) */,
147 .tag_mode = 0,
148 .type = &asn_DEF_ch_4,
Lev Walkin67a30122017-08-10 05:48:54 -0700149 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700150 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700151 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000152 .name = "ch"
153 },
Lev Walkin2a744a72013-03-27 01:56:23 -0700154 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +0000155 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
156 .tag_mode = 0,
157 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -0700158 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700159 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700160 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000161 .name = "bool"
162 },
163};
Lev Walkin20696a42017-10-17 21:27:33 -0700164static const unsigned asn_MAP_Choice_to_canonical_1[] = { 2, 1, 0, 3 };
165static const unsigned asn_MAP_Choice_from_canonical_1[] = { 2, 1, 0, 3 };
Lev Walkina7591b52014-10-12 18:37:35 -0700166static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700167 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
168 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int */
169 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr */
170 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null */
171 { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid */
Lev Walkin59b176e2005-11-26 11:25:14 +0000172};
173static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = {
174 sizeof(struct Choice),
175 offsetof(struct Choice, _asn_ctx),
176 offsetof(struct Choice, present),
177 sizeof(((struct Choice *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700178 .tag2el = asn_MAP_Choice_tag2el_1,
179 .tag2el_count = 5, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700180 .to_canonical_order = asn_MAP_Choice_to_canonical_1,
181 .from_canonical_order = asn_MAP_Choice_from_canonical_1,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700182 .first_extension = 3 /* Extensions start */
Lev Walkin59b176e2005-11-26 11:25:14 +0000183};
Lev Walkin59b176e2005-11-26 11:25:14 +0000184asn_TYPE_descriptor_t asn_DEF_Choice = {
185 "Choice",
186 "Choice",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800187 &asn_OP_CHOICE,
Lev Walkin59b176e2005-11-26 11:25:14 +0000188 0, /* No effective tags (pointer) */
189 0, /* No effective tags (count) */
190 0, /* No tags (pointer) */
191 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700192 { 0, &asn_PER_type_Choice_constr_1, CHOICE_constraint },
Lev Walkin59b176e2005-11-26 11:25:14 +0000193 asn_MBR_Choice_1,
194 4, /* Elements count */
195 &asn_SPC_Choice_specs_1 /* Additional specs */
196};
197
198
199/*** <<< INCLUDES [Choice2] >>> ***/
200
201#include <BIT_STRING.h>
202#include <RELATIVE-OID.h>
203#include <constr_CHOICE.h>
204
205/*** <<< DEPS [Choice2] >>> ***/
206
207typedef enum Choice2_PR {
208 Choice2_PR_NOTHING, /* No components present */
209 Choice2_PR_bitstr,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000210 Choice2_PR_roid
Lev Walkin59b176e2005-11-26 11:25:14 +0000211} Choice2_PR;
212
213/*** <<< TYPE-DECLS [Choice2] >>> ***/
214
215typedef struct Choice2 {
216 Choice2_PR present;
217 union Choice2_u {
218 BIT_STRING_t bitstr;
219 RELATIVE_OID_t roid;
220 } choice;
221
222 /* Context for parsing across buffer boundaries */
223 asn_struct_ctx_t _asn_ctx;
224} Choice2_t;
225
226/*** <<< FUNC-DECLS [Choice2] >>> ***/
227
228extern asn_TYPE_descriptor_t asn_DEF_Choice2;
229
Lev Walkin725883b2006-10-09 12:07:58 +0000230/*** <<< CTDEFS [Choice2] >>> ***/
231
Lev Walkin0479e042017-09-26 18:39:58 -0700232static asn_per_constraints_t asn_PER_type_Choice2_constr_1 CC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000233 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
234 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
235 0, 0 /* No PER value map */
236};
237
Lev Walkin59b176e2005-11-26 11:25:14 +0000238/*** <<< STAT-DEFS [Choice2] >>> ***/
239
240static asn_TYPE_member_t asn_MBR_Choice2_1[] = {
241 { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr),
242 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
243 .tag_mode = +1, /* EXPLICIT tag at current level */
244 .type = &asn_DEF_BIT_STRING,
Lev Walkin67a30122017-08-10 05:48:54 -0700245 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700246 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700247 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000248 .name = "bitstr"
249 },
250 { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid),
251 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
252 .tag_mode = +1, /* EXPLICIT tag at current level */
253 .type = &asn_DEF_RELATIVE_OID,
Lev Walkin67a30122017-08-10 05:48:54 -0700254 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700255 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700256 0, 0, /* No default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000257 .name = "roid"
258 },
259};
Lev Walkina7591b52014-10-12 18:37:35 -0700260static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700261 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr */
262 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid */
Lev Walkin59b176e2005-11-26 11:25:14 +0000263};
264static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
265 sizeof(struct Choice2),
266 offsetof(struct Choice2, _asn_ctx),
267 offsetof(struct Choice2, present),
268 sizeof(((struct Choice2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700269 .tag2el = asn_MAP_Choice2_tag2el_1,
270 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700271 0, 0,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700272 .first_extension = -1 /* Extensions start */
Lev Walkin59b176e2005-11-26 11:25:14 +0000273};
Lev Walkin59b176e2005-11-26 11:25:14 +0000274asn_TYPE_descriptor_t asn_DEF_Choice2 = {
275 "Choice2",
276 "Choice2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800277 &asn_OP_CHOICE,
Lev Walkin59b176e2005-11-26 11:25:14 +0000278 0, /* No effective tags (pointer) */
279 0, /* No effective tags (count) */
280 0, /* No tags (pointer) */
281 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700282 { 0, &asn_PER_type_Choice2_constr_1, CHOICE_constraint },
Lev Walkin59b176e2005-11-26 11:25:14 +0000283 asn_MBR_Choice2_1,
284 2, /* Elements count */
285 &asn_SPC_Choice2_specs_1 /* Additional specs */
286};
287