blob: 4fcddc4bc685d0e5d05f1c0c06e63c0bf0f4665a [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",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000103 CHOICE_free,
104 CHOICE_print,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000105 CHOICE_constraint,
106 CHOICE_decode_ber,
107 CHOICE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000108 0, /* Not implemented yet */
109 CHOICE_encode_xer,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000110 CHOICE_outmost_tag,
Lev Walkin188ed2c2004-09-13 08:31:01 +0000111 0, /* No effective tags (pointer) */
112 0, /* No effective tags (count) */
113 0, /* No tags (pointer) */
114 0, /* No tags (count) */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000115 1, /* Whether CONSTRUCTED */
116 asn1_MBR_e,
117 2, /* Elements count */
118 &asn1_DEF_e_specs /* Additional specs */
119};
120
121static asn1_TYPE_member_t asn1_MBR_h[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000122 { ATF_NOFLAGS, 0, offsetof(struct h, choice.i),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000123 .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
124 .tag_mode = -1, /* IMPLICIT tag at current level */
125 .type = (void *)&asn1_DEF_NULL,
126 .memb_constraints = 0, /* Defer to actual type */
127 .name = "i"
128 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000129 { ATF_NOFLAGS, 0, offsetof(struct h, choice.j),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000130 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
131 .tag_mode = -1, /* IMPLICIT tag at current level */
132 .type = (void *)&asn1_DEF_NULL,
133 .memb_constraints = 0, /* Defer to actual type */
134 .name = "j"
135 },
136};
137static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = {
138 { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */
139 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */
140};
141static asn1_CHOICE_specifics_t asn1_DEF_h_specs = {
142 sizeof(struct h),
143 offsetof(struct h, _ber_dec_ctx),
144 offsetof(struct h, present),
145 sizeof(((struct h *)0)->present),
146 asn1_DEF_h_tag2el,
147 2, /* Count of tags in the map */
148 0 /* Whether extensible */
149};
Lev Walkind04430c2004-09-07 06:44:29 +0000150static /* Use -fall-defs-global to expose */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000151asn1_TYPE_descriptor_t asn1_DEF_h = {
152 "h",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000153 CHOICE_free,
154 CHOICE_print,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000155 CHOICE_constraint,
156 CHOICE_decode_ber,
157 CHOICE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000158 0, /* Not implemented yet */
159 CHOICE_encode_xer,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000160 CHOICE_outmost_tag,
Lev Walkin188ed2c2004-09-13 08:31:01 +0000161 0, /* No effective tags (pointer) */
162 0, /* No effective tags (count) */
163 0, /* No tags (pointer) */
164 0, /* No tags (count) */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000165 1, /* Whether CONSTRUCTED */
166 asn1_MBR_h,
167 2, /* Elements count */
168 &asn1_DEF_h_specs /* Additional specs */
169};
170
171static asn1_TYPE_member_t asn1_MBR_b[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000172 { ATF_NOFLAGS, 0, offsetof(struct b, choice.c),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000173 .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
174 .tag_mode = -1, /* IMPLICIT tag at current level */
175 .type = (void *)&asn1_DEF_NULL,
176 .memb_constraints = 0, /* Defer to actual type */
177 .name = "c"
178 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000179 { ATF_NOFLAGS, 0, offsetof(struct b, choice.d),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000180 .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
181 .tag_mode = -1, /* IMPLICIT tag at current level */
182 .type = (void *)&asn1_DEF_NULL,
183 .memb_constraints = 0, /* Defer to actual type */
184 .name = "d"
185 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000186 { ATF_NOFLAGS, 0, offsetof(struct b, choice.e),
Lev Walkinb9189732004-09-10 09:37:12 +0000187 .tag = -1 /* Ambiguous tag (CHOICE?) */,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000188 .tag_mode = 0,
189 .type = (void *)&asn1_DEF_e,
190 .memb_constraints = 0, /* Defer to actual type */
191 .name = "e"
192 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000193 { ATF_NOFLAGS, 0, offsetof(struct b, choice.h),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000194 .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
195 .tag_mode = +1, /* EXPLICIT tag at current level */
196 .type = (void *)&asn1_DEF_h,
197 .memb_constraints = 0, /* Defer to actual type */
198 .name = "h"
199 },
200};
201static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = {
202 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */
203 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
204 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */
205 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */
206 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */
207};
208static asn1_CHOICE_specifics_t asn1_DEF_b_specs = {
209 sizeof(struct b),
210 offsetof(struct b, _ber_dec_ctx),
211 offsetof(struct b, present),
212 sizeof(((struct b *)0)->present),
213 asn1_DEF_b_tag2el,
214 5, /* Count of tags in the map */
215 0 /* Whether extensible */
216};
Lev Walkind04430c2004-09-07 06:44:29 +0000217static /* Use -fall-defs-global to expose */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000218asn1_TYPE_descriptor_t asn1_DEF_b = {
219 "b",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000220 CHOICE_free,
221 CHOICE_print,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000222 CHOICE_constraint,
223 CHOICE_decode_ber,
224 CHOICE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000225 0, /* Not implemented yet */
226 CHOICE_encode_xer,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000227 CHOICE_outmost_tag,
Lev Walkin188ed2c2004-09-13 08:31:01 +0000228 0, /* No effective tags (pointer) */
229 0, /* No effective tags (count) */
230 0, /* No tags (pointer) */
231 0, /* No tags (count) */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000232 1, /* Whether CONSTRUCTED */
233 asn1_MBR_b,
234 4, /* Elements count */
235 &asn1_DEF_b_specs /* Additional specs */
236};
237
238static asn1_TYPE_member_t asn1_MBR_T[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000239 { ATF_NOFLAGS, 0, offsetof(struct T, a),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000240 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
241 .tag_mode = -1, /* IMPLICIT tag at current level */
242 .type = (void *)&asn1_DEF_NULL,
243 .memb_constraints = 0, /* Defer to actual type */
244 .name = "a"
245 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000246 { ATF_NOFLAGS, 0, offsetof(struct T, b),
Lev Walkinb9189732004-09-10 09:37:12 +0000247 .tag = -1 /* Ambiguous tag (CHOICE?) */,
Lev Walkin2e3055d2004-08-20 13:36:32 +0000248 .tag_mode = 0,
249 .type = (void *)&asn1_DEF_b,
250 .memb_constraints = 0, /* Defer to actual type */
251 .name = "b"
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000252 },
253};
254static ber_tlv_tag_t asn1_DEF_T_tags[] = {
Lev Walkin188ed2c2004-09-13 08:31:01 +0000255 (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
256 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000257};
258static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
259 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */
260 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c at 17 */
261 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
262 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f at 20 */
263 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
264 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 }, /* h at 24 */
265};
266static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = {
267 sizeof(struct T),
268 offsetof(struct T, _ber_dec_ctx),
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000269 asn1_DEF_T_tag2el,
270 6, /* Count of tags in the map */
271 -1, /* Start extensions */
272 -1 /* Stop extensions */
273};
274asn1_TYPE_descriptor_t asn1_DEF_T = {
275 "T",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000276 SEQUENCE_free,
277 SEQUENCE_print,
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000278 SEQUENCE_constraint,
279 SEQUENCE_decode_ber,
280 SEQUENCE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000281 0, /* Not implemented yet */
282 SEQUENCE_encode_xer,
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000283 0, /* Use generic outmost tag fetcher */
284 asn1_DEF_T_tags,
285 sizeof(asn1_DEF_T_tags)
Lev Walkin188ed2c2004-09-13 08:31:01 +0000286 /sizeof(asn1_DEF_T_tags[0]) - 1, /* 1 */
287 asn1_DEF_T_tags, /* Same as above */
288 sizeof(asn1_DEF_T_tags)
289 /sizeof(asn1_DEF_T_tags[0]), /* 2 */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000290 1, /* Whether CONSTRUCTED */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000291 asn1_MBR_T,
292 2, /* Elements count */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000293 &asn1_DEF_T_specs /* Additional specs */
294};
295