blob: 5ac269d3b20ced511973c381f772172de7fd9bc1 [file] [log] [blame]
vlm3df79662004-06-28 21:13:22 +00001
vlm6e1b13e2004-08-11 05:25:47 +00002/*** <<< INCLUDES [T] >>> ***/
vlm3df79662004-06-28 21:13:22 +00003
vlm3df79662004-06-28 21:13:22 +00004#include <NULL.h>
vlm6e1b13e2004-08-11 05:25:47 +00005#include <constr_CHOICE.h>
vlm3df79662004-06-28 21:13:22 +00006#include <constr_SEQUENCE.h>
7
vlm6e1b13e2004-08-11 05:25:47 +00008/*** <<< DEPS [T] >>> ***/
9
vlm21e46002004-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;
vlm3df79662004-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 {
vlm6e73a042004-08-11 07:17:22 +000035 b_PR present;
vlm3df79662004-06-28 21:13:22 +000036 union {
37 NULL_t c;
38 NULL_t d;
39 struct e {
vlm6e73a042004-08-11 07:17:22 +000040 e_PR present;
vlm3df79662004-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 {
vlm6e73a042004-08-11 07:17:22 +000050 h_PR present;
vlm3df79662004-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
vlm21e46002004-08-20 13:36:32 +000071static asn1_TYPE_member_t asn1_MBR_e[] = {
vlmddd5a7d2004-09-10 09:18:20 +000072 { ATF_NOFLAGS, 0, offsetof(struct e, choice.f),
vlm21e46002004-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"
vlm3df79662004-06-28 21:13:22 +000078 },
vlmddd5a7d2004-09-10 09:18:20 +000079 { ATF_NOFLAGS, 0, offsetof(struct e, choice.g),
vlm21e46002004-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};
vlm1dc848e2004-09-07 06:44:29 +0000100static /* Use -fall-defs-global to expose */
vlm21e46002004-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,
vlm72425de2004-09-13 08:31:01 +0000109 0, /* No effective tags (pointer) */
110 0, /* No effective tags (count) */
111 0, /* No tags (pointer) */
112 0, /* No tags (count) */
vlm21e46002004-08-20 13:36:32 +0000113 1, /* Whether CONSTRUCTED */
114 asn1_MBR_e,
115 2, /* Elements count */
116 &asn1_DEF_e_specs /* Additional specs */
117};
118
119static asn1_TYPE_member_t asn1_MBR_h[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000120 { ATF_NOFLAGS, 0, offsetof(struct h, choice.i),
vlm21e46002004-08-20 13:36:32 +0000121 .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
122 .tag_mode = -1, /* IMPLICIT tag at current level */
123 .type = (void *)&asn1_DEF_NULL,
124 .memb_constraints = 0, /* Defer to actual type */
125 .name = "i"
126 },
vlmddd5a7d2004-09-10 09:18:20 +0000127 { ATF_NOFLAGS, 0, offsetof(struct h, choice.j),
vlm21e46002004-08-20 13:36:32 +0000128 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
129 .tag_mode = -1, /* IMPLICIT tag at current level */
130 .type = (void *)&asn1_DEF_NULL,
131 .memb_constraints = 0, /* Defer to actual type */
132 .name = "j"
133 },
134};
135static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = {
136 { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */
137 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */
138};
139static asn1_CHOICE_specifics_t asn1_DEF_h_specs = {
140 sizeof(struct h),
141 offsetof(struct h, _ber_dec_ctx),
142 offsetof(struct h, present),
143 sizeof(((struct h *)0)->present),
144 asn1_DEF_h_tag2el,
145 2, /* Count of tags in the map */
146 0 /* Whether extensible */
147};
vlm1dc848e2004-09-07 06:44:29 +0000148static /* Use -fall-defs-global to expose */
vlm21e46002004-08-20 13:36:32 +0000149asn1_TYPE_descriptor_t asn1_DEF_h = {
150 "h",
151 CHOICE_constraint,
152 CHOICE_decode_ber,
153 CHOICE_encode_der,
154 CHOICE_print,
155 CHOICE_free,
156 CHOICE_outmost_tag,
vlm72425de2004-09-13 08:31:01 +0000157 0, /* No effective tags (pointer) */
158 0, /* No effective tags (count) */
159 0, /* No tags (pointer) */
160 0, /* No tags (count) */
vlm21e46002004-08-20 13:36:32 +0000161 1, /* Whether CONSTRUCTED */
162 asn1_MBR_h,
163 2, /* Elements count */
164 &asn1_DEF_h_specs /* Additional specs */
165};
166
167static asn1_TYPE_member_t asn1_MBR_b[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000168 { ATF_NOFLAGS, 0, offsetof(struct b, choice.c),
vlm21e46002004-08-20 13:36:32 +0000169 .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
170 .tag_mode = -1, /* IMPLICIT tag at current level */
171 .type = (void *)&asn1_DEF_NULL,
172 .memb_constraints = 0, /* Defer to actual type */
173 .name = "c"
174 },
vlmddd5a7d2004-09-10 09:18:20 +0000175 { ATF_NOFLAGS, 0, offsetof(struct b, choice.d),
vlm21e46002004-08-20 13:36:32 +0000176 .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
177 .tag_mode = -1, /* IMPLICIT tag at current level */
178 .type = (void *)&asn1_DEF_NULL,
179 .memb_constraints = 0, /* Defer to actual type */
180 .name = "d"
181 },
vlmddd5a7d2004-09-10 09:18:20 +0000182 { ATF_NOFLAGS, 0, offsetof(struct b, choice.e),
vlm060fe2a2004-09-10 09:37:12 +0000183 .tag = -1 /* Ambiguous tag (CHOICE?) */,
vlm21e46002004-08-20 13:36:32 +0000184 .tag_mode = 0,
185 .type = (void *)&asn1_DEF_e,
186 .memb_constraints = 0, /* Defer to actual type */
187 .name = "e"
188 },
vlmddd5a7d2004-09-10 09:18:20 +0000189 { ATF_NOFLAGS, 0, offsetof(struct b, choice.h),
vlm21e46002004-08-20 13:36:32 +0000190 .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
191 .tag_mode = +1, /* EXPLICIT tag at current level */
192 .type = (void *)&asn1_DEF_h,
193 .memb_constraints = 0, /* Defer to actual type */
194 .name = "h"
195 },
196};
197static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = {
198 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */
199 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
200 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */
201 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */
202 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */
203};
204static asn1_CHOICE_specifics_t asn1_DEF_b_specs = {
205 sizeof(struct b),
206 offsetof(struct b, _ber_dec_ctx),
207 offsetof(struct b, present),
208 sizeof(((struct b *)0)->present),
209 asn1_DEF_b_tag2el,
210 5, /* Count of tags in the map */
211 0 /* Whether extensible */
212};
vlm1dc848e2004-09-07 06:44:29 +0000213static /* Use -fall-defs-global to expose */
vlm21e46002004-08-20 13:36:32 +0000214asn1_TYPE_descriptor_t asn1_DEF_b = {
215 "b",
216 CHOICE_constraint,
217 CHOICE_decode_ber,
218 CHOICE_encode_der,
219 CHOICE_print,
220 CHOICE_free,
221 CHOICE_outmost_tag,
vlm72425de2004-09-13 08:31:01 +0000222 0, /* No effective tags (pointer) */
223 0, /* No effective tags (count) */
224 0, /* No tags (pointer) */
225 0, /* No tags (count) */
vlm21e46002004-08-20 13:36:32 +0000226 1, /* Whether CONSTRUCTED */
227 asn1_MBR_b,
228 4, /* Elements count */
229 &asn1_DEF_b_specs /* Additional specs */
230};
231
232static asn1_TYPE_member_t asn1_MBR_T[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000233 { ATF_NOFLAGS, 0, offsetof(struct T, a),
vlm21e46002004-08-20 13:36:32 +0000234 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
235 .tag_mode = -1, /* IMPLICIT tag at current level */
236 .type = (void *)&asn1_DEF_NULL,
237 .memb_constraints = 0, /* Defer to actual type */
238 .name = "a"
239 },
vlmddd5a7d2004-09-10 09:18:20 +0000240 { ATF_NOFLAGS, 0, offsetof(struct T, b),
vlm060fe2a2004-09-10 09:37:12 +0000241 .tag = -1 /* Ambiguous tag (CHOICE?) */,
vlm21e46002004-08-20 13:36:32 +0000242 .tag_mode = 0,
243 .type = (void *)&asn1_DEF_b,
244 .memb_constraints = 0, /* Defer to actual type */
245 .name = "b"
vlm3df79662004-06-28 21:13:22 +0000246 },
247};
248static ber_tlv_tag_t asn1_DEF_T_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000249 (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
250 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
vlm3df79662004-06-28 21:13:22 +0000251};
252static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
253 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */
254 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c at 17 */
255 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
256 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f at 20 */
257 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
258 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 }, /* h at 24 */
259};
260static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = {
261 sizeof(struct T),
262 offsetof(struct T, _ber_dec_ctx),
vlm3df79662004-06-28 21:13:22 +0000263 asn1_DEF_T_tag2el,
264 6, /* Count of tags in the map */
265 -1, /* Start extensions */
266 -1 /* Stop extensions */
267};
268asn1_TYPE_descriptor_t asn1_DEF_T = {
269 "T",
270 SEQUENCE_constraint,
271 SEQUENCE_decode_ber,
272 SEQUENCE_encode_der,
273 SEQUENCE_print,
274 SEQUENCE_free,
275 0, /* Use generic outmost tag fetcher */
276 asn1_DEF_T_tags,
277 sizeof(asn1_DEF_T_tags)
vlm72425de2004-09-13 08:31:01 +0000278 /sizeof(asn1_DEF_T_tags[0]) - 1, /* 1 */
279 asn1_DEF_T_tags, /* Same as above */
280 sizeof(asn1_DEF_T_tags)
281 /sizeof(asn1_DEF_T_tags[0]), /* 2 */
vlm3df79662004-06-28 21:13:22 +0000282 1, /* Whether CONSTRUCTED */
vlm21e46002004-08-20 13:36:32 +0000283 asn1_MBR_T,
284 2, /* Elements count */
vlm3df79662004-06-28 21:13:22 +0000285 &asn1_DEF_T_specs /* Additional specs */
286};
287