blob: 2da68af1e1fe1cbf5c82e274f19b828c1cadcd26 [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",
Lev Walkina9cc46e2004-09-22 16:06:28 +000057 SEQUENCE_free,
58 SEQUENCE_print,
Lev Walkinb9189732004-09-10 09:37:12 +000059 SEQUENCE_constraint,
60 SEQUENCE_decode_ber,
61 SEQUENCE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +000062 0, /* Not implemented yet */
63 SEQUENCE_encode_xer,
Lev Walkinb9189732004-09-10 09:37:12 +000064 0, /* Use generic outmost tag fetcher */
65 asn1_DEF_T1_tags,
66 sizeof(asn1_DEF_T1_tags)
67 /sizeof(asn1_DEF_T1_tags[0]), /* 1 */
Lev Walkin188ed2c2004-09-13 08:31:01 +000068 asn1_DEF_T1_tags, /* Same as above */
69 sizeof(asn1_DEF_T1_tags)
70 /sizeof(asn1_DEF_T1_tags[0]), /* 1 */
Lev Walkinb9189732004-09-10 09:37:12 +000071 1, /* Whether CONSTRUCTED */
72 asn1_MBR_T1,
73 2, /* Elements count */
74 &asn1_DEF_T1_specs /* Additional specs */
75};
76
77
78/*** <<< INCLUDES [T2] >>> ***/
79
80#include <INTEGER.h>
81#include <ANY.h>
82#include <constr_SEQUENCE.h>
83
84/*** <<< DEPS [T2] >>> ***/
85
86extern asn1_TYPE_descriptor_t asn1_DEF_T2;
87
88/*** <<< TYPE-DECLS [T2] >>> ***/
89
90
91typedef struct T2 {
92 INTEGER_t i;
93 ANY_t *any /* OPTIONAL */;
94
95 /* Context for parsing across buffer boundaries */
96 ber_dec_ctx_t _ber_dec_ctx;
97} T2_t;
98
99/*** <<< STAT-DEFS [T2] >>> ***/
100
101static asn1_TYPE_member_t asn1_MBR_T2[] = {
102 { ATF_NOFLAGS, 0, offsetof(struct T2, i),
103 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
104 .tag_mode = 0,
105 .type = (void *)&asn1_DEF_INTEGER,
106 .memb_constraints = 0, /* Defer to actual type */
107 .name = "i"
108 },
109 { ATF_POINTER, 1, offsetof(struct T2, any),
110 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
111 .tag_mode = +1, /* EXPLICIT tag at current level */
112 .type = (void *)&asn1_DEF_ANY,
113 .memb_constraints = 0, /* Defer to actual type */
114 .name = "any"
115 },
116};
117static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
118 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
119};
120static asn1_TYPE_tag2member_t asn1_DEF_T2_tag2el[] = {
121 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 20 */
122 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* any at 21 */
123};
124static asn1_SEQUENCE_specifics_t asn1_DEF_T2_specs = {
125 sizeof(struct T2),
126 offsetof(struct T2, _ber_dec_ctx),
127 asn1_DEF_T2_tag2el,
128 2, /* Count of tags in the map */
129 -1, /* Start extensions */
130 -1 /* Stop extensions */
131};
132asn1_TYPE_descriptor_t asn1_DEF_T2 = {
133 "T2",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000134 SEQUENCE_free,
135 SEQUENCE_print,
Lev Walkinb9189732004-09-10 09:37:12 +0000136 SEQUENCE_constraint,
137 SEQUENCE_decode_ber,
138 SEQUENCE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000139 0, /* Not implemented yet */
140 SEQUENCE_encode_xer,
Lev Walkinb9189732004-09-10 09:37:12 +0000141 0, /* Use generic outmost tag fetcher */
142 asn1_DEF_T2_tags,
143 sizeof(asn1_DEF_T2_tags)
144 /sizeof(asn1_DEF_T2_tags[0]), /* 1 */
Lev Walkin188ed2c2004-09-13 08:31:01 +0000145 asn1_DEF_T2_tags, /* Same as above */
146 sizeof(asn1_DEF_T2_tags)
147 /sizeof(asn1_DEF_T2_tags[0]), /* 1 */
Lev Walkinb9189732004-09-10 09:37:12 +0000148 1, /* Whether CONSTRUCTED */
149 asn1_MBR_T2,
150 2, /* Elements count */
151 &asn1_DEF_T2_specs /* Additional specs */
152};
153