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