blob: 3ff74e4bfb701afdcc1f68147a844ac65fc16e02 [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 */
69 1, /* Tags to skip */
70 1, /* Whether CONSTRUCTED */
71 asn1_MBR_t_member1,
72 1, /* Single element */
73 &asn1_DEF_t_member1_specs /* Additional specs */
74};
75
76static asn1_TYPE_member_t asn1_MBR_t_member2[] = {
vlmddd5a7d2004-09-10 09:18:20 +000077 { ATF_NOFLAGS, 0, 0,
vlmb71a9d32004-09-08 00:26:56 +000078 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
79 .tag_mode = 0,
80 .type = (void *)&asn1_DEF_Test_structure_1,
81 .memb_constraints = 0, /* Defer to actual type */
82 .name = ""
83 },
84};
85static ber_tlv_tag_t asn1_DEF_t_member2_tags[] = {
86 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
87};
88static asn1_SET_OF_specifics_t asn1_DEF_t_member2_specs = {
89 sizeof(struct t_member2),
90 offsetof(struct t_member2, _ber_dec_ctx),
91};
92static /* Use -fall-defs-global to expose */
93asn1_TYPE_descriptor_t asn1_DEF_t_member2 = {
94 "t-member2",
95 SEQUENCE_OF_constraint,
96 SEQUENCE_OF_decode_ber,
97 SEQUENCE_OF_encode_der,
98 SEQUENCE_OF_print,
99 SEQUENCE_OF_free,
100 0, /* Use generic outmost tag fetcher */
101 asn1_DEF_t_member2_tags,
102 sizeof(asn1_DEF_t_member2_tags)
103 /sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
104 1, /* Tags to skip */
105 1, /* Whether CONSTRUCTED */
106 asn1_MBR_t_member2,
107 1, /* Single element */
108 &asn1_DEF_t_member2_specs /* Additional specs */
109};
110
111static asn1_TYPE_member_t asn1_MBR_Test_structure_1[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000112 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member1),
vlmb71a9d32004-09-08 00:26:56 +0000113 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
114 .tag_mode = 0,
115 .type = (void *)&asn1_DEF_t_member1,
116 .memb_constraints = 0, /* Defer to actual type */
117 .name = "t-member1"
118 },
vlmddd5a7d2004-09-10 09:18:20 +0000119 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member2),
vlmb71a9d32004-09-08 00:26:56 +0000120 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
121 .tag_mode = 0,
122 .type = (void *)&asn1_DEF_t_member2,
123 .memb_constraints = 0, /* Defer to actual type */
124 .name = "t-member2"
125 },
vlmddd5a7d2004-09-10 09:18:20 +0000126 { ATF_POINTER, 1, offsetof(struct Test_structure_1, t_member3),
vlmb71a9d32004-09-08 00:26:56 +0000127 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
128 .tag_mode = 0,
129 .type = (void *)&asn1_DEF_Test_structure_1,
130 .memb_constraints = 0, /* Defer to actual type */
131 .name = "t-member3"
132 },
vlmddd5a7d2004-09-10 09:18:20 +0000133 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member4),
vlmb71a9d32004-09-08 00:26:56 +0000134 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
135 .tag_mode = 0,
136 .type = (void *)&asn1_DEF_INTEGER,
137 .memb_constraints = 0, /* Defer to actual type */
138 .name = "t-member4"
139 },
140};
141static ber_tlv_tag_t asn1_DEF_Test_structure_1_tags[] = {
142 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
143};
144static asn1_TYPE_tag2member_t asn1_DEF_Test_structure_1_tag2el[] = {
145 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* t-member4 at 19 */
146 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 1 }, /* t-member2 at 16 */
147 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 }, /* t-member3 at 17 */
148 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 }, /* t-member1 at 15 */
149};
150static asn1_SEQUENCE_specifics_t asn1_DEF_Test_structure_1_specs = {
151 sizeof(struct Test_structure_1),
152 offsetof(struct Test_structure_1, _ber_dec_ctx),
153 asn1_DEF_Test_structure_1_tag2el,
154 4, /* Count of tags in the map */
155 -1, /* Start extensions */
156 -1 /* Stop extensions */
157};
158asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1 = {
159 "Test-structure-1",
160 SEQUENCE_constraint,
161 SEQUENCE_decode_ber,
162 SEQUENCE_encode_der,
163 SEQUENCE_print,
164 SEQUENCE_free,
165 0, /* Use generic outmost tag fetcher */
166 asn1_DEF_Test_structure_1_tags,
167 sizeof(asn1_DEF_Test_structure_1_tags)
168 /sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
169 1, /* Tags to skip */
170 1, /* Whether CONSTRUCTED */
171 asn1_MBR_Test_structure_1,
172 4, /* Elements count */
173 &asn1_DEF_Test_structure_1_specs /* Additional specs */
174};
175
176
177/*** <<< INCLUDES [Choice-1] >>> ***/
178
179#include <Choice-1.h>
180#include <INTEGER.h>
181#include <asn_SET_OF.h>
182#include <constr_SET_OF.h>
183#include <constr_CHOICE.h>
184
185/*** <<< DEPS [Choice-1] >>> ***/
186
187typedef enum Choice_1_PR {
188 Choice_1_PR_NOTHING, /* No components present */
189 Choice_1_PR_and,
190 Choice_1_PR_or,
191 Choice_1_PR_not,
192 Choice_1_PR_other,
193} Choice_1_PR;
194extern asn1_TYPE_descriptor_t asn1_DEF_Choice_1;
195
196/*** <<< TYPE-DECLS [Choice-1] >>> ***/
197
198
199typedef struct Choice_1 {
200 Choice_1_PR present;
201 union {
vlmddd5a7d2004-09-10 09:18:20 +0000202 struct Choice_1 *and;
vlmb71a9d32004-09-08 00:26:56 +0000203 struct or {
204 A_SET_OF(struct Choice_1) list;
205
206 /* Context for parsing across buffer boundaries */
207 ber_dec_ctx_t _ber_dec_ctx;
208 } or;
vlmddd5a7d2004-09-10 09:18:20 +0000209 struct Choice_1 *not;
vlmb71a9d32004-09-08 00:26:56 +0000210 INTEGER_t other;
211 } choice;
212
213 /* Context for parsing across buffer boundaries */
214 ber_dec_ctx_t _ber_dec_ctx;
215} Choice_1_t;
216
217/*** <<< STAT-DEFS [Choice-1] >>> ***/
218
219static asn1_TYPE_member_t asn1_MBR_or[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000220 { ATF_NOFLAGS, 0, 0,
vlmb71a9d32004-09-08 00:26:56 +0000221 .tag = -1 /* Ambiguous tag (CHOICE|ANY?) */,
222 .tag_mode = 0,
223 .type = (void *)&asn1_DEF_Choice_1,
224 .memb_constraints = 0, /* Defer to actual type */
225 .name = ""
226 },
227};
228static ber_tlv_tag_t asn1_DEF_or_tags[] = {
229 (ASN_TAG_CLASS_CONTEXT | (2 << 2))
230};
231static asn1_SET_OF_specifics_t asn1_DEF_or_specs = {
232 sizeof(struct or),
233 offsetof(struct or, _ber_dec_ctx),
234};
235static /* Use -fall-defs-global to expose */
236asn1_TYPE_descriptor_t asn1_DEF_or = {
237 "or",
238 SET_OF_constraint,
239 SET_OF_decode_ber,
240 SET_OF_encode_der,
241 SET_OF_print,
242 SET_OF_free,
243 0, /* Use generic outmost tag fetcher */
244 asn1_DEF_or_tags,
245 sizeof(asn1_DEF_or_tags)
246 /sizeof(asn1_DEF_or_tags[0]), /* 1 */
247 1, /* Tags to skip */
248 1, /* Whether CONSTRUCTED */
249 asn1_MBR_or,
250 1, /* Single element */
251 &asn1_DEF_or_specs /* Additional specs */
252};
253
254static asn1_TYPE_member_t asn1_MBR_Choice_1[] = {
vlmddd5a7d2004-09-10 09:18:20 +0000255 { ATF_POINTER, 0, offsetof(struct Choice_1, choice.and),
vlmb71a9d32004-09-08 00:26:56 +0000256 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
257 .tag_mode = +1, /* EXPLICIT tag at current level */
258 .type = (void *)&asn1_DEF_Choice_1,
259 .memb_constraints = 0, /* Defer to actual type */
260 .name = "and"
261 },
vlmddd5a7d2004-09-10 09:18:20 +0000262 { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.or),
vlmb71a9d32004-09-08 00:26:56 +0000263 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
264 .tag_mode = -1, /* IMPLICIT tag at current level */
265 .type = (void *)&asn1_DEF_or,
266 .memb_constraints = 0, /* Defer to actual type */
267 .name = "or"
268 },
vlmddd5a7d2004-09-10 09:18:20 +0000269 { ATF_POINTER, 0, offsetof(struct Choice_1, choice.not),
vlmb71a9d32004-09-08 00:26:56 +0000270 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
271 .tag_mode = +1, /* EXPLICIT tag at current level */
272 .type = (void *)&asn1_DEF_Choice_1,
273 .memb_constraints = 0, /* Defer to actual type */
274 .name = "not"
275 },
vlmddd5a7d2004-09-10 09:18:20 +0000276 { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.other),
vlmb71a9d32004-09-08 00:26:56 +0000277 .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
278 .tag_mode = +1, /* EXPLICIT tag at current level */
279 .type = (void *)&asn1_DEF_INTEGER,
280 .memb_constraints = 0, /* Defer to actual type */
281 .name = "other"
282 },
283};
284static asn1_TYPE_tag2member_t asn1_DEF_Choice_1_tag2el[] = {
285 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* and at 22 */
286 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* or at 23 */
287 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* not at 24 */
288 { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 }, /* other at 26 */
289};
290static asn1_CHOICE_specifics_t asn1_DEF_Choice_1_specs = {
291 sizeof(struct Choice_1),
292 offsetof(struct Choice_1, _ber_dec_ctx),
293 offsetof(struct Choice_1, present),
294 sizeof(((struct Choice_1 *)0)->present),
295 asn1_DEF_Choice_1_tag2el,
296 4, /* Count of tags in the map */
297 0 /* Whether extensible */
298};
299asn1_TYPE_descriptor_t asn1_DEF_Choice_1 = {
300 "Choice-1",
301 CHOICE_constraint,
302 CHOICE_decode_ber,
303 CHOICE_encode_der,
304 CHOICE_print,
305 CHOICE_free,
306 CHOICE_outmost_tag,
307 0, /* No explicit tags (pointer) */
308 0, /* No explicit tags (count) */
309 0, /* Tags to skip */
310 1, /* Whether CONSTRUCTED */
311 asn1_MBR_Choice_1,
312 4, /* Elements count */
313 &asn1_DEF_Choice_1_specs /* Additional specs */
314};
315