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