From 231fc65ac63b40af14aca4b5cdbe0f44597088fe Mon Sep 17 00:00:00 2001 From: johvik Date: Thu, 26 Sep 2024 15:37:18 +0200 Subject: [PATCH] Fix version brackets in CHOICE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quote from Rec. ITU-T X.691 (02/2021) end of section 23: "NOTE – Version brackets in the definition of choice extension additions have no effect on how "ExtensionAdditionAlternatives" are encoded." In other words elements inside version brackets should not be grouped together for CHOICE (as opposed to how its done for SEQUENCE). --- libasn1compiler/asn1c_C.c | 8 - libasn1parser/asn1p_y.y | 6 +- .../165-choice-extended-group-OK.asn1 | 31 ++ .../165-choice-extended-group-OK.asn1.+-P | 515 ++++++++++++++++++ 4 files changed, 548 insertions(+), 12 deletions(-) create mode 100644 tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1 create mode 100644 tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1.+-P diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c index ba0ba12c8..5c2a2074e 100644 --- a/libasn1compiler/asn1c_C.c +++ b/libasn1compiler/asn1c_C.c @@ -973,7 +973,6 @@ asn1c_lang_C_type_CHOICE(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; int saved_target = arg->target->target; - int ext_num = 1; DEPENDENCIES; @@ -994,13 +993,6 @@ asn1c_lang_C_type_CHOICE(arg_t *arg) { continue; } - if((v->expr_type == ASN_CONSTR_SEQUENCE) && - (v->marker.flags & EM_OPTIONAL) && - (v->Identifier == NULL)) { - char ext_name[20]; - sprintf(ext_name, "ext%d", ext_num++); - v->Identifier = strdup(ext_name); - } OUT("%s", c_presence_name(arg, v)); } OUT("\n"); diff --git a/libasn1parser/asn1p_y.y b/libasn1parser/asn1p_y.y index 680c7169e..d51ba20ce 100644 --- a/libasn1parser/asn1p_y.y +++ b/libasn1parser/asn1p_y.y @@ -1097,10 +1097,8 @@ AlternativeTypeLists: } | AlternativeTypeLists ',' TOK_VBracketLeft AlternativeTypeLists TOK_VBracketRight { $$ = $1; - $4->meta_type = AMT_TYPE; - $4->expr_type = ASN_CONSTR_SEQUENCE; - $4->marker.flags |= EM_OPTIONAL; - asn1p_expr_add($$, $4); + asn1p_expr_add_many($$, $4); + asn1p_expr_free($4); } ; diff --git a/tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1 b/tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1 new file mode 100644 index 000000000..75bc01e9d --- /dev/null +++ b/tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1 @@ -0,0 +1,31 @@ + +-- OK: Everything is fine + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .165 + +ModuleTestExtensibleChoice + { iso org(3) dod(6) internet(1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 165 } + DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + + Choice ::= CHOICE { + a INTEGER, + ..., + b INTEGER, + [[ + c INTEGER + ]], + [[ + d INTEGER, + e INTEGER + ]], + [[ + f INTEGER, + g INTEGER + ]] + } + +END diff --git a/tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1.+-P b/tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1.+-P new file mode 100644 index 000000000..1bc4268e4 --- /dev/null +++ b/tests/tests-asn1c-compiler/165-choice-extended-group-OK.asn1.+-P @@ -0,0 +1,515 @@ + +/*** <<< INCLUDES [Choice] >>> ***/ + +#include +#include + +/*** <<< DEPS [Choice] >>> ***/ + +typedef enum Choice_PR { + Choice_PR_NOTHING, /* No components present */ + Choice_PR_a, + /* Extensions may appear below */ + Choice_PR_b, + Choice_PR_c, + Choice_PR_d, + Choice_PR_e, + Choice_PR_f, + Choice_PR_g +} Choice_PR; + +/*** <<< TYPE-DECLS [Choice] >>> ***/ + +typedef struct Choice { + Choice_PR present; + union Choice_u { + long a; + /* + * This type is extensible, + * possible extensions are below. + */ + long b; + long c; + long d; + long e; + long f; + long g; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} Choice_t; + +/*** <<< FUNC-DECLS [Choice] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_Choice; + +/*** <<< STAT-DEFS [Choice] >>> ***/ + +static asn_TYPE_member_t asn_MBR_Choice_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.a), + .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "a" + }, + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.b), + .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "b" + }, + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.c), + .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "c" + }, + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.d), + .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "d" + }, + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.e), + .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "e" + }, + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.f), + .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "f" + }, + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.g), + .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "g" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* b */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* c */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* d */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* e */ + { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* f */ + { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* g */ +}; +static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { + sizeof(struct Choice), + offsetof(struct Choice, _asn_ctx), + offsetof(struct Choice, present), + sizeof(((struct Choice *)0)->present), + .tag2el = asn_MAP_Choice_tag2el_1, + .tag2el_count = 7, /* Count of tags in the map */ + 0, 0, + .first_extension = 1 /* Extensions start */ +}; +asn_TYPE_descriptor_t asn_DEF_Choice = { + "Choice", + "Choice", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_Choice_1, + 7, /* Elements count */ + &asn_SPC_Choice_specs_1 /* Additional specs */ +}; + + +/*** <<< INCLUDES [EXTERNAL] >>> ***/ + +#include +#include +#include +#include +#include +#include +#include +#include + +/*** <<< DEPS [EXTERNAL] >>> ***/ + +typedef enum encoding_PR { + encoding_PR_NOTHING, /* No components present */ + encoding_PR_single_ASN1_type, + encoding_PR_octet_aligned, + encoding_PR_arbitrary +} encoding_PR; + +/*** <<< TYPE-DECLS [EXTERNAL] >>> ***/ + +typedef struct EXTERNAL { + OBJECT_IDENTIFIER_t *direct_reference; /* OPTIONAL */ + long *indirect_reference; /* OPTIONAL */ + ObjectDescriptor_t *data_value_descriptor; /* OPTIONAL */ + struct encoding { + encoding_PR present; + union EXTERNAL__encoding_u { + ANY_t single_ASN1_type; + OCTET_STRING_t octet_aligned; + BIT_STRING_t arbitrary; + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } encoding; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} EXTERNAL_t; + +/*** <<< FUNC-DECLS [EXTERNAL] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_EXTERNAL; + +/*** <<< STAT-DEFS [EXTERNAL] >>> ***/ + +static asn_TYPE_member_t asn_MBR_encoding_5[] = { + { ATF_NOFLAGS, 0, offsetof(struct encoding, choice.single_ASN1_type), + .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + .tag_mode = +1, /* EXPLICIT tag at current level */ + .type = &asn_DEF_ANY, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "single-ASN1-type" + }, + { ATF_NOFLAGS, 0, offsetof(struct encoding, choice.octet_aligned), + .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_OCTET_STRING, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "octet-aligned" + }, + { ATF_NOFLAGS, 0, offsetof(struct encoding, choice.arbitrary), + .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_BIT_STRING, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "arbitrary" + }, +}; +static const asn_TYPE_tag2member_t asn_MAP_encoding_tag2el_5[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* single-ASN1-type */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* octet-aligned */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* arbitrary */ +}; +static asn_CHOICE_specifics_t asn_SPC_encoding_specs_5 = { + sizeof(struct encoding), + offsetof(struct encoding, _asn_ctx), + offsetof(struct encoding, present), + sizeof(((struct encoding *)0)->present), + .tag2el = asn_MAP_encoding_tag2el_5, + .tag2el_count = 3, /* Count of tags in the map */ + 0, 0, + .first_extension = -1 /* Extensions start */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_encoding_5 = { + "encoding", + "encoding", + &asn_OP_CHOICE, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + CHOICE_constraint + }, + asn_MBR_encoding_5, + 3, /* Elements count */ + &asn_SPC_encoding_specs_5 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_EXTERNAL_1[] = { + { ATF_POINTER, 3, offsetof(struct EXTERNAL, direct_reference), + .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), + .tag_mode = 0, + .type = &asn_DEF_OBJECT_IDENTIFIER, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "direct-reference" + }, + { ATF_POINTER, 2, offsetof(struct EXTERNAL, indirect_reference), + .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + .tag_mode = 0, + .type = &asn_DEF_NativeInteger, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "indirect-reference" + }, + { ATF_POINTER, 1, offsetof(struct EXTERNAL, data_value_descriptor), + .tag = (ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), + .tag_mode = 0, + .type = &asn_DEF_ObjectDescriptor, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "data-value-descriptor" + }, + { ATF_NOFLAGS, 0, offsetof(struct EXTERNAL, encoding), + .tag = -1 /* Ambiguous tag (CHOICE?) */, + .tag_mode = 0, + .type = &asn_DEF_encoding_5, + .type_selector = 0, + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + .oer_constraints = 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + .per_constraints = 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + .jer_constraints = 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + .general_constraints = 0 + }, + 0, 0, /* No default value */ + .name = "encoding" + }, +}; +static const ber_tlv_tag_t asn_DEF_EXTERNAL_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (8 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_EXTERNAL_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* indirect-reference */ + { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 }, /* direct-reference */ + { (ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), 2, 0, 0 }, /* data-value-descriptor */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* single-ASN1-type */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* octet-aligned */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 3, 0, 0 } /* arbitrary */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_EXTERNAL_specs_1 = { + sizeof(struct EXTERNAL), + offsetof(struct EXTERNAL, _asn_ctx), + .tag2el = asn_MAP_EXTERNAL_tag2el_1, + .tag2el_count = 6, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_EXTERNAL = { + "EXTERNAL", + "EXTERNAL", + &asn_OP_SEQUENCE, + asn_DEF_EXTERNAL_tags_1, + sizeof(asn_DEF_EXTERNAL_tags_1) + /sizeof(asn_DEF_EXTERNAL_tags_1[0]) - 1, /* 1 */ + asn_DEF_EXTERNAL_tags_1, /* Same as above */ + sizeof(asn_DEF_EXTERNAL_tags_1) + /sizeof(asn_DEF_EXTERNAL_tags_1[0]), /* 2 */ + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ + SEQUENCE_constraint + }, + asn_MBR_EXTERNAL_1, + 4, /* Elements count */ + &asn_SPC_EXTERNAL_specs_1 /* Additional specs */ +}; +