blob: bd13dfd31eb505f6c51f5ff2abf7a12585870ecc [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001
Lev Walkin5d5e6522004-08-11 05:22:22 +00002/*** <<< INCLUDES [T] >>> ***/
Lev Walkinf15320b2004-06-03 03:38:44 +00003
Lev Walkinf15320b2004-06-03 03:38:44 +00004#include <INTEGER.h>
Lev Walkinf15320b2004-06-03 03:38:44 +00005#include <T2.h>
6#include <asn_SEQUENCE_OF.h>
Lev Walkin5d5e6522004-08-11 05:22:22 +00007#include <constr_SEQUENCE_OF.h>
Lev Walkinf15320b2004-06-03 03:38:44 +00008#include <constr_SEQUENCE.h>
9
Lev Walkin5d5e6522004-08-11 05:22:22 +000010/*** <<< DEPS [T] >>> ***/
11
Lev Walkinf15320b2004-06-03 03:38:44 +000012extern asn1_TYPE_descriptor_t asn1_DEF_T;
13
14/*** <<< TYPE-DECLS [T] >>> ***/
15
16
17typedef struct T {
18 INTEGER_t int;
19 struct collection {
Lev Walkin8dd0eed2004-09-17 06:32:12 +000020 A_SEQUENCE_OF(T2_t) list;
Lev Walkinf15320b2004-06-03 03:38:44 +000021
22 /* Context for parsing across buffer boundaries */
23 ber_dec_ctx_t _ber_dec_ctx;
24 } collection;
25
26 /* Context for parsing across buffer boundaries */
27 ber_dec_ctx_t _ber_dec_ctx;
28} T_t;
29
30/*** <<< STAT-DEFS [T] >>> ***/
31
Lev Walkin2e3055d2004-08-20 13:36:32 +000032static asn1_TYPE_member_t asn1_MBR_collection[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000033 { ATF_NOFLAGS, 0, 0,
Lev Walkin2e3055d2004-08-20 13:36:32 +000034 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
35 .tag_mode = 0,
36 .type = (void *)&asn1_DEF_T2,
37 .memb_constraints = 0, /* Defer to actual type */
38 .name = ""
Lev Walkinf15320b2004-06-03 03:38:44 +000039 },
Lev Walkin2e3055d2004-08-20 13:36:32 +000040};
41static ber_tlv_tag_t asn1_DEF_collection_tags[] = {
42 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
43};
44static asn1_SET_OF_specifics_t asn1_DEF_collection_specs = {
45 sizeof(struct collection),
46 offsetof(struct collection, _ber_dec_ctx),
Lev Walkina9cc46e2004-09-22 16:06:28 +000047 0, /* XER encoding is XMLDelimitedItemList */
Lev Walkin2e3055d2004-08-20 13:36:32 +000048};
Lev Walkind04430c2004-09-07 06:44:29 +000049static /* Use -fall-defs-global to expose */
Lev Walkin2e3055d2004-08-20 13:36:32 +000050asn1_TYPE_descriptor_t asn1_DEF_collection = {
51 "collection",
Lev Walkina9cc46e2004-09-22 16:06:28 +000052 SEQUENCE_OF_free,
53 SEQUENCE_OF_print,
Lev Walkin2e3055d2004-08-20 13:36:32 +000054 SEQUENCE_OF_constraint,
55 SEQUENCE_OF_decode_ber,
56 SEQUENCE_OF_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +000057 0, /* Not implemented yet */
58 SEQUENCE_OF_encode_xer,
Lev Walkin2e3055d2004-08-20 13:36:32 +000059 0, /* Use generic outmost tag fetcher */
60 asn1_DEF_collection_tags,
61 sizeof(asn1_DEF_collection_tags)
62 /sizeof(asn1_DEF_collection_tags[0]), /* 1 */
Lev Walkin188ed2c2004-09-13 08:31:01 +000063 asn1_DEF_collection_tags, /* Same as above */
64 sizeof(asn1_DEF_collection_tags)
65 /sizeof(asn1_DEF_collection_tags[0]), /* 1 */
Lev Walkin2e3055d2004-08-20 13:36:32 +000066 1, /* Whether CONSTRUCTED */
67 asn1_MBR_collection,
68 1, /* Single element */
69 &asn1_DEF_collection_specs /* Additional specs */
70};
71
72static asn1_TYPE_member_t asn1_MBR_T[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +000073 { ATF_NOFLAGS, 0, offsetof(struct T, int),
Lev Walkin2e3055d2004-08-20 13:36:32 +000074 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
75 .tag_mode = 0,
76 .type = (void *)&asn1_DEF_INTEGER,
77 .memb_constraints = 0, /* Defer to actual type */
78 .name = "int"
79 },
Lev Walkincc93b0f2004-09-10 09:18:20 +000080 { ATF_NOFLAGS, 0, offsetof(struct T, collection),
Lev Walkin2e3055d2004-08-20 13:36:32 +000081 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
82 .tag_mode = 0,
83 .type = (void *)&asn1_DEF_collection,
84 .memb_constraints = 0, /* Defer to actual type */
85 .name = "collection"
Lev Walkinf15320b2004-06-03 03:38:44 +000086 },
87};
88static ber_tlv_tag_t asn1_DEF_T_tags[] = {
89 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
90};
Lev Walkincda6b8a2004-06-06 07:20:52 +000091static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
Lev Walkin38abe792004-06-14 13:09:45 +000092 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int at 15 */
93 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* collection at 17 */
Lev Walkincda6b8a2004-06-06 07:20:52 +000094};
Lev Walkinf15320b2004-06-03 03:38:44 +000095static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = {
96 sizeof(struct T),
97 offsetof(struct T, _ber_dec_ctx),
Lev Walkincda6b8a2004-06-06 07:20:52 +000098 asn1_DEF_T_tag2el,
99 2, /* Count of tags in the map */
Lev Walkinf15320b2004-06-03 03:38:44 +0000100 -1, /* Start extensions */
101 -1 /* Stop extensions */
102};
103asn1_TYPE_descriptor_t asn1_DEF_T = {
104 "T",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000105 SEQUENCE_free,
106 SEQUENCE_print,
Lev Walkinf15320b2004-06-03 03:38:44 +0000107 SEQUENCE_constraint,
108 SEQUENCE_decode_ber,
109 SEQUENCE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000110 0, /* Not implemented yet */
111 SEQUENCE_encode_xer,
Lev Walkinf15320b2004-06-03 03:38:44 +0000112 0, /* Use generic outmost tag fetcher */
113 asn1_DEF_T_tags,
114 sizeof(asn1_DEF_T_tags)
Lev Walkin64399722004-08-11 07:17:22 +0000115 /sizeof(asn1_DEF_T_tags[0]), /* 1 */
Lev Walkin188ed2c2004-09-13 08:31:01 +0000116 asn1_DEF_T_tags, /* Same as above */
117 sizeof(asn1_DEF_T_tags)
118 /sizeof(asn1_DEF_T_tags[0]), /* 1 */
Lev Walkinf15320b2004-06-03 03:38:44 +0000119 1, /* Whether CONSTRUCTED */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000120 asn1_MBR_T,
121 2, /* Elements count */
Lev Walkinf15320b2004-06-03 03:38:44 +0000122 &asn1_DEF_T_specs /* Additional specs */
123};
124
125
Lev Walkin5d5e6522004-08-11 05:22:22 +0000126/*** <<< INCLUDES [T2] >>> ***/
Lev Walkinf15320b2004-06-03 03:38:44 +0000127
Lev Walkinf15320b2004-06-03 03:38:44 +0000128#include <BOOLEAN.h>
129#include <UTF8String.h>
Lev Walkinf15320b2004-06-03 03:38:44 +0000130#include <constr_SEQUENCE.h>
131
Lev Walkin5d5e6522004-08-11 05:22:22 +0000132/*** <<< DEPS [T2] >>> ***/
133
Lev Walkinf15320b2004-06-03 03:38:44 +0000134extern asn1_TYPE_descriptor_t asn1_DEF_T2;
135
136/*** <<< TYPE-DECLS [T2] >>> ***/
137
138
139typedef struct T2 {
140 BOOLEAN_t flag;
141 UTF8String_t str;
142
143 /* Context for parsing across buffer boundaries */
144 ber_dec_ctx_t _ber_dec_ctx;
145} T2_t;
146
147/*** <<< STAT-DEFS [T2] >>> ***/
148
Lev Walkin2e3055d2004-08-20 13:36:32 +0000149static asn1_TYPE_member_t asn1_MBR_T2[] = {
Lev Walkincc93b0f2004-09-10 09:18:20 +0000150 { ATF_NOFLAGS, 0, offsetof(struct T2, flag),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000151 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
152 .tag_mode = 0,
153 .type = (void *)&asn1_DEF_BOOLEAN,
154 .memb_constraints = 0, /* Defer to actual type */
155 .name = "flag"
Lev Walkinf15320b2004-06-03 03:38:44 +0000156 },
Lev Walkincc93b0f2004-09-10 09:18:20 +0000157 { ATF_NOFLAGS, 0, offsetof(struct T2, str),
Lev Walkin2e3055d2004-08-20 13:36:32 +0000158 .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
159 .tag_mode = 0,
160 .type = (void *)&asn1_DEF_UTF8String,
161 .memb_constraints = 0, /* Defer to actual type */
162 .name = "str"
Lev Walkinf15320b2004-06-03 03:38:44 +0000163 },
164};
165static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
166 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
167};
Lev Walkincda6b8a2004-06-06 07:20:52 +0000168static asn1_TYPE_tag2member_t asn1_DEF_T2_tag2el[] = {
Lev Walkin38abe792004-06-14 13:09:45 +0000169 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* flag at 20 */
170 { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* str at 21 */
Lev Walkincda6b8a2004-06-06 07:20:52 +0000171};
Lev Walkinf15320b2004-06-03 03:38:44 +0000172static asn1_SEQUENCE_specifics_t asn1_DEF_T2_specs = {
173 sizeof(struct T2),
174 offsetof(struct T2, _ber_dec_ctx),
Lev Walkincda6b8a2004-06-06 07:20:52 +0000175 asn1_DEF_T2_tag2el,
176 2, /* Count of tags in the map */
Lev Walkinf15320b2004-06-03 03:38:44 +0000177 -1, /* Start extensions */
178 -1 /* Stop extensions */
179};
180asn1_TYPE_descriptor_t asn1_DEF_T2 = {
181 "T2",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000182 SEQUENCE_free,
183 SEQUENCE_print,
Lev Walkinf15320b2004-06-03 03:38:44 +0000184 SEQUENCE_constraint,
185 SEQUENCE_decode_ber,
186 SEQUENCE_encode_der,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000187 0, /* Not implemented yet */
188 SEQUENCE_encode_xer,
Lev Walkinf15320b2004-06-03 03:38:44 +0000189 0, /* Use generic outmost tag fetcher */
190 asn1_DEF_T2_tags,
191 sizeof(asn1_DEF_T2_tags)
Lev Walkin64399722004-08-11 07:17:22 +0000192 /sizeof(asn1_DEF_T2_tags[0]), /* 1 */
Lev Walkin188ed2c2004-09-13 08:31:01 +0000193 asn1_DEF_T2_tags, /* Same as above */
194 sizeof(asn1_DEF_T2_tags)
195 /sizeof(asn1_DEF_T2_tags[0]), /* 1 */
Lev Walkinf15320b2004-06-03 03:38:44 +0000196 1, /* Whether CONSTRUCTED */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000197 asn1_MBR_T2,
198 2, /* Elements count */
Lev Walkinf15320b2004-06-03 03:38:44 +0000199 &asn1_DEF_T2_specs /* Additional specs */
200};
201