blob: 6a8553b9aa723983514ba0377c8d8d8284525817 [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 {
20 A_SEQUENCE_OF(struct T2) list;
21
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[] = {
33 { 0, 0,
34 .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),
47};
48asn1_TYPE_descriptor_t asn1_DEF_collection = {
49 "collection",
50 SEQUENCE_OF_constraint,
51 SEQUENCE_OF_decode_ber,
52 SEQUENCE_OF_encode_der,
53 SEQUENCE_OF_print,
54 SEQUENCE_OF_free,
55 0, /* Use generic outmost tag fetcher */
56 asn1_DEF_collection_tags,
57 sizeof(asn1_DEF_collection_tags)
58 /sizeof(asn1_DEF_collection_tags[0]), /* 1 */
59 1, /* Tags to skip */
60 1, /* Whether CONSTRUCTED */
61 asn1_MBR_collection,
62 1, /* Single element */
63 &asn1_DEF_collection_specs /* Additional specs */
64};
65
66static asn1_TYPE_member_t asn1_MBR_T[] = {
67 { 0, offsetof(struct T, int),
68 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
69 .tag_mode = 0,
70 .type = (void *)&asn1_DEF_INTEGER,
71 .memb_constraints = 0, /* Defer to actual type */
72 .name = "int"
73 },
74 { 0, offsetof(struct T, collection),
75 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
76 .tag_mode = 0,
77 .type = (void *)&asn1_DEF_collection,
78 .memb_constraints = 0, /* Defer to actual type */
79 .name = "collection"
Lev Walkinf15320b2004-06-03 03:38:44 +000080 },
81};
82static ber_tlv_tag_t asn1_DEF_T_tags[] = {
83 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
84};
Lev Walkincda6b8a2004-06-06 07:20:52 +000085static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
Lev Walkin38abe792004-06-14 13:09:45 +000086 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int at 15 */
87 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* collection at 17 */
Lev Walkincda6b8a2004-06-06 07:20:52 +000088};
Lev Walkinf15320b2004-06-03 03:38:44 +000089static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = {
90 sizeof(struct T),
91 offsetof(struct T, _ber_dec_ctx),
Lev Walkincda6b8a2004-06-06 07:20:52 +000092 asn1_DEF_T_tag2el,
93 2, /* Count of tags in the map */
Lev Walkinf15320b2004-06-03 03:38:44 +000094 -1, /* Start extensions */
95 -1 /* Stop extensions */
96};
97asn1_TYPE_descriptor_t asn1_DEF_T = {
98 "T",
99 SEQUENCE_constraint,
100 SEQUENCE_decode_ber,
101 SEQUENCE_encode_der,
102 SEQUENCE_print,
103 SEQUENCE_free,
104 0, /* Use generic outmost tag fetcher */
105 asn1_DEF_T_tags,
106 sizeof(asn1_DEF_T_tags)
Lev Walkin64399722004-08-11 07:17:22 +0000107 /sizeof(asn1_DEF_T_tags[0]), /* 1 */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000108 1, /* Tags to skip */
Lev Walkinf15320b2004-06-03 03:38:44 +0000109 1, /* Whether CONSTRUCTED */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000110 asn1_MBR_T,
111 2, /* Elements count */
Lev Walkinf15320b2004-06-03 03:38:44 +0000112 &asn1_DEF_T_specs /* Additional specs */
113};
114
115
Lev Walkin5d5e6522004-08-11 05:22:22 +0000116/*** <<< INCLUDES [T2] >>> ***/
Lev Walkinf15320b2004-06-03 03:38:44 +0000117
Lev Walkinf15320b2004-06-03 03:38:44 +0000118#include <BOOLEAN.h>
119#include <UTF8String.h>
Lev Walkinf15320b2004-06-03 03:38:44 +0000120#include <constr_SEQUENCE.h>
121
Lev Walkin5d5e6522004-08-11 05:22:22 +0000122/*** <<< DEPS [T2] >>> ***/
123
Lev Walkinf15320b2004-06-03 03:38:44 +0000124extern asn1_TYPE_descriptor_t asn1_DEF_T2;
125
126/*** <<< TYPE-DECLS [T2] >>> ***/
127
128
129typedef struct T2 {
130 BOOLEAN_t flag;
131 UTF8String_t str;
132
133 /* Context for parsing across buffer boundaries */
134 ber_dec_ctx_t _ber_dec_ctx;
135} T2_t;
136
137/*** <<< STAT-DEFS [T2] >>> ***/
138
Lev Walkin2e3055d2004-08-20 13:36:32 +0000139static asn1_TYPE_member_t asn1_MBR_T2[] = {
140 { 0, offsetof(struct T2, flag),
141 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
142 .tag_mode = 0,
143 .type = (void *)&asn1_DEF_BOOLEAN,
144 .memb_constraints = 0, /* Defer to actual type */
145 .name = "flag"
Lev Walkinf15320b2004-06-03 03:38:44 +0000146 },
Lev Walkin2e3055d2004-08-20 13:36:32 +0000147 { 0, offsetof(struct T2, str),
148 .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
149 .tag_mode = 0,
150 .type = (void *)&asn1_DEF_UTF8String,
151 .memb_constraints = 0, /* Defer to actual type */
152 .name = "str"
Lev Walkinf15320b2004-06-03 03:38:44 +0000153 },
154};
155static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
156 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
157};
Lev Walkincda6b8a2004-06-06 07:20:52 +0000158static asn1_TYPE_tag2member_t asn1_DEF_T2_tag2el[] = {
Lev Walkin38abe792004-06-14 13:09:45 +0000159 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* flag at 20 */
160 { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* str at 21 */
Lev Walkincda6b8a2004-06-06 07:20:52 +0000161};
Lev Walkinf15320b2004-06-03 03:38:44 +0000162static asn1_SEQUENCE_specifics_t asn1_DEF_T2_specs = {
163 sizeof(struct T2),
164 offsetof(struct T2, _ber_dec_ctx),
Lev Walkincda6b8a2004-06-06 07:20:52 +0000165 asn1_DEF_T2_tag2el,
166 2, /* Count of tags in the map */
Lev Walkinf15320b2004-06-03 03:38:44 +0000167 -1, /* Start extensions */
168 -1 /* Stop extensions */
169};
170asn1_TYPE_descriptor_t asn1_DEF_T2 = {
171 "T2",
172 SEQUENCE_constraint,
173 SEQUENCE_decode_ber,
174 SEQUENCE_encode_der,
175 SEQUENCE_print,
176 SEQUENCE_free,
177 0, /* Use generic outmost tag fetcher */
178 asn1_DEF_T2_tags,
179 sizeof(asn1_DEF_T2_tags)
Lev Walkin64399722004-08-11 07:17:22 +0000180 /sizeof(asn1_DEF_T2_tags[0]), /* 1 */
Lev Walkin5bbff1e2004-06-28 21:13:22 +0000181 1, /* Tags to skip */
Lev Walkinf15320b2004-06-03 03:38:44 +0000182 1, /* Whether CONSTRUCTED */
Lev Walkin2e3055d2004-08-20 13:36:32 +0000183 asn1_MBR_T2,
184 2, /* Elements count */
Lev Walkinf15320b2004-06-03 03:38:44 +0000185 &asn1_DEF_T2_specs /* Additional specs */
186};
187