Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Choice] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 5 | #include <constr_CHOICE.h> |
| 6 | |
| 7 | /*** <<< DEPS [Choice] >>> ***/ |
| 8 | |
| 9 | typedef enum Choice_PR { |
| 10 | Choice_PR_NOTHING, /* No components present */ |
| 11 | Choice_PR_a, |
| 12 | /* Extensions may appear below */ |
| 13 | Choice_PR_b, |
| 14 | Choice_PR_c, |
| 15 | } Choice_PR; |
| 16 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 17 | /*** <<< FWD-DECLS [Choice] >>> ***/ |
| 18 | |
Lev Walkin | bf56d54 | 2005-03-04 23:50:56 +0000 | [diff] [blame] | 19 | struct Choice; |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 20 | |
| 21 | /*** <<< TYPE-DECLS [Choice] >>> ***/ |
| 22 | |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 23 | typedef struct Choice { |
| 24 | Choice_PR present; |
Lev Walkin | 0f5d74c | 2005-08-14 15:03:31 +0000 | [diff] [blame] | 25 | union Choice_u { |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 26 | INTEGER_t a; |
| 27 | /* |
| 28 | * This type is extensible, |
| 29 | * possible extensions are below. |
| 30 | */ |
| 31 | INTEGER_t b; |
| 32 | struct Choice *c; |
| 33 | } choice; |
| 34 | |
| 35 | /* Context for parsing across buffer boundaries */ |
| 36 | asn_struct_ctx_t _asn_ctx; |
| 37 | } Choice_t; |
| 38 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 39 | /*** <<< FUNC-DECLS [Choice] >>> ***/ |
| 40 | |
| 41 | extern asn_TYPE_descriptor_t asn_DEF_Choice; |
| 42 | |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 43 | /*** <<< POST-INCLUDE [Choice] >>> ***/ |
| 44 | |
| 45 | #include <Choice.h> |
| 46 | |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 47 | /*** <<< STAT-DEFS [Choice] >>> ***/ |
| 48 | |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 49 | static asn_TYPE_member_t asn_MBR_Choice_1[] = { |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 50 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.a), |
| 51 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 52 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 53 | .type = &asn_DEF_INTEGER, |
Lev Walkin | fb857fd | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 54 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 55 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 56 | .default_value = 0, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 57 | .name = "a" |
| 58 | }, |
| 59 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.b), |
| 60 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 61 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 62 | .type = &asn_DEF_INTEGER, |
Lev Walkin | fb857fd | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 63 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 64 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 65 | .default_value = 0, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 66 | .name = "b" |
| 67 | }, |
| 68 | { ATF_POINTER, 0, offsetof(struct Choice, choice.c), |
| 69 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
Lev Walkin | fb857fd | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 70 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 71 | .type = &asn_DEF_Choice, |
Lev Walkin | fb857fd | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 72 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 73 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 74 | .default_value = 0, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 75 | .name = "c" |
| 76 | }, |
| 77 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 78 | static ber_tlv_tag_t asn_DEF_Choice_tags_1[] = { |
Lev Walkin | fb857fd | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 79 | (ASN_TAG_CLASS_CONTEXT | (123 << 2)) |
| 80 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 81 | static asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 82 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 15 */ |
| 83 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b at 17 */ |
Lev Walkin | 4756e5e | 2005-02-25 08:19:34 +0000 | [diff] [blame] | 84 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 19 */ |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 85 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 86 | static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 87 | sizeof(struct Choice), |
| 88 | offsetof(struct Choice, _asn_ctx), |
| 89 | offsetof(struct Choice, present), |
| 90 | sizeof(((struct Choice *)0)->present), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 91 | asn_MAP_Choice_tag2el_1, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 92 | 3, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 93 | .canonical_order = 0, |
| 94 | .ext_start = 1 /* Extensions start */ |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 95 | }; |
| 96 | asn_TYPE_descriptor_t asn_DEF_Choice = { |
| 97 | "Choice", |
| 98 | "Choice", |
| 99 | CHOICE_free, |
| 100 | CHOICE_print, |
| 101 | CHOICE_constraint, |
| 102 | CHOICE_decode_ber, |
| 103 | CHOICE_encode_der, |
| 104 | CHOICE_decode_xer, |
| 105 | CHOICE_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 106 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 107 | CHOICE_outmost_tag, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 108 | asn_DEF_Choice_tags_1, |
| 109 | sizeof(asn_DEF_Choice_tags_1) |
| 110 | /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */ |
| 111 | asn_DEF_Choice_tags_1, /* Same as above */ |
| 112 | sizeof(asn_DEF_Choice_tags_1) |
| 113 | /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */ |
| 114 | 0, /* No PER visible constraints */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 115 | asn_MBR_Choice_1, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 116 | 3, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 117 | &asn_SPC_Choice_specs_1 /* Additional specs */ |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 118 | }; |
| 119 | |