X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tests%2Ftests-asn1c-compiler%2F65-multi-tag-OK.asn1.-Pfwide-types;fp=tests%2Ftests-asn1c-compiler%2F65-multi-tag-OK.asn1.-Pfwide-types;h=31570c01de0954bff4383b07983212e50d5e638a;hb=70ee6fc793ec8e828067a3569849b6c216054497;hp=0000000000000000000000000000000000000000;hpb=59f84608ec15c016958a6e0e0ddd813f376c0925;p=com%2Fasn1c.git diff --git a/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1.-Pfwide-types new file mode 100644 index 0000000..31570c0 --- /dev/null +++ b/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1.-Pfwide-types @@ -0,0 +1,450 @@ + +/*** <<< INCLUDES [T1] >>> ***/ + +#include "T2.h" + +/*** <<< TYPE-DECLS [T1] >>> ***/ + +typedef T2_t T1_t; + +/*** <<< FUNC-DECLS [T1] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_T1; +asn_struct_free_f T1_free; +asn_struct_print_f T1_print; +asn_constr_check_f T1_constraint; +ber_type_decoder_f T1_decode_ber; +der_type_encoder_f T1_encode_der; +xer_type_decoder_f T1_decode_xer; +xer_type_encoder_f T1_encode_xer; + +/*** <<< CODE [T1] >>> ***/ + +/* + * This type is implemented using T2, + * so here we adjust the DEF accordingly. + */ + +/*** <<< STAT-DEFS [T1] >>> ***/ + +static const ber_tlv_tag_t asn_DEF_T1_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)) +}; +static const ber_tlv_tag_t asn_DEF_T1_all_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_T1 = { + "T1", + "T1", + &asn_OP_REAL, + asn_DEF_T1_tags_1, + sizeof(asn_DEF_T1_tags_1) + /sizeof(asn_DEF_T1_tags_1[0]), /* 4 */ + asn_DEF_T1_all_tags_1, + sizeof(asn_DEF_T1_all_tags_1) + /sizeof(asn_DEF_T1_all_tags_1[0]), /* 6 */ + { 0, 0, REAL_constraint }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [T2] >>> ***/ + +#include "T3.h" + +/*** <<< TYPE-DECLS [T2] >>> ***/ + +typedef T3_t T2_t; + +/*** <<< FUNC-DECLS [T2] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_T2; +asn_struct_free_f T2_free; +asn_struct_print_f T2_print; +asn_constr_check_f T2_constraint; +ber_type_decoder_f T2_decode_ber; +der_type_encoder_f T2_encode_der; +xer_type_decoder_f T2_decode_xer; +xer_type_encoder_f T2_encode_xer; + +/*** <<< CODE [T2] >>> ***/ + +/* + * This type is implemented using T3, + * so here we adjust the DEF accordingly. + */ + +/*** <<< STAT-DEFS [T2] >>> ***/ + +static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)) +}; +static const ber_tlv_tag_t asn_DEF_T2_all_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_T2 = { + "T2", + "T2", + &asn_OP_REAL, + asn_DEF_T2_tags_1, + sizeof(asn_DEF_T2_tags_1) + /sizeof(asn_DEF_T2_tags_1[0]), /* 3 */ + asn_DEF_T2_all_tags_1, + sizeof(asn_DEF_T2_all_tags_1) + /sizeof(asn_DEF_T2_all_tags_1[0]), /* 5 */ + { 0, 0, REAL_constraint }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [T3] >>> ***/ + +#include "T4.h" + +/*** <<< TYPE-DECLS [T3] >>> ***/ + +typedef T4_t T3_t; + +/*** <<< FUNC-DECLS [T3] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_T3; +asn_struct_free_f T3_free; +asn_struct_print_f T3_print; +asn_constr_check_f T3_constraint; +ber_type_decoder_f T3_decode_ber; +der_type_encoder_f T3_encode_der; +xer_type_decoder_f T3_decode_xer; +xer_type_encoder_f T3_encode_xer; + +/*** <<< CODE [T3] >>> ***/ + +/* + * This type is implemented using T4, + * so here we adjust the DEF accordingly. + */ + +/*** <<< STAT-DEFS [T3] >>> ***/ + +static const ber_tlv_tag_t asn_DEF_T3_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)) +}; +static const ber_tlv_tag_t asn_DEF_T3_all_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_T3 = { + "T3", + "T3", + &asn_OP_REAL, + asn_DEF_T3_tags_1, + sizeof(asn_DEF_T3_tags_1) + /sizeof(asn_DEF_T3_tags_1[0]), /* 2 */ + asn_DEF_T3_all_tags_1, + sizeof(asn_DEF_T3_all_tags_1) + /sizeof(asn_DEF_T3_all_tags_1[0]), /* 4 */ + { 0, 0, REAL_constraint }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [T4] >>> ***/ + +#include "T5.h" + +/*** <<< TYPE-DECLS [T4] >>> ***/ + +typedef T5_t T4_t; + +/*** <<< FUNC-DECLS [T4] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_T4; +asn_struct_free_f T4_free; +asn_struct_print_f T4_print; +asn_constr_check_f T4_constraint; +ber_type_decoder_f T4_decode_ber; +der_type_encoder_f T4_encode_der; +xer_type_decoder_f T4_decode_xer; +xer_type_encoder_f T4_encode_xer; + +/*** <<< CODE [T4] >>> ***/ + +/* + * This type is implemented using T5, + * so here we adjust the DEF accordingly. + */ + +/*** <<< STAT-DEFS [T4] >>> ***/ + +static const ber_tlv_tag_t asn_DEF_T4_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (5 << 2)), + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_T4 = { + "T4", + "T4", + &asn_OP_REAL, + asn_DEF_T4_tags_1, + sizeof(asn_DEF_T4_tags_1) + /sizeof(asn_DEF_T4_tags_1[0]) - 1, /* 2 */ + asn_DEF_T4_tags_1, /* Same as above */ + sizeof(asn_DEF_T4_tags_1) + /sizeof(asn_DEF_T4_tags_1[0]), /* 3 */ + { 0, 0, REAL_constraint }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [T5] >>> ***/ + +#include "T6.h" + +/*** <<< TYPE-DECLS [T5] >>> ***/ + +typedef T6_t T5_t; + +/*** <<< FUNC-DECLS [T5] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_T5; +asn_struct_free_f T5_free; +asn_struct_print_f T5_print; +asn_constr_check_f T5_constraint; +ber_type_decoder_f T5_decode_ber; +der_type_encoder_f T5_encode_der; +xer_type_decoder_f T5_decode_xer; +xer_type_encoder_f T5_encode_xer; + +/*** <<< CODE [T5] >>> ***/ + +/* + * This type is implemented using T6, + * so here we adjust the DEF accordingly. + */ + +/*** <<< STAT-DEFS [T5] >>> ***/ + +static const ber_tlv_tag_t asn_DEF_T5_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (6 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_T5 = { + "T5", + "T5", + &asn_OP_REAL, + asn_DEF_T5_tags_1, + sizeof(asn_DEF_T5_tags_1) + /sizeof(asn_DEF_T5_tags_1[0]) - 1, /* 1 */ + asn_DEF_T5_tags_1, /* Same as above */ + sizeof(asn_DEF_T5_tags_1) + /sizeof(asn_DEF_T5_tags_1[0]), /* 2 */ + { 0, 0, REAL_constraint }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [T6] >>> ***/ + +#include + +/*** <<< TYPE-DECLS [T6] >>> ***/ + +typedef REAL_t T6_t; + +/*** <<< FUNC-DECLS [T6] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_T6; +asn_struct_free_f T6_free; +asn_struct_print_f T6_print; +asn_constr_check_f T6_constraint; +ber_type_decoder_f T6_decode_ber; +der_type_encoder_f T6_encode_der; +xer_type_decoder_f T6_decode_xer; +xer_type_encoder_f T6_encode_xer; + +/*** <<< CODE [T6] >>> ***/ + +/* + * This type is implemented using REAL, + * so here we adjust the DEF accordingly. + */ + +/*** <<< STAT-DEFS [T6] >>> ***/ + +static const ber_tlv_tag_t asn_DEF_T6_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_T6 = { + "T6", + "T6", + &asn_OP_REAL, + asn_DEF_T6_tags_1, + sizeof(asn_DEF_T6_tags_1) + /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */ + asn_DEF_T6_tags_1, /* Same as above */ + sizeof(asn_DEF_T6_tags_1) + /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */ + { 0, 0, REAL_constraint }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [T] >>> ***/ + +#include "Ts.h" + +/*** <<< TYPE-DECLS [T] >>> ***/ + +typedef Ts_t T_t; + +/*** <<< FUNC-DECLS [T] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_T; +asn_struct_free_f T_free; +asn_struct_print_f T_print; +asn_constr_check_f T_constraint; +ber_type_decoder_f T_decode_ber; +der_type_encoder_f T_encode_der; +xer_type_decoder_f T_decode_xer; +xer_type_encoder_f T_encode_xer; + +/*** <<< CODE [T] >>> ***/ + +/* + * This type is implemented using Ts, + * so here we adjust the DEF accordingly. + */ + +/*** <<< STAT-DEFS [T] >>> ***/ + +static const ber_tlv_tag_t asn_DEF_T_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + (ASN_TAG_CLASS_CONTEXT | (123 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_T = { + "T", + "T", + &asn_OP_SEQUENCE, + asn_DEF_T_tags_1, + sizeof(asn_DEF_T_tags_1) + /sizeof(asn_DEF_T_tags_1[0]) - 2, /* 1 */ + asn_DEF_T_tags_1, /* Same as above */ + sizeof(asn_DEF_T_tags_1) + /sizeof(asn_DEF_T_tags_1[0]), /* 3 */ + { 0, 0, SEQUENCE_constraint }, + asn_MBR_Ts_1, + 3, /* Elements count */ + &asn_SPC_Ts_specs_1 /* Additional specs */ +}; + + +/*** <<< INCLUDES [Ts] >>> ***/ + +#include "T2.h" +#include "T3.h" +#include + +/*** <<< TYPE-DECLS [Ts] >>> ***/ + +typedef struct Ts { + T2_t m1; + T3_t *m2; /* OPTIONAL */ + T3_t m3; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} Ts_t; + +/*** <<< FUNC-DECLS [Ts] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_Ts; +extern asn_SEQUENCE_specifics_t asn_SPC_Ts_specs_1; +extern asn_TYPE_member_t asn_MBR_Ts_1[3]; + +/*** <<< STAT-DEFS [Ts] >>> ***/ + +asn_TYPE_member_t asn_MBR_Ts_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct Ts, m1), + .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_T2, + .type_selector = 0, + { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, + 0, 0, /* No default value */ + .name = "m1" + }, + { ATF_POINTER, 1, offsetof(struct Ts, m2), + .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + .tag_mode = +1, /* EXPLICIT tag at current level */ + .type = &asn_DEF_T3, + .type_selector = 0, + { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, + 0, 0, /* No default value */ + .name = "m2" + }, + { ATF_NOFLAGS, 0, offsetof(struct Ts, m3), + .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), + .tag_mode = -1, /* IMPLICIT tag at current level */ + .type = &asn_DEF_T3, + .type_selector = 0, + { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, + 0, 0, /* No default value */ + .name = "m3" + }, +}; +static const ber_tlv_tag_t asn_DEF_Ts_tags_1[] = { + (ASN_TAG_CLASS_CONTEXT | (123 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static const asn_TYPE_tag2member_t asn_MAP_Ts_tag2el_1[] = { + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* m1 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* m2 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 } /* m3 */ +}; +asn_SEQUENCE_specifics_t asn_SPC_Ts_specs_1 = { + sizeof(struct Ts), + offsetof(struct Ts, _asn_ctx), + .tag2el = asn_MAP_Ts_tag2el_1, + .tag2el_count = 3, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* First extension addition */ +}; +asn_TYPE_descriptor_t asn_DEF_Ts = { + "Ts", + "Ts", + &asn_OP_SEQUENCE, + asn_DEF_Ts_tags_1, + sizeof(asn_DEF_Ts_tags_1) + /sizeof(asn_DEF_Ts_tags_1[0]) - 1, /* 1 */ + asn_DEF_Ts_tags_1, /* Same as above */ + sizeof(asn_DEF_Ts_tags_1) + /sizeof(asn_DEF_Ts_tags_1[0]), /* 2 */ + { 0, 0, SEQUENCE_constraint }, + asn_MBR_Ts_1, + 3, /* Elements count */ + &asn_SPC_Ts_specs_1 /* Additional specs */ +}; +