asn1c/tests/44-choice-in-sequence-OK.as...

348 lines
10 KiB
Plaintext
Raw Normal View History

2004-06-28 21:13:22 +00:00
2004-08-11 05:25:47 +00:00
/*** <<< INCLUDES [T] >>> ***/
2004-06-28 21:13:22 +00:00
#include <NULL.h>
2004-08-11 05:25:47 +00:00
#include <constr_CHOICE.h>
2004-06-28 21:13:22 +00:00
#include <constr_SEQUENCE.h>
2004-08-11 05:25:47 +00:00
/*** <<< DEPS [T] >>> ***/
2004-08-20 13:36:32 +00:00
typedef enum b_PR {
b_PR_NOTHING, /* No components present */
b_PR_c,
b_PR_d,
b_PR_e,
2006-08-18 01:46:46 +00:00
b_PR_h
2004-08-20 13:36:32 +00:00
} b_PR;
typedef enum e_PR {
e_PR_NOTHING, /* No components present */
e_PR_f,
2006-08-18 01:46:46 +00:00
e_PR_g
2004-08-20 13:36:32 +00:00
} e_PR;
typedef enum h_PR {
h_PR_NOTHING, /* No components present */
h_PR_i,
2006-08-18 01:46:46 +00:00
h_PR_j
2004-08-20 13:36:32 +00:00
} h_PR;
2004-06-28 21:13:22 +00:00
/*** <<< TYPE-DECLS [T] >>> ***/
typedef struct T {
NULL_t a;
struct b {
2004-08-11 07:17:22 +00:00
b_PR present;
2005-08-14 15:03:31 +00:00
union T__b_u {
2004-06-28 21:13:22 +00:00
NULL_t c;
NULL_t d;
struct e {
2004-08-11 07:17:22 +00:00
e_PR present;
2005-08-14 15:03:31 +00:00
union T__b__e_u {
2004-06-28 21:13:22 +00:00
NULL_t f;
NULL_t g;
} choice;
/* Context for parsing across buffer boundaries */
2004-09-29 13:19:37 +00:00
asn_struct_ctx_t _asn_ctx;
2004-06-28 21:13:22 +00:00
} e;
struct h {
2004-08-11 07:17:22 +00:00
h_PR present;
2005-08-14 15:03:31 +00:00
union T__b__h_u {
2004-06-28 21:13:22 +00:00
NULL_t i;
NULL_t j;
} choice;
/* Context for parsing across buffer boundaries */
2004-09-29 13:19:37 +00:00
asn_struct_ctx_t _asn_ctx;
2004-06-28 21:13:22 +00:00
} h;
} choice;
/* Context for parsing across buffer boundaries */
2004-09-29 13:19:37 +00:00
asn_struct_ctx_t _asn_ctx;
2004-06-28 21:13:22 +00:00
} b;
/* Context for parsing across buffer boundaries */
2004-09-29 13:19:37 +00:00
asn_struct_ctx_t _asn_ctx;
2004-06-28 21:13:22 +00:00
} T_t;
/*** <<< FUNC-DECLS [T] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_T;
2004-06-28 21:13:22 +00:00
/*** <<< STAT-DEFS [T] >>> ***/
static asn_TYPE_member_t asn_MBR_e_6[] = {
{ ATF_NOFLAGS, 0, offsetof(struct e, choice.f),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (7 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NULL,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "f"
2004-06-28 21:13:22 +00:00
},
{ ATF_NOFLAGS, 0, offsetof(struct e, choice.g),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (8 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NULL,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "g"
},
};
2014-10-13 01:37:35 +00:00
static const asn_TYPE_tag2member_t asn_MAP_e_tag2el_6[] = {
2013-10-11 21:29:38 +00:00
{ (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f */
{ (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 } /* g */
2004-08-20 13:36:32 +00:00
};
2005-11-26 11:25:14 +00:00
static asn_CHOICE_specifics_t asn_SPC_e_specs_6 = {
2004-08-20 13:36:32 +00:00
sizeof(struct e),
2004-09-29 13:19:37 +00:00
offsetof(struct e, _asn_ctx),
2004-08-20 13:36:32 +00:00
offsetof(struct e, present),
sizeof(((struct e *)0)->present),
2005-11-26 11:25:14 +00:00
asn_MAP_e_tag2el_6,
2004-08-20 13:36:32 +00:00
2, /* Count of tags in the map */
2005-11-26 11:25:14 +00:00
.canonical_order = 0,
.ext_start = -1 /* Extensions start */
2004-08-20 13:36:32 +00:00
};
2004-09-07 06:44:29 +00:00
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_e_6 = {
2004-10-20 15:50:55 +00:00
"e",
2004-08-20 13:36:32 +00:00
"e",
2004-09-22 16:06:28 +00:00
CHOICE_free,
CHOICE_print,
2004-08-20 13:36:32 +00:00
CHOICE_constraint,
CHOICE_decode_ber,
CHOICE_encode_der,
2004-10-23 15:07:45 +00:00
CHOICE_decode_xer,
2004-09-22 16:06:28 +00:00
CHOICE_encode_xer,
2017-07-06 14:52:39 +00:00
0, 0, /* No OER support, use "-gen-OER" to enable */
2017-07-14 10:59:52 +00:00
0, 0, /* No PER support, use "-gen-PER" to enable */
2004-08-20 13:36:32 +00:00
CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
2017-07-14 10:59:52 +00:00
0, /* No OER visible constraints */
2005-11-26 11:25:14 +00:00
0, /* No PER visible constraints */
asn_MBR_e_6,
2004-08-20 13:36:32 +00:00
2, /* Elements count */
2005-11-26 11:25:14 +00:00
&asn_SPC_e_specs_6 /* Additional specs */
2004-08-20 13:36:32 +00:00
};
static asn_TYPE_member_t asn_MBR_h_9[] = {
{ ATF_NOFLAGS, 0, offsetof(struct h, choice.i),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NULL,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "i"
},
{ ATF_NOFLAGS, 0, offsetof(struct h, choice.j),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NULL,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "j"
},
};
2014-10-13 01:37:35 +00:00
static const asn_TYPE_tag2member_t asn_MAP_h_tag2el_9[] = {
2013-10-11 21:29:38 +00:00
{ (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i */
{ (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 } /* j */
2004-08-20 13:36:32 +00:00
};
2005-11-26 11:25:14 +00:00
static asn_CHOICE_specifics_t asn_SPC_h_specs_9 = {
2004-08-20 13:36:32 +00:00
sizeof(struct h),
2004-09-29 13:19:37 +00:00
offsetof(struct h, _asn_ctx),
2004-08-20 13:36:32 +00:00
offsetof(struct h, present),
sizeof(((struct h *)0)->present),
2005-11-26 11:25:14 +00:00
asn_MAP_h_tag2el_9,
2004-08-20 13:36:32 +00:00
2, /* Count of tags in the map */
2005-11-26 11:25:14 +00:00
.canonical_order = 0,
.ext_start = -1 /* Extensions start */
2004-08-20 13:36:32 +00:00
};
2004-09-07 06:44:29 +00:00
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_h_9 = {
2004-10-20 15:50:55 +00:00
"h",
2004-08-20 13:36:32 +00:00
"h",
2004-09-22 16:06:28 +00:00
CHOICE_free,
CHOICE_print,
2004-08-20 13:36:32 +00:00
CHOICE_constraint,
CHOICE_decode_ber,
CHOICE_encode_der,
2004-10-23 15:07:45 +00:00
CHOICE_decode_xer,
2004-09-22 16:06:28 +00:00
CHOICE_encode_xer,
2017-07-06 14:52:39 +00:00
0, 0, /* No OER support, use "-gen-OER" to enable */
2017-07-14 10:59:52 +00:00
0, 0, /* No PER support, use "-gen-PER" to enable */
2004-08-20 13:36:32 +00:00
CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
2017-07-14 10:59:52 +00:00
0, /* No OER visible constraints */
2005-11-26 11:25:14 +00:00
0, /* No PER visible constraints */
asn_MBR_h_9,
2004-08-20 13:36:32 +00:00
2, /* Elements count */
2005-11-26 11:25:14 +00:00
&asn_SPC_h_specs_9 /* Additional specs */
2004-08-20 13:36:32 +00:00
};
static asn_TYPE_member_t asn_MBR_b_3[] = {
{ ATF_NOFLAGS, 0, offsetof(struct b, choice.c),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NULL,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "c"
},
{ ATF_NOFLAGS, 0, offsetof(struct b, choice.d),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NULL,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "d"
},
{ ATF_NOFLAGS, 0, offsetof(struct b, choice.e),
2004-09-10 09:37:12 +00:00
.tag = -1 /* Ambiguous tag (CHOICE?) */,
2004-08-20 13:36:32 +00:00
.tag_mode = 0,
.type = &asn_DEF_e_6,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "e"
},
{ ATF_NOFLAGS, 0, offsetof(struct b, choice.h),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
.tag_mode = +1, /* EXPLICIT tag at current level */
.type = &asn_DEF_h_9,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "h"
},
};
2014-10-13 01:37:35 +00:00
static const asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = {
2013-10-11 21:29:38 +00:00
{ (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c */
{ (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d */
{ (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f */
{ (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g */
{ (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 } /* h */
2004-08-20 13:36:32 +00:00
};
2005-11-26 11:25:14 +00:00
static asn_CHOICE_specifics_t asn_SPC_b_specs_3 = {
2004-08-20 13:36:32 +00:00
sizeof(struct b),
2004-09-29 13:19:37 +00:00
offsetof(struct b, _asn_ctx),
2004-08-20 13:36:32 +00:00
offsetof(struct b, present),
sizeof(((struct b *)0)->present),
2005-11-26 11:25:14 +00:00
asn_MAP_b_tag2el_3,
2004-08-20 13:36:32 +00:00
5, /* Count of tags in the map */
2005-11-26 11:25:14 +00:00
.canonical_order = 0,
.ext_start = -1 /* Extensions start */
2004-08-20 13:36:32 +00:00
};
2004-09-07 06:44:29 +00:00
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_b_3 = {
2004-10-20 15:50:55 +00:00
"b",
2004-08-20 13:36:32 +00:00
"b",
2004-09-22 16:06:28 +00:00
CHOICE_free,
CHOICE_print,
2004-08-20 13:36:32 +00:00
CHOICE_constraint,
CHOICE_decode_ber,
CHOICE_encode_der,
2004-10-23 15:07:45 +00:00
CHOICE_decode_xer,
2004-09-22 16:06:28 +00:00
CHOICE_encode_xer,
2017-07-06 14:52:39 +00:00
0, 0, /* No OER support, use "-gen-OER" to enable */
2017-07-14 10:59:52 +00:00
0, 0, /* No PER support, use "-gen-PER" to enable */
2004-08-20 13:36:32 +00:00
CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
2017-07-14 10:59:52 +00:00
0, /* No OER visible constraints */
2005-11-26 11:25:14 +00:00
0, /* No PER visible constraints */
asn_MBR_b_3,
2004-08-20 13:36:32 +00:00
4, /* Elements count */
2005-11-26 11:25:14 +00:00
&asn_SPC_b_specs_3 /* Additional specs */
2004-08-20 13:36:32 +00:00
};
2005-03-04 11:26:08 +00:00
static asn_TYPE_member_t asn_MBR_T_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct T, a),
2004-08-20 13:36:32 +00:00
.tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NULL,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "a"
},
{ ATF_NOFLAGS, 0, offsetof(struct T, b),
2004-09-10 09:37:12 +00:00
.tag = -1 /* Ambiguous tag (CHOICE?) */,
2004-08-20 13:36:32 +00:00
.tag_mode = 0,
.type = &asn_DEF_b_3,
2005-01-17 12:20:19 +00:00
.memb_constraints = 0, /* Defer constraints checking to the member type */
2017-07-14 10:59:52 +00:00
.oer_constraints = 0, /* OER is not compiled, use -gen-OER */
2005-11-26 11:25:14 +00:00
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
2004-08-20 13:36:32 +00:00
.name = "b"
2004-06-28 21:13:22 +00:00
},
};
2014-10-13 01:37:35 +00:00
static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
(ASN_TAG_CLASS_PRIVATE | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2004-06-28 21:13:22 +00:00
};
2014-10-13 01:37:35 +00:00
static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
2013-10-11 21:29:38 +00:00
{ (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a */
{ (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c */
{ (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d */
{ (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f */
{ (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g */
{ (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 } /* h */
2004-06-28 21:13:22 +00:00
};
2005-11-26 11:25:14 +00:00
static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
2004-06-28 21:13:22 +00:00
sizeof(struct T),
2004-09-29 13:19:37 +00:00
offsetof(struct T, _asn_ctx),
2005-11-26 11:25:14 +00:00
asn_MAP_T_tag2el_1,
2004-06-28 21:13:22 +00:00
6, /* Count of tags in the map */
2005-11-26 11:25:14 +00:00
0, 0, 0, /* Optional elements (not needed) */
2004-06-28 21:13:22 +00:00
-1, /* Start extensions */
-1 /* Stop extensions */
};
2004-09-29 13:19:37 +00:00
asn_TYPE_descriptor_t asn_DEF_T = {
2004-10-20 15:50:55 +00:00
"T",
2004-06-28 21:13:22 +00:00
"T",
2004-09-22 16:06:28 +00:00
SEQUENCE_free,
SEQUENCE_print,
2004-06-28 21:13:22 +00:00
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
2004-10-23 15:07:45 +00:00
SEQUENCE_decode_xer,
2004-09-22 16:06:28 +00:00
SEQUENCE_encode_xer,
2017-07-06 14:52:39 +00:00
0, 0, /* No OER support, use "-gen-OER" to enable */
2017-07-14 10:59:52 +00:00
0, 0, /* No PER support, use "-gen-PER" to enable */
2004-06-28 21:13:22 +00:00
0, /* Use generic outmost tag fetcher */
2005-11-26 11:25:14 +00:00
asn_DEF_T_tags_1,
sizeof(asn_DEF_T_tags_1)
/sizeof(asn_DEF_T_tags_1[0]) - 1, /* 1 */
asn_DEF_T_tags_1, /* Same as above */
sizeof(asn_DEF_T_tags_1)
/sizeof(asn_DEF_T_tags_1[0]), /* 2 */
2017-07-14 10:59:52 +00:00
0, /* No OER visible constraints */
2005-11-26 11:25:14 +00:00
0, /* No PER visible constraints */
2005-03-04 11:26:08 +00:00
asn_MBR_T_1,
2004-08-20 13:36:32 +00:00
2, /* Elements count */
2005-11-26 11:25:14 +00:00
&asn_SPC_T_specs_1 /* Additional specs */
2004-06-28 21:13:22 +00:00
};