Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< DEPS [T] >>> ***/ |
| 3 | |
| 4 | /* Dependencies for T */ |
| 5 | #include <NULL.h> |
| 6 | |
| 7 | /* Dependencies for b */ |
| 8 | #include <NULL.h> |
| 9 | #include <NULL.h> |
| 10 | |
| 11 | /* Dependencies for e */ |
| 12 | #include <NULL.h> |
| 13 | #include <NULL.h> |
| 14 | |
| 15 | /* Dependencies for h */ |
| 16 | #include <NULL.h> |
| 17 | #include <NULL.h> |
| 18 | |
| 19 | #include <constr_SEQUENCE.h> |
| 20 | |
| 21 | extern asn1_TYPE_descriptor_t asn1_DEF_T; |
| 22 | |
| 23 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 24 | |
| 25 | |
| 26 | typedef struct T { |
| 27 | NULL_t a; |
| 28 | struct b { |
| 29 | enum { |
| 30 | b_PR_NOTHING, /* No components present */ |
| 31 | b_PR_c, |
| 32 | b_PR_d, |
| 33 | b_PR_e, |
| 34 | b_PR_h, |
| 35 | } present; |
| 36 | union { |
| 37 | NULL_t c; |
| 38 | NULL_t d; |
| 39 | struct e { |
| 40 | enum { |
| 41 | e_PR_NOTHING, /* No components present */ |
| 42 | e_PR_f, |
| 43 | e_PR_g, |
| 44 | } present; |
| 45 | union { |
| 46 | NULL_t f; |
| 47 | NULL_t g; |
| 48 | } choice; |
| 49 | |
| 50 | /* Context for parsing across buffer boundaries */ |
| 51 | ber_dec_ctx_t _ber_dec_ctx; |
| 52 | } e; |
| 53 | struct h { |
| 54 | enum { |
| 55 | h_PR_NOTHING, /* No components present */ |
| 56 | h_PR_i, |
| 57 | h_PR_j, |
| 58 | } present; |
| 59 | union { |
| 60 | NULL_t i; |
| 61 | NULL_t j; |
| 62 | } choice; |
| 63 | |
| 64 | /* Context for parsing across buffer boundaries */ |
| 65 | ber_dec_ctx_t _ber_dec_ctx; |
| 66 | } h; |
| 67 | } choice; |
| 68 | |
| 69 | /* Context for parsing across buffer boundaries */ |
| 70 | ber_dec_ctx_t _ber_dec_ctx; |
| 71 | } b; |
| 72 | |
| 73 | /* Context for parsing across buffer boundaries */ |
| 74 | ber_dec_ctx_t _ber_dec_ctx; |
| 75 | } T_t; |
| 76 | |
| 77 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 78 | |
| 79 | #include <constr_CHOICE.h> |
| 80 | |
| 81 | static asn1_CHOICE_element_t asn1_DEF_e_elements[] = { |
| 82 | { offsetof(struct e, choice.f), 0, |
| 83 | (ASN_TAG_CLASS_PRIVATE | (7 << 2)), |
| 84 | -1, /* IMPLICIT tag at current level */ |
| 85 | (void *)&asn1_DEF_NULL, |
| 86 | "f" |
| 87 | }, |
| 88 | { offsetof(struct e, choice.g), 0, |
| 89 | (ASN_TAG_CLASS_PRIVATE | (8 << 2)), |
| 90 | -1, /* IMPLICIT tag at current level */ |
| 91 | (void *)&asn1_DEF_NULL, |
| 92 | "g" |
| 93 | }, |
| 94 | }; |
| 95 | static ber_tlv_tag_t asn1_DEF_e_tags[] = { |
| 96 | }; |
| 97 | static asn1_TYPE_tag2member_t asn1_DEF_e_tag2el[] = { |
| 98 | { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f at 20 */ |
| 99 | { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */ |
| 100 | }; |
| 101 | static asn1_CHOICE_specifics_t asn1_DEF_e_specs = { |
| 102 | sizeof(struct e), |
| 103 | offsetof(struct e, _ber_dec_ctx), |
| 104 | offsetof(struct e, present), |
| 105 | sizeof(((struct e *)0)->present), |
| 106 | asn1_DEF_e_elements, |
| 107 | 2, /* Elements count */ |
| 108 | asn1_DEF_e_tag2el, |
| 109 | 2, /* Count of tags in the map */ |
| 110 | 0 /* Whether extensible */ |
| 111 | }; |
| 112 | asn1_TYPE_descriptor_t asn1_DEF_e = { |
| 113 | "e", |
| 114 | CHOICE_constraint, |
| 115 | CHOICE_decode_ber, |
| 116 | CHOICE_encode_der, |
| 117 | CHOICE_print, |
| 118 | CHOICE_free, |
| 119 | CHOICE_outmost_tag, |
| 120 | asn1_DEF_e_tags, |
| 121 | sizeof(asn1_DEF_e_tags) |
| 122 | /sizeof(asn1_DEF_e_tags[0]), |
| 123 | 0, /* Tags to skip */ |
| 124 | 1, /* Whether CONSTRUCTED */ |
| 125 | &asn1_DEF_e_specs /* Additional specs */ |
| 126 | }; |
| 127 | |
| 128 | #include <constr_CHOICE.h> |
| 129 | |
| 130 | static asn1_CHOICE_element_t asn1_DEF_h_elements[] = { |
| 131 | { offsetof(struct h, choice.i), 0, |
| 132 | (ASN_TAG_CLASS_PRIVATE | (1 << 2)), |
| 133 | -1, /* IMPLICIT tag at current level */ |
| 134 | (void *)&asn1_DEF_NULL, |
| 135 | "i" |
| 136 | }, |
| 137 | { offsetof(struct h, choice.j), 0, |
| 138 | (ASN_TAG_CLASS_PRIVATE | (2 << 2)), |
| 139 | -1, /* IMPLICIT tag at current level */ |
| 140 | (void *)&asn1_DEF_NULL, |
| 141 | "j" |
| 142 | }, |
| 143 | }; |
| 144 | static ber_tlv_tag_t asn1_DEF_h_tags[] = { |
| 145 | }; |
| 146 | static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = { |
| 147 | { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */ |
| 148 | { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */ |
| 149 | }; |
| 150 | static asn1_CHOICE_specifics_t asn1_DEF_h_specs = { |
| 151 | sizeof(struct h), |
| 152 | offsetof(struct h, _ber_dec_ctx), |
| 153 | offsetof(struct h, present), |
| 154 | sizeof(((struct h *)0)->present), |
| 155 | asn1_DEF_h_elements, |
| 156 | 2, /* Elements count */ |
| 157 | asn1_DEF_h_tag2el, |
| 158 | 2, /* Count of tags in the map */ |
| 159 | 0 /* Whether extensible */ |
| 160 | }; |
| 161 | asn1_TYPE_descriptor_t asn1_DEF_h = { |
| 162 | "h", |
| 163 | CHOICE_constraint, |
| 164 | CHOICE_decode_ber, |
| 165 | CHOICE_encode_der, |
| 166 | CHOICE_print, |
| 167 | CHOICE_free, |
| 168 | CHOICE_outmost_tag, |
| 169 | asn1_DEF_h_tags, |
| 170 | sizeof(asn1_DEF_h_tags) |
| 171 | /sizeof(asn1_DEF_h_tags[0]), |
| 172 | 0, /* Tags to skip */ |
| 173 | 1, /* Whether CONSTRUCTED */ |
| 174 | &asn1_DEF_h_specs /* Additional specs */ |
| 175 | }; |
| 176 | |
| 177 | #include <constr_CHOICE.h> |
| 178 | |
| 179 | static asn1_CHOICE_element_t asn1_DEF_b_elements[] = { |
| 180 | { offsetof(struct b, choice.c), 0, |
| 181 | (ASN_TAG_CLASS_PRIVATE | (5 << 2)), |
| 182 | -1, /* IMPLICIT tag at current level */ |
| 183 | (void *)&asn1_DEF_NULL, |
| 184 | "c" |
| 185 | }, |
| 186 | { offsetof(struct b, choice.d), 0, |
| 187 | (ASN_TAG_CLASS_PRIVATE | (6 << 2)), |
| 188 | -1, /* IMPLICIT tag at current level */ |
| 189 | (void *)&asn1_DEF_NULL, |
| 190 | "d" |
| 191 | }, |
| 192 | { offsetof(struct b, choice.e), 0, |
| 193 | -1 /* Ambiguous tag (CHOICE?) */, |
| 194 | 0, |
| 195 | (void *)&asn1_DEF_e, |
| 196 | "e" |
| 197 | }, |
| 198 | { offsetof(struct b, choice.h), 0, |
| 199 | (ASN_TAG_CLASS_PRIVATE | (9 << 2)), |
| 200 | +1, /* EXPLICIT tag at current level */ |
| 201 | (void *)&asn1_DEF_h, |
| 202 | "h" |
| 203 | }, |
| 204 | }; |
| 205 | static ber_tlv_tag_t asn1_DEF_b_tags[] = { |
| 206 | }; |
| 207 | static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = { |
| 208 | { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */ |
| 209 | { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */ |
| 210 | { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */ |
| 211 | { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */ |
| 212 | { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */ |
| 213 | }; |
| 214 | static asn1_CHOICE_specifics_t asn1_DEF_b_specs = { |
| 215 | sizeof(struct b), |
| 216 | offsetof(struct b, _ber_dec_ctx), |
| 217 | offsetof(struct b, present), |
| 218 | sizeof(((struct b *)0)->present), |
| 219 | asn1_DEF_b_elements, |
| 220 | 4, /* Elements count */ |
| 221 | asn1_DEF_b_tag2el, |
| 222 | 5, /* Count of tags in the map */ |
| 223 | 0 /* Whether extensible */ |
| 224 | }; |
| 225 | asn1_TYPE_descriptor_t asn1_DEF_b = { |
| 226 | "b", |
| 227 | CHOICE_constraint, |
| 228 | CHOICE_decode_ber, |
| 229 | CHOICE_encode_der, |
| 230 | CHOICE_print, |
| 231 | CHOICE_free, |
| 232 | CHOICE_outmost_tag, |
| 233 | asn1_DEF_b_tags, |
| 234 | sizeof(asn1_DEF_b_tags) |
| 235 | /sizeof(asn1_DEF_b_tags[0]), |
| 236 | 0, /* Tags to skip */ |
| 237 | 1, /* Whether CONSTRUCTED */ |
| 238 | &asn1_DEF_b_specs /* Additional specs */ |
| 239 | }; |
| 240 | |
| 241 | #include <constr_SEQUENCE.h> |
| 242 | |
| 243 | static asn1_SEQUENCE_element_t asn1_DEF_T_elements[] = { |
| 244 | { offsetof(struct T, a), 0, |
| 245 | (ASN_TAG_CLASS_PRIVATE | (2 << 2)), |
| 246 | -1, /* IMPLICIT tag at current level */ |
| 247 | (void *)&asn1_DEF_NULL, |
| 248 | "a" |
| 249 | }, |
| 250 | { offsetof(struct T, b), 0, |
| 251 | -1 /* Ambiguous tag (CHOICE?) */, |
| 252 | 0, |
| 253 | (void *)&asn1_DEF_b, |
| 254 | "b" |
| 255 | }, |
| 256 | }; |
| 257 | static ber_tlv_tag_t asn1_DEF_T_tags[] = { |
| 258 | (ASN_TAG_CLASS_PRIVATE | (1 << 2)) |
| 259 | }; |
| 260 | static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = { |
| 261 | { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */ |
| 262 | { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c at 17 */ |
| 263 | { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */ |
| 264 | { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f at 20 */ |
| 265 | { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */ |
| 266 | { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 }, /* h at 24 */ |
| 267 | }; |
| 268 | static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = { |
| 269 | sizeof(struct T), |
| 270 | offsetof(struct T, _ber_dec_ctx), |
| 271 | asn1_DEF_T_elements, |
| 272 | 2, /* Elements count */ |
| 273 | asn1_DEF_T_tag2el, |
| 274 | 6, /* Count of tags in the map */ |
| 275 | -1, /* Start extensions */ |
| 276 | -1 /* Stop extensions */ |
| 277 | }; |
| 278 | asn1_TYPE_descriptor_t asn1_DEF_T = { |
| 279 | "T", |
| 280 | SEQUENCE_constraint, |
| 281 | SEQUENCE_decode_ber, |
| 282 | SEQUENCE_encode_der, |
| 283 | SEQUENCE_print, |
| 284 | SEQUENCE_free, |
| 285 | 0, /* Use generic outmost tag fetcher */ |
| 286 | asn1_DEF_T_tags, |
| 287 | sizeof(asn1_DEF_T_tags) |
| 288 | /sizeof(asn1_DEF_T_tags[0]), |
| 289 | 1, /* Tags to skip */ |
| 290 | 1, /* Whether CONSTRUCTED */ |
| 291 | &asn1_DEF_T_specs /* Additional specs */ |
| 292 | }; |
| 293 | |