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[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 72 | { ATF_NOFLAGS, 0, offsetof(struct e, choice.f), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 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 | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 79 | { ATF_NOFLAGS, 0, offsetof(struct e, choice.g), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 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", |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 103 | CHOICE_free, |
| 104 | CHOICE_print, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 105 | CHOICE_constraint, |
| 106 | CHOICE_decode_ber, |
| 107 | CHOICE_encode_der, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 108 | 0, /* Not implemented yet */ |
| 109 | CHOICE_encode_xer, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 110 | CHOICE_outmost_tag, |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 111 | 0, /* No effective tags (pointer) */ |
| 112 | 0, /* No effective tags (count) */ |
| 113 | 0, /* No tags (pointer) */ |
| 114 | 0, /* No tags (count) */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 115 | asn1_MBR_e, |
| 116 | 2, /* Elements count */ |
| 117 | &asn1_DEF_e_specs /* Additional specs */ |
| 118 | }; |
| 119 | |
| 120 | static asn1_TYPE_member_t asn1_MBR_h[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 121 | { ATF_NOFLAGS, 0, offsetof(struct h, choice.i), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 122 | .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)), |
| 123 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 124 | .type = (void *)&asn1_DEF_NULL, |
| 125 | .memb_constraints = 0, /* Defer to actual type */ |
| 126 | .name = "i" |
| 127 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 128 | { ATF_NOFLAGS, 0, offsetof(struct h, choice.j), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 129 | .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)), |
| 130 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 131 | .type = (void *)&asn1_DEF_NULL, |
| 132 | .memb_constraints = 0, /* Defer to actual type */ |
| 133 | .name = "j" |
| 134 | }, |
| 135 | }; |
| 136 | static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = { |
| 137 | { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */ |
| 138 | { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */ |
| 139 | }; |
| 140 | static asn1_CHOICE_specifics_t asn1_DEF_h_specs = { |
| 141 | sizeof(struct h), |
| 142 | offsetof(struct h, _ber_dec_ctx), |
| 143 | offsetof(struct h, present), |
| 144 | sizeof(((struct h *)0)->present), |
| 145 | asn1_DEF_h_tag2el, |
| 146 | 2, /* Count of tags in the map */ |
| 147 | 0 /* Whether extensible */ |
| 148 | }; |
vlm | 1dc848e | 2004-09-07 06:44:29 +0000 | [diff] [blame] | 149 | static /* Use -fall-defs-global to expose */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 150 | asn1_TYPE_descriptor_t asn1_DEF_h = { |
| 151 | "h", |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 152 | CHOICE_free, |
| 153 | CHOICE_print, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 154 | CHOICE_constraint, |
| 155 | CHOICE_decode_ber, |
| 156 | CHOICE_encode_der, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 157 | 0, /* Not implemented yet */ |
| 158 | CHOICE_encode_xer, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 159 | CHOICE_outmost_tag, |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 160 | 0, /* No effective tags (pointer) */ |
| 161 | 0, /* No effective tags (count) */ |
| 162 | 0, /* No tags (pointer) */ |
| 163 | 0, /* No tags (count) */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 164 | asn1_MBR_h, |
| 165 | 2, /* Elements count */ |
| 166 | &asn1_DEF_h_specs /* Additional specs */ |
| 167 | }; |
| 168 | |
| 169 | static asn1_TYPE_member_t asn1_MBR_b[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 170 | { ATF_NOFLAGS, 0, offsetof(struct b, choice.c), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 171 | .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)), |
| 172 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 173 | .type = (void *)&asn1_DEF_NULL, |
| 174 | .memb_constraints = 0, /* Defer to actual type */ |
| 175 | .name = "c" |
| 176 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 177 | { ATF_NOFLAGS, 0, offsetof(struct b, choice.d), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 178 | .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)), |
| 179 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 180 | .type = (void *)&asn1_DEF_NULL, |
| 181 | .memb_constraints = 0, /* Defer to actual type */ |
| 182 | .name = "d" |
| 183 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 184 | { ATF_NOFLAGS, 0, offsetof(struct b, choice.e), |
vlm | 060fe2a | 2004-09-10 09:37:12 +0000 | [diff] [blame] | 185 | .tag = -1 /* Ambiguous tag (CHOICE?) */, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 186 | .tag_mode = 0, |
| 187 | .type = (void *)&asn1_DEF_e, |
| 188 | .memb_constraints = 0, /* Defer to actual type */ |
| 189 | .name = "e" |
| 190 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 191 | { ATF_NOFLAGS, 0, offsetof(struct b, choice.h), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 192 | .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)), |
| 193 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 194 | .type = (void *)&asn1_DEF_h, |
| 195 | .memb_constraints = 0, /* Defer to actual type */ |
| 196 | .name = "h" |
| 197 | }, |
| 198 | }; |
| 199 | static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = { |
| 200 | { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */ |
| 201 | { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */ |
| 202 | { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */ |
| 203 | { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */ |
| 204 | { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */ |
| 205 | }; |
| 206 | static asn1_CHOICE_specifics_t asn1_DEF_b_specs = { |
| 207 | sizeof(struct b), |
| 208 | offsetof(struct b, _ber_dec_ctx), |
| 209 | offsetof(struct b, present), |
| 210 | sizeof(((struct b *)0)->present), |
| 211 | asn1_DEF_b_tag2el, |
| 212 | 5, /* Count of tags in the map */ |
| 213 | 0 /* Whether extensible */ |
| 214 | }; |
vlm | 1dc848e | 2004-09-07 06:44:29 +0000 | [diff] [blame] | 215 | static /* Use -fall-defs-global to expose */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 216 | asn1_TYPE_descriptor_t asn1_DEF_b = { |
| 217 | "b", |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 218 | CHOICE_free, |
| 219 | CHOICE_print, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 220 | CHOICE_constraint, |
| 221 | CHOICE_decode_ber, |
| 222 | CHOICE_encode_der, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 223 | 0, /* Not implemented yet */ |
| 224 | CHOICE_encode_xer, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 225 | CHOICE_outmost_tag, |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 226 | 0, /* No effective tags (pointer) */ |
| 227 | 0, /* No effective tags (count) */ |
| 228 | 0, /* No tags (pointer) */ |
| 229 | 0, /* No tags (count) */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 230 | asn1_MBR_b, |
| 231 | 4, /* Elements count */ |
| 232 | &asn1_DEF_b_specs /* Additional specs */ |
| 233 | }; |
| 234 | |
| 235 | static asn1_TYPE_member_t asn1_MBR_T[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 236 | { ATF_NOFLAGS, 0, offsetof(struct T, a), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 237 | .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)), |
| 238 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 239 | .type = (void *)&asn1_DEF_NULL, |
| 240 | .memb_constraints = 0, /* Defer to actual type */ |
| 241 | .name = "a" |
| 242 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 243 | { ATF_NOFLAGS, 0, offsetof(struct T, b), |
vlm | 060fe2a | 2004-09-10 09:37:12 +0000 | [diff] [blame] | 244 | .tag = -1 /* Ambiguous tag (CHOICE?) */, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 245 | .tag_mode = 0, |
| 246 | .type = (void *)&asn1_DEF_b, |
| 247 | .memb_constraints = 0, /* Defer to actual type */ |
| 248 | .name = "b" |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 249 | }, |
| 250 | }; |
| 251 | static ber_tlv_tag_t asn1_DEF_T_tags[] = { |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 252 | (ASN_TAG_CLASS_PRIVATE | (1 << 2)), |
| 253 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 254 | }; |
| 255 | static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = { |
| 256 | { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */ |
| 257 | { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c at 17 */ |
| 258 | { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */ |
| 259 | { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f at 20 */ |
| 260 | { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */ |
| 261 | { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 }, /* h at 24 */ |
| 262 | }; |
| 263 | static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = { |
| 264 | sizeof(struct T), |
| 265 | offsetof(struct T, _ber_dec_ctx), |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 266 | asn1_DEF_T_tag2el, |
| 267 | 6, /* Count of tags in the map */ |
| 268 | -1, /* Start extensions */ |
| 269 | -1 /* Stop extensions */ |
| 270 | }; |
| 271 | asn1_TYPE_descriptor_t asn1_DEF_T = { |
| 272 | "T", |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 273 | SEQUENCE_free, |
| 274 | SEQUENCE_print, |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 275 | SEQUENCE_constraint, |
| 276 | SEQUENCE_decode_ber, |
| 277 | SEQUENCE_encode_der, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 278 | 0, /* Not implemented yet */ |
| 279 | SEQUENCE_encode_xer, |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 280 | 0, /* Use generic outmost tag fetcher */ |
| 281 | asn1_DEF_T_tags, |
| 282 | sizeof(asn1_DEF_T_tags) |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 283 | /sizeof(asn1_DEF_T_tags[0]) - 1, /* 1 */ |
| 284 | asn1_DEF_T_tags, /* Same as above */ |
| 285 | sizeof(asn1_DEF_T_tags) |
| 286 | /sizeof(asn1_DEF_T_tags[0]), /* 2 */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 287 | asn1_MBR_T, |
| 288 | 2, /* Elements count */ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 289 | &asn1_DEF_T_specs /* Additional specs */ |
| 290 | }; |
| 291 | |