aboutsummaryrefslogtreecommitdiffstats
path: root/tests/65-multi-tag-OK.asn1.-P
blob: 01681c2a427808af43981430ef8c2c7de8ac59f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
/*** <<< INCLUDES [T1] >>> ***/

#include <T2.h>

/*** <<< TYPE-DECLS [T1] >>> ***/


typedef T2_t	 T1_t;

/*** <<< FUNC-DECLS [T1] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_T1;
asn_constr_check_f T1_constraint;
ber_type_decoder_f T1_decode_ber;
der_type_encoder_f T1_encode_der;
asn_struct_print_f T1_print;
asn_struct_free_f T1_free;

/*** <<< CODE [T1] >>> ***/

int
T1_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
			asn_app_consume_bytes_f *app_errlog, void *app_key) {
	
	/* Make the underlying type checker permanent */
	td->check_constraints = asn1_DEF_T2.check_constraints;
	return td->check_constraints
		(td, sptr, app_errlog, app_key);
}

/*
 * This type is implemented using T2,
 * so adjust the DEF appropriately.
 */
static void
T1_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
	td->ber_decoder    = asn1_DEF_T2.ber_decoder;
	td->der_encoder    = asn1_DEF_T2.der_encoder;
	td->free_struct    = asn1_DEF_T2.free_struct;
	td->print_struct   = asn1_DEF_T2.print_struct;
	td->last_tag_form  = asn1_DEF_T2.last_tag_form;
	td->elements       = asn1_DEF_T2.elements;
	td->elements_count = asn1_DEF_T2.elements_count;
	td->specifics      = asn1_DEF_T2.specifics;
}

ber_dec_rval_t
T1_decode_ber(asn1_TYPE_descriptor_t *td,
		void **structure, void *bufptr, size_t size, int tag_mode) {
	T1_inherit_TYPE_descriptor(td);
	return td->ber_decoder(td, structure, bufptr, size, tag_mode);
}

der_enc_rval_t
T1_encode_der(asn1_TYPE_descriptor_t *td,
		void *structure, int tag_mode, ber_tlv_tag_t tag,
		asn_app_consume_bytes_f *cb, void *app_key) {
	T1_inherit_TYPE_descriptor(td);
	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}

int
T1_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
	T1_inherit_TYPE_descriptor(td);
	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}

void
T1_free(asn1_TYPE_descriptor_t *td,
		void *struct_ptr, int contents_only) {
	T1_inherit_TYPE_descriptor(td);
	td->free_struct(td, struct_ptr, contents_only);
}


/*** <<< STAT-DEFS [T1] >>> ***/

static ber_tlv_tag_t asn1_DEF_T1_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (6 << 2))
};
static ber_tlv_tag_t asn1_DEF_T1_all_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T1 = {
	"T1",
	T1_constraint,
	T1_decode_ber,
	T1_encode_der,
	T1_print,
	T1_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_T1_tags,
	sizeof(asn1_DEF_T1_tags)
		/sizeof(asn1_DEF_T1_tags[0]), /* 4 */
	asn1_DEF_T1_all_tags,
	sizeof(asn1_DEF_T1_all_tags)
		/sizeof(asn1_DEF_T1_all_tags[0]), /* 6 */
	-0,	/* Unknown yet */
	0, 0,	/* No members */
	0	/* No specifics */
};


/*** <<< INCLUDES [T2] >>> ***/

#include <T3.h>

/*** <<< TYPE-DECLS [T2] >>> ***/


typedef T3_t	 T2_t;

/*** <<< FUNC-DECLS [T2] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_T2;
asn_constr_check_f T2_constraint;
ber_type_decoder_f T2_decode_ber;
der_type_encoder_f T2_encode_der;
asn_struct_print_f T2_print;
asn_struct_free_f T2_free;

/*** <<< CODE [T2] >>> ***/

int
T2_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
			asn_app_consume_bytes_f *app_errlog, void *app_key) {
	
	/* Make the underlying type checker permanent */
	td->check_constraints = asn1_DEF_T3.check_constraints;
	return td->check_constraints
		(td, sptr, app_errlog, app_key);
}

/*
 * This type is implemented using T3,
 * so adjust the DEF appropriately.
 */
static void
T2_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
	td->ber_decoder    = asn1_DEF_T3.ber_decoder;
	td->der_encoder    = asn1_DEF_T3.der_encoder;
	td->free_struct    = asn1_DEF_T3.free_struct;
	td->print_struct   = asn1_DEF_T3.print_struct;
	td->last_tag_form  = asn1_DEF_T3.last_tag_form;
	td->elements       = asn1_DEF_T3.elements;
	td->elements_count = asn1_DEF_T3.elements_count;
	td->specifics      = asn1_DEF_T3.specifics;
}

ber_dec_rval_t
T2_decode_ber(asn1_TYPE_descriptor_t *td,
		void **structure, void *bufptr, size_t size, int tag_mode) {
	T2_inherit_TYPE_descriptor(td);
	return td->ber_decoder(td, structure, bufptr, size, tag_mode);
}

der_enc_rval_t
T2_encode_der(asn1_TYPE_descriptor_t *td,
		void *structure, int tag_mode, ber_tlv_tag_t tag,
		asn_app_consume_bytes_f *cb, void *app_key) {
	T2_inherit_TYPE_descriptor(td);
	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}

int
T2_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
	T2_inherit_TYPE_descriptor(td);
	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}

void
T2_free(asn1_TYPE_descriptor_t *td,
		void *struct_ptr, int contents_only) {
	T2_inherit_TYPE_descriptor(td);
	td->free_struct(td, struct_ptr, contents_only);
}


/*** <<< STAT-DEFS [T2] >>> ***/

static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (6 << 2))
};
static ber_tlv_tag_t asn1_DEF_T2_all_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T2 = {
	"T2",
	T2_constraint,
	T2_decode_ber,
	T2_encode_der,
	T2_print,
	T2_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_T2_tags,
	sizeof(asn1_DEF_T2_tags)
		/sizeof(asn1_DEF_T2_tags[0]), /* 3 */
	asn1_DEF_T2_all_tags,
	sizeof(asn1_DEF_T2_all_tags)
		/sizeof(asn1_DEF_T2_all_tags[0]), /* 5 */
	-0,	/* Unknown yet */
	0, 0,	/* No members */
	0	/* No specifics */
};


/*** <<< INCLUDES [T3] >>> ***/

#include <T4.h>

/*** <<< TYPE-DECLS [T3] >>> ***/


typedef T4_t	 T3_t;

/*** <<< FUNC-DECLS [T3] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_T3;
asn_constr_check_f T3_constraint;
ber_type_decoder_f T3_decode_ber;
der_type_encoder_f T3_encode_der;
asn_struct_print_f T3_print;
asn_struct_free_f T3_free;

/*** <<< CODE [T3] >>> ***/

int
T3_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
			asn_app_consume_bytes_f *app_errlog, void *app_key) {
	
	/* Make the underlying type checker permanent */
	td->check_constraints = asn1_DEF_T4.check_constraints;
	return td->check_constraints
		(td, sptr, app_errlog, app_key);
}

/*
 * This type is implemented using T4,
 * so adjust the DEF appropriately.
 */
static void
T3_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
	td->ber_decoder    = asn1_DEF_T4.ber_decoder;
	td->der_encoder    = asn1_DEF_T4.der_encoder;
	td->free_struct    = asn1_DEF_T4.free_struct;
	td->print_struct   = asn1_DEF_T4.print_struct;
	td->last_tag_form  = asn1_DEF_T4.last_tag_form;
	td->elements       = asn1_DEF_T4.elements;
	td->elements_count = asn1_DEF_T4.elements_count;
	td->specifics      = asn1_DEF_T4.specifics;
}

ber_dec_rval_t
T3_decode_ber(asn1_TYPE_descriptor_t *td,
		void **structure, void *bufptr, size_t size, int tag_mode) {
	T3_inherit_TYPE_descriptor(td);
	return td->ber_decoder(td, structure, bufptr, size, tag_mode);
}

der_enc_rval_t
T3_encode_der(asn1_TYPE_descriptor_t *td,
		void *structure, int tag_mode, ber_tlv_tag_t tag,
		asn_app_consume_bytes_f *cb, void *app_key) {
	T3_inherit_TYPE_descriptor(td);
	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}

int
T3_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
	T3_inherit_TYPE_descriptor(td);
	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}

void
T3_free(asn1_TYPE_descriptor_t *td,
		void *struct_ptr, int contents_only) {
	T3_inherit_TYPE_descriptor(td);
	td->free_struct(td, struct_ptr, contents_only);
}


/*** <<< STAT-DEFS [T3] >>> ***/

static ber_tlv_tag_t asn1_DEF_T3_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (6 << 2))
};
static ber_tlv_tag_t asn1_DEF_T3_all_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T3 = {
	"T3",
	T3_constraint,
	T3_decode_ber,
	T3_encode_der,
	T3_print,
	T3_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_T3_tags,
	sizeof(asn1_DEF_T3_tags)
		/sizeof(asn1_DEF_T3_tags[0]), /* 2 */
	asn1_DEF_T3_all_tags,
	sizeof(asn1_DEF_T3_all_tags)
		/sizeof(asn1_DEF_T3_all_tags[0]), /* 4 */
	-0,	/* Unknown yet */
	0, 0,	/* No members */
	0	/* No specifics */
};


/*** <<< INCLUDES [T4] >>> ***/

#include <T5.h>

/*** <<< TYPE-DECLS [T4] >>> ***/


typedef T5_t	 T4_t;

/*** <<< FUNC-DECLS [T4] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_T4;
asn_constr_check_f T4_constraint;
ber_type_decoder_f T4_decode_ber;
der_type_encoder_f T4_encode_der;
asn_struct_print_f T4_print;
asn_struct_free_f T4_free;

/*** <<< CODE [T4] >>> ***/

int
T4_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
			asn_app_consume_bytes_f *app_errlog, void *app_key) {
	
	/* Make the underlying type checker permanent */
	td->check_constraints = asn1_DEF_T5.check_constraints;
	return td->check_constraints
		(td, sptr, app_errlog, app_key);
}

/*
 * This type is implemented using T5,
 * so adjust the DEF appropriately.
 */
static void
T4_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
	td->ber_decoder    = asn1_DEF_T5.ber_decoder;
	td->der_encoder    = asn1_DEF_T5.der_encoder;
	td->free_struct    = asn1_DEF_T5.free_struct;
	td->print_struct   = asn1_DEF_T5.print_struct;
	td->last_tag_form  = asn1_DEF_T5.last_tag_form;
	td->elements       = asn1_DEF_T5.elements;
	td->elements_count = asn1_DEF_T5.elements_count;
	td->specifics      = asn1_DEF_T5.specifics;
}

ber_dec_rval_t
T4_decode_ber(asn1_TYPE_descriptor_t *td,
		void **structure, void *bufptr, size_t size, int tag_mode) {
	T4_inherit_TYPE_descriptor(td);
	return td->ber_decoder(td, structure, bufptr, size, tag_mode);
}

der_enc_rval_t
T4_encode_der(asn1_TYPE_descriptor_t *td,
		void *structure, int tag_mode, ber_tlv_tag_t tag,
		asn_app_consume_bytes_f *cb, void *app_key) {
	T4_inherit_TYPE_descriptor(td);
	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}

int
T4_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
	T4_inherit_TYPE_descriptor(td);
	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}

void
T4_free(asn1_TYPE_descriptor_t *td,
		void *struct_ptr, int contents_only) {
	T4_inherit_TYPE_descriptor(td);
	td->free_struct(td, struct_ptr, contents_only);
}


/*** <<< STAT-DEFS [T4] >>> ***/

static ber_tlv_tag_t asn1_DEF_T4_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T4 = {
	"T4",
	T4_constraint,
	T4_decode_ber,
	T4_encode_der,
	T4_print,
	T4_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_T4_tags,
	sizeof(asn1_DEF_T4_tags)
		/sizeof(asn1_DEF_T4_tags[0]) - 1, /* 2 */
	asn1_DEF_T4_tags,	/* Same as above */
	sizeof(asn1_DEF_T4_tags)
		/sizeof(asn1_DEF_T4_tags[0]), /* 3 */
	-0,	/* Unknown yet */
	0, 0,	/* No members */
	0	/* No specifics */
};


/*** <<< INCLUDES [T5] >>> ***/

#include <T6.h>

/*** <<< TYPE-DECLS [T5] >>> ***/


typedef T6_t	 T5_t;

/*** <<< FUNC-DECLS [T5] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_T5;
asn_constr_check_f T5_constraint;
ber_type_decoder_f T5_decode_ber;
der_type_encoder_f T5_encode_der;
asn_struct_print_f T5_print;
asn_struct_free_f T5_free;

/*** <<< CODE [T5] >>> ***/

int
T5_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
			asn_app_consume_bytes_f *app_errlog, void *app_key) {
	
	/* Make the underlying type checker permanent */
	td->check_constraints = asn1_DEF_T6.check_constraints;
	return td->check_constraints
		(td, sptr, app_errlog, app_key);
}

/*
 * This type is implemented using T6,
 * so adjust the DEF appropriately.
 */
static void
T5_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
	td->ber_decoder    = asn1_DEF_T6.ber_decoder;
	td->der_encoder    = asn1_DEF_T6.der_encoder;
	td->free_struct    = asn1_DEF_T6.free_struct;
	td->print_struct   = asn1_DEF_T6.print_struct;
	td->last_tag_form  = asn1_DEF_T6.last_tag_form;
	td->elements       = asn1_DEF_T6.elements;
	td->elements_count = asn1_DEF_T6.elements_count;
	td->specifics      = asn1_DEF_T6.specifics;
}

ber_dec_rval_t
T5_decode_ber(asn1_TYPE_descriptor_t *td,
		void **structure, void *bufptr, size_t size, int tag_mode) {
	T5_inherit_TYPE_descriptor(td);
	return td->ber_decoder(td, structure, bufptr, size, tag_mode);
}

der_enc_rval_t
T5_encode_der(asn1_TYPE_descriptor_t *td,
		void *structure, int tag_mode, ber_tlv_tag_t tag,
		asn_app_consume_bytes_f *cb, void *app_key) {
	T5_inherit_TYPE_descriptor(td);
	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}

int
T5_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
	T5_inherit_TYPE_descriptor(td);
	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}

void
T5_free(asn1_TYPE_descriptor_t *td,
		void *struct_ptr, int contents_only) {
	T5_inherit_TYPE_descriptor(td);
	td->free_struct(td, struct_ptr, contents_only);
}


/*** <<< STAT-DEFS [T5] >>> ***/

static ber_tlv_tag_t asn1_DEF_T5_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T5 = {
	"T5",
	T5_constraint,
	T5_decode_ber,
	T5_encode_der,
	T5_print,
	T5_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_T5_tags,
	sizeof(asn1_DEF_T5_tags)
		/sizeof(asn1_DEF_T5_tags[0]) - 1, /* 1 */
	asn1_DEF_T5_tags,	/* Same as above */
	sizeof(asn1_DEF_T5_tags)
		/sizeof(asn1_DEF_T5_tags[0]), /* 2 */
	-0,	/* Unknown yet */
	0, 0,	/* No members */
	0	/* No specifics */
};


/*** <<< INCLUDES [T6] >>> ***/

#include <INTEGER.h>

/*** <<< TYPE-DECLS [T6] >>> ***/


typedef INTEGER_t	 T6_t;

/*** <<< FUNC-DECLS [T6] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_T6;
asn_constr_check_f T6_constraint;
ber_type_decoder_f T6_decode_ber;
der_type_encoder_f T6_encode_der;
asn_struct_print_f T6_print;
asn_struct_free_f T6_free;

/*** <<< CODE [T6] >>> ***/

int
T6_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
			asn_app_consume_bytes_f *app_errlog, void *app_key) {
	
	/* Make the underlying type checker permanent */
	td->check_constraints = asn1_DEF_INTEGER.check_constraints;
	return td->check_constraints
		(td, sptr, app_errlog, app_key);
}

/*
 * This type is implemented using INTEGER,
 * so adjust the DEF appropriately.
 */
static void
T6_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
	td->ber_decoder    = asn1_DEF_INTEGER.ber_decoder;
	td->der_encoder    = asn1_DEF_INTEGER.der_encoder;
	td->free_struct    = asn1_DEF_INTEGER.free_struct;
	td->print_struct   = asn1_DEF_INTEGER.print_struct;
	td->last_tag_form  = asn1_DEF_INTEGER.last_tag_form;
	td->elements       = asn1_DEF_INTEGER.elements;
	td->elements_count = asn1_DEF_INTEGER.elements_count;
	td->specifics      = asn1_DEF_INTEGER.specifics;
}

ber_dec_rval_t
T6_decode_ber(asn1_TYPE_descriptor_t *td,
		void **structure, void *bufptr, size_t size, int tag_mode) {
	T6_inherit_TYPE_descriptor(td);
	return td->ber_decoder(td, structure, bufptr, size, tag_mode);
}

der_enc_rval_t
T6_encode_der(asn1_TYPE_descriptor_t *td,
		void *structure, int tag_mode, ber_tlv_tag_t tag,
		asn_app_consume_bytes_f *cb, void *app_key) {
	T6_inherit_TYPE_descriptor(td);
	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}

int
T6_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
	T6_inherit_TYPE_descriptor(td);
	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}

void
T6_free(asn1_TYPE_descriptor_t *td,
		void *struct_ptr, int contents_only) {
	T6_inherit_TYPE_descriptor(td);
	td->free_struct(td, struct_ptr, contents_only);
}


/*** <<< STAT-DEFS [T6] >>> ***/

static ber_tlv_tag_t asn1_DEF_T6_tags[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T6 = {
	"T6",
	T6_constraint,
	T6_decode_ber,
	T6_encode_der,
	T6_print,
	T6_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_T6_tags,
	sizeof(asn1_DEF_T6_tags)
		/sizeof(asn1_DEF_T6_tags[0]), /* 1 */
	asn1_DEF_T6_tags,	/* Same as above */
	sizeof(asn1_DEF_T6_tags)
		/sizeof(asn1_DEF_T6_tags[0]), /* 1 */
	-0,	/* Unknown yet */
	0, 0,	/* No members */
	0	/* No specifics */
};


/*** <<< INCLUDES [T] >>> ***/

#include <Ts.h>

/*** <<< TYPE-DECLS [T] >>> ***/


typedef Ts_t	 T_t;

/*** <<< FUNC-DECLS [T] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_T;
asn_constr_check_f T_constraint;
ber_type_decoder_f T_decode_ber;
der_type_encoder_f T_encode_der;
asn_struct_print_f T_print;
asn_struct_free_f T_free;

/*** <<< CODE [T] >>> ***/

int
T_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
			asn_app_consume_bytes_f *app_errlog, void *app_key) {
	
	/* Make the underlying type checker permanent */
	td->check_constraints = asn1_DEF_Ts.check_constraints;
	return td->check_constraints
		(td, sptr, app_errlog, app_key);
}

/*
 * This type is implemented using Ts,
 * so adjust the DEF appropriately.
 */
static void
T_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
	td->ber_decoder    = asn1_DEF_Ts.ber_decoder;
	td->der_encoder    = asn1_DEF_Ts.der_encoder;
	td->free_struct    = asn1_DEF_Ts.free_struct;
	td->print_struct   = asn1_DEF_Ts.print_struct;
	td->last_tag_form  = asn1_DEF_Ts.last_tag_form;
	td->elements       = asn1_DEF_Ts.elements;
	td->elements_count = asn1_DEF_Ts.elements_count;
	td->specifics      = asn1_DEF_Ts.specifics;
}

ber_dec_rval_t
T_decode_ber(asn1_TYPE_descriptor_t *td,
		void **structure, void *bufptr, size_t size, int tag_mode) {
	T_inherit_TYPE_descriptor(td);
	return td->ber_decoder(td, structure, bufptr, size, tag_mode);
}

der_enc_rval_t
T_encode_der(asn1_TYPE_descriptor_t *td,
		void *structure, int tag_mode, ber_tlv_tag_t tag,
		asn_app_consume_bytes_f *cb, void *app_key) {
	T_inherit_TYPE_descriptor(td);
	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}

int
T_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,
		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
	T_inherit_TYPE_descriptor(td);
	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}

void
T_free(asn1_TYPE_descriptor_t *td,
		void *struct_ptr, int contents_only) {
	T_inherit_TYPE_descriptor(td);
	td->free_struct(td, struct_ptr, contents_only);
}


/*** <<< STAT-DEFS [T] >>> ***/

static ber_tlv_tag_t asn1_DEF_T_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
	(ASN_TAG_CLASS_CONTEXT | (123 << 2)),
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T = {
	"T",
	T_constraint,
	T_decode_ber,
	T_encode_der,
	T_print,
	T_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_T_tags,
	sizeof(asn1_DEF_T_tags)
		/sizeof(asn1_DEF_T_tags[0]) - 2, /* 1 */
	asn1_DEF_T_tags,	/* Same as above */
	sizeof(asn1_DEF_T_tags)
		/sizeof(asn1_DEF_T_tags[0]), /* 3 */
	-0,	/* Unknown yet */
	0, 0,	/* Defined elsewhere */
	0	/* No specifics */
};


/*** <<< INCLUDES [Ts] >>> ***/

#include <T2.h>
#include <T3.h>
#include <constr_SEQUENCE.h>

/*** <<< DEPS [Ts] >>> ***/

extern asn1_TYPE_descriptor_t asn1_DEF_Ts;

/*** <<< TYPE-DECLS [Ts] >>> ***/


typedef struct Ts {
	T2_t	 m1;
	T3_t	*m2	/* OPTIONAL */;
	T3_t	 m3;
	
	/* Context for parsing across buffer boundaries */
	ber_dec_ctx_t _ber_dec_ctx;
} Ts_t;

/*** <<< STAT-DEFS [Ts] >>> ***/

static asn1_TYPE_member_t asn1_MBR_Ts[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct Ts, m1),
		.tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = (void *)&asn1_DEF_T2,
		.memb_constraints = 0,	/* Defer to actual type */
		.name = "m1"
		},
	{ ATF_POINTER, 1, offsetof(struct Ts, m2),
		.tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
		.tag_mode = +1,	/* EXPLICIT tag at current level */
		.type = (void *)&asn1_DEF_T3,
		.memb_constraints = 0,	/* Defer to actual type */
		.name = "m2"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct Ts, m3),
		.tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
		.tag_mode = -1,	/* IMPLICIT tag at current level */
		.type = (void *)&asn1_DEF_T3,
		.memb_constraints = 0,	/* Defer to actual type */
		.name = "m3"
		},
};
static ber_tlv_tag_t asn1_DEF_Ts_tags[] = {
	(ASN_TAG_CLASS_CONTEXT | (123 << 2)),
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn1_TYPE_tag2member_t asn1_DEF_Ts_tag2el[] = {
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* m1 at 24 */
    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* m2 at 25 */
    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* m3 at 27 */
};
static asn1_SEQUENCE_specifics_t asn1_DEF_Ts_specs = {
	sizeof(struct Ts),
	offsetof(struct Ts, _ber_dec_ctx),
	asn1_DEF_Ts_tag2el,
	3,	/* Count of tags in the map */
	-1,	/* Start extensions */
	-1	/* Stop extensions */
};
asn1_TYPE_descriptor_t asn1_DEF_Ts = {
	"Ts",
	SEQUENCE_constraint,
	SEQUENCE_decode_ber,
	SEQUENCE_encode_der,
	SEQUENCE_print,
	SEQUENCE_free,
	0,	/* Use generic outmost tag fetcher */
	asn1_DEF_Ts_tags,
	sizeof(asn1_DEF_Ts_tags)
		/sizeof(asn1_DEF_Ts_tags[0]) - 1, /* 1 */
	asn1_DEF_Ts_tags,	/* Same as above */
	sizeof(asn1_DEF_Ts_tags)
		/sizeof(asn1_DEF_Ts_tags[0]), /* 2 */
	1,	/* Whether CONSTRUCTED */
	asn1_MBR_Ts,
	3,	/* Elements count */
	&asn1_DEF_Ts_specs	/* Additional specs */
};