blob: 1f93524018ab518883df96e8e860654946034b8e [file] [log] [blame]
vlmb71a9d32004-09-08 00:26:56 +00001
2/*** <<< INCLUDES [Test-structure-1] >>> ***/
3
4#include <Test-structure-1.h>
5#include <INTEGER.h>
6#include <asn_SET_OF.h>
7#include <constr_SET_OF.h>
8#include <asn_SEQUENCE_OF.h>
9#include <constr_SEQUENCE_OF.h>
10#include <constr_SEQUENCE.h>
11
12/*** <<< DEPS [Test-structure-1] >>> ***/
13
14extern asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1;
15
16/*** <<< TYPE-DECLS [Test-structure-1] >>> ***/
17
18
19typedef struct Test_structure_1 {
20 struct t_member1 {
21 A_SET_OF(struct Test_structure_1) list;
22
23 /* Context for parsing across buffer boundaries */
24 ber_dec_ctx_t _ber_dec_ctx;
25 } t_member1;
26 struct t_member2 {
27 A_SEQUENCE_OF(struct Test_structure_1) list;
28
29 /* Context for parsing across buffer boundaries */
30 ber_dec_ctx_t _ber_dec_ctx;
31 } t_member2;
32 struct Test_structure_1 *t_member3 /* OPTIONAL */;
33 INTEGER_t t_member4;
34
35 /* Context for parsing across buffer boundaries */
36 ber_dec_ctx_t _ber_dec_ctx;
37} Test_structure_1_t;
38
39/*** <<< STAT-DEFS [Test-structure-1] >>> ***/
40
41static asn1_TYPE_member_t asn1_MBR_t_member1[] = {
vlmddd5a7d2004-09-10 09:18:20 +000042 { ATF_NOFLAGS, 0, 0,
vlmb71a9d32004-09-08 00:26:56 +000043 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
44 .tag_mode = 0,
45 .type = (void *)&asn1_DEF_Test_structure_1,
46 .memb_constraints = 0, /* Defer to actual type */
47 .name = ""
48 },
49};
50static ber_tlv_tag_t asn1_DEF_t_member1_tags[] = {
51 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
52};
53static asn1_SET_OF_specifics_t asn1_DEF_t_member1_specs = {
54 sizeof(struct t_member1),
55 offsetof(struct t_member1, _ber_dec_ctx),
56};
57static /* Use -fall-defs-global to expose */
58asn1_TYPE_descriptor_t asn1_DEF_t_member1 = {
59 "t-member1",
60 SET_OF_constraint,
61 SET_OF_decode_ber,
62 SET_OF_encode_der,
63 SET_OF_print,
64 SET_OF_free,
65 0, /* Use generic outmost tag fetcher */
66 asn1_DEF_t_member1_tags,
67 sizeof(asn1_DEF_t_member1_tags)
68 /sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +000069 asn1_DEF_t_member1_tags, /* Same as above */
70 sizeof(asn1_DEF_t_member1_tags)
71 /sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */
vlmb71a9d32004-09-08 00:26:56 +000072 1, /* Whether CONSTRUCTED */
73 asn1_MBR_t_member1,
74 1, /* Single element */
75 &asn1_DEF_t_member1_specs /* Additional specs */
76};
77
78static asn1_TYPE_member_t asn1_MBR_t_member2[] = {
vlmddd5a7d2004-09-10 09:18:20 +000079 { ATF_NOFLAGS, 0, 0,
vlmb71a9d32004-09-08 00:26:56 +000080 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
81 .tag_mode = 0,
82 .type = (void *)&asn1_DEF_Test_structure_1,
83 .memb_constraints = 0, /* Defer to actual type */
84 .name = ""
85 },
86};
87static ber_tlv_tag_t asn1_DEF_t_member2_tags[] = {
88 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
89};
90static asn1_SET_OF_specifics_t asn1_DEF_t_member2_specs = {
91 sizeof(struct t_member2),
92 offsetof(struct t_member2, _ber_dec_ctx),
93};
94static /* Use -fall-defs-global to expose */
95asn1_TYPE_descriptor_t asn1_DEF_t_member2 = {
96 "t-member2",
97 SEQUENCE_OF_constraint,
98 SEQUENCE_OF_decode_ber,
99 SEQUENCE_OF_encode_der,
100 SEQUENCE_OF_print,
101 SEQUENCE_OF_free,
102 0, /* Use generic outmost tag fetcher */
103 asn1_DEF_t_member2_tags,
104 sizeof(asn1_DEF_t_member2_tags)
105 /sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000106 asn1_DEF_t_member2_tags, /* Same as above */
107 sizeof(asn1_DEF_t_member2_tags)
108 /sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
vlmb71a9d32004-09-08 00:26:56 +0000109 1, /* Whether CONSTRUCTED */
110 asn1_MBR_t_member2,
111 1, /* Single element */
112 &asn1_DEF_t_member2_specs /* Additional specs */
113};
114
115static asn1_TYPE_member_t asn1_MBR_Test_structure_1[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000116 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member1),
vlmb71a9d32004-09-08 00:26:56 +0000117 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
118 .tag_mode = 0,
119 .type = (void *)&asn1_DEF_t_member1,
120 .memb_constraints = 0, /* Defer to actual type */
121 .name = "t-member1"
122 },
vlmddd5a7d2004-09-10 09:18:20 +0000123 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member2),
vlmb71a9d32004-09-08 00:26:56 +0000124 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
125 .tag_mode = 0,
126 .type = (void *)&asn1_DEF_t_member2,
127 .memb_constraints = 0, /* Defer to actual type */
128 .name = "t-member2"
129 },
vlmddd5a7d2004-09-10 09:18:20 +0000130 { ATF_POINTER, 1, offsetof(struct Test_structure_1, t_member3),
vlmb71a9d32004-09-08 00:26:56 +0000131 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
132 .tag_mode = 0,
133 .type = (void *)&asn1_DEF_Test_structure_1,
134 .memb_constraints = 0, /* Defer to actual type */
135 .name = "t-member3"
136 },
vlmddd5a7d2004-09-10 09:18:20 +0000137 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member4),
vlmb71a9d32004-09-08 00:26:56 +0000138 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
139 .tag_mode = 0,
140 .type = (void *)&asn1_DEF_INTEGER,
141 .memb_constraints = 0, /* Defer to actual type */
142 .name = "t-member4"
143 },
144};
145static ber_tlv_tag_t asn1_DEF_Test_structure_1_tags[] = {
146 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
147};
148static asn1_TYPE_tag2member_t asn1_DEF_Test_structure_1_tag2el[] = {
149 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* t-member4 at 19 */
150 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 1 }, /* t-member2 at 16 */
151 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 }, /* t-member3 at 17 */
152 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 }, /* t-member1 at 15 */
153};
154static asn1_SEQUENCE_specifics_t asn1_DEF_Test_structure_1_specs = {
155 sizeof(struct Test_structure_1),
156 offsetof(struct Test_structure_1, _ber_dec_ctx),
157 asn1_DEF_Test_structure_1_tag2el,
158 4, /* Count of tags in the map */
159 -1, /* Start extensions */
160 -1 /* Stop extensions */
161};
162asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1 = {
163 "Test-structure-1",
164 SEQUENCE_constraint,
165 SEQUENCE_decode_ber,
166 SEQUENCE_encode_der,
167 SEQUENCE_print,
168 SEQUENCE_free,
169 0, /* Use generic outmost tag fetcher */
170 asn1_DEF_Test_structure_1_tags,
171 sizeof(asn1_DEF_Test_structure_1_tags)
172 /sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000173 asn1_DEF_Test_structure_1_tags, /* Same as above */
174 sizeof(asn1_DEF_Test_structure_1_tags)
175 /sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
vlmb71a9d32004-09-08 00:26:56 +0000176 1, /* Whether CONSTRUCTED */
177 asn1_MBR_Test_structure_1,
178 4, /* Elements count */
179 &asn1_DEF_Test_structure_1_specs /* Additional specs */
180};
181
182
183/*** <<< INCLUDES [Choice-1] >>> ***/
184
185#include <Choice-1.h>
186#include <INTEGER.h>
187#include <asn_SET_OF.h>
188#include <constr_SET_OF.h>
189#include <constr_CHOICE.h>
190
191/*** <<< DEPS [Choice-1] >>> ***/
192
193typedef enum Choice_1_PR {
194 Choice_1_PR_NOTHING, /* No components present */
195 Choice_1_PR_and,
196 Choice_1_PR_or,
197 Choice_1_PR_not,
198 Choice_1_PR_other,
199} Choice_1_PR;
200extern asn1_TYPE_descriptor_t asn1_DEF_Choice_1;
201
202/*** <<< TYPE-DECLS [Choice-1] >>> ***/
203
204
205typedef struct Choice_1 {
206 Choice_1_PR present;
207 union {
vlmddd5a7d2004-09-10 09:18:20 +0000208 struct Choice_1 *and;
vlmb71a9d32004-09-08 00:26:56 +0000209 struct or {
210 A_SET_OF(struct Choice_1) list;
211
212 /* Context for parsing across buffer boundaries */
213 ber_dec_ctx_t _ber_dec_ctx;
214 } or;
vlmddd5a7d2004-09-10 09:18:20 +0000215 struct Choice_1 *not;
vlmb71a9d32004-09-08 00:26:56 +0000216 INTEGER_t other;
217 } choice;
218
219 /* Context for parsing across buffer boundaries */
220 ber_dec_ctx_t _ber_dec_ctx;
221} Choice_1_t;
222
223/*** <<< STAT-DEFS [Choice-1] >>> ***/
224
225static asn1_TYPE_member_t asn1_MBR_or[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000226 { ATF_NOFLAGS, 0, 0,
vlm060fe2a2004-09-10 09:37:12 +0000227 .tag = -1 /* Ambiguous tag (CHOICE?) */,
vlmb71a9d32004-09-08 00:26:56 +0000228 .tag_mode = 0,
229 .type = (void *)&asn1_DEF_Choice_1,
230 .memb_constraints = 0, /* Defer to actual type */
231 .name = ""
232 },
233};
234static ber_tlv_tag_t asn1_DEF_or_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000235 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
236 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
vlmb71a9d32004-09-08 00:26:56 +0000237};
238static asn1_SET_OF_specifics_t asn1_DEF_or_specs = {
239 sizeof(struct or),
240 offsetof(struct or, _ber_dec_ctx),
241};
242static /* Use -fall-defs-global to expose */
243asn1_TYPE_descriptor_t asn1_DEF_or = {
244 "or",
245 SET_OF_constraint,
246 SET_OF_decode_ber,
247 SET_OF_encode_der,
248 SET_OF_print,
249 SET_OF_free,
250 0, /* Use generic outmost tag fetcher */
251 asn1_DEF_or_tags,
252 sizeof(asn1_DEF_or_tags)
vlm72425de2004-09-13 08:31:01 +0000253 /sizeof(asn1_DEF_or_tags[0]) - 1, /* 1 */
254 asn1_DEF_or_tags, /* Same as above */
255 sizeof(asn1_DEF_or_tags)
256 /sizeof(asn1_DEF_or_tags[0]), /* 2 */
vlmb71a9d32004-09-08 00:26:56 +0000257 1, /* Whether CONSTRUCTED */
258 asn1_MBR_or,
259 1, /* Single element */
260 &asn1_DEF_or_specs /* Additional specs */
261};
262
263static asn1_TYPE_member_t asn1_MBR_Choice_1[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000264 { ATF_POINTER, 0, offsetof(struct Choice_1, choice.and),
vlmb71a9d32004-09-08 00:26:56 +0000265 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
266 .tag_mode = +1, /* EXPLICIT tag at current level */
267 .type = (void *)&asn1_DEF_Choice_1,
268 .memb_constraints = 0, /* Defer to actual type */
269 .name = "and"
270 },
vlmddd5a7d2004-09-10 09:18:20 +0000271 { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.or),
vlmb71a9d32004-09-08 00:26:56 +0000272 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
273 .tag_mode = -1, /* IMPLICIT tag at current level */
274 .type = (void *)&asn1_DEF_or,
275 .memb_constraints = 0, /* Defer to actual type */
276 .name = "or"
277 },
vlmddd5a7d2004-09-10 09:18:20 +0000278 { ATF_POINTER, 0, offsetof(struct Choice_1, choice.not),
vlmb71a9d32004-09-08 00:26:56 +0000279 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
280 .tag_mode = +1, /* EXPLICIT tag at current level */
281 .type = (void *)&asn1_DEF_Choice_1,
282 .memb_constraints = 0, /* Defer to actual type */
283 .name = "not"
284 },
vlmddd5a7d2004-09-10 09:18:20 +0000285 { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.other),
vlmb71a9d32004-09-08 00:26:56 +0000286 .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
287 .tag_mode = +1, /* EXPLICIT tag at current level */
288 .type = (void *)&asn1_DEF_INTEGER,
289 .memb_constraints = 0, /* Defer to actual type */
290 .name = "other"
291 },
292};
293static asn1_TYPE_tag2member_t asn1_DEF_Choice_1_tag2el[] = {
294 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* and at 22 */
295 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* or at 23 */
296 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* not at 24 */
297 { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 }, /* other at 26 */
298};
299static asn1_CHOICE_specifics_t asn1_DEF_Choice_1_specs = {
300 sizeof(struct Choice_1),
301 offsetof(struct Choice_1, _ber_dec_ctx),
302 offsetof(struct Choice_1, present),
303 sizeof(((struct Choice_1 *)0)->present),
304 asn1_DEF_Choice_1_tag2el,
305 4, /* Count of tags in the map */
306 0 /* Whether extensible */
307};
308asn1_TYPE_descriptor_t asn1_DEF_Choice_1 = {
309 "Choice-1",
310 CHOICE_constraint,
311 CHOICE_decode_ber,
312 CHOICE_encode_der,
313 CHOICE_print,
314 CHOICE_free,
315 CHOICE_outmost_tag,
vlm72425de2004-09-13 08:31:01 +0000316 0, /* No effective tags (pointer) */
317 0, /* No effective tags (count) */
318 0, /* No tags (pointer) */
319 0, /* No tags (count) */
vlmb71a9d32004-09-08 00:26:56 +0000320 1, /* Whether CONSTRUCTED */
321 asn1_MBR_Choice_1,
322 4, /* Elements count */
323 &asn1_DEF_Choice_1_specs /* Additional specs */
324};
325