blob: 6bf3d7c7593fd4c62c4a4049c273b92db8857752 [file] [log] [blame]
vlm7b9a7682004-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 {
vlmb47f48e2004-09-17 06:32:12 +000016 A_SET_OF(Tree_t) list;
vlm7b9a7682004-08-22 03:18:17 +000017
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[] = {
vlmddd5a7d2004-09-10 09:18:20 +000025 { ATF_NOFLAGS, 0, 0,
vlm7b9a7682004-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),
vlm39ba4c42004-09-22 16:06:28 +000039 0, /* XER encoding is XMLDelimitedItemList */
vlm7b9a7682004-08-22 03:18:17 +000040};
41asn1_TYPE_descriptor_t asn1_DEF_Forest = {
42 "Forest",
vlm39ba4c42004-09-22 16:06:28 +000043 SET_OF_free,
44 SET_OF_print,
vlm7b9a7682004-08-22 03:18:17 +000045 SET_OF_constraint,
46 SET_OF_decode_ber,
47 SET_OF_encode_der,
vlm39ba4c42004-09-22 16:06:28 +000048 0, /* Not implemented yet */
49 SET_OF_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +000050 0, /* Use generic outmost tag fetcher */
51 asn1_DEF_Forest_tags,
52 sizeof(asn1_DEF_Forest_tags)
53 /sizeof(asn1_DEF_Forest_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +000054 asn1_DEF_Forest_tags, /* Same as above */
55 sizeof(asn1_DEF_Forest_tags)
56 /sizeof(asn1_DEF_Forest_tags[0]), /* 1 */
vlm7b9a7682004-08-22 03:18:17 +000057 asn1_MBR_Forest,
58 1, /* Single element */
59 &asn1_DEF_Forest_specs /* Additional specs */
60};
61
62
63/*** <<< INCLUDES [Tree] >>> ***/
64
65#include <INTEGER.h>
66#include <constr_SEQUENCE.h>
67
68/*** <<< DEPS [Tree] >>> ***/
69
70extern asn1_TYPE_descriptor_t asn1_DEF_Tree;
71
72/*** <<< TYPE-DECLS [Tree] >>> ***/
73
74
75typedef struct Tree {
76 INTEGER_t height;
77 INTEGER_t width;
78
79 /* Context for parsing across buffer boundaries */
80 ber_dec_ctx_t _ber_dec_ctx;
81} Tree_t;
82
83/*** <<< STAT-DEFS [Tree] >>> ***/
84
85static asn1_TYPE_member_t asn1_MBR_Tree[] = {
vlmddd5a7d2004-09-10 09:18:20 +000086 { ATF_NOFLAGS, 0, offsetof(struct Tree, height),
vlm7b9a7682004-08-22 03:18:17 +000087 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
88 .tag_mode = 0,
89 .type = (void *)&asn1_DEF_INTEGER,
90 .memb_constraints = 0, /* Defer to actual type */
91 .name = "height"
92 },
vlmddd5a7d2004-09-10 09:18:20 +000093 { ATF_NOFLAGS, 0, offsetof(struct Tree, width),
vlm7b9a7682004-08-22 03:18:17 +000094 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
95 .tag_mode = 0,
96 .type = (void *)&asn1_DEF_INTEGER,
97 .memb_constraints = 0, /* Defer to actual type */
98 .name = "width"
99 },
100};
101static ber_tlv_tag_t asn1_DEF_Tree_tags[] = {
102 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
103};
104static asn1_TYPE_tag2member_t asn1_DEF_Tree_tag2el[] = {
105 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* height at 17 */
106 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* width at 19 */
107};
108static asn1_SEQUENCE_specifics_t asn1_DEF_Tree_specs = {
109 sizeof(struct Tree),
110 offsetof(struct Tree, _ber_dec_ctx),
111 asn1_DEF_Tree_tag2el,
112 2, /* Count of tags in the map */
113 -1, /* Start extensions */
114 -1 /* Stop extensions */
115};
116asn1_TYPE_descriptor_t asn1_DEF_Tree = {
117 "Tree",
vlm39ba4c42004-09-22 16:06:28 +0000118 SEQUENCE_free,
119 SEQUENCE_print,
vlm7b9a7682004-08-22 03:18:17 +0000120 SEQUENCE_constraint,
121 SEQUENCE_decode_ber,
122 SEQUENCE_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000123 0, /* Not implemented yet */
124 SEQUENCE_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000125 0, /* Use generic outmost tag fetcher */
126 asn1_DEF_Tree_tags,
127 sizeof(asn1_DEF_Tree_tags)
128 /sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000129 asn1_DEF_Tree_tags, /* Same as above */
130 sizeof(asn1_DEF_Tree_tags)
131 /sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
vlm7b9a7682004-08-22 03:18:17 +0000132 asn1_MBR_Tree,
133 2, /* Elements count */
134 &asn1_DEF_Tree_specs /* Additional specs */
135};
136
137
138/*** <<< INCLUDES [Stuff] >>> ***/
139
140#include <Forest.h>
141#include <asn_SET_OF.h>
142#include <constr_SET_OF.h>
143#include <BIT_STRING.h>
144#include <constr_SEQUENCE.h>
145#include <constr_SET.h>
146
147/*** <<< DEPS [Stuff] >>> ***/
148
149
150/*
151 * Method of determining the components presence
152 */
153typedef enum Stuff_PR {
154 Stuff_PR_trees, /* Member trees is present */
155 Stuff_PR_anything, /* Member anything is present */
156} Stuff_PR;
157extern asn1_TYPE_descriptor_t asn1_DEF_Stuff;
158
159/*** <<< TYPE-DECLS [Stuff] >>> ***/
160
161
162typedef struct Stuff {
163 struct trees {
vlmb47f48e2004-09-17 06:32:12 +0000164 A_SET_OF(Forest_t) list;
vlm7b9a7682004-08-22 03:18:17 +0000165
166 /* Context for parsing across buffer boundaries */
167 ber_dec_ctx_t _ber_dec_ctx;
168 } *trees;
169 struct anything {
170 A_SET_OF(struct anything_member {
171 BIT_STRING_t cup_of_coffee;
172 /*
173 * This type is extensible,
174 * possible extensions are below.
175 */
176
177 /* Context for parsing across buffer boundaries */
178 ber_dec_ctx_t _ber_dec_ctx;
179 } ) list;
180
181 /* Context for parsing across buffer boundaries */
182 ber_dec_ctx_t _ber_dec_ctx;
183 } *anything;
184
185 /* Presence bitmask: ASN_SET_ISPRESENT(pStuff, Stuff_PR_x) */
186 unsigned int _presence_map
187 [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
188
189 /* Context for parsing across buffer boundaries */
190 ber_dec_ctx_t _ber_dec_ctx;
191} Stuff_t;
192
193/*** <<< STAT-DEFS [Stuff] >>> ***/
194
195static asn1_TYPE_member_t asn1_MBR_trees[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000196 { ATF_NOFLAGS, 0, 0,
vlm7b9a7682004-08-22 03:18:17 +0000197 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
198 .tag_mode = 0,
199 .type = (void *)&asn1_DEF_Forest,
200 .memb_constraints = 0, /* Defer to actual type */
201 .name = ""
202 },
203};
204static ber_tlv_tag_t asn1_DEF_trees_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000205 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
206 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
vlm7b9a7682004-08-22 03:18:17 +0000207};
208static asn1_SET_OF_specifics_t asn1_DEF_trees_specs = {
209 sizeof(struct trees),
210 offsetof(struct trees, _ber_dec_ctx),
vlm39ba4c42004-09-22 16:06:28 +0000211 0, /* XER encoding is XMLDelimitedItemList */
vlm7b9a7682004-08-22 03:18:17 +0000212};
vlm1dc848e2004-09-07 06:44:29 +0000213static /* Use -fall-defs-global to expose */
vlm7b9a7682004-08-22 03:18:17 +0000214asn1_TYPE_descriptor_t asn1_DEF_trees = {
215 "trees",
vlm39ba4c42004-09-22 16:06:28 +0000216 SET_OF_free,
217 SET_OF_print,
vlm7b9a7682004-08-22 03:18:17 +0000218 SET_OF_constraint,
219 SET_OF_decode_ber,
220 SET_OF_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000221 0, /* Not implemented yet */
222 SET_OF_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000223 0, /* Use generic outmost tag fetcher */
224 asn1_DEF_trees_tags,
225 sizeof(asn1_DEF_trees_tags)
vlm72425de2004-09-13 08:31:01 +0000226 /sizeof(asn1_DEF_trees_tags[0]) - 1, /* 1 */
227 asn1_DEF_trees_tags, /* Same as above */
228 sizeof(asn1_DEF_trees_tags)
229 /sizeof(asn1_DEF_trees_tags[0]), /* 2 */
vlm7b9a7682004-08-22 03:18:17 +0000230 asn1_MBR_trees,
231 1, /* Single element */
232 &asn1_DEF_trees_specs /* Additional specs */
233};
234
235static asn1_TYPE_member_t asn1_MBR_anything_member[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000236 { ATF_NOFLAGS, 0, offsetof(struct anything_member, cup_of_coffee),
vlm7b9a7682004-08-22 03:18:17 +0000237 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
238 .tag_mode = 0,
239 .type = (void *)&asn1_DEF_BIT_STRING,
240 .memb_constraints = 0, /* Defer to actual type */
241 .name = "cup-of-coffee"
242 },
243};
244static ber_tlv_tag_t asn1_DEF_anything_member_tags[] = {
245 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
246};
247static asn1_TYPE_tag2member_t asn1_DEF_anything_member_tag2el[] = {
248 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 }, /* cup-of-coffee at 26 */
249};
250static asn1_SEQUENCE_specifics_t asn1_DEF_anything_member_specs = {
251 sizeof(struct anything_member),
252 offsetof(struct anything_member, _ber_dec_ctx),
253 asn1_DEF_anything_member_tag2el,
254 1, /* Count of tags in the map */
255 0, /* Start extensions */
256 2 /* Stop extensions */
257};
vlm1dc848e2004-09-07 06:44:29 +0000258static /* Use -fall-defs-global to expose */
vlm7b9a7682004-08-22 03:18:17 +0000259asn1_TYPE_descriptor_t asn1_DEF_anything_member = {
260 "",
vlm39ba4c42004-09-22 16:06:28 +0000261 SEQUENCE_free,
262 SEQUENCE_print,
vlm7b9a7682004-08-22 03:18:17 +0000263 SEQUENCE_constraint,
264 SEQUENCE_decode_ber,
265 SEQUENCE_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000266 0, /* Not implemented yet */
267 SEQUENCE_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000268 0, /* Use generic outmost tag fetcher */
269 asn1_DEF_anything_member_tags,
270 sizeof(asn1_DEF_anything_member_tags)
271 /sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000272 asn1_DEF_anything_member_tags, /* Same as above */
273 sizeof(asn1_DEF_anything_member_tags)
274 /sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
vlm7b9a7682004-08-22 03:18:17 +0000275 asn1_MBR_anything_member,
276 1, /* Elements count */
277 &asn1_DEF_anything_member_specs /* Additional specs */
278};
279
280static asn1_TYPE_member_t asn1_MBR_anything[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000281 { ATF_NOFLAGS, 0, 0,
vlm7b9a7682004-08-22 03:18:17 +0000282 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
283 .tag_mode = 0,
284 .type = (void *)&asn1_DEF_anything_member,
285 .memb_constraints = 0, /* Defer to actual type */
286 .name = ""
287 },
288};
289static ber_tlv_tag_t asn1_DEF_anything_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000290 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
291 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
vlm7b9a7682004-08-22 03:18:17 +0000292};
293static asn1_SET_OF_specifics_t asn1_DEF_anything_specs = {
294 sizeof(struct anything),
295 offsetof(struct anything, _ber_dec_ctx),
vlm39ba4c42004-09-22 16:06:28 +0000296 0, /* XER encoding is XMLDelimitedItemList */
vlm7b9a7682004-08-22 03:18:17 +0000297};
vlm1dc848e2004-09-07 06:44:29 +0000298static /* Use -fall-defs-global to expose */
vlm7b9a7682004-08-22 03:18:17 +0000299asn1_TYPE_descriptor_t asn1_DEF_anything = {
300 "anything",
vlm39ba4c42004-09-22 16:06:28 +0000301 SET_OF_free,
302 SET_OF_print,
vlm7b9a7682004-08-22 03:18:17 +0000303 SET_OF_constraint,
304 SET_OF_decode_ber,
305 SET_OF_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000306 0, /* Not implemented yet */
307 SET_OF_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000308 0, /* Use generic outmost tag fetcher */
309 asn1_DEF_anything_tags,
310 sizeof(asn1_DEF_anything_tags)
vlm72425de2004-09-13 08:31:01 +0000311 /sizeof(asn1_DEF_anything_tags[0]) - 1, /* 1 */
312 asn1_DEF_anything_tags, /* Same as above */
313 sizeof(asn1_DEF_anything_tags)
314 /sizeof(asn1_DEF_anything_tags[0]), /* 2 */
vlm7b9a7682004-08-22 03:18:17 +0000315 asn1_MBR_anything,
316 1, /* Single element */
317 &asn1_DEF_anything_specs /* Additional specs */
318};
319
320static asn1_TYPE_member_t asn1_MBR_Stuff[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000321 { ATF_POINTER, 2, offsetof(struct Stuff, trees),
vlm7b9a7682004-08-22 03:18:17 +0000322 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
323 .tag_mode = -1, /* IMPLICIT tag at current level */
324 .type = (void *)&asn1_DEF_trees,
325 .memb_constraints = 0, /* Defer to actual type */
326 .name = "trees"
327 },
vlmddd5a7d2004-09-10 09:18:20 +0000328 { ATF_POINTER, 1, offsetof(struct Stuff, anything),
vlm7b9a7682004-08-22 03:18:17 +0000329 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
330 .tag_mode = -1, /* IMPLICIT tag at current level */
331 .type = (void *)&asn1_DEF_anything,
332 .memb_constraints = 0, /* Defer to actual type */
333 .name = "anything"
334 },
335};
336static ber_tlv_tag_t asn1_DEF_Stuff_tags[] = {
337 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
338};
339static asn1_TYPE_tag2member_t asn1_DEF_Stuff_tag2el[] = {
340 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* trees at 23 */
341 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* anything at 28 */
342};
343static uint8_t asn1_DEF_Stuff_mmap[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
344 (0 << 7) | (0 << 6)
345};
346static asn1_SET_specifics_t asn1_DEF_Stuff_specs = {
347 sizeof(struct Stuff),
348 offsetof(struct Stuff, _ber_dec_ctx),
349 offsetof(struct Stuff, _presence_map),
350 asn1_DEF_Stuff_tag2el,
351 2, /* Count of tags in the map */
352 0, /* Whether extensible */
353 (unsigned int *)asn1_DEF_Stuff_mmap /* Mandatory elements map */
354};
355asn1_TYPE_descriptor_t asn1_DEF_Stuff = {
356 "Stuff",
vlm39ba4c42004-09-22 16:06:28 +0000357 SET_free,
358 SET_print,
vlm7b9a7682004-08-22 03:18:17 +0000359 SET_constraint,
360 SET_decode_ber,
361 SET_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000362 0, /* Not implemented yet */
363 SET_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000364 0, /* Use generic outmost tag fetcher */
365 asn1_DEF_Stuff_tags,
366 sizeof(asn1_DEF_Stuff_tags)
367 /sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000368 asn1_DEF_Stuff_tags, /* Same as above */
369 sizeof(asn1_DEF_Stuff_tags)
370 /sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
vlm7b9a7682004-08-22 03:18:17 +0000371 asn1_MBR_Stuff,
372 2, /* Elements count */
373 &asn1_DEF_Stuff_specs /* Additional specs */
374};
375