blob: 51d2b0880a665fed813958c36051d6e8e3bbbe37 [file] [log] [blame]
vlm1308d2b2004-09-10 15:49:15 +00001
2/*** <<< INCLUDES [T1] >>> ***/
3
4#include <T2.h>
5
6/*** <<< TYPE-DECLS [T1] >>> ***/
7
8
9typedef T2_t T1_t;
10
11/*** <<< FUNC-DECLS [T1] >>> ***/
12
13extern asn1_TYPE_descriptor_t asn1_DEF_T1;
14asn_constr_check_f T1_constraint;
15ber_type_decoder_f T1_decode_ber;
16der_type_encoder_f T1_encode_der;
17asn_struct_print_f T1_print;
18asn_struct_free_f T1_free;
19
20/*** <<< CODE [T1] >>> ***/
21
22int
23T1_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
24 asn_app_consume_bytes_f *app_errlog, void *app_key) {
25
26 /* Make the underlying type checker permanent */
27 td->check_constraints = asn1_DEF_T2.check_constraints;
28 return td->check_constraints
29 (td, sptr, app_errlog, app_key);
30}
31
32/*
33 * This type is implemented using T2,
34 * so adjust the DEF appropriately.
35 */
36static void
37T1_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
38 td->ber_decoder = asn1_DEF_T2.ber_decoder;
39 td->der_encoder = asn1_DEF_T2.der_encoder;
40 td->free_struct = asn1_DEF_T2.free_struct;
41 td->print_struct = asn1_DEF_T2.print_struct;
42 td->last_tag_form = asn1_DEF_T2.last_tag_form;
43 td->elements = asn1_DEF_T2.elements;
44 td->elements_count = asn1_DEF_T2.elements_count;
45 td->specifics = asn1_DEF_T2.specifics;
46}
47
48ber_dec_rval_t
49T1_decode_ber(asn1_TYPE_descriptor_t *td,
50 void **structure, void *bufptr, size_t size, int tag_mode) {
51 T1_inherit_TYPE_descriptor(td);
52 return td->ber_decoder(td, structure, bufptr, size, tag_mode);
53}
54
55der_enc_rval_t
56T1_encode_der(asn1_TYPE_descriptor_t *td,
57 void *structure, int tag_mode, ber_tlv_tag_t tag,
58 asn_app_consume_bytes_f *cb, void *app_key) {
59 T1_inherit_TYPE_descriptor(td);
60 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
61}
62
63int
64T1_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
65 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
66 T1_inherit_TYPE_descriptor(td);
67 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
68}
69
70void
71T1_free(asn1_TYPE_descriptor_t *td,
72 void *struct_ptr, int contents_only) {
73 T1_inherit_TYPE_descriptor(td);
74 td->free_struct(td, struct_ptr, contents_only);
75}
76
77
78/*** <<< STAT-DEFS [T1] >>> ***/
79
80static ber_tlv_tag_t asn1_DEF_T1_tags[] = {
81 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
82 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
83 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
84 (ASN_TAG_CLASS_CONTEXT | (6 << 2))
85};
vlm72425de2004-09-13 08:31:01 +000086static ber_tlv_tag_t asn1_DEF_T1_all_tags[] = {
87 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
88 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
89 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
90 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
91 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
vlmde592d72004-09-14 12:46:58 +000092 (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
vlm72425de2004-09-13 08:31:01 +000093};
vlm1308d2b2004-09-10 15:49:15 +000094asn1_TYPE_descriptor_t asn1_DEF_T1 = {
95 "T1",
96 T1_constraint,
97 T1_decode_ber,
98 T1_encode_der,
99 T1_print,
100 T1_free,
101 0, /* Use generic outmost tag fetcher */
102 asn1_DEF_T1_tags,
103 sizeof(asn1_DEF_T1_tags)
104 /sizeof(asn1_DEF_T1_tags[0]), /* 4 */
vlm72425de2004-09-13 08:31:01 +0000105 asn1_DEF_T1_all_tags,
106 sizeof(asn1_DEF_T1_all_tags)
107 /sizeof(asn1_DEF_T1_all_tags[0]), /* 6 */
vlm1308d2b2004-09-10 15:49:15 +0000108 -0, /* Unknown yet */
109 0, 0, /* No members */
110 0 /* No specifics */
111};
112
113
114/*** <<< INCLUDES [T2] >>> ***/
115
116#include <T3.h>
117
118/*** <<< TYPE-DECLS [T2] >>> ***/
119
120
121typedef T3_t T2_t;
122
123/*** <<< FUNC-DECLS [T2] >>> ***/
124
125extern asn1_TYPE_descriptor_t asn1_DEF_T2;
126asn_constr_check_f T2_constraint;
127ber_type_decoder_f T2_decode_ber;
128der_type_encoder_f T2_encode_der;
129asn_struct_print_f T2_print;
130asn_struct_free_f T2_free;
131
132/*** <<< CODE [T2] >>> ***/
133
134int
135T2_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
136 asn_app_consume_bytes_f *app_errlog, void *app_key) {
137
138 /* Make the underlying type checker permanent */
139 td->check_constraints = asn1_DEF_T3.check_constraints;
140 return td->check_constraints
141 (td, sptr, app_errlog, app_key);
142}
143
144/*
145 * This type is implemented using T3,
146 * so adjust the DEF appropriately.
147 */
148static void
149T2_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
150 td->ber_decoder = asn1_DEF_T3.ber_decoder;
151 td->der_encoder = asn1_DEF_T3.der_encoder;
152 td->free_struct = asn1_DEF_T3.free_struct;
153 td->print_struct = asn1_DEF_T3.print_struct;
154 td->last_tag_form = asn1_DEF_T3.last_tag_form;
155 td->elements = asn1_DEF_T3.elements;
156 td->elements_count = asn1_DEF_T3.elements_count;
157 td->specifics = asn1_DEF_T3.specifics;
158}
159
160ber_dec_rval_t
161T2_decode_ber(asn1_TYPE_descriptor_t *td,
162 void **structure, void *bufptr, size_t size, int tag_mode) {
163 T2_inherit_TYPE_descriptor(td);
164 return td->ber_decoder(td, structure, bufptr, size, tag_mode);
165}
166
167der_enc_rval_t
168T2_encode_der(asn1_TYPE_descriptor_t *td,
169 void *structure, int tag_mode, ber_tlv_tag_t tag,
170 asn_app_consume_bytes_f *cb, void *app_key) {
171 T2_inherit_TYPE_descriptor(td);
172 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
173}
174
175int
176T2_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
177 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
178 T2_inherit_TYPE_descriptor(td);
179 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
180}
181
182void
183T2_free(asn1_TYPE_descriptor_t *td,
184 void *struct_ptr, int contents_only) {
185 T2_inherit_TYPE_descriptor(td);
186 td->free_struct(td, struct_ptr, contents_only);
187}
188
189
190/*** <<< STAT-DEFS [T2] >>> ***/
191
192static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
193 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
194 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
195 (ASN_TAG_CLASS_CONTEXT | (6 << 2))
196};
vlm72425de2004-09-13 08:31:01 +0000197static ber_tlv_tag_t asn1_DEF_T2_all_tags[] = {
198 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
199 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
200 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
201 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
vlmde592d72004-09-14 12:46:58 +0000202 (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
vlm72425de2004-09-13 08:31:01 +0000203};
vlm1308d2b2004-09-10 15:49:15 +0000204asn1_TYPE_descriptor_t asn1_DEF_T2 = {
205 "T2",
206 T2_constraint,
207 T2_decode_ber,
208 T2_encode_der,
209 T2_print,
210 T2_free,
211 0, /* Use generic outmost tag fetcher */
212 asn1_DEF_T2_tags,
213 sizeof(asn1_DEF_T2_tags)
214 /sizeof(asn1_DEF_T2_tags[0]), /* 3 */
vlm72425de2004-09-13 08:31:01 +0000215 asn1_DEF_T2_all_tags,
216 sizeof(asn1_DEF_T2_all_tags)
217 /sizeof(asn1_DEF_T2_all_tags[0]), /* 5 */
vlm1308d2b2004-09-10 15:49:15 +0000218 -0, /* Unknown yet */
219 0, 0, /* No members */
220 0 /* No specifics */
221};
222
223
224/*** <<< INCLUDES [T3] >>> ***/
225
226#include <T4.h>
227
228/*** <<< TYPE-DECLS [T3] >>> ***/
229
230
231typedef T4_t T3_t;
232
233/*** <<< FUNC-DECLS [T3] >>> ***/
234
235extern asn1_TYPE_descriptor_t asn1_DEF_T3;
236asn_constr_check_f T3_constraint;
237ber_type_decoder_f T3_decode_ber;
238der_type_encoder_f T3_encode_der;
239asn_struct_print_f T3_print;
240asn_struct_free_f T3_free;
241
242/*** <<< CODE [T3] >>> ***/
243
244int
245T3_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
246 asn_app_consume_bytes_f *app_errlog, void *app_key) {
247
248 /* Make the underlying type checker permanent */
249 td->check_constraints = asn1_DEF_T4.check_constraints;
250 return td->check_constraints
251 (td, sptr, app_errlog, app_key);
252}
253
254/*
255 * This type is implemented using T4,
256 * so adjust the DEF appropriately.
257 */
258static void
259T3_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
260 td->ber_decoder = asn1_DEF_T4.ber_decoder;
261 td->der_encoder = asn1_DEF_T4.der_encoder;
262 td->free_struct = asn1_DEF_T4.free_struct;
263 td->print_struct = asn1_DEF_T4.print_struct;
264 td->last_tag_form = asn1_DEF_T4.last_tag_form;
265 td->elements = asn1_DEF_T4.elements;
266 td->elements_count = asn1_DEF_T4.elements_count;
267 td->specifics = asn1_DEF_T4.specifics;
268}
269
270ber_dec_rval_t
271T3_decode_ber(asn1_TYPE_descriptor_t *td,
272 void **structure, void *bufptr, size_t size, int tag_mode) {
273 T3_inherit_TYPE_descriptor(td);
274 return td->ber_decoder(td, structure, bufptr, size, tag_mode);
275}
276
277der_enc_rval_t
278T3_encode_der(asn1_TYPE_descriptor_t *td,
279 void *structure, int tag_mode, ber_tlv_tag_t tag,
280 asn_app_consume_bytes_f *cb, void *app_key) {
281 T3_inherit_TYPE_descriptor(td);
282 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
283}
284
285int
286T3_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
287 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
288 T3_inherit_TYPE_descriptor(td);
289 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
290}
291
292void
293T3_free(asn1_TYPE_descriptor_t *td,
294 void *struct_ptr, int contents_only) {
295 T3_inherit_TYPE_descriptor(td);
296 td->free_struct(td, struct_ptr, contents_only);
297}
298
299
300/*** <<< STAT-DEFS [T3] >>> ***/
301
302static ber_tlv_tag_t asn1_DEF_T3_tags[] = {
303 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
304 (ASN_TAG_CLASS_CONTEXT | (6 << 2))
305};
vlm72425de2004-09-13 08:31:01 +0000306static ber_tlv_tag_t asn1_DEF_T3_all_tags[] = {
307 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
308 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
309 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
vlmde592d72004-09-14 12:46:58 +0000310 (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
vlm72425de2004-09-13 08:31:01 +0000311};
vlm1308d2b2004-09-10 15:49:15 +0000312asn1_TYPE_descriptor_t asn1_DEF_T3 = {
313 "T3",
314 T3_constraint,
315 T3_decode_ber,
316 T3_encode_der,
317 T3_print,
318 T3_free,
319 0, /* Use generic outmost tag fetcher */
320 asn1_DEF_T3_tags,
321 sizeof(asn1_DEF_T3_tags)
322 /sizeof(asn1_DEF_T3_tags[0]), /* 2 */
vlm72425de2004-09-13 08:31:01 +0000323 asn1_DEF_T3_all_tags,
324 sizeof(asn1_DEF_T3_all_tags)
325 /sizeof(asn1_DEF_T3_all_tags[0]), /* 4 */
vlm1308d2b2004-09-10 15:49:15 +0000326 -0, /* Unknown yet */
327 0, 0, /* No members */
328 0 /* No specifics */
329};
330
331
332/*** <<< INCLUDES [T4] >>> ***/
333
334#include <T5.h>
335
336/*** <<< TYPE-DECLS [T4] >>> ***/
337
338
339typedef T5_t T4_t;
340
341/*** <<< FUNC-DECLS [T4] >>> ***/
342
343extern asn1_TYPE_descriptor_t asn1_DEF_T4;
344asn_constr_check_f T4_constraint;
345ber_type_decoder_f T4_decode_ber;
346der_type_encoder_f T4_encode_der;
347asn_struct_print_f T4_print;
348asn_struct_free_f T4_free;
349
350/*** <<< CODE [T4] >>> ***/
351
352int
353T4_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
354 asn_app_consume_bytes_f *app_errlog, void *app_key) {
355
356 /* Make the underlying type checker permanent */
357 td->check_constraints = asn1_DEF_T5.check_constraints;
358 return td->check_constraints
359 (td, sptr, app_errlog, app_key);
360}
361
362/*
363 * This type is implemented using T5,
364 * so adjust the DEF appropriately.
365 */
366static void
367T4_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
368 td->ber_decoder = asn1_DEF_T5.ber_decoder;
369 td->der_encoder = asn1_DEF_T5.der_encoder;
370 td->free_struct = asn1_DEF_T5.free_struct;
371 td->print_struct = asn1_DEF_T5.print_struct;
372 td->last_tag_form = asn1_DEF_T5.last_tag_form;
373 td->elements = asn1_DEF_T5.elements;
374 td->elements_count = asn1_DEF_T5.elements_count;
375 td->specifics = asn1_DEF_T5.specifics;
376}
377
378ber_dec_rval_t
379T4_decode_ber(asn1_TYPE_descriptor_t *td,
380 void **structure, void *bufptr, size_t size, int tag_mode) {
381 T4_inherit_TYPE_descriptor(td);
382 return td->ber_decoder(td, structure, bufptr, size, tag_mode);
383}
384
385der_enc_rval_t
386T4_encode_der(asn1_TYPE_descriptor_t *td,
387 void *structure, int tag_mode, ber_tlv_tag_t tag,
388 asn_app_consume_bytes_f *cb, void *app_key) {
389 T4_inherit_TYPE_descriptor(td);
390 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
391}
392
393int
394T4_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
395 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
396 T4_inherit_TYPE_descriptor(td);
397 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
398}
399
400void
401T4_free(asn1_TYPE_descriptor_t *td,
402 void *struct_ptr, int contents_only) {
403 T4_inherit_TYPE_descriptor(td);
404 td->free_struct(td, struct_ptr, contents_only);
405}
406
407
408/*** <<< STAT-DEFS [T4] >>> ***/
409
410static ber_tlv_tag_t asn1_DEF_T4_tags[] = {
411 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
vlm72425de2004-09-13 08:31:01 +0000412 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
vlmde592d72004-09-14 12:46:58 +0000413 (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
vlm1308d2b2004-09-10 15:49:15 +0000414};
415asn1_TYPE_descriptor_t asn1_DEF_T4 = {
416 "T4",
417 T4_constraint,
418 T4_decode_ber,
419 T4_encode_der,
420 T4_print,
421 T4_free,
422 0, /* Use generic outmost tag fetcher */
423 asn1_DEF_T4_tags,
424 sizeof(asn1_DEF_T4_tags)
vlm72425de2004-09-13 08:31:01 +0000425 /sizeof(asn1_DEF_T4_tags[0]) - 1, /* 2 */
426 asn1_DEF_T4_tags, /* Same as above */
427 sizeof(asn1_DEF_T4_tags)
428 /sizeof(asn1_DEF_T4_tags[0]), /* 3 */
vlm1308d2b2004-09-10 15:49:15 +0000429 -0, /* Unknown yet */
430 0, 0, /* No members */
431 0 /* No specifics */
432};
433
434
435/*** <<< INCLUDES [T5] >>> ***/
436
437#include <T6.h>
438
439/*** <<< TYPE-DECLS [T5] >>> ***/
440
441
442typedef T6_t T5_t;
443
444/*** <<< FUNC-DECLS [T5] >>> ***/
445
446extern asn1_TYPE_descriptor_t asn1_DEF_T5;
447asn_constr_check_f T5_constraint;
448ber_type_decoder_f T5_decode_ber;
449der_type_encoder_f T5_encode_der;
450asn_struct_print_f T5_print;
451asn_struct_free_f T5_free;
452
453/*** <<< CODE [T5] >>> ***/
454
455int
456T5_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
457 asn_app_consume_bytes_f *app_errlog, void *app_key) {
458
459 /* Make the underlying type checker permanent */
460 td->check_constraints = asn1_DEF_T6.check_constraints;
461 return td->check_constraints
462 (td, sptr, app_errlog, app_key);
463}
464
465/*
466 * This type is implemented using T6,
467 * so adjust the DEF appropriately.
468 */
469static void
470T5_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
471 td->ber_decoder = asn1_DEF_T6.ber_decoder;
472 td->der_encoder = asn1_DEF_T6.der_encoder;
473 td->free_struct = asn1_DEF_T6.free_struct;
474 td->print_struct = asn1_DEF_T6.print_struct;
475 td->last_tag_form = asn1_DEF_T6.last_tag_form;
476 td->elements = asn1_DEF_T6.elements;
477 td->elements_count = asn1_DEF_T6.elements_count;
478 td->specifics = asn1_DEF_T6.specifics;
479}
480
481ber_dec_rval_t
482T5_decode_ber(asn1_TYPE_descriptor_t *td,
483 void **structure, void *bufptr, size_t size, int tag_mode) {
484 T5_inherit_TYPE_descriptor(td);
485 return td->ber_decoder(td, structure, bufptr, size, tag_mode);
486}
487
488der_enc_rval_t
489T5_encode_der(asn1_TYPE_descriptor_t *td,
490 void *structure, int tag_mode, ber_tlv_tag_t tag,
491 asn_app_consume_bytes_f *cb, void *app_key) {
492 T5_inherit_TYPE_descriptor(td);
493 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
494}
495
496int
497T5_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
498 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
499 T5_inherit_TYPE_descriptor(td);
500 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
501}
502
503void
504T5_free(asn1_TYPE_descriptor_t *td,
505 void *struct_ptr, int contents_only) {
506 T5_inherit_TYPE_descriptor(td);
507 td->free_struct(td, struct_ptr, contents_only);
508}
509
510
511/*** <<< STAT-DEFS [T5] >>> ***/
512
513static ber_tlv_tag_t asn1_DEF_T5_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000514 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
vlmde592d72004-09-14 12:46:58 +0000515 (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
vlm1308d2b2004-09-10 15:49:15 +0000516};
517asn1_TYPE_descriptor_t asn1_DEF_T5 = {
518 "T5",
519 T5_constraint,
520 T5_decode_ber,
521 T5_encode_der,
522 T5_print,
523 T5_free,
524 0, /* Use generic outmost tag fetcher */
525 asn1_DEF_T5_tags,
526 sizeof(asn1_DEF_T5_tags)
vlm72425de2004-09-13 08:31:01 +0000527 /sizeof(asn1_DEF_T5_tags[0]) - 1, /* 1 */
528 asn1_DEF_T5_tags, /* Same as above */
529 sizeof(asn1_DEF_T5_tags)
530 /sizeof(asn1_DEF_T5_tags[0]), /* 2 */
vlm1308d2b2004-09-10 15:49:15 +0000531 -0, /* Unknown yet */
532 0, 0, /* No members */
533 0 /* No specifics */
534};
535
536
537/*** <<< INCLUDES [T6] >>> ***/
538
vlmde592d72004-09-14 12:46:58 +0000539#include <REAL.h>
vlm1308d2b2004-09-10 15:49:15 +0000540
541/*** <<< TYPE-DECLS [T6] >>> ***/
542
543
vlmde592d72004-09-14 12:46:58 +0000544typedef REAL_t T6_t;
vlm1308d2b2004-09-10 15:49:15 +0000545
546/*** <<< FUNC-DECLS [T6] >>> ***/
547
548extern asn1_TYPE_descriptor_t asn1_DEF_T6;
549asn_constr_check_f T6_constraint;
550ber_type_decoder_f T6_decode_ber;
551der_type_encoder_f T6_encode_der;
552asn_struct_print_f T6_print;
553asn_struct_free_f T6_free;
554
555/*** <<< CODE [T6] >>> ***/
556
557int
558T6_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
559 asn_app_consume_bytes_f *app_errlog, void *app_key) {
560
561 /* Make the underlying type checker permanent */
vlmde592d72004-09-14 12:46:58 +0000562 td->check_constraints = asn1_DEF_REAL.check_constraints;
vlm1308d2b2004-09-10 15:49:15 +0000563 return td->check_constraints
564 (td, sptr, app_errlog, app_key);
565}
566
567/*
vlmde592d72004-09-14 12:46:58 +0000568 * This type is implemented using REAL,
vlm1308d2b2004-09-10 15:49:15 +0000569 * so adjust the DEF appropriately.
570 */
571static void
572T6_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
vlmde592d72004-09-14 12:46:58 +0000573 td->ber_decoder = asn1_DEF_REAL.ber_decoder;
574 td->der_encoder = asn1_DEF_REAL.der_encoder;
575 td->free_struct = asn1_DEF_REAL.free_struct;
576 td->print_struct = asn1_DEF_REAL.print_struct;
577 td->last_tag_form = asn1_DEF_REAL.last_tag_form;
578 td->elements = asn1_DEF_REAL.elements;
579 td->elements_count = asn1_DEF_REAL.elements_count;
580 td->specifics = asn1_DEF_REAL.specifics;
vlm1308d2b2004-09-10 15:49:15 +0000581}
582
583ber_dec_rval_t
584T6_decode_ber(asn1_TYPE_descriptor_t *td,
585 void **structure, void *bufptr, size_t size, int tag_mode) {
586 T6_inherit_TYPE_descriptor(td);
587 return td->ber_decoder(td, structure, bufptr, size, tag_mode);
588}
589
590der_enc_rval_t
591T6_encode_der(asn1_TYPE_descriptor_t *td,
592 void *structure, int tag_mode, ber_tlv_tag_t tag,
593 asn_app_consume_bytes_f *cb, void *app_key) {
594 T6_inherit_TYPE_descriptor(td);
595 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
596}
597
598int
599T6_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
600 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
601 T6_inherit_TYPE_descriptor(td);
602 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
603}
604
605void
606T6_free(asn1_TYPE_descriptor_t *td,
607 void *struct_ptr, int contents_only) {
608 T6_inherit_TYPE_descriptor(td);
609 td->free_struct(td, struct_ptr, contents_only);
610}
611
612
613/*** <<< STAT-DEFS [T6] >>> ***/
614
615static ber_tlv_tag_t asn1_DEF_T6_tags[] = {
vlmde592d72004-09-14 12:46:58 +0000616 (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
vlm1308d2b2004-09-10 15:49:15 +0000617};
618asn1_TYPE_descriptor_t asn1_DEF_T6 = {
619 "T6",
620 T6_constraint,
621 T6_decode_ber,
622 T6_encode_der,
623 T6_print,
624 T6_free,
625 0, /* Use generic outmost tag fetcher */
626 asn1_DEF_T6_tags,
627 sizeof(asn1_DEF_T6_tags)
628 /sizeof(asn1_DEF_T6_tags[0]), /* 1 */
vlm72425de2004-09-13 08:31:01 +0000629 asn1_DEF_T6_tags, /* Same as above */
630 sizeof(asn1_DEF_T6_tags)
631 /sizeof(asn1_DEF_T6_tags[0]), /* 1 */
vlm1308d2b2004-09-10 15:49:15 +0000632 -0, /* Unknown yet */
633 0, 0, /* No members */
634 0 /* No specifics */
635};
636
637
638/*** <<< INCLUDES [T] >>> ***/
639
640#include <Ts.h>
641
642/*** <<< TYPE-DECLS [T] >>> ***/
643
644
645typedef Ts_t T_t;
646
647/*** <<< FUNC-DECLS [T] >>> ***/
648
649extern asn1_TYPE_descriptor_t asn1_DEF_T;
650asn_constr_check_f T_constraint;
651ber_type_decoder_f T_decode_ber;
652der_type_encoder_f T_encode_der;
653asn_struct_print_f T_print;
654asn_struct_free_f T_free;
655
656/*** <<< CODE [T] >>> ***/
657
658int
659T_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
660 asn_app_consume_bytes_f *app_errlog, void *app_key) {
661
662 /* Make the underlying type checker permanent */
663 td->check_constraints = asn1_DEF_Ts.check_constraints;
664 return td->check_constraints
665 (td, sptr, app_errlog, app_key);
666}
667
668/*
669 * This type is implemented using Ts,
670 * so adjust the DEF appropriately.
671 */
672static void
673T_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
674 td->ber_decoder = asn1_DEF_Ts.ber_decoder;
675 td->der_encoder = asn1_DEF_Ts.der_encoder;
676 td->free_struct = asn1_DEF_Ts.free_struct;
677 td->print_struct = asn1_DEF_Ts.print_struct;
678 td->last_tag_form = asn1_DEF_Ts.last_tag_form;
679 td->elements = asn1_DEF_Ts.elements;
680 td->elements_count = asn1_DEF_Ts.elements_count;
681 td->specifics = asn1_DEF_Ts.specifics;
682}
683
684ber_dec_rval_t
685T_decode_ber(asn1_TYPE_descriptor_t *td,
686 void **structure, void *bufptr, size_t size, int tag_mode) {
687 T_inherit_TYPE_descriptor(td);
688 return td->ber_decoder(td, structure, bufptr, size, tag_mode);
689}
690
691der_enc_rval_t
692T_encode_der(asn1_TYPE_descriptor_t *td,
693 void *structure, int tag_mode, ber_tlv_tag_t tag,
694 asn_app_consume_bytes_f *cb, void *app_key) {
695 T_inherit_TYPE_descriptor(td);
696 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
697}
698
699int
700T_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
701 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
702 T_inherit_TYPE_descriptor(td);
703 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
704}
705
706void
707T_free(asn1_TYPE_descriptor_t *td,
708 void *struct_ptr, int contents_only) {
709 T_inherit_TYPE_descriptor(td);
710 td->free_struct(td, struct_ptr, contents_only);
711}
712
713
714/*** <<< STAT-DEFS [T] >>> ***/
715
716static ber_tlv_tag_t asn1_DEF_T_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000717 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
718 (ASN_TAG_CLASS_CONTEXT | (123 << 2)),
719 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
vlm1308d2b2004-09-10 15:49:15 +0000720};
721asn1_TYPE_descriptor_t asn1_DEF_T = {
722 "T",
723 T_constraint,
724 T_decode_ber,
725 T_encode_der,
726 T_print,
727 T_free,
728 0, /* Use generic outmost tag fetcher */
729 asn1_DEF_T_tags,
730 sizeof(asn1_DEF_T_tags)
vlm72425de2004-09-13 08:31:01 +0000731 /sizeof(asn1_DEF_T_tags[0]) - 2, /* 1 */
732 asn1_DEF_T_tags, /* Same as above */
733 sizeof(asn1_DEF_T_tags)
734 /sizeof(asn1_DEF_T_tags[0]), /* 3 */
vlm1308d2b2004-09-10 15:49:15 +0000735 -0, /* Unknown yet */
736 0, 0, /* Defined elsewhere */
737 0 /* No specifics */
738};
739
740
741/*** <<< INCLUDES [Ts] >>> ***/
742
743#include <T2.h>
744#include <T3.h>
745#include <constr_SEQUENCE.h>
746
747/*** <<< DEPS [Ts] >>> ***/
748
749extern asn1_TYPE_descriptor_t asn1_DEF_Ts;
750
751/*** <<< TYPE-DECLS [Ts] >>> ***/
752
753
754typedef struct Ts {
755 T2_t m1;
756 T3_t *m2 /* OPTIONAL */;
757 T3_t m3;
758
759 /* Context for parsing across buffer boundaries */
760 ber_dec_ctx_t _ber_dec_ctx;
761} Ts_t;
762
763/*** <<< STAT-DEFS [Ts] >>> ***/
764
765static asn1_TYPE_member_t asn1_MBR_Ts[] = {
766 { ATF_NOFLAGS, 0, offsetof(struct Ts, m1),
767 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
768 .tag_mode = -1, /* IMPLICIT tag at current level */
769 .type = (void *)&asn1_DEF_T2,
770 .memb_constraints = 0, /* Defer to actual type */
771 .name = "m1"
772 },
773 { ATF_POINTER, 1, offsetof(struct Ts, m2),
774 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
775 .tag_mode = +1, /* EXPLICIT tag at current level */
776 .type = (void *)&asn1_DEF_T3,
777 .memb_constraints = 0, /* Defer to actual type */
778 .name = "m2"
779 },
780 { ATF_NOFLAGS, 0, offsetof(struct Ts, m3),
781 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
782 .tag_mode = -1, /* IMPLICIT tag at current level */
783 .type = (void *)&asn1_DEF_T3,
784 .memb_constraints = 0, /* Defer to actual type */
785 .name = "m3"
786 },
787};
788static ber_tlv_tag_t asn1_DEF_Ts_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000789 (ASN_TAG_CLASS_CONTEXT | (123 << 2)),
790 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
vlm1308d2b2004-09-10 15:49:15 +0000791};
792static asn1_TYPE_tag2member_t asn1_DEF_Ts_tag2el[] = {
793 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* m1 at 24 */
794 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* m2 at 25 */
795 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* m3 at 27 */
796};
797static asn1_SEQUENCE_specifics_t asn1_DEF_Ts_specs = {
798 sizeof(struct Ts),
799 offsetof(struct Ts, _ber_dec_ctx),
800 asn1_DEF_Ts_tag2el,
801 3, /* Count of tags in the map */
802 -1, /* Start extensions */
803 -1 /* Stop extensions */
804};
805asn1_TYPE_descriptor_t asn1_DEF_Ts = {
806 "Ts",
807 SEQUENCE_constraint,
808 SEQUENCE_decode_ber,
809 SEQUENCE_encode_der,
810 SEQUENCE_print,
811 SEQUENCE_free,
812 0, /* Use generic outmost tag fetcher */
813 asn1_DEF_Ts_tags,
814 sizeof(asn1_DEF_Ts_tags)
vlm72425de2004-09-13 08:31:01 +0000815 /sizeof(asn1_DEF_Ts_tags[0]) - 1, /* 1 */
816 asn1_DEF_Ts_tags, /* Same as above */
817 sizeof(asn1_DEF_Ts_tags)
818 /sizeof(asn1_DEF_Ts_tags[0]), /* 2 */
vlm1308d2b2004-09-10 15:49:15 +0000819 1, /* Whether CONSTRUCTED */
820 asn1_MBR_Ts,
821 3, /* Elements count */
822 &asn1_DEF_Ts_specs /* Additional specs */
823};
824