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, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 14 | Choice_PR_c |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 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; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 42 | extern asn_CHOICE_specifics_t asn_SPC_Choice_specs_1; |
| 43 | extern asn_TYPE_member_t asn_MBR_Choice_1[3]; |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 44 | |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 45 | /*** <<< POST-INCLUDE [Choice] >>> ***/ |
| 46 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 47 | #include "Choice.h" |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 48 | |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 49 | /*** <<< STAT-DEFS [Choice] >>> ***/ |
| 50 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 51 | asn_TYPE_member_t asn_MBR_Choice_1[] = { |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 52 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.a), |
| 53 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 54 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 55 | .type = &asn_DEF_INTEGER, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 56 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 57 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 58 | .default_value = 0, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 59 | .name = "a" |
| 60 | }, |
| 61 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.b), |
| 62 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 63 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 64 | .type = &asn_DEF_INTEGER, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 65 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 66 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 67 | .default_value = 0, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 68 | .name = "b" |
| 69 | }, |
| 70 | { ATF_POINTER, 0, offsetof(struct Choice, choice.c), |
| 71 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
Lev Walkin | fb857fd | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 72 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 73 | .type = &asn_DEF_Choice, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 74 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 75 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 76 | .default_value = 0, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 77 | .name = "c" |
| 78 | }, |
| 79 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 80 | static const ber_tlv_tag_t asn_DEF_Choice_tags_1[] = { |
Lev Walkin | fb857fd | 2005-01-17 12:17:41 +0000 | [diff] [blame] | 81 | (ASN_TAG_CLASS_CONTEXT | (123 << 2)) |
| 82 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 83 | static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 84 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */ |
| 85 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b */ |
| 86 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c */ |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 87 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 88 | asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 89 | sizeof(struct Choice), |
| 90 | offsetof(struct Choice, _asn_ctx), |
| 91 | offsetof(struct Choice, present), |
| 92 | sizeof(((struct Choice *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 93 | .tag2el = asn_MAP_Choice_tag2el_1, |
| 94 | .tag2el_count = 3, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 95 | .canonical_order = 0, |
| 96 | .ext_start = 1 /* Extensions start */ |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 97 | }; |
| 98 | asn_TYPE_descriptor_t asn_DEF_Choice = { |
| 99 | "Choice", |
| 100 | "Choice", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 101 | &asn_OP_CHOICE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 102 | asn_DEF_Choice_tags_1, |
| 103 | sizeof(asn_DEF_Choice_tags_1) |
| 104 | /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */ |
| 105 | asn_DEF_Choice_tags_1, /* Same as above */ |
| 106 | sizeof(asn_DEF_Choice_tags_1) |
| 107 | /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 108 | { 0, 0, CHOICE_constraint }, |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 109 | asn_MBR_Choice_1, |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 110 | 3, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 111 | &asn_SPC_Choice_specs_1 /* Additional specs */ |
Lev Walkin | 659c63b | 2005-01-17 11:40:49 +0000 | [diff] [blame] | 112 | }; |
| 113 | |