blob: 12f7be4bdfefd526751ee7d9a8b529798c1a32f9 [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
Lev Walkinc8285712005-03-04 22:18:20 +000018/*** <<< FWD-DECLS [Choice] >>> ***/
19
Lev Walkin659c63b2005-01-17 11:40:49 +000020struct Choice; /* Forward declaration */
Lev Walkin659c63b2005-01-17 11:40:49 +000021
22/*** <<< TYPE-DECLS [Choice] >>> ***/
23
Lev Walkin659c63b2005-01-17 11:40:49 +000024typedef 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
Lev Walkinc8285712005-03-04 22:18:20 +000040/*** <<< FUNC-DECLS [Choice] >>> ***/
41
42extern asn_TYPE_descriptor_t asn_DEF_Choice;
43
Lev Walkin659c63b2005-01-17 11:40:49 +000044/*** <<< STAT-DEFS [Choice] >>> ***/
45
Lev Walkine0272aa2005-03-04 11:26:08 +000046static asn_TYPE_member_t asn_MBR_Choice_1[] = {
Lev Walkin659c63b2005-01-17 11:40:49 +000047 { 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,
Lev Walkinfb857fd2005-01-17 12:17:41 +000051 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin659c63b2005-01-17 11:40:49 +000052 .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,
Lev Walkinfb857fd2005-01-17 12:17:41 +000058 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin659c63b2005-01-17 11:40:49 +000059 .name = "b"
60 },
61 { ATF_POINTER, 0, offsetof(struct Choice, choice.c),
62 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
Lev Walkinfb857fd2005-01-17 12:17:41 +000063 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin659c63b2005-01-17 11:40:49 +000064 .type = (void *)&asn_DEF_Choice,
Lev Walkinfb857fd2005-01-17 12:17:41 +000065 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin659c63b2005-01-17 11:40:49 +000066 .name = "c"
67 },
68};
Lev Walkine0272aa2005-03-04 11:26:08 +000069static ber_tlv_tag_t asn_DEF_Choice_1_tags[] = {
Lev Walkinfb857fd2005-01-17 12:17:41 +000070 (ASN_TAG_CLASS_CONTEXT | (123 << 2))
71};
Lev Walkine0272aa2005-03-04 11:26:08 +000072static asn_TYPE_tag2member_t asn_MAP_Choice_1_tag2el[] = {
Lev Walkin659c63b2005-01-17 11:40:49 +000073 { (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 */
Lev Walkin4756e5e2005-02-25 08:19:34 +000075 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* c at 19 */
Lev Walkin659c63b2005-01-17 11:40:49 +000076};
Lev Walkine0272aa2005-03-04 11:26:08 +000077static asn_CHOICE_specifics_t asn_SPC_Choice_1_specs = {
Lev Walkin659c63b2005-01-17 11:40:49 +000078 sizeof(struct Choice),
79 offsetof(struct Choice, _asn_ctx),
80 offsetof(struct Choice, present),
81 sizeof(((struct Choice *)0)->present),
Lev Walkine0272aa2005-03-04 11:26:08 +000082 asn_MAP_Choice_1_tag2el,
Lev Walkin659c63b2005-01-17 11:40:49 +000083 3, /* Count of tags in the map */
84 1 /* Whether extensible */
85};
86asn_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,
Lev Walkine0272aa2005-03-04 11:26:08 +000097 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,
Lev Walkin659c63b2005-01-17 11:40:49 +0000104 3, /* Elements count */
Lev Walkine0272aa2005-03-04 11:26:08 +0000105 &asn_SPC_Choice_1_specs /* Additional specs */
Lev Walkin659c63b2005-01-17 11:40:49 +0000106};
107