blob: 2590eab1f4739dd60b281976e605b047470d69c3 [file] [log] [blame]
Lev Walkin659c63b2005-01-17 11:40:49 +00001
2/*** <<< INCLUDES [Choice] >>> ***/
3
4#include <INTEGER.h>
Lev Walkin659c63b2005-01-17 11:40:49 +00005#include <constr_CHOICE.h>
6
7/*** <<< DEPS [Choice] >>> ***/
8
9typedef 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 Walkinc8285712005-03-04 22:18:20 +000017/*** <<< FWD-DECLS [Choice] >>> ***/
18
Lev Walkinbf56d542005-03-04 23:50:56 +000019struct Choice;
Lev Walkin659c63b2005-01-17 11:40:49 +000020
21/*** <<< TYPE-DECLS [Choice] >>> ***/
22
Lev Walkin659c63b2005-01-17 11:40:49 +000023typedef struct Choice {
24 Choice_PR present;
Lev Walkin0f5d74c2005-08-14 15:03:31 +000025 union Choice_u {
Lev Walkin659c63b2005-01-17 11:40:49 +000026 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 Walkinc8285712005-03-04 22:18:20 +000039/*** <<< FUNC-DECLS [Choice] >>> ***/
40
41extern asn_TYPE_descriptor_t asn_DEF_Choice;
42
Lev Walkin8eb4b572005-08-16 16:57:17 +000043/*** <<< POST-INCLUDE [Choice] >>> ***/
44
45#include <Choice.h>
46
Lev Walkin659c63b2005-01-17 11:40:49 +000047/*** <<< STAT-DEFS [Choice] >>> ***/
48
Lev Walkine0272aa2005-03-04 11:26:08 +000049static asn_TYPE_member_t asn_MBR_Choice_1[] = {
Lev Walkin659c63b2005-01-17 11:40:49 +000050 { 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 Walkinae7bf3f2005-08-29 10:31:14 +000053 .type = &asn_DEF_INTEGER,
Lev Walkinfb857fd2005-01-17 12:17:41 +000054 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin659c63b2005-01-17 11:40:49 +000055 .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 */
Lev Walkinae7bf3f2005-08-29 10:31:14 +000060 .type = &asn_DEF_INTEGER,
Lev Walkinfb857fd2005-01-17 12:17:41 +000061 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin659c63b2005-01-17 11:40:49 +000062 .name = "b"
63 },
64 { ATF_POINTER, 0, offsetof(struct Choice, choice.c),
65 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
Lev Walkinfb857fd2005-01-17 12:17:41 +000066 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +000067 .type = &asn_DEF_Choice,
Lev Walkinfb857fd2005-01-17 12:17:41 +000068 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin659c63b2005-01-17 11:40:49 +000069 .name = "c"
70 },
71};
Lev Walkine0272aa2005-03-04 11:26:08 +000072static ber_tlv_tag_t asn_DEF_Choice_1_tags[] = {
Lev Walkinfb857fd2005-01-17 12:17:41 +000073 (ASN_TAG_CLASS_CONTEXT | (123 << 2))
74};
Lev Walkine0272aa2005-03-04 11:26:08 +000075static asn_TYPE_tag2member_t asn_MAP_Choice_1_tag2el[] = {
Lev Walkin659c63b2005-01-17 11:40:49 +000076 { (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 */
Lev Walkin4756e5e2005-02-25 08:19:34 +000078 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 19 */
Lev Walkin659c63b2005-01-17 11:40:49 +000079};
Lev Walkine0272aa2005-03-04 11:26:08 +000080static asn_CHOICE_specifics_t asn_SPC_Choice_1_specs = {
Lev Walkin659c63b2005-01-17 11:40:49 +000081 sizeof(struct Choice),
82 offsetof(struct Choice, _asn_ctx),
83 offsetof(struct Choice, present),
84 sizeof(((struct Choice *)0)->present),
Lev Walkine0272aa2005-03-04 11:26:08 +000085 asn_MAP_Choice_1_tag2el,
Lev Walkin659c63b2005-01-17 11:40:49 +000086 3, /* Count of tags in the map */
87 1 /* Whether extensible */
88};
89asn_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,
Lev Walkine0272aa2005-03-04 11:26:08 +0000100 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,
Lev Walkin659c63b2005-01-17 11:40:49 +0000107 3, /* Elements count */
Lev Walkine0272aa2005-03-04 11:26:08 +0000108 &asn_SPC_Choice_1_specs /* Additional specs */
Lev Walkin659c63b2005-01-17 11:40:49 +0000109};
110