blob: ce284dfca9366aa6f839f9a78f732a54b6f1796c [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 1, /* Whether CONSTRUCTED */
58 asn1_MBR_Forest,
59 1, /* Single element */
60 &asn1_DEF_Forest_specs /* Additional specs */
61};
62
63
64/*** <<< INCLUDES [Tree] >>> ***/
65
66#include <INTEGER.h>
67#include <constr_SEQUENCE.h>
68
69/*** <<< DEPS [Tree] >>> ***/
70
71extern asn1_TYPE_descriptor_t asn1_DEF_Tree;
72
73/*** <<< TYPE-DECLS [Tree] >>> ***/
74
75
76typedef struct Tree {
77 INTEGER_t height;
78 INTEGER_t width;
79
80 /* Context for parsing across buffer boundaries */
81 ber_dec_ctx_t _ber_dec_ctx;
82} Tree_t;
83
84/*** <<< STAT-DEFS [Tree] >>> ***/
85
86static asn1_TYPE_member_t asn1_MBR_Tree[] = {
vlmddd5a7d2004-09-10 09:18:20 +000087 { ATF_NOFLAGS, 0, offsetof(struct Tree, height),
vlm7b9a7682004-08-22 03:18:17 +000088 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
89 .tag_mode = 0,
90 .type = (void *)&asn1_DEF_INTEGER,
91 .memb_constraints = 0, /* Defer to actual type */
92 .name = "height"
93 },
vlmddd5a7d2004-09-10 09:18:20 +000094 { ATF_NOFLAGS, 0, offsetof(struct Tree, width),
vlm7b9a7682004-08-22 03:18:17 +000095 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
96 .tag_mode = 0,
97 .type = (void *)&asn1_DEF_INTEGER,
98 .memb_constraints = 0, /* Defer to actual type */
99 .name = "width"
100 },
101};
102static ber_tlv_tag_t asn1_DEF_Tree_tags[] = {
103 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
104};
105static asn1_TYPE_tag2member_t asn1_DEF_Tree_tag2el[] = {
106 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* height at 17 */
107 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* width at 19 */
108};
109static asn1_SEQUENCE_specifics_t asn1_DEF_Tree_specs = {
110 sizeof(struct Tree),
111 offsetof(struct Tree, _ber_dec_ctx),
112 asn1_DEF_Tree_tag2el,
113 2, /* Count of tags in the map */
114 -1, /* Start extensions */
115 -1 /* Stop extensions */
116};
117asn1_TYPE_descriptor_t asn1_DEF_Tree = {
118 "Tree",
vlm39ba4c42004-09-22 16:06:28 +0000119 SEQUENCE_free,
120 SEQUENCE_print,
vlm7b9a7682004-08-22 03:18:17 +0000121 SEQUENCE_constraint,
122 SEQUENCE_decode_ber,
123 SEQUENCE_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000124 0, /* Not implemented yet */
125 SEQUENCE_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000126 0, /* Use generic outmost tag fetcher */
127 asn1_DEF_Tree_tags,
128 sizeof(asn1_DEF_Tree_tags)
129 /sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000130 asn1_DEF_Tree_tags, /* Same as above */
131 sizeof(asn1_DEF_Tree_tags)
132 /sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
vlm7b9a7682004-08-22 03:18:17 +0000133 1, /* Whether CONSTRUCTED */
134 asn1_MBR_Tree,
135 2, /* Elements count */
136 &asn1_DEF_Tree_specs /* Additional specs */
137};
138
139
140/*** <<< INCLUDES [Stuff] >>> ***/
141
142#include <Forest.h>
143#include <asn_SET_OF.h>
144#include <constr_SET_OF.h>
145#include <BIT_STRING.h>
146#include <constr_SEQUENCE.h>
147#include <constr_SET.h>
148
149/*** <<< DEPS [Stuff] >>> ***/
150
151
152/*
153 * Method of determining the components presence
154 */
155typedef enum Stuff_PR {
156 Stuff_PR_trees, /* Member trees is present */
157 Stuff_PR_anything, /* Member anything is present */
158} Stuff_PR;
159extern asn1_TYPE_descriptor_t asn1_DEF_Stuff;
160
161/*** <<< TYPE-DECLS [Stuff] >>> ***/
162
163
164typedef struct Stuff {
165 struct trees {
vlmb47f48e2004-09-17 06:32:12 +0000166 A_SET_OF(Forest_t) list;
vlm7b9a7682004-08-22 03:18:17 +0000167
168 /* Context for parsing across buffer boundaries */
169 ber_dec_ctx_t _ber_dec_ctx;
170 } *trees;
171 struct anything {
172 A_SET_OF(struct anything_member {
173 BIT_STRING_t cup_of_coffee;
174 /*
175 * This type is extensible,
176 * possible extensions are below.
177 */
178
179 /* Context for parsing across buffer boundaries */
180 ber_dec_ctx_t _ber_dec_ctx;
181 } ) list;
182
183 /* Context for parsing across buffer boundaries */
184 ber_dec_ctx_t _ber_dec_ctx;
185 } *anything;
186
187 /* Presence bitmask: ASN_SET_ISPRESENT(pStuff, Stuff_PR_x) */
188 unsigned int _presence_map
189 [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
190
191 /* Context for parsing across buffer boundaries */
192 ber_dec_ctx_t _ber_dec_ctx;
193} Stuff_t;
194
195/*** <<< STAT-DEFS [Stuff] >>> ***/
196
197static asn1_TYPE_member_t asn1_MBR_trees[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000198 { ATF_NOFLAGS, 0, 0,
vlm7b9a7682004-08-22 03:18:17 +0000199 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
200 .tag_mode = 0,
201 .type = (void *)&asn1_DEF_Forest,
202 .memb_constraints = 0, /* Defer to actual type */
203 .name = ""
204 },
205};
206static ber_tlv_tag_t asn1_DEF_trees_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000207 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
208 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
vlm7b9a7682004-08-22 03:18:17 +0000209};
210static asn1_SET_OF_specifics_t asn1_DEF_trees_specs = {
211 sizeof(struct trees),
212 offsetof(struct trees, _ber_dec_ctx),
vlm39ba4c42004-09-22 16:06:28 +0000213 0, /* XER encoding is XMLDelimitedItemList */
vlm7b9a7682004-08-22 03:18:17 +0000214};
vlm1dc848e2004-09-07 06:44:29 +0000215static /* Use -fall-defs-global to expose */
vlm7b9a7682004-08-22 03:18:17 +0000216asn1_TYPE_descriptor_t asn1_DEF_trees = {
217 "trees",
vlm39ba4c42004-09-22 16:06:28 +0000218 SET_OF_free,
219 SET_OF_print,
vlm7b9a7682004-08-22 03:18:17 +0000220 SET_OF_constraint,
221 SET_OF_decode_ber,
222 SET_OF_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000223 0, /* Not implemented yet */
224 SET_OF_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000225 0, /* Use generic outmost tag fetcher */
226 asn1_DEF_trees_tags,
227 sizeof(asn1_DEF_trees_tags)
vlm72425de2004-09-13 08:31:01 +0000228 /sizeof(asn1_DEF_trees_tags[0]) - 1, /* 1 */
229 asn1_DEF_trees_tags, /* Same as above */
230 sizeof(asn1_DEF_trees_tags)
231 /sizeof(asn1_DEF_trees_tags[0]), /* 2 */
vlm7b9a7682004-08-22 03:18:17 +0000232 1, /* Whether CONSTRUCTED */
233 asn1_MBR_trees,
234 1, /* Single element */
235 &asn1_DEF_trees_specs /* Additional specs */
236};
237
238static asn1_TYPE_member_t asn1_MBR_anything_member[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000239 { ATF_NOFLAGS, 0, offsetof(struct anything_member, cup_of_coffee),
vlm7b9a7682004-08-22 03:18:17 +0000240 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
241 .tag_mode = 0,
242 .type = (void *)&asn1_DEF_BIT_STRING,
243 .memb_constraints = 0, /* Defer to actual type */
244 .name = "cup-of-coffee"
245 },
246};
247static ber_tlv_tag_t asn1_DEF_anything_member_tags[] = {
248 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
249};
250static asn1_TYPE_tag2member_t asn1_DEF_anything_member_tag2el[] = {
251 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 }, /* cup-of-coffee at 26 */
252};
253static asn1_SEQUENCE_specifics_t asn1_DEF_anything_member_specs = {
254 sizeof(struct anything_member),
255 offsetof(struct anything_member, _ber_dec_ctx),
256 asn1_DEF_anything_member_tag2el,
257 1, /* Count of tags in the map */
258 0, /* Start extensions */
259 2 /* Stop extensions */
260};
vlm1dc848e2004-09-07 06:44:29 +0000261static /* Use -fall-defs-global to expose */
vlm7b9a7682004-08-22 03:18:17 +0000262asn1_TYPE_descriptor_t asn1_DEF_anything_member = {
263 "",
vlm39ba4c42004-09-22 16:06:28 +0000264 SEQUENCE_free,
265 SEQUENCE_print,
vlm7b9a7682004-08-22 03:18:17 +0000266 SEQUENCE_constraint,
267 SEQUENCE_decode_ber,
268 SEQUENCE_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000269 0, /* Not implemented yet */
270 SEQUENCE_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000271 0, /* Use generic outmost tag fetcher */
272 asn1_DEF_anything_member_tags,
273 sizeof(asn1_DEF_anything_member_tags)
274 /sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000275 asn1_DEF_anything_member_tags, /* Same as above */
276 sizeof(asn1_DEF_anything_member_tags)
277 /sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
vlm7b9a7682004-08-22 03:18:17 +0000278 1, /* Whether CONSTRUCTED */
279 asn1_MBR_anything_member,
280 1, /* Elements count */
281 &asn1_DEF_anything_member_specs /* Additional specs */
282};
283
284static asn1_TYPE_member_t asn1_MBR_anything[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000285 { ATF_NOFLAGS, 0, 0,
vlm7b9a7682004-08-22 03:18:17 +0000286 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
287 .tag_mode = 0,
288 .type = (void *)&asn1_DEF_anything_member,
289 .memb_constraints = 0, /* Defer to actual type */
290 .name = ""
291 },
292};
293static ber_tlv_tag_t asn1_DEF_anything_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000294 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
295 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
vlm7b9a7682004-08-22 03:18:17 +0000296};
297static asn1_SET_OF_specifics_t asn1_DEF_anything_specs = {
298 sizeof(struct anything),
299 offsetof(struct anything, _ber_dec_ctx),
vlm39ba4c42004-09-22 16:06:28 +0000300 0, /* XER encoding is XMLDelimitedItemList */
vlm7b9a7682004-08-22 03:18:17 +0000301};
vlm1dc848e2004-09-07 06:44:29 +0000302static /* Use -fall-defs-global to expose */
vlm7b9a7682004-08-22 03:18:17 +0000303asn1_TYPE_descriptor_t asn1_DEF_anything = {
304 "anything",
vlm39ba4c42004-09-22 16:06:28 +0000305 SET_OF_free,
306 SET_OF_print,
vlm7b9a7682004-08-22 03:18:17 +0000307 SET_OF_constraint,
308 SET_OF_decode_ber,
309 SET_OF_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000310 0, /* Not implemented yet */
311 SET_OF_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000312 0, /* Use generic outmost tag fetcher */
313 asn1_DEF_anything_tags,
314 sizeof(asn1_DEF_anything_tags)
vlm72425de2004-09-13 08:31:01 +0000315 /sizeof(asn1_DEF_anything_tags[0]) - 1, /* 1 */
316 asn1_DEF_anything_tags, /* Same as above */
317 sizeof(asn1_DEF_anything_tags)
318 /sizeof(asn1_DEF_anything_tags[0]), /* 2 */
vlm7b9a7682004-08-22 03:18:17 +0000319 1, /* Whether CONSTRUCTED */
320 asn1_MBR_anything,
321 1, /* Single element */
322 &asn1_DEF_anything_specs /* Additional specs */
323};
324
325static asn1_TYPE_member_t asn1_MBR_Stuff[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000326 { ATF_POINTER, 2, offsetof(struct Stuff, trees),
vlm7b9a7682004-08-22 03:18:17 +0000327 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
328 .tag_mode = -1, /* IMPLICIT tag at current level */
329 .type = (void *)&asn1_DEF_trees,
330 .memb_constraints = 0, /* Defer to actual type */
331 .name = "trees"
332 },
vlmddd5a7d2004-09-10 09:18:20 +0000333 { ATF_POINTER, 1, offsetof(struct Stuff, anything),
vlm7b9a7682004-08-22 03:18:17 +0000334 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
335 .tag_mode = -1, /* IMPLICIT tag at current level */
336 .type = (void *)&asn1_DEF_anything,
337 .memb_constraints = 0, /* Defer to actual type */
338 .name = "anything"
339 },
340};
341static ber_tlv_tag_t asn1_DEF_Stuff_tags[] = {
342 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
343};
344static asn1_TYPE_tag2member_t asn1_DEF_Stuff_tag2el[] = {
345 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* trees at 23 */
346 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* anything at 28 */
347};
348static uint8_t asn1_DEF_Stuff_mmap[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
349 (0 << 7) | (0 << 6)
350};
351static asn1_SET_specifics_t asn1_DEF_Stuff_specs = {
352 sizeof(struct Stuff),
353 offsetof(struct Stuff, _ber_dec_ctx),
354 offsetof(struct Stuff, _presence_map),
355 asn1_DEF_Stuff_tag2el,
356 2, /* Count of tags in the map */
357 0, /* Whether extensible */
358 (unsigned int *)asn1_DEF_Stuff_mmap /* Mandatory elements map */
359};
360asn1_TYPE_descriptor_t asn1_DEF_Stuff = {
361 "Stuff",
vlm39ba4c42004-09-22 16:06:28 +0000362 SET_free,
363 SET_print,
vlm7b9a7682004-08-22 03:18:17 +0000364 SET_constraint,
365 SET_decode_ber,
366 SET_encode_der,
vlm39ba4c42004-09-22 16:06:28 +0000367 0, /* Not implemented yet */
368 SET_encode_xer,
vlm7b9a7682004-08-22 03:18:17 +0000369 0, /* Use generic outmost tag fetcher */
370 asn1_DEF_Stuff_tags,
371 sizeof(asn1_DEF_Stuff_tags)
372 /sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000373 asn1_DEF_Stuff_tags, /* Same as above */
374 sizeof(asn1_DEF_Stuff_tags)
375 /sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
vlm7b9a7682004-08-22 03:18:17 +0000376 1, /* Whether CONSTRUCTED */
377 asn1_MBR_Stuff,
378 2, /* Elements count */
379 &asn1_DEF_Stuff_specs /* Additional specs */
380};
381