blob: e28455aef2e8deef2c149c0035bdf8fb038de8bb [file] [log] [blame]
Lev Walkin03ba3e92004-08-22 03:18:17 +00001
2/*** <<< INCLUDES [Forest] >>> ***/
3
4#include <Tree.h>
5#include <asn_SET_OF.h>
6#include <constr_SET_OF.h>
7
8/*** <<< DEPS [Forest] >>> ***/
9
10extern asn1_TYPE_descriptor_t asn1_DEF_Forest;
11
12/*** <<< TYPE-DECLS [Forest] >>> ***/
13
14
15typedef struct Forest {
16 A_SET_OF(struct Tree) list;
17
18 /* Context for parsing across buffer boundaries */
19 ber_dec_ctx_t _ber_dec_ctx;
20} Forest_t;
21
22/*** <<< STAT-DEFS [Forest] >>> ***/
23
24static asn1_TYPE_member_t asn1_MBR_Forest[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000025 { ATF_NOFLAGS, 0, 0,
Lev Walkin03ba3e92004-08-22 03:18:17 +000026 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
27 .tag_mode = 0,
28 .type = (void *)&asn1_DEF_Tree,
29 .memb_constraints = 0, /* Defer to actual type */
30 .name = ""
31 },
32};
33static ber_tlv_tag_t asn1_DEF_Forest_tags[] = {
34 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
35};
36static asn1_SET_OF_specifics_t asn1_DEF_Forest_specs = {
37 sizeof(struct Forest),
38 offsetof(struct Forest, _ber_dec_ctx),
39};
40asn1_TYPE_descriptor_t asn1_DEF_Forest = {
41 "Forest",
42 SET_OF_constraint,
43 SET_OF_decode_ber,
44 SET_OF_encode_der,
45 SET_OF_print,
46 SET_OF_free,
47 0, /* Use generic outmost tag fetcher */
48 asn1_DEF_Forest_tags,
49 sizeof(asn1_DEF_Forest_tags)
50 /sizeof(asn1_DEF_Forest_tags[0]), /* 1 */
Lev Walkin03ba3e92004-08-22 03:18:17 +000051 1, /* Whether CONSTRUCTED */
52 asn1_MBR_Forest,
53 1, /* Single element */
54 &asn1_DEF_Forest_specs /* Additional specs */
55};
56
57
58/*** <<< INCLUDES [Tree] >>> ***/
59
60#include <INTEGER.h>
61#include <constr_SEQUENCE.h>
62
63/*** <<< DEPS [Tree] >>> ***/
64
65extern asn1_TYPE_descriptor_t asn1_DEF_Tree;
66
67/*** <<< TYPE-DECLS [Tree] >>> ***/
68
69
70typedef struct Tree {
71 INTEGER_t height;
72 INTEGER_t width;
73
74 /* Context for parsing across buffer boundaries */
75 ber_dec_ctx_t _ber_dec_ctx;
76} Tree_t;
77
78/*** <<< STAT-DEFS [Tree] >>> ***/
79
80static asn1_TYPE_member_t asn1_MBR_Tree[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000081 { ATF_NOFLAGS, 0, offsetof(struct Tree, height),
Lev Walkin03ba3e92004-08-22 03:18:17 +000082 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
83 .tag_mode = 0,
84 .type = (void *)&asn1_DEF_INTEGER,
85 .memb_constraints = 0, /* Defer to actual type */
86 .name = "height"
87 },
Lev Walkincc93b0f2004-09-10 09:18:20 +000088 { ATF_NOFLAGS, 0, offsetof(struct Tree, width),
Lev Walkin03ba3e92004-08-22 03:18:17 +000089 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
90 .tag_mode = 0,
91 .type = (void *)&asn1_DEF_INTEGER,
92 .memb_constraints = 0, /* Defer to actual type */
93 .name = "width"
94 },
95};
96static ber_tlv_tag_t asn1_DEF_Tree_tags[] = {
97 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
98};
99static asn1_TYPE_tag2member_t asn1_DEF_Tree_tag2el[] = {
100 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* height at 17 */
101 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* width at 19 */
102};
103static asn1_SEQUENCE_specifics_t asn1_DEF_Tree_specs = {
104 sizeof(struct Tree),
105 offsetof(struct Tree, _ber_dec_ctx),
106 asn1_DEF_Tree_tag2el,
107 2, /* Count of tags in the map */
108 -1, /* Start extensions */
109 -1 /* Stop extensions */
110};
111asn1_TYPE_descriptor_t asn1_DEF_Tree = {
112 "Tree",
113 SEQUENCE_constraint,
114 SEQUENCE_decode_ber,
115 SEQUENCE_encode_der,
116 SEQUENCE_print,
117 SEQUENCE_free,
118 0, /* Use generic outmost tag fetcher */
119 asn1_DEF_Tree_tags,
120 sizeof(asn1_DEF_Tree_tags)
121 /sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000122 1, /* Whether CONSTRUCTED */
123 asn1_MBR_Tree,
124 2, /* Elements count */
125 &asn1_DEF_Tree_specs /* Additional specs */
126};
127
128
129/*** <<< INCLUDES [Stuff] >>> ***/
130
131#include <Forest.h>
132#include <asn_SET_OF.h>
133#include <constr_SET_OF.h>
134#include <BIT_STRING.h>
135#include <constr_SEQUENCE.h>
136#include <constr_SET.h>
137
138/*** <<< DEPS [Stuff] >>> ***/
139
140
141/*
142 * Method of determining the components presence
143 */
144typedef enum Stuff_PR {
145 Stuff_PR_trees, /* Member trees is present */
146 Stuff_PR_anything, /* Member anything is present */
147} Stuff_PR;
148extern asn1_TYPE_descriptor_t asn1_DEF_Stuff;
149
150/*** <<< TYPE-DECLS [Stuff] >>> ***/
151
152
153typedef struct Stuff {
154 struct trees {
155 A_SET_OF(struct Forest) list;
156
157 /* Context for parsing across buffer boundaries */
158 ber_dec_ctx_t _ber_dec_ctx;
159 } *trees;
160 struct anything {
161 A_SET_OF(struct anything_member {
162 BIT_STRING_t cup_of_coffee;
163 /*
164 * This type is extensible,
165 * possible extensions are below.
166 */
167
168 /* Context for parsing across buffer boundaries */
169 ber_dec_ctx_t _ber_dec_ctx;
170 } ) list;
171
172 /* Context for parsing across buffer boundaries */
173 ber_dec_ctx_t _ber_dec_ctx;
174 } *anything;
175
176 /* Presence bitmask: ASN_SET_ISPRESENT(pStuff, Stuff_PR_x) */
177 unsigned int _presence_map
178 [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
179
180 /* Context for parsing across buffer boundaries */
181 ber_dec_ctx_t _ber_dec_ctx;
182} Stuff_t;
183
184/*** <<< STAT-DEFS [Stuff] >>> ***/
185
186static asn1_TYPE_member_t asn1_MBR_trees[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000187 { ATF_NOFLAGS, 0, 0,
Lev Walkin03ba3e92004-08-22 03:18:17 +0000188 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
189 .tag_mode = 0,
190 .type = (void *)&asn1_DEF_Forest,
191 .memb_constraints = 0, /* Defer to actual type */
192 .name = ""
193 },
194};
195static ber_tlv_tag_t asn1_DEF_trees_tags[] = {
196 (ASN_TAG_CLASS_CONTEXT | (0 << 2))
197};
198static asn1_SET_OF_specifics_t asn1_DEF_trees_specs = {
199 sizeof(struct trees),
200 offsetof(struct trees, _ber_dec_ctx),
201};
Lev Walkind04430c2004-09-07 06:44:29 +0000202static /* Use -fall-defs-global to expose */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000203asn1_TYPE_descriptor_t asn1_DEF_trees = {
204 "trees",
205 SET_OF_constraint,
206 SET_OF_decode_ber,
207 SET_OF_encode_der,
208 SET_OF_print,
209 SET_OF_free,
210 0, /* Use generic outmost tag fetcher */
211 asn1_DEF_trees_tags,
212 sizeof(asn1_DEF_trees_tags)
213 /sizeof(asn1_DEF_trees_tags[0]), /* 1 */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000214 1, /* Whether CONSTRUCTED */
215 asn1_MBR_trees,
216 1, /* Single element */
217 &asn1_DEF_trees_specs /* Additional specs */
218};
219
220static asn1_TYPE_member_t asn1_MBR_anything_member[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000221 { ATF_NOFLAGS, 0, offsetof(struct anything_member, cup_of_coffee),
Lev Walkin03ba3e92004-08-22 03:18:17 +0000222 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
223 .tag_mode = 0,
224 .type = (void *)&asn1_DEF_BIT_STRING,
225 .memb_constraints = 0, /* Defer to actual type */
226 .name = "cup-of-coffee"
227 },
228};
229static ber_tlv_tag_t asn1_DEF_anything_member_tags[] = {
230 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
231};
232static asn1_TYPE_tag2member_t asn1_DEF_anything_member_tag2el[] = {
233 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 }, /* cup-of-coffee at 26 */
234};
235static asn1_SEQUENCE_specifics_t asn1_DEF_anything_member_specs = {
236 sizeof(struct anything_member),
237 offsetof(struct anything_member, _ber_dec_ctx),
238 asn1_DEF_anything_member_tag2el,
239 1, /* Count of tags in the map */
240 0, /* Start extensions */
241 2 /* Stop extensions */
242};
Lev Walkind04430c2004-09-07 06:44:29 +0000243static /* Use -fall-defs-global to expose */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000244asn1_TYPE_descriptor_t asn1_DEF_anything_member = {
245 "",
246 SEQUENCE_constraint,
247 SEQUENCE_decode_ber,
248 SEQUENCE_encode_der,
249 SEQUENCE_print,
250 SEQUENCE_free,
251 0, /* Use generic outmost tag fetcher */
252 asn1_DEF_anything_member_tags,
253 sizeof(asn1_DEF_anything_member_tags)
254 /sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000255 1, /* Whether CONSTRUCTED */
256 asn1_MBR_anything_member,
257 1, /* Elements count */
258 &asn1_DEF_anything_member_specs /* Additional specs */
259};
260
261static asn1_TYPE_member_t asn1_MBR_anything[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000262 { ATF_NOFLAGS, 0, 0,
Lev Walkin03ba3e92004-08-22 03:18:17 +0000263 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
264 .tag_mode = 0,
265 .type = (void *)&asn1_DEF_anything_member,
266 .memb_constraints = 0, /* Defer to actual type */
267 .name = ""
268 },
269};
270static ber_tlv_tag_t asn1_DEF_anything_tags[] = {
271 (ASN_TAG_CLASS_CONTEXT | (1 << 2))
272};
273static asn1_SET_OF_specifics_t asn1_DEF_anything_specs = {
274 sizeof(struct anything),
275 offsetof(struct anything, _ber_dec_ctx),
276};
Lev Walkind04430c2004-09-07 06:44:29 +0000277static /* Use -fall-defs-global to expose */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000278asn1_TYPE_descriptor_t asn1_DEF_anything = {
279 "anything",
280 SET_OF_constraint,
281 SET_OF_decode_ber,
282 SET_OF_encode_der,
283 SET_OF_print,
284 SET_OF_free,
285 0, /* Use generic outmost tag fetcher */
286 asn1_DEF_anything_tags,
287 sizeof(asn1_DEF_anything_tags)
288 /sizeof(asn1_DEF_anything_tags[0]), /* 1 */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000289 1, /* Whether CONSTRUCTED */
290 asn1_MBR_anything,
291 1, /* Single element */
292 &asn1_DEF_anything_specs /* Additional specs */
293};
294
295static asn1_TYPE_member_t asn1_MBR_Stuff[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000296 { ATF_POINTER, 2, offsetof(struct Stuff, trees),
Lev Walkin03ba3e92004-08-22 03:18:17 +0000297 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
298 .tag_mode = -1, /* IMPLICIT tag at current level */
299 .type = (void *)&asn1_DEF_trees,
300 .memb_constraints = 0, /* Defer to actual type */
301 .name = "trees"
302 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000303 { ATF_POINTER, 1, offsetof(struct Stuff, anything),
Lev Walkin03ba3e92004-08-22 03:18:17 +0000304 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
305 .tag_mode = -1, /* IMPLICIT tag at current level */
306 .type = (void *)&asn1_DEF_anything,
307 .memb_constraints = 0, /* Defer to actual type */
308 .name = "anything"
309 },
310};
311static ber_tlv_tag_t asn1_DEF_Stuff_tags[] = {
312 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
313};
314static asn1_TYPE_tag2member_t asn1_DEF_Stuff_tag2el[] = {
315 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* trees at 23 */
316 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* anything at 28 */
317};
318static uint8_t asn1_DEF_Stuff_mmap[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
319 (0 << 7) | (0 << 6)
320};
321static asn1_SET_specifics_t asn1_DEF_Stuff_specs = {
322 sizeof(struct Stuff),
323 offsetof(struct Stuff, _ber_dec_ctx),
324 offsetof(struct Stuff, _presence_map),
325 asn1_DEF_Stuff_tag2el,
326 2, /* Count of tags in the map */
327 0, /* Whether extensible */
328 (unsigned int *)asn1_DEF_Stuff_mmap /* Mandatory elements map */
329};
330asn1_TYPE_descriptor_t asn1_DEF_Stuff = {
331 "Stuff",
332 SET_constraint,
333 SET_decode_ber,
334 SET_encode_der,
335 SET_print,
336 SET_free,
337 0, /* Use generic outmost tag fetcher */
338 asn1_DEF_Stuff_tags,
339 sizeof(asn1_DEF_Stuff_tags)
340 /sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
Lev Walkin03ba3e92004-08-22 03:18:17 +0000341 1, /* Whether CONSTRUCTED */
342 asn1_MBR_Stuff,
343 2, /* Elements count */
344 &asn1_DEF_Stuff_specs /* Additional specs */
345};
346