blob: 942d9f5b116431531e3010295347c99dcecb07e5 [file] [log] [blame]
Lev Walkin659c63b2005-01-17 11:40:49 +00001
2/*** <<< INCLUDES [Choice] >>> ***/
3
4#include <INTEGER.h>
5#include <Choice.h>
6#include <constr_CHOICE.h>
7
8/*** <<< DEPS [Choice] >>> ***/
9
10typedef 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
18struct Choice; /* Forward declaration */
19extern asn_TYPE_descriptor_t asn_DEF_Choice;
20
21/*** <<< TYPE-DECLS [Choice] >>> ***/
22
23
24typedef 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
40/*** <<< STAT-DEFS [Choice] >>> ***/
41
42static asn_TYPE_member_t asn_MBR_Choice[] = {
43 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.a),
44 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
45 .tag_mode = -1, /* IMPLICIT tag at current level */
46 .type = (void *)&asn_DEF_INTEGER,
Lev Walkinfb857fd2005-01-17 12:17:41 +000047 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin659c63b2005-01-17 11:40:49 +000048 .name = "a"
49 },
50 { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.b),
51 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
52 .tag_mode = -1, /* IMPLICIT tag at current level */
53 .type = (void *)&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 = "b"
56 },
57 { ATF_POINTER, 0, offsetof(struct Choice, choice.c),
58 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
Lev Walkinfb857fd2005-01-17 12:17:41 +000059 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin659c63b2005-01-17 11:40:49 +000060 .type = (void *)&asn_DEF_Choice,
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 = "c"
63 },
64};
Lev Walkinfb857fd2005-01-17 12:17:41 +000065static ber_tlv_tag_t asn_DEF_Choice_tags[] = {
66 (ASN_TAG_CLASS_CONTEXT | (123 << 2))
67};
Lev Walkin659c63b2005-01-17 11:40:49 +000068static asn_TYPE_tag2member_t asn_DEF_Choice_tag2el[] = {
69 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a at 15 */
70 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b at 17 */
71 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* c at 19 */
72};
73static asn_CHOICE_specifics_t asn_DEF_Choice_specs = {
74 sizeof(struct Choice),
75 offsetof(struct Choice, _asn_ctx),
76 offsetof(struct Choice, present),
77 sizeof(((struct Choice *)0)->present),
78 asn_DEF_Choice_tag2el,
79 3, /* Count of tags in the map */
80 1 /* Whether extensible */
81};
82asn_TYPE_descriptor_t asn_DEF_Choice = {
83 "Choice",
84 "Choice",
85 CHOICE_free,
86 CHOICE_print,
87 CHOICE_constraint,
88 CHOICE_decode_ber,
89 CHOICE_encode_der,
90 CHOICE_decode_xer,
91 CHOICE_encode_xer,
92 CHOICE_outmost_tag,
Lev Walkinfb857fd2005-01-17 12:17:41 +000093 asn_DEF_Choice_tags,
94 sizeof(asn_DEF_Choice_tags)
95 /sizeof(asn_DEF_Choice_tags[0]), /* 1 */
96 asn_DEF_Choice_tags, /* Same as above */
97 sizeof(asn_DEF_Choice_tags)
98 /sizeof(asn_DEF_Choice_tags[0]), /* 1 */
Lev Walkin659c63b2005-01-17 11:40:49 +000099 asn_MBR_Choice,
100 3, /* Elements count */
101 &asn_DEF_Choice_specs /* Additional specs */
102};
103