blob: 107cdb8dec4fc1e36e8292629da8b2e04297ae9f [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
Lev Walkin2e3055d2004-08-20 13:36:32 +000010typedef 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,
16} b_PR;
17typedef enum e_PR {
18 e_PR_NOTHING, /* No components present */
19 e_PR_f,
20 e_PR_g,
21} e_PR;
22typedef enum h_PR {
23 h_PR_NOTHING, /* No components present */
24 h_PR_i,
25 h_PR_j,
26} 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 Walkin2e3055d2004-08-20 13:36:32 +000071static asn1_TYPE_member_t asn1_MBR_e[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000072 { ATF_NOFLAGS, 0, offsetof(struct e, choice.f),
Lev Walkin2e3055d2004-08-20 13:36:32 +000073 .tag = (ASN_TAG_CLASS_PRIVATE | (7 << 2)),
74 .tag_mode = -1, /* IMPLICIT tag at current level */
75 .type = (void *)&asn1_DEF_NULL,
76 .memb_constraints = 0, /* Defer to actual type */
77 .name = "f"
Lev Walkin5bbff1e2004-06-28 21:13:22 +000078 },
Lev Walkincc93b0f2004-09-10 09:18:20 +000079 { ATF_NOFLAGS, 0, offsetof(struct e, choice.g),
Lev Walkin2e3055d2004-08-20 13:36:32 +000080 .tag = (ASN_TAG_CLASS_PRIVATE | (8 << 2)),
81 .tag_mode = -1, /* IMPLICIT tag at current level */
82 .type = (void *)&asn1_DEF_NULL,
83 .memb_constraints = 0, /* Defer to actual type */
84 .name = "g"
85 },
86};
87static asn1_TYPE_tag2member_t asn1_DEF_e_tag2el[] = {
88 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f at 20 */
89 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
90};
91static asn1_CHOICE_specifics_t asn1_DEF_e_specs = {
92 sizeof(struct e),
93 offsetof(struct e, _ber_dec_ctx),
94 offsetof(struct e, present),
95 sizeof(((struct e *)0)->present),
96 asn1_DEF_e_tag2el,
97 2, /* Count of tags in the map */
98 0 /* Whether extensible */
99};
Lev Walkind04430c2004-09-07 06:44:29 +0000100static /* Use -fall-defs-global to expose */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000101asn1_TYPE_descriptor_t asn1_DEF_e = {
102 "e",
103 CHOICE_constraint,
104 CHOICE_decode_ber,
105 CHOICE_encode_der,
106 CHOICE_print,
107 CHOICE_free,
108 CHOICE_outmost_tag,
109 0, /* No explicit tags (pointer) */
110 0, /* No explicit tags (count) */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000111 1, /* Whether CONSTRUCTED */
112 asn1_MBR_e,
113 2, /* Elements count */
114 &asn1_DEF_e_specs /* Additional specs */
115};
116
117static asn1_TYPE_member_t asn1_MBR_h[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000118 { ATF_NOFLAGS, 0, offsetof(struct h, choice.i),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000119 .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
120 .tag_mode = -1, /* IMPLICIT tag at current level */
121 .type = (void *)&asn1_DEF_NULL,
122 .memb_constraints = 0, /* Defer to actual type */
123 .name = "i"
124 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000125 { ATF_NOFLAGS, 0, offsetof(struct h, choice.j),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000126 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
127 .tag_mode = -1, /* IMPLICIT tag at current level */
128 .type = (void *)&asn1_DEF_NULL,
129 .memb_constraints = 0, /* Defer to actual type */
130 .name = "j"
131 },
132};
133static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = {
134 { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */
135 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */
136};
137static asn1_CHOICE_specifics_t asn1_DEF_h_specs = {
138 sizeof(struct h),
139 offsetof(struct h, _ber_dec_ctx),
140 offsetof(struct h, present),
141 sizeof(((struct h *)0)->present),
142 asn1_DEF_h_tag2el,
143 2, /* Count of tags in the map */
144 0 /* Whether extensible */
145};
Lev Walkind04430c2004-09-07 06:44:29 +0000146static /* Use -fall-defs-global to expose */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000147asn1_TYPE_descriptor_t asn1_DEF_h = {
148 "h",
149 CHOICE_constraint,
150 CHOICE_decode_ber,
151 CHOICE_encode_der,
152 CHOICE_print,
153 CHOICE_free,
154 CHOICE_outmost_tag,
155 0, /* No explicit tags (pointer) */
156 0, /* No explicit tags (count) */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000157 1, /* Whether CONSTRUCTED */
158 asn1_MBR_h,
159 2, /* Elements count */
160 &asn1_DEF_h_specs /* Additional specs */
161};
162
163static asn1_TYPE_member_t asn1_MBR_b[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000164 { ATF_NOFLAGS, 0, offsetof(struct b, choice.c),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000165 .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
166 .tag_mode = -1, /* IMPLICIT tag at current level */
167 .type = (void *)&asn1_DEF_NULL,
168 .memb_constraints = 0, /* Defer to actual type */
169 .name = "c"
170 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000171 { ATF_NOFLAGS, 0, offsetof(struct b, choice.d),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000172 .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
173 .tag_mode = -1, /* IMPLICIT tag at current level */
174 .type = (void *)&asn1_DEF_NULL,
175 .memb_constraints = 0, /* Defer to actual type */
176 .name = "d"
177 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000178 { ATF_NOFLAGS, 0, offsetof(struct b, choice.e),
Lev Walkinb9189732004-09-10 09:37:12 +0000179 .tag = -1 /* Ambiguous tag (CHOICE?) */,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000180 .tag_mode = 0,
181 .type = (void *)&asn1_DEF_e,
182 .memb_constraints = 0, /* Defer to actual type */
183 .name = "e"
184 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000185 { ATF_NOFLAGS, 0, offsetof(struct b, choice.h),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000186 .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
187 .tag_mode = +1, /* EXPLICIT tag at current level */
188 .type = (void *)&asn1_DEF_h,
189 .memb_constraints = 0, /* Defer to actual type */
190 .name = "h"
191 },
192};
193static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = {
194 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */
195 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
196 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */
197 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */
198 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */
199};
200static asn1_CHOICE_specifics_t asn1_DEF_b_specs = {
201 sizeof(struct b),
202 offsetof(struct b, _ber_dec_ctx),
203 offsetof(struct b, present),
204 sizeof(((struct b *)0)->present),
205 asn1_DEF_b_tag2el,
206 5, /* Count of tags in the map */
207 0 /* Whether extensible */
208};
Lev Walkind04430c2004-09-07 06:44:29 +0000209static /* Use -fall-defs-global to expose */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000210asn1_TYPE_descriptor_t asn1_DEF_b = {
211 "b",
212 CHOICE_constraint,
213 CHOICE_decode_ber,
214 CHOICE_encode_der,
215 CHOICE_print,
216 CHOICE_free,
217 CHOICE_outmost_tag,
218 0, /* No explicit tags (pointer) */
219 0, /* No explicit tags (count) */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000220 1, /* Whether CONSTRUCTED */
221 asn1_MBR_b,
222 4, /* Elements count */
223 &asn1_DEF_b_specs /* Additional specs */
224};
225
226static asn1_TYPE_member_t asn1_MBR_T[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000227 { ATF_NOFLAGS, 0, offsetof(struct T, a),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000228 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
229 .tag_mode = -1, /* IMPLICIT tag at current level */
230 .type = (void *)&asn1_DEF_NULL,
231 .memb_constraints = 0, /* Defer to actual type */
232 .name = "a"
233 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000234 { ATF_NOFLAGS, 0, offsetof(struct T, b),
Lev Walkinb9189732004-09-10 09:37:12 +0000235 .tag = -1 /* Ambiguous tag (CHOICE?) */,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000236 .tag_mode = 0,
237 .type = (void *)&asn1_DEF_b,
238 .memb_constraints = 0, /* Defer to actual type */
239 .name = "b"
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000240 },
241};
242static ber_tlv_tag_t asn1_DEF_T_tags[] = {
243 (ASN_TAG_CLASS_PRIVATE | (1 << 2))
244};
245static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
246 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */
247 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c at 17 */
248 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
249 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f at 20 */
250 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
251 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 }, /* h at 24 */
252};
253static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = {
254 sizeof(struct T),
255 offsetof(struct T, _ber_dec_ctx),
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000256 asn1_DEF_T_tag2el,
257 6, /* Count of tags in the map */
258 -1, /* Start extensions */
259 -1 /* Stop extensions */
260};
261asn1_TYPE_descriptor_t asn1_DEF_T = {
262 "T",
263 SEQUENCE_constraint,
264 SEQUENCE_decode_ber,
265 SEQUENCE_encode_der,
266 SEQUENCE_print,
267 SEQUENCE_free,
268 0, /* Use generic outmost tag fetcher */
269 asn1_DEF_T_tags,
270 sizeof(asn1_DEF_T_tags)
Lev Walkin64399722004-08-11 07:17:22 +0000271 /sizeof(asn1_DEF_T_tags[0]), /* 1 */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000272 1, /* Whether CONSTRUCTED */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000273 asn1_MBR_T,
274 2, /* Elements count */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000275 &asn1_DEF_T_specs /* Additional specs */
276};
277