vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Test-structure-1] >>> ***/ |
| 3 | |
| 4 | #include <Test-structure-1.h> |
| 5 | #include <INTEGER.h> |
| 6 | #include <asn_SET_OF.h> |
| 7 | #include <constr_SET_OF.h> |
| 8 | #include <asn_SEQUENCE_OF.h> |
| 9 | #include <constr_SEQUENCE_OF.h> |
| 10 | #include <constr_SEQUENCE.h> |
| 11 | |
| 12 | /*** <<< DEPS [Test-structure-1] >>> ***/ |
| 13 | |
| 14 | extern asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1; |
| 15 | |
| 16 | /*** <<< TYPE-DECLS [Test-structure-1] >>> ***/ |
| 17 | |
| 18 | |
| 19 | typedef struct Test_structure_1 { |
| 20 | struct t_member1 { |
| 21 | A_SET_OF(struct Test_structure_1) list; |
| 22 | |
| 23 | /* Context for parsing across buffer boundaries */ |
| 24 | ber_dec_ctx_t _ber_dec_ctx; |
| 25 | } t_member1; |
| 26 | struct t_member2 { |
| 27 | A_SEQUENCE_OF(struct Test_structure_1) list; |
| 28 | |
| 29 | /* Context for parsing across buffer boundaries */ |
| 30 | ber_dec_ctx_t _ber_dec_ctx; |
| 31 | } t_member2; |
| 32 | struct Test_structure_1 *t_member3 /* OPTIONAL */; |
| 33 | INTEGER_t t_member4; |
| 34 | |
| 35 | /* Context for parsing across buffer boundaries */ |
| 36 | ber_dec_ctx_t _ber_dec_ctx; |
| 37 | } Test_structure_1_t; |
| 38 | |
| 39 | /*** <<< STAT-DEFS [Test-structure-1] >>> ***/ |
| 40 | |
| 41 | static asn1_TYPE_member_t asn1_MBR_t_member1[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 42 | { ATF_NOFLAGS, 0, 0, |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 43 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 44 | .tag_mode = 0, |
| 45 | .type = (void *)&asn1_DEF_Test_structure_1, |
| 46 | .memb_constraints = 0, /* Defer to actual type */ |
| 47 | .name = "" |
| 48 | }, |
| 49 | }; |
| 50 | static ber_tlv_tag_t asn1_DEF_t_member1_tags[] = { |
| 51 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 52 | }; |
| 53 | static asn1_SET_OF_specifics_t asn1_DEF_t_member1_specs = { |
| 54 | sizeof(struct t_member1), |
| 55 | offsetof(struct t_member1, _ber_dec_ctx), |
| 56 | }; |
| 57 | static /* Use -fall-defs-global to expose */ |
| 58 | asn1_TYPE_descriptor_t asn1_DEF_t_member1 = { |
| 59 | "t-member1", |
| 60 | SET_OF_constraint, |
| 61 | SET_OF_decode_ber, |
| 62 | SET_OF_encode_der, |
| 63 | SET_OF_print, |
| 64 | SET_OF_free, |
| 65 | 0, /* Use generic outmost tag fetcher */ |
| 66 | asn1_DEF_t_member1_tags, |
| 67 | sizeof(asn1_DEF_t_member1_tags) |
| 68 | /sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */ |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 69 | asn1_DEF_t_member1_tags, /* Same as above */ |
| 70 | sizeof(asn1_DEF_t_member1_tags) |
| 71 | /sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */ |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 72 | 1, /* Whether CONSTRUCTED */ |
| 73 | asn1_MBR_t_member1, |
| 74 | 1, /* Single element */ |
| 75 | &asn1_DEF_t_member1_specs /* Additional specs */ |
| 76 | }; |
| 77 | |
| 78 | static asn1_TYPE_member_t asn1_MBR_t_member2[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 79 | { ATF_NOFLAGS, 0, 0, |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 80 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 81 | .tag_mode = 0, |
| 82 | .type = (void *)&asn1_DEF_Test_structure_1, |
| 83 | .memb_constraints = 0, /* Defer to actual type */ |
| 84 | .name = "" |
| 85 | }, |
| 86 | }; |
| 87 | static ber_tlv_tag_t asn1_DEF_t_member2_tags[] = { |
| 88 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 89 | }; |
| 90 | static asn1_SET_OF_specifics_t asn1_DEF_t_member2_specs = { |
| 91 | sizeof(struct t_member2), |
| 92 | offsetof(struct t_member2, _ber_dec_ctx), |
| 93 | }; |
| 94 | static /* Use -fall-defs-global to expose */ |
| 95 | asn1_TYPE_descriptor_t asn1_DEF_t_member2 = { |
| 96 | "t-member2", |
| 97 | SEQUENCE_OF_constraint, |
| 98 | SEQUENCE_OF_decode_ber, |
| 99 | SEQUENCE_OF_encode_der, |
| 100 | SEQUENCE_OF_print, |
| 101 | SEQUENCE_OF_free, |
| 102 | 0, /* Use generic outmost tag fetcher */ |
| 103 | asn1_DEF_t_member2_tags, |
| 104 | sizeof(asn1_DEF_t_member2_tags) |
| 105 | /sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */ |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 106 | asn1_DEF_t_member2_tags, /* Same as above */ |
| 107 | sizeof(asn1_DEF_t_member2_tags) |
| 108 | /sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */ |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 109 | 1, /* Whether CONSTRUCTED */ |
| 110 | asn1_MBR_t_member2, |
| 111 | 1, /* Single element */ |
| 112 | &asn1_DEF_t_member2_specs /* Additional specs */ |
| 113 | }; |
| 114 | |
| 115 | static asn1_TYPE_member_t asn1_MBR_Test_structure_1[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 116 | { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member1), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 117 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 118 | .tag_mode = 0, |
| 119 | .type = (void *)&asn1_DEF_t_member1, |
| 120 | .memb_constraints = 0, /* Defer to actual type */ |
| 121 | .name = "t-member1" |
| 122 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 123 | { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member2), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 124 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 125 | .tag_mode = 0, |
| 126 | .type = (void *)&asn1_DEF_t_member2, |
| 127 | .memb_constraints = 0, /* Defer to actual type */ |
| 128 | .name = "t-member2" |
| 129 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 130 | { ATF_POINTER, 1, offsetof(struct Test_structure_1, t_member3), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 131 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 132 | .tag_mode = 0, |
| 133 | .type = (void *)&asn1_DEF_Test_structure_1, |
| 134 | .memb_constraints = 0, /* Defer to actual type */ |
| 135 | .name = "t-member3" |
| 136 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 137 | { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member4), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 138 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 139 | .tag_mode = 0, |
| 140 | .type = (void *)&asn1_DEF_INTEGER, |
| 141 | .memb_constraints = 0, /* Defer to actual type */ |
| 142 | .name = "t-member4" |
| 143 | }, |
| 144 | }; |
| 145 | static ber_tlv_tag_t asn1_DEF_Test_structure_1_tags[] = { |
| 146 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 147 | }; |
| 148 | static asn1_TYPE_tag2member_t asn1_DEF_Test_structure_1_tag2el[] = { |
| 149 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* t-member4 at 19 */ |
| 150 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 1 }, /* t-member2 at 16 */ |
| 151 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 }, /* t-member3 at 17 */ |
| 152 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 }, /* t-member1 at 15 */ |
| 153 | }; |
| 154 | static asn1_SEQUENCE_specifics_t asn1_DEF_Test_structure_1_specs = { |
| 155 | sizeof(struct Test_structure_1), |
| 156 | offsetof(struct Test_structure_1, _ber_dec_ctx), |
| 157 | asn1_DEF_Test_structure_1_tag2el, |
| 158 | 4, /* Count of tags in the map */ |
| 159 | -1, /* Start extensions */ |
| 160 | -1 /* Stop extensions */ |
| 161 | }; |
| 162 | asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1 = { |
| 163 | "Test-structure-1", |
| 164 | SEQUENCE_constraint, |
| 165 | SEQUENCE_decode_ber, |
| 166 | SEQUENCE_encode_der, |
| 167 | SEQUENCE_print, |
| 168 | SEQUENCE_free, |
| 169 | 0, /* Use generic outmost tag fetcher */ |
| 170 | asn1_DEF_Test_structure_1_tags, |
| 171 | sizeof(asn1_DEF_Test_structure_1_tags) |
| 172 | /sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */ |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 173 | asn1_DEF_Test_structure_1_tags, /* Same as above */ |
| 174 | sizeof(asn1_DEF_Test_structure_1_tags) |
| 175 | /sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */ |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 176 | 1, /* Whether CONSTRUCTED */ |
| 177 | asn1_MBR_Test_structure_1, |
| 178 | 4, /* Elements count */ |
| 179 | &asn1_DEF_Test_structure_1_specs /* Additional specs */ |
| 180 | }; |
| 181 | |
| 182 | |
| 183 | /*** <<< INCLUDES [Choice-1] >>> ***/ |
| 184 | |
| 185 | #include <Choice-1.h> |
| 186 | #include <INTEGER.h> |
| 187 | #include <asn_SET_OF.h> |
| 188 | #include <constr_SET_OF.h> |
| 189 | #include <constr_CHOICE.h> |
| 190 | |
| 191 | /*** <<< DEPS [Choice-1] >>> ***/ |
| 192 | |
| 193 | typedef enum Choice_1_PR { |
| 194 | Choice_1_PR_NOTHING, /* No components present */ |
| 195 | Choice_1_PR_and, |
| 196 | Choice_1_PR_or, |
| 197 | Choice_1_PR_not, |
| 198 | Choice_1_PR_other, |
| 199 | } Choice_1_PR; |
| 200 | extern asn1_TYPE_descriptor_t asn1_DEF_Choice_1; |
| 201 | |
| 202 | /*** <<< TYPE-DECLS [Choice-1] >>> ***/ |
| 203 | |
| 204 | |
| 205 | typedef struct Choice_1 { |
| 206 | Choice_1_PR present; |
| 207 | union { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 208 | struct Choice_1 *and; |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 209 | struct or { |
| 210 | A_SET_OF(struct Choice_1) list; |
| 211 | |
| 212 | /* Context for parsing across buffer boundaries */ |
| 213 | ber_dec_ctx_t _ber_dec_ctx; |
| 214 | } or; |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 215 | struct Choice_1 *not; |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 216 | INTEGER_t other; |
| 217 | } choice; |
| 218 | |
| 219 | /* Context for parsing across buffer boundaries */ |
| 220 | ber_dec_ctx_t _ber_dec_ctx; |
| 221 | } Choice_1_t; |
| 222 | |
| 223 | /*** <<< STAT-DEFS [Choice-1] >>> ***/ |
| 224 | |
| 225 | static asn1_TYPE_member_t asn1_MBR_or[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 226 | { ATF_NOFLAGS, 0, 0, |
vlm | 060fe2a | 2004-09-10 09:37:12 +0000 | [diff] [blame] | 227 | .tag = -1 /* Ambiguous tag (CHOICE?) */, |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 228 | .tag_mode = 0, |
| 229 | .type = (void *)&asn1_DEF_Choice_1, |
| 230 | .memb_constraints = 0, /* Defer to actual type */ |
| 231 | .name = "" |
| 232 | }, |
| 233 | }; |
| 234 | static ber_tlv_tag_t asn1_DEF_or_tags[] = { |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 235 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 236 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 237 | }; |
| 238 | static asn1_SET_OF_specifics_t asn1_DEF_or_specs = { |
| 239 | sizeof(struct or), |
| 240 | offsetof(struct or, _ber_dec_ctx), |
| 241 | }; |
| 242 | static /* Use -fall-defs-global to expose */ |
| 243 | asn1_TYPE_descriptor_t asn1_DEF_or = { |
| 244 | "or", |
| 245 | SET_OF_constraint, |
| 246 | SET_OF_decode_ber, |
| 247 | SET_OF_encode_der, |
| 248 | SET_OF_print, |
| 249 | SET_OF_free, |
| 250 | 0, /* Use generic outmost tag fetcher */ |
| 251 | asn1_DEF_or_tags, |
| 252 | sizeof(asn1_DEF_or_tags) |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 253 | /sizeof(asn1_DEF_or_tags[0]) - 1, /* 1 */ |
| 254 | asn1_DEF_or_tags, /* Same as above */ |
| 255 | sizeof(asn1_DEF_or_tags) |
| 256 | /sizeof(asn1_DEF_or_tags[0]), /* 2 */ |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 257 | 1, /* Whether CONSTRUCTED */ |
| 258 | asn1_MBR_or, |
| 259 | 1, /* Single element */ |
| 260 | &asn1_DEF_or_specs /* Additional specs */ |
| 261 | }; |
| 262 | |
| 263 | static asn1_TYPE_member_t asn1_MBR_Choice_1[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 264 | { ATF_POINTER, 0, offsetof(struct Choice_1, choice.and), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 265 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 266 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 267 | .type = (void *)&asn1_DEF_Choice_1, |
| 268 | .memb_constraints = 0, /* Defer to actual type */ |
| 269 | .name = "and" |
| 270 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 271 | { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.or), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 272 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 273 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 274 | .type = (void *)&asn1_DEF_or, |
| 275 | .memb_constraints = 0, /* Defer to actual type */ |
| 276 | .name = "or" |
| 277 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 278 | { ATF_POINTER, 0, offsetof(struct Choice_1, choice.not), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 279 | .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), |
| 280 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 281 | .type = (void *)&asn1_DEF_Choice_1, |
| 282 | .memb_constraints = 0, /* Defer to actual type */ |
| 283 | .name = "not" |
| 284 | }, |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 285 | { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.other), |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 286 | .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), |
| 287 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 288 | .type = (void *)&asn1_DEF_INTEGER, |
| 289 | .memb_constraints = 0, /* Defer to actual type */ |
| 290 | .name = "other" |
| 291 | }, |
| 292 | }; |
| 293 | static asn1_TYPE_tag2member_t asn1_DEF_Choice_1_tag2el[] = { |
| 294 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* and at 22 */ |
| 295 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* or at 23 */ |
| 296 | { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* not at 24 */ |
| 297 | { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 }, /* other at 26 */ |
| 298 | }; |
| 299 | static asn1_CHOICE_specifics_t asn1_DEF_Choice_1_specs = { |
| 300 | sizeof(struct Choice_1), |
| 301 | offsetof(struct Choice_1, _ber_dec_ctx), |
| 302 | offsetof(struct Choice_1, present), |
| 303 | sizeof(((struct Choice_1 *)0)->present), |
| 304 | asn1_DEF_Choice_1_tag2el, |
| 305 | 4, /* Count of tags in the map */ |
| 306 | 0 /* Whether extensible */ |
| 307 | }; |
| 308 | asn1_TYPE_descriptor_t asn1_DEF_Choice_1 = { |
| 309 | "Choice-1", |
| 310 | CHOICE_constraint, |
| 311 | CHOICE_decode_ber, |
| 312 | CHOICE_encode_der, |
| 313 | CHOICE_print, |
| 314 | CHOICE_free, |
| 315 | CHOICE_outmost_tag, |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 316 | 0, /* No effective tags (pointer) */ |
| 317 | 0, /* No effective tags (count) */ |
| 318 | 0, /* No tags (pointer) */ |
| 319 | 0, /* No tags (count) */ |
vlm | b71a9d3 | 2004-09-08 00:26:56 +0000 | [diff] [blame] | 320 | 1, /* Whether CONSTRUCTED */ |
| 321 | asn1_MBR_Choice_1, |
| 322 | 4, /* Elements count */ |
| 323 | &asn1_DEF_Choice_1_specs /* Additional specs */ |
| 324 | }; |
| 325 | |