blob: 96098a58dd9750c930c6d3481945bb98a2bfcfc8 [file] [log] [blame]
Lev Walkinb9189732004-09-10 09:37:12 +00001
2/*** <<< INCLUDES [T1] >>> ***/
3
4#include <INTEGER.h>
5#include <ANY.h>
6#include <constr_SEQUENCE.h>
7
8/*** <<< DEPS [T1] >>> ***/
9
10extern asn1_TYPE_descriptor_t asn1_DEF_T1;
11
12/*** <<< TYPE-DECLS [T1] >>> ***/
13
14
15typedef struct T1 {
16 INTEGER_t i;
17 ANY_t any;
18
19 /* Context for parsing across buffer boundaries */
20 ber_dec_ctx_t _ber_dec_ctx;
21} T1_t;
22
23/*** <<< STAT-DEFS [T1] >>> ***/
24
25static asn1_TYPE_member_t asn1_MBR_T1[] = {
26 { ATF_NOFLAGS, 0, offsetof(struct T1, i),
27 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
28 .tag_mode = 0,
29 .type = (void *)&asn1_DEF_INTEGER,
30 .memb_constraints = 0, /* Defer to actual type */
31 .name = "i"
32 },
33 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct T1, any),
34 .tag = -1 /* Ambiguous tag (ANY?) */,
35 .tag_mode = 0,
36 .type = (void *)&asn1_DEF_ANY,
37 .memb_constraints = 0, /* Defer to actual type */
38 .name = "any"
39 },
40};
41static ber_tlv_tag_t asn1_DEF_T1_tags[] = {
42 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
43};
44static asn1_TYPE_tag2member_t asn1_DEF_T1_tag2el[] = {
45 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 15 */
46};
47static asn1_SEQUENCE_specifics_t asn1_DEF_T1_specs = {
48 sizeof(struct T1),
49 offsetof(struct T1, _ber_dec_ctx),
50 asn1_DEF_T1_tag2el,
51 1, /* Count of tags in the map */
52 -1, /* Start extensions */
53 -1 /* Stop extensions */
54};
55asn1_TYPE_descriptor_t asn1_DEF_T1 = {
56 "T1",
57 SEQUENCE_constraint,
58 SEQUENCE_decode_ber,
59 SEQUENCE_encode_der,
60 SEQUENCE_print,
61 SEQUENCE_free,
62 0, /* Use generic outmost tag fetcher */
63 asn1_DEF_T1_tags,
64 sizeof(asn1_DEF_T1_tags)
65 /sizeof(asn1_DEF_T1_tags[0]), /* 1 */
66 1, /* Tags to skip */
67 1, /* Whether CONSTRUCTED */
68 asn1_MBR_T1,
69 2, /* Elements count */
70 &asn1_DEF_T1_specs /* Additional specs */
71};
72
73
74/*** <<< INCLUDES [T2] >>> ***/
75
76#include <INTEGER.h>
77#include <ANY.h>
78#include <constr_SEQUENCE.h>
79
80/*** <<< DEPS [T2] >>> ***/
81
82extern asn1_TYPE_descriptor_t asn1_DEF_T2;
83
84/*** <<< TYPE-DECLS [T2] >>> ***/
85
86
87typedef struct T2 {
88 INTEGER_t i;
89 ANY_t *any /* OPTIONAL */;
90
91 /* Context for parsing across buffer boundaries */
92 ber_dec_ctx_t _ber_dec_ctx;
93} T2_t;
94
95/*** <<< STAT-DEFS [T2] >>> ***/
96
97static asn1_TYPE_member_t asn1_MBR_T2[] = {
98 { ATF_NOFLAGS, 0, offsetof(struct T2, i),
99 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
100 .tag_mode = 0,
101 .type = (void *)&asn1_DEF_INTEGER,
102 .memb_constraints = 0, /* Defer to actual type */
103 .name = "i"
104 },
105 { ATF_POINTER, 1, offsetof(struct T2, any),
106 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
107 .tag_mode = +1, /* EXPLICIT tag at current level */
108 .type = (void *)&asn1_DEF_ANY,
109 .memb_constraints = 0, /* Defer to actual type */
110 .name = "any"
111 },
112};
113static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
114 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
115};
116static asn1_TYPE_tag2member_t asn1_DEF_T2_tag2el[] = {
117 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 20 */
118 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* any at 21 */
119};
120static asn1_SEQUENCE_specifics_t asn1_DEF_T2_specs = {
121 sizeof(struct T2),
122 offsetof(struct T2, _ber_dec_ctx),
123 asn1_DEF_T2_tag2el,
124 2, /* Count of tags in the map */
125 -1, /* Start extensions */
126 -1 /* Stop extensions */
127};
128asn1_TYPE_descriptor_t asn1_DEF_T2 = {
129 "T2",
130 SEQUENCE_constraint,
131 SEQUENCE_decode_ber,
132 SEQUENCE_encode_der,
133 SEQUENCE_print,
134 SEQUENCE_free,
135 0, /* Use generic outmost tag fetcher */
136 asn1_DEF_T2_tags,
137 sizeof(asn1_DEF_T2_tags)
138 /sizeof(asn1_DEF_T2_tags[0]), /* 1 */
139 1, /* Tags to skip */
140 1, /* Whether CONSTRUCTED */
141 asn1_MBR_T2,
142 2, /* Elements count */
143 &asn1_DEF_T2_specs /* Additional specs */
144};
145