blob: 0c65871f5005f71641cf0511443d445050431ea7 [file] [log] [blame]
Lev Walkin5bbff1e2004-06-28 21:13:22 +00001
Lev Walkinb47ddce2004-08-11 05:25:47 +00002/*** <<< INCLUDES [T] >>> ***/
Lev Walkin5bbff1e2004-06-28 21:13:22 +00003
Lev Walkin5bbff1e2004-06-28 21:13:22 +00004#include <NULL.h>
Lev Walkinb47ddce2004-08-11 05:25:47 +00005#include <constr_CHOICE.h>
Lev Walkin5bbff1e2004-06-28 21:13:22 +00006#include <constr_SEQUENCE.h>
7
Lev Walkinb47ddce2004-08-11 05:25:47 +00008/*** <<< DEPS [T] >>> ***/
9
10 typedef enum b_PR {
11 b_PR_NOTHING, /* No components present */
12 b_PR_c,
13 b_PR_d,
14 b_PR_e,
15 b_PR_h,
Lev Walkin64399722004-08-11 07:17:22 +000016 } b_PR;
Lev Walkinb47ddce2004-08-11 05:25:47 +000017 typedef enum e_PR {
18 e_PR_NOTHING, /* No components present */
19 e_PR_f,
20 e_PR_g,
Lev Walkin64399722004-08-11 07:17:22 +000021 } e_PR;
Lev Walkinb47ddce2004-08-11 05:25:47 +000022 typedef enum h_PR {
23 h_PR_NOTHING, /* No components present */
24 h_PR_i,
25 h_PR_j,
Lev Walkin64399722004-08-11 07:17:22 +000026 } h_PR;
Lev Walkin5bbff1e2004-06-28 21:13:22 +000027extern asn1_TYPE_descriptor_t asn1_DEF_T;
28
29/*** <<< TYPE-DECLS [T] >>> ***/
30
31
32typedef struct T {
33 NULL_t a;
34 struct b {
Lev Walkin64399722004-08-11 07:17:22 +000035 b_PR present;
Lev Walkin5bbff1e2004-06-28 21:13:22 +000036 union {
37 NULL_t c;
38 NULL_t d;
39 struct e {
Lev Walkin64399722004-08-11 07:17:22 +000040 e_PR present;
Lev Walkin5bbff1e2004-06-28 21:13:22 +000041 union {
42 NULL_t f;
43 NULL_t g;
44 } choice;
45
46 /* Context for parsing across buffer boundaries */
47 ber_dec_ctx_t _ber_dec_ctx;
48 } e;
49 struct h {
Lev Walkin64399722004-08-11 07:17:22 +000050 h_PR present;
Lev Walkin5bbff1e2004-06-28 21:13:22 +000051 union {
52 NULL_t i;
53 NULL_t j;
54 } choice;
55
56 /* Context for parsing across buffer boundaries */
57 ber_dec_ctx_t _ber_dec_ctx;
58 } h;
59 } choice;
60
61 /* Context for parsing across buffer boundaries */
62 ber_dec_ctx_t _ber_dec_ctx;
63 } b;
64
65 /* Context for parsing across buffer boundaries */
66 ber_dec_ctx_t _ber_dec_ctx;
67} T_t;
68
69/*** <<< STAT-DEFS [T] >>> ***/
70
Lev Walkin5bbff1e2004-06-28 21:13:22 +000071 static asn1_CHOICE_element_t asn1_DEF_e_elements[] = {
72 { offsetof(struct e, choice.f), 0,
73 (ASN_TAG_CLASS_PRIVATE | (7 << 2)),
74 -1, /* IMPLICIT tag at current level */
75 (void *)&asn1_DEF_NULL,
76 "f"
77 },
78 { offsetof(struct e, choice.g), 0,
79 (ASN_TAG_CLASS_PRIVATE | (8 << 2)),
80 -1, /* IMPLICIT tag at current level */
81 (void *)&asn1_DEF_NULL,
82 "g"
83 },
84 };
Lev Walkin5bbff1e2004-06-28 21:13:22 +000085 static asn1_TYPE_tag2member_t asn1_DEF_e_tag2el[] = {
86 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f at 20 */
87 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
88 };
89 static asn1_CHOICE_specifics_t asn1_DEF_e_specs = {
90 sizeof(struct e),
91 offsetof(struct e, _ber_dec_ctx),
92 offsetof(struct e, present),
93 sizeof(((struct e *)0)->present),
94 asn1_DEF_e_elements,
95 2, /* Elements count */
96 asn1_DEF_e_tag2el,
97 2, /* Count of tags in the map */
98 0 /* Whether extensible */
99 };
100 asn1_TYPE_descriptor_t asn1_DEF_e = {
101 "e",
102 CHOICE_constraint,
103 CHOICE_decode_ber,
104 CHOICE_encode_der,
105 CHOICE_print,
106 CHOICE_free,
107 CHOICE_outmost_tag,
Lev Walkin64399722004-08-11 07:17:22 +0000108 0, /* No explicit tags (pointer) */
109 0, /* No explicit tags (count) */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000110 0, /* Tags to skip */
111 1, /* Whether CONSTRUCTED */
112 &asn1_DEF_e_specs /* Additional specs */
113 };
114
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000115 static asn1_CHOICE_element_t asn1_DEF_h_elements[] = {
116 { offsetof(struct h, choice.i), 0,
117 (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
118 -1, /* IMPLICIT tag at current level */
119 (void *)&asn1_DEF_NULL,
120 "i"
121 },
122 { offsetof(struct h, choice.j), 0,
123 (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
124 -1, /* IMPLICIT tag at current level */
125 (void *)&asn1_DEF_NULL,
126 "j"
127 },
128 };
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000129 static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = {
130 { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */
131 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */
132 };
133 static asn1_CHOICE_specifics_t asn1_DEF_h_specs = {
134 sizeof(struct h),
135 offsetof(struct h, _ber_dec_ctx),
136 offsetof(struct h, present),
137 sizeof(((struct h *)0)->present),
138 asn1_DEF_h_elements,
139 2, /* Elements count */
140 asn1_DEF_h_tag2el,
141 2, /* Count of tags in the map */
142 0 /* Whether extensible */
143 };
144 asn1_TYPE_descriptor_t asn1_DEF_h = {
145 "h",
146 CHOICE_constraint,
147 CHOICE_decode_ber,
148 CHOICE_encode_der,
149 CHOICE_print,
150 CHOICE_free,
151 CHOICE_outmost_tag,
Lev Walkin64399722004-08-11 07:17:22 +0000152 0, /* No explicit tags (pointer) */
153 0, /* No explicit tags (count) */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000154 0, /* Tags to skip */
155 1, /* Whether CONSTRUCTED */
156 &asn1_DEF_h_specs /* Additional specs */
157 };
158
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000159 static asn1_CHOICE_element_t asn1_DEF_b_elements[] = {
160 { offsetof(struct b, choice.c), 0,
161 (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
162 -1, /* IMPLICIT tag at current level */
163 (void *)&asn1_DEF_NULL,
164 "c"
165 },
166 { offsetof(struct b, choice.d), 0,
167 (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
168 -1, /* IMPLICIT tag at current level */
169 (void *)&asn1_DEF_NULL,
170 "d"
171 },
172 { offsetof(struct b, choice.e), 0,
173 -1 /* Ambiguous tag (CHOICE?) */,
174 0,
175 (void *)&asn1_DEF_e,
176 "e"
177 },
178 { offsetof(struct b, choice.h), 0,
179 (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
180 +1, /* EXPLICIT tag at current level */
181 (void *)&asn1_DEF_h,
182 "h"
183 },
184 };
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000185 static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = {
186 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */
187 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
188 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */
189 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */
190 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */
191 };
192 static asn1_CHOICE_specifics_t asn1_DEF_b_specs = {
193 sizeof(struct b),
194 offsetof(struct b, _ber_dec_ctx),
195 offsetof(struct b, present),
196 sizeof(((struct b *)0)->present),
197 asn1_DEF_b_elements,
198 4, /* Elements count */
199 asn1_DEF_b_tag2el,
200 5, /* Count of tags in the map */
201 0 /* Whether extensible */
202 };
203 asn1_TYPE_descriptor_t asn1_DEF_b = {
204 "b",
205 CHOICE_constraint,
206 CHOICE_decode_ber,
207 CHOICE_encode_der,
208 CHOICE_print,
209 CHOICE_free,
210 CHOICE_outmost_tag,
Lev Walkin64399722004-08-11 07:17:22 +0000211 0, /* No explicit tags (pointer) */
212 0, /* No explicit tags (count) */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000213 0, /* Tags to skip */
214 1, /* Whether CONSTRUCTED */
215 &asn1_DEF_b_specs /* Additional specs */
216 };
217
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000218static asn1_SEQUENCE_element_t asn1_DEF_T_elements[] = {
219 { offsetof(struct T, a), 0,
220 (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
221 -1, /* IMPLICIT tag at current level */
222 (void *)&asn1_DEF_NULL,
223 "a"
224 },
225 { offsetof(struct T, b), 0,
226 -1 /* Ambiguous tag (CHOICE?) */,
227 0,
228 (void *)&asn1_DEF_b,
229 "b"
230 },
231};
232static ber_tlv_tag_t asn1_DEF_T_tags[] = {
233 (ASN_TAG_CLASS_PRIVATE | (1 << 2))
234};
235static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
236 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */
237 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c at 17 */
238 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
239 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f at 20 */
240 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
241 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 }, /* h at 24 */
242};
243static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = {
244 sizeof(struct T),
245 offsetof(struct T, _ber_dec_ctx),
246 asn1_DEF_T_elements,
247 2, /* Elements count */
248 asn1_DEF_T_tag2el,
249 6, /* Count of tags in the map */
250 -1, /* Start extensions */
251 -1 /* Stop extensions */
252};
253asn1_TYPE_descriptor_t asn1_DEF_T = {
254 "T",
255 SEQUENCE_constraint,
256 SEQUENCE_decode_ber,
257 SEQUENCE_encode_der,
258 SEQUENCE_print,
259 SEQUENCE_free,
260 0, /* Use generic outmost tag fetcher */
261 asn1_DEF_T_tags,
262 sizeof(asn1_DEF_T_tags)
Lev Walkin64399722004-08-11 07:17:22 +0000263 /sizeof(asn1_DEF_T_tags[0]), /* 1 */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000264 1, /* Tags to skip */
265 1, /* Whether CONSTRUCTED */
266 &asn1_DEF_T_specs /* Additional specs */
267};
268