blob: 18c02d7cac5f6fff510657b504adee0b09cac15d [file] [log] [blame]
Lev Walkin67ec2092004-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[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000042 { ATF_NOFLAGS, 0, 0,
Lev Walkin67ec2092004-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 */
Lev Walkin67ec2092004-09-08 00:26:56 +000069 1, /* Whether CONSTRUCTED */
70 asn1_MBR_t_member1,
71 1, /* Single element */
72 &asn1_DEF_t_member1_specs /* Additional specs */
73};
74
75static asn1_TYPE_member_t asn1_MBR_t_member2[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000076 { ATF_NOFLAGS, 0, 0,
Lev Walkin67ec2092004-09-08 00:26:56 +000077 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
78 .tag_mode = 0,
79 .type = (void *)&asn1_DEF_Test_structure_1,
80 .memb_constraints = 0, /* Defer to actual type */
81 .name = ""
82 },
83};
84static ber_tlv_tag_t asn1_DEF_t_member2_tags[] = {
85 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
86};
87static asn1_SET_OF_specifics_t asn1_DEF_t_member2_specs = {
88 sizeof(struct t_member2),
89 offsetof(struct t_member2, _ber_dec_ctx),
90};
91static /* Use -fall-defs-global to expose */
92asn1_TYPE_descriptor_t asn1_DEF_t_member2 = {
93 "t-member2",
94 SEQUENCE_OF_constraint,
95 SEQUENCE_OF_decode_ber,
96 SEQUENCE_OF_encode_der,
97 SEQUENCE_OF_print,
98 SEQUENCE_OF_free,
99 0, /* Use generic outmost tag fetcher */
100 asn1_DEF_t_member2_tags,
101 sizeof(asn1_DEF_t_member2_tags)
102 /sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
Lev Walkin67ec2092004-09-08 00:26:56 +0000103 1, /* Whether CONSTRUCTED */
104 asn1_MBR_t_member2,
105 1, /* Single element */
106 &asn1_DEF_t_member2_specs /* Additional specs */
107};
108
109static asn1_TYPE_member_t asn1_MBR_Test_structure_1[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000110 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member1),
Lev Walkin67ec2092004-09-08 00:26:56 +0000111 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
112 .tag_mode = 0,
113 .type = (void *)&asn1_DEF_t_member1,
114 .memb_constraints = 0, /* Defer to actual type */
115 .name = "t-member1"
116 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000117 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member2),
Lev Walkin67ec2092004-09-08 00:26:56 +0000118 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
119 .tag_mode = 0,
120 .type = (void *)&asn1_DEF_t_member2,
121 .memb_constraints = 0, /* Defer to actual type */
122 .name = "t-member2"
123 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000124 { ATF_POINTER, 1, offsetof(struct Test_structure_1, t_member3),
Lev Walkin67ec2092004-09-08 00:26:56 +0000125 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
126 .tag_mode = 0,
127 .type = (void *)&asn1_DEF_Test_structure_1,
128 .memb_constraints = 0, /* Defer to actual type */
129 .name = "t-member3"
130 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000131 { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member4),
Lev Walkin67ec2092004-09-08 00:26:56 +0000132 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
133 .tag_mode = 0,
134 .type = (void *)&asn1_DEF_INTEGER,
135 .memb_constraints = 0, /* Defer to actual type */
136 .name = "t-member4"
137 },
138};
139static ber_tlv_tag_t asn1_DEF_Test_structure_1_tags[] = {
140 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
141};
142static asn1_TYPE_tag2member_t asn1_DEF_Test_structure_1_tag2el[] = {
143 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* t-member4 at 19 */
144 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 1 }, /* t-member2 at 16 */
145 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 }, /* t-member3 at 17 */
146 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 }, /* t-member1 at 15 */
147};
148static asn1_SEQUENCE_specifics_t asn1_DEF_Test_structure_1_specs = {
149 sizeof(struct Test_structure_1),
150 offsetof(struct Test_structure_1, _ber_dec_ctx),
151 asn1_DEF_Test_structure_1_tag2el,
152 4, /* Count of tags in the map */
153 -1, /* Start extensions */
154 -1 /* Stop extensions */
155};
156asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1 = {
157 "Test-structure-1",
158 SEQUENCE_constraint,
159 SEQUENCE_decode_ber,
160 SEQUENCE_encode_der,
161 SEQUENCE_print,
162 SEQUENCE_free,
163 0, /* Use generic outmost tag fetcher */
164 asn1_DEF_Test_structure_1_tags,
165 sizeof(asn1_DEF_Test_structure_1_tags)
166 /sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
Lev Walkin67ec2092004-09-08 00:26:56 +0000167 1, /* Whether CONSTRUCTED */
168 asn1_MBR_Test_structure_1,
169 4, /* Elements count */
170 &asn1_DEF_Test_structure_1_specs /* Additional specs */
171};
172
173
174/*** <<< INCLUDES [Choice-1] >>> ***/
175
176#include <Choice-1.h>
177#include <INTEGER.h>
178#include <asn_SET_OF.h>
179#include <constr_SET_OF.h>
180#include <constr_CHOICE.h>
181
182/*** <<< DEPS [Choice-1] >>> ***/
183
184typedef enum Choice_1_PR {
185 Choice_1_PR_NOTHING, /* No components present */
186 Choice_1_PR_and,
187 Choice_1_PR_or,
188 Choice_1_PR_not,
189 Choice_1_PR_other,
190} Choice_1_PR;
191extern asn1_TYPE_descriptor_t asn1_DEF_Choice_1;
192
193/*** <<< TYPE-DECLS [Choice-1] >>> ***/
194
195
196typedef struct Choice_1 {
197 Choice_1_PR present;
198 union {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000199 struct Choice_1 *and;
Lev Walkin67ec2092004-09-08 00:26:56 +0000200 struct or {
201 A_SET_OF(struct Choice_1) list;
202
203 /* Context for parsing across buffer boundaries */
204 ber_dec_ctx_t _ber_dec_ctx;
205 } or;
Lev Walkincc93b0f2004-09-10 09:18:20 +0000206 struct Choice_1 *not;
Lev Walkin67ec2092004-09-08 00:26:56 +0000207 INTEGER_t other;
208 } choice;
209
210 /* Context for parsing across buffer boundaries */
211 ber_dec_ctx_t _ber_dec_ctx;
212} Choice_1_t;
213
214/*** <<< STAT-DEFS [Choice-1] >>> ***/
215
216static asn1_TYPE_member_t asn1_MBR_or[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000217 { ATF_NOFLAGS, 0, 0,
Lev Walkinb9189732004-09-10 09:37:12 +0000218 .tag = -1 /* Ambiguous tag (CHOICE?) */,
Lev Walkin67ec2092004-09-08 00:26:56 +0000219 .tag_mode = 0,
220 .type = (void *)&asn1_DEF_Choice_1,
221 .memb_constraints = 0, /* Defer to actual type */
222 .name = ""
223 },
224};
225static ber_tlv_tag_t asn1_DEF_or_tags[] = {
226 (ASN_TAG_CLASS_CONTEXT | (2 << 2))
227};
228static asn1_SET_OF_specifics_t asn1_DEF_or_specs = {
229 sizeof(struct or),
230 offsetof(struct or, _ber_dec_ctx),
231};
232static /* Use -fall-defs-global to expose */
233asn1_TYPE_descriptor_t asn1_DEF_or = {
234 "or",
235 SET_OF_constraint,
236 SET_OF_decode_ber,
237 SET_OF_encode_der,
238 SET_OF_print,
239 SET_OF_free,
240 0, /* Use generic outmost tag fetcher */
241 asn1_DEF_or_tags,
242 sizeof(asn1_DEF_or_tags)
243 /sizeof(asn1_DEF_or_tags[0]), /* 1 */
Lev Walkin67ec2092004-09-08 00:26:56 +0000244 1, /* Whether CONSTRUCTED */
245 asn1_MBR_or,
246 1, /* Single element */
247 &asn1_DEF_or_specs /* Additional specs */
248};
249
250static asn1_TYPE_member_t asn1_MBR_Choice_1[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000251 { ATF_POINTER, 0, offsetof(struct Choice_1, choice.and),
Lev Walkin67ec2092004-09-08 00:26:56 +0000252 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
253 .tag_mode = +1, /* EXPLICIT tag at current level */
254 .type = (void *)&asn1_DEF_Choice_1,
255 .memb_constraints = 0, /* Defer to actual type */
256 .name = "and"
257 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000258 { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.or),
Lev Walkin67ec2092004-09-08 00:26:56 +0000259 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
260 .tag_mode = -1, /* IMPLICIT tag at current level */
261 .type = (void *)&asn1_DEF_or,
262 .memb_constraints = 0, /* Defer to actual type */
263 .name = "or"
264 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000265 { ATF_POINTER, 0, offsetof(struct Choice_1, choice.not),
Lev Walkin67ec2092004-09-08 00:26:56 +0000266 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
267 .tag_mode = +1, /* EXPLICIT tag at current level */
268 .type = (void *)&asn1_DEF_Choice_1,
269 .memb_constraints = 0, /* Defer to actual type */
270 .name = "not"
271 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000272 { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.other),
Lev Walkin67ec2092004-09-08 00:26:56 +0000273 .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
274 .tag_mode = +1, /* EXPLICIT tag at current level */
275 .type = (void *)&asn1_DEF_INTEGER,
276 .memb_constraints = 0, /* Defer to actual type */
277 .name = "other"
278 },
279};
280static asn1_TYPE_tag2member_t asn1_DEF_Choice_1_tag2el[] = {
281 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* and at 22 */
282 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* or at 23 */
283 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* not at 24 */
284 { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 }, /* other at 26 */
285};
286static asn1_CHOICE_specifics_t asn1_DEF_Choice_1_specs = {
287 sizeof(struct Choice_1),
288 offsetof(struct Choice_1, _ber_dec_ctx),
289 offsetof(struct Choice_1, present),
290 sizeof(((struct Choice_1 *)0)->present),
291 asn1_DEF_Choice_1_tag2el,
292 4, /* Count of tags in the map */
293 0 /* Whether extensible */
294};
295asn1_TYPE_descriptor_t asn1_DEF_Choice_1 = {
296 "Choice-1",
297 CHOICE_constraint,
298 CHOICE_decode_ber,
299 CHOICE_encode_der,
300 CHOICE_print,
301 CHOICE_free,
302 CHOICE_outmost_tag,
303 0, /* No explicit tags (pointer) */
304 0, /* No explicit tags (count) */
Lev Walkin67ec2092004-09-08 00:26:56 +0000305 1, /* Whether CONSTRUCTED */
306 asn1_MBR_Choice_1,
307 4, /* Elements count */
308 &asn1_DEF_Choice_1_specs /* Additional specs */
309};
310