vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Choice] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
vlm | 34dcd57 | 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 | |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 17 | /*** <<< FWD-DECLS [Choice] >>> ***/ |
| 18 | |
vlm | 5feb752 | 2005-03-04 23:50:56 +0000 | [diff] [blame] | 19 | struct Choice; |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 20 | |
| 21 | /*** <<< TYPE-DECLS [Choice] >>> ***/ |
| 22 | |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 23 | typedef struct Choice { |
| 24 | Choice_PR present; |
vlm | 2e77428 | 2005-08-14 15:03:31 +0000 | [diff] [blame] | 25 | union Choice_u { |
vlm | 34dcd57 | 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 | |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 39 | /*** <<< FUNC-DECLS [Choice] >>> ***/ |
| 40 | |
| 41 | extern asn_TYPE_descriptor_t asn_DEF_Choice; |
| 42 | |
vlm | 2cebdf3 | 2005-08-16 16:57:17 +0000 | [diff] [blame^] | 43 | /*** <<< POST-INCLUDE [Choice] >>> ***/ |
| 44 | |
| 45 | #include <Choice.h> |
| 46 | |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 47 | /*** <<< STAT-DEFS [Choice] >>> ***/ |
| 48 | |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 49 | static asn_TYPE_member_t asn_MBR_Choice_1[] = { |
vlm | 34dcd57 | 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 */ |
| 53 | .type = (void *)&asn_DEF_INTEGER, |
vlm | 53807eb | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 54 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 55 | .name = "a" |
| 56 | }, |
| 57 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.b), |
| 58 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 59 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 60 | .type = (void *)&asn_DEF_INTEGER, |
vlm | 53807eb | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 61 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 62 | .name = "b" |
| 63 | }, |
| 64 | { ATF_POINTER, 0, offsetof(struct Choice, choice.c), |
| 65 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
vlm | 53807eb | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 66 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 67 | .type = (void *)&asn_DEF_Choice, |
vlm | 53807eb | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 68 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 69 | .name = "c" |
| 70 | }, |
| 71 | }; |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 72 | static ber_tlv_tag_t asn_DEF_Choice_1_tags[] = { |
vlm | 53807eb | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 73 | (ASN_TAG_CLASS_CONTEXT | (123 << 2)) |
| 74 | }; |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 75 | static asn_TYPE_tag2member_t asn_MAP_Choice_1_tag2el[] = { |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 76 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 15 */ |
| 77 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b at 17 */ |
vlm | 7f061a7 | 2005-02-25 08:19:34 +0000 | [diff] [blame] | 78 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 19 */ |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 79 | }; |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 80 | static asn_CHOICE_specifics_t asn_SPC_Choice_1_specs = { |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 81 | sizeof(struct Choice), |
| 82 | offsetof(struct Choice, _asn_ctx), |
| 83 | offsetof(struct Choice, present), |
| 84 | sizeof(((struct Choice *)0)->present), |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 85 | asn_MAP_Choice_1_tag2el, |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 86 | 3, /* Count of tags in the map */ |
| 87 | 1 /* Whether extensible */ |
| 88 | }; |
| 89 | asn_TYPE_descriptor_t asn_DEF_Choice = { |
| 90 | "Choice", |
| 91 | "Choice", |
| 92 | CHOICE_free, |
| 93 | CHOICE_print, |
| 94 | CHOICE_constraint, |
| 95 | CHOICE_decode_ber, |
| 96 | CHOICE_encode_der, |
| 97 | CHOICE_decode_xer, |
| 98 | CHOICE_encode_xer, |
| 99 | CHOICE_outmost_tag, |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 100 | asn_DEF_Choice_1_tags, |
| 101 | sizeof(asn_DEF_Choice_1_tags) |
| 102 | /sizeof(asn_DEF_Choice_1_tags[0]), /* 1 */ |
| 103 | asn_DEF_Choice_1_tags, /* Same as above */ |
| 104 | sizeof(asn_DEF_Choice_1_tags) |
| 105 | /sizeof(asn_DEF_Choice_1_tags[0]), /* 1 */ |
| 106 | asn_MBR_Choice_1, |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 107 | 3, /* Elements count */ |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 108 | &asn_SPC_Choice_1_specs /* Additional specs */ |
vlm | 34dcd57 | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 109 | }; |
| 110 | |