reshuffled the tests layout
diff --git a/tests/tests-asn1c-compiler/00-empty-OK.asn1 b/tests/tests-asn1c-compiler/00-empty-OK.asn1
new file mode 100644
index 0000000..532d4fb
--- /dev/null
+++ b/tests/tests-asn1c-compiler/00-empty-OK.asn1
@@ -0,0 +1 @@
+ModuleTestEmpty DEFINITIONS ::= BEGIN END
diff --git a/tests/tests-asn1c-compiler/01-empty-OK.asn1 b/tests/tests-asn1c-compiler/01-empty-OK.asn1
new file mode 100644
index 0000000..04d9ba7
--- /dev/null
+++ b/tests/tests-asn1c-compiler/01-empty-OK.asn1
@@ -0,0 +1,14 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .1
+
+ModuleTestEmpty
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 1 }
+ DEFINITIONS ::=
+BEGIN
+
+END
diff --git a/tests/tests-asn1c-compiler/02-garbage-NP.asn1 b/tests/tests-asn1c-compiler/02-garbage-NP.asn1
new file mode 100644
index 0000000..410c7bc
--- /dev/null
+++ b/tests/tests-asn1c-compiler/02-garbage-NP.asn1
@@ -0,0 +1,17 @@
+
+-- NP: Non-parseable.
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .2
+
+ModuleTestGarbage
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 2 }
+ DEFINITIONS ::=
+BEGIN
+
+ -- must fail on the next line --
+ some garbage
+
+END
diff --git a/tests/tests-asn1c-compiler/03-enum-OK.asn1 b/tests/tests-asn1c-compiler/03-enum-OK.asn1
new file mode 100644
index 0000000..a8570a9
--- /dev/null
+++ b/tests/tests-asn1c-compiler/03-enum-OK.asn1
@@ -0,0 +1,37 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .3
+
+ModuleTestEnum1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 3 }
+ DEFINITIONS ::=
+BEGIN
+
+ Enum1 ::= ENUMERATED
+ { red, -- will be 0 --
+ green, -- will be 1 --
+ blue(4),
+ alpha,
+ ... -- extensible --
+ }
+
+ Enum2 ::= ENUMERATED
+ { red, -- will be 0 --
+ green, -- will be 1 --
+ blue(45),
+ orange(23), -- Does not have to be ordered --
+ alpha,
+ ..., -- extensible --
+ beta(12), -- May be less than the max value in the root --
+ gamma(103) -- Must be ordered --
+ }
+
+ Enum3 ::= ENUMERATED { a, b(3), ..., c(1) }
+ Enum4 ::= ENUMERATED { a, b, ..., c(3), d }
+ Enum5 ::= ENUMERATED { a, z(25), ..., d }
+
+END
diff --git a/tests/tests-asn1c-compiler/03-enum-OK.asn1.-EF b/tests/tests-asn1c-compiler/03-enum-OK.asn1.-EF
new file mode 100644
index 0000000..761736f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/03-enum-OK.asn1.-EF
@@ -0,0 +1,47 @@
+ModuleTestEnum1 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 3 }
+DEFINITIONS ::=
+BEGIN
+
+Enum1 ::= ENUMERATED {
+ red(0),
+ green(1),
+ blue(4),
+ alpha(5),
+ ...
+}
+
+Enum2 ::= ENUMERATED {
+ red(0),
+ green(1),
+ blue(45),
+ orange(23),
+ alpha(46),
+ ...,
+ beta(12),
+ gamma(103)
+}
+
+Enum3 ::= ENUMERATED {
+ a(0),
+ b(3),
+ ...,
+ c(1)
+}
+
+Enum4 ::= ENUMERATED {
+ a(0),
+ b(1),
+ ...,
+ c(3),
+ d(4)
+}
+
+Enum5 ::= ENUMERATED {
+ a(0),
+ z(25),
+ ...,
+ d(26)
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/03-enum-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/03-enum-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..af272c5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/03-enum-OK.asn1.-Pfwide-types
@@ -0,0 +1,468 @@
+
+/*** <<< INCLUDES [Enum1] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [Enum1] >>> ***/
+
+typedef enum Enum1 {
+ Enum1_red = 0,
+ Enum1_green = 1,
+ Enum1_blue = 4,
+ Enum1_alpha = 5
+ /*
+ * Enumeration is extensible
+ */
+} e_Enum1;
+
+/*** <<< TYPE-DECLS [Enum1] >>> ***/
+
+typedef ENUMERATED_t Enum1_t;
+
+/*** <<< FUNC-DECLS [Enum1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum1;
+asn_struct_free_f Enum1_free;
+asn_struct_print_f Enum1_print;
+asn_constr_check_f Enum1_constraint;
+ber_type_decoder_f Enum1_decode_ber;
+der_type_encoder_f Enum1_encode_der;
+xer_type_decoder_f Enum1_decode_xer;
+xer_type_encoder_f Enum1_encode_xer;
+
+/*** <<< CODE [Enum1] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Enum1] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
+ { 0, 3, "red" },
+ { 1, 5, "green" },
+ { 4, 4, "blue" },
+ { 5, 5, "alpha" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
+ 3, /* alpha(5) */
+ 2, /* blue(4) */
+ 1, /* green(1) */
+ 0 /* red(0) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
+ asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
+ 4, /* Number of elements in the maps */
+ 5, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum1 = {
+ "Enum1",
+ "Enum1",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum1_tags_1,
+ sizeof(asn_DEF_Enum1_tags_1)
+ /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
+ asn_DEF_Enum1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum1_tags_1)
+ /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum2] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [Enum2] >>> ***/
+
+typedef enum Enum2 {
+ Enum2_red = 0,
+ Enum2_green = 1,
+ Enum2_blue = 45,
+ Enum2_orange = 23,
+ Enum2_alpha = 46,
+ /*
+ * Enumeration is extensible
+ */
+ Enum2_beta = 12,
+ Enum2_gamma = 103
+} e_Enum2;
+
+/*** <<< TYPE-DECLS [Enum2] >>> ***/
+
+typedef ENUMERATED_t Enum2_t;
+
+/*** <<< FUNC-DECLS [Enum2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum2;
+asn_struct_free_f Enum2_free;
+asn_struct_print_f Enum2_print;
+asn_constr_check_f Enum2_constraint;
+ber_type_decoder_f Enum2_decode_ber;
+der_type_encoder_f Enum2_encode_der;
+xer_type_decoder_f Enum2_decode_xer;
+xer_type_encoder_f Enum2_encode_xer;
+
+/*** <<< CODE [Enum2] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Enum2] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = {
+ { 0, 3, "red" },
+ { 1, 5, "green" },
+ { 12, 4, "beta" },
+ { 23, 6, "orange" },
+ { 45, 4, "blue" },
+ { 46, 5, "alpha" },
+ { 103, 5, "gamma" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_Enum2_enum2value_1[] = {
+ 5, /* alpha(46) */
+ 2, /* beta(12) */
+ 4, /* blue(45) */
+ 6, /* gamma(103) */
+ 1, /* green(1) */
+ 3, /* orange(23) */
+ 0 /* red(0) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = {
+ asn_MAP_Enum2_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum2_enum2value_1, /* N => "tag"; sorted by N */
+ 7, /* Number of elements in the maps */
+ 6, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum2 = {
+ "Enum2",
+ "Enum2",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum2_tags_1,
+ sizeof(asn_DEF_Enum2_tags_1)
+ /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
+ asn_DEF_Enum2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum2_tags_1)
+ /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum3] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [Enum3] >>> ***/
+
+typedef enum Enum3 {
+ Enum3_a = 0,
+ Enum3_b = 3,
+ /*
+ * Enumeration is extensible
+ */
+ Enum3_c = 1
+} e_Enum3;
+
+/*** <<< TYPE-DECLS [Enum3] >>> ***/
+
+typedef ENUMERATED_t Enum3_t;
+
+/*** <<< FUNC-DECLS [Enum3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum3;
+asn_struct_free_f Enum3_free;
+asn_struct_print_f Enum3_print;
+asn_constr_check_f Enum3_constraint;
+ber_type_decoder_f Enum3_decode_ber;
+der_type_encoder_f Enum3_encode_der;
+xer_type_decoder_f Enum3_decode_xer;
+xer_type_encoder_f Enum3_encode_xer;
+
+/*** <<< CODE [Enum3] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Enum3] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = {
+ { 0, 1, "a" },
+ { 1, 1, "c" },
+ { 3, 1, "b" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_Enum3_enum2value_1[] = {
+ 0, /* a(0) */
+ 2, /* b(3) */
+ 1 /* c(1) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = {
+ asn_MAP_Enum3_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum3_enum2value_1, /* N => "tag"; sorted by N */
+ 3, /* Number of elements in the maps */
+ 3, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum3 = {
+ "Enum3",
+ "Enum3",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum3_tags_1,
+ sizeof(asn_DEF_Enum3_tags_1)
+ /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
+ asn_DEF_Enum3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum3_tags_1)
+ /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum3_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum4] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [Enum4] >>> ***/
+
+typedef enum Enum4 {
+ Enum4_a = 0,
+ Enum4_b = 1,
+ /*
+ * Enumeration is extensible
+ */
+ Enum4_c = 3,
+ Enum4_d = 4
+} e_Enum4;
+
+/*** <<< TYPE-DECLS [Enum4] >>> ***/
+
+typedef ENUMERATED_t Enum4_t;
+
+/*** <<< FUNC-DECLS [Enum4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum4;
+asn_struct_free_f Enum4_free;
+asn_struct_print_f Enum4_print;
+asn_constr_check_f Enum4_constraint;
+ber_type_decoder_f Enum4_decode_ber;
+der_type_encoder_f Enum4_encode_der;
+xer_type_decoder_f Enum4_decode_xer;
+xer_type_encoder_f Enum4_encode_xer;
+
+/*** <<< CODE [Enum4] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Enum4] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = {
+ { 0, 1, "a" },
+ { 1, 1, "b" },
+ { 3, 1, "c" },
+ { 4, 1, "d" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_Enum4_enum2value_1[] = {
+ 0, /* a(0) */
+ 1, /* b(1) */
+ 2, /* c(3) */
+ 3 /* d(4) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = {
+ asn_MAP_Enum4_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum4_enum2value_1, /* N => "tag"; sorted by N */
+ 4, /* Number of elements in the maps */
+ 3, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum4 = {
+ "Enum4",
+ "Enum4",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum4_tags_1,
+ sizeof(asn_DEF_Enum4_tags_1)
+ /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
+ asn_DEF_Enum4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum4_tags_1)
+ /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum4_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum5] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [Enum5] >>> ***/
+
+typedef enum Enum5 {
+ Enum5_a = 0,
+ Enum5_z = 25,
+ /*
+ * Enumeration is extensible
+ */
+ Enum5_d = 26
+} e_Enum5;
+
+/*** <<< TYPE-DECLS [Enum5] >>> ***/
+
+typedef ENUMERATED_t Enum5_t;
+
+/*** <<< FUNC-DECLS [Enum5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum5;
+asn_struct_free_f Enum5_free;
+asn_struct_print_f Enum5_print;
+asn_constr_check_f Enum5_constraint;
+ber_type_decoder_f Enum5_decode_ber;
+der_type_encoder_f Enum5_encode_der;
+xer_type_decoder_f Enum5_decode_xer;
+xer_type_encoder_f Enum5_encode_xer;
+
+/*** <<< CODE [Enum5] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Enum5] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = {
+ { 0, 1, "a" },
+ { 25, 1, "z" },
+ { 26, 1, "d" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_Enum5_enum2value_1[] = {
+ 0, /* a(0) */
+ 2, /* d(26) */
+ 1 /* z(25) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = {
+ asn_MAP_Enum5_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum5_enum2value_1, /* N => "tag"; sorted by N */
+ 3, /* Number of elements in the maps */
+ 3, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum5 = {
+ "Enum5",
+ "Enum5",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum5_tags_1,
+ sizeof(asn_DEF_Enum5_tags_1)
+ /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
+ asn_DEF_Enum5_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum5_tags_1)
+ /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum5_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/04-enum-SE.asn1 b/tests/tests-asn1c-compiler/04-enum-SE.asn1
new file mode 100644
index 0000000..e9a37c4
--- /dev/null
+++ b/tests/tests-asn1c-compiler/04-enum-SE.asn1
@@ -0,0 +1,19 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .4
+
+ModuleTestEnum2
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 4 }
+ DEFINITIONS ::=
+BEGIN
+
+ enum1 Enum1 ::= blue
+
+ Enum1 ::= ENUMERATED { red, green, ...,
+ blue(1) -- collides with green -- }
+
+END
diff --git a/tests/tests-asn1c-compiler/04-enum-SE.asn1.-E b/tests/tests-asn1c-compiler/04-enum-SE.asn1.-E
new file mode 100644
index 0000000..2036bd5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/04-enum-SE.asn1.-E
@@ -0,0 +1,15 @@
+ModuleTestEnum2 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 4 }
+DEFINITIONS ::=
+BEGIN
+
+enum1 Enum1 ::= blue
+
+Enum1 ::= ENUMERATED {
+ red,
+ green,
+ ...,
+ blue(1)
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/05-enum-SE.asn1 b/tests/tests-asn1c-compiler/05-enum-SE.asn1
new file mode 100644
index 0000000..083724d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/05-enum-SE.asn1
@@ -0,0 +1,21 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .5
+
+ModuleTestEnum3
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 5 }
+ DEFINITIONS ::=
+BEGIN
+
+ enum1 Enum1 ::= red
+
+ Enum1 ::= ENUMERATED { red(5), green(4), ..., blue(6),
+ -- second extension marker is not allowed --
+ ...,
+ white(7) }
+
+END
diff --git a/tests/tests-asn1c-compiler/06-enum-SE.asn1 b/tests/tests-asn1c-compiler/06-enum-SE.asn1
new file mode 100644
index 0000000..ad304af
--- /dev/null
+++ b/tests/tests-asn1c-compiler/06-enum-SE.asn1
@@ -0,0 +1,20 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .6
+
+ModuleTestEnum4
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 6 }
+ DEFINITIONS ::=
+BEGIN
+
+ enum1 Enum1 ::= red
+
+ Enum1 ::= ENUMERATED { red(5), ...,
+ green(7), blue(6) -- order is not maintained after ...
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/07-int-OK.asn1 b/tests/tests-asn1c-compiler/07-int-OK.asn1
new file mode 100644
index 0000000..bf59627
--- /dev/null
+++ b/tests/tests-asn1c-compiler/07-int-OK.asn1
@@ -0,0 +1,26 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .7
+
+ModuleTestInt1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 7 }
+ DEFINITIONS ::=
+BEGIN
+
+ int123456 INTEGER ::= 123456
+
+ Interval ::= INTEGER (1..int123456)
+
+ SameInterval INTEGER ::= { 1 | 2 | 3 | 4 | 5 | 6 }
+
+ Reason ::= INTEGER {
+ no-reason(0),
+ negative-reason(-10),
+ some-large-value(1324324)
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/07-int-OK.asn1.-EF b/tests/tests-asn1c-compiler/07-int-OK.asn1.-EF
new file mode 100644
index 0000000..3baa862
--- /dev/null
+++ b/tests/tests-asn1c-compiler/07-int-OK.asn1.-EF
@@ -0,0 +1,18 @@
+ModuleTestInt1 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 7 }
+DEFINITIONS ::=
+BEGIN
+
+int123456 INTEGER ::= 123456
+
+Interval ::= INTEGER (1..123456)
+
+SameInterval INTEGER ::= {1 | 2 | 3 | 4 | 5 | 6}
+
+Reason ::= INTEGER {
+ no-reason(0),
+ negative-reason(-10),
+ some-large-value(1324324)
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/08-int-SE.asn1 b/tests/tests-asn1c-compiler/08-int-SE.asn1
new file mode 100644
index 0000000..64c1dc0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/08-int-SE.asn1
@@ -0,0 +1,19 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .8
+
+ModuleTestInt2
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 8 }
+ DEFINITIONS ::=
+BEGIN
+
+ Reason ::= INTEGER {
+ value1(0),
+ value1(2) -- identifiers must be distinct --
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/09-int-SE.asn1 b/tests/tests-asn1c-compiler/09-int-SE.asn1
new file mode 100644
index 0000000..1eda767
--- /dev/null
+++ b/tests/tests-asn1c-compiler/09-int-SE.asn1
@@ -0,0 +1,20 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .9
+
+ModuleTestInt3
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 9 }
+ DEFINITIONS ::=
+BEGIN
+
+ Reason ::= INTEGER {
+ value1(1),
+ value5(5),
+ value2-1(1) -- integers must be distinct --
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/10-int-OK.asn1 b/tests/tests-asn1c-compiler/10-int-OK.asn1
new file mode 100644
index 0000000..c17265f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/10-int-OK.asn1
@@ -0,0 +1,29 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .10
+
+ModuleTestInt4
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 10 }
+ DEFINITIONS ::=
+BEGIN
+
+ alpha INTEGER ::= 1
+ Type1 ::= INTEGER { alpha(2) }
+ Type2 ::= INTEGER { alpha(3), beta(alpha) }
+ gamma Type2 ::= beta -- equals 1 --
+ delta Type2 ::= alpha -- equals 3 --
+
+ /*
+ * The following are for post-fix checking by the check_fixer.
+ * It will be able to pick-up these values if the file is parseable,
+ * even if it contains some semantic errors.
+ */
+
+ check-gamma INTEGER ::= 1 -- check "gamma"'s value
+ check-delta INTEGER ::= 3 -- check "delta"'s value
+
+END
diff --git a/tests/tests-asn1c-compiler/100-class-ref-OK.asn1 b/tests/tests-asn1c-compiler/100-class-ref-OK.asn1
new file mode 100644
index 0000000..e8c1f72
--- /dev/null
+++ b/tests/tests-asn1c-compiler/100-class-ref-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .100
+
+ModuleClassSample
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 100 }
+ DEFINITIONS ::=
+BEGIN
+
+ REF-ID ::= TYPE-IDENTIFIER
+
+ RefID ::= SEQUENCE {
+ field REF-ID.&id,
+ params REF-ID.&Type
+ }
+
+ SupportedReferences REF-ID ::= { ... }
+
+END
diff --git a/tests/tests-asn1c-compiler/100-class-ref-OK.asn1.-EF b/tests/tests-asn1c-compiler/100-class-ref-OK.asn1.-EF
new file mode 100644
index 0000000..7449f2b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/100-class-ref-OK.asn1.-EF
@@ -0,0 +1,15 @@
+ModuleClassSample { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 100 }
+DEFINITIONS ::=
+BEGIN
+
+REF-ID ::= TYPE-IDENTIFIER
+
+RefID ::= SEQUENCE {
+ field REF-ID.&id,
+ params REF-ID.&Type
+}
+
+SupportedReferences REF-ID ::= {...}
+
+END
diff --git a/tests/tests-asn1c-compiler/101-class-ref-SE.asn1 b/tests/tests-asn1c-compiler/101-class-ref-SE.asn1
new file mode 100644
index 0000000..373df7f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/101-class-ref-SE.asn1
@@ -0,0 +1,23 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .101
+
+ModuleClassMisUse
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 101 }
+ DEFINITIONS ::=
+BEGIN
+
+ NOTCLASS ::= SEQUENCE { ... }
+
+ REF-ID ::= NOTCLASS
+
+ RefID ::= SEQUENCE {
+ field REF-ID.&id,
+ params REF-ID.&Type
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/102-class-ref-SE.asn1 b/tests/tests-asn1c-compiler/102-class-ref-SE.asn1
new file mode 100644
index 0000000..4f42240
--- /dev/null
+++ b/tests/tests-asn1c-compiler/102-class-ref-SE.asn1
@@ -0,0 +1,22 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .102
+
+ModuleClassMisUse
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 102 }
+ DEFINITIONS ::=
+BEGIN
+
+ REF-ID ::= REF-ID2
+ REF-ID2 ::= REF-ID
+
+ RefID ::= SEQUENCE {
+ field REF-ID.&id,
+ params REF-ID.&Type
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/102-class-ref-SE.asn1.-EF b/tests/tests-asn1c-compiler/102-class-ref-SE.asn1.-EF
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/tests-asn1c-compiler/102-class-ref-SE.asn1.-EF
diff --git a/tests/tests-asn1c-compiler/103-reference-SE.asn1 b/tests/tests-asn1c-compiler/103-reference-SE.asn1
new file mode 100644
index 0000000..8b01ef8
--- /dev/null
+++ b/tests/tests-asn1c-compiler/103-reference-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .103
+
+ModuleReference
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 103 }
+ DEFINITIONS ::=
+BEGIN
+ IMPORTS Type FROM ModuleReference;
+
+ T ::= SEQUENCE OF Type
+END
diff --git a/tests/tests-asn1c-compiler/104-param-1-OK.asn1 b/tests/tests-asn1c-compiler/104-param-1-OK.asn1
new file mode 100644
index 0000000..9c1527a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/104-param-1-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .104
+
+ModuleParameterization1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 104 }
+ DEFINITIONS ::=
+BEGIN
+
+ Collection {T} ::= SET OF T
+
+ Bunch ::= SEQUENCE {
+ field-REAL Collection {REAL},
+ field-IA5String Collection {IA5String}
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/104-param-1-OK.asn1.-EFprint-class-matrix b/tests/tests-asn1c-compiler/104-param-1-OK.asn1.-EFprint-class-matrix
new file mode 100644
index 0000000..754ba54
--- /dev/null
+++ b/tests/tests-asn1c-compiler/104-param-1-OK.asn1.-EFprint-class-matrix
@@ -0,0 +1,17 @@
+ModuleParameterization1 { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 104 }
+DEFINITIONS ::=
+BEGIN
+
+Collection{T} ::= SET OF T
+-- Specializations list has 2 entries:
+-- REAL
+-- IA5String
+
+
+Bunch ::= SEQUENCE {
+ field-REAL Collection{ REAL},
+ field-IA5String Collection{ IA5String}
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/104-param-1-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/104-param-1-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..df69818
--- /dev/null
+++ b/tests/tests-asn1c-compiler/104-param-1-OK.asn1.-Pfwide-types
@@ -0,0 +1,219 @@
+
+/*** <<< INCLUDES [Collection] >>> ***/
+
+#include <REAL.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [Collection] >>> ***/
+
+typedef struct Collection_16P0 {
+ A_SET_OF(REAL_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Collection_16P0_t;
+typedef struct Collection_16P1 {
+ A_SET_OF(IA5String_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Collection_16P1_t;
+
+/*** <<< FUNC-DECLS [Collection] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Collection_16P0;
+extern asn_SET_OF_specifics_t asn_SPC_Collection_16P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_Collection_16P0_1[1];
+extern asn_TYPE_descriptor_t asn_DEF_Collection_16P1;
+extern asn_SET_OF_specifics_t asn_SPC_Collection_16P1_specs_3;
+extern asn_TYPE_member_t asn_MBR_Collection_16P1_3[1];
+
+/*** <<< STAT-DEFS [Collection] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Collection_16P0_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_REAL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Collection_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_Collection_16P0_specs_1 = {
+ sizeof(struct Collection_16P0),
+ offsetof(struct Collection_16P0, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Collection_16P0 = {
+ "Collection",
+ "Collection",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Collection_16P0_tags_1,
+ sizeof(asn_DEF_Collection_16P0_tags_1)
+ /sizeof(asn_DEF_Collection_16P0_tags_1[0]), /* 1 */
+ asn_DEF_Collection_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_Collection_16P0_tags_1)
+ /sizeof(asn_DEF_Collection_16P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Collection_16P0_1,
+ 1, /* Single element */
+ &asn_SPC_Collection_16P0_specs_1 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Collection_16P1_3[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Collection_16P1_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_Collection_16P1_specs_3 = {
+ sizeof(struct Collection_16P1),
+ offsetof(struct Collection_16P1, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Collection_16P1 = {
+ "Collection",
+ "Collection",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Collection_16P1_tags_3,
+ sizeof(asn_DEF_Collection_16P1_tags_3)
+ /sizeof(asn_DEF_Collection_16P1_tags_3[0]), /* 1 */
+ asn_DEF_Collection_16P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_Collection_16P1_tags_3)
+ /sizeof(asn_DEF_Collection_16P1_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Collection_16P1_3,
+ 1, /* Single element */
+ &asn_SPC_Collection_16P1_specs_3 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Bunch] >>> ***/
+
+#include "Collection.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Bunch] >>> ***/
+
+typedef struct Bunch {
+ Collection_16P0_t field_REAL;
+ Collection_16P1_t field_IA5String;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Bunch_t;
+
+/*** <<< FUNC-DECLS [Bunch] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Bunch;
+
+/*** <<< STAT-DEFS [Bunch] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Bunch_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Bunch, field_REAL),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Collection_16P0,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "field-REAL"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Bunch, field_IA5String),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Collection_16P1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "field-IA5String"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Bunch_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Bunch_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* field-REAL */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, -1, 0 } /* field-IA5String */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Bunch_specs_1 = {
+ sizeof(struct Bunch),
+ offsetof(struct Bunch, _asn_ctx),
+ asn_MAP_Bunch_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Bunch = {
+ "Bunch",
+ "Bunch",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Bunch_tags_1,
+ sizeof(asn_DEF_Bunch_tags_1)
+ /sizeof(asn_DEF_Bunch_tags_1[0]), /* 1 */
+ asn_DEF_Bunch_tags_1, /* Same as above */
+ sizeof(asn_DEF_Bunch_tags_1)
+ /sizeof(asn_DEF_Bunch_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Bunch_1,
+ 2, /* Elements count */
+ &asn_SPC_Bunch_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/105-param-2-OK.asn1 b/tests/tests-asn1c-compiler/105-param-2-OK.asn1
new file mode 100644
index 0000000..e3ac589
--- /dev/null
+++ b/tests/tests-asn1c-compiler/105-param-2-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .105
+
+ModuleParameterization2
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 105 }
+ DEFINITIONS ::=
+BEGIN
+
+ SIGNED {Type} ::= SEQUENCE {
+ signed Type
+ }
+
+ SignedREAL ::= SIGNED {REAL}
+ SignedSET ::= SIGNED { SET { a INTEGER } }
+
+END
diff --git a/tests/tests-asn1c-compiler/105-param-2-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/105-param-2-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..8b11c2c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/105-param-2-OK.asn1.-Pfwide-types
@@ -0,0 +1,343 @@
+
+/*** <<< INCLUDES [SIGNED] >>> ***/
+
+#include <REAL.h>
+#include <constr_SEQUENCE.h>
+#include <INTEGER.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [SIGNED] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum signed_PR {
+ signed_PR_a, /* Member a is present */
+} signed_PR;
+
+/*** <<< TYPE-DECLS [SIGNED] >>> ***/
+
+typedef struct SIGNED_16P0 {
+ REAL_t Signed;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SIGNED_16P0_t;
+typedef struct SIGNED_16P1 {
+ struct Signed {
+ INTEGER_t a;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(psigned, signed_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } Signed;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SIGNED_16P1_t;
+
+/*** <<< FUNC-DECLS [SIGNED] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0;
+extern asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[1];
+extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1;
+extern asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3;
+extern asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[1];
+
+/*** <<< STAT-DEFS [SIGNED] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P0, Signed),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_REAL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SIGNED_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SIGNED_16P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 0, 0, 0 } /* signed */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1 = {
+ sizeof(struct SIGNED_16P0),
+ offsetof(struct SIGNED_16P0, _asn_ctx),
+ asn_MAP_SIGNED_16P0_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0 = {
+ "SIGNED",
+ "SIGNED",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIGNED_16P0_tags_1,
+ sizeof(asn_DEF_SIGNED_16P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
+ asn_DEF_SIGNED_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIGNED_16P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_16P0_1,
+ 1, /* Elements count */
+ &asn_SPC_SIGNED_16P0_specs_1 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_signed_4[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Signed, a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_signed_tags_4[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_signed_tag2el_4[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* a */
+};
+static const uint8_t asn_MAP_signed_mmap_4[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+static
+asn_SET_specifics_t asn_SPC_signed_specs_4 = {
+ sizeof(struct Signed),
+ offsetof(struct Signed, _asn_ctx),
+ offsetof(struct Signed, _presence_map),
+ asn_MAP_signed_tag2el_4,
+ 1, /* Count of tags in the map */
+ asn_MAP_signed_tag2el_4, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_signed_mmap_4 /* Mandatory elements map */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_signed_4 = {
+ "signed",
+ "signed",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_signed_tags_4,
+ sizeof(asn_DEF_signed_tags_4)
+ /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
+ asn_DEF_signed_tags_4, /* Same as above */
+ sizeof(asn_DEF_signed_tags_4)
+ /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_signed_4,
+ 1, /* Elements count */
+ &asn_SPC_signed_specs_4 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P1, Signed),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_signed_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SIGNED_16P1_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SIGNED_16P1_tag2el_3[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* signed */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3 = {
+ sizeof(struct SIGNED_16P1),
+ offsetof(struct SIGNED_16P1, _asn_ctx),
+ asn_MAP_SIGNED_16P1_tag2el_3,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1 = {
+ "SIGNED",
+ "SIGNED",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIGNED_16P1_tags_3,
+ sizeof(asn_DEF_SIGNED_16P1_tags_3)
+ /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
+ asn_DEF_SIGNED_16P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_SIGNED_16P1_tags_3)
+ /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_16P1_3,
+ 1, /* Elements count */
+ &asn_SPC_SIGNED_16P1_specs_3 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SignedREAL] >>> ***/
+
+#include "SIGNED.h"
+
+/*** <<< TYPE-DECLS [SignedREAL] >>> ***/
+
+typedef SIGNED_16P0_t SignedREAL_t;
+
+/*** <<< FUNC-DECLS [SignedREAL] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SignedREAL;
+asn_struct_free_f SignedREAL_free;
+asn_struct_print_f SignedREAL_print;
+asn_constr_check_f SignedREAL_constraint;
+ber_type_decoder_f SignedREAL_decode_ber;
+der_type_encoder_f SignedREAL_encode_der;
+xer_type_decoder_f SignedREAL_decode_xer;
+xer_type_encoder_f SignedREAL_encode_xer;
+
+/*** <<< CODE [SignedREAL] >>> ***/
+
+/*
+ * This type is implemented using SIGNED_16P0,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [SignedREAL] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_SignedREAL_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SignedREAL = {
+ "SignedREAL",
+ "SignedREAL",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SignedREAL_tags_1,
+ sizeof(asn_DEF_SignedREAL_tags_1)
+ /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
+ asn_DEF_SignedREAL_tags_1, /* Same as above */
+ sizeof(asn_DEF_SignedREAL_tags_1)
+ /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_16P0_1,
+ 1, /* Elements count */
+ &asn_SPC_SIGNED_16P0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SignedSET] >>> ***/
+
+#include "SIGNED.h"
+
+/*** <<< TYPE-DECLS [SignedSET] >>> ***/
+
+typedef SIGNED_16P1_t SignedSET_t;
+
+/*** <<< FUNC-DECLS [SignedSET] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SignedSET;
+asn_struct_free_f SignedSET_free;
+asn_struct_print_f SignedSET_print;
+asn_constr_check_f SignedSET_constraint;
+ber_type_decoder_f SignedSET_decode_ber;
+der_type_encoder_f SignedSET_encode_der;
+xer_type_decoder_f SignedSET_decode_xer;
+xer_type_encoder_f SignedSET_encode_xer;
+
+/*** <<< CODE [SignedSET] >>> ***/
+
+/*
+ * This type is implemented using SIGNED_16P1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [SignedSET] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_SignedSET_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SignedSET = {
+ "SignedSET",
+ "SignedSET",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SignedSET_tags_1,
+ sizeof(asn_DEF_SignedSET_tags_1)
+ /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
+ asn_DEF_SignedSET_tags_1, /* Same as above */
+ sizeof(asn_DEF_SignedSET_tags_1)
+ /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_16P1_3,
+ 1, /* Elements count */
+ &asn_SPC_SIGNED_16P1_specs_3 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/106-param-constr-OK.asn1 b/tests/tests-asn1c-compiler/106-param-constr-OK.asn1
new file mode 100644
index 0000000..ea63c3d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/106-param-constr-OK.asn1
@@ -0,0 +1,22 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .106
+
+ModuleParameterizationWithConstraints
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 106 }
+ DEFINITIONS ::=
+BEGIN
+
+ Narrow {Type, INTEGER:value} ::= SEQUENCE {
+ narrow1 Type (1..5) DEFAULT value,
+ narrow2 [0] Type (2..5),
+ narrow3 [1] Type (3..5) OPTIONAL
+ }
+
+ NarrowInteger ::= Narrow {INTEGER (0..10), 3}
+
+END
diff --git a/tests/tests-asn1c-compiler/106-param-constr-OK.asn1.-P b/tests/tests-asn1c-compiler/106-param-constr-OK.asn1.-P
new file mode 100644
index 0000000..8acf397
--- /dev/null
+++ b/tests/tests-asn1c-compiler/106-param-constr-OK.asn1.-P
@@ -0,0 +1,259 @@
+
+/*** <<< INCLUDES [Narrow] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Narrow] >>> ***/
+
+typedef struct Narrow_15P0 {
+ long *narrow1 /* DEFAULT 3 */;
+ long narrow2;
+ long *narrow3 /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Narrow_15P0_t;
+
+/*** <<< FUNC-DECLS [Narrow] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Narrow_15P0;
+extern asn_SEQUENCE_specifics_t asn_SPC_Narrow_15P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_Narrow_15P0_1[3];
+
+/*** <<< CODE [Narrow] >>> ***/
+
+static int
+memb_narrow1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 1 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_narrow2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 2 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_narrow3_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 3 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [Narrow] >>> ***/
+
+static int asn_DFL_2_set_3(int set_value, void **sptr) {
+ long *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 3 */
+ *st = 3;
+ return 0;
+ } else {
+ /* Test default value 3 */
+ return (*st == 3);
+ }
+}
+asn_TYPE_member_t asn_MBR_Narrow_15P0_1[] = {
+ { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow1),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_narrow1_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
+ .name = "narrow1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Narrow_15P0, narrow2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_narrow2_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "narrow2"
+ },
+ { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_narrow3_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "narrow3"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Narrow_15P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Narrow_15P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* narrow1 */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* narrow2 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* narrow3 */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Narrow_15P0_specs_1 = {
+ sizeof(struct Narrow_15P0),
+ offsetof(struct Narrow_15P0, _asn_ctx),
+ asn_MAP_Narrow_15P0_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Narrow_15P0 = {
+ "Narrow",
+ "Narrow",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Narrow_15P0_tags_1,
+ sizeof(asn_DEF_Narrow_15P0_tags_1)
+ /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */
+ asn_DEF_Narrow_15P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_Narrow_15P0_tags_1)
+ /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Narrow_15P0_1,
+ 3, /* Elements count */
+ &asn_SPC_Narrow_15P0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NarrowInteger] >>> ***/
+
+#include "Narrow.h"
+
+/*** <<< TYPE-DECLS [NarrowInteger] >>> ***/
+
+typedef Narrow_15P0_t NarrowInteger_t;
+
+/*** <<< FUNC-DECLS [NarrowInteger] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NarrowInteger;
+asn_struct_free_f NarrowInteger_free;
+asn_struct_print_f NarrowInteger_print;
+asn_constr_check_f NarrowInteger_constraint;
+ber_type_decoder_f NarrowInteger_decode_ber;
+der_type_encoder_f NarrowInteger_encode_der;
+xer_type_decoder_f NarrowInteger_decode_xer;
+xer_type_encoder_f NarrowInteger_encode_xer;
+
+/*** <<< CODE [NarrowInteger] >>> ***/
+
+/*
+ * This type is implemented using Narrow_15P0,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NarrowInteger] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NarrowInteger_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NarrowInteger = {
+ "NarrowInteger",
+ "NarrowInteger",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NarrowInteger_tags_1,
+ sizeof(asn_DEF_NarrowInteger_tags_1)
+ /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */
+ asn_DEF_NarrowInteger_tags_1, /* Same as above */
+ sizeof(asn_DEF_NarrowInteger_tags_1)
+ /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Narrow_15P0_1,
+ 3, /* Elements count */
+ &asn_SPC_Narrow_15P0_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/107-param-constr-2-OK.asn1 b/tests/tests-asn1c-compiler/107-param-constr-2-OK.asn1
new file mode 100644
index 0000000..23d23ec
--- /dev/null
+++ b/tests/tests-asn1c-compiler/107-param-constr-2-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .107
+
+ModuleParameterizationWithConstraints2
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 107 }
+ DEFINITIONS ::=
+BEGIN
+
+ Narrow {Type} ::= Type (2..5)
+
+ NarrowInteger ::= Narrow {INTEGER}
+
+END
diff --git a/tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1 b/tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1
new file mode 100644
index 0000000..2b52486
--- /dev/null
+++ b/tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .108
+
+ModuleParameterizationWithConstraints3
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 108 }
+ DEFINITIONS ::=
+BEGIN
+
+ MinMax {Type, INTEGER:low-bound} ::= Type (low-bound..MAX)
+
+ ThreePlus ::= MinMax {INTEGER, 3}
+
+END
diff --git a/tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..7be99ad
--- /dev/null
+++ b/tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1.-Pfwide-types
@@ -0,0 +1,178 @@
+
+/*** <<< INCLUDES [MinMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [MinMax] >>> ***/
+
+typedef INTEGER_t MinMax_16P0_t;
+
+/*** <<< FUNC-DECLS [MinMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_MinMax_16P0;
+asn_struct_free_f MinMax_16P0_free;
+asn_struct_print_f MinMax_16P0_print;
+asn_constr_check_f MinMax_16P0_constraint;
+ber_type_decoder_f MinMax_16P0_decode_ber;
+der_type_encoder_f MinMax_16P0_encode_der;
+xer_type_decoder_f MinMax_16P0_decode_xer;
+xer_type_encoder_f MinMax_16P0_encode_xer;
+
+/*** <<< CODE [MinMax] >>> ***/
+
+int
+MinMax_16P0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 3)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [MinMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = {
+ "MinMax",
+ "MinMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ MinMax_16P0_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_MinMax_16P0_tags_1,
+ sizeof(asn_DEF_MinMax_16P0_tags_1)
+ /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
+ asn_DEF_MinMax_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_MinMax_16P0_tags_1)
+ /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [ThreePlus] >>> ***/
+
+#include "MinMax.h"
+
+/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
+
+typedef MinMax_16P0_t ThreePlus_t;
+
+/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
+asn_struct_free_f ThreePlus_free;
+asn_struct_print_f ThreePlus_print;
+asn_constr_check_f ThreePlus_constraint;
+ber_type_decoder_f ThreePlus_decode_ber;
+der_type_encoder_f ThreePlus_encode_der;
+xer_type_decoder_f ThreePlus_decode_xer;
+xer_type_encoder_f ThreePlus_encode_xer;
+
+/*** <<< CODE [ThreePlus] >>> ***/
+
+int
+ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 3)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using MinMax_16P0,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [ThreePlus] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
+ "ThreePlus",
+ "ThreePlus",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ ThreePlus_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ThreePlus_tags_1,
+ sizeof(asn_DEF_ThreePlus_tags_1)
+ /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
+ asn_DEF_ThreePlus_tags_1, /* Same as above */
+ sizeof(asn_DEF_ThreePlus_tags_1)
+ /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/109-bit-string-SE.asn1 b/tests/tests-asn1c-compiler/109-bit-string-SE.asn1
new file mode 100644
index 0000000..a07f7a1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/109-bit-string-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .109
+
+ModuleBitStringExtensibility
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 109 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= BIT STRING { one(1), ... }
+
+END
diff --git a/tests/tests-asn1c-compiler/11-int-SE.asn1 b/tests/tests-asn1c-compiler/11-int-SE.asn1
new file mode 100644
index 0000000..e140701
--- /dev/null
+++ b/tests/tests-asn1c-compiler/11-int-SE.asn1
@@ -0,0 +1,18 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .11
+
+ModuleTestInt5
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 11 }
+ DEFINITIONS ::=
+BEGIN
+
+ -- recursive definition loop
+ alpha INTEGER ::= beta
+ beta INTEGER ::= alpha
+
+END
diff --git a/tests/tests-asn1c-compiler/110-param-3-OK.asn1 b/tests/tests-asn1c-compiler/110-param-3-OK.asn1
new file mode 100644
index 0000000..383f16c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/110-param-3-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .110
+
+ModuleParameterization3
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 110 }
+ DEFINITIONS ::=
+BEGIN
+
+ Flag{Color} ::= SEQUENCE {
+ field Color DEFAULT blue
+ }
+
+ IntegerColorFlag ::= Flag{INTEGER{ red(0), green(1), blue(5) }}
+ EnumeratedColorFlag ::= Flag{ENUMERATED{ red(3), green, blue }}
+
+END
diff --git a/tests/tests-asn1c-compiler/110-param-3-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/110-param-3-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..671781a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/110-param-3-OK.asn1.-Pfwide-types
@@ -0,0 +1,371 @@
+
+/*** <<< INCLUDES [Flag] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [Flag] >>> ***/
+
+typedef enum field {
+ field_red = 0,
+ field_green = 1,
+ field_blue = 5
+} e_field;
+typedef enum field {
+ field_red = 3,
+ field_green = 4,
+ field_blue = 5
+} e_field;
+
+/*** <<< TYPE-DECLS [Flag] >>> ***/
+
+typedef struct Flag_16P0 {
+ INTEGER_t *field /* DEFAULT 5 */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Flag_16P0_t;
+typedef struct Flag_16P1 {
+ ENUMERATED_t *field /* DEFAULT 5 */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Flag_16P1_t;
+
+/*** <<< FUNC-DECLS [Flag] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Flag_16P0;
+extern asn_SEQUENCE_specifics_t asn_SPC_Flag_16P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_Flag_16P0_1[1];
+/* extern asn_TYPE_descriptor_t asn_DEF_field_7; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_Flag_16P1;
+extern asn_SEQUENCE_specifics_t asn_SPC_Flag_16P1_specs_6;
+extern asn_TYPE_member_t asn_MBR_Flag_16P1_6[1];
+
+/*** <<< CODE [Flag] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Flag] >>> ***/
+
+static int asn_DFL_2_set_5(int set_value, void **sptr) {
+ INTEGER_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 5 */
+ return asn_long2INTEGER(st, 5);
+ } else {
+ /* Test default value 5 */
+ long value;
+ if(asn_INTEGER2long(st, &value))
+ return -1;
+ return (value == 5);
+ }
+}
+asn_TYPE_member_t asn_MBR_Flag_16P0_1[] = {
+ { ATF_POINTER, 1, offsetof(struct Flag_16P0, field),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_2_set_5, /* DEFAULT 5 */
+ .name = "field"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Flag_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Flag_16P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* field */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Flag_16P0_specs_1 = {
+ sizeof(struct Flag_16P0),
+ offsetof(struct Flag_16P0, _asn_ctx),
+ asn_MAP_Flag_16P0_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Flag_16P0 = {
+ "Flag",
+ "Flag",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Flag_16P0_tags_1,
+ sizeof(asn_DEF_Flag_16P0_tags_1)
+ /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */
+ asn_DEF_Flag_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_Flag_16P0_tags_1)
+ /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Flag_16P0_1,
+ 1, /* Elements count */
+ &asn_SPC_Flag_16P0_specs_1 /* Additional specs */
+};
+
+static int asn_DFL_7_set_5(int set_value, void **sptr) {
+ ENUMERATED_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 5 */
+ return asn_long2INTEGER(st, 5);
+ } else {
+ /* Test default value 5 */
+ long value;
+ if(asn_INTEGER2long(st, &value))
+ return -1;
+ return (value == 5);
+ }
+}
+static const asn_INTEGER_enum_map_t asn_MAP_field_value2enum_7[] = {
+ { 3, 3, "red" },
+ { 4, 5, "green" },
+ { 5, 4, "blue" }
+};
+static const unsigned int asn_MAP_field_enum2value_7[] = {
+ 2, /* blue(5) */
+ 1, /* green(4) */
+ 0 /* red(3) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_field_specs_7 = {
+ asn_MAP_field_value2enum_7, /* "tag" => N; sorted by tag */
+ asn_MAP_field_enum2value_7, /* N => "tag"; sorted by N */
+ 3, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_field_tags_7[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_field_7 = {
+ "field",
+ "field",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_field_tags_7,
+ sizeof(asn_DEF_field_tags_7)
+ /sizeof(asn_DEF_field_tags_7[0]), /* 1 */
+ asn_DEF_field_tags_7, /* Same as above */
+ sizeof(asn_DEF_field_tags_7)
+ /sizeof(asn_DEF_field_tags_7[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_field_specs_7 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Flag_16P1_6[] = {
+ { ATF_POINTER, 1, offsetof(struct Flag_16P1, field),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_field_7,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_7_set_5, /* DEFAULT 5 */
+ .name = "field"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Flag_16P1_tags_6[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Flag_16P1_tag2el_6[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* field */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Flag_16P1_specs_6 = {
+ sizeof(struct Flag_16P1),
+ offsetof(struct Flag_16P1, _asn_ctx),
+ asn_MAP_Flag_16P1_tag2el_6,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Flag_16P1 = {
+ "Flag",
+ "Flag",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Flag_16P1_tags_6,
+ sizeof(asn_DEF_Flag_16P1_tags_6)
+ /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */
+ asn_DEF_Flag_16P1_tags_6, /* Same as above */
+ sizeof(asn_DEF_Flag_16P1_tags_6)
+ /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Flag_16P1_6,
+ 1, /* Elements count */
+ &asn_SPC_Flag_16P1_specs_6 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [IntegerColorFlag] >>> ***/
+
+#include "Flag.h"
+
+/*** <<< TYPE-DECLS [IntegerColorFlag] >>> ***/
+
+typedef Flag_16P0_t IntegerColorFlag_t;
+
+/*** <<< FUNC-DECLS [IntegerColorFlag] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag;
+asn_struct_free_f IntegerColorFlag_free;
+asn_struct_print_f IntegerColorFlag_print;
+asn_constr_check_f IntegerColorFlag_constraint;
+ber_type_decoder_f IntegerColorFlag_decode_ber;
+der_type_encoder_f IntegerColorFlag_encode_der;
+xer_type_decoder_f IntegerColorFlag_decode_xer;
+xer_type_encoder_f IntegerColorFlag_encode_xer;
+
+/*** <<< CODE [IntegerColorFlag] >>> ***/
+
+/*
+ * This type is implemented using Flag_16P0,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [IntegerColorFlag] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_IntegerColorFlag_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag = {
+ "IntegerColorFlag",
+ "IntegerColorFlag",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_IntegerColorFlag_tags_1,
+ sizeof(asn_DEF_IntegerColorFlag_tags_1)
+ /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */
+ asn_DEF_IntegerColorFlag_tags_1, /* Same as above */
+ sizeof(asn_DEF_IntegerColorFlag_tags_1)
+ /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Flag_16P0_1,
+ 1, /* Elements count */
+ &asn_SPC_Flag_16P0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [EnumeratedColorFlag] >>> ***/
+
+#include "Flag.h"
+
+/*** <<< TYPE-DECLS [EnumeratedColorFlag] >>> ***/
+
+typedef Flag_16P1_t EnumeratedColorFlag_t;
+
+/*** <<< FUNC-DECLS [EnumeratedColorFlag] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag;
+asn_struct_free_f EnumeratedColorFlag_free;
+asn_struct_print_f EnumeratedColorFlag_print;
+asn_constr_check_f EnumeratedColorFlag_constraint;
+ber_type_decoder_f EnumeratedColorFlag_decode_ber;
+der_type_encoder_f EnumeratedColorFlag_encode_der;
+xer_type_decoder_f EnumeratedColorFlag_decode_xer;
+xer_type_encoder_f EnumeratedColorFlag_encode_xer;
+
+/*** <<< CODE [EnumeratedColorFlag] >>> ***/
+
+/*
+ * This type is implemented using Flag_16P1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [EnumeratedColorFlag] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_EnumeratedColorFlag_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag = {
+ "EnumeratedColorFlag",
+ "EnumeratedColorFlag",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_EnumeratedColorFlag_tags_1,
+ sizeof(asn_DEF_EnumeratedColorFlag_tags_1)
+ /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */
+ asn_DEF_EnumeratedColorFlag_tags_1, /* Same as above */
+ sizeof(asn_DEF_EnumeratedColorFlag_tags_1)
+ /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Flag_16P1_6,
+ 1, /* Elements count */
+ &asn_SPC_Flag_16P1_specs_6 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/111-param-4-SE.asn1 b/tests/tests-asn1c-compiler/111-param-4-SE.asn1
new file mode 100644
index 0000000..4c542b8
--- /dev/null
+++ b/tests/tests-asn1c-compiler/111-param-4-SE.asn1
@@ -0,0 +1,21 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .111
+
+ModuleParameterization4
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 111 }
+ DEFINITIONS ::=
+BEGIN
+
+ Flag{Color} ::= SEQUENCE {
+ field Color DEFAULT cyan
+ }
+
+ IntegerColorFlag ::= Flag{INTEGER{ red(0), green(1), blue(5) }}
+ EnumeratedColorFlag ::= Flag{ENUMERATED{ red(3), green, blue }}
+
+END
diff --git a/tests/tests-asn1c-compiler/112-param-class-OK.asn1 b/tests/tests-asn1c-compiler/112-param-class-OK.asn1
new file mode 100644
index 0000000..d5512df
--- /dev/null
+++ b/tests/tests-asn1c-compiler/112-param-class-OK.asn1
@@ -0,0 +1,24 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .112
+
+ModuleParameterizationClass
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 112 }
+ DEFINITIONS ::=
+BEGIN
+
+ PCLASS {Type, INTEGER:value, INTEGER:ValueSet} ::= CLASS {
+ &valueField1 Type,
+ &valueField2 INTEGER DEFAULT value,
+ &valueField3 INTEGER (ValueSet),
+ &ValueSetField INTEGER DEFAULT {ValueSet}
+ } WITH SYNTAX {
+ &valueField1, &valueField2, &valueField3, &ValueSetField }
+
+ SCLASS ::= PCLASS {REAL, 111, {1 | 2 | 3}}
+
+END
diff --git a/tests/tests-asn1c-compiler/112-param-class-OK.asn1.-EF b/tests/tests-asn1c-compiler/112-param-class-OK.asn1.-EF
new file mode 100644
index 0000000..9922367
--- /dev/null
+++ b/tests/tests-asn1c-compiler/112-param-class-OK.asn1.-EF
@@ -0,0 +1,17 @@
+ModuleParameterizationClass { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 112 }
+DEFINITIONS ::=
+BEGIN
+
+PCLASS{Type, INTEGER:value, INTEGER:ValueSet} ::= CLASS {
+ &valueField1 Type,
+ &valueField2 INTEGER DEFAULT value,
+ &valueField3 INTEGER (ValueSet),
+ &ValueSetField INTEGER DEFAULT {ValueSet}
+} WITH SYNTAX {
+ &valueField1, &valueField2, &valueField3, &ValueSetField }
+
+
+SCLASS ::= PCLASS{ REAL, 111, {1 | 2 | 3}}
+
+END
diff --git a/tests/tests-asn1c-compiler/113-bit-string-SE.asn1 b/tests/tests-asn1c-compiler/113-bit-string-SE.asn1
new file mode 100644
index 0000000..79d4565
--- /dev/null
+++ b/tests/tests-asn1c-compiler/113-bit-string-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .113
+
+ModuleBitStringIdentifierUniqueness
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 113 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= BIT STRING { one(1), one(2) }
+
+END
diff --git a/tests/tests-asn1c-compiler/114-bit-string-SE.asn1 b/tests/tests-asn1c-compiler/114-bit-string-SE.asn1
new file mode 100644
index 0000000..5006b06
--- /dev/null
+++ b/tests/tests-asn1c-compiler/114-bit-string-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .114
+
+ModuleBitStringNegativeInteger
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 114 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= BIT STRING { one(-2) }
+
+END
diff --git a/tests/tests-asn1c-compiler/115-bit-string-OK.asn1 b/tests/tests-asn1c-compiler/115-bit-string-OK.asn1
new file mode 100644
index 0000000..5433470
--- /dev/null
+++ b/tests/tests-asn1c-compiler/115-bit-string-OK.asn1
@@ -0,0 +1,17 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .115
+
+ModuleBitStringReferencedValue
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 115 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= BIT STRING { one(a) }
+ a INTEGER ::= 123
+
+END
diff --git a/tests/tests-asn1c-compiler/116-bit-string-SE.asn1 b/tests/tests-asn1c-compiler/116-bit-string-SE.asn1
new file mode 100644
index 0000000..f5967c0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/116-bit-string-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .116
+
+ModuleBitStringSameValues
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 116 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= BIT STRING { one(1), another(1) }
+
+END
diff --git a/tests/tests-asn1c-compiler/117-real-constraint-OK.asn1 b/tests/tests-asn1c-compiler/117-real-constraint-OK.asn1
new file mode 100644
index 0000000..7e0e5cd
--- /dev/null
+++ b/tests/tests-asn1c-compiler/117-real-constraint-OK.asn1
@@ -0,0 +1,16 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .117
+
+ModuleRealConstraint
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 117 }
+ DEFINITIONS ::=
+BEGIN
+
+ R ::= REAL (0..3.14159265)
+
+END
diff --git a/tests/tests-asn1c-compiler/117-real-constraint-OK.asn1.-EF b/tests/tests-asn1c-compiler/117-real-constraint-OK.asn1.-EF
new file mode 100644
index 0000000..2745e14
--- /dev/null
+++ b/tests/tests-asn1c-compiler/117-real-constraint-OK.asn1.-EF
@@ -0,0 +1,8 @@
+ModuleRealConstraint { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 117 }
+DEFINITIONS ::=
+BEGIN
+
+R ::= REAL (0..3.141593)
+
+END
diff --git a/tests/tests-asn1c-compiler/118-per-constraint-OK.asn1 b/tests/tests-asn1c-compiler/118-per-constraint-OK.asn1
new file mode 100644
index 0000000..98c9a35
--- /dev/null
+++ b/tests/tests-asn1c-compiler/118-per-constraint-OK.asn1
@@ -0,0 +1,26 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .118
+
+ModuleConstraintPrecedence
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 118 }
+ DEFINITIONS ::=
+BEGIN
+
+ E1 ::= IA5String (SIZE(1..5, ...) ^ FROM("A".."Z"))
+ E2 ::= IA5String (SIZE(1..5,...,5)) (FROM("A".."Z"))
+ E3 ::= IA5String (SIZE(1..5) ^ FROM("A".."Z"),...)
+ E4 ::= IA5String (FROM("A".."Z"),...) (SIZE(1..5))
+
+ C ::= IA5String (SIZE(10) ^ FROM("A".."D")
+ | SIZE(20) ^ FROM("D".."F"))
+
+ P ::= IA5String (FROM("AB") ^ SIZE(1..2)
+ | FROM("DE") ^ SIZE(3)
+ | FROM("AXE") ^ SIZE(1..5))
+
+END
diff --git a/tests/tests-asn1c-compiler/118-per-constraint-OK.asn1.-EFprint-constraints b/tests/tests-asn1c-compiler/118-per-constraint-OK.asn1.-EFprint-constraints
new file mode 100644
index 0000000..e53b8b9
--- /dev/null
+++ b/tests/tests-asn1c-compiler/118-per-constraint-OK.asn1.-EFprint-constraints
Binary files differ
diff --git a/tests/tests-asn1c-compiler/119-per-strings-OK.asn1 b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1
new file mode 100644
index 0000000..ae1ec46
--- /dev/null
+++ b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1
@@ -0,0 +1,48 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .119
+
+ModulePERStrings
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 119 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ PDU ::= SEQUENCE {
+ many SEQUENCE OF PDU OPTIONAL,
+ ia5 IA5String OPTIONAL,
+ ia5-c IA5String (FROM("A".."Z")) OPTIONAL,
+ ia5-ce IA5String (FROM("A".."Z",...)) OPTIONAL,
+ ia5-ir IA5String (FROM("A".."B"|"X".."Z")) OPTIONAL,
+ vs VisibleString OPTIONAL,
+ vs-c VisibleString (FROM("A".."Z")) OPTIONAL,
+ vs-ce VisibleString (FROM("A".."Z",...)) OPTIONAL,
+ vs-ir VisibleString (FROM("A".."B"|"X".."Z")) OPTIONAL,
+ pr PrintableString OPTIONAL,
+ pr-c PrintableString (FROM("A".."Z")) OPTIONAL,
+ pr-ir PrintableString (FROM("A".."B"|"X".."Z")) OPTIONAL,
+ ns NumericString OPTIONAL,
+ ns-c NumericString (FROM("5".."9")) OPTIONAL,
+ ns-ce NumericString (FROM("5".."9",...)) OPTIONAL,
+ ns-ir NumericString (FROM("1"|"9")) OPTIONAL,
+ ut-c UTF8String (SIZE(6)) OPTIONAL,
+ ut-ce UTF8String (SIZE(6,...)) OPTIONAL,
+ ut-ir UTF8String (FROM("A"|"Z")) OPTIONAL,
+ bm BMPString OPTIONAL,
+ bm-c BMPString (FROM("A".."Z")) OPTIONAL,
+ bm-cs BMPString (SIZE(6)) OPTIONAL,
+ bm-ce BMPString (FROM("A".."Z",...)) OPTIONAL,
+ bm-ir BMPString (FROM("A".."B"|"X".."Z")) OPTIONAL,
+ us UniversalString OPTIONAL,
+ us-c UniversalString (FROM("A".."Z")) OPTIONAL,
+ us-cs UniversalString (SIZE(6)) OPTIONAL,
+ us-ce UniversalString (FROM("A".."Z",...)) OPTIONAL,
+ us-ir UniversalString (FROM("A".."B"|"X".."Z")) OPTIONAL,
+ real REAL OPTIONAL,
+ oid OBJECT IDENTIFIER OPTIONAL
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-EF b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-EF
new file mode 100644
index 0000000..7819c03
--- /dev/null
+++ b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-EF
@@ -0,0 +1,40 @@
+ModulePERStrings { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 119 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+PDU ::= SEQUENCE {
+ many [0] IMPLICIT SEQUENCE OF PDU OPTIONAL,
+ ia5 [1] IMPLICIT IA5String OPTIONAL,
+ ia5-c [2] IMPLICIT IA5String (FROM("A".."Z")) OPTIONAL,
+ ia5-ce [3] IMPLICIT IA5String (FROM("A".."Z",...)) OPTIONAL,
+ ia5-ir [4] IMPLICIT IA5String (FROM("A".."B" | "X".."Z")) OPTIONAL,
+ vs [5] IMPLICIT VisibleString OPTIONAL,
+ vs-c [6] IMPLICIT VisibleString (FROM("A".."Z")) OPTIONAL,
+ vs-ce [7] IMPLICIT VisibleString (FROM("A".."Z",...)) OPTIONAL,
+ vs-ir [8] IMPLICIT VisibleString (FROM("A".."B" | "X".."Z")) OPTIONAL,
+ pr [9] IMPLICIT PrintableString OPTIONAL,
+ pr-c [10] IMPLICIT PrintableString (FROM("A".."Z")) OPTIONAL,
+ pr-ir [11] IMPLICIT PrintableString (FROM("A".."B" | "X".."Z")) OPTIONAL,
+ ns [12] IMPLICIT NumericString OPTIONAL,
+ ns-c [13] IMPLICIT NumericString (FROM("5".."9")) OPTIONAL,
+ ns-ce [14] IMPLICIT NumericString (FROM("5".."9",...)) OPTIONAL,
+ ns-ir [15] IMPLICIT NumericString (FROM("1" | "9")) OPTIONAL,
+ ut-c [16] IMPLICIT UTF8String (SIZE(6)) OPTIONAL,
+ ut-ce [17] IMPLICIT UTF8String (SIZE(6,...)) OPTIONAL,
+ ut-ir [18] IMPLICIT UTF8String (FROM("A" | "Z")) OPTIONAL,
+ bm [19] IMPLICIT BMPString OPTIONAL,
+ bm-c [20] IMPLICIT BMPString (FROM("A".."Z")) OPTIONAL,
+ bm-cs [21] IMPLICIT BMPString (SIZE(6)) OPTIONAL,
+ bm-ce [22] IMPLICIT BMPString (FROM("A".."Z",...)) OPTIONAL,
+ bm-ir [23] IMPLICIT BMPString (FROM("A".."B" | "X".."Z")) OPTIONAL,
+ us [24] IMPLICIT UniversalString OPTIONAL,
+ us-c [25] IMPLICIT UniversalString (FROM("A".."Z")) OPTIONAL,
+ us-cs [26] IMPLICIT UniversalString (SIZE(6)) OPTIONAL,
+ us-ce [27] IMPLICIT UniversalString (FROM("A".."Z",...)) OPTIONAL,
+ us-ir [28] IMPLICIT UniversalString (FROM("A".."B" | "X".."Z")) OPTIONAL,
+ real [29] IMPLICIT REAL OPTIONAL,
+ oid [30] IMPLICIT OBJECT IDENTIFIER OPTIONAL
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..637a260
--- /dev/null
+++ b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-Pgen-PER
@@ -0,0 +1,1654 @@
+
+/*** <<< INCLUDES [PDU] >>> ***/
+
+#include <IA5String.h>
+#include <VisibleString.h>
+#include <PrintableString.h>
+#include <NumericString.h>
+#include <UTF8String.h>
+#include <BMPString.h>
+#include <UniversalString.h>
+#include <NativeReal.h>
+#include <OBJECT_IDENTIFIER.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [PDU] >>> ***/
+
+struct PDU;
+
+/*** <<< TYPE-DECLS [PDU] >>> ***/
+
+typedef struct PDU {
+ struct many {
+ A_SEQUENCE_OF(struct PDU) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *many;
+ IA5String_t *ia5 /* OPTIONAL */;
+ IA5String_t *ia5_c /* OPTIONAL */;
+ IA5String_t *ia5_ce /* OPTIONAL */;
+ IA5String_t *ia5_ir /* OPTIONAL */;
+ VisibleString_t *vs /* OPTIONAL */;
+ VisibleString_t *vs_c /* OPTIONAL */;
+ VisibleString_t *vs_ce /* OPTIONAL */;
+ VisibleString_t *vs_ir /* OPTIONAL */;
+ PrintableString_t *pr /* OPTIONAL */;
+ PrintableString_t *pr_c /* OPTIONAL */;
+ PrintableString_t *pr_ir /* OPTIONAL */;
+ NumericString_t *ns /* OPTIONAL */;
+ NumericString_t *ns_c /* OPTIONAL */;
+ NumericString_t *ns_ce /* OPTIONAL */;
+ NumericString_t *ns_ir /* OPTIONAL */;
+ UTF8String_t *ut_c /* OPTIONAL */;
+ UTF8String_t *ut_ce /* OPTIONAL */;
+ UTF8String_t *ut_ir /* OPTIONAL */;
+ BMPString_t *bm /* OPTIONAL */;
+ BMPString_t *bm_c /* OPTIONAL */;
+ BMPString_t *bm_cs /* OPTIONAL */;
+ BMPString_t *bm_ce /* OPTIONAL */;
+ BMPString_t *bm_ir /* OPTIONAL */;
+ UniversalString_t *us /* OPTIONAL */;
+ UniversalString_t *us_c /* OPTIONAL */;
+ UniversalString_t *us_cs /* OPTIONAL */;
+ UniversalString_t *us_ce /* OPTIONAL */;
+ UniversalString_t *us_ir /* OPTIONAL */;
+ double *real /* OPTIONAL */;
+ OBJECT_IDENTIFIER_t *oid /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} PDU_t;
+
+/*** <<< FUNC-DECLS [PDU] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PDU;
+extern asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1;
+extern asn_TYPE_member_t asn_MBR_PDU_1[31];
+
+/*** <<< POST-INCLUDE [PDU] >>> ***/
+
+#include "PDU.h"
+
+/*** <<< CTABLES [PDU] >>> ***/
+
+static int check_permitted_alphabet_5(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_6(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static const int permitted_alphabet_table_7[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */
+};
+static const int permitted_alphabet_code2value_7[5] = {
+65,66,88,89,90,};
+
+
+static int check_permitted_alphabet_7(const void *sptr) {
+ const int *table = permitted_alphabet_table_7;
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_9(const void *sptr) {
+ /* The underlying type is VisibleString */
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_10(const void *sptr) {
+ /* The underlying type is VisibleString */
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static const int permitted_alphabet_table_11[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */
+};
+static const int permitted_alphabet_code2value_11[5] = {
+65,66,88,89,90,};
+
+
+static int check_permitted_alphabet_11(const void *sptr) {
+ const int *table = permitted_alphabet_table_11;
+ /* The underlying type is VisibleString */
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_13(const void *sptr) {
+ /* The underlying type is PrintableString */
+ const PrintableString_t *st = (const PrintableString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static const int permitted_alphabet_table_14[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */
+};
+static const int permitted_alphabet_code2value_14[5] = {
+65,66,88,89,90,};
+
+
+static int check_permitted_alphabet_14(const void *sptr) {
+ const int *table = permitted_alphabet_table_14;
+ /* The underlying type is PrintableString */
+ const PrintableString_t *st = (const PrintableString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_16(const void *sptr) {
+ /* The underlying type is NumericString */
+ const NumericString_t *st = (const NumericString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 53 && cv <= 57)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_17(const void *sptr) {
+ /* The underlying type is NumericString */
+ const NumericString_t *st = (const NumericString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 53 && cv <= 57)) return -1;
+ }
+ return 0;
+}
+
+static const int permitted_alphabet_table_18[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, /* 1 9 */
+};
+static const int permitted_alphabet_code2value_18[2] = {
+49,57,};
+
+
+static int check_permitted_alphabet_18(const void *sptr) {
+ const int *table = permitted_alphabet_table_18;
+ /* The underlying type is NumericString */
+ const NumericString_t *st = (const NumericString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+static const int permitted_alphabet_table_21[128] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, /* Z */
+};
+
+static int check_permitted_alphabet_21(const void *sptr) {
+ const int *table = permitted_alphabet_table_21;
+ /* The underlying type is UTF8String */
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(cv >= 0x80) return -1;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_23(const void *sptr) {
+ /* The underlying type is BMPString */
+ const BMPString_t *st = (const BMPString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 2) return -1; /* (size%2)! */
+ for(; ch < end; ch += 2) {
+ uint16_t cv = (ch[0] << 8)
+ | ch[1];
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_24(const void *sptr) {
+ /* The underlying type is BMPString */
+ const BMPString_t *st = (const BMPString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 2) return -1; /* (size%2)! */
+ for(; ch < end; ch += 2) {
+ uint16_t cv = (ch[0] << 8)
+ | ch[1];
+ if(!(cv <= 65533)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_25(const void *sptr) {
+ /* The underlying type is BMPString */
+ const BMPString_t *st = (const BMPString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 2) return -1; /* (size%2)! */
+ for(; ch < end; ch += 2) {
+ uint16_t cv = (ch[0] << 8)
+ | ch[1];
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static const int permitted_alphabet_table_26[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */
+};
+static const int permitted_alphabet_code2value_26[5] = {
+65,66,88,89,90,};
+
+
+static int check_permitted_alphabet_26(const void *sptr) {
+ const int *table = permitted_alphabet_table_26;
+ /* The underlying type is BMPString */
+ const BMPString_t *st = (const BMPString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 2) return -1; /* (size%2)! */
+ for(; ch < end; ch += 2) {
+ uint16_t cv = (ch[0] << 8)
+ | ch[1];
+ if(cv > 255) return -1;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_28(const void *sptr) {
+ /* The underlying type is UniversalString */
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 4) return -1; /* (size%4)! */
+ for(; ch < end; ch += 4) {
+ uint32_t cv = (ch[0] << 24)
+ | (ch[1] << 16)
+ | (ch[2] << 8)
+ | ch[3];
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_29(const void *sptr) {
+ /* The underlying type is UniversalString */
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 4) return -1; /* (size%4)! */
+ for(; ch < end; ch += 4) {
+ uint32_t cv = (ch[0] << 24)
+ | (ch[1] << 16)
+ | (ch[2] << 8)
+ | ch[3];
+ if(!(1 /* Constraint matches natural range of cv */)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_30(const void *sptr) {
+ /* The underlying type is UniversalString */
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 4) return -1; /* (size%4)! */
+ for(; ch < end; ch += 4) {
+ uint32_t cv = (ch[0] << 24)
+ | (ch[1] << 16)
+ | (ch[2] << 8)
+ | ch[3];
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static const int permitted_alphabet_table_31[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* AB */
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, /* XYZ */
+};
+static const int permitted_alphabet_code2value_31[5] = {
+65,66,88,89,90,};
+
+
+static int check_permitted_alphabet_31(const void *sptr) {
+ const int *table = permitted_alphabet_table_31;
+ /* The underlying type is UniversalString */
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 4) return -1; /* (size%4)! */
+ for(; ch < end; ch += 4) {
+ uint32_t cv = (ch[0] << 24)
+ | (ch[1] << 16)
+ | (ch[2] << 8)
+ | ch[3];
+ if(cv > 255) return -1;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [PDU] >>> ***/
+
+static int
+memb_ia5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_5(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_ia5_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_6(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_ia5_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_7(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_ia5_ir_7_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_7)/sizeof(permitted_alphabet_table_7[0]))
+ return -1;
+ return permitted_alphabet_table_7[value] - 1;
+}
+static int asn_PER_MAP_ia5_ir_7_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_7)/sizeof(permitted_alphabet_code2value_7[0]))
+ return -1;
+ return permitted_alphabet_code2value_7[code];
+}
+static int
+memb_vs_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_9(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_vs_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_10(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_vs_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_11(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_vs_ir_11_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_11)/sizeof(permitted_alphabet_table_11[0]))
+ return -1;
+ return permitted_alphabet_table_11[value] - 1;
+}
+static int asn_PER_MAP_vs_ir_11_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_11)/sizeof(permitted_alphabet_code2value_11[0]))
+ return -1;
+ return permitted_alphabet_code2value_11[code];
+}
+static int
+memb_pr_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PrintableString_t *st = (const PrintableString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_13(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_pr_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PrintableString_t *st = (const PrintableString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_14(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_pr_ir_14_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_14)/sizeof(permitted_alphabet_table_14[0]))
+ return -1;
+ return permitted_alphabet_table_14[value] - 1;
+}
+static int asn_PER_MAP_pr_ir_14_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_14)/sizeof(permitted_alphabet_code2value_14[0]))
+ return -1;
+ return permitted_alphabet_code2value_14[code];
+}
+static int
+memb_ns_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const NumericString_t *st = (const NumericString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_16(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_ns_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const NumericString_t *st = (const NumericString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_17(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_ns_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const NumericString_t *st = (const NumericString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_18(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_ns_ir_18_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_18)/sizeof(permitted_alphabet_table_18[0]))
+ return -1;
+ return permitted_alphabet_table_18[value] - 1;
+}
+static int asn_PER_MAP_ns_ir_18_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_18)/sizeof(permitted_alphabet_code2value_18[0]))
+ return -1;
+ return permitted_alphabet_code2value_18[code];
+}
+static int
+memb_ut_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = UTF8String_length(st);
+ if((ssize_t)size < 0) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: UTF-8: broken encoding (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((size == 6)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_ut_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = UTF8String_length(st);
+ if((ssize_t)size < 0) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: UTF-8: broken encoding (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((size == 6)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_ut_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_21(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_bm_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BMPString_t *st = (const BMPString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_23(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_bm_cs_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BMPString_t *st = (const BMPString_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size >> 1; /* 2 byte per character */
+
+ if((size == 6)
+ && !check_permitted_alphabet_24(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_bm_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BMPString_t *st = (const BMPString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_25(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_bm_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BMPString_t *st = (const BMPString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_26(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_bm_ir_26_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_26)/sizeof(permitted_alphabet_table_26[0]))
+ return -1;
+ return permitted_alphabet_table_26[value] - 1;
+}
+static int asn_PER_MAP_bm_ir_26_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_26)/sizeof(permitted_alphabet_code2value_26[0]))
+ return -1;
+ return permitted_alphabet_code2value_26[code];
+}
+static int
+memb_us_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_28(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_us_cs_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size >> 2; /* 4 byte per character */
+
+ if((size == 6)
+ && !check_permitted_alphabet_29(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_us_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_30(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_us_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_31(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_us_ir_31_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_31)/sizeof(permitted_alphabet_table_31[0]))
+ return -1;
+ return permitted_alphabet_table_31[value] - 1;
+}
+static int asn_PER_MAP_us_ir_31_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_31)/sizeof(permitted_alphabet_code2value_31[0]))
+ return -1;
+ return permitted_alphabet_code2value_31[code];
+}
+
+/*** <<< CTDEFS [PDU] >>> ***/
+
+static asn_per_constraints_t asn_PER_memb_ia5_c_constr_5 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_ia5_ce_constr_6 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_ia5_ir_constr_7 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ asn_PER_MAP_ia5_ir_7_v2c, /* Value to PER code map */
+ asn_PER_MAP_ia5_ir_7_c2v /* PER code to value map */
+};
+static asn_per_constraints_t asn_PER_memb_vs_c_constr_9 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_vs_ce_constr_10 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_vs_ir_constr_11 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ asn_PER_MAP_vs_ir_11_v2c, /* Value to PER code map */
+ asn_PER_MAP_vs_ir_11_c2v /* PER code to value map */
+};
+static asn_per_constraints_t asn_PER_memb_pr_c_constr_13 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_pr_ir_constr_14 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ asn_PER_MAP_pr_ir_14_v2c, /* Value to PER code map */
+ asn_PER_MAP_pr_ir_14_c2v /* PER code to value map */
+};
+static asn_per_constraints_t asn_PER_memb_ns_c_constr_16 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 53, 57 } /* (53..57) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_ns_ce_constr_17 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_ns_ir_constr_18 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 1, 1, 49, 57 } /* (49..57) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ asn_PER_MAP_ns_ir_18_v2c, /* Value to PER code map */
+ asn_PER_MAP_ns_ir_18_c2v /* PER code to value map */
+};
+static asn_per_constraints_t asn_PER_memb_ut_c_constr_19 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_ut_ce_constr_20 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_ut_ir_constr_21 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_bm_c_constr_23 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_bm_cs_constr_24 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 16, 16, 0, 65533 } /* (0..65533) */,
+ { APC_CONSTRAINED, 0, 0, 6, 6 } /* (SIZE(6..6)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_bm_ce_constr_25 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_bm_ir_constr_26 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ asn_PER_MAP_bm_ir_26_v2c, /* Value to PER code map */
+ asn_PER_MAP_bm_ir_26_c2v /* PER code to value map */
+};
+static asn_per_constraints_t asn_PER_memb_us_c_constr_28 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 5, 5, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_us_cs_constr_29 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, 32, 0, 2147483647 } /* (0..4294967295) */,
+ { APC_CONSTRAINED, 0, 0, 6, 6 } /* (SIZE(6..6)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_us_ce_constr_30 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, 32, 0, 2147483647 } /* special case 1 */
+ ,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_us_ir_constr_31 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 90 } /* (65..90) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ asn_PER_MAP_us_ir_31_v2c, /* Value to PER code map */
+ asn_PER_MAP_us_ir_31_c2v /* PER code to value map */
+};
+
+/*** <<< STAT-DEFS [PDU] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_many_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_PDU,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_many_tags_2[] = {
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_many_specs_2 = {
+ sizeof(struct many),
+ offsetof(struct many, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_many_2 = {
+ "many",
+ "many",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_OF_decode_uper,
+ SEQUENCE_OF_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_many_tags_2,
+ sizeof(asn_DEF_many_tags_2)
+ /sizeof(asn_DEF_many_tags_2[0]) - 1, /* 1 */
+ asn_DEF_many_tags_2, /* Same as above */
+ sizeof(asn_DEF_many_tags_2)
+ /sizeof(asn_DEF_many_tags_2[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_many_2,
+ 1, /* Single element */
+ &asn_SPC_many_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_PDU_1[] = {
+ { ATF_POINTER, 31, offsetof(struct PDU, many),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_many_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "many"
+ },
+ { ATF_POINTER, 30, offsetof(struct PDU, ia5),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "ia5"
+ },
+ { ATF_POINTER, 29, offsetof(struct PDU, ia5_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = memb_ia5_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ia5_c_constr_5,
+ .default_value = 0,
+ .name = "ia5-c"
+ },
+ { ATF_POINTER, 28, offsetof(struct PDU, ia5_ce),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = memb_ia5_ce_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ia5_ce_constr_6,
+ .default_value = 0,
+ .name = "ia5-ce"
+ },
+ { ATF_POINTER, 27, offsetof(struct PDU, ia5_ir),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = memb_ia5_ir_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ia5_ir_constr_7,
+ .default_value = 0,
+ .name = "ia5-ir"
+ },
+ { ATF_POINTER, 26, offsetof(struct PDU, vs),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "vs"
+ },
+ { ATF_POINTER, 25, offsetof(struct PDU, vs_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = memb_vs_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_vs_c_constr_9,
+ .default_value = 0,
+ .name = "vs-c"
+ },
+ { ATF_POINTER, 24, offsetof(struct PDU, vs_ce),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = memb_vs_ce_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_vs_ce_constr_10,
+ .default_value = 0,
+ .name = "vs-ce"
+ },
+ { ATF_POINTER, 23, offsetof(struct PDU, vs_ir),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = memb_vs_ir_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_vs_ir_constr_11,
+ .default_value = 0,
+ .name = "vs-ir"
+ },
+ { ATF_POINTER, 22, offsetof(struct PDU, pr),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_PrintableString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "pr"
+ },
+ { ATF_POINTER, 21, offsetof(struct PDU, pr_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (10 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_PrintableString,
+ .type_selector = 0,
+ .memb_constraints = memb_pr_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_pr_c_constr_13,
+ .default_value = 0,
+ .name = "pr-c"
+ },
+ { ATF_POINTER, 20, offsetof(struct PDU, pr_ir),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (11 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_PrintableString,
+ .type_selector = 0,
+ .memb_constraints = memb_pr_ir_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_pr_ir_constr_14,
+ .default_value = 0,
+ .name = "pr-ir"
+ },
+ { ATF_POINTER, 19, offsetof(struct PDU, ns),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (12 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NumericString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "ns"
+ },
+ { ATF_POINTER, 18, offsetof(struct PDU, ns_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (13 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NumericString,
+ .type_selector = 0,
+ .memb_constraints = memb_ns_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ns_c_constr_16,
+ .default_value = 0,
+ .name = "ns-c"
+ },
+ { ATF_POINTER, 17, offsetof(struct PDU, ns_ce),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (14 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NumericString,
+ .type_selector = 0,
+ .memb_constraints = memb_ns_ce_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ns_ce_constr_17,
+ .default_value = 0,
+ .name = "ns-ce"
+ },
+ { ATF_POINTER, 16, offsetof(struct PDU, ns_ir),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (15 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NumericString,
+ .type_selector = 0,
+ .memb_constraints = memb_ns_ir_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ns_ir_constr_18,
+ .default_value = 0,
+ .name = "ns-ir"
+ },
+ { ATF_POINTER, 15, offsetof(struct PDU, ut_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (16 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = memb_ut_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ut_c_constr_19,
+ .default_value = 0,
+ .name = "ut-c"
+ },
+ { ATF_POINTER, 14, offsetof(struct PDU, ut_ce),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (17 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = memb_ut_ce_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ut_ce_constr_20,
+ .default_value = 0,
+ .name = "ut-ce"
+ },
+ { ATF_POINTER, 13, offsetof(struct PDU, ut_ir),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (18 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = memb_ut_ir_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_ut_ir_constr_21,
+ .default_value = 0,
+ .name = "ut-ir"
+ },
+ { ATF_POINTER, 12, offsetof(struct PDU, bm),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (19 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BMPString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "bm"
+ },
+ { ATF_POINTER, 11, offsetof(struct PDU, bm_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (20 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BMPString,
+ .type_selector = 0,
+ .memb_constraints = memb_bm_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_bm_c_constr_23,
+ .default_value = 0,
+ .name = "bm-c"
+ },
+ { ATF_POINTER, 10, offsetof(struct PDU, bm_cs),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (21 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BMPString,
+ .type_selector = 0,
+ .memb_constraints = memb_bm_cs_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_bm_cs_constr_24,
+ .default_value = 0,
+ .name = "bm-cs"
+ },
+ { ATF_POINTER, 9, offsetof(struct PDU, bm_ce),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (22 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BMPString,
+ .type_selector = 0,
+ .memb_constraints = memb_bm_ce_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_bm_ce_constr_25,
+ .default_value = 0,
+ .name = "bm-ce"
+ },
+ { ATF_POINTER, 8, offsetof(struct PDU, bm_ir),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (23 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BMPString,
+ .type_selector = 0,
+ .memb_constraints = memb_bm_ir_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_bm_ir_constr_26,
+ .default_value = 0,
+ .name = "bm-ir"
+ },
+ { ATF_POINTER, 7, offsetof(struct PDU, us),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (24 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UniversalString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "us"
+ },
+ { ATF_POINTER, 6, offsetof(struct PDU, us_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (25 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UniversalString,
+ .type_selector = 0,
+ .memb_constraints = memb_us_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_us_c_constr_28,
+ .default_value = 0,
+ .name = "us-c"
+ },
+ { ATF_POINTER, 5, offsetof(struct PDU, us_cs),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (26 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UniversalString,
+ .type_selector = 0,
+ .memb_constraints = memb_us_cs_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_us_cs_constr_29,
+ .default_value = 0,
+ .name = "us-cs"
+ },
+ { ATF_POINTER, 4, offsetof(struct PDU, us_ce),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (27 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UniversalString,
+ .type_selector = 0,
+ .memb_constraints = memb_us_ce_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_us_ce_constr_30,
+ .default_value = 0,
+ .name = "us-ce"
+ },
+ { ATF_POINTER, 3, offsetof(struct PDU, us_ir),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (28 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UniversalString,
+ .type_selector = 0,
+ .memb_constraints = memb_us_ir_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_us_ir_constr_31,
+ .default_value = 0,
+ .name = "us-ir"
+ },
+ { ATF_POINTER, 2, offsetof(struct PDU, real),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (29 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeReal,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "real"
+ },
+ { ATF_POINTER, 1, offsetof(struct PDU, oid),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (30 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_OBJECT_IDENTIFIER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "oid"
+ },
+};
+static const int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 };
+static const ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* many */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ia5 */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ia5-c */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ia5-ce */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* ia5-ir */
+ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* vs */
+ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* vs-c */
+ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* vs-ce */
+ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* vs-ir */
+ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* pr */
+ { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 }, /* pr-c */
+ { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 }, /* pr-ir */
+ { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 12, 0, 0 }, /* ns */
+ { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 13, 0, 0 }, /* ns-c */
+ { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 14, 0, 0 }, /* ns-ce */
+ { (ASN_TAG_CLASS_CONTEXT | (15 << 2)), 15, 0, 0 }, /* ns-ir */
+ { (ASN_TAG_CLASS_CONTEXT | (16 << 2)), 16, 0, 0 }, /* ut-c */
+ { (ASN_TAG_CLASS_CONTEXT | (17 << 2)), 17, 0, 0 }, /* ut-ce */
+ { (ASN_TAG_CLASS_CONTEXT | (18 << 2)), 18, 0, 0 }, /* ut-ir */
+ { (ASN_TAG_CLASS_CONTEXT | (19 << 2)), 19, 0, 0 }, /* bm */
+ { (ASN_TAG_CLASS_CONTEXT | (20 << 2)), 20, 0, 0 }, /* bm-c */
+ { (ASN_TAG_CLASS_CONTEXT | (21 << 2)), 21, 0, 0 }, /* bm-cs */
+ { (ASN_TAG_CLASS_CONTEXT | (22 << 2)), 22, 0, 0 }, /* bm-ce */
+ { (ASN_TAG_CLASS_CONTEXT | (23 << 2)), 23, 0, 0 }, /* bm-ir */
+ { (ASN_TAG_CLASS_CONTEXT | (24 << 2)), 24, 0, 0 }, /* us */
+ { (ASN_TAG_CLASS_CONTEXT | (25 << 2)), 25, 0, 0 }, /* us-c */
+ { (ASN_TAG_CLASS_CONTEXT | (26 << 2)), 26, 0, 0 }, /* us-cs */
+ { (ASN_TAG_CLASS_CONTEXT | (27 << 2)), 27, 0, 0 }, /* us-ce */
+ { (ASN_TAG_CLASS_CONTEXT | (28 << 2)), 28, 0, 0 }, /* us-ir */
+ { (ASN_TAG_CLASS_CONTEXT | (29 << 2)), 29, 0, 0 }, /* real */
+ { (ASN_TAG_CLASS_CONTEXT | (30 << 2)), 30, 0, 0 } /* oid */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = {
+ sizeof(struct PDU),
+ offsetof(struct PDU, _asn_ctx),
+ asn_MAP_PDU_tag2el_1,
+ 31, /* Count of tags in the map */
+ asn_MAP_PDU_oms_1, /* Optional members */
+ 31, 0, /* Root/Additions */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_PDU = {
+ "PDU",
+ "PDU",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_decode_uper,
+ SEQUENCE_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PDU_tags_1,
+ sizeof(asn_DEF_PDU_tags_1)
+ /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
+ asn_DEF_PDU_tags_1, /* Same as above */
+ sizeof(asn_DEF_PDU_tags_1)
+ /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_PDU_1,
+ 31, /* Elements count */
+ &asn_SPC_PDU_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/12-int-SE.asn1 b/tests/tests-asn1c-compiler/12-int-SE.asn1
new file mode 100644
index 0000000..92ab358
--- /dev/null
+++ b/tests/tests-asn1c-compiler/12-int-SE.asn1
@@ -0,0 +1,17 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .12
+
+ModuleTestInt6
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 12 }
+ DEFINITIONS ::=
+BEGIN
+
+ -- unresolved reference
+ alpha INTEGER ::= beta
+
+END
diff --git a/tests/tests-asn1c-compiler/121-empty-imports-OK.asn1 b/tests/tests-asn1c-compiler/121-empty-imports-OK.asn1
new file mode 100644
index 0000000..bbf1d1e
--- /dev/null
+++ b/tests/tests-asn1c-compiler/121-empty-imports-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .121
+
+ModuleEmptyIMPORTS
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 121 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ IMPORTS -- nothing --;
+
+ Type ::= INTEGER
+
+END
diff --git a/tests/tests-asn1c-compiler/121-empty-imports-OK.asn1.-EF b/tests/tests-asn1c-compiler/121-empty-imports-OK.asn1.-EF
new file mode 100644
index 0000000..a5ad681
--- /dev/null
+++ b/tests/tests-asn1c-compiler/121-empty-imports-OK.asn1.-EF
@@ -0,0 +1,8 @@
+ModuleEmptyIMPORTS { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 121 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+Type ::= INTEGER
+
+END
diff --git a/tests/tests-asn1c-compiler/122-pattern-OK.asn1 b/tests/tests-asn1c-compiler/122-pattern-OK.asn1
new file mode 100644
index 0000000..16c823f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/122-pattern-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .122
+
+ModulePatternConstraint
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 122 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ Language ::= VisibleString (FROM ("a".."z" | "A".."Z" | "-" | "0".."9"))
+ (PATTERN "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*")
+
+ PatternByRef1 ::= VisibleString (PATTERN refPattern1)
+ PatternByRef2 ::= VisibleString (PATTERN refPattern2)
+
+ refPattern1 UniversalString ::= "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*"
+ refPattern2 UTF8String ::= "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*"
+
+END
diff --git a/tests/tests-asn1c-compiler/123-valueassignment-OK.asn1 b/tests/tests-asn1c-compiler/123-valueassignment-OK.asn1
new file mode 100644
index 0000000..bb54fc5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/123-valueassignment-OK.asn1
@@ -0,0 +1,16 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .123
+
+ModuleValueAssignmentConstrained
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 123 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ zzz OCTET STRING (SIZE(1)) ::= '1'H
+
+END
diff --git a/tests/tests-asn1c-compiler/123-valueassignment-OK.asn1.-EF b/tests/tests-asn1c-compiler/123-valueassignment-OK.asn1.-EF
new file mode 100644
index 0000000..8fe6f2c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/123-valueassignment-OK.asn1.-EF
@@ -0,0 +1,8 @@
+ModuleValueAssignmentConstrained { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 123 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+zzz OCTET STRING (SIZE(1)) ::= '0001'B
+
+END
diff --git a/tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1 b/tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1
new file mode 100644
index 0000000..577a142
--- /dev/null
+++ b/tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1
@@ -0,0 +1,16 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .124
+
+ModuleMultiConstraint
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 124 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ T ::= VisibleString (PATTERN "^[a-z]+$") (CONSTRAINED BY { ... })
+
+END
diff --git a/tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1.-EF b/tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1.-EF
new file mode 100644
index 0000000..efd3214
--- /dev/null
+++ b/tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1.-EF
@@ -0,0 +1,8 @@
+ModuleMultiConstraint { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 124 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+T ::= VisibleString (PATTERN "^[a-z]+$")(CONSTRAINED BY { ... })
+
+END
diff --git a/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1 b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1
new file mode 100644
index 0000000..d175ce7
--- /dev/null
+++ b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .125
+
+ModuleBitStringConstraint
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 125 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= BIT STRING { flag1(0), flag2(1), flag3(2) }
+ ('000'B | '001'B | '010'B | '011'B)
+
+
+END
diff --git a/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-EF b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-EF
new file mode 100644
index 0000000..0887560
--- /dev/null
+++ b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-EF
@@ -0,0 +1,12 @@
+ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 125 }
+DEFINITIONS ::=
+BEGIN
+
+T ::= BIT STRING {
+ flag1(0),
+ flag2(1),
+ flag3(2)
+} ('000'B | '001'B | '010'B | '011'B)
+
+END
diff --git a/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-P b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-P
new file mode 100644
index 0000000..f267409
--- /dev/null
+++ b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-P
@@ -0,0 +1,89 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <BIT_STRING.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum T {
+ T_flag1 = 0,
+ T_flag2 = 1,
+ T_flag3 = 2
+} e_T;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef BIT_STRING_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] >>> ***/
+
+int
+T_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ (void)st; /* Unused variable */
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_BIT_STRING.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using BIT_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ BIT_STRING_free,
+ BIT_STRING_print,
+ BIT_STRING_compare,
+ T_constraint,
+ BIT_STRING_decode_ber,
+ BIT_STRING_encode_der,
+ BIT_STRING_decode_xer,
+ BIT_STRING_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_BIT_STRING_specs /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-X b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-X
new file mode 100644
index 0000000..534182a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.-X
@@ -0,0 +1,8 @@
+<!-- XML DTD generated by asn1c-0.9.29 -->
+
+<!-- ASN.1 module
+ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 125 }
+found in ../tests/125-bitstring-constraint-OK.asn1 -->
+
+<!ELEMENT T (flag1?, flag2?, flag3?)>
diff --git a/tests/tests-asn1c-compiler/126-per-extensions-OK.asn1 b/tests/tests-asn1c-compiler/126-per-extensions-OK.asn1
new file mode 100644
index 0000000..7d12173
--- /dev/null
+++ b/tests/tests-asn1c-compiler/126-per-extensions-OK.asn1
@@ -0,0 +1,33 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .126
+
+ModulePERExtensions
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 126 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ PDU ::= SEQUENCE {
+ ...,
+ str-o IA5String OPTIONAL,
+ str-m IA5String,
+ singl Singleton,
+ pdu-2 PDU-2 OPTIONAL
+ }
+
+ Singleton ::= SEQUENCE {
+ opt-z IA5String DEFAULT "z"
+ }
+
+ PDU-2 ::= CHOICE {
+ main [3] INTEGER,
+ ...,
+ ext1 [1] INTEGER,
+ ext0 [0] INTEGER
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/126-per-extensions-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/126-per-extensions-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..d503369
--- /dev/null
+++ b/tests/tests-asn1c-compiler/126-per-extensions-OK.asn1.-Pgen-PER
@@ -0,0 +1,367 @@
+
+/*** <<< INCLUDES [PDU] >>> ***/
+
+#include <IA5String.h>
+#include "Singleton.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [PDU] >>> ***/
+
+struct PDU_2;
+struct Singleton;
+
+/*** <<< TYPE-DECLS [PDU] >>> ***/
+
+typedef struct PDU {
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ IA5String_t *str_o /* OPTIONAL */;
+ IA5String_t *str_m;
+ struct Singleton *singl;
+ struct PDU_2 *pdu_2 /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} PDU_t;
+
+/*** <<< FUNC-DECLS [PDU] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PDU;
+
+/*** <<< POST-INCLUDE [PDU] >>> ***/
+
+#include "PDU-2.h"
+
+/*** <<< STAT-DEFS [PDU] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_PDU_1[] = {
+ { ATF_POINTER, 4, offsetof(struct PDU, str_o),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "str-o"
+ },
+ { ATF_POINTER, 3, offsetof(struct PDU, str_m),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "str-m"
+ },
+ { ATF_POINTER, 2, offsetof(struct PDU, singl),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Singleton,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "singl"
+ },
+ { ATF_POINTER, 1, offsetof(struct PDU, pdu_2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_PDU_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "pdu-2"
+ },
+};
+static const int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3 };
+static const ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* str-o */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* str-m */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* singl */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* pdu-2 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = {
+ sizeof(struct PDU),
+ offsetof(struct PDU, _asn_ctx),
+ asn_MAP_PDU_tag2el_1,
+ 4, /* Count of tags in the map */
+ asn_MAP_PDU_oms_1, /* Optional members */
+ 0, 4, /* Root/Additions */
+ -1, /* Start extensions */
+ 5 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_PDU = {
+ "PDU",
+ "PDU",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_decode_uper,
+ SEQUENCE_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PDU_tags_1,
+ sizeof(asn_DEF_PDU_tags_1)
+ /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
+ asn_DEF_PDU_tags_1, /* Same as above */
+ sizeof(asn_DEF_PDU_tags_1)
+ /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_PDU_1,
+ 4, /* Elements count */
+ &asn_SPC_PDU_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Singleton] >>> ***/
+
+#include <IA5String.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Singleton] >>> ***/
+
+typedef struct Singleton {
+ IA5String_t *opt_z /* DEFAULT z */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Singleton_t;
+
+/*** <<< FUNC-DECLS [Singleton] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Singleton;
+extern asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1;
+extern asn_TYPE_member_t asn_MBR_Singleton_1[1];
+
+/*** <<< STAT-DEFS [Singleton] >>> ***/
+
+static int asn_DFL_2_set(int set_value, void **sptr) {
+ static uint8_t defv[] = "z";
+ IA5String_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ uint8_t *ptr = MALLOC(sizeof(defv));
+ if(!ptr) return -1;
+ memcpy(ptr, &defv, sizeof(defv));
+ FREEMEM(st->buf);
+ st->buf = ptr;
+ st->size = sizeof(defv) - 1;
+ return 0;
+ } else {
+ if(st->size != (sizeof(defv) - 1)
+ || memcmp(st->buf, &defv, sizeof(defv) - 1))
+ return 0;
+ return 1;
+ }
+
+}
+asn_TYPE_member_t asn_MBR_Singleton_1[] = {
+ { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = asn_DFL_2_set, /* DEFAULT "z" */
+ .name = "opt-z"
+ },
+};
+static const int asn_MAP_Singleton_oms_1[] = { 0 };
+static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
+ sizeof(struct Singleton),
+ offsetof(struct Singleton, _asn_ctx),
+ asn_MAP_Singleton_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_Singleton_oms_1, /* Optional members */
+ 1, 0, /* Root/Additions */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Singleton = {
+ "Singleton",
+ "Singleton",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_decode_uper,
+ SEQUENCE_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Singleton_tags_1,
+ sizeof(asn_DEF_Singleton_tags_1)
+ /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
+ asn_DEF_Singleton_tags_1, /* Same as above */
+ sizeof(asn_DEF_Singleton_tags_1)
+ /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Singleton_1,
+ 1, /* Elements count */
+ &asn_SPC_Singleton_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [PDU-2] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [PDU-2] >>> ***/
+
+typedef enum PDU_2_PR {
+ PDU_2_PR_NOTHING, /* No components present */
+ PDU_2_PR_main,
+ /* Extensions may appear below */
+ PDU_2_PR_ext1,
+ PDU_2_PR_ext0
+} PDU_2_PR;
+
+/*** <<< TYPE-DECLS [PDU-2] >>> ***/
+
+typedef struct PDU_2 {
+ PDU_2_PR present;
+ union PDU_2_u {
+ long main;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ long ext1;
+ long ext0;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} PDU_2_t;
+
+/*** <<< FUNC-DECLS [PDU-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
+extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
+extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
+extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
+
+/*** <<< CTDEFS [PDU-2] >>> ***/
+
+asn_per_constraints_t asn_PER_type_PDU_2_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [PDU-2] >>> ***/
+
+asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "main"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "ext1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "ext0"
+ },
+};
+static const int asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
+static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
+};
+asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
+ sizeof(struct PDU_2),
+ offsetof(struct PDU_2, _asn_ctx),
+ offsetof(struct PDU_2, present),
+ sizeof(((struct PDU_2 *)0)->present),
+ asn_MAP_PDU_2_tag2el_1,
+ 3, /* Count of tags in the map */
+ .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
+ "PDU-2",
+ "PDU-2",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ CHOICE_decode_uper,
+ CHOICE_encode_uper,
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_PDU_2_constr_1,
+ asn_MBR_PDU_2_1,
+ 3, /* Elements count */
+ &asn_SPC_PDU_2_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/127-per-long-OK.asn1 b/tests/tests-asn1c-compiler/127-per-long-OK.asn1
new file mode 100644
index 0000000..0a7b6fe
--- /dev/null
+++ b/tests/tests-asn1c-compiler/127-per-long-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+-- Also see .134 for wider integer types.
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .127
+
+ModulePERLong
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 127 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ -- Should be supported on all 32-bit platforms and above.
+ small32range INTEGER (-2000000000..2000000000),
+ full32range INTEGER (-2147483648..2147483647),
+ unsigned32 INTEGER (0..4294967295),
+ unsplit32 INTEGER (5..500|600..4294967290)
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/127-per-long-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/127-per-long-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..80e595b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/127-per-long-OK.asn1.-Pgen-PER
@@ -0,0 +1,368 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ long small32range;
+ long full32range;
+ unsigned long unsigned32;
+ unsigned long unsplit32;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+/* extern asn_TYPE_descriptor_t asn_DEF_unsigned32_4; // (Use -fall-defs-global to expose) */
+/* extern asn_TYPE_descriptor_t asn_DEF_unsplit32_5; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< CODE [T] >>> ***/
+
+static int
+unsigned32_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ /* Constraint check succeeded */
+ return 0;
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static int
+unsplit32_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if(((value >= 5 && value <= 500) || (value >= 600 && value <= 4294967290))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static int
+memb_small32range_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -2000000000 && value <= 2000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_full32range_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= (-2147483647L - 1) && value <= 2147483647)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_unsigned32_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ /* Constraint check succeeded */
+ return 0;
+}
+
+static int
+memb_unsplit32_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if(((value >= 5 && value <= 500) || (value >= 600 && value <= 4294967290))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< CTDEFS [T] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_unsigned32_constr_4 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_type_unsplit32_constr_5 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, 5, 4294967290 } /* (5..4294967290) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_small32range_constr_2 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, -2000000000, 2000000000 } /* (-2000000000..2000000000) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_full32range_constr_3 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_unsigned32_constr_4 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_unsplit32_constr_5 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, 5, 4294967290 } /* (5..4294967290) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_unsigned32_specs_4 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_unsigned32_tags_4[] = {
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_unsigned32_4 = {
+ "unsigned32",
+ "unsigned32",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ unsigned32_4_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_unsigned32_tags_4,
+ sizeof(asn_DEF_unsigned32_tags_4)
+ /sizeof(asn_DEF_unsigned32_tags_4[0]) - 1, /* 1 */
+ asn_DEF_unsigned32_tags_4, /* Same as above */
+ sizeof(asn_DEF_unsigned32_tags_4)
+ /sizeof(asn_DEF_unsigned32_tags_4[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_unsigned32_constr_4,
+ 0, 0, /* No members */
+ &asn_SPC_unsigned32_specs_4 /* Additional specs */
+};
+
+static const asn_INTEGER_specifics_t asn_SPC_unsplit32_specs_5 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_unsplit32_tags_5[] = {
+ (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_unsplit32_5 = {
+ "unsplit32",
+ "unsplit32",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ unsplit32_5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_unsplit32_tags_5,
+ sizeof(asn_DEF_unsplit32_tags_5)
+ /sizeof(asn_DEF_unsplit32_tags_5[0]) - 1, /* 1 */
+ asn_DEF_unsplit32_tags_5, /* Same as above */
+ sizeof(asn_DEF_unsplit32_tags_5)
+ /sizeof(asn_DEF_unsplit32_tags_5[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_unsplit32_constr_5,
+ 0, 0, /* No members */
+ &asn_SPC_unsplit32_specs_5 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, small32range),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_small32range_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_small32range_constr_2,
+ .default_value = 0,
+ .name = "small32range"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, full32range),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_full32range_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_full32range_constr_3,
+ .default_value = 0,
+ .name = "full32range"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned32),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_unsigned32_4,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned32_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_unsigned32_constr_4,
+ .default_value = 0,
+ .name = "unsigned32"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsplit32),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_unsplit32_5,
+ .type_selector = 0,
+ .memb_constraints = memb_unsplit32_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_unsplit32_constr_5,
+ .default_value = 0,
+ .name = "unsplit32"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* small32range */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* full32range */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* unsigned32 */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* unsplit32 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ asn_MAP_T_tag2el_1,
+ 4, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_decode_uper,
+ SEQUENCE_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 4, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/128-enum-SE.asn1 b/tests/tests-asn1c-compiler/128-enum-SE.asn1
new file mode 100644
index 0000000..40b8caf
--- /dev/null
+++ b/tests/tests-asn1c-compiler/128-enum-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .128
+
+ModuleTestEnum1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 128 }
+ DEFINITIONS ::=
+BEGIN
+
+ A ::= ENUMERATED {a, b, ..., c, d(2)}
+
+END
diff --git a/tests/tests-asn1c-compiler/129-enum-OK.asn1 b/tests/tests-asn1c-compiler/129-enum-OK.asn1
new file mode 100644
index 0000000..06f5eed
--- /dev/null
+++ b/tests/tests-asn1c-compiler/129-enum-OK.asn1
@@ -0,0 +1,16 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .129
+
+ModuleTestEnum1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 129 }
+ DEFINITIONS ::=
+BEGIN
+
+ A ::= ENUMERATED {a(-5), b(-4), c}
+
+END
diff --git a/tests/tests-asn1c-compiler/129-enum-OK.asn1.-EF b/tests/tests-asn1c-compiler/129-enum-OK.asn1.-EF
new file mode 100644
index 0000000..ebc3d30
--- /dev/null
+++ b/tests/tests-asn1c-compiler/129-enum-OK.asn1.-EF
@@ -0,0 +1,12 @@
+ModuleTestEnum1 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 129 }
+DEFINITIONS ::=
+BEGIN
+
+A ::= ENUMERATED {
+ a(-5),
+ b(-4),
+ c(0)
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/129-enum-SE.asn1 b/tests/tests-asn1c-compiler/129-enum-SE.asn1
new file mode 100644
index 0000000..cb85dc9
--- /dev/null
+++ b/tests/tests-asn1c-compiler/129-enum-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .129
+
+ModuleTestEnum1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 129 }
+ DEFINITIONS ::=
+BEGIN
+
+ A ::= ENUMERATED {a, b, ..., c, d(2)}
+
+END
diff --git a/tests/tests-asn1c-compiler/13-resolver-OK.asn1 b/tests/tests-asn1c-compiler/13-resolver-OK.asn1
new file mode 100644
index 0000000..5237b01
--- /dev/null
+++ b/tests/tests-asn1c-compiler/13-resolver-OK.asn1
@@ -0,0 +1,47 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .13 1
+-- .13 2
+
+ModuleTestResolver1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 13 1 }
+ DEFINITIONS ::=
+BEGIN
+ IMPORTS IntegerType, beta FROM
+ Renamed
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 13 2 };
+
+ -- external reference
+ alpha IntegerType ::= beta
+ alpha2 Renamed.IntegerType ::= beta
+
+ --
+ -- The following are for post-fix checking by the check_fixer.
+ -- It will be able to pick-up these values if the file is parseable,
+ -- even if it contains some semantic errors.
+ --
+
+ check-alpha INTEGER ::= 123
+ check-alpha2 INTEGER ::= 123
+
+END
+
+ModuleTestResolver2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 13 2 }
+ DEFINITIONS ::=
+BEGIN
+ EXPORTS beta, IntegerType ;
+
+ beta HiddenType ::= 123
+
+ HiddenType ::= INTEGER
+
+ IntegerType ::= INTEGER
+
+END
diff --git a/tests/tests-asn1c-compiler/130-enum-OK.asn1 b/tests/tests-asn1c-compiler/130-enum-OK.asn1
new file mode 100644
index 0000000..d917e39
--- /dev/null
+++ b/tests/tests-asn1c-compiler/130-enum-OK.asn1
@@ -0,0 +1,16 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .130
+
+ModuleTestEnum1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 130 }
+ DEFINITIONS ::=
+BEGIN
+
+ A ::= ENUMERATED {a(-5), b(-4),..., c}
+
+END
diff --git a/tests/tests-asn1c-compiler/130-enum-OK.asn1.-EF b/tests/tests-asn1c-compiler/130-enum-OK.asn1.-EF
new file mode 100644
index 0000000..eaa5a51
--- /dev/null
+++ b/tests/tests-asn1c-compiler/130-enum-OK.asn1.-EF
@@ -0,0 +1,13 @@
+ModuleTestEnum1 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 130 }
+DEFINITIONS ::=
+BEGIN
+
+A ::= ENUMERATED {
+ a(-5),
+ b(-4),
+ ...,
+ c(0)
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/131-per-empty-OK.asn1 b/tests/tests-asn1c-compiler/131-per-empty-OK.asn1
new file mode 100644
index 0000000..fec5d2c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/131-per-empty-OK.asn1
@@ -0,0 +1,16 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .131
+
+ModulePERLong
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 131 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ T ::= SEQUENCE { } -- Empty sequence
+
+END
diff --git a/tests/tests-asn1c-compiler/131-per-empty-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/131-per-empty-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..0beb8fc
--- /dev/null
+++ b/tests/tests-asn1c-compiler/131-per-empty-OK.asn1.-Pgen-PER
@@ -0,0 +1,58 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_decode_uper,
+ SEQUENCE_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/132-per-choice-OK.asn1 b/tests/tests-asn1c-compiler/132-per-choice-OK.asn1
new file mode 100644
index 0000000..8cbdb48
--- /dev/null
+++ b/tests/tests-asn1c-compiler/132-per-choice-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .132
+
+ModulePERChoice
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 132 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ T ::= CHOICE {
+ first [1] CHOICE {
+ nothing INTEGER (5..10)
+ },
+ second [0] INTEGER (-10..10)
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/133-per-constraints-OK.asn1 b/tests/tests-asn1c-compiler/133-per-constraints-OK.asn1
new file mode 100644
index 0000000..38721b6
--- /dev/null
+++ b/tests/tests-asn1c-compiler/133-per-constraints-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .133
+
+ModulePERConstraints
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 133 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ T ::= CHOICE {
+ first [2] CHOICE {
+ nothing INTEGER (5..MAX)
+ },
+ second [0] INTEGER (MIN..10),
+ ...,
+ third [1] INTEGER (-10..MAX)
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/134-per-long-OK.asn1 b/tests/tests-asn1c-compiler/134-per-long-OK.asn1
new file mode 100644
index 0000000..b4334dd
--- /dev/null
+++ b/tests/tests-asn1c-compiler/134-per-long-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+-- Also see .127 for narrower integer types.
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .134
+
+ModulePERLong
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 134 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ -- Supported only on 64-bit platforms.
+ T ::= SEQUENCE {
+ unsigned33 INTEGER (0..5000000000), -- range 33 bits
+ unsigned42 INTEGER (0..3153600000000), -- range 42 bits
+ signed33 INTEGER (-4000000000..4000000000), -- 33 bits
+ signed33ext INTEGER (-4000000000..4000000000,...)
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/134-per-long-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/134-per-long-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..9fd6945
--- /dev/null
+++ b/tests/tests-asn1c-compiler/134-per-long-OK.asn1.-Pgen-PER
@@ -0,0 +1,266 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ INTEGER_t unsigned33;
+ INTEGER_t unsigned42;
+ INTEGER_t signed33;
+ INTEGER_t signed33ext;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< CODE [T] >>> ***/
+
+static int
+memb_unsigned33_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 0 && value <= 5000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_unsigned42_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 0 && value <= 3153600000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_signed33_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= -4000000000 && value <= 4000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_signed33ext_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= -4000000000 && value <= 4000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< CTDEFS [T] >>> ***/
+
+static asn_per_constraints_t asn_PER_memb_unsigned33_constr_2 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 33, -1, 0, 5000000000 } /* (0..5000000000) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_unsigned42_constr_3 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 42, -1, 0, 3153600000000 } /* (0..3153600000000) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_signed33_constr_4 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 33, -1, -4000000000, 4000000000 } /* (-4000000000..4000000000) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_signed33ext_constr_5 GCC_NOTUSED = {
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 33, -1, -4000000000, 4000000000 } /* (-4000000000..4000000000,...) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned33),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned33_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_unsigned33_constr_2,
+ .default_value = 0,
+ .name = "unsigned33"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned42),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned42_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_unsigned42_constr_3,
+ .default_value = 0,
+ .name = "unsigned42"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, signed33),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = memb_signed33_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_signed33_constr_4,
+ .default_value = 0,
+ .name = "signed33"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, signed33ext),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = memb_signed33ext_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_signed33ext_constr_5,
+ .default_value = 0,
+ .name = "signed33ext"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* unsigned33 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* unsigned42 */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* signed33 */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* signed33ext */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ asn_MAP_T_tag2el_1,
+ 4, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_decode_uper,
+ SEQUENCE_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 4, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/135-oer-short-OK.asn1 b/tests/tests-asn1c-compiler/135-oer-short-OK.asn1
new file mode 100644
index 0000000..fcd80fc
--- /dev/null
+++ b/tests/tests-asn1c-compiler/135-oer-short-OK.asn1
@@ -0,0 +1,30 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .135
+
+ModuleOERShort
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 135 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ -- Supported only on 64-bit platforms.
+ T ::= SEQUENCE {
+ unsigned8 [0] INTEGER (0..255), -- OER 1 byte
+ unsigned16 [1] INTEGER (0..65535), -- OER 2 bytes
+ unsigned16stack [2] INTEGER (0..32767)(0..255), -- OER 1 byte
+ unsigned16stack-ext [15] INTEGER (0..32767)(0..255,...), -- OER 2 bytes
+ ...,
+ signed8 [10] INTEGER (-128..127) DEFAULT 3, -- OER 1 byte
+ signed16 [11] INTEGER (-32768..32767), -- OER 2 bytes
+ signed16stack [12] INTEGER (-32768..32767)(-128..127), -- OER 1 byte
+ signed16stack-ext [5] INTEGER (-32768..32767)(-128..127,...), -- OER 2 b
+ signed32 [7] INTEGER (-2000000000..2000000000), -- OER 4 bytes
+ ...,
+ minmax [6] INTEGER (MIN..MAX) OPTIONAL
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/136-oer-long-OK.asn1 b/tests/tests-asn1c-compiler/136-oer-long-OK.asn1
new file mode 100644
index 0000000..706a6ea
--- /dev/null
+++ b/tests/tests-asn1c-compiler/136-oer-long-OK.asn1
@@ -0,0 +1,32 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .136
+
+ModuleOERLong
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 136 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ -- Supported only on 64-bit platforms.
+ T ::= SEQUENCE {
+ unsigned8 [0] INTEGER (0..255), -- OER 1 byte
+ unsigned16 [1] INTEGER (0..65535), -- OER 2 bytes
+ unsigned16stack [2] INTEGER (0..32767)(0..255), -- OER 1 byte
+ unsigned16stack-ext [15] INTEGER (0..32767)(0..255,...), -- OER 2 bytes
+ unsigned33 [3] INTEGER (0..5000000000), -- OER 8 bytes
+ ...,
+ signed8 [10] INTEGER (-128..127) DEFAULT 3, -- OER 1 byte
+ signed16 [11] INTEGER (-32768..32767), -- OER 2 bytes
+ signed16stack [12] INTEGER (-32768..32767)(-128..127), -- OER 1 byte
+ signed16stack-ext [5] INTEGER (-32768..32767)(-128..127,...), -- OER 2 b
+ signed32 [7] INTEGER (-2000000000..2000000000), -- OER 4 bytes
+ signed33ext [8] INTEGER (-4000000000..4000000000,...),-- OER vrble
+ ...,
+ minmax [6] INTEGER (MIN..MAX) OPTIONAL
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/136-oer-long-OK.asn1.-Pgen-OER b/tests/tests-asn1c-compiler/136-oer-long-OK.asn1.-Pgen-OER
new file mode 100644
index 0000000..229bc4d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/136-oer-long-OK.asn1.-Pgen-OER
@@ -0,0 +1,593 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <NativeInteger.h>
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ long unsigned8;
+ long unsigned16;
+ long unsigned16stack;
+ long unsigned16stack_ext;
+ INTEGER_t unsigned33;
+ long *minmax /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ long *signed8 /* DEFAULT 3 */;
+ long *signed16;
+ long *signed16stack;
+ long *signed16stack_ext;
+ long *signed32;
+ INTEGER_t *signed33ext;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< CODE [T] >>> ***/
+
+static int
+memb_unsigned8_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 255)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_unsigned16_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 65535)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_unsigned16stack_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 255)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_unsigned16stack_ext_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 255)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_unsigned33_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 0 && value <= 5000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_minmax_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_signed8_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -128 && value <= 127)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_signed16_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -32768 && value <= 32767)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_signed16stack_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -128 && value <= 127)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_signed16stack_ext_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -128 && value <= 127)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_signed32_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -2000000000 && value <= 2000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_signed33ext_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= -4000000000 && value <= 4000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< CTDEFS [T] >>> ***/
+
+static asn_oer_constraints_t asn_OER_memb_unsigned8_constr_2 GCC_NOTUSED = {
+ { 1, 1 } /* (0..255) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_unsigned16_constr_3 GCC_NOTUSED = {
+ { 2, 1 } /* (0..65535) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_unsigned16stack_constr_4 GCC_NOTUSED = {
+ { 1, 1 } /* (0..255) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_unsigned16stack_ext_constr_5 GCC_NOTUSED = {
+ { 2, 1 } /* (0..32767) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_unsigned33_constr_6 GCC_NOTUSED = {
+ { 8, 1 } /* (0..5000000000) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_minmax_constr_7 GCC_NOTUSED = {
+ { 0, 0 },
+ -1};
+static asn_oer_constraints_t asn_OER_memb_signed8_constr_9 GCC_NOTUSED = {
+ { 1, 0 } /* (-128..127) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_signed16_constr_10 GCC_NOTUSED = {
+ { 2, 0 } /* (-32768..32767) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_signed16stack_constr_11 GCC_NOTUSED = {
+ { 1, 0 } /* (-128..127) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_signed16stack_ext_constr_12 GCC_NOTUSED = {
+ { 2, 0 } /* (-32768..32767) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_signed32_constr_13 GCC_NOTUSED = {
+ { 4, 0 } /* (-2000000000..2000000000) */,
+ -1};
+static asn_oer_constraints_t asn_OER_memb_signed33ext_constr_14 GCC_NOTUSED = {
+ { 0, 0 },
+ -1};
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static int asn_DFL_9_set_3(int set_value, void **sptr) {
+ long *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 3 */
+ *st = 3;
+ return 0;
+ } else {
+ /* Test default value 3 */
+ return (*st == 3);
+ }
+}
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned8),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned8_constraint_1,
+ .oer_constraints = &asn_OER_memb_unsigned8_constr_2,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unsigned8"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned16),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned16_constraint_1,
+ .oer_constraints = &asn_OER_memb_unsigned16_constr_3,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unsigned16"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned16stack),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned16stack_constraint_1,
+ .oer_constraints = &asn_OER_memb_unsigned16stack_constr_4,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unsigned16stack"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned16stack_ext),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (15 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned16stack_ext_constraint_1,
+ .oer_constraints = &asn_OER_memb_unsigned16stack_ext_constr_5,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unsigned16stack-ext"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, unsigned33),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = memb_unsigned33_constraint_1,
+ .oer_constraints = &asn_OER_memb_unsigned33_constr_6,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unsigned33"
+ },
+ { ATF_POINTER, 7, offsetof(struct T, minmax),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_minmax_constraint_1,
+ .oer_constraints = &asn_OER_memb_minmax_constr_7,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "minmax"
+ },
+ { ATF_POINTER, 6, offsetof(struct T, signed8),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (10 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_signed8_constraint_1,
+ .oer_constraints = &asn_OER_memb_signed8_constr_9,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_9_set_3, /* DEFAULT 3 */
+ .name = "signed8"
+ },
+ { ATF_POINTER, 5, offsetof(struct T, signed16),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (11 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_signed16_constraint_1,
+ .oer_constraints = &asn_OER_memb_signed16_constr_10,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed16"
+ },
+ { ATF_POINTER, 4, offsetof(struct T, signed16stack),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (12 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_signed16stack_constraint_1,
+ .oer_constraints = &asn_OER_memb_signed16stack_constr_11,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed16stack"
+ },
+ { ATF_POINTER, 3, offsetof(struct T, signed16stack_ext),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_signed16stack_ext_constraint_1,
+ .oer_constraints = &asn_OER_memb_signed16stack_ext_constr_12,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed16stack-ext"
+ },
+ { ATF_POINTER, 2, offsetof(struct T, signed32),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_signed32_constraint_1,
+ .oer_constraints = &asn_OER_memb_signed32_constr_13,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed32"
+ },
+ { ATF_POINTER, 1, offsetof(struct T, signed33ext),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = memb_signed33ext_constraint_1,
+ .oer_constraints = &asn_OER_memb_signed33ext_constr_14,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed33ext"
+ },
+};
+static const int asn_MAP_T_oms_1[] = { 5, 6, 7, 8, 9, 10, 11 };
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* unsigned8 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* unsigned16 */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* unsigned16stack */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 4, 0, 0 }, /* unsigned33 */
+ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 9, 0, 0 }, /* signed16stack-ext */
+ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 5, 0, 0 }, /* minmax */
+ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 10, 0, 0 }, /* signed32 */
+ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 11, 0, 0 }, /* signed33ext */
+ { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 6, 0, 0 }, /* signed8 */
+ { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 7, 0, 0 }, /* signed16 */
+ { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 8, 0, 0 }, /* signed16stack */
+ { (ASN_TAG_CLASS_CONTEXT | (15 << 2)), 3, 0, 0 } /* unsigned16stack-ext */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ asn_MAP_T_tag2el_1,
+ 12, /* Count of tags in the map */
+ asn_MAP_T_oms_1, /* Optional members */
+ 1, 6, /* Root/Additions */
+ 5, /* Start extensions */
+ 13 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ SEQUENCE_decode_oer,
+ SEQUENCE_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 12, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/137-oer-string-OK.asn1 b/tests/tests-asn1c-compiler/137-oer-string-OK.asn1
new file mode 100644
index 0000000..86707e6
--- /dev/null
+++ b/tests/tests-asn1c-compiler/137-oer-string-OK.asn1
@@ -0,0 +1,27 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .137
+
+ModuleOERString
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 137 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ unconstrained SEQUENCE {
+ unc-ia5 IA5String,
+ unc-utf8 UTF8String,
+ unc-universal UniversalString
+ },
+ constrained SEQUENCE {
+ con-ia5 IA5String (SIZE(2..2)),
+ con-utf8 UTF8String (SIZE(2)),
+ con-universal UniversalString (SIZE(2 | 2))
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/137-oer-string-OK.asn1.-Pgen-OER b/tests/tests-asn1c-compiler/137-oer-string-OK.asn1.-Pgen-OER
new file mode 100644
index 0000000..e65926a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/137-oer-string-OK.asn1.-Pgen-OER
@@ -0,0 +1,402 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <IA5String.h>
+#include <UTF8String.h>
+#include <UniversalString.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ struct unconstrained {
+ IA5String_t unc_ia5;
+ UTF8String_t unc_utf8;
+ UniversalString_t unc_universal;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } unconstrained;
+ struct constrained {
+ IA5String_t con_ia5;
+ UTF8String_t con_utf8;
+ UniversalString_t con_universal;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } constrained;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< CTABLES [T] >>> ***/
+
+static int check_permitted_alphabet_7(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv <= 127)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_9(const void *sptr) {
+ /* The underlying type is UniversalString */
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ if(st->size % 4) return -1; /* (size%4)! */
+ for(; ch < end; ch += 4) {
+ uint32_t cv = (ch[0] << 24)
+ | (ch[1] << 16)
+ | (ch[2] << 8)
+ | ch[3];
+ if(!(1 /* Constraint matches natural range of cv */)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [T] >>> ***/
+
+static int
+memb_con_ia5_constraint_6(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size == 2)
+ && !check_permitted_alphabet_7(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_con_utf8_constraint_6(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = UTF8String_length(st);
+ if((ssize_t)size < 0) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: UTF-8: broken encoding (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((size == 2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_con_universal_constraint_6(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UniversalString_t *st = (const UniversalString_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size >> 2; /* 4 byte per character */
+
+ if((size == 2)
+ && !check_permitted_alphabet_9(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< CTDEFS [T] >>> ***/
+
+static asn_oer_constraints_t asn_OER_memb_con_ia5_constr_7 GCC_NOTUSED = {
+ { 0, 0 },
+ 2 /* (SIZE(2..2)) */};
+static asn_oer_constraints_t asn_OER_memb_con_utf8_constr_8 GCC_NOTUSED = {
+ { 0, 0 },
+ -1 /* (SIZE(0..MAX)) */};
+static asn_oer_constraints_t asn_OER_memb_con_universal_constr_9 GCC_NOTUSED = {
+ { 0, 0 },
+ 2 /* (SIZE(2..2)) */};
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_unconstrained_2[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct unconstrained, unc_ia5),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* No OER visible constraints */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unc-ia5"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct unconstrained, unc_utf8),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* No OER visible constraints */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unc-utf8"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct unconstrained, unc_universal),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (28 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_UniversalString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* No OER visible constraints */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unc-universal"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_unconstrained_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_unconstrained_tag2el_2[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* unc-utf8 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 0, 0, 0 }, /* unc-ia5 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (28 << 2)), 2, 0, 0 } /* unc-universal */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_unconstrained_specs_2 = {
+ sizeof(struct unconstrained),
+ offsetof(struct unconstrained, _asn_ctx),
+ asn_MAP_unconstrained_tag2el_2,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_unconstrained_2 = {
+ "unconstrained",
+ "unconstrained",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ SEQUENCE_decode_oer,
+ SEQUENCE_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_unconstrained_tags_2,
+ sizeof(asn_DEF_unconstrained_tags_2)
+ /sizeof(asn_DEF_unconstrained_tags_2[0]), /* 1 */
+ asn_DEF_unconstrained_tags_2, /* Same as above */
+ sizeof(asn_DEF_unconstrained_tags_2)
+ /sizeof(asn_DEF_unconstrained_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_unconstrained_2,
+ 3, /* Elements count */
+ &asn_SPC_unconstrained_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_constrained_6[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct constrained, con_ia5),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = memb_con_ia5_constraint_6,
+ .oer_constraints = &asn_OER_memb_con_ia5_constr_7,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "con-ia5"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct constrained, con_utf8),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = memb_con_utf8_constraint_6,
+ .oer_constraints = &asn_OER_memb_con_utf8_constr_8,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "con-utf8"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct constrained, con_universal),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (28 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_UniversalString,
+ .type_selector = 0,
+ .memb_constraints = memb_con_universal_constraint_6,
+ .oer_constraints = &asn_OER_memb_con_universal_constr_9,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "con-universal"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_constrained_tags_6[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_constrained_tag2el_6[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* con-utf8 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 0, 0, 0 }, /* con-ia5 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (28 << 2)), 2, 0, 0 } /* con-universal */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_constrained_specs_6 = {
+ sizeof(struct constrained),
+ offsetof(struct constrained, _asn_ctx),
+ asn_MAP_constrained_tag2el_6,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_constrained_6 = {
+ "constrained",
+ "constrained",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ SEQUENCE_decode_oer,
+ SEQUENCE_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_constrained_tags_6,
+ sizeof(asn_DEF_constrained_tags_6)
+ /sizeof(asn_DEF_constrained_tags_6[0]), /* 1 */
+ asn_DEF_constrained_tags_6, /* Same as above */
+ sizeof(asn_DEF_constrained_tags_6)
+ /sizeof(asn_DEF_constrained_tags_6[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_constrained_6,
+ 3, /* Elements count */
+ &asn_SPC_constrained_specs_6 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, unconstrained),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_unconstrained_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* No OER visible constraints */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "unconstrained"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, constrained),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_constrained_6,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* No OER visible constraints */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "constrained"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* unconstrained */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* constrained */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ asn_MAP_T_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ SEQUENCE_decode_oer,
+ SEQUENCE_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 2, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1 b/tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1
new file mode 100644
index 0000000..ce868b5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1
@@ -0,0 +1,32 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .138
+
+ModuleOERConstraints
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 138 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ A-noc ::= INTEGER -- No constraints
+ B-0-0 ::= INTEGER (0) -- Value constraint
+ C-1-2 ::= INTEGER (1..2) -- Value range constraint
+ D-inv ::= INTEGER (0..10,...) -- Extensible, not OER-visible
+ E-2-5 ::= INTEGER (0..10,...)(2..5) -- OER-visible constraint 2..5
+ F-inv ::= INTEGER (0..10,...)(2..5,...) -- Not OER-visible
+ G-3-3 ::= INTEGER (0..10,...)(2..5,...)(3) -- OER-visible constraint 3
+ -- X.696 #8.2.4 Not OER-visible parts of INTERSECTION are ignored
+ H-4-5 ::= INTEGER ((0..5) ^ (4..9)) -- OER-visible constraint 4..5
+ I-0-5 ::= INTEGER ((0..5) ^ (4..12,...)) -- OER-visible constraint 0..5
+ J-4-9 ::= INTEGER ((0..5,...) ^ (4..9)) -- OER-visible constraint 4..9
+ K-inv ::= INTEGER ((0..5,...) ^ (4..9,...)) -- Not OER-visible
+ -- X.696 #8.2.5 UNION with exeptions are ignored
+ L-0-5 ::= INTEGER ((0) | (5)) -- OER-visible constraint 0..5
+ M-inv ::= INTEGER ((0) | (5,...)) -- Not OER-visible
+ N-inv ::= INTEGER ((0..4,...) | (5)) -- Not OER-visible
+ O-inv ::= INTEGER ((0..4,...) | (5,...)) -- Not OER-visible
+
+END
diff --git a/tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1.-Pgen-OER b/tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1.-Pgen-OER
new file mode 100644
index 0000000..0d74625
--- /dev/null
+++ b/tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1.-Pgen-OER
@@ -0,0 +1,1349 @@
+
+/*** <<< INCLUDES [A-noc] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [A-noc] >>> ***/
+
+typedef long A_noc_t;
+
+/*** <<< FUNC-DECLS [A-noc] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_A_noc;
+asn_struct_free_f A_noc_free;
+asn_struct_print_f A_noc_print;
+asn_constr_check_f A_noc_constraint;
+ber_type_decoder_f A_noc_decode_ber;
+der_type_encoder_f A_noc_encode_der;
+xer_type_decoder_f A_noc_decode_xer;
+xer_type_encoder_f A_noc_encode_xer;
+oer_type_decoder_f A_noc_decode_oer;
+oer_type_encoder_f A_noc_encode_oer;
+
+/*** <<< CODE [A-noc] >>> ***/
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [A-noc] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_A_noc_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_A_noc = {
+ "A-noc",
+ "A-noc",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NativeInteger_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_A_noc_tags_1,
+ sizeof(asn_DEF_A_noc_tags_1)
+ /sizeof(asn_DEF_A_noc_tags_1[0]), /* 1 */
+ asn_DEF_A_noc_tags_1, /* Same as above */
+ sizeof(asn_DEF_A_noc_tags_1)
+ /sizeof(asn_DEF_A_noc_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [B-0-0] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [B-0-0] >>> ***/
+
+typedef long B_0_0_t;
+
+/*** <<< FUNC-DECLS [B-0-0] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_B_0_0;
+asn_struct_free_f B_0_0_free;
+asn_struct_print_f B_0_0_print;
+asn_constr_check_f B_0_0_constraint;
+ber_type_decoder_f B_0_0_decode_ber;
+der_type_encoder_f B_0_0_encode_der;
+xer_type_decoder_f B_0_0_decode_xer;
+xer_type_encoder_f B_0_0_encode_xer;
+oer_type_decoder_f B_0_0_decode_oer;
+oer_type_encoder_f B_0_0_encode_oer;
+
+/*** <<< CODE [B-0-0] >>> ***/
+
+int
+B_0_0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 0)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [B-0-0] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_B_0_0_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (0..0) */,
+ -1};
+
+/*** <<< STAT-DEFS [B-0-0] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_B_0_0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_B_0_0 = {
+ "B-0-0",
+ "B-0-0",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ B_0_0_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_B_0_0_tags_1,
+ sizeof(asn_DEF_B_0_0_tags_1)
+ /sizeof(asn_DEF_B_0_0_tags_1[0]), /* 1 */
+ asn_DEF_B_0_0_tags_1, /* Same as above */
+ sizeof(asn_DEF_B_0_0_tags_1)
+ /sizeof(asn_DEF_B_0_0_tags_1[0]), /* 1 */
+ &asn_OER_type_B_0_0_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [C-1-2] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [C-1-2] >>> ***/
+
+typedef long C_1_2_t;
+
+/*** <<< FUNC-DECLS [C-1-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_C_1_2;
+asn_struct_free_f C_1_2_free;
+asn_struct_print_f C_1_2_print;
+asn_constr_check_f C_1_2_constraint;
+ber_type_decoder_f C_1_2_decode_ber;
+der_type_encoder_f C_1_2_encode_der;
+xer_type_decoder_f C_1_2_decode_xer;
+xer_type_encoder_f C_1_2_encode_xer;
+oer_type_decoder_f C_1_2_decode_oer;
+oer_type_encoder_f C_1_2_encode_oer;
+
+/*** <<< CODE [C-1-2] >>> ***/
+
+int
+C_1_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 1 && value <= 2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [C-1-2] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_C_1_2_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (1..2) */,
+ -1};
+
+/*** <<< STAT-DEFS [C-1-2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_C_1_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_C_1_2 = {
+ "C-1-2",
+ "C-1-2",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ C_1_2_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_C_1_2_tags_1,
+ sizeof(asn_DEF_C_1_2_tags_1)
+ /sizeof(asn_DEF_C_1_2_tags_1[0]), /* 1 */
+ asn_DEF_C_1_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_C_1_2_tags_1)
+ /sizeof(asn_DEF_C_1_2_tags_1[0]), /* 1 */
+ &asn_OER_type_C_1_2_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [D-inv] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [D-inv] >>> ***/
+
+typedef long D_inv_t;
+
+/*** <<< FUNC-DECLS [D-inv] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_D_inv;
+asn_struct_free_f D_inv_free;
+asn_struct_print_f D_inv_print;
+asn_constr_check_f D_inv_constraint;
+ber_type_decoder_f D_inv_decode_ber;
+der_type_encoder_f D_inv_encode_der;
+xer_type_decoder_f D_inv_decode_xer;
+xer_type_encoder_f D_inv_encode_xer;
+oer_type_decoder_f D_inv_decode_oer;
+oer_type_encoder_f D_inv_encode_oer;
+
+/*** <<< CODE [D-inv] >>> ***/
+
+int
+D_inv_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 10)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [D-inv] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_D_inv_constr_1 GCC_NOTUSED = {
+ { 0, 0 },
+ -1};
+
+/*** <<< STAT-DEFS [D-inv] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_D_inv_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_D_inv = {
+ "D-inv",
+ "D-inv",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ D_inv_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_D_inv_tags_1,
+ sizeof(asn_DEF_D_inv_tags_1)
+ /sizeof(asn_DEF_D_inv_tags_1[0]), /* 1 */
+ asn_DEF_D_inv_tags_1, /* Same as above */
+ sizeof(asn_DEF_D_inv_tags_1)
+ /sizeof(asn_DEF_D_inv_tags_1[0]), /* 1 */
+ &asn_OER_type_D_inv_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [E-2-5] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [E-2-5] >>> ***/
+
+typedef long E_2_5_t;
+
+/*** <<< FUNC-DECLS [E-2-5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_E_2_5;
+asn_struct_free_f E_2_5_free;
+asn_struct_print_f E_2_5_print;
+asn_constr_check_f E_2_5_constraint;
+ber_type_decoder_f E_2_5_decode_ber;
+der_type_encoder_f E_2_5_encode_der;
+xer_type_decoder_f E_2_5_decode_xer;
+xer_type_encoder_f E_2_5_encode_xer;
+oer_type_decoder_f E_2_5_decode_oer;
+oer_type_encoder_f E_2_5_encode_oer;
+
+/*** <<< CODE [E-2-5] >>> ***/
+
+int
+E_2_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 2 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [E-2-5] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_E_2_5_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (2..5) */,
+ -1};
+
+/*** <<< STAT-DEFS [E-2-5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_E_2_5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_E_2_5 = {
+ "E-2-5",
+ "E-2-5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ E_2_5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_E_2_5_tags_1,
+ sizeof(asn_DEF_E_2_5_tags_1)
+ /sizeof(asn_DEF_E_2_5_tags_1[0]), /* 1 */
+ asn_DEF_E_2_5_tags_1, /* Same as above */
+ sizeof(asn_DEF_E_2_5_tags_1)
+ /sizeof(asn_DEF_E_2_5_tags_1[0]), /* 1 */
+ &asn_OER_type_E_2_5_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [F-inv] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [F-inv] >>> ***/
+
+typedef long F_inv_t;
+
+/*** <<< FUNC-DECLS [F-inv] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_F_inv;
+asn_struct_free_f F_inv_free;
+asn_struct_print_f F_inv_print;
+asn_constr_check_f F_inv_constraint;
+ber_type_decoder_f F_inv_decode_ber;
+der_type_encoder_f F_inv_encode_der;
+xer_type_decoder_f F_inv_decode_xer;
+xer_type_encoder_f F_inv_encode_xer;
+oer_type_decoder_f F_inv_decode_oer;
+oer_type_encoder_f F_inv_encode_oer;
+
+/*** <<< CODE [F-inv] >>> ***/
+
+int
+F_inv_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 2 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [F-inv] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_F_inv_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (0..10) */,
+ -1};
+
+/*** <<< STAT-DEFS [F-inv] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_F_inv_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_F_inv = {
+ "F-inv",
+ "F-inv",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ F_inv_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_F_inv_tags_1,
+ sizeof(asn_DEF_F_inv_tags_1)
+ /sizeof(asn_DEF_F_inv_tags_1[0]), /* 1 */
+ asn_DEF_F_inv_tags_1, /* Same as above */
+ sizeof(asn_DEF_F_inv_tags_1)
+ /sizeof(asn_DEF_F_inv_tags_1[0]), /* 1 */
+ &asn_OER_type_F_inv_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [G-3-3] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [G-3-3] >>> ***/
+
+typedef long G_3_3_t;
+
+/*** <<< FUNC-DECLS [G-3-3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_G_3_3;
+asn_struct_free_f G_3_3_free;
+asn_struct_print_f G_3_3_print;
+asn_constr_check_f G_3_3_constraint;
+ber_type_decoder_f G_3_3_decode_ber;
+der_type_encoder_f G_3_3_encode_der;
+xer_type_decoder_f G_3_3_decode_xer;
+xer_type_encoder_f G_3_3_encode_xer;
+oer_type_decoder_f G_3_3_decode_oer;
+oer_type_encoder_f G_3_3_encode_oer;
+
+/*** <<< CODE [G-3-3] >>> ***/
+
+int
+G_3_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 3)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [G-3-3] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_G_3_3_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (3..3) */,
+ -1};
+
+/*** <<< STAT-DEFS [G-3-3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_G_3_3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_G_3_3 = {
+ "G-3-3",
+ "G-3-3",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ G_3_3_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_G_3_3_tags_1,
+ sizeof(asn_DEF_G_3_3_tags_1)
+ /sizeof(asn_DEF_G_3_3_tags_1[0]), /* 1 */
+ asn_DEF_G_3_3_tags_1, /* Same as above */
+ sizeof(asn_DEF_G_3_3_tags_1)
+ /sizeof(asn_DEF_G_3_3_tags_1[0]), /* 1 */
+ &asn_OER_type_G_3_3_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [H-4-5] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [H-4-5] >>> ***/
+
+typedef long H_4_5_t;
+
+/*** <<< FUNC-DECLS [H-4-5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_H_4_5;
+asn_struct_free_f H_4_5_free;
+asn_struct_print_f H_4_5_print;
+asn_constr_check_f H_4_5_constraint;
+ber_type_decoder_f H_4_5_decode_ber;
+der_type_encoder_f H_4_5_encode_der;
+xer_type_decoder_f H_4_5_decode_xer;
+xer_type_encoder_f H_4_5_encode_xer;
+oer_type_decoder_f H_4_5_decode_oer;
+oer_type_encoder_f H_4_5_encode_oer;
+
+/*** <<< CODE [H-4-5] >>> ***/
+
+int
+H_4_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 4 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [H-4-5] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_H_4_5_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (4..5) */,
+ -1};
+
+/*** <<< STAT-DEFS [H-4-5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_H_4_5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_H_4_5 = {
+ "H-4-5",
+ "H-4-5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ H_4_5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_H_4_5_tags_1,
+ sizeof(asn_DEF_H_4_5_tags_1)
+ /sizeof(asn_DEF_H_4_5_tags_1[0]), /* 1 */
+ asn_DEF_H_4_5_tags_1, /* Same as above */
+ sizeof(asn_DEF_H_4_5_tags_1)
+ /sizeof(asn_DEF_H_4_5_tags_1[0]), /* 1 */
+ &asn_OER_type_H_4_5_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [I-0-5] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [I-0-5] >>> ***/
+
+typedef long I_0_5_t;
+
+/*** <<< FUNC-DECLS [I-0-5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_I_0_5;
+asn_struct_free_f I_0_5_free;
+asn_struct_print_f I_0_5_print;
+asn_constr_check_f I_0_5_constraint;
+ber_type_decoder_f I_0_5_decode_ber;
+der_type_encoder_f I_0_5_encode_der;
+xer_type_decoder_f I_0_5_decode_xer;
+xer_type_encoder_f I_0_5_encode_xer;
+oer_type_decoder_f I_0_5_decode_oer;
+oer_type_encoder_f I_0_5_encode_oer;
+
+/*** <<< CODE [I-0-5] >>> ***/
+
+int
+I_0_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 4 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [I-0-5] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_I_0_5_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (0..5) */,
+ -1};
+
+/*** <<< STAT-DEFS [I-0-5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_I_0_5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_I_0_5 = {
+ "I-0-5",
+ "I-0-5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ I_0_5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_I_0_5_tags_1,
+ sizeof(asn_DEF_I_0_5_tags_1)
+ /sizeof(asn_DEF_I_0_5_tags_1[0]), /* 1 */
+ asn_DEF_I_0_5_tags_1, /* Same as above */
+ sizeof(asn_DEF_I_0_5_tags_1)
+ /sizeof(asn_DEF_I_0_5_tags_1[0]), /* 1 */
+ &asn_OER_type_I_0_5_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [J-4-9] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [J-4-9] >>> ***/
+
+typedef long J_4_9_t;
+
+/*** <<< FUNC-DECLS [J-4-9] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_J_4_9;
+asn_struct_free_f J_4_9_free;
+asn_struct_print_f J_4_9_print;
+asn_constr_check_f J_4_9_constraint;
+ber_type_decoder_f J_4_9_decode_ber;
+der_type_encoder_f J_4_9_encode_der;
+xer_type_decoder_f J_4_9_decode_xer;
+xer_type_encoder_f J_4_9_encode_xer;
+oer_type_decoder_f J_4_9_decode_oer;
+oer_type_encoder_f J_4_9_encode_oer;
+
+/*** <<< CODE [J-4-9] >>> ***/
+
+int
+J_4_9_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 4 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [J-4-9] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_J_4_9_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (4..9) */,
+ -1};
+
+/*** <<< STAT-DEFS [J-4-9] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_J_4_9_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_J_4_9 = {
+ "J-4-9",
+ "J-4-9",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ J_4_9_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_J_4_9_tags_1,
+ sizeof(asn_DEF_J_4_9_tags_1)
+ /sizeof(asn_DEF_J_4_9_tags_1[0]), /* 1 */
+ asn_DEF_J_4_9_tags_1, /* Same as above */
+ sizeof(asn_DEF_J_4_9_tags_1)
+ /sizeof(asn_DEF_J_4_9_tags_1[0]), /* 1 */
+ &asn_OER_type_J_4_9_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [K-inv] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [K-inv] >>> ***/
+
+typedef long K_inv_t;
+
+/*** <<< FUNC-DECLS [K-inv] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_K_inv;
+asn_struct_free_f K_inv_free;
+asn_struct_print_f K_inv_print;
+asn_constr_check_f K_inv_constraint;
+ber_type_decoder_f K_inv_decode_ber;
+der_type_encoder_f K_inv_encode_der;
+xer_type_decoder_f K_inv_decode_xer;
+xer_type_encoder_f K_inv_encode_xer;
+oer_type_decoder_f K_inv_decode_oer;
+oer_type_encoder_f K_inv_encode_oer;
+
+/*** <<< CODE [K-inv] >>> ***/
+
+int
+K_inv_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 4 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [K-inv] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_K_inv_constr_1 GCC_NOTUSED = {
+ { 0, 0 },
+ -1};
+
+/*** <<< STAT-DEFS [K-inv] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_K_inv_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_K_inv = {
+ "K-inv",
+ "K-inv",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ K_inv_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_K_inv_tags_1,
+ sizeof(asn_DEF_K_inv_tags_1)
+ /sizeof(asn_DEF_K_inv_tags_1[0]), /* 1 */
+ asn_DEF_K_inv_tags_1, /* Same as above */
+ sizeof(asn_DEF_K_inv_tags_1)
+ /sizeof(asn_DEF_K_inv_tags_1[0]), /* 1 */
+ &asn_OER_type_K_inv_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [L-0-5] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [L-0-5] >>> ***/
+
+typedef long L_0_5_t;
+
+/*** <<< FUNC-DECLS [L-0-5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_L_0_5;
+asn_struct_free_f L_0_5_free;
+asn_struct_print_f L_0_5_print;
+asn_constr_check_f L_0_5_constraint;
+ber_type_decoder_f L_0_5_decode_ber;
+der_type_encoder_f L_0_5_encode_der;
+xer_type_decoder_f L_0_5_decode_xer;
+xer_type_encoder_f L_0_5_encode_xer;
+oer_type_decoder_f L_0_5_decode_oer;
+oer_type_encoder_f L_0_5_encode_oer;
+
+/*** <<< CODE [L-0-5] >>> ***/
+
+int
+L_0_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == 0) || (value == 5))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [L-0-5] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_L_0_5_constr_1 GCC_NOTUSED = {
+ { 1, 1 } /* (0..5) */,
+ -1};
+
+/*** <<< STAT-DEFS [L-0-5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_L_0_5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_L_0_5 = {
+ "L-0-5",
+ "L-0-5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ L_0_5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_L_0_5_tags_1,
+ sizeof(asn_DEF_L_0_5_tags_1)
+ /sizeof(asn_DEF_L_0_5_tags_1[0]), /* 1 */
+ asn_DEF_L_0_5_tags_1, /* Same as above */
+ sizeof(asn_DEF_L_0_5_tags_1)
+ /sizeof(asn_DEF_L_0_5_tags_1[0]), /* 1 */
+ &asn_OER_type_L_0_5_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [M-inv] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [M-inv] >>> ***/
+
+typedef long M_inv_t;
+
+/*** <<< FUNC-DECLS [M-inv] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_M_inv;
+asn_struct_free_f M_inv_free;
+asn_struct_print_f M_inv_print;
+asn_constr_check_f M_inv_constraint;
+ber_type_decoder_f M_inv_decode_ber;
+der_type_encoder_f M_inv_encode_der;
+xer_type_decoder_f M_inv_decode_xer;
+xer_type_encoder_f M_inv_encode_xer;
+oer_type_decoder_f M_inv_decode_oer;
+oer_type_encoder_f M_inv_encode_oer;
+
+/*** <<< CODE [M-inv] >>> ***/
+
+int
+M_inv_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == 0) || (value == 5))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [M-inv] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_M_inv_constr_1 GCC_NOTUSED = {
+ { 0, 0 },
+ -1};
+
+/*** <<< STAT-DEFS [M-inv] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_M_inv_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_M_inv = {
+ "M-inv",
+ "M-inv",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ M_inv_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_M_inv_tags_1,
+ sizeof(asn_DEF_M_inv_tags_1)
+ /sizeof(asn_DEF_M_inv_tags_1[0]), /* 1 */
+ asn_DEF_M_inv_tags_1, /* Same as above */
+ sizeof(asn_DEF_M_inv_tags_1)
+ /sizeof(asn_DEF_M_inv_tags_1[0]), /* 1 */
+ &asn_OER_type_M_inv_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [N-inv] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [N-inv] >>> ***/
+
+typedef long N_inv_t;
+
+/*** <<< FUNC-DECLS [N-inv] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_N_inv;
+asn_struct_free_f N_inv_free;
+asn_struct_print_f N_inv_print;
+asn_constr_check_f N_inv_constraint;
+ber_type_decoder_f N_inv_decode_ber;
+der_type_encoder_f N_inv_encode_der;
+xer_type_decoder_f N_inv_decode_xer;
+xer_type_encoder_f N_inv_encode_xer;
+oer_type_decoder_f N_inv_decode_oer;
+oer_type_encoder_f N_inv_encode_oer;
+
+/*** <<< CODE [N-inv] >>> ***/
+
+int
+N_inv_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [N-inv] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_N_inv_constr_1 GCC_NOTUSED = {
+ { 0, 0 },
+ -1};
+
+/*** <<< STAT-DEFS [N-inv] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_N_inv_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_N_inv = {
+ "N-inv",
+ "N-inv",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ N_inv_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_N_inv_tags_1,
+ sizeof(asn_DEF_N_inv_tags_1)
+ /sizeof(asn_DEF_N_inv_tags_1[0]), /* 1 */
+ asn_DEF_N_inv_tags_1, /* Same as above */
+ sizeof(asn_DEF_N_inv_tags_1)
+ /sizeof(asn_DEF_N_inv_tags_1[0]), /* 1 */
+ &asn_OER_type_N_inv_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [O-inv] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [O-inv] >>> ***/
+
+typedef long O_inv_t;
+
+/*** <<< FUNC-DECLS [O-inv] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_O_inv;
+asn_struct_free_f O_inv_free;
+asn_struct_print_f O_inv_print;
+asn_constr_check_f O_inv_constraint;
+ber_type_decoder_f O_inv_decode_ber;
+der_type_encoder_f O_inv_encode_der;
+xer_type_decoder_f O_inv_decode_xer;
+xer_type_encoder_f O_inv_encode_xer;
+oer_type_decoder_f O_inv_decode_oer;
+oer_type_encoder_f O_inv_encode_oer;
+
+/*** <<< CODE [O-inv] >>> ***/
+
+int
+O_inv_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [O-inv] >>> ***/
+
+static asn_oer_constraints_t asn_OER_type_O_inv_constr_1 GCC_NOTUSED = {
+ { 0, 0 },
+ -1};
+
+/*** <<< STAT-DEFS [O-inv] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_O_inv_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_O_inv = {
+ "O-inv",
+ "O-inv",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ O_inv_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ NativeInteger_decode_oer,
+ NativeInteger_encode_oer,
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_O_inv_tags_1,
+ sizeof(asn_DEF_O_inv_tags_1)
+ /sizeof(asn_DEF_O_inv_tags_1[0]), /* 1 */
+ asn_DEF_O_inv_tags_1, /* Same as above */
+ sizeof(asn_DEF_O_inv_tags_1)
+ /sizeof(asn_DEF_O_inv_tags_1[0]), /* 1 */
+ &asn_OER_type_O_inv_constr_1,
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/139-component-relation-OK.asn1 b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1
new file mode 100755
index 0000000..e71a35e
--- /dev/null
+++ b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1
@@ -0,0 +1,36 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .139
+
+ModuleComponentRelationConstraint
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 139 }
+ DEFINITIONS ::=
+BEGIN
+
+ Frame ::= SEQUENCE {
+ ident FRAME-STRUCTURE.&id({FrameTypes}),
+ value FRAME-STRUCTURE.&Type({FrameTypes}{@.ident}),
+ ...
+ }
+
+ FRAME-STRUCTURE ::= CLASS {
+ &id INTEGER UNIQUE,
+ &Type
+ } WITH SYNTAX {&Type IDENTIFIED BY &id}
+
+ FrameTypes FRAME-STRUCTURE ::= {
+ { PrimitiveMessage IDENTIFIED BY basicMessage } |
+ { ComplexMessage IDENTIFIED BY 2 },
+ ...
+ }
+
+ PrimitiveMessage ::= SEQUENCE {}
+ ComplexMessage ::= SEQUENCE {}
+
+ basicMessage INTEGER ::= 1
+
+END
diff --git a/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-EFprint-class-matrix b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-EFprint-class-matrix
new file mode 100644
index 0000000..fad77f9
--- /dev/null
+++ b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-EFprint-class-matrix
@@ -0,0 +1,36 @@
+ModuleComponentRelationConstraint { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 139 }
+DEFINITIONS ::=
+BEGIN
+
+Frame ::= SEQUENCE {
+ ident FRAME-STRUCTURE.&id ({FrameTypes}),
+ value FRAME-STRUCTURE.&Type ({FrameTypes}{@.ident}),
+ ...
+}
+
+FRAME-STRUCTURE ::= CLASS {
+ &id INTEGER UNIQUE,
+ &Type ANY
+} WITH SYNTAX {&Type IDENTIFIED BY &id}
+
+-- Information Object Set has 2 entries:
+-- [ &id][ &Type]
+-- [1] basicMessage PrimitiveMessage
+-- [2] 2 ComplexMessage
+
+
+FrameTypes FRAME-STRUCTURE ::= {{ PrimitiveMessage IDENTIFIED BY basicMessage } | { ComplexMessage IDENTIFIED BY 2 },...}
+-- Information Object Set has 2 entries:
+-- [ &id][ &Type]
+-- [1] basicMessage PrimitiveMessage
+-- [2] 2 ComplexMessage
+
+
+PrimitiveMessage ::= SEQUENCE { }
+
+ComplexMessage ::= SEQUENCE { }
+
+basicMessage INTEGER ::= 1
+
+END
diff --git a/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P
new file mode 100644
index 0000000..ea127a1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P
@@ -0,0 +1,286 @@
+
+/*** <<< INCLUDES [Frame] >>> ***/
+
+#include <NativeInteger.h>
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "PrimitiveMessage.h"
+#include "ComplexMessage.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Frame] >>> ***/
+
+typedef struct Frame {
+ long ident;
+ ANY_t value;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Frame_t;
+
+/*** <<< FUNC-DECLS [Frame] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Frame;
+
+/*** <<< IOC-TABLES [Frame] >>> ***/
+
+static const long asn_VAL_basicMessage_0 = 1;
+static const long asn_VAL_2_0 = 2;
+static const asn_ioc_cell_t asn_IOS_FrameTypes_1_rows[] = {
+ { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_basicMessage_0 },
+ { "&Type", aioc__type, &asn_DEF_PrimitiveMessage },
+ { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_2_0 },
+ { "&Type", aioc__type, &asn_DEF_ComplexMessage }
+};
+static asn_ioc_set_t asn_IOS_FrameTypes_1[] = {
+ 2, 2, asn_IOS_FrameTypes_1_rows
+};
+
+/*** <<< CODE [Frame] >>> ***/
+
+static int
+memb_ident_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_TYPE_descriptor_t *
+select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+ asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
+ size_t constraining_column = 0; /* &id */
+ size_t for_column = 1; /* &Type */
+ size_t row;
+ const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
+
+ for(row=0; row < itable->rows_count; row++) {
+ asn_ioc_cell_s *constraining_cell = itable->rows[row * itable->columns_count + constraining_column];
+ asn_ioc_cell_s *type_cell = itable->rows[row * itable->columns_count + for_column];
+ if(constraining_cell->type_descriptor->struct_compare(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+ return type_cell->type_descriptor;
+ }
+ }
+
+ return NULL;
+}
+
+static int
+memb_value_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [Frame] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Frame_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Frame, ident),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_ident_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ident"
+ },
+ { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value),
+ .tag = -1 /* Ambiguous tag (ANY?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_ANY,
+ .type_selector = select_value_type,
+ .memb_constraints = memb_value_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "value"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* ident */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = {
+ sizeof(struct Frame),
+ offsetof(struct Frame, _asn_ctx),
+ asn_MAP_Frame_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Frame = {
+ "Frame",
+ "Frame",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Frame_tags_1,
+ sizeof(asn_DEF_Frame_tags_1)
+ /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
+ asn_DEF_Frame_tags_1, /* Same as above */
+ sizeof(asn_DEF_Frame_tags_1)
+ /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Frame_1,
+ 2, /* Elements count */
+ &asn_SPC_Frame_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [PrimitiveMessage] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
+
+typedef struct PrimitiveMessage {
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} PrimitiveMessage_t;
+
+/*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
+extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
+
+/*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
+ sizeof(struct PrimitiveMessage),
+ offsetof(struct PrimitiveMessage, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
+ "PrimitiveMessage",
+ "PrimitiveMessage",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PrimitiveMessage_tags_1,
+ sizeof(asn_DEF_PrimitiveMessage_tags_1)
+ /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
+ asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
+ sizeof(asn_DEF_PrimitiveMessage_tags_1)
+ /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ComplexMessage] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
+
+typedef struct ComplexMessage {
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ComplexMessage_t;
+
+/*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
+extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
+
+/*** <<< STAT-DEFS [ComplexMessage] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
+ sizeof(struct ComplexMessage),
+ offsetof(struct ComplexMessage, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
+ "ComplexMessage",
+ "ComplexMessage",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ComplexMessage_tags_1,
+ sizeof(asn_DEF_ComplexMessage_tags_1)
+ /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
+ asn_DEF_ComplexMessage_tags_1, /* Same as above */
+ sizeof(asn_DEF_ComplexMessage_tags_1)
+ /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/14-resolver-OK.asn1 b/tests/tests-asn1c-compiler/14-resolver-OK.asn1
new file mode 100644
index 0000000..4b0df81
--- /dev/null
+++ b/tests/tests-asn1c-compiler/14-resolver-OK.asn1
@@ -0,0 +1,66 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .14 1
+-- .14 2
+-- .14 3
+
+ModuleTestResolver2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 14 1 }
+ DEFINITIONS ::=
+BEGIN
+ IMPORTS Enumeration, beta, gamma FROM
+ OtherModuleRenamed
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 14 2 };
+
+ -- external references
+ alpha Enumeration ::= beta
+ other Enumeration ::= gamma
+
+ Struct ::= SEQUENCE {
+ member1 [1] ModuleTestResolver3.Enumeration OPTIONAL,
+ member2 [2] OtherModuleRenamed.Enumeration DEFAULT b
+ }
+
+ --
+ -- The following are for post-fix checking by the check_fixer.
+ -- It will be able to pick-up these values if the file is parseable,
+ -- even if it contains some semantic errors.
+ --
+
+ check-alpha INTEGER ::= 2
+ check-other INTEGER ::= 1
+
+END
+
+ModuleTestResolver3
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 14 2 }
+ DEFINITIONS ::=
+BEGIN
+ EXPORTS Enumeration, beta, gamma;
+ IMPORTS gamma, HiddenEnum FROM HiddenModule;
+
+ beta HiddenEnum ::= b
+
+ Enumeration ::= ENUMERATED { a(1), b(2) } -- the same type --
+
+END
+
+HiddenModule
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 14 3 }
+ DEFINITIONS ::=
+BEGIN
+ EXPORTS HiddenEnum, gamma;
+ IMPORTS Enumeration FROM ModuleTestResolver3;
+
+ HiddenEnum ::= ENUMERATED { a(1), b(2) }
+
+ gamma Enumeration ::= a
+
+END
diff --git a/tests/tests-asn1c-compiler/14-resolver-OK.asn1.-EF b/tests/tests-asn1c-compiler/14-resolver-OK.asn1.-EF
new file mode 100644
index 0000000..8c3eb0f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/14-resolver-OK.asn1.-EF
@@ -0,0 +1,47 @@
+ModuleTestResolver2 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 14 1 }
+DEFINITIONS ::=
+BEGIN
+
+alpha Enumeration ::= 2
+
+other Enumeration ::= 1
+
+Struct ::= SEQUENCE {
+ member1 [1] EXPLICIT ModuleTestResolver3.Enumeration OPTIONAL,
+ member2 [2] EXPLICIT OtherModuleRenamed.Enumeration DEFAULT 2
+}
+
+check-alpha INTEGER ::= 2
+
+check-other INTEGER ::= 1
+
+END
+
+ModuleTestResolver3 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 14 2 }
+DEFINITIONS ::=
+BEGIN
+
+beta HiddenEnum ::= 2
+
+Enumeration ::= ENUMERATED {
+ a(1),
+ b(2)
+}
+
+END
+
+HiddenModule { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 14 3 }
+DEFINITIONS ::=
+BEGIN
+
+HiddenEnum ::= ENUMERATED {
+ a(1),
+ b(2)
+}
+
+gamma Enumeration ::= 1
+
+END
diff --git a/tests/tests-asn1c-compiler/140-component-relation-OK.asn1 b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1
new file mode 100755
index 0000000..acb72e5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1
@@ -0,0 +1,35 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .140
+
+ModuleComponentRelationConstraint
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 140 }
+ DEFINITIONS ::=
+BEGIN
+
+ Frame ::= SEQUENCE {
+ ident FRAME-STRUCTURE.&id({FrameTypes}),
+ value FRAME-STRUCTURE.&Type({FrameTypes}{@.ident}),
+ ...
+ }
+
+ FRAME-STRUCTURE ::= CLASS {
+ &id INTEGER UNIQUE,
+ &Type
+ } WITH SYNTAX {&Type IDENTIFIED BY &id}
+
+ FrameTypes FRAME-STRUCTURE ::= { primType | complexType, ... }
+
+ primType FRAME-STRUCTURE ::= { PrimitiveMessage IDENTIFIED BY basicMessage }
+ complexType FRAME-STRUCTURE ::= { ComplexMessage IDENTIFIED BY 2 }
+
+ PrimitiveMessage ::= SEQUENCE {}
+ ComplexMessage ::= SEQUENCE {}
+
+ basicMessage INTEGER ::= 1
+
+END
diff --git a/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-EFprint-class-matrix b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-EFprint-class-matrix
new file mode 100644
index 0000000..981e78b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-EFprint-class-matrix
@@ -0,0 +1,48 @@
+ModuleComponentRelationConstraint { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 140 }
+DEFINITIONS ::=
+BEGIN
+
+Frame ::= SEQUENCE {
+ ident FRAME-STRUCTURE.&id ({FrameTypes}),
+ value FRAME-STRUCTURE.&Type ({FrameTypes}{@.ident}),
+ ...
+}
+
+FRAME-STRUCTURE ::= CLASS {
+ &id INTEGER UNIQUE,
+ &Type ANY
+} WITH SYNTAX {&Type IDENTIFIED BY &id}
+
+-- Information Object Set has 2 entries:
+-- [ &id][ &Type]
+-- [1] basicMessage PrimitiveMessage
+-- [2] 2 ComplexMessage
+
+
+FrameTypes FRAME-STRUCTURE ::= {{ PrimitiveMessage IDENTIFIED BY basicMessage } | { ComplexMessage IDENTIFIED BY 2 },...}
+-- Information Object Set has 2 entries:
+-- [ &id][ &Type]
+-- [1] basicMessage PrimitiveMessage
+-- [2] 2 ComplexMessage
+
+
+primType FRAME-STRUCTURE ::= { PrimitiveMessage IDENTIFIED BY basicMessage }
+-- Information Object Set has 1 entry:
+-- [ &id][ &Type]
+-- [1] basicMessage PrimitiveMessage
+
+
+complexType FRAME-STRUCTURE ::= { ComplexMessage IDENTIFIED BY 2 }
+-- Information Object Set has 1 entry:
+-- [ &id][ &Type]
+-- [1] 2 ComplexMessage
+
+
+PrimitiveMessage ::= SEQUENCE { }
+
+ComplexMessage ::= SEQUENCE { }
+
+basicMessage INTEGER ::= 1
+
+END
diff --git a/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P
new file mode 100644
index 0000000..ea127a1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P
@@ -0,0 +1,286 @@
+
+/*** <<< INCLUDES [Frame] >>> ***/
+
+#include <NativeInteger.h>
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "PrimitiveMessage.h"
+#include "ComplexMessage.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Frame] >>> ***/
+
+typedef struct Frame {
+ long ident;
+ ANY_t value;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Frame_t;
+
+/*** <<< FUNC-DECLS [Frame] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Frame;
+
+/*** <<< IOC-TABLES [Frame] >>> ***/
+
+static const long asn_VAL_basicMessage_0 = 1;
+static const long asn_VAL_2_0 = 2;
+static const asn_ioc_cell_t asn_IOS_FrameTypes_1_rows[] = {
+ { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_basicMessage_0 },
+ { "&Type", aioc__type, &asn_DEF_PrimitiveMessage },
+ { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_2_0 },
+ { "&Type", aioc__type, &asn_DEF_ComplexMessage }
+};
+static asn_ioc_set_t asn_IOS_FrameTypes_1[] = {
+ 2, 2, asn_IOS_FrameTypes_1_rows
+};
+
+/*** <<< CODE [Frame] >>> ***/
+
+static int
+memb_ident_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_TYPE_descriptor_t *
+select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+ asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
+ size_t constraining_column = 0; /* &id */
+ size_t for_column = 1; /* &Type */
+ size_t row;
+ const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
+
+ for(row=0; row < itable->rows_count; row++) {
+ asn_ioc_cell_s *constraining_cell = itable->rows[row * itable->columns_count + constraining_column];
+ asn_ioc_cell_s *type_cell = itable->rows[row * itable->columns_count + for_column];
+ if(constraining_cell->type_descriptor->struct_compare(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+ return type_cell->type_descriptor;
+ }
+ }
+
+ return NULL;
+}
+
+static int
+memb_value_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [Frame] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Frame_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Frame, ident),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_ident_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ident"
+ },
+ { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value),
+ .tag = -1 /* Ambiguous tag (ANY?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_ANY,
+ .type_selector = select_value_type,
+ .memb_constraints = memb_value_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "value"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* ident */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = {
+ sizeof(struct Frame),
+ offsetof(struct Frame, _asn_ctx),
+ asn_MAP_Frame_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Frame = {
+ "Frame",
+ "Frame",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Frame_tags_1,
+ sizeof(asn_DEF_Frame_tags_1)
+ /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
+ asn_DEF_Frame_tags_1, /* Same as above */
+ sizeof(asn_DEF_Frame_tags_1)
+ /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Frame_1,
+ 2, /* Elements count */
+ &asn_SPC_Frame_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [PrimitiveMessage] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
+
+typedef struct PrimitiveMessage {
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} PrimitiveMessage_t;
+
+/*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
+extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
+
+/*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
+ sizeof(struct PrimitiveMessage),
+ offsetof(struct PrimitiveMessage, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
+ "PrimitiveMessage",
+ "PrimitiveMessage",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PrimitiveMessage_tags_1,
+ sizeof(asn_DEF_PrimitiveMessage_tags_1)
+ /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
+ asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
+ sizeof(asn_DEF_PrimitiveMessage_tags_1)
+ /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ComplexMessage] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
+
+typedef struct ComplexMessage {
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ComplexMessage_t;
+
+/*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
+extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
+
+/*** <<< STAT-DEFS [ComplexMessage] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
+ sizeof(struct ComplexMessage),
+ offsetof(struct ComplexMessage, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
+ "ComplexMessage",
+ "ComplexMessage",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ComplexMessage_tags_1,
+ sizeof(asn_DEF_ComplexMessage_tags_1)
+ /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
+ asn_DEF_ComplexMessage_tags_1, /* Same as above */
+ sizeof(asn_DEF_ComplexMessage_tags_1)
+ /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/15-resolver-SE.asn1 b/tests/tests-asn1c-compiler/15-resolver-SE.asn1
new file mode 100644
index 0000000..f4255c8
--- /dev/null
+++ b/tests/tests-asn1c-compiler/15-resolver-SE.asn1
@@ -0,0 +1,35 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .15 1
+-- .15 2
+
+ModuleTestResolver4
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 15 1 }
+ DEFINITIONS ::=
+BEGIN
+ IMPORTS Enumeration, beta FROM
+ OtherModuleRenamed
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 15 2 };
+
+ -- external reference
+ alpha Enumeration ::= beta
+
+END
+
+ModuleTestResolver5
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 15 2 }
+ DEFINITIONS ::=
+BEGIN
+ EXPORTS; -- Does not export anything!
+
+ beta Enumeration ::= b
+
+ Enumeration ::= ENUMERATED { a(1), b(2) }
+
+END
diff --git a/tests/tests-asn1c-compiler/16-constraint-OK.asn1 b/tests/tests-asn1c-compiler/16-constraint-OK.asn1
new file mode 100644
index 0000000..00ade37
--- /dev/null
+++ b/tests/tests-asn1c-compiler/16-constraint-OK.asn1
@@ -0,0 +1,39 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .16 1
+-- .16 2
+
+ModuleTestConstraint1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 16 1 }
+ DEFINITIONS ::=
+BEGIN
+ IMPORTS Type1 FROM ModuleTestConstraint2;
+
+ -- external reference
+ Type0 ::= IA5String (Type6)
+ Type6 ::= IA5String (Type1)
+END
+
+ModuleTestConstraint2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 16 2 }
+ DEFINITIONS ::=
+BEGIN
+ EXPORTS Type1;
+
+ -- external reference
+ Type1 ::= IA5String (SIZE(1..ten,...))(FROM("a".."z"|"#",...))
+ Type2 ::= IA5String (SIZE (MIN..4)|FROM ("abc"))
+ Type3 ::= BMPString (SIZE(1))
+ Type4 ::= INTEGER (1..MAX)
+ Type5 ::= BOOLEAN (TRUE|FALSE)
+
+ ten INTEGER ::= 10
+
+ v1 Type1 ::= "#value wi
+ th ""double quotes"""
+END
diff --git a/tests/tests-asn1c-compiler/16-constraint-OK.asn1.-EF b/tests/tests-asn1c-compiler/16-constraint-OK.asn1.-EF
new file mode 100644
index 0000000..a1f8e85
--- /dev/null
+++ b/tests/tests-asn1c-compiler/16-constraint-OK.asn1.-EF
@@ -0,0 +1,31 @@
+ModuleTestConstraint1 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 16 1 }
+DEFINITIONS ::=
+BEGIN
+
+Type0 ::= IA5String (((SIZE(1..10))(FROM("a".."z" | "#"))))
+
+Type6 ::= IA5String ((SIZE(1..10))(FROM("a".."z" | "#")))
+
+END
+
+ModuleTestConstraint2 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 16 2 }
+DEFINITIONS ::=
+BEGIN
+
+Type1 ::= IA5String (SIZE(1..10,...))(FROM("a".."z" | "#",...))
+
+Type2 ::= IA5String (SIZE(MIN..4) | FROM("abc"))
+
+Type3 ::= BMPString (SIZE(1))
+
+Type4 ::= INTEGER (1..MAX)
+
+Type5 ::= BOOLEAN (TRUE | FALSE)
+
+ten INTEGER ::= 10
+
+v1 Type1 ::= "#value with ""double quotes"""
+
+END
diff --git a/tests/tests-asn1c-compiler/16-constraint-OK.asn1.-EFprint-constraints b/tests/tests-asn1c-compiler/16-constraint-OK.asn1.-EFprint-constraints
new file mode 100644
index 0000000..30a5710
--- /dev/null
+++ b/tests/tests-asn1c-compiler/16-constraint-OK.asn1.-EFprint-constraints
Binary files differ
diff --git a/tests/tests-asn1c-compiler/17-tags-OK.asn1 b/tests/tests-asn1c-compiler/17-tags-OK.asn1
new file mode 100644
index 0000000..40f9c07
--- /dev/null
+++ b/tests/tests-asn1c-compiler/17-tags-OK.asn1
@@ -0,0 +1,24 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .17
+
+ModuleTestTags
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 17 }
+ DEFINITIONS ::=
+BEGIN
+
+ T3 ::= [3] IMPLICIT T2
+ T1 ::= [1] INTEGER
+ T2 ::= [2] EXPLICIT T1
+
+ T4 ::= [APPLICATION 1] SET {
+ t1 [4] IMPLICIT T1,
+ t2 [5] T2,
+ t3 [6] T3
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/18-class-OK.asn1 b/tests/tests-asn1c-compiler/18-class-OK.asn1
new file mode 100644
index 0000000..edae856
--- /dev/null
+++ b/tests/tests-asn1c-compiler/18-class-OK.asn1
@@ -0,0 +1,36 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .18
+
+ModuleTestClass
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 18 }
+ DEFINITIONS ::=
+BEGIN
+
+ AlphaNumeric ::= IA5String (FROM ("A".."Z"|"a".."z"|"0".."9"))
+
+ FUNCTION ::= CLASS {
+ &code INTEGER (0..MAX) UNIQUE,
+ &Alphabet IA5String DEFAULT {AlphaNumeric},
+ &ArgType ,
+ &SupportedArguments &ArgType OPTIONAL,
+ &ResultType DEFAULT NULL,
+ &result-if-error &ResultType DEFAULT NULL,
+ &associated-function FUNCTION OPTIONAL
+ }
+
+ operator-plus FUNCTION ::= {
+ &ArgType Pair,
+ &SupportedArguments { PosPair | NegPair }
+ &ResultType INTEGER,
+ &result-if-error 0,
+ &code 1
+ }
+
+ FunctionCodeType ::= FUNCTION.&code
+
+END
diff --git a/tests/tests-asn1c-compiler/18-class-OK.asn1.-EF b/tests/tests-asn1c-compiler/18-class-OK.asn1.-EF
new file mode 100644
index 0000000..e5ce9c2
--- /dev/null
+++ b/tests/tests-asn1c-compiler/18-class-OK.asn1.-EF
@@ -0,0 +1,28 @@
+ModuleTestClass { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 18 }
+DEFINITIONS ::=
+BEGIN
+
+AlphaNumeric ::= IA5String (FROM("A".."Z" | "a".."z" | "0".."9"))
+
+FUNCTION ::= CLASS {
+ &code INTEGER (0..MAX) UNIQUE,
+ &Alphabet IA5String DEFAULT {AlphaNumeric},
+ &ArgType ,
+ &SupportedArguments &ArgType OPTIONAL,
+ &ResultType DEFAULT NULL,
+ &result-if-error &ResultType DEFAULT NULL,
+ &associated-function FUNCTION OPTIONAL
+}
+
+operator-plus FUNCTION ::= {
+ &ArgType Pair,
+ &SupportedArguments { PosPair | NegPair }
+ &ResultType INTEGER,
+ &result-if-error 0,
+ &code 1
+ }
+
+FunctionCodeType ::= FUNCTION.&code
+
+END
diff --git a/tests/tests-asn1c-compiler/19-param-OK.asn1 b/tests/tests-asn1c-compiler/19-param-OK.asn1
new file mode 100644
index 0000000..31fa772
--- /dev/null
+++ b/tests/tests-asn1c-compiler/19-param-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)
+-- .19
+
+ModuleTestParam
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 19 }
+ DEFINITIONS ::=
+BEGIN
+
+ SIGNED { ToBeSigned } ::= SEQUENCE {
+ toBeSigned ToBeSigned,
+ algorithm OBJECT IDENTIFIER,
+ signature BIT STRING SIZE(0..256)
+ }
+
+ Certificate ::= SIGNED { SEQUENCE {
+ version INTEGER,
+ signature OBJECT IDENTIFIER,
+ issuer Name
+ } }
+
+ Name ::= SEQUENCE OF RelativeDistinguishedName
+
+ RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
+ IA5String (FROM("A".."Z"|"a".."z"|"0-9"|",-."))
+
+END
diff --git a/tests/tests-asn1c-compiler/19-param-OK.asn1.-EF b/tests/tests-asn1c-compiler/19-param-OK.asn1.-EF
new file mode 100644
index 0000000..da64015
--- /dev/null
+++ b/tests/tests-asn1c-compiler/19-param-OK.asn1.-EF
@@ -0,0 +1,22 @@
+ModuleTestParam { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 19 }
+DEFINITIONS ::=
+BEGIN
+
+SIGNED{ToBeSigned} ::= SEQUENCE {
+ toBeSigned ToBeSigned,
+ algorithm OBJECT IDENTIFIER,
+ signature BIT STRING SIZE(0..256)
+}
+
+Certificate ::= SIGNED{ SEQUENCE {
+ version INTEGER,
+ signature OBJECT IDENTIFIER,
+ issuer Name
+ }}
+
+Name ::= SEQUENCE OF RelativeDistinguishedName
+
+RelativeDistinguishedName ::= SET SIZE(1..MAX) OF IA5String (FROM("A".."Z" | "a".."z" | "0-9" | ",-."))
+
+END
diff --git a/tests/tests-asn1c-compiler/19-param-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/19-param-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..df32328
--- /dev/null
+++ b/tests/tests-asn1c-compiler/19-param-OK.asn1.-Pfwide-types
@@ -0,0 +1,493 @@
+
+/*** <<< INCLUDES [SIGNED] >>> ***/
+
+#include <OBJECT_IDENTIFIER.h>
+#include <BIT_STRING.h>
+#include <INTEGER.h>
+#include "Name.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [SIGNED] >>> ***/
+
+typedef struct SIGNED_15P0 {
+ struct toBeSigned {
+ INTEGER_t version;
+ OBJECT_IDENTIFIER_t signature;
+ Name_t issuer;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } toBeSigned;
+ OBJECT_IDENTIFIER_t algorithm;
+ BIT_STRING_t signature;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SIGNED_15P0_t;
+
+/*** <<< FUNC-DECLS [SIGNED] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0;
+extern asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[3];
+
+/*** <<< CODE [SIGNED] >>> ***/
+
+static int
+memb_signature_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(st->size > 0) {
+ /* Size in bits */
+ size = 8 * st->size - (st->bits_unused & 0x07);
+ } else {
+ size = 0;
+ }
+
+ if((size <= 256)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [SIGNED] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_toBeSigned_2[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, version),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "version"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, signature),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_OBJECT_IDENTIFIER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signature"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct toBeSigned, issuer),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Name,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "issuer"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_toBeSigned_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_toBeSigned_tag2el_2[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* version */
+ { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* signature */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 } /* issuer */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_toBeSigned_specs_2 = {
+ sizeof(struct toBeSigned),
+ offsetof(struct toBeSigned, _asn_ctx),
+ asn_MAP_toBeSigned_tag2el_2,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_toBeSigned_2 = {
+ "toBeSigned",
+ "toBeSigned",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_toBeSigned_tags_2,
+ sizeof(asn_DEF_toBeSigned_tags_2)
+ /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */
+ asn_DEF_toBeSigned_tags_2, /* Same as above */
+ sizeof(asn_DEF_toBeSigned_tags_2)
+ /sizeof(asn_DEF_toBeSigned_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_toBeSigned_2,
+ 3, /* Elements count */
+ &asn_SPC_toBeSigned_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, toBeSigned),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_toBeSigned_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "toBeSigned"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, algorithm),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_OBJECT_IDENTIFIER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "algorithm"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, signature),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = memb_signature_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signature"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SIGNED_15P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SIGNED_15P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 2, 0, 0 }, /* signature */
+ { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* algorithm */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* toBeSigned */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1 = {
+ sizeof(struct SIGNED_15P0),
+ offsetof(struct SIGNED_15P0, _asn_ctx),
+ asn_MAP_SIGNED_15P0_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0 = {
+ "SIGNED",
+ "SIGNED",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIGNED_15P0_tags_1,
+ sizeof(asn_DEF_SIGNED_15P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
+ asn_DEF_SIGNED_15P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIGNED_15P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_15P0_1,
+ 3, /* Elements count */
+ &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Certificate] >>> ***/
+
+#include "SIGNED.h"
+
+/*** <<< TYPE-DECLS [Certificate] >>> ***/
+
+typedef SIGNED_15P0_t Certificate_t;
+
+/*** <<< FUNC-DECLS [Certificate] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Certificate;
+asn_struct_free_f Certificate_free;
+asn_struct_print_f Certificate_print;
+asn_constr_check_f Certificate_constraint;
+ber_type_decoder_f Certificate_decode_ber;
+der_type_encoder_f Certificate_encode_der;
+xer_type_decoder_f Certificate_decode_xer;
+xer_type_encoder_f Certificate_encode_xer;
+
+/*** <<< CODE [Certificate] >>> ***/
+
+/*
+ * This type is implemented using SIGNED_15P0,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Certificate] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Certificate = {
+ "Certificate",
+ "Certificate",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Certificate_tags_1,
+ sizeof(asn_DEF_Certificate_tags_1)
+ /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
+ asn_DEF_Certificate_tags_1, /* Same as above */
+ sizeof(asn_DEF_Certificate_tags_1)
+ /sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_15P0_1,
+ 3, /* Elements count */
+ &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Name] >>> ***/
+
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+/*** <<< FWD-DECLS [Name] >>> ***/
+
+struct RelativeDistinguishedName;
+
+/*** <<< TYPE-DECLS [Name] >>> ***/
+
+typedef struct Name {
+ A_SEQUENCE_OF(struct RelativeDistinguishedName) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Name_t;
+
+/*** <<< FUNC-DECLS [Name] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Name;
+extern asn_SET_OF_specifics_t asn_SPC_Name_specs_1;
+extern asn_TYPE_member_t asn_MBR_Name_1[1];
+
+/*** <<< POST-INCLUDE [Name] >>> ***/
+
+#include "RelativeDistinguishedName.h"
+
+/*** <<< STAT-DEFS [Name] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Name_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_RelativeDistinguishedName,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Name_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_Name_specs_1 = {
+ sizeof(struct Name),
+ offsetof(struct Name, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Name = {
+ "Name",
+ "Name",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Name_tags_1,
+ sizeof(asn_DEF_Name_tags_1)
+ /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */
+ asn_DEF_Name_tags_1, /* Same as above */
+ sizeof(asn_DEF_Name_tags_1)
+ /sizeof(asn_DEF_Name_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Name_1,
+ 1, /* Single element */
+ &asn_SPC_Name_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [RelativeDistinguishedName] >>> ***/
+
+#include <IA5String.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< TYPE-DECLS [RelativeDistinguishedName] >>> ***/
+
+typedef struct RelativeDistinguishedName {
+ A_SET_OF(IA5String_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} RelativeDistinguishedName_t;
+
+/*** <<< FUNC-DECLS [RelativeDistinguishedName] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName;
+extern asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1;
+extern asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[1];
+
+/*** <<< CTABLES [RelativeDistinguishedName] >>> ***/
+
+static const int permitted_alphabet_table_2[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, /* ,-. */
+ 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, /* 0 9 */
+ 0, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20, /* ABCDEFGHIJKLMNO */
+21,22,23,24,25,26,27,28,29,30,31, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
+ 0,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, /* abcdefghijklmno */
+47,48,49,50,51,52,53,54,55,56,57, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
+};
+
+static int check_permitted_alphabet_2(const void *sptr) {
+ const int *table = permitted_alphabet_table_2;
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [RelativeDistinguishedName] >>> ***/
+
+static int
+memb_IA5String_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_2(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [RelativeDistinguishedName] >>> ***/
+
+asn_TYPE_member_t asn_MBR_RelativeDistinguishedName_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = memb_IA5String_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_RelativeDistinguishedName_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RelativeDistinguishedName_specs_1 = {
+ sizeof(struct RelativeDistinguishedName),
+ offsetof(struct RelativeDistinguishedName, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RelativeDistinguishedName = {
+ "RelativeDistinguishedName",
+ "RelativeDistinguishedName",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_RelativeDistinguishedName_tags_1,
+ sizeof(asn_DEF_RelativeDistinguishedName_tags_1)
+ /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */
+ asn_DEF_RelativeDistinguishedName_tags_1, /* Same as above */
+ sizeof(asn_DEF_RelativeDistinguishedName_tags_1)
+ /sizeof(asn_DEF_RelativeDistinguishedName_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_RelativeDistinguishedName_1,
+ 1, /* Single element */
+ &asn_SPC_RelativeDistinguishedName_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/20-constr-OK.asn1 b/tests/tests-asn1c-compiler/20-constr-OK.asn1
new file mode 100644
index 0000000..f2a97f0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/20-constr-OK.asn1
@@ -0,0 +1,30 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .20
+
+ModuleTestConstr
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 20 }
+ DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::=
+BEGIN
+
+ ConstructedType1 ::= SEQUENCE {
+ a [1] INTEGER,
+ b [2] INTEGER,
+ ...!ex1,
+ c IA5String,
+ ...,
+ d UTF8String
+ }
+
+ ConstructedType2 ::= SET {
+ a [1] INTEGER,
+ b [2] INTEGER
+ }
+
+ ex1 INTEGER ::= 1
+
+END
diff --git a/tests/tests-asn1c-compiler/20-constr-OK.asn1.-EF b/tests/tests-asn1c-compiler/20-constr-OK.asn1.-EF
new file mode 100644
index 0000000..798f756
--- /dev/null
+++ b/tests/tests-asn1c-compiler/20-constr-OK.asn1.-EF
@@ -0,0 +1,22 @@
+ModuleTestConstr { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 20 }
+DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::=
+BEGIN
+
+ConstructedType1 ::= SEQUENCE {
+ a [1] IMPLICIT INTEGER,
+ b [2] IMPLICIT INTEGER,
+ d UTF8String,
+ ...!ex1,
+ c IA5String
+}
+
+ConstructedType2 ::= SET {
+ a [1] IMPLICIT INTEGER,
+ b [2] IMPLICIT INTEGER,
+ ...
+}
+
+ex1 INTEGER ::= 1
+
+END
diff --git a/tests/tests-asn1c-compiler/21-tags-OK.asn1 b/tests/tests-asn1c-compiler/21-tags-OK.asn1
new file mode 100644
index 0000000..3a46c32
--- /dev/null
+++ b/tests/tests-asn1c-compiler/21-tags-OK.asn1
@@ -0,0 +1,34 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .21 1
+-- .21 2
+
+ModuleTestTags1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 21 1 }
+ DEFINITIONS EXPLICIT TAGS ::=
+BEGIN
+
+ T1 ::= CHOICE {
+ first [0] INTEGER,
+ second [1] INTEGER
+ }
+
+END
+
+ModuleTestTags2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 21 2 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+ IMPORTS T1 FROM ModuleTestTags1;
+
+ T2 ::= SEQUENCE {
+ one [0] T1,
+ two [1] IA5String
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/21-tags-OK.asn1.-EF b/tests/tests-asn1c-compiler/21-tags-OK.asn1.-EF
new file mode 100644
index 0000000..566e6a1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/21-tags-OK.asn1.-EF
@@ -0,0 +1,23 @@
+ModuleTestTags1 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 21 1 }
+DEFINITIONS EXPLICIT TAGS ::=
+BEGIN
+
+T1 ::= CHOICE {
+ first [0] EXPLICIT INTEGER,
+ second [1] EXPLICIT INTEGER
+}
+
+END
+
+ModuleTestTags2 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 21 2 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+T2 ::= SEQUENCE {
+ one [0] EXPLICIT T1,
+ two [1] IMPLICIT IA5String
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/22-tags-OK.asn1 b/tests/tests-asn1c-compiler/22-tags-OK.asn1
new file mode 100644
index 0000000..562e14b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/22-tags-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .22
+
+ModuleTestTags3
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 22 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ T1 ::= SEQUENCE {
+ a INTEGER,
+ b CHOICE {
+ i INTEGER,
+ n IA5String
+ },
+ c UTF8String
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/22-tags-OK.asn1.-EF b/tests/tests-asn1c-compiler/22-tags-OK.asn1.-EF
new file mode 100644
index 0000000..b1a0b8c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/22-tags-OK.asn1.-EF
@@ -0,0 +1,15 @@
+ModuleTestTags3 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 22 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+T1 ::= SEQUENCE {
+ a [0] IMPLICIT INTEGER,
+ b [1] EXPLICIT CHOICE {
+ i [0] IMPLICIT INTEGER,
+ n [1] IMPLICIT IA5String
+ },
+ c [2] IMPLICIT UTF8String
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/22-tags-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/22-tags-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..cefd976
--- /dev/null
+++ b/tests/tests-asn1c-compiler/22-tags-OK.asn1.-Pfwide-types
@@ -0,0 +1,186 @@
+
+/*** <<< INCLUDES [T1] >>> ***/
+
+#include <INTEGER.h>
+#include <UTF8String.h>
+#include <IA5String.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< DEPS [T1] >>> ***/
+
+typedef enum b_PR {
+ b_PR_NOTHING, /* No components present */
+ b_PR_i,
+ b_PR_n
+} b_PR;
+
+/*** <<< TYPE-DECLS [T1] >>> ***/
+
+typedef struct T1 {
+ INTEGER_t a;
+ struct b {
+ b_PR present;
+ union T1__b_u {
+ INTEGER_t i;
+ IA5String_t n;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } b;
+ UTF8String_t c;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T1_t;
+
+/*** <<< FUNC-DECLS [T1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T1;
+
+/*** <<< STAT-DEFS [T1] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_b_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct b, choice.i),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct b, choice.n),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "n"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* i */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* n */
+};
+static asn_CHOICE_specifics_t asn_SPC_b_specs_3 = {
+ sizeof(struct b),
+ offsetof(struct b, _asn_ctx),
+ offsetof(struct b, present),
+ sizeof(((struct b *)0)->present),
+ asn_MAP_b_tag2el_3,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_b_3 = {
+ "b",
+ "b",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_b_3,
+ 2, /* Elements count */
+ &asn_SPC_b_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_T1_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T1, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T1, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_b_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T1, c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T1_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 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T1_specs_1 = {
+ sizeof(struct T1),
+ offsetof(struct T1, _asn_ctx),
+ asn_MAP_T1_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T1 = {
+ "T1",
+ "T1",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T1_tags_1,
+ sizeof(asn_DEF_T1_tags_1)
+ /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
+ asn_DEF_T1_tags_1, /* Same as above */
+ sizeof(asn_DEF_T1_tags_1)
+ /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T1_1,
+ 3, /* Elements count */
+ &asn_SPC_T1_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/23-bits-OK.asn1 b/tests/tests-asn1c-compiler/23-bits-OK.asn1
new file mode 100644
index 0000000..f41b923
--- /dev/null
+++ b/tests/tests-asn1c-compiler/23-bits-OK.asn1
@@ -0,0 +1,22 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .23
+
+ModuleTestBitString
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 23 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ v28 INTEGER ::= 28
+
+ BS1 ::= BIT STRING { first(0), third(2), twenty-eight(v28) }
+
+ one-zero-one BS1 ::= { first, third } -- Equivalent to '101'B
+
+ one0one BS1 ::= '1010000'B -- Equivalent to '101'B
+
+END
diff --git a/tests/tests-asn1c-compiler/23-bits-OK.asn1.-EF b/tests/tests-asn1c-compiler/23-bits-OK.asn1.-EF
new file mode 100644
index 0000000..8064815
--- /dev/null
+++ b/tests/tests-asn1c-compiler/23-bits-OK.asn1.-EF
@@ -0,0 +1,18 @@
+ModuleTestBitString { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 23 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+v28 INTEGER ::= 28
+
+BS1 ::= BIT STRING {
+ first(0),
+ third(2),
+ twenty-eight(28)
+}
+
+one-zero-one BS1 ::= '101'B
+
+one0one BS1 ::= '101'B
+
+END
diff --git a/tests/tests-asn1c-compiler/24-sequence-OK.asn1 b/tests/tests-asn1c-compiler/24-sequence-OK.asn1
new file mode 100644
index 0000000..ce6f6d6
--- /dev/null
+++ b/tests/tests-asn1c-compiler/24-sequence-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .24
+
+ModuleTestSequence
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 24 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= [5] EXPLICIT SEQUENCE {
+ a INTEGER,
+ b [0] INTEGER OPTIONAL,
+ c [1] INTEGER DEFAULT ten,
+ d [5] EXPLICIT INTEGER
+ }
+
+ ten INTEGER ::= 10
+
+END
diff --git a/tests/tests-asn1c-compiler/24-sequence-OK.asn1.-EF b/tests/tests-asn1c-compiler/24-sequence-OK.asn1.-EF
new file mode 100644
index 0000000..ecdc4b0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/24-sequence-OK.asn1.-EF
@@ -0,0 +1,15 @@
+ModuleTestSequence { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 24 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+T ::= [5] EXPLICIT SEQUENCE {
+ a INTEGER,
+ b [0] IMPLICIT INTEGER OPTIONAL,
+ c [1] IMPLICIT INTEGER DEFAULT 10,
+ d [5] EXPLICIT INTEGER
+}
+
+ten INTEGER ::= 10
+
+END
diff --git a/tests/tests-asn1c-compiler/25-misc-OK.asn1 b/tests/tests-asn1c-compiler/25-misc-OK.asn1
new file mode 100644
index 0000000..43487de
--- /dev/null
+++ b/tests/tests-asn1c-compiler/25-misc-OK.asn1
@@ -0,0 +1,29 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .25
+
+ModuleTestMisc
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 25 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ a INTEGER,
+ b [2] BOOLEAN,
+ c NULL,
+ ...,
+ d ENUMERATED {
+ a(1), b(2)
+ },
+ e OCTET STRING,
+ f [5] VisibleString,
+ g BIT STRING,
+ h [7] BIT STRING,
+ ...
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/26-sequence-SE.asn1 b/tests/tests-asn1c-compiler/26-sequence-SE.asn1
new file mode 100644
index 0000000..8c5866a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/26-sequence-SE.asn1
@@ -0,0 +1,20 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .26
+
+ModuleTestSequenceTagsDistinct
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 26 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ a INTEGER,
+ b INTEGER OPTIONAL,
+ c INTEGER
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/27-set-SE.asn1 b/tests/tests-asn1c-compiler/27-set-SE.asn1
new file mode 100644
index 0000000..91e5697
--- /dev/null
+++ b/tests/tests-asn1c-compiler/27-set-SE.asn1
@@ -0,0 +1,21 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .27
+
+ModuleTestSetTagsDistinct
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 27 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= SET {
+ a INTEGER,
+ b CHOICE { -- Could we lookup tag past CHOICE?..
+ c INTEGER -- Tags must be distinct here.
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/28-tags-SE.asn1 b/tests/tests-asn1c-compiler/28-tags-SE.asn1
new file mode 100644
index 0000000..b3af0e3
--- /dev/null
+++ b/tests/tests-asn1c-compiler/28-tags-SE.asn1
@@ -0,0 +1,26 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .28
+
+ModuleTestTagsDistinct
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 28 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ S ::= SET {
+ a INTEGER,
+ b CHOICE {
+ c IA5String,
+ ...
+ },
+ d CHOICE {
+ e BOOLEAN,
+ ...
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/29-tags-OK.asn1 b/tests/tests-asn1c-compiler/29-tags-OK.asn1
new file mode 100644
index 0000000..440f16c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/29-tags-OK.asn1
@@ -0,0 +1,26 @@
+
+-- OK: Everything is fin
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .29
+
+ModuleTestTagsDistinct2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 29 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ S ::= SET {
+ a INTEGER,
+ b CHOICE {
+ c IA5String,
+ ...
+ },
+ d CHOICE {
+ e BOOLEAN,
+ ...
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/30-set-OK.asn1 b/tests/tests-asn1c-compiler/30-set-OK.asn1
new file mode 100644
index 0000000..41ad52d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/30-set-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .30
+
+ModuleTestSetSimple
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 30 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= SET {
+ i [APPLICATION 3] INTEGER,
+ s IA5String,
+ ...,
+ b [2] BOOLEAN
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/30-set-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/30-set-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..a0deb70
--- /dev/null
+++ b/tests/tests-asn1c-compiler/30-set-OK.asn1.-Pfwide-types
@@ -0,0 +1,130 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <INTEGER.h>
+#include <IA5String.h>
+#include <BOOLEAN.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum T_PR {
+ T_PR_i, /* Member i is present */
+ T_PR_s, /* Member s is present */
+ T_PR_b, /* Member b is present */
+} T_PR;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ INTEGER_t i;
+ IA5String_t s;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ BOOLEAN_t *b;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pT, T_PR_x) */
+ unsigned int _presence_map
+ [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, i),
+ .tag = (ASN_TAG_CLASS_APPLICATION | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, s),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "s"
+ },
+ { ATF_POINTER, 1, offsetof(struct T, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 }, /* s */
+ { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, 0, 0 }, /* i */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b */
+};
+static const uint8_t asn_MAP_T_mmap_1[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7) | (1 << 6) | (0 << 5)
+};
+static
+asn_SET_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ offsetof(struct T, _presence_map),
+ asn_MAP_T_tag2el_1,
+ 3, /* Count of tags in the map */
+ asn_MAP_T_tag2el_1, /* Same as above */
+ 3, /* Count of tags in the CXER map */
+ 1, /* Whether extensible */
+ (const unsigned int *)asn_MAP_T_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 3, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/31-set-of-OK.asn1 b/tests/tests-asn1c-compiler/31-set-of-OK.asn1
new file mode 100644
index 0000000..c8fa51e
--- /dev/null
+++ b/tests/tests-asn1c-compiler/31-set-of-OK.asn1
@@ -0,0 +1,40 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .31
+
+ModuleTestSetOfSimple
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 31 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ Forest ::= SET OF Tree
+
+ Tree ::= SEQUENCE {
+ height INTEGER,
+ width INTEGER
+ }
+
+ -- The following clause tests OPTIONAL.
+ Stuff ::= SET {
+ trees [1] SET OF Forest OPTIONAL,
+ ...,
+ other CHOICE {
+ a [0] INTEGER,
+ b [3] INTEGER
+ },
+ ...,
+ anything [2] SET OF
+ SEQUENCE {
+ cup-of-coffee BIT STRING,
+ ...
+ } OPTIONAL
+ -- The above OPTIONAL applies to the "anything"
+ -- member of the outer CHOICE,
+ -- not to the SET OF's embedded SEQUENCE!
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/31-set-of-OK.asn1.-EF b/tests/tests-asn1c-compiler/31-set-of-OK.asn1.-EF
new file mode 100644
index 0000000..f97ce2a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/31-set-of-OK.asn1.-EF
@@ -0,0 +1,26 @@
+ModuleTestSetOfSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 31 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+Forest ::= SET OF Tree
+
+Tree ::= SEQUENCE {
+ height INTEGER,
+ width INTEGER
+}
+
+Stuff ::= SET {
+ trees [1] IMPLICIT SET OF Forest OPTIONAL,
+ anything [2] IMPLICIT SET OF SEQUENCE {
+ cup-of-coffee BIT STRING,
+ ...
+ } OPTIONAL,
+ ...,
+ other CHOICE {
+ a [0] IMPLICIT INTEGER,
+ b [3] IMPLICIT INTEGER
+ }
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/31-set-of-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/31-set-of-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..b562307
--- /dev/null
+++ b/tests/tests-asn1c-compiler/31-set-of-OK.asn1.-Pfwide-types
@@ -0,0 +1,574 @@
+
+/*** <<< INCLUDES [Forest] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< FWD-DECLS [Forest] >>> ***/
+
+struct Tree;
+
+/*** <<< TYPE-DECLS [Forest] >>> ***/
+
+typedef struct Forest {
+ A_SET_OF(struct Tree) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Forest_t;
+
+/*** <<< FUNC-DECLS [Forest] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Forest;
+extern asn_SET_OF_specifics_t asn_SPC_Forest_specs_1;
+extern asn_TYPE_member_t asn_MBR_Forest_1[1];
+
+/*** <<< POST-INCLUDE [Forest] >>> ***/
+
+#include "Tree.h"
+
+/*** <<< STAT-DEFS [Forest] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Forest_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Tree,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Forest_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_Forest_specs_1 = {
+ sizeof(struct Forest),
+ offsetof(struct Forest, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Forest = {
+ "Forest",
+ "Forest",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Forest_tags_1,
+ sizeof(asn_DEF_Forest_tags_1)
+ /sizeof(asn_DEF_Forest_tags_1[0]), /* 1 */
+ asn_DEF_Forest_tags_1, /* Same as above */
+ sizeof(asn_DEF_Forest_tags_1)
+ /sizeof(asn_DEF_Forest_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Forest_1,
+ 1, /* Single element */
+ &asn_SPC_Forest_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Tree] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Tree] >>> ***/
+
+typedef struct Tree {
+ INTEGER_t height;
+ INTEGER_t width;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Tree_t;
+
+/*** <<< FUNC-DECLS [Tree] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Tree;
+extern asn_SEQUENCE_specifics_t asn_SPC_Tree_specs_1;
+extern asn_TYPE_member_t asn_MBR_Tree_1[2];
+
+/*** <<< STAT-DEFS [Tree] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Tree_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Tree, height),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "height"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Tree, width),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "width"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Tree_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Tree_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* height */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* width */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Tree_specs_1 = {
+ sizeof(struct Tree),
+ offsetof(struct Tree, _asn_ctx),
+ asn_MAP_Tree_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Tree = {
+ "Tree",
+ "Tree",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Tree_tags_1,
+ sizeof(asn_DEF_Tree_tags_1)
+ /sizeof(asn_DEF_Tree_tags_1[0]), /* 1 */
+ asn_DEF_Tree_tags_1, /* Same as above */
+ sizeof(asn_DEF_Tree_tags_1)
+ /sizeof(asn_DEF_Tree_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Tree_1,
+ 2, /* Elements count */
+ &asn_SPC_Tree_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Stuff] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <BIT_STRING.h>
+#include <constr_SEQUENCE.h>
+#include <INTEGER.h>
+#include <constr_CHOICE.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [Stuff] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum Stuff_PR {
+ Stuff_PR_trees, /* Member trees is present */
+ Stuff_PR_anything, /* Member anything is present */
+ Stuff_PR_other, /* Member other is present */
+} Stuff_PR;
+typedef enum other_PR {
+ other_PR_NOTHING, /* No components present */
+ other_PR_a,
+ other_PR_b
+} other_PR;
+
+/*** <<< FWD-DECLS [Stuff] >>> ***/
+
+struct Forest;
+
+/*** <<< FWD-DEFS [Stuff] >>> ***/
+
+typedef struct Member {
+ BIT_STRING_t cup_of_coffee;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Member;
+
+/*** <<< TYPE-DECLS [Stuff] >>> ***/
+
+typedef struct Stuff {
+ struct trees {
+ A_SET_OF(struct Forest) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *trees;
+ struct anything {
+ A_SET_OF(Member) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *anything;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ struct other {
+ other_PR present;
+ union Stuff__other_u {
+ INTEGER_t a;
+ INTEGER_t b;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *other;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pStuff, Stuff_PR_x) */
+ unsigned int _presence_map
+ [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Stuff_t;
+
+/*** <<< FUNC-DECLS [Stuff] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Stuff;
+
+/*** <<< POST-INCLUDE [Stuff] >>> ***/
+
+#include "Forest.h"
+
+/*** <<< STAT-DEFS [Stuff] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_trees_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Forest,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_trees_tags_2[] = {
+ (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_trees_specs_2 = {
+ sizeof(struct trees),
+ offsetof(struct trees, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_trees_2 = {
+ "trees",
+ "trees",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_trees_tags_2,
+ sizeof(asn_DEF_trees_tags_2)
+ /sizeof(asn_DEF_trees_tags_2[0]) - 1, /* 1 */
+ asn_DEF_trees_tags_2, /* Same as above */
+ sizeof(asn_DEF_trees_tags_2)
+ /sizeof(asn_DEF_trees_tags_2[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_trees_2,
+ 1, /* Single element */
+ &asn_SPC_trees_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_Member_5[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Member, cup_of_coffee),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "cup-of-coffee"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Member_tags_5[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_5[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* cup-of-coffee */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_5 = {
+ sizeof(struct Member),
+ offsetof(struct Member, _asn_ctx),
+ asn_MAP_Member_tag2el_5,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 0, /* Start extensions */
+ 2 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_Member_5 = {
+ "SEQUENCE",
+ "SEQUENCE",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Member_tags_5,
+ sizeof(asn_DEF_Member_tags_5)
+ /sizeof(asn_DEF_Member_tags_5[0]), /* 1 */
+ asn_DEF_Member_tags_5, /* Same as above */
+ sizeof(asn_DEF_Member_tags_5)
+ /sizeof(asn_DEF_Member_tags_5[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Member_5,
+ 1, /* Elements count */
+ &asn_SPC_Member_specs_5 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_anything_4[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Member_5,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_anything_tags_4[] = {
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_anything_specs_4 = {
+ sizeof(struct anything),
+ offsetof(struct anything, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_anything_4 = {
+ "anything",
+ "anything",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_anything_tags_4,
+ sizeof(asn_DEF_anything_tags_4)
+ /sizeof(asn_DEF_anything_tags_4[0]) - 1, /* 1 */
+ asn_DEF_anything_tags_4, /* Same as above */
+ sizeof(asn_DEF_anything_tags_4)
+ /sizeof(asn_DEF_anything_tags_4[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_anything_4,
+ 1, /* Single element */
+ &asn_SPC_anything_specs_4 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_other_9[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct other, choice.a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct other, choice.b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_other_tag2el_9[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* b */
+};
+static asn_CHOICE_specifics_t asn_SPC_other_specs_9 = {
+ sizeof(struct other),
+ offsetof(struct other, _asn_ctx),
+ offsetof(struct other, present),
+ sizeof(((struct other *)0)->present),
+ asn_MAP_other_tag2el_9,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_other_9 = {
+ "other",
+ "other",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_other_9,
+ 2, /* Elements count */
+ &asn_SPC_other_specs_9 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_Stuff_1[] = {
+ { ATF_POINTER, 3, offsetof(struct Stuff, trees),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_trees_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "trees"
+ },
+ { ATF_POINTER, 2, offsetof(struct Stuff, anything),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_anything_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "anything"
+ },
+ { ATF_POINTER, 1, offsetof(struct Stuff, other),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_other_9,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "other"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Stuff_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Stuff_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* trees */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* anything */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 } /* b */
+};
+static const asn_TYPE_tag2member_t asn_MAP_Stuff_tag2el_cxer_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* trees */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* anything */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 } /* a */
+};
+static const uint8_t asn_MAP_Stuff_mmap_1[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (0 << 7) | (0 << 6) | (0 << 5)
+};
+static
+asn_SET_specifics_t asn_SPC_Stuff_specs_1 = {
+ sizeof(struct Stuff),
+ offsetof(struct Stuff, _asn_ctx),
+ offsetof(struct Stuff, _presence_map),
+ asn_MAP_Stuff_tag2el_1,
+ 4, /* Count of tags in the map */
+ asn_MAP_Stuff_tag2el_cxer_1,
+ 3, /* Count of tags in the CXER map */
+ 1, /* Whether extensible */
+ (const unsigned int *)asn_MAP_Stuff_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_Stuff = {
+ "Stuff",
+ "Stuff",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Stuff_tags_1,
+ sizeof(asn_DEF_Stuff_tags_1)
+ /sizeof(asn_DEF_Stuff_tags_1[0]), /* 1 */
+ asn_DEF_Stuff_tags_1, /* Same as above */
+ sizeof(asn_DEF_Stuff_tags_1)
+ /sizeof(asn_DEF_Stuff_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Stuff_1,
+ 3, /* Elements count */
+ &asn_SPC_Stuff_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1 b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1
new file mode 100644
index 0000000..467e5bd
--- /dev/null
+++ b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1
@@ -0,0 +1,34 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .32
+
+ModuleTestSequenceSimple
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 32 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ Programming ::= SEQUENCE SIZE(1..maxSize) OF [0] IMPLICIT Fault
+
+ Fault ::= SET OF Error
+
+ Error ::= SEQUENCE {
+ ...
+ }
+
+ maxSize INTEGER ::= 10
+
+ SeqWithMandatory ::= SEQUENCE {
+ someString UTF8String,
+ seqOfMan [0] EXPLICIT SEQUENCE OF Error
+ }
+
+ SeqWithOptional ::= SEQUENCE {
+ someString UTF8String,
+ seqOfOpt [0] EXPLICIT SEQUENCE OF Error OPTIONAL
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-EF b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-EF
new file mode 100644
index 0000000..d0059b2
--- /dev/null
+++ b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-EF
@@ -0,0 +1,26 @@
+ModuleTestSequenceSimple { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 32 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+Programming ::= SEQUENCE SIZE(1..10) OF [0] IMPLICIT Fault
+
+Fault ::= SET OF Error
+
+Error ::= SEQUENCE {
+ ...
+}
+
+maxSize INTEGER ::= 10
+
+SeqWithMandatory ::= SEQUENCE {
+ someString UTF8String,
+ seqOfMan [0] EXPLICIT SEQUENCE OF Error
+}
+
+SeqWithOptional ::= SEQUENCE {
+ someString UTF8String,
+ seqOfOpt [0] EXPLICIT SEQUENCE OF Error OPTIONAL
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
new file mode 100644
index 0000000..c52168e
--- /dev/null
+++ b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
@@ -0,0 +1,526 @@
+
+/*** <<< INCLUDES [Programming] >>> ***/
+
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+/*** <<< FWD-DECLS [Programming] >>> ***/
+
+struct Fault;
+
+/*** <<< TYPE-DECLS [Programming] >>> ***/
+
+typedef struct Programming {
+ A_SEQUENCE_OF(struct Fault) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Programming_t;
+
+/*** <<< FUNC-DECLS [Programming] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Programming;
+
+/*** <<< POST-INCLUDE [Programming] >>> ***/
+
+#include "Fault.h"
+
+/*** <<< STAT-DEFS [Programming] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Programming_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Fault,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Programming_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_Programming_specs_1 = {
+ sizeof(struct Programming),
+ offsetof(struct Programming, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Programming = {
+ "Programming",
+ "Programming",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Programming_tags_1,
+ sizeof(asn_DEF_Programming_tags_1)
+ /sizeof(asn_DEF_Programming_tags_1[0]), /* 1 */
+ asn_DEF_Programming_tags_1, /* Same as above */
+ sizeof(asn_DEF_Programming_tags_1)
+ /sizeof(asn_DEF_Programming_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Programming_1,
+ 1, /* Single element */
+ &asn_SPC_Programming_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Fault] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< FWD-DECLS [Fault] >>> ***/
+
+struct Error;
+
+/*** <<< TYPE-DECLS [Fault] >>> ***/
+
+typedef struct Fault {
+ A_SET_OF(struct Error) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Fault_t;
+
+/*** <<< FUNC-DECLS [Fault] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Fault;
+extern asn_SET_OF_specifics_t asn_SPC_Fault_specs_1;
+extern asn_TYPE_member_t asn_MBR_Fault_1[1];
+
+/*** <<< POST-INCLUDE [Fault] >>> ***/
+
+#include "Error.h"
+
+/*** <<< STAT-DEFS [Fault] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Fault_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Error,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Fault_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_Fault_specs_1 = {
+ sizeof(struct Fault),
+ offsetof(struct Fault, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Fault = {
+ "Fault",
+ "Fault",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Fault_tags_1,
+ sizeof(asn_DEF_Fault_tags_1)
+ /sizeof(asn_DEF_Fault_tags_1[0]), /* 1 */
+ asn_DEF_Fault_tags_1, /* Same as above */
+ sizeof(asn_DEF_Fault_tags_1)
+ /sizeof(asn_DEF_Fault_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Fault_1,
+ 1, /* Single element */
+ &asn_SPC_Fault_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Error] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Error] >>> ***/
+
+typedef struct Error {
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Error_t;
+
+/*** <<< FUNC-DECLS [Error] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Error;
+extern asn_SEQUENCE_specifics_t asn_SPC_Error_specs_1;
+
+/*** <<< STAT-DEFS [Error] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Error_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SEQUENCE_specifics_t asn_SPC_Error_specs_1 = {
+ sizeof(struct Error),
+ offsetof(struct Error, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Error = {
+ "Error",
+ "Error",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Error_tags_1,
+ sizeof(asn_DEF_Error_tags_1)
+ /sizeof(asn_DEF_Error_tags_1[0]), /* 1 */
+ asn_DEF_Error_tags_1, /* Same as above */
+ sizeof(asn_DEF_Error_tags_1)
+ /sizeof(asn_DEF_Error_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_Error_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SeqWithMandatory] >>> ***/
+
+#include <UTF8String.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [SeqWithMandatory] >>> ***/
+
+struct Error;
+
+/*** <<< TYPE-DECLS [SeqWithMandatory] >>> ***/
+
+typedef struct SeqWithMandatory {
+ UTF8String_t someString;
+ struct seqOfMan {
+ A_SEQUENCE_OF(struct Error) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } seqOfMan;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SeqWithMandatory_t;
+
+/*** <<< FUNC-DECLS [SeqWithMandatory] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SeqWithMandatory;
+
+/*** <<< POST-INCLUDE [SeqWithMandatory] >>> ***/
+
+#include "Error.h"
+
+/*** <<< STAT-DEFS [SeqWithMandatory] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_seqOfMan_3[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Error,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_seqOfMan_tags_3[] = {
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_seqOfMan_specs_3 = {
+ sizeof(struct seqOfMan),
+ offsetof(struct seqOfMan, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_seqOfMan_3 = {
+ "seqOfMan",
+ "seqOfMan",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_seqOfMan_tags_3,
+ sizeof(asn_DEF_seqOfMan_tags_3)
+ /sizeof(asn_DEF_seqOfMan_tags_3[0]), /* 2 */
+ asn_DEF_seqOfMan_tags_3, /* Same as above */
+ sizeof(asn_DEF_seqOfMan_tags_3)
+ /sizeof(asn_DEF_seqOfMan_tags_3[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_seqOfMan_3,
+ 1, /* Single element */
+ &asn_SPC_seqOfMan_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_SeqWithMandatory_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SeqWithMandatory, someString),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "someString"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct SeqWithMandatory, seqOfMan),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_seqOfMan_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "seqOfMan"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SeqWithMandatory_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SeqWithMandatory_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* someString */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* seqOfMan */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_SeqWithMandatory_specs_1 = {
+ sizeof(struct SeqWithMandatory),
+ offsetof(struct SeqWithMandatory, _asn_ctx),
+ asn_MAP_SeqWithMandatory_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SeqWithMandatory = {
+ "SeqWithMandatory",
+ "SeqWithMandatory",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SeqWithMandatory_tags_1,
+ sizeof(asn_DEF_SeqWithMandatory_tags_1)
+ /sizeof(asn_DEF_SeqWithMandatory_tags_1[0]), /* 1 */
+ asn_DEF_SeqWithMandatory_tags_1, /* Same as above */
+ sizeof(asn_DEF_SeqWithMandatory_tags_1)
+ /sizeof(asn_DEF_SeqWithMandatory_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SeqWithMandatory_1,
+ 2, /* Elements count */
+ &asn_SPC_SeqWithMandatory_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SeqWithOptional] >>> ***/
+
+#include <UTF8String.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [SeqWithOptional] >>> ***/
+
+struct Error;
+
+/*** <<< TYPE-DECLS [SeqWithOptional] >>> ***/
+
+typedef struct SeqWithOptional {
+ UTF8String_t someString;
+ struct seqOfOpt {
+ A_SEQUENCE_OF(struct Error) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *seqOfOpt;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SeqWithOptional_t;
+
+/*** <<< FUNC-DECLS [SeqWithOptional] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SeqWithOptional;
+
+/*** <<< POST-INCLUDE [SeqWithOptional] >>> ***/
+
+#include "Error.h"
+
+/*** <<< STAT-DEFS [SeqWithOptional] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_seqOfOpt_3[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Error,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_seqOfOpt_tags_3[] = {
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_seqOfOpt_specs_3 = {
+ sizeof(struct seqOfOpt),
+ offsetof(struct seqOfOpt, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_seqOfOpt_3 = {
+ "seqOfOpt",
+ "seqOfOpt",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_seqOfOpt_tags_3,
+ sizeof(asn_DEF_seqOfOpt_tags_3)
+ /sizeof(asn_DEF_seqOfOpt_tags_3[0]), /* 2 */
+ asn_DEF_seqOfOpt_tags_3, /* Same as above */
+ sizeof(asn_DEF_seqOfOpt_tags_3)
+ /sizeof(asn_DEF_seqOfOpt_tags_3[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_seqOfOpt_3,
+ 1, /* Single element */
+ &asn_SPC_seqOfOpt_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_SeqWithOptional_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SeqWithOptional, someString),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "someString"
+ },
+ { ATF_POINTER, 1, offsetof(struct SeqWithOptional, seqOfOpt),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_seqOfOpt_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "seqOfOpt"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SeqWithOptional_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SeqWithOptional_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* someString */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* seqOfOpt */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_SeqWithOptional_specs_1 = {
+ sizeof(struct SeqWithOptional),
+ offsetof(struct SeqWithOptional, _asn_ctx),
+ asn_MAP_SeqWithOptional_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SeqWithOptional = {
+ "SeqWithOptional",
+ "SeqWithOptional",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SeqWithOptional_tags_1,
+ sizeof(asn_DEF_SeqWithOptional_tags_1)
+ /sizeof(asn_DEF_SeqWithOptional_tags_1[0]), /* 1 */
+ asn_DEF_SeqWithOptional_tags_1, /* Same as above */
+ sizeof(asn_DEF_SeqWithOptional_tags_1)
+ /sizeof(asn_DEF_SeqWithOptional_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SeqWithOptional_1,
+ 2, /* Elements count */
+ &asn_SPC_SeqWithOptional_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/33-misc-OK.asn1 b/tests/tests-asn1c-compiler/33-misc-OK.asn1
new file mode 100644
index 0000000..1018a40
--- /dev/null
+++ b/tests/tests-asn1c-compiler/33-misc-OK.asn1
@@ -0,0 +1,33 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .33
+
+ModuleTestMiscComplex
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 33 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ a [1] INTEGER,
+ ...,
+ b [2] EXPLICIT BitString,
+ c [8] IMPLICIT Label,
+ d [10] IMPLICIT Int,
+ e [12] T2
+ }
+
+ BitString ::= [8] BIT STRING
+
+ Label ::= [9] EXPLICIT UTF8String
+
+ Label2 ::= [1] Label
+
+ Int ::= [3] IMPLICIT INTEGER { a(1), b(2) }
+
+ T2 ::= SEQUENCE { l Label2 }
+
+END
diff --git a/tests/tests-asn1c-compiler/34-class-OK.asn1 b/tests/tests-asn1c-compiler/34-class-OK.asn1
new file mode 100644
index 0000000..2ea8901
--- /dev/null
+++ b/tests/tests-asn1c-compiler/34-class-OK.asn1
@@ -0,0 +1,53 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .34
+
+ModuleTestClassSimple
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 34 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ -- First CLASS
+
+ EXTENSION ::= CLASS {
+ &id [PRIVATE 0] INTEGER UNIQUE,
+ &ExtnType
+ } WITH SYNTAX {
+ SYNTAX &ExtnType
+ IDENTIFIED BY &id
+ }
+
+ -- Basic CLASS extraction
+ Ext1 ::= SEQUENCE {
+ extnId EXTENSION.&id
+ }
+
+ -- Second CLASS
+
+ EXTENSION-ATTRIBUTE ::= CLASS {
+ &id INTEGER (0..ub-extension-attributes) UNIQUE,
+ &Type
+ } WITH SYNTAX {&Type IDENTIFIED BY &id}
+
+ terminal-type EXTENSION-ATTRIBUTE ::= {TerminalType IDENTIFIED BY 23}
+
+ TerminalType ::= INTEGER { terminal(0) }
+
+ -- Advanced CLASS extraction
+
+ ExtensionAttribute ::= SEQUENCE {
+ extension-attribute-type [0] EXTENSION-ATTRIBUTE.&id
+ ({ExtensionAttributeTable}),
+ extension-attribute-value [1] EXTENSION-ATTRIBUTE.&Type
+ ({ExtensionAttributeTable} {@extension-attribute-type})
+ }
+
+ -- Variables referenced by subtype constraints
+
+ ub-extension-attributes INTEGER ::= 256
+
+END
diff --git a/tests/tests-asn1c-compiler/34-class-OK.asn1.-EF b/tests/tests-asn1c-compiler/34-class-OK.asn1.-EF
new file mode 100644
index 0000000..8af80a8
--- /dev/null
+++ b/tests/tests-asn1c-compiler/34-class-OK.asn1.-EF
@@ -0,0 +1,38 @@
+ModuleTestClassSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 34 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+EXTENSION ::= CLASS {
+ &id [PRIVATE 0] INTEGER UNIQUE,
+ &ExtnType
+} WITH SYNTAX {
+ SYNTAX &ExtnType
+ IDENTIFIED BY &id
+ }
+
+
+Ext1 ::= SEQUENCE {
+ extnId EXTENSION.&id
+}
+
+EXTENSION-ATTRIBUTE ::= CLASS {
+ &id INTEGER (0..256) UNIQUE,
+ &Type ANY
+} WITH SYNTAX {&Type IDENTIFIED BY &id}
+
+
+terminal-type EXTENSION-ATTRIBUTE ::= {TerminalType IDENTIFIED BY 23}
+
+TerminalType ::= INTEGER {
+ terminal(0)
+}
+
+ExtensionAttribute ::= SEQUENCE {
+ extension-attribute-type [0] IMPLICIT EXTENSION-ATTRIBUTE.&id ({ExtensionAttributeTable}),
+ extension-attribute-value [1] EXPLICIT EXTENSION-ATTRIBUTE.&Type ({ExtensionAttributeTable}{@extension-attribute-type})
+}
+
+ub-extension-attributes INTEGER ::= 256
+
+END
diff --git a/tests/tests-asn1c-compiler/34-class-OK.asn1.-EFprint-class-matrix b/tests/tests-asn1c-compiler/34-class-OK.asn1.-EFprint-class-matrix
new file mode 100644
index 0000000..136dd92
--- /dev/null
+++ b/tests/tests-asn1c-compiler/34-class-OK.asn1.-EFprint-class-matrix
@@ -0,0 +1,47 @@
+ModuleTestClassSimple { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 34 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+EXTENSION ::= CLASS {
+ &id [PRIVATE 0] INTEGER UNIQUE,
+ &ExtnType
+} WITH SYNTAX {
+ SYNTAX &ExtnType
+ IDENTIFIED BY &id
+ }
+
+-- Information Object Class table is empty
+
+Ext1 ::= SEQUENCE {
+ extnId EXTENSION.&id
+}
+
+EXTENSION-ATTRIBUTE ::= CLASS {
+ &id INTEGER (0..256) UNIQUE,
+ &Type ANY
+} WITH SYNTAX {&Type IDENTIFIED BY &id}
+
+-- Information Object Set has 1 entry:
+-- [ &id][ &Type]
+-- [1] 23 TerminalType
+
+
+terminal-type EXTENSION-ATTRIBUTE ::= {TerminalType IDENTIFIED BY 23}
+-- Information Object Set has 1 entry:
+-- [ &id][ &Type]
+-- [1] 23 TerminalType
+
+
+TerminalType ::= INTEGER {
+ terminal(0)
+}
+
+ExtensionAttribute ::= SEQUENCE {
+ extension-attribute-type [0] IMPLICIT EXTENSION-ATTRIBUTE.&id ({ExtensionAttributeTable}),
+ extension-attribute-value [1] EXPLICIT EXTENSION-ATTRIBUTE.&Type ({ExtensionAttributeTable}{@extension-attribute-type})
+}
+
+ub-extension-attributes INTEGER ::= 256
+
+END
diff --git a/tests/tests-asn1c-compiler/35-set-choice-OK.asn1 b/tests/tests-asn1c-compiler/35-set-choice-OK.asn1
new file mode 100644
index 0000000..3678021
--- /dev/null
+++ b/tests/tests-asn1c-compiler/35-set-choice-OK.asn1
@@ -0,0 +1,36 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .35
+
+ModuleTestSetAndUntaggedChoice
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 35 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= SET {
+ a NumericString,
+ b CHOICE { -- Untagged choice
+ b1 IA5String,
+ b2 ObjectDescriptor,
+ b3 Choice
+ },
+ c BOOLEAN,
+ ...,
+ d OID
+ }
+
+ Choice ::= CHOICE { -- One more level
+ ch-a OCTET STRING,
+ ch-b BIT STRING
+ }
+
+ OID ::= CHOICE {
+ oid OBJECT IDENTIFIER,
+ r-oid RELATIVE-OID
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/36-indirect-choice-SE.asn1 b/tests/tests-asn1c-compiler/36-indirect-choice-SE.asn1
new file mode 100644
index 0000000..90155c7
--- /dev/null
+++ b/tests/tests-asn1c-compiler/36-indirect-choice-SE.asn1
@@ -0,0 +1,25 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .36
+
+ModuleTestIndirectChoiceError
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 36 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= CHOICE {
+ t-a INTEGER,
+ t-b OCTET STRING,
+ t-c Choice
+ }
+
+ Choice ::= CHOICE { -- One more level
+ c-a OCTET STRING,
+ c-b INTEGER
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1 b/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1
new file mode 100644
index 0000000..86b3b66
--- /dev/null
+++ b/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1
@@ -0,0 +1,38 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .37
+
+ModuleTestIndirectChoiceFine
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 37 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= CHOICE {
+ t-a INTEGER,
+ t-b OCTET STRING,
+ t-c [1] Choice1,
+ t-d [3] Choice2
+ }
+
+ Choice1 ::= CHOICE {
+ c-a OCTET STRING,
+ c-b INTEGER
+ }
+
+ Choice2 ::= [2] CHOICE {
+ c-a OCTET STRING,
+ c-b INTEGER,
+ c-d [3] Choice1,
+ c-e [4] Choice1
+ }
+
+ Choice3 ::= [3] EXPLICIT Choice2 -- tags [3] [2]
+ Choice4 ::= [4] IMPLICIT Choice2 -- tags [4]
+ Choice5 ::= Choice2 -- tags [2]
+ Choice6 ::= Choice1 -- tags
+
+END
diff --git a/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1.-EF b/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1.-EF
new file mode 100644
index 0000000..b4031a8
--- /dev/null
+++ b/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1.-EF
@@ -0,0 +1,33 @@
+ModuleTestIndirectChoiceFine { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 37 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+T ::= CHOICE {
+ t-a INTEGER,
+ t-b OCTET STRING,
+ t-c [1] EXPLICIT Choice1,
+ t-d [3] IMPLICIT Choice2
+}
+
+Choice1 ::= CHOICE {
+ c-a OCTET STRING,
+ c-b INTEGER
+}
+
+Choice2 ::= [2] EXPLICIT CHOICE {
+ c-a OCTET STRING,
+ c-b INTEGER,
+ c-d [3] EXPLICIT Choice1,
+ c-e [4] EXPLICIT Choice1
+}
+
+Choice3 ::= [3] EXPLICIT Choice2
+
+Choice4 ::= [4] IMPLICIT Choice2
+
+Choice5 ::= Choice2
+
+Choice6 ::= Choice1
+
+END
diff --git a/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..22d35d6
--- /dev/null
+++ b/tests/tests-asn1c-compiler/37-indirect-choice-OK.asn1.-Pfwide-types
@@ -0,0 +1,592 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <INTEGER.h>
+#include <OCTET_STRING.h>
+#include "Choice1.h"
+#include "Choice2.h"
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum T_PR {
+ T_PR_NOTHING, /* No components present */
+ T_PR_t_a,
+ T_PR_t_b,
+ T_PR_t_c,
+ T_PR_t_d
+} T_PR;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ T_PR present;
+ union T_u {
+ INTEGER_t t_a;
+ OCTET_STRING_t t_b;
+ Choice1_t t_c;
+ Choice2_t t_d;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_b),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_OCTET_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-b"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-c"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.t_d),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Choice2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-d"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* t-a */
+ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* t-b */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* t-c */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* t-d */
+};
+static asn_CHOICE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ offsetof(struct T, present),
+ sizeof(((struct T *)0)->present),
+ asn_MAP_T_tag2el_1,
+ 4, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 4, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice1] >>> ***/
+
+#include <OCTET_STRING.h>
+#include <INTEGER.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice1] >>> ***/
+
+typedef enum Choice1_PR {
+ Choice1_PR_NOTHING, /* No components present */
+ Choice1_PR_c_a,
+ Choice1_PR_c_b
+} Choice1_PR;
+
+/*** <<< TYPE-DECLS [Choice1] >>> ***/
+
+typedef struct Choice1 {
+ Choice1_PR present;
+ union Choice1_u {
+ OCTET_STRING_t c_a;
+ INTEGER_t c_b;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice1_t;
+
+/*** <<< FUNC-DECLS [Choice1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice1;
+extern asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice1_1[2];
+
+/*** <<< STAT-DEFS [Choice1] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Choice1_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice1, choice.c_a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_OCTET_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c-a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice1, choice.c_b),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c-b"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* c-b */
+ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* c-a */
+};
+asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1 = {
+ sizeof(struct Choice1),
+ offsetof(struct Choice1, _asn_ctx),
+ offsetof(struct Choice1, present),
+ sizeof(((struct Choice1 *)0)->present),
+ asn_MAP_Choice1_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice1 = {
+ "Choice1",
+ "Choice1",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice1_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice2] >>> ***/
+
+#include <OCTET_STRING.h>
+#include <INTEGER.h>
+#include "Choice1.h"
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice2] >>> ***/
+
+typedef enum Choice2_PR {
+ Choice2_PR_NOTHING, /* No components present */
+ Choice2_PR_c_a,
+ Choice2_PR_c_b,
+ Choice2_PR_c_d,
+ Choice2_PR_c_e
+} Choice2_PR;
+
+/*** <<< TYPE-DECLS [Choice2] >>> ***/
+
+typedef struct Choice2 {
+ Choice2_PR present;
+ union Choice2_u {
+ OCTET_STRING_t c_a;
+ INTEGER_t c_b;
+ Choice1_t c_d;
+ Choice1_t c_e;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice2_t;
+
+/*** <<< FUNC-DECLS [Choice2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice2;
+extern asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice2_1[4];
+
+/*** <<< STAT-DEFS [Choice2] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Choice2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_OCTET_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c-a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_b),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c-b"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_d),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c-d"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.c_e),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c-e"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Choice2_tags_1[] = {
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* c-b */
+ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 }, /* c-a */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* c-d */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 } /* c-e */
+};
+asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
+ sizeof(struct Choice2),
+ offsetof(struct Choice2, _asn_ctx),
+ offsetof(struct Choice2, present),
+ sizeof(((struct Choice2 *)0)->present),
+ asn_MAP_Choice2_tag2el_1,
+ 4, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice2 = {
+ "Choice2",
+ "Choice2",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ asn_DEF_Choice2_tags_1,
+ sizeof(asn_DEF_Choice2_tags_1)
+ /sizeof(asn_DEF_Choice2_tags_1[0]), /* 1 */
+ asn_DEF_Choice2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Choice2_tags_1)
+ /sizeof(asn_DEF_Choice2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice2_1,
+ 4, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice3] >>> ***/
+
+#include "Choice2.h"
+
+/*** <<< TYPE-DECLS [Choice3] >>> ***/
+
+typedef Choice2_t Choice3_t;
+
+/*** <<< FUNC-DECLS [Choice3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice3;
+asn_struct_free_f Choice3_free;
+asn_struct_print_f Choice3_print;
+asn_constr_check_f Choice3_constraint;
+ber_type_decoder_f Choice3_decode_ber;
+der_type_encoder_f Choice3_encode_der;
+xer_type_decoder_f Choice3_decode_xer;
+xer_type_encoder_f Choice3_encode_xer;
+
+/*** <<< CODE [Choice3] >>> ***/
+
+/*
+ * This type is implemented using Choice2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Choice3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Choice3_tags_1[] = {
+ (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Choice3 = {
+ "Choice3",
+ "Choice3",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ asn_DEF_Choice3_tags_1,
+ sizeof(asn_DEF_Choice3_tags_1)
+ /sizeof(asn_DEF_Choice3_tags_1[0]), /* 2 */
+ asn_DEF_Choice3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Choice3_tags_1)
+ /sizeof(asn_DEF_Choice3_tags_1[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice2_1,
+ 4, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice4] >>> ***/
+
+#include "Choice2.h"
+
+/*** <<< TYPE-DECLS [Choice4] >>> ***/
+
+typedef Choice2_t Choice4_t;
+
+/*** <<< FUNC-DECLS [Choice4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice4;
+asn_struct_free_f Choice4_free;
+asn_struct_print_f Choice4_print;
+asn_constr_check_f Choice4_constraint;
+ber_type_decoder_f Choice4_decode_ber;
+der_type_encoder_f Choice4_encode_der;
+xer_type_decoder_f Choice4_decode_xer;
+xer_type_encoder_f Choice4_encode_xer;
+
+/*** <<< CODE [Choice4] >>> ***/
+
+/*
+ * This type is implemented using Choice2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Choice4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Choice4_tags_1[] = {
+ (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Choice4 = {
+ "Choice4",
+ "Choice4",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ asn_DEF_Choice4_tags_1,
+ sizeof(asn_DEF_Choice4_tags_1)
+ /sizeof(asn_DEF_Choice4_tags_1[0]) - 1, /* 1 */
+ asn_DEF_Choice4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Choice4_tags_1)
+ /sizeof(asn_DEF_Choice4_tags_1[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice2_1,
+ 4, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice5] >>> ***/
+
+#include "Choice2.h"
+
+/*** <<< TYPE-DECLS [Choice5] >>> ***/
+
+typedef Choice2_t Choice5_t;
+
+/*** <<< FUNC-DECLS [Choice5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice5;
+asn_struct_free_f Choice5_free;
+asn_struct_print_f Choice5_print;
+asn_constr_check_f Choice5_constraint;
+ber_type_decoder_f Choice5_decode_ber;
+der_type_encoder_f Choice5_encode_der;
+xer_type_decoder_f Choice5_decode_xer;
+xer_type_encoder_f Choice5_encode_xer;
+
+/*** <<< CODE [Choice5] >>> ***/
+
+/*
+ * This type is implemented using Choice2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Choice5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Choice5_tags_1[] = {
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Choice5 = {
+ "Choice5",
+ "Choice5",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ asn_DEF_Choice5_tags_1,
+ sizeof(asn_DEF_Choice5_tags_1)
+ /sizeof(asn_DEF_Choice5_tags_1[0]), /* 1 */
+ asn_DEF_Choice5_tags_1, /* Same as above */
+ sizeof(asn_DEF_Choice5_tags_1)
+ /sizeof(asn_DEF_Choice5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice2_1,
+ 4, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice6] >>> ***/
+
+#include "Choice1.h"
+
+/*** <<< TYPE-DECLS [Choice6] >>> ***/
+
+typedef Choice1_t Choice6_t;
+
+/*** <<< FUNC-DECLS [Choice6] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice6;
+asn_struct_free_f Choice6_free;
+asn_struct_print_f Choice6_print;
+asn_constr_check_f Choice6_constraint;
+ber_type_decoder_f Choice6_decode_ber;
+der_type_encoder_f Choice6_encode_der;
+xer_type_decoder_f Choice6_decode_xer;
+xer_type_encoder_f Choice6_encode_xer;
+
+/*** <<< CODE [Choice6] >>> ***/
+
+/*
+ * This type is implemented using Choice1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Choice6] >>> ***/
+
+asn_TYPE_descriptor_t asn_DEF_Choice6 = {
+ "Choice6",
+ "Choice6",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice1_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice1_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/38-comments-OK.asn1 b/tests/tests-asn1c-compiler/38-comments-OK.asn1
new file mode 100644
index 0000000..f2f9aab
--- /dev/null
+++ b/tests/tests-asn1c-compiler/38-comments-OK.asn1
@@ -0,0 +1,33 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .38
+
+ModuleNestedCTypeComments
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 38 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= CHOICE {
+ t-a INTEGER,
+ t-b OCTET STRING
+/* t-c [1] Choice1, t-d Choice2 */
+ }
+
+ -- this is a comment too -- This-Is-Not-A-Comment
+ ::= INTEGER
+
+/*
+ ISO/IEC 8824-1 #11.6.4
+
+ blah blah blah
+ /* nested comment */
+ -- this is an insignificant coment
+ -- this is a comment too -- and this is a comment
+
+ */
+
+END
diff --git a/tests/tests-asn1c-compiler/39-sequence-of-OK.asn1 b/tests/tests-asn1c-compiler/39-sequence-of-OK.asn1
new file mode 100644
index 0000000..b8ac3f4
--- /dev/null
+++ b/tests/tests-asn1c-compiler/39-sequence-of-OK.asn1
@@ -0,0 +1,24 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .39
+
+ModuleNestedSequenceOf
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 39 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ int INTEGER,
+ collection SEQUENCE OF T2
+ }
+
+ T2 ::= SEQUENCE {
+ flag BOOLEAN,
+ str UTF8String
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/39-sequence-of-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/39-sequence-of-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..9b39bc4
--- /dev/null
+++ b/tests/tests-asn1c-compiler/39-sequence-of-OK.asn1.-Pfwide-types
@@ -0,0 +1,245 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <INTEGER.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [T] >>> ***/
+
+struct T2;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ INTEGER_t Int;
+ struct collection {
+ A_SEQUENCE_OF(struct T2) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } collection;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< POST-INCLUDE [T] >>> ***/
+
+#include "T2.h"
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_collection_3[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_T2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_collection_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_collection_specs_3 = {
+ sizeof(struct collection),
+ offsetof(struct collection, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_collection_3 = {
+ "collection",
+ "collection",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_collection_tags_3,
+ sizeof(asn_DEF_collection_tags_3)
+ /sizeof(asn_DEF_collection_tags_3[0]), /* 1 */
+ asn_DEF_collection_tags_3, /* Same as above */
+ sizeof(asn_DEF_collection_tags_3)
+ /sizeof(asn_DEF_collection_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_collection_3,
+ 1, /* Single element */
+ &asn_SPC_collection_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, Int),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, collection),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_collection_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "collection"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* collection */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ asn_MAP_T_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 2, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [T2] >>> ***/
+
+#include <BOOLEAN.h>
+#include <UTF8String.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T2] >>> ***/
+
+typedef struct T2 {
+ BOOLEAN_t flag;
+ UTF8String_t str;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T2_t;
+
+/*** <<< FUNC-DECLS [T2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T2;
+extern asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1;
+extern asn_TYPE_member_t asn_MBR_T2_1[2];
+
+/*** <<< STAT-DEFS [T2] >>> ***/
+
+asn_TYPE_member_t asn_MBR_T2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T2, flag),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "flag"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T2, str),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "str"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* flag */
+ { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 } /* str */
+};
+asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1 = {
+ sizeof(struct T2),
+ offsetof(struct T2, _asn_ctx),
+ asn_MAP_T2_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T2 = {
+ "T2",
+ "T2",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T2_tags_1,
+ sizeof(asn_DEF_T2_tags_1)
+ /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
+ asn_DEF_T2_tags_1, /* Same as above */
+ sizeof(asn_DEF_T2_tags_1)
+ /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T2_1,
+ 2, /* Elements count */
+ &asn_SPC_T2_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/40-int-optional-SE.asn1 b/tests/tests-asn1c-compiler/40-int-optional-SE.asn1
new file mode 100644
index 0000000..fbcb0a5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/40-int-optional-SE.asn1
@@ -0,0 +1,27 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .40
+
+ModuleTestIntOptional
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 40 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= CHOICE {
+ seq SEQUENCE {
+ string UTF8String,
+ alpha INTEGER OPTIONAL,
+ beta INTEGER OPTIONAL
+ },
+ set SET {
+ string UTF8String,
+ alpha INTEGER OPTIONAL,
+ beta INTEGER OPTIONAL
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/41-int-optional-OK.asn1 b/tests/tests-asn1c-compiler/41-int-optional-OK.asn1
new file mode 100644
index 0000000..3e091d7
--- /dev/null
+++ b/tests/tests-asn1c-compiler/41-int-optional-OK.asn1
@@ -0,0 +1,27 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .41
+
+ModuleTestIntOptional
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 41 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ T ::= CHOICE {
+ seq SEQUENCE {
+ string UTF8String,
+ alpha INTEGER OPTIONAL,
+ beta INTEGER OPTIONAL
+ },
+ set SET {
+ string UTF8String,
+ alpha INTEGER OPTIONAL,
+ beta INTEGER OPTIONAL
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/42-real-life-OK.asn1 b/tests/tests-asn1c-compiler/42-real-life-OK.asn1
new file mode 100644
index 0000000..8c1d59e
--- /dev/null
+++ b/tests/tests-asn1c-compiler/42-real-life-OK.asn1
@@ -0,0 +1,67 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .42
+
+ModuleLAPStorage
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 42 }
+ DEFINITIONS EXTENSIBILITY IMPLIED ::=
+BEGIN
+
+ /*
+ * A package representing a distinguished log line.
+ * It contains
+ * - a digest of that line (actually, a normalized
+ * form with bells (\007) in place of variable components),
+ * - one or more sets of variable parts (presumably with different
+ * acceptability rules).
+ */
+ LogLine ::= SEQUENCE {
+ line-digest IA5String, -- Log line normal form
+ varsets SEQUENCE SIZE(1..MAX) OF VariablePartSet
+ }
+
+ /*
+ * This package contains a set of variable components of a log line.
+ * Each variable component may contain one or more "value samples",
+ * or a range between two samples.
+ */
+ VariablePartSet ::= SEQUENCE {
+ vparts SEQUENCE SIZE(0..MAX) OF VariablePart, -- {123,321}
+ resolution ActionItem
+ }
+
+ /*
+ * A description of a single variable part.
+ */
+ VariablePart ::= CHOICE {
+ -- A set of acceptable values
+ vset SET SIZE(1..MAX) OF VisibleString,
+ -- A range of acceptable values
+ vrange SEQUENCE {
+ from VisibleString,
+ to VisibleString
+ }
+ }
+
+ /*
+ * What to do with the log line.
+ */
+ ActionItem ::= SEQUENCE {
+ accept-as ENUMERATED {
+ unknown, -- Action yet unknown.
+ safe, -- No action, just move on.
+ unsafe, -- Unsafe message. Inform NOC.
+ ...
+ },
+ notify SEQUENCE { -- How to notify NOC.
+ critical BOOLEAN, -- Emit critical message
+ email SET OF VisibleString, -- Send emails
+ ...
+ } OPTIONAL
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/42-real-life-OK.asn1.-EF b/tests/tests-asn1c-compiler/42-real-life-OK.asn1.-EF
new file mode 100644
index 0000000..0543ee3
--- /dev/null
+++ b/tests/tests-asn1c-compiler/42-real-life-OK.asn1.-EF
@@ -0,0 +1,43 @@
+ModuleLAPStorage { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 42 }
+DEFINITIONS EXTENSIBILITY IMPLIED ::=
+BEGIN
+
+LogLine ::= SEQUENCE {
+ line-digest IA5String,
+ varsets SEQUENCE SIZE(1..MAX) OF VariablePartSet,
+ ...
+}
+
+VariablePartSet ::= SEQUENCE {
+ vparts SEQUENCE SIZE(0..MAX) OF VariablePart,
+ resolution ActionItem,
+ ...
+}
+
+VariablePart ::= CHOICE {
+ vset SET SIZE(1..MAX) OF VisibleString,
+ vrange SEQUENCE {
+ from VisibleString,
+ to VisibleString,
+ ...
+ },
+ ...
+}
+
+ActionItem ::= SEQUENCE {
+ accept-as ENUMERATED {
+ unknown(0),
+ safe(1),
+ unsafe(2),
+ ...
+ },
+ notify SEQUENCE {
+ critical BOOLEAN,
+ email SET OF VisibleString,
+ ...
+ } OPTIONAL,
+ ...
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/42-real-life-OK.asn1.-PR b/tests/tests-asn1c-compiler/42-real-life-OK.asn1.-PR
new file mode 100644
index 0000000..c356921
--- /dev/null
+++ b/tests/tests-asn1c-compiler/42-real-life-OK.asn1.-PR
@@ -0,0 +1,936 @@
+
+/*** <<< INCLUDES [LogLine] >>> ***/
+
+#include <IA5String.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [LogLine] >>> ***/
+
+struct VariablePartSet;
+
+/*** <<< TYPE-DECLS [LogLine] >>> ***/
+
+typedef struct LogLine {
+ IA5String_t line_digest;
+ struct varsets {
+ A_SEQUENCE_OF(struct VariablePartSet) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } varsets;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} LogLine_t;
+
+/*** <<< FUNC-DECLS [LogLine] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_LogLine;
+
+/*** <<< POST-INCLUDE [LogLine] >>> ***/
+
+#include "VariablePartSet.h"
+
+/*** <<< CODE [LogLine] >>> ***/
+
+static int
+memb_varsets_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ /* Determine the number of elements */
+ size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+
+ if((size >= 1)) {
+ /* Perform validation of the inner elements */
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [LogLine] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_varsets_3[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_VariablePartSet,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_varsets_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_varsets_specs_3 = {
+ sizeof(struct varsets),
+ offsetof(struct varsets, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_varsets_3 = {
+ "varsets",
+ "varsets",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_varsets_tags_3,
+ sizeof(asn_DEF_varsets_tags_3)
+ /sizeof(asn_DEF_varsets_tags_3[0]), /* 1 */
+ asn_DEF_varsets_tags_3, /* Same as above */
+ sizeof(asn_DEF_varsets_tags_3)
+ /sizeof(asn_DEF_varsets_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_varsets_3,
+ 1, /* Single element */
+ &asn_SPC_varsets_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_LogLine_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct LogLine, line_digest),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "line-digest"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct LogLine, varsets),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_varsets_3,
+ .type_selector = 0,
+ .memb_constraints = memb_varsets_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "varsets"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_LogLine_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_LogLine_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* varsets */
+ { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 0, 0, 0 } /* line-digest */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_LogLine_specs_1 = {
+ sizeof(struct LogLine),
+ offsetof(struct LogLine, _asn_ctx),
+ asn_MAP_LogLine_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_LogLine = {
+ "LogLine",
+ "LogLine",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_LogLine_tags_1,
+ sizeof(asn_DEF_LogLine_tags_1)
+ /sizeof(asn_DEF_LogLine_tags_1[0]), /* 1 */
+ asn_DEF_LogLine_tags_1, /* Same as above */
+ sizeof(asn_DEF_LogLine_tags_1)
+ /sizeof(asn_DEF_LogLine_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_LogLine_1,
+ 2, /* Elements count */
+ &asn_SPC_LogLine_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [VariablePartSet] >>> ***/
+
+#include "ActionItem.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [VariablePartSet] >>> ***/
+
+struct VariablePart;
+
+/*** <<< TYPE-DECLS [VariablePartSet] >>> ***/
+
+typedef struct VariablePartSet {
+ struct vparts {
+ A_SEQUENCE_OF(struct VariablePart) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } vparts;
+ ActionItem_t resolution;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} VariablePartSet_t;
+
+/*** <<< FUNC-DECLS [VariablePartSet] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_VariablePartSet;
+extern asn_SEQUENCE_specifics_t asn_SPC_VariablePartSet_specs_1;
+extern asn_TYPE_member_t asn_MBR_VariablePartSet_1[2];
+
+/*** <<< POST-INCLUDE [VariablePartSet] >>> ***/
+
+#include "VariablePart.h"
+
+/*** <<< CODE [VariablePartSet] >>> ***/
+
+static int
+memb_vparts_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [VariablePartSet] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_vparts_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_VariablePart,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_vparts_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_vparts_specs_2 = {
+ sizeof(struct vparts),
+ offsetof(struct vparts, _asn_ctx),
+ 2, /* XER encoding is XMLValueList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_vparts_2 = {
+ "vparts",
+ "vparts",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_vparts_tags_2,
+ sizeof(asn_DEF_vparts_tags_2)
+ /sizeof(asn_DEF_vparts_tags_2[0]), /* 1 */
+ asn_DEF_vparts_tags_2, /* Same as above */
+ sizeof(asn_DEF_vparts_tags_2)
+ /sizeof(asn_DEF_vparts_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_vparts_2,
+ 1, /* Single element */
+ &asn_SPC_vparts_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_VariablePartSet_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct VariablePartSet, vparts),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_vparts_2,
+ .type_selector = 0,
+ .memb_constraints = memb_vparts_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "vparts"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct VariablePartSet, resolution),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_ActionItem,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "resolution"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_VariablePartSet_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_VariablePartSet_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* vparts */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* resolution */
+};
+asn_SEQUENCE_specifics_t asn_SPC_VariablePartSet_specs_1 = {
+ sizeof(struct VariablePartSet),
+ offsetof(struct VariablePartSet, _asn_ctx),
+ asn_MAP_VariablePartSet_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_VariablePartSet = {
+ "VariablePartSet",
+ "VariablePartSet",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_VariablePartSet_tags_1,
+ sizeof(asn_DEF_VariablePartSet_tags_1)
+ /sizeof(asn_DEF_VariablePartSet_tags_1[0]), /* 1 */
+ asn_DEF_VariablePartSet_tags_1, /* Same as above */
+ sizeof(asn_DEF_VariablePartSet_tags_1)
+ /sizeof(asn_DEF_VariablePartSet_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_VariablePartSet_1,
+ 2, /* Elements count */
+ &asn_SPC_VariablePartSet_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [VariablePart] >>> ***/
+
+#include <VisibleString.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <constr_SEQUENCE.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [VariablePart] >>> ***/
+
+typedef enum VariablePart_PR {
+ VariablePart_PR_NOTHING, /* No components present */
+ VariablePart_PR_vset,
+ VariablePart_PR_vrange
+ /* Extensions may appear below */
+
+} VariablePart_PR;
+
+/*** <<< TYPE-DECLS [VariablePart] >>> ***/
+
+typedef struct VariablePart {
+ VariablePart_PR present;
+ union VariablePart_u {
+ struct vset {
+ A_SET_OF(VisibleString_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } vset;
+ struct vrange {
+ VisibleString_t from;
+ VisibleString_t to;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } vrange;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} VariablePart_t;
+
+/*** <<< FUNC-DECLS [VariablePart] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_VariablePart;
+extern asn_CHOICE_specifics_t asn_SPC_VariablePart_specs_1;
+extern asn_TYPE_member_t asn_MBR_VariablePart_1[2];
+
+/*** <<< CODE [VariablePart] >>> ***/
+
+static int
+memb_vset_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ /* Determine the number of elements */
+ size = _A_CSET_FROM_VOID(sptr)->count;
+
+ if((size >= 1)) {
+ /* Perform validation of the inner elements */
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [VariablePart] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_vset_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_vset_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_vset_specs_2 = {
+ sizeof(struct vset),
+ offsetof(struct vset, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_vset_2 = {
+ "vset",
+ "vset",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_vset_tags_2,
+ sizeof(asn_DEF_vset_tags_2)
+ /sizeof(asn_DEF_vset_tags_2[0]), /* 1 */
+ asn_DEF_vset_tags_2, /* Same as above */
+ sizeof(asn_DEF_vset_tags_2)
+ /sizeof(asn_DEF_vset_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_vset_2,
+ 1, /* Single element */
+ &asn_SPC_vset_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_vrange_4[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct vrange, from),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "from"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct vrange, to),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "to"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_vrange_tags_4[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_vrange_tag2el_4[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), 0, 0, 1 }, /* from */
+ { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), 1, -1, 0 } /* to */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_vrange_specs_4 = {
+ sizeof(struct vrange),
+ offsetof(struct vrange, _asn_ctx),
+ asn_MAP_vrange_tag2el_4,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_vrange_4 = {
+ "vrange",
+ "vrange",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_vrange_tags_4,
+ sizeof(asn_DEF_vrange_tags_4)
+ /sizeof(asn_DEF_vrange_tags_4[0]), /* 1 */
+ asn_DEF_vrange_tags_4, /* Same as above */
+ sizeof(asn_DEF_vrange_tags_4)
+ /sizeof(asn_DEF_vrange_tags_4[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_vrange_4,
+ 2, /* Elements count */
+ &asn_SPC_vrange_specs_4 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_VariablePart_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct VariablePart, choice.vset),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_vset_2,
+ .type_selector = 0,
+ .memb_constraints = memb_vset_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "vset"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct VariablePart, choice.vrange),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_vrange_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "vrange"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_VariablePart_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* vrange */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* vset */
+};
+asn_CHOICE_specifics_t asn_SPC_VariablePart_specs_1 = {
+ sizeof(struct VariablePart),
+ offsetof(struct VariablePart, _asn_ctx),
+ offsetof(struct VariablePart, present),
+ sizeof(((struct VariablePart *)0)->present),
+ asn_MAP_VariablePart_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 2 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_VariablePart = {
+ "VariablePart",
+ "VariablePart",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_VariablePart_1,
+ 2, /* Elements count */
+ &asn_SPC_VariablePart_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ActionItem] >>> ***/
+
+#include <NativeEnumerated.h>
+#include <BOOLEAN.h>
+#include <VisibleString.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< DEPS [ActionItem] >>> ***/
+
+typedef enum accept_as {
+ accept_as_unknown = 0,
+ accept_as_safe = 1,
+ accept_as_unsafe = 2
+ /*
+ * Enumeration is extensible
+ */
+} e_accept_as;
+
+/*** <<< TYPE-DECLS [ActionItem] >>> ***/
+
+typedef struct ActionItem {
+ long accept_as;
+ struct notify {
+ BOOLEAN_t critical;
+ struct email {
+ A_SET_OF(VisibleString_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } email;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *notify;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ActionItem_t;
+
+/*** <<< FUNC-DECLS [ActionItem] >>> ***/
+
+/* extern asn_TYPE_descriptor_t asn_DEF_accept_as_2; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_ActionItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_ActionItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_ActionItem_1[2];
+
+/*** <<< CODE [ActionItem] >>> ***/
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [ActionItem] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_accept_as_value2enum_2[] = {
+ { 0, 7, "unknown" },
+ { 1, 4, "safe" },
+ { 2, 6, "unsafe" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_accept_as_enum2value_2[] = {
+ 1, /* safe(1) */
+ 0, /* unknown(0) */
+ 2 /* unsafe(2) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_accept_as_specs_2 = {
+ asn_MAP_accept_as_value2enum_2, /* "tag" => N; sorted by tag */
+ asn_MAP_accept_as_enum2value_2, /* N => "tag"; sorted by N */
+ 3, /* Number of elements in the maps */
+ 4, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_accept_as_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_accept_as_2 = {
+ "accept-as",
+ "accept-as",
+ NativeEnumerated_free,
+ NativeEnumerated_print,
+ NativeEnumerated_compare,
+ NativeEnumerated_constraint,
+ NativeEnumerated_decode_ber,
+ NativeEnumerated_encode_der,
+ NativeEnumerated_decode_xer,
+ NativeEnumerated_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_accept_as_tags_2,
+ sizeof(asn_DEF_accept_as_tags_2)
+ /sizeof(asn_DEF_accept_as_tags_2[0]), /* 1 */
+ asn_DEF_accept_as_tags_2, /* Same as above */
+ sizeof(asn_DEF_accept_as_tags_2)
+ /sizeof(asn_DEF_accept_as_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_accept_as_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_email_9[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_email_tags_9[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_email_specs_9 = {
+ sizeof(struct email),
+ offsetof(struct email, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_email_9 = {
+ "email",
+ "email",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_email_tags_9,
+ sizeof(asn_DEF_email_tags_9)
+ /sizeof(asn_DEF_email_tags_9[0]), /* 1 */
+ asn_DEF_email_tags_9, /* Same as above */
+ sizeof(asn_DEF_email_tags_9)
+ /sizeof(asn_DEF_email_tags_9[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_email_9,
+ 1, /* Single element */
+ &asn_SPC_email_specs_9 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_notify_7[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct notify, critical),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "critical"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct notify, email),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_email_9,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "email"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_notify_tags_7[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_notify_tag2el_7[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* critical */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* email */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_notify_specs_7 = {
+ sizeof(struct notify),
+ offsetof(struct notify, _asn_ctx),
+ asn_MAP_notify_tag2el_7,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_notify_7 = {
+ "notify",
+ "notify",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_notify_tags_7,
+ sizeof(asn_DEF_notify_tags_7)
+ /sizeof(asn_DEF_notify_tags_7[0]), /* 1 */
+ asn_DEF_notify_tags_7, /* Same as above */
+ sizeof(asn_DEF_notify_tags_7)
+ /sizeof(asn_DEF_notify_tags_7[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_notify_7,
+ 2, /* Elements count */
+ &asn_SPC_notify_specs_7 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ActionItem_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ActionItem, accept_as),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_accept_as_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "accept-as"
+ },
+ { ATF_POINTER, 1, offsetof(struct ActionItem, notify),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_notify_7,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "notify"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ActionItem_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ActionItem_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 }, /* accept-as */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* notify */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ActionItem_specs_1 = {
+ sizeof(struct ActionItem),
+ offsetof(struct ActionItem, _asn_ctx),
+ asn_MAP_ActionItem_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ActionItem = {
+ "ActionItem",
+ "ActionItem",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ActionItem_tags_1,
+ sizeof(asn_DEF_ActionItem_tags_1)
+ /sizeof(asn_DEF_ActionItem_tags_1[0]), /* 1 */
+ asn_DEF_ActionItem_tags_1, /* Same as above */
+ sizeof(asn_DEF_ActionItem_tags_1)
+ /sizeof(asn_DEF_ActionItem_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ActionItem_1,
+ 2, /* Elements count */
+ &asn_SPC_ActionItem_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/43-recursion-OK.asn1 b/tests/tests-asn1c-compiler/43-recursion-OK.asn1
new file mode 100644
index 0000000..782f6c3
--- /dev/null
+++ b/tests/tests-asn1c-compiler/43-recursion-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)
+-- .43
+
+ModuleRecursion
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 43 }
+ DEFINITIONS ::=
+BEGIN
+
+ Test-structure-1 ::= SEQUENCE {
+ t-member1 SET OF Test-structure-1,
+ t-member2 SEQUENCE OF Test-structure-1,
+ t-member3 Test-structure-1 OPTIONAL,
+ t-member4 INTEGER
+ }
+
+ Choice-1 ::= CHOICE {
+ and [1] Choice-1,
+ or [2] IMPLICIT SET OF Choice-1,
+ not [3] Choice-1,
+ other [4] INTEGER
+ }
+
+ Test-structure-2 ::= SET { m1 Test-structure-3 OPTIONAL }
+ Test-structure-3 ::= SET { m1 Test-structure-2 OPTIONAL }
+
+END
diff --git a/tests/tests-asn1c-compiler/43-recursion-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/43-recursion-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..2097caa
--- /dev/null
+++ b/tests/tests-asn1c-compiler/43-recursion-OK.asn1.-Pfwide-types
@@ -0,0 +1,636 @@
+
+/*** <<< INCLUDES [Test-structure-1] >>> ***/
+
+#include <INTEGER.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Test-structure-1] >>> ***/
+
+struct Test_structure_1;
+
+/*** <<< TYPE-DECLS [Test-structure-1] >>> ***/
+
+typedef struct Test_structure_1 {
+ struct t_member1 {
+ A_SET_OF(struct Test_structure_1) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } t_member1;
+ struct t_member2 {
+ A_SEQUENCE_OF(struct Test_structure_1) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } t_member2;
+ struct Test_structure_1 *t_member3 /* OPTIONAL */;
+ INTEGER_t t_member4;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Test_structure_1_t;
+
+/*** <<< FUNC-DECLS [Test-structure-1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Test_structure_1;
+extern asn_SEQUENCE_specifics_t asn_SPC_Test_structure_1_specs_1;
+extern asn_TYPE_member_t asn_MBR_Test_structure_1_1[4];
+
+/*** <<< POST-INCLUDE [Test-structure-1] >>> ***/
+
+#include "Test-structure-1.h"
+
+/*** <<< STAT-DEFS [Test-structure-1] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_t_member1_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Test_structure_1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_t_member1_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_t_member1_specs_2 = {
+ sizeof(struct t_member1),
+ offsetof(struct t_member1, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_t_member1_2 = {
+ "t-member1",
+ "t-member1",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_t_member1_tags_2,
+ sizeof(asn_DEF_t_member1_tags_2)
+ /sizeof(asn_DEF_t_member1_tags_2[0]), /* 1 */
+ asn_DEF_t_member1_tags_2, /* Same as above */
+ sizeof(asn_DEF_t_member1_tags_2)
+ /sizeof(asn_DEF_t_member1_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_t_member1_2,
+ 1, /* Single element */
+ &asn_SPC_t_member1_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_t_member2_4[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Test_structure_1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_t_member2_tags_4[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_t_member2_specs_4 = {
+ sizeof(struct t_member2),
+ offsetof(struct t_member2, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_t_member2_4 = {
+ "t-member2",
+ "t-member2",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_t_member2_tags_4,
+ sizeof(asn_DEF_t_member2_tags_4)
+ /sizeof(asn_DEF_t_member2_tags_4[0]), /* 1 */
+ asn_DEF_t_member2_tags_4, /* Same as above */
+ sizeof(asn_DEF_t_member2_tags_4)
+ /sizeof(asn_DEF_t_member2_tags_4[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_t_member2_4,
+ 1, /* Single element */
+ &asn_SPC_t_member2_specs_4 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Test_structure_1_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member1),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_t_member1_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-member1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member2),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_t_member2_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-member2"
+ },
+ { ATF_POINTER, 1, offsetof(struct Test_structure_1, t_member3),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Test_structure_1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-member3"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Test_structure_1, t_member4),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t-member4"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Test_structure_1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Test_structure_1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* t-member4 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 1 }, /* t-member2 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 }, /* t-member3 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* t-member1 */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Test_structure_1_specs_1 = {
+ sizeof(struct Test_structure_1),
+ offsetof(struct Test_structure_1, _asn_ctx),
+ asn_MAP_Test_structure_1_tag2el_1,
+ 4, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Test_structure_1 = {
+ "Test-structure-1",
+ "Test-structure-1",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Test_structure_1_tags_1,
+ sizeof(asn_DEF_Test_structure_1_tags_1)
+ /sizeof(asn_DEF_Test_structure_1_tags_1[0]), /* 1 */
+ asn_DEF_Test_structure_1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Test_structure_1_tags_1)
+ /sizeof(asn_DEF_Test_structure_1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Test_structure_1_1,
+ 4, /* Elements count */
+ &asn_SPC_Test_structure_1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice-1] >>> ***/
+
+#include <INTEGER.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice-1] >>> ***/
+
+typedef enum Choice_1_PR {
+ Choice_1_PR_NOTHING, /* No components present */
+ Choice_1_PR_and,
+ Choice_1_PR_or,
+ Choice_1_PR_not,
+ Choice_1_PR_other
+} Choice_1_PR;
+
+/*** <<< FWD-DECLS [Choice-1] >>> ***/
+
+struct Choice_1;
+
+/*** <<< TYPE-DECLS [Choice-1] >>> ***/
+
+typedef struct Choice_1 {
+ Choice_1_PR present;
+ union Choice_1_u {
+ struct Choice_1 *And;
+ struct Or {
+ A_SET_OF(struct Choice_1) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } Or;
+ struct Choice_1 *Not;
+ INTEGER_t other;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice_1_t;
+
+/*** <<< FUNC-DECLS [Choice-1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice_1;
+extern asn_CHOICE_specifics_t asn_SPC_Choice_1_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice_1_1[4];
+
+/*** <<< POST-INCLUDE [Choice-1] >>> ***/
+
+#include "Choice-1.h"
+
+/*** <<< STAT-DEFS [Choice-1] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_or_3[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_Choice_1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_or_tags_3[] = {
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_or_specs_3 = {
+ sizeof(struct Or),
+ offsetof(struct Or, _asn_ctx),
+ 2, /* XER encoding is XMLValueList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_or_3 = {
+ "or",
+ "or",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_or_tags_3,
+ sizeof(asn_DEF_or_tags_3)
+ /sizeof(asn_DEF_or_tags_3[0]) - 1, /* 1 */
+ asn_DEF_or_tags_3, /* Same as above */
+ sizeof(asn_DEF_or_tags_3)
+ /sizeof(asn_DEF_or_tags_3[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_or_3,
+ 1, /* Single element */
+ &asn_SPC_or_specs_3 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Choice_1_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Choice_1, choice.And),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice_1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "and"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.Or),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_or_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "or"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice_1, choice.Not),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice_1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "not"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.other),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "other"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice_1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* and */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* or */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* not */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 } /* other */
+};
+asn_CHOICE_specifics_t asn_SPC_Choice_1_specs_1 = {
+ sizeof(struct Choice_1),
+ offsetof(struct Choice_1, _asn_ctx),
+ offsetof(struct Choice_1, present),
+ sizeof(((struct Choice_1 *)0)->present),
+ asn_MAP_Choice_1_tag2el_1,
+ 4, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice_1 = {
+ "Choice-1",
+ "Choice-1",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice_1_1,
+ 4, /* Elements count */
+ &asn_SPC_Choice_1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Test-structure-2] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [Test-structure-2] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum Test_structure_2_PR {
+ Test_structure_2_PR_m1, /* Member m1 is present */
+} Test_structure_2_PR;
+
+/*** <<< FWD-DECLS [Test-structure-2] >>> ***/
+
+struct Test_structure_3;
+
+/*** <<< TYPE-DECLS [Test-structure-2] >>> ***/
+
+typedef struct Test_structure_2 {
+ struct Test_structure_3 *m1 /* OPTIONAL */;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pTest_structure_2, Test_structure_2_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Test_structure_2_t;
+
+/*** <<< FUNC-DECLS [Test-structure-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Test_structure_2;
+extern asn_SET_specifics_t asn_SPC_Test_structure_2_specs_1;
+extern asn_TYPE_member_t asn_MBR_Test_structure_2_1[1];
+
+/*** <<< POST-INCLUDE [Test-structure-2] >>> ***/
+
+#include "Test-structure-3.h"
+
+/*** <<< STAT-DEFS [Test-structure-2] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Test_structure_2_1[] = {
+ { ATF_POINTER, 1, offsetof(struct Test_structure_2, m1),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Test_structure_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m1"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Test_structure_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Test_structure_2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* m1 */
+};
+static const uint8_t asn_MAP_Test_structure_2_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (0 << 7)
+};
+asn_SET_specifics_t asn_SPC_Test_structure_2_specs_1 = {
+ sizeof(struct Test_structure_2),
+ offsetof(struct Test_structure_2, _asn_ctx),
+ offsetof(struct Test_structure_2, _presence_map),
+ asn_MAP_Test_structure_2_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_Test_structure_2_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_Test_structure_2_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_Test_structure_2 = {
+ "Test-structure-2",
+ "Test-structure-2",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Test_structure_2_tags_1,
+ sizeof(asn_DEF_Test_structure_2_tags_1)
+ /sizeof(asn_DEF_Test_structure_2_tags_1[0]), /* 1 */
+ asn_DEF_Test_structure_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Test_structure_2_tags_1)
+ /sizeof(asn_DEF_Test_structure_2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Test_structure_2_1,
+ 1, /* Elements count */
+ &asn_SPC_Test_structure_2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Test-structure-3] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [Test-structure-3] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum Test_structure_3_PR {
+ Test_structure_3_PR_m1, /* Member m1 is present */
+} Test_structure_3_PR;
+
+/*** <<< FWD-DECLS [Test-structure-3] >>> ***/
+
+struct Test_structure_2;
+
+/*** <<< TYPE-DECLS [Test-structure-3] >>> ***/
+
+typedef struct Test_structure_3 {
+ struct Test_structure_2 *m1 /* OPTIONAL */;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pTest_structure_3, Test_structure_3_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Test_structure_3_t;
+
+/*** <<< FUNC-DECLS [Test-structure-3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Test_structure_3;
+extern asn_SET_specifics_t asn_SPC_Test_structure_3_specs_1;
+extern asn_TYPE_member_t asn_MBR_Test_structure_3_1[1];
+
+/*** <<< POST-INCLUDE [Test-structure-3] >>> ***/
+
+#include "Test-structure-2.h"
+
+/*** <<< STAT-DEFS [Test-structure-3] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Test_structure_3_1[] = {
+ { ATF_POINTER, 1, offsetof(struct Test_structure_3, m1),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Test_structure_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m1"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Test_structure_3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Test_structure_3_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* m1 */
+};
+static const uint8_t asn_MAP_Test_structure_3_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (0 << 7)
+};
+asn_SET_specifics_t asn_SPC_Test_structure_3_specs_1 = {
+ sizeof(struct Test_structure_3),
+ offsetof(struct Test_structure_3, _asn_ctx),
+ offsetof(struct Test_structure_3, _presence_map),
+ asn_MAP_Test_structure_3_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_Test_structure_3_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_Test_structure_3_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_Test_structure_3 = {
+ "Test-structure-3",
+ "Test-structure-3",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Test_structure_3_tags_1,
+ sizeof(asn_DEF_Test_structure_3_tags_1)
+ /sizeof(asn_DEF_Test_structure_3_tags_1[0]), /* 1 */
+ asn_DEF_Test_structure_3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Test_structure_3_tags_1)
+ /sizeof(asn_DEF_Test_structure_3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Test_structure_3_1,
+ 1, /* Elements count */
+ &asn_SPC_Test_structure_3_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/44-choice-in-sequence-OK.asn1 b/tests/tests-asn1c-compiler/44-choice-in-sequence-OK.asn1
new file mode 100644
index 0000000..ef375f6
--- /dev/null
+++ b/tests/tests-asn1c-compiler/44-choice-in-sequence-OK.asn1
@@ -0,0 +1,30 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .44
+
+ModuleChoiceInSequence
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 44 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= [PRIVATE 1] SEQUENCE {
+ a [PRIVATE 2] NULL,
+ b CHOICE {
+ c [PRIVATE 5] NULL,
+ d [PRIVATE 6] NULL,
+ e CHOICE {
+ f [PRIVATE 7] NULL,
+ g [PRIVATE 8] NULL
+ },
+ h [PRIVATE 9] CHOICE { -- EXPLICIT!
+ i [PRIVATE 1] NULL,
+ j [PRIVATE 2] NULL
+ }
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/44-choice-in-sequence-OK.asn1.-P b/tests/tests-asn1c-compiler/44-choice-in-sequence-OK.asn1.-P
new file mode 100644
index 0000000..ac0d5e1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/44-choice-in-sequence-OK.asn1.-P
@@ -0,0 +1,361 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <NULL.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum b_PR {
+ b_PR_NOTHING, /* No components present */
+ b_PR_c,
+ b_PR_d,
+ b_PR_e,
+ b_PR_h
+} b_PR;
+typedef enum e_PR {
+ e_PR_NOTHING, /* No components present */
+ e_PR_f,
+ e_PR_g
+} e_PR;
+typedef enum h_PR {
+ h_PR_NOTHING, /* No components present */
+ h_PR_i,
+ h_PR_j
+} h_PR;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ NULL_t a;
+ struct b {
+ b_PR present;
+ union T__b_u {
+ NULL_t c;
+ NULL_t d;
+ struct e {
+ e_PR present;
+ union T__b__e_u {
+ NULL_t f;
+ NULL_t g;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } e;
+ struct h {
+ h_PR present;
+ union T__b__h_u {
+ NULL_t i;
+ NULL_t j;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } h;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_e_6[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct e, choice.f),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "f"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct e, choice.g),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "g"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_e_tag2el_6[] = {
+ { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f */
+ { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 } /* g */
+};
+static asn_CHOICE_specifics_t asn_SPC_e_specs_6 = {
+ sizeof(struct e),
+ offsetof(struct e, _asn_ctx),
+ offsetof(struct e, present),
+ sizeof(((struct e *)0)->present),
+ asn_MAP_e_tag2el_6,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_e_6 = {
+ "e",
+ "e",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_e_6,
+ 2, /* Elements count */
+ &asn_SPC_e_specs_6 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_h_9[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct h, choice.i),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct h, choice.j),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "j"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_h_tag2el_9[] = {
+ { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i */
+ { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 } /* j */
+};
+static asn_CHOICE_specifics_t asn_SPC_h_specs_9 = {
+ sizeof(struct h),
+ offsetof(struct h, _asn_ctx),
+ offsetof(struct h, present),
+ sizeof(((struct h *)0)->present),
+ asn_MAP_h_tag2el_9,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_h_9 = {
+ "h",
+ "h",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_h_9,
+ 2, /* Elements count */
+ &asn_SPC_h_specs_9 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_b_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct b, choice.c),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct b, choice.d),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "d"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct b, choice.e),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_e_6,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "e"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct b, choice.h),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_h_9,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "h"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = {
+ { (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 */
+};
+static asn_CHOICE_specifics_t asn_SPC_b_specs_3 = {
+ sizeof(struct b),
+ offsetof(struct b, _asn_ctx),
+ offsetof(struct b, present),
+ sizeof(((struct b *)0)->present),
+ asn_MAP_b_tag2el_3,
+ 5, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_b_3 = {
+ "b",
+ "b",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_b_3,
+ 4, /* Elements count */
+ &asn_SPC_b_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, a),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, b),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_b_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (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 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ asn_MAP_T_tag2el_1,
+ 6, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 2, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/45-undefined-type-SE.asn1 b/tests/tests-asn1c-compiler/45-undefined-type-SE.asn1
new file mode 100644
index 0000000..a068b5c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/45-undefined-type-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .45
+
+ModuleKnownExternType
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 45 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type ::= KnownExt -- KnownExt is known to be external.
+
+END
diff --git a/tests/tests-asn1c-compiler/45-undefined-type-SE.asn1.-EFfknown-extern-type=KnownExt b/tests/tests-asn1c-compiler/45-undefined-type-SE.asn1.-EFfknown-extern-type=KnownExt
new file mode 100644
index 0000000..994a890
--- /dev/null
+++ b/tests/tests-asn1c-compiler/45-undefined-type-SE.asn1.-EFfknown-extern-type=KnownExt
@@ -0,0 +1,8 @@
+ModuleKnownExternType { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 45 }
+DEFINITIONS ::=
+BEGIN
+
+Type ::= KnownExt
+
+END
diff --git a/tests/tests-asn1c-compiler/46-redefine-OK.asn1 b/tests/tests-asn1c-compiler/46-redefine-OK.asn1
new file mode 100644
index 0000000..0585404
--- /dev/null
+++ b/tests/tests-asn1c-compiler/46-redefine-OK.asn1
@@ -0,0 +1,22 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .46
+
+ModuleRedefineType
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 46 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ PrimitiveType ::= OCTET STRING
+
+ ConstructedType ::= SEQUENCE {
+ field [5] PrimitiveType
+ }
+
+ T ::= [3] ConstructedType
+
+END
diff --git a/tests/tests-asn1c-compiler/46-redefine-OK.asn1.-PR b/tests/tests-asn1c-compiler/46-redefine-OK.asn1.-PR
new file mode 100644
index 0000000..4b2a364
--- /dev/null
+++ b/tests/tests-asn1c-compiler/46-redefine-OK.asn1.-PR
@@ -0,0 +1,196 @@
+
+/*** <<< INCLUDES [PrimitiveType] >>> ***/
+
+#include <OCTET_STRING.h>
+
+/*** <<< TYPE-DECLS [PrimitiveType] >>> ***/
+
+typedef OCTET_STRING_t PrimitiveType_t;
+
+/*** <<< FUNC-DECLS [PrimitiveType] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PrimitiveType;
+asn_struct_free_f PrimitiveType_free;
+asn_struct_print_f PrimitiveType_print;
+asn_constr_check_f PrimitiveType_constraint;
+ber_type_decoder_f PrimitiveType_decode_ber;
+der_type_encoder_f PrimitiveType_encode_der;
+xer_type_decoder_f PrimitiveType_decode_xer;
+xer_type_encoder_f PrimitiveType_encode_xer;
+
+/*** <<< CODE [PrimitiveType] >>> ***/
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [PrimitiveType] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_PrimitiveType_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PrimitiveType = {
+ "PrimitiveType",
+ "PrimitiveType",
+ OCTET_STRING_free,
+ OCTET_STRING_print,
+ OCTET_STRING_compare,
+ OCTET_STRING_constraint,
+ OCTET_STRING_decode_ber,
+ OCTET_STRING_encode_der,
+ OCTET_STRING_decode_xer,
+ OCTET_STRING_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PrimitiveType_tags_1,
+ sizeof(asn_DEF_PrimitiveType_tags_1)
+ /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */
+ asn_DEF_PrimitiveType_tags_1, /* Same as above */
+ sizeof(asn_DEF_PrimitiveType_tags_1)
+ /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_OCTET_STRING_specs /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ConstructedType] >>> ***/
+
+#include "PrimitiveType.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [ConstructedType] >>> ***/
+
+typedef struct ConstructedType {
+ PrimitiveType_t field;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ConstructedType_t;
+
+/*** <<< FUNC-DECLS [ConstructedType] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ConstructedType;
+extern asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_specs_1;
+extern asn_TYPE_member_t asn_MBR_ConstructedType_1[1];
+
+/*** <<< STAT-DEFS [ConstructedType] >>> ***/
+
+asn_TYPE_member_t asn_MBR_ConstructedType_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ConstructedType, field),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_PrimitiveType,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "field"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ConstructedType_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ConstructedType_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 0, 0, 0 } /* field */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_specs_1 = {
+ sizeof(struct ConstructedType),
+ offsetof(struct ConstructedType, _asn_ctx),
+ asn_MAP_ConstructedType_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ConstructedType = {
+ "ConstructedType",
+ "ConstructedType",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ConstructedType_tags_1,
+ sizeof(asn_DEF_ConstructedType_tags_1)
+ /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */
+ asn_DEF_ConstructedType_tags_1, /* Same as above */
+ sizeof(asn_DEF_ConstructedType_tags_1)
+ /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ConstructedType_1,
+ 1, /* Elements count */
+ &asn_SPC_ConstructedType_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include "ConstructedType.h"
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef ConstructedType_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 ConstructedType,
+ * 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 | (3 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ConstructedType_1,
+ 1, /* Elements count */
+ &asn_SPC_ConstructedType_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/47-set-ext-OK.asn1 b/tests/tests-asn1c-compiler/47-set-ext-OK.asn1
new file mode 100644
index 0000000..52afef1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/47-set-ext-OK.asn1
@@ -0,0 +1,19 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .47
+
+ModuleSetChoiceExtensibility
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 47 }
+ DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::=
+BEGIN
+
+ T1 ::= SET { i INTEGER }
+ T2 ::= SET { i INTEGER, ... }
+ T3 ::= CHOICE { i INTEGER }
+ T4 ::= CHOICE { i INTEGER, ... }
+
+END
diff --git a/tests/tests-asn1c-compiler/47-set-ext-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/47-set-ext-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..e1266cf
--- /dev/null
+++ b/tests/tests-asn1c-compiler/47-set-ext-OK.asn1.-Pfwide-types
@@ -0,0 +1,376 @@
+
+/*** <<< INCLUDES [T1] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [T1] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum T1_PR {
+ T1_PR_i, /* Member i is present */
+} T1_PR;
+
+/*** <<< TYPE-DECLS [T1] >>> ***/
+
+typedef struct T1 {
+ INTEGER_t i;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pT1, T1_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T1_t;
+
+/*** <<< FUNC-DECLS [T1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T1;
+
+/*** <<< STAT-DEFS [T1] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T1_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T1, i),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
+};
+static const uint8_t asn_MAP_T1_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+static
+asn_SET_specifics_t asn_SPC_T1_specs_1 = {
+ sizeof(struct T1),
+ offsetof(struct T1, _asn_ctx),
+ offsetof(struct T1, _presence_map),
+ asn_MAP_T1_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_T1_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 1, /* Whether extensible */
+ (const unsigned int *)asn_MAP_T1_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_T1 = {
+ "T1",
+ "T1",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T1_tags_1,
+ sizeof(asn_DEF_T1_tags_1)
+ /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
+ asn_DEF_T1_tags_1, /* Same as above */
+ sizeof(asn_DEF_T1_tags_1)
+ /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T1_1,
+ 1, /* Elements count */
+ &asn_SPC_T1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [T2] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [T2] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum T2_PR {
+ T2_PR_i, /* Member i is present */
+} T2_PR;
+
+/*** <<< TYPE-DECLS [T2] >>> ***/
+
+typedef struct T2 {
+ INTEGER_t i;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pT2, T2_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T2_t;
+
+/*** <<< FUNC-DECLS [T2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T2;
+
+/*** <<< STAT-DEFS [T2] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T2, i),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
+};
+static const uint8_t asn_MAP_T2_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+static
+asn_SET_specifics_t asn_SPC_T2_specs_1 = {
+ sizeof(struct T2),
+ offsetof(struct T2, _asn_ctx),
+ offsetof(struct T2, _presence_map),
+ asn_MAP_T2_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_T2_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 1, /* Whether extensible */
+ (const unsigned int *)asn_MAP_T2_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_T2 = {
+ "T2",
+ "T2",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T2_tags_1,
+ sizeof(asn_DEF_T2_tags_1)
+ /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
+ asn_DEF_T2_tags_1, /* Same as above */
+ sizeof(asn_DEF_T2_tags_1)
+ /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T2_1,
+ 1, /* Elements count */
+ &asn_SPC_T2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [T3] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [T3] >>> ***/
+
+typedef enum T3_PR {
+ T3_PR_NOTHING, /* No components present */
+ T3_PR_i
+ /* Extensions may appear below */
+
+} T3_PR;
+
+/*** <<< TYPE-DECLS [T3] >>> ***/
+
+typedef struct T3 {
+ T3_PR present;
+ union T3_u {
+ INTEGER_t i;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T3_t;
+
+/*** <<< FUNC-DECLS [T3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T3;
+
+/*** <<< STAT-DEFS [T3] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T3_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T3, choice.i),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_T3_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
+};
+static asn_CHOICE_specifics_t asn_SPC_T3_specs_1 = {
+ sizeof(struct T3),
+ offsetof(struct T3, _asn_ctx),
+ offsetof(struct T3, present),
+ sizeof(((struct T3 *)0)->present),
+ asn_MAP_T3_tag2el_1,
+ 1, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_T3 = {
+ "T3",
+ "T3",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T3_1,
+ 1, /* Elements count */
+ &asn_SPC_T3_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [T4] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [T4] >>> ***/
+
+typedef enum T4_PR {
+ T4_PR_NOTHING, /* No components present */
+ T4_PR_i
+ /* Extensions may appear below */
+
+} T4_PR;
+
+/*** <<< TYPE-DECLS [T4] >>> ***/
+
+typedef struct T4 {
+ T4_PR present;
+ union T4_u {
+ INTEGER_t i;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T4_t;
+
+/*** <<< FUNC-DECLS [T4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T4;
+
+/*** <<< STAT-DEFS [T4] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T4_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T4, choice.i),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_T4_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
+};
+static asn_CHOICE_specifics_t asn_SPC_T4_specs_1 = {
+ sizeof(struct T4),
+ offsetof(struct T4, _asn_ctx),
+ offsetof(struct T4, present),
+ sizeof(((struct T4 *)0)->present),
+ asn_MAP_T4_tag2el_1,
+ 1, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_T4 = {
+ "T4",
+ "T4",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T4_1,
+ 1, /* Elements count */
+ &asn_SPC_T4_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/48-real-life-OK.asn1 b/tests/tests-asn1c-compiler/48-real-life-OK.asn1
new file mode 100644
index 0000000..7173676
--- /dev/null
+++ b/tests/tests-asn1c-compiler/48-real-life-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .48
+
+ModuleSetChoiceExtensibility
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 48 }
+ DEFINITIONS ::=
+BEGIN
+
+ /*
+ * 0.8.14 had problem saving/reloading this object
+ */
+ UserIdentifier ::= CHOICE {
+ phoneNumber [3] EXPLICIT IA5String
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/49-real-life-OK.asn1 b/tests/tests-asn1c-compiler/49-real-life-OK.asn1
new file mode 100644
index 0000000..aeba3b0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/49-real-life-OK.asn1
@@ -0,0 +1,24 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .49
+
+ModuleSetChoiceExtensibility
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 49 }
+ DEFINITIONS ::=
+BEGIN
+ /*
+ * 0.8.17 had problem parsing this module
+ */
+
+ EXPORTS TypeA ;
+
+ IMPORTS TypeB FROM ModuleB
+ TypeC FROM ModuleC ;
+
+ Z ::= INTEGER -- Can't specify only EXPORTS & IMPOTS
+
+END
diff --git a/tests/tests-asn1c-compiler/49-real-life-OK.asn1.-E b/tests/tests-asn1c-compiler/49-real-life-OK.asn1.-E
new file mode 100644
index 0000000..018bc6b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/49-real-life-OK.asn1.-E
@@ -0,0 +1,8 @@
+ModuleSetChoiceExtensibility { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 49 }
+DEFINITIONS ::=
+BEGIN
+
+Z ::= INTEGER
+
+END
diff --git a/tests/tests-asn1c-compiler/50-constraint-OK.asn1 b/tests/tests-asn1c-compiler/50-constraint-OK.asn1
new file mode 100644
index 0000000..62c4fdf
--- /dev/null
+++ b/tests/tests-asn1c-compiler/50-constraint-OK.asn1
@@ -0,0 +1,93 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .50 1
+-- .50 2
+
+ModuleNestedConstraintsCheck
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 50 1 }
+ DEFINITIONS ::=
+BEGIN
+ IMPORTS Identifier FROM IdentifierModule;
+
+ Int1 ::= INTEGER
+ Int2 ::= Int1 (0..MAX) -- X.680-0207::41.4.4
+ Int3 ::= Int2 (MIN..ten) -- Means (0..10)
+ Int4 ::= Int3 (5..MAX,...,1..4) -- Means (1..10,...)
+ Int5 ::= Int4 (MIN..5) -- Means (5)
+ -- Int6 ::= INTEGER (Int5) -- -- Not yet supported
+
+ ten Int1 ::= other-ten
+ other-ten Int2 ::= 10
+
+ -- G.4.3.4
+ ExtensibleExtensions ::= INTEGER ((1..256,...) INTERSECTION (1..256))
+
+ Str1 ::= IA5String
+ Str2 ::= Str1 (SIZE(MIN..20 | 25..30))
+ -- Means (SIZE(0..20 | 25..30))
+ Str3 ::= Str2 (SIZE(10..27))(FROM("ABC"|"def"))
+ -- (SIZE(10..20,25..27))(FROM("ABCdef"))
+ Str4 ::= IA5String ("ABCD"|SIZE(4))
+ -- Not PER-visible
+
+ PER-Visible ::= IA5String (FROM("A".."F"))
+ PER-Visible-2 ::= PER-Visible (FROM("E".."F")) -- Means (FROM("EF"))
+ -- The following maintain parent permitted alphabet constraint
+ Not-PER-Visible-1 ::= PER-Visible (FROM("AB") | SIZE(1..2))
+ Not-PER-Visible-2 ::= PER-Visible (FROM("AB",...))
+ Not-PER-Visible-3 ::= PER-Visible (FROM("AB"),...)
+
+ SIZE-but-not-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD",...))
+ SIZE-and-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD"))
+ Neither-SIZE-nor-FROM ::= PER-Visible (SIZE(1..4) | FROM("ABCD",...))
+
+ Utf8-4 ::= UTF8String (FROM("A".."Z")) -- Alphabet
+ Utf8-3 ::= Utf8-2 (FROM("A".."Z"|"a".."z")) -- Alphabet and size
+ Utf8-2 ::= Utf8-1 (SIZE(1..2)) -- Size
+ Utf8-1 ::= UTF8String
+
+ VisibleIdentifier ::= Identifier
+
+ Sequence ::= SEQUENCE {
+ int1-c Int1 (-2..MAX) DEFAULT 3,
+ int4 [2] Int4,
+ int4-c Int4 (MIN..7),
+ bool BOOLEAN DEFAULT 1,
+ enum-c ENUMERATED { one(1), two(2), ..., three(3) },
+ ...,
+ int5-c Int5 (5) OPTIONAL,
+ ...,
+ null NULL OPTIONAL
+ }
+
+ SequenceOf ::= SEQUENCE (SIZE(1..2)) OF Sequence
+
+ Enum0 ::= ENUMERATED { one, two }
+ Enum1 ::= ENUMERATED { one, two } (one)
+
+END
+
+
+IdentifierModule
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 50 2 }
+ DEFINITIONS ::=
+BEGIN
+ EXPORTS Identifier;
+
+ maxIdentifier INTEGER ::= 32
+
+ Identifier ::=
+ VisibleString ( FROM
+ ("A"|"a"|"B"|"b"|"C"|"c"|"D"|"d"|"E"|"e"|"F"|"f"|
+ "G"|"g"|"H"|"h"|"I"|"i"|"J"|"j"|"K"|"k"|"L"|"l"|
+ "M"|"m"|"N"|"n"|"O"|"o"|"P"|"p"|"Q"|"q"|"R"|"r"|
+ "S"|"s"|"T"|"t"|"U"|"u"|"V"|"v"|"W"|"w"|"X"|"x"|
+ "Y"|"y"|"Z"|"z"|"$"|"_"|"0"|"1"|"2"|"3"|"4"|"5"|
+ "6"|"7"|"8"|"9") ) (SIZE(1..maxIdentifier))
+
+END
diff --git a/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-EFprint-constraints b/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-EFprint-constraints
new file mode 100644
index 0000000..da6224d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-EFprint-constraints
Binary files differ
diff --git a/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..45d46bf
--- /dev/null
+++ b/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pfwide-types
@@ -0,0 +1,2876 @@
+
+/*** <<< INCLUDES [Int1] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [Int1] >>> ***/
+
+typedef INTEGER_t Int1_t;
+
+/*** <<< FUNC-DECLS [Int1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Int1;
+asn_struct_free_f Int1_free;
+asn_struct_print_f Int1_print;
+asn_constr_check_f Int1_constraint;
+ber_type_decoder_f Int1_decode_ber;
+der_type_encoder_f Int1_encode_der;
+xer_type_decoder_f Int1_decode_xer;
+xer_type_encoder_f Int1_encode_xer;
+
+/*** <<< CODE [Int1] >>> ***/
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Int1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int1 = {
+ "Int1",
+ "Int1",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ INTEGER_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int1_tags_1,
+ sizeof(asn_DEF_Int1_tags_1)
+ /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
+ asn_DEF_Int1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int1_tags_1)
+ /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int2] >>> ***/
+
+#include "Int1.h"
+
+/*** <<< TYPE-DECLS [Int2] >>> ***/
+
+typedef Int1_t Int2_t;
+
+/*** <<< FUNC-DECLS [Int2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Int2;
+asn_struct_free_f Int2_free;
+asn_struct_print_f Int2_print;
+asn_constr_check_f Int2_constraint;
+ber_type_decoder_f Int2_decode_ber;
+der_type_encoder_f Int2_encode_der;
+xer_type_decoder_f Int2_decode_xer;
+xer_type_encoder_f Int2_encode_xer;
+
+/*** <<< CODE [Int2] >>> ***/
+
+int
+Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Int1_t *st = (const Int1_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ /* Check if the sign bit is present */
+ value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
+
+ if((value >= 0)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Int2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int2 = {
+ "Int2",
+ "Int2",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ Int2_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int2_tags_1,
+ sizeof(asn_DEF_Int2_tags_1)
+ /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
+ asn_DEF_Int2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int2_tags_1)
+ /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int3] >>> ***/
+
+#include "Int2.h"
+
+/*** <<< TYPE-DECLS [Int3] >>> ***/
+
+typedef Int2_t Int3_t;
+
+/*** <<< FUNC-DECLS [Int3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Int3;
+asn_struct_free_f Int3_free;
+asn_struct_print_f Int3_print;
+asn_constr_check_f Int3_constraint;
+ber_type_decoder_f Int3_decode_ber;
+der_type_encoder_f Int3_encode_der;
+xer_type_decoder_f Int3_decode_xer;
+xer_type_encoder_f Int3_encode_xer;
+
+/*** <<< CODE [Int3] >>> ***/
+
+int
+Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Int2_t *st = (const Int2_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 0 && value <= 10)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Int3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int3 = {
+ "Int3",
+ "Int3",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ Int3_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int3_tags_1,
+ sizeof(asn_DEF_Int3_tags_1)
+ /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
+ asn_DEF_Int3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int3_tags_1)
+ /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int4] >>> ***/
+
+#include "Int3.h"
+
+/*** <<< TYPE-DECLS [Int4] >>> ***/
+
+typedef Int3_t Int4_t;
+
+/*** <<< FUNC-DECLS [Int4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Int4;
+asn_struct_free_f Int4_free;
+asn_struct_print_f Int4_print;
+asn_constr_check_f Int4_constraint;
+ber_type_decoder_f Int4_decode_ber;
+der_type_encoder_f Int4_encode_der;
+xer_type_decoder_f Int4_decode_xer;
+xer_type_encoder_f Int4_encode_xer;
+
+/*** <<< CODE [Int4] >>> ***/
+
+int
+Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Int3_t *st = (const Int3_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 1 && value <= 10)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int3,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Int4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int4 = {
+ "Int4",
+ "Int4",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ Int4_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int4_tags_1,
+ sizeof(asn_DEF_Int4_tags_1)
+ /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
+ asn_DEF_Int4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int4_tags_1)
+ /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int5] >>> ***/
+
+#include "Int4.h"
+
+/*** <<< TYPE-DECLS [Int5] >>> ***/
+
+typedef Int4_t Int5_t;
+
+/*** <<< FUNC-DECLS [Int5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Int5;
+asn_struct_free_f Int5_free;
+asn_struct_print_f Int5_print;
+asn_constr_check_f Int5_constraint;
+ber_type_decoder_f Int5_decode_ber;
+der_type_encoder_f Int5_encode_der;
+xer_type_decoder_f Int5_decode_xer;
+xer_type_encoder_f Int5_encode_xer;
+
+/*** <<< CODE [Int5] >>> ***/
+
+int
+Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Int4_t *st = (const Int4_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value == 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int4,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Int5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int5 = {
+ "Int5",
+ "Int5",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ Int5_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int5_tags_1,
+ sizeof(asn_DEF_Int5_tags_1)
+ /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
+ asn_DEF_Int5_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int5_tags_1)
+ /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
+
+typedef INTEGER_t ExtensibleExtensions_t;
+
+/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
+asn_struct_free_f ExtensibleExtensions_free;
+asn_struct_print_f ExtensibleExtensions_print;
+asn_constr_check_f ExtensibleExtensions_constraint;
+ber_type_decoder_f ExtensibleExtensions_decode_ber;
+der_type_encoder_f ExtensibleExtensions_encode_der;
+xer_type_decoder_f ExtensibleExtensions_decode_xer;
+xer_type_encoder_f ExtensibleExtensions_encode_xer;
+
+/*** <<< CODE [ExtensibleExtensions] >>> ***/
+
+int
+ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 1 && value <= 256)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
+ "ExtensibleExtensions",
+ "ExtensibleExtensions",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ ExtensibleExtensions_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ExtensibleExtensions_tags_1,
+ sizeof(asn_DEF_ExtensibleExtensions_tags_1)
+ /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
+ asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
+ sizeof(asn_DEF_ExtensibleExtensions_tags_1)
+ /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str1] >>> ***/
+
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [Str1] >>> ***/
+
+typedef IA5String_t Str1_t;
+
+/*** <<< FUNC-DECLS [Str1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Str1;
+asn_struct_free_f Str1_free;
+asn_struct_print_f Str1_print;
+asn_constr_check_f Str1_constraint;
+ber_type_decoder_f Str1_decode_ber;
+der_type_encoder_f Str1_encode_der;
+xer_type_decoder_f Str1_decode_xer;
+xer_type_encoder_f Str1_encode_xer;
+
+/*** <<< CODE [Str1] >>> ***/
+
+/*
+ * This type is implemented using IA5String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Str1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str1 = {
+ "Str1",
+ "Str1",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ IA5String_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str1_tags_1,
+ sizeof(asn_DEF_Str1_tags_1)
+ /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
+ asn_DEF_Str1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str1_tags_1)
+ /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str2] >>> ***/
+
+#include "Str1.h"
+
+/*** <<< TYPE-DECLS [Str2] >>> ***/
+
+typedef Str1_t Str2_t;
+
+/*** <<< FUNC-DECLS [Str2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Str2;
+asn_struct_free_f Str2_free;
+asn_struct_print_f Str2_print;
+asn_constr_check_f Str2_constraint;
+ber_type_decoder_f Str2_decode_ber;
+der_type_encoder_f Str2_encode_der;
+xer_type_decoder_f Str2_decode_xer;
+xer_type_encoder_f Str2_encode_xer;
+
+/*** <<< CTABLES [Str2] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv <= 127)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Str2] >>> ***/
+
+int
+Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Str1_t *st = (const Str1_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if(((size <= 20) || (size >= 25 && size <= 30))
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Str1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Str2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str2 = {
+ "Str2",
+ "Str2",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Str2_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str2_tags_1,
+ sizeof(asn_DEF_Str2_tags_1)
+ /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
+ asn_DEF_Str2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str2_tags_1)
+ /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str3] >>> ***/
+
+#include "Str2.h"
+
+/*** <<< TYPE-DECLS [Str3] >>> ***/
+
+typedef Str2_t Str3_t;
+
+/*** <<< FUNC-DECLS [Str3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Str3;
+asn_struct_free_f Str3_free;
+asn_struct_print_f Str3_print;
+asn_constr_check_f Str3_constraint;
+ber_type_decoder_f Str3_decode_ber;
+der_type_encoder_f Str3_encode_der;
+xer_type_decoder_f Str3_decode_xer;
+xer_type_encoder_f Str3_encode_xer;
+
+/*** <<< CTABLES [Str3] >>> ***/
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
+};
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Str3] >>> ***/
+
+int
+Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Str2_t *st = (const Str2_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Str2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Str3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str3 = {
+ "Str3",
+ "Str3",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Str3_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str3_tags_1,
+ sizeof(asn_DEF_Str3_tags_1)
+ /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
+ asn_DEF_Str3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str3_tags_1)
+ /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str4] >>> ***/
+
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [Str4] >>> ***/
+
+typedef IA5String_t Str4_t;
+
+/*** <<< FUNC-DECLS [Str4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Str4;
+asn_struct_free_f Str4_free;
+asn_struct_print_f Str4_print;
+asn_constr_check_f Str4_constraint;
+ber_type_decoder_f Str4_decode_ber;
+der_type_encoder_f Str4_encode_der;
+xer_type_decoder_f Str4_decode_xer;
+xer_type_encoder_f Str4_encode_xer;
+
+/*** <<< CTABLES [Str4] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv <= 127)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Str4] >>> ***/
+
+int
+Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using IA5String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Str4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str4 = {
+ "Str4",
+ "Str4",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Str4_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str4_tags_1,
+ sizeof(asn_DEF_Str4_tags_1)
+ /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
+ asn_DEF_Str4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str4_tags_1)
+ /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [PER-Visible] >>> ***/
+
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
+
+typedef IA5String_t PER_Visible_t;
+
+/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
+asn_struct_free_f PER_Visible_free;
+asn_struct_print_f PER_Visible_print;
+asn_constr_check_f PER_Visible_constraint;
+ber_type_decoder_f PER_Visible_decode_ber;
+der_type_encoder_f PER_Visible_encode_der;
+xer_type_decoder_f PER_Visible_decode_xer;
+xer_type_encoder_f PER_Visible_encode_xer;
+
+/*** <<< CTABLES [PER-Visible] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [PER-Visible] >>> ***/
+
+int
+PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using IA5String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [PER-Visible] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
+ "PER-Visible",
+ "PER-Visible",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ PER_Visible_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PER_Visible_tags_1,
+ sizeof(asn_DEF_PER_Visible_tags_1)
+ /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
+ asn_DEF_PER_Visible_tags_1, /* Same as above */
+ sizeof(asn_DEF_PER_Visible_tags_1)
+ /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [PER-Visible-2] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
+
+typedef PER_Visible_t PER_Visible_2_t;
+
+/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
+asn_struct_free_f PER_Visible_2_free;
+asn_struct_print_f PER_Visible_2_print;
+asn_constr_check_f PER_Visible_2_constraint;
+ber_type_decoder_f PER_Visible_2_decode_ber;
+der_type_encoder_f PER_Visible_2_encode_der;
+xer_type_decoder_f PER_Visible_2_decode_xer;
+xer_type_encoder_f PER_Visible_2_encode_xer;
+
+/*** <<< CTABLES [PER-Visible-2] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 69 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [PER-Visible-2] >>> ***/
+
+int
+PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
+ "PER-Visible-2",
+ "PER-Visible-2",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ PER_Visible_2_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PER_Visible_2_tags_1,
+ sizeof(asn_DEF_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
+ asn_DEF_PER_Visible_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
+
+typedef PER_Visible_t Not_PER_Visible_1_t;
+
+/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
+asn_struct_free_f Not_PER_Visible_1_free;
+asn_struct_print_f Not_PER_Visible_1_print;
+asn_constr_check_f Not_PER_Visible_1_constraint;
+ber_type_decoder_f Not_PER_Visible_1_decode_ber;
+der_type_encoder_f Not_PER_Visible_1_encode_der;
+xer_type_decoder_f Not_PER_Visible_1_decode_xer;
+xer_type_encoder_f Not_PER_Visible_1_encode_xer;
+
+/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Not-PER-Visible-1] >>> ***/
+
+int
+Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
+ "Not-PER-Visible-1",
+ "Not-PER-Visible-1",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Not_PER_Visible_1_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Not_PER_Visible_1_tags_1,
+ sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
+ asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
+
+typedef PER_Visible_t Not_PER_Visible_2_t;
+
+/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
+asn_struct_free_f Not_PER_Visible_2_free;
+asn_struct_print_f Not_PER_Visible_2_print;
+asn_constr_check_f Not_PER_Visible_2_constraint;
+ber_type_decoder_f Not_PER_Visible_2_decode_ber;
+der_type_encoder_f Not_PER_Visible_2_encode_der;
+xer_type_decoder_f Not_PER_Visible_2_decode_xer;
+xer_type_encoder_f Not_PER_Visible_2_encode_xer;
+
+/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 66)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Not-PER-Visible-2] >>> ***/
+
+int
+Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
+ "Not-PER-Visible-2",
+ "Not-PER-Visible-2",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Not_PER_Visible_2_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Not_PER_Visible_2_tags_1,
+ sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
+ asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
+
+typedef PER_Visible_t Not_PER_Visible_3_t;
+
+/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
+asn_struct_free_f Not_PER_Visible_3_free;
+asn_struct_print_f Not_PER_Visible_3_print;
+asn_constr_check_f Not_PER_Visible_3_constraint;
+ber_type_decoder_f Not_PER_Visible_3_decode_ber;
+der_type_encoder_f Not_PER_Visible_3_encode_der;
+xer_type_decoder_f Not_PER_Visible_3_decode_xer;
+xer_type_encoder_f Not_PER_Visible_3_encode_xer;
+
+/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 66)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Not-PER-Visible-3] >>> ***/
+
+int
+Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
+ "Not-PER-Visible-3",
+ "Not-PER-Visible-3",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Not_PER_Visible_3_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Not_PER_Visible_3_tags_1,
+ sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
+ asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
+
+typedef PER_Visible_t SIZE_but_not_FROM_t;
+
+/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
+asn_struct_free_f SIZE_but_not_FROM_free;
+asn_struct_print_f SIZE_but_not_FROM_print;
+asn_constr_check_f SIZE_but_not_FROM_constraint;
+ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
+der_type_encoder_f SIZE_but_not_FROM_encode_der;
+xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
+xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
+
+/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 68)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
+
+int
+SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 4)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
+ "SIZE-but-not-FROM",
+ "SIZE-but-not-FROM",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ SIZE_but_not_FROM_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIZE_but_not_FROM_tags_1,
+ sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
+ asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
+
+typedef PER_Visible_t SIZE_and_FROM_t;
+
+/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
+asn_struct_free_f SIZE_and_FROM_free;
+asn_struct_print_f SIZE_and_FROM_print;
+asn_constr_check_f SIZE_and_FROM_constraint;
+ber_type_decoder_f SIZE_and_FROM_decode_ber;
+der_type_encoder_f SIZE_and_FROM_encode_der;
+xer_type_decoder_f SIZE_and_FROM_decode_xer;
+xer_type_encoder_f SIZE_and_FROM_encode_xer;
+
+/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 68)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [SIZE-and-FROM] >>> ***/
+
+int
+SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 4)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
+ "SIZE-and-FROM",
+ "SIZE-and-FROM",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ SIZE_and_FROM_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIZE_and_FROM_tags_1,
+ sizeof(asn_DEF_SIZE_and_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
+ asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIZE_and_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
+
+typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
+
+/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
+asn_struct_free_f Neither_SIZE_nor_FROM_free;
+asn_struct_print_f Neither_SIZE_nor_FROM_print;
+asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
+ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
+der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
+xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
+xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
+
+/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
+
+int
+Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
+ "Neither-SIZE-nor-FROM",
+ "Neither-SIZE-nor-FROM",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Neither_SIZE_nor_FROM_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Neither_SIZE_nor_FROM_tags_1,
+ sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
+ /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
+ asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
+ sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
+ /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-4] >>> ***/
+
+#include <UTF8String.h>
+
+/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
+
+typedef UTF8String_t Utf8_4_t;
+
+/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
+asn_struct_free_f Utf8_4_free;
+asn_struct_print_f Utf8_4_print;
+asn_constr_check_f Utf8_4_constraint;
+ber_type_decoder_f Utf8_4_decode_ber;
+der_type_encoder_f Utf8_4_encode_der;
+xer_type_decoder_f Utf8_4_decode_xer;
+xer_type_encoder_f Utf8_4_encode_xer;
+
+/*** <<< CTABLES [Utf8-4] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ if(UTF8String_length((const UTF8String_t *)sptr) < 0)
+ return -1; /* Alphabet (sic!) test failed. */
+
+ return 0;
+}
+
+
+/*** <<< CODE [Utf8-4] >>> ***/
+
+int
+Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using UTF8String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Utf8-4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
+ "Utf8-4",
+ "Utf8-4",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ Utf8_4_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_4_tags_1,
+ sizeof(asn_DEF_Utf8_4_tags_1)
+ /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_4_tags_1)
+ /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-3] >>> ***/
+
+#include "Utf8-2.h"
+
+/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
+
+typedef Utf8_2_t Utf8_3_t;
+
+/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
+asn_struct_free_f Utf8_3_free;
+asn_struct_print_f Utf8_3_print;
+asn_constr_check_f Utf8_3_constraint;
+ber_type_decoder_f Utf8_3_decode_ber;
+der_type_encoder_f Utf8_3_encode_der;
+xer_type_decoder_f Utf8_3_decode_xer;
+xer_type_encoder_f Utf8_3_encode_xer;
+
+/*** <<< CTABLES [Utf8-3] >>> ***/
+
+static const int permitted_alphabet_table_1[128] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
+16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
+ 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
+42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
+};
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is UTF8String */
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(cv >= 0x80) return -1;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Utf8-3] >>> ***/
+
+int
+Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Utf8_2_t *st = (const Utf8_2_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = UTF8String_length(st);
+ if((ssize_t)size < 0) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: UTF-8: broken encoding (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((size >= 1 && size <= 2)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Utf8_2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Utf8-3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
+ "Utf8-3",
+ "Utf8-3",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ Utf8_3_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_3_tags_1,
+ sizeof(asn_DEF_Utf8_3_tags_1)
+ /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_3_tags_1)
+ /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-2] >>> ***/
+
+#include "Utf8-1.h"
+
+/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
+
+typedef Utf8_1_t Utf8_2_t;
+
+/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
+asn_struct_free_f Utf8_2_free;
+asn_struct_print_f Utf8_2_print;
+asn_constr_check_f Utf8_2_constraint;
+ber_type_decoder_f Utf8_2_decode_ber;
+der_type_encoder_f Utf8_2_encode_der;
+xer_type_decoder_f Utf8_2_decode_xer;
+xer_type_encoder_f Utf8_2_encode_xer;
+
+/*** <<< CODE [Utf8-2] >>> ***/
+
+int
+Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Utf8_1_t *st = (const Utf8_1_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = UTF8String_length(st);
+ if((ssize_t)size < 0) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: UTF-8: broken encoding (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((size >= 1 && size <= 2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Utf8_1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Utf8-2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
+ "Utf8-2",
+ "Utf8-2",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ Utf8_2_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_2_tags_1,
+ sizeof(asn_DEF_Utf8_2_tags_1)
+ /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_2_tags_1)
+ /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-1] >>> ***/
+
+#include <UTF8String.h>
+
+/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
+
+typedef UTF8String_t Utf8_1_t;
+
+/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
+asn_struct_free_f Utf8_1_free;
+asn_struct_print_f Utf8_1_print;
+asn_constr_check_f Utf8_1_constraint;
+ber_type_decoder_f Utf8_1_decode_ber;
+der_type_encoder_f Utf8_1_encode_der;
+xer_type_decoder_f Utf8_1_decode_xer;
+xer_type_encoder_f Utf8_1_encode_xer;
+
+/*** <<< CODE [Utf8-1] >>> ***/
+
+/*
+ * This type is implemented using UTF8String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Utf8-1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
+ "Utf8-1",
+ "Utf8-1",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ UTF8String_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_1_tags_1,
+ sizeof(asn_DEF_Utf8_1_tags_1)
+ /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_1_tags_1)
+ /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
+
+#include "Identifier.h"
+
+/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
+
+typedef Identifier_t VisibleIdentifier_t;
+
+/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
+asn_struct_free_f VisibleIdentifier_free;
+asn_struct_print_f VisibleIdentifier_print;
+asn_constr_check_f VisibleIdentifier_constraint;
+ber_type_decoder_f VisibleIdentifier_decode_ber;
+der_type_encoder_f VisibleIdentifier_encode_der;
+xer_type_decoder_f VisibleIdentifier_decode_xer;
+xer_type_encoder_f VisibleIdentifier_encode_xer;
+
+/*** <<< CTABLES [VisibleIdentifier] >>> ***/
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
+ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
+ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
+27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
+ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
+54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
+};
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is VisibleString */
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [VisibleIdentifier] >>> ***/
+
+int
+VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Identifier_t *st = (const Identifier_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 32)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Identifier,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
+ "VisibleIdentifier",
+ "VisibleIdentifier",
+ VisibleString_free,
+ VisibleString_print,
+ VisibleString_compare,
+ VisibleIdentifier_constraint,
+ VisibleString_decode_ber,
+ VisibleString_encode_der,
+ VisibleString_decode_xer,
+ VisibleString_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_VisibleIdentifier_tags_1,
+ sizeof(asn_DEF_VisibleIdentifier_tags_1)
+ /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
+ asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
+ sizeof(asn_DEF_VisibleIdentifier_tags_1)
+ /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Sequence] >>> ***/
+
+#include "Int1.h"
+#include "Int4.h"
+#include <BOOLEAN.h>
+#include <ENUMERATED.h>
+#include <NULL.h>
+#include "Int5.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< DEPS [Sequence] >>> ***/
+
+typedef enum enum_c {
+ enum_c_one = 1,
+ enum_c_two = 2,
+ /*
+ * Enumeration is extensible
+ */
+ enum_c_three = 3
+} e_enum_c;
+
+/*** <<< TYPE-DECLS [Sequence] >>> ***/
+
+typedef struct Sequence {
+ Int1_t *int1_c /* DEFAULT 3 */;
+ Int4_t int4;
+ Int4_t int4_c;
+ BOOLEAN_t *Bool /* DEFAULT 1 */;
+ ENUMERATED_t enum_c;
+ NULL_t *null /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ Int5_t *int5_c /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Sequence_t;
+
+/*** <<< FUNC-DECLS [Sequence] >>> ***/
+
+/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_Sequence;
+extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
+extern asn_TYPE_member_t asn_MBR_Sequence_1[7];
+
+/*** <<< CODE [Sequence] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+static int
+memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Int1_t *st = (const Int1_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= -2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Int4_t *st = (const Int4_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 5 && value <= 7)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Int5_t *st = (const Int5_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value == 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [Sequence] >>> ***/
+
+static int asn_DFL_2_set_3(int set_value, void **sptr) {
+ Int1_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 3 */
+ return asn_long2INTEGER(st, 3);
+ } else {
+ /* Test default value 3 */
+ long value;
+ if(asn_INTEGER2long(st, &value))
+ return -1;
+ return (value == 3);
+ }
+}
+static int asn_DFL_5_set_1(int set_value, void **sptr) {
+ BOOLEAN_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 1 */
+ *st = 1;
+ return 0;
+ } else {
+ /* Test default value 1 */
+ return (*st == 1);
+ }
+}
+static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
+ { 1, 3, "one" },
+ { 2, 3, "two" },
+ { 3, 5, "three" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
+ 0, /* one(1) */
+ 2, /* three(3) */
+ 1 /* two(2) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
+ asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
+ asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
+ 3, /* Number of elements in the maps */
+ 3, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
+ "enum-c",
+ "enum-c",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_enum_c_tags_6,
+ sizeof(asn_DEF_enum_c_tags_6)
+ /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
+ asn_DEF_enum_c_tags_6, /* Same as above */
+ sizeof(asn_DEF_enum_c_tags_6)
+ /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_enum_c_specs_6 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Sequence_1[] = {
+ { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Int1,
+ .type_selector = 0,
+ .memb_constraints = memb_int1_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
+ .name = "int1-c"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Int4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int4"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Int4,
+ .type_selector = 0,
+ .memb_constraints = memb_int4_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int4-c"
+ },
+ { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
+ .name = "bool"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_enum_c_6,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "enum-c"
+ },
+ { ATF_POINTER, 2, offsetof(struct Sequence, null),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "null"
+ },
+ { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Int5,
+ .type_selector = 0,
+ .memb_constraints = memb_int5_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int5-c"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
+ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
+ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
+ sizeof(struct Sequence),
+ offsetof(struct Sequence, _asn_ctx),
+ asn_MAP_Sequence_tag2el_1,
+ 7, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 5, /* Start extensions */
+ 8 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Sequence = {
+ "Sequence",
+ "Sequence",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Sequence_tags_1,
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ asn_DEF_Sequence_tags_1, /* Same as above */
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 7, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SequenceOf] >>> ***/
+
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+/*** <<< FWD-DECLS [SequenceOf] >>> ***/
+
+struct Sequence;
+
+/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
+
+typedef struct SequenceOf {
+ A_SEQUENCE_OF(struct Sequence) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SequenceOf_t;
+
+/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
+
+/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
+
+#include "Sequence.h"
+
+/*** <<< STAT-DEFS [SequenceOf] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
+ sizeof(struct SequenceOf),
+ offsetof(struct SequenceOf, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
+ "SequenceOf",
+ "SequenceOf",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SequenceOf_tags_1,
+ sizeof(asn_DEF_SequenceOf_tags_1)
+ /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
+ asn_DEF_SequenceOf_tags_1, /* Same as above */
+ sizeof(asn_DEF_SequenceOf_tags_1)
+ /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SequenceOf_1,
+ 1, /* Single element */
+ &asn_SPC_SequenceOf_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum0] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [Enum0] >>> ***/
+
+typedef enum Enum0 {
+ Enum0_one = 0,
+ Enum0_two = 1
+} e_Enum0;
+
+/*** <<< TYPE-DECLS [Enum0] >>> ***/
+
+typedef ENUMERATED_t Enum0_t;
+
+/*** <<< FUNC-DECLS [Enum0] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum0;
+asn_struct_free_f Enum0_free;
+asn_struct_print_f Enum0_print;
+asn_constr_check_f Enum0_constraint;
+ber_type_decoder_f Enum0_decode_ber;
+der_type_encoder_f Enum0_encode_der;
+xer_type_decoder_f Enum0_decode_xer;
+xer_type_encoder_f Enum0_encode_xer;
+
+/*** <<< CODE [Enum0] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Enum0] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
+ { 0, 3, "one" },
+ { 1, 3, "two" }
+};
+static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
+ 0, /* one(0) */
+ 1 /* two(1) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
+ asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum0 = {
+ "Enum0",
+ "Enum0",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum0_tags_1,
+ sizeof(asn_DEF_Enum0_tags_1)
+ /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
+ asn_DEF_Enum0_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum0_tags_1)
+ /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum1] >>> ***/
+
+#include <NativeEnumerated.h>
+
+/*** <<< DEPS [Enum1] >>> ***/
+
+typedef enum Enum1 {
+ Enum1_one = 0,
+ Enum1_two = 1
+} e_Enum1;
+
+/*** <<< TYPE-DECLS [Enum1] >>> ***/
+
+typedef long Enum1_t;
+
+/*** <<< FUNC-DECLS [Enum1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum1;
+asn_struct_free_f Enum1_free;
+asn_struct_print_f Enum1_print;
+asn_constr_check_f Enum1_constraint;
+ber_type_decoder_f Enum1_decode_ber;
+der_type_encoder_f Enum1_encode_der;
+xer_type_decoder_f Enum1_decode_xer;
+xer_type_encoder_f Enum1_encode_xer;
+
+/*** <<< CODE [Enum1] >>> ***/
+
+int
+Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 0)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Enum1] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
+ { 0, 3, "one" },
+ { 1, 3, "two" }
+};
+static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
+ 0, /* one(0) */
+ 1 /* two(1) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
+ asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum1 = {
+ "Enum1",
+ "Enum1",
+ NativeEnumerated_free,
+ NativeEnumerated_print,
+ NativeEnumerated_compare,
+ Enum1_constraint,
+ NativeEnumerated_decode_ber,
+ NativeEnumerated_encode_der,
+ NativeEnumerated_decode_xer,
+ NativeEnumerated_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum1_tags_1,
+ sizeof(asn_DEF_Enum1_tags_1)
+ /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
+ asn_DEF_Enum1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum1_tags_1)
+ /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Identifier] >>> ***/
+
+#include <VisibleString.h>
+
+/*** <<< TYPE-DECLS [Identifier] >>> ***/
+
+typedef VisibleString_t Identifier_t;
+
+/*** <<< FUNC-DECLS [Identifier] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Identifier;
+asn_struct_free_f Identifier_free;
+asn_struct_print_f Identifier_print;
+asn_constr_check_f Identifier_constraint;
+ber_type_decoder_f Identifier_decode_ber;
+der_type_encoder_f Identifier_encode_der;
+xer_type_decoder_f Identifier_decode_xer;
+xer_type_encoder_f Identifier_encode_xer;
+
+/*** <<< CTABLES [Identifier] >>> ***/
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
+ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
+ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
+27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
+ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
+54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
+};
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is VisibleString */
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Identifier] >>> ***/
+
+int
+Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 32)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using VisibleString,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Identifier] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Identifier = {
+ "Identifier",
+ "Identifier",
+ VisibleString_free,
+ VisibleString_print,
+ VisibleString_compare,
+ Identifier_constraint,
+ VisibleString_decode_ber,
+ VisibleString_encode_der,
+ VisibleString_decode_xer,
+ VisibleString_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Identifier_tags_1,
+ sizeof(asn_DEF_Identifier_tags_1)
+ /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
+ asn_DEF_Identifier_tags_1, /* Same as above */
+ sizeof(asn_DEF_Identifier_tags_1)
+ /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..2058de9
--- /dev/null
+++ b/tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pgen-PER
@@ -0,0 +1,3167 @@
+
+/*** <<< INCLUDES [Int1] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [Int1] >>> ***/
+
+typedef long Int1_t;
+
+/*** <<< FUNC-DECLS [Int1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Int1;
+asn_struct_free_f Int1_free;
+asn_struct_print_f Int1_print;
+asn_constr_check_f Int1_constraint;
+ber_type_decoder_f Int1_decode_ber;
+der_type_encoder_f Int1_encode_der;
+xer_type_decoder_f Int1_decode_xer;
+xer_type_encoder_f Int1_encode_xer;
+per_type_decoder_f Int1_decode_uper;
+per_type_encoder_f Int1_encode_uper;
+
+/*** <<< CODE [Int1] >>> ***/
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Int1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int1 = {
+ "Int1",
+ "Int1",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NativeInteger_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int1_tags_1,
+ sizeof(asn_DEF_Int1_tags_1)
+ /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
+ asn_DEF_Int1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int1_tags_1)
+ /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int2] >>> ***/
+
+#include "Int1.h"
+
+/*** <<< TYPE-DECLS [Int2] >>> ***/
+
+typedef Int1_t Int2_t;
+
+/*** <<< FUNC-DECLS [Int2] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_Int2_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Int2;
+asn_struct_free_f Int2_free;
+asn_struct_print_f Int2_print;
+asn_constr_check_f Int2_constraint;
+ber_type_decoder_f Int2_decode_ber;
+der_type_encoder_f Int2_encode_der;
+xer_type_decoder_f Int2_decode_xer;
+xer_type_encoder_f Int2_encode_xer;
+per_type_decoder_f Int2_decode_uper;
+per_type_encoder_f Int2_encode_uper;
+
+/*** <<< CODE [Int2] >>> ***/
+
+int
+Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Int2] >>> ***/
+
+asn_per_constraints_t asn_PER_type_Int2_constr_1 GCC_NOTUSED = {
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Int2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int2 = {
+ "Int2",
+ "Int2",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ Int2_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int2_tags_1,
+ sizeof(asn_DEF_Int2_tags_1)
+ /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
+ asn_DEF_Int2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int2_tags_1)
+ /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Int2_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int3] >>> ***/
+
+#include "Int2.h"
+
+/*** <<< TYPE-DECLS [Int3] >>> ***/
+
+typedef Int2_t Int3_t;
+
+/*** <<< FUNC-DECLS [Int3] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_Int3_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Int3;
+asn_struct_free_f Int3_free;
+asn_struct_print_f Int3_print;
+asn_constr_check_f Int3_constraint;
+ber_type_decoder_f Int3_decode_ber;
+der_type_encoder_f Int3_encode_der;
+xer_type_decoder_f Int3_decode_xer;
+xer_type_encoder_f Int3_encode_xer;
+per_type_decoder_f Int3_decode_uper;
+per_type_encoder_f Int3_encode_uper;
+
+/*** <<< CODE [Int3] >>> ***/
+
+int
+Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 0 && value <= 10)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Int3] >>> ***/
+
+asn_per_constraints_t asn_PER_type_Int3_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Int3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int3 = {
+ "Int3",
+ "Int3",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ Int3_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int3_tags_1,
+ sizeof(asn_DEF_Int3_tags_1)
+ /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
+ asn_DEF_Int3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int3_tags_1)
+ /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Int3_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int4] >>> ***/
+
+#include "Int3.h"
+
+/*** <<< TYPE-DECLS [Int4] >>> ***/
+
+typedef Int3_t Int4_t;
+
+/*** <<< FUNC-DECLS [Int4] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_Int4_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Int4;
+asn_struct_free_f Int4_free;
+asn_struct_print_f Int4_print;
+asn_constr_check_f Int4_constraint;
+ber_type_decoder_f Int4_decode_ber;
+der_type_encoder_f Int4_encode_der;
+xer_type_decoder_f Int4_decode_xer;
+xer_type_encoder_f Int4_encode_xer;
+per_type_decoder_f Int4_decode_uper;
+per_type_encoder_f Int4_encode_uper;
+
+/*** <<< CODE [Int4] >>> ***/
+
+int
+Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 1 && value <= 10)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int3,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Int4] >>> ***/
+
+asn_per_constraints_t asn_PER_type_Int4_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Int4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int4 = {
+ "Int4",
+ "Int4",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ Int4_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int4_tags_1,
+ sizeof(asn_DEF_Int4_tags_1)
+ /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
+ asn_DEF_Int4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int4_tags_1)
+ /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Int4_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Int5] >>> ***/
+
+#include "Int4.h"
+
+/*** <<< TYPE-DECLS [Int5] >>> ***/
+
+typedef Int4_t Int5_t;
+
+/*** <<< FUNC-DECLS [Int5] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_Int5_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Int5;
+asn_struct_free_f Int5_free;
+asn_struct_print_f Int5_print;
+asn_constr_check_f Int5_constraint;
+ber_type_decoder_f Int5_decode_ber;
+der_type_encoder_f Int5_encode_der;
+xer_type_decoder_f Int5_decode_xer;
+xer_type_encoder_f Int5_encode_xer;
+per_type_decoder_f Int5_decode_uper;
+per_type_encoder_f Int5_encode_uper;
+
+/*** <<< CODE [Int5] >>> ***/
+
+int
+Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Int4,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Int5] >>> ***/
+
+asn_per_constraints_t asn_PER_type_Int5_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Int5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Int5 = {
+ "Int5",
+ "Int5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ Int5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Int5_tags_1,
+ sizeof(asn_DEF_Int5_tags_1)
+ /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
+ asn_DEF_Int5_tags_1, /* Same as above */
+ sizeof(asn_DEF_Int5_tags_1)
+ /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Int5_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
+
+typedef long ExtensibleExtensions_t;
+
+/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
+asn_struct_free_f ExtensibleExtensions_free;
+asn_struct_print_f ExtensibleExtensions_print;
+asn_constr_check_f ExtensibleExtensions_constraint;
+ber_type_decoder_f ExtensibleExtensions_decode_ber;
+der_type_encoder_f ExtensibleExtensions_encode_der;
+xer_type_decoder_f ExtensibleExtensions_decode_xer;
+xer_type_encoder_f ExtensibleExtensions_encode_xer;
+per_type_decoder_f ExtensibleExtensions_decode_uper;
+per_type_encoder_f ExtensibleExtensions_encode_uper;
+
+/*** <<< CODE [ExtensibleExtensions] >>> ***/
+
+int
+ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 1 && value <= 256)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
+ "ExtensibleExtensions",
+ "ExtensibleExtensions",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ ExtensibleExtensions_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ExtensibleExtensions_tags_1,
+ sizeof(asn_DEF_ExtensibleExtensions_tags_1)
+ /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
+ asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
+ sizeof(asn_DEF_ExtensibleExtensions_tags_1)
+ /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_ExtensibleExtensions_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str1] >>> ***/
+
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [Str1] >>> ***/
+
+typedef IA5String_t Str1_t;
+
+/*** <<< FUNC-DECLS [Str1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Str1;
+asn_struct_free_f Str1_free;
+asn_struct_print_f Str1_print;
+asn_constr_check_f Str1_constraint;
+ber_type_decoder_f Str1_decode_ber;
+der_type_encoder_f Str1_encode_der;
+xer_type_decoder_f Str1_decode_xer;
+xer_type_encoder_f Str1_encode_xer;
+per_type_decoder_f Str1_decode_uper;
+per_type_encoder_f Str1_encode_uper;
+
+/*** <<< CODE [Str1] >>> ***/
+
+/*
+ * This type is implemented using IA5String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Str1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str1 = {
+ "Str1",
+ "Str1",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ IA5String_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str1_tags_1,
+ sizeof(asn_DEF_Str1_tags_1)
+ /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
+ asn_DEF_Str1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str1_tags_1)
+ /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str2] >>> ***/
+
+#include "Str1.h"
+
+/*** <<< TYPE-DECLS [Str2] >>> ***/
+
+typedef Str1_t Str2_t;
+
+/*** <<< FUNC-DECLS [Str2] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_Str2_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Str2;
+asn_struct_free_f Str2_free;
+asn_struct_print_f Str2_print;
+asn_constr_check_f Str2_constraint;
+ber_type_decoder_f Str2_decode_ber;
+der_type_encoder_f Str2_encode_der;
+xer_type_decoder_f Str2_decode_xer;
+xer_type_encoder_f Str2_encode_xer;
+per_type_decoder_f Str2_decode_uper;
+per_type_encoder_f Str2_encode_uper;
+
+/*** <<< CTABLES [Str2] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv <= 127)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Str2] >>> ***/
+
+int
+Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Str1_t *st = (const Str1_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if(((size <= 20) || (size >= 25 && size <= 30))
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Str1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Str2] >>> ***/
+
+asn_per_constraints_t asn_PER_type_Str2_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
+ { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [Str2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str2 = {
+ "Str2",
+ "Str2",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Str2_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str2_tags_1,
+ sizeof(asn_DEF_Str2_tags_1)
+ /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
+ asn_DEF_Str2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str2_tags_1)
+ /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Str2_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str3] >>> ***/
+
+#include "Str2.h"
+
+/*** <<< TYPE-DECLS [Str3] >>> ***/
+
+typedef Str2_t Str3_t;
+
+/*** <<< FUNC-DECLS [Str3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Str3;
+asn_struct_free_f Str3_free;
+asn_struct_print_f Str3_print;
+asn_constr_check_f Str3_constraint;
+ber_type_decoder_f Str3_decode_ber;
+der_type_encoder_f Str3_encode_der;
+xer_type_decoder_f Str3_decode_xer;
+xer_type_encoder_f Str3_encode_xer;
+per_type_decoder_f Str3_decode_uper;
+per_type_encoder_f Str3_encode_uper;
+
+/*** <<< CTABLES [Str3] >>> ***/
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
+};
+static const int permitted_alphabet_code2value_1[6] = {
+65,66,67,100,101,102,};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Str3] >>> ***/
+
+int
+Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Str2_t *st = (const Str2_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+ return -1;
+ return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+ return -1;
+ return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using Str2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Str3] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Str3_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
+ { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
+ asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
+ asn_PER_MAP_Str3_1_c2v /* PER code to value map */
+};
+
+/*** <<< STAT-DEFS [Str3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str3 = {
+ "Str3",
+ "Str3",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Str3_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str3_tags_1,
+ sizeof(asn_DEF_Str3_tags_1)
+ /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
+ asn_DEF_Str3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str3_tags_1)
+ /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Str3_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Str4] >>> ***/
+
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [Str4] >>> ***/
+
+typedef IA5String_t Str4_t;
+
+/*** <<< FUNC-DECLS [Str4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Str4;
+asn_struct_free_f Str4_free;
+asn_struct_print_f Str4_print;
+asn_constr_check_f Str4_constraint;
+ber_type_decoder_f Str4_decode_ber;
+der_type_encoder_f Str4_encode_der;
+xer_type_decoder_f Str4_decode_xer;
+xer_type_encoder_f Str4_encode_xer;
+per_type_decoder_f Str4_decode_uper;
+per_type_encoder_f Str4_encode_uper;
+
+/*** <<< CTABLES [Str4] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv <= 127)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Str4] >>> ***/
+
+int
+Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using IA5String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Str4] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Str4_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [Str4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Str4 = {
+ "Str4",
+ "Str4",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Str4_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Str4_tags_1,
+ sizeof(asn_DEF_Str4_tags_1)
+ /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
+ asn_DEF_Str4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Str4_tags_1)
+ /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Str4_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [PER-Visible] >>> ***/
+
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
+
+typedef IA5String_t PER_Visible_t;
+
+/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_PER_Visible_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
+asn_struct_free_f PER_Visible_free;
+asn_struct_print_f PER_Visible_print;
+asn_constr_check_f PER_Visible_constraint;
+ber_type_decoder_f PER_Visible_decode_ber;
+der_type_encoder_f PER_Visible_encode_der;
+xer_type_decoder_f PER_Visible_decode_xer;
+xer_type_encoder_f PER_Visible_encode_xer;
+per_type_decoder_f PER_Visible_decode_uper;
+per_type_encoder_f PER_Visible_encode_uper;
+
+/*** <<< CTABLES [PER-Visible] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [PER-Visible] >>> ***/
+
+int
+PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using IA5String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [PER-Visible] >>> ***/
+
+asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [PER-Visible] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
+ "PER-Visible",
+ "PER-Visible",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ PER_Visible_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PER_Visible_tags_1,
+ sizeof(asn_DEF_PER_Visible_tags_1)
+ /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
+ asn_DEF_PER_Visible_tags_1, /* Same as above */
+ sizeof(asn_DEF_PER_Visible_tags_1)
+ /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_PER_Visible_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [PER-Visible-2] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
+
+typedef PER_Visible_t PER_Visible_2_t;
+
+/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
+asn_struct_free_f PER_Visible_2_free;
+asn_struct_print_f PER_Visible_2_print;
+asn_constr_check_f PER_Visible_2_constraint;
+ber_type_decoder_f PER_Visible_2_decode_ber;
+der_type_encoder_f PER_Visible_2_encode_der;
+xer_type_decoder_f PER_Visible_2_decode_xer;
+xer_type_encoder_f PER_Visible_2_encode_xer;
+per_type_decoder_f PER_Visible_2_decode_uper;
+per_type_encoder_f PER_Visible_2_encode_uper;
+
+/*** <<< CTABLES [PER-Visible-2] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 69 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [PER-Visible-2] >>> ***/
+
+int
+PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [PER-Visible-2] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
+ "PER-Visible-2",
+ "PER-Visible-2",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ PER_Visible_2_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_PER_Visible_2_tags_1,
+ sizeof(asn_DEF_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
+ asn_DEF_PER_Visible_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_PER_Visible_2_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
+
+typedef PER_Visible_t Not_PER_Visible_1_t;
+
+/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
+asn_struct_free_f Not_PER_Visible_1_free;
+asn_struct_print_f Not_PER_Visible_1_print;
+asn_constr_check_f Not_PER_Visible_1_constraint;
+ber_type_decoder_f Not_PER_Visible_1_decode_ber;
+der_type_encoder_f Not_PER_Visible_1_encode_der;
+xer_type_decoder_f Not_PER_Visible_1_decode_xer;
+xer_type_encoder_f Not_PER_Visible_1_encode_xer;
+per_type_decoder_f Not_PER_Visible_1_decode_uper;
+per_type_encoder_f Not_PER_Visible_1_encode_uper;
+
+/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Not-PER-Visible-1] >>> ***/
+
+int
+Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
+ "Not-PER-Visible-1",
+ "Not-PER-Visible-1",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Not_PER_Visible_1_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Not_PER_Visible_1_tags_1,
+ sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
+ asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Not_PER_Visible_1_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
+
+typedef PER_Visible_t Not_PER_Visible_2_t;
+
+/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
+asn_struct_free_f Not_PER_Visible_2_free;
+asn_struct_print_f Not_PER_Visible_2_print;
+asn_constr_check_f Not_PER_Visible_2_constraint;
+ber_type_decoder_f Not_PER_Visible_2_decode_ber;
+der_type_encoder_f Not_PER_Visible_2_encode_der;
+xer_type_decoder_f Not_PER_Visible_2_decode_xer;
+xer_type_encoder_f Not_PER_Visible_2_encode_xer;
+per_type_decoder_f Not_PER_Visible_2_decode_uper;
+per_type_encoder_f Not_PER_Visible_2_encode_uper;
+
+/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 66)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Not-PER-Visible-2] >>> ***/
+
+int
+Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
+ "Not-PER-Visible-2",
+ "Not-PER-Visible-2",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Not_PER_Visible_2_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Not_PER_Visible_2_tags_1,
+ sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
+ asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Not_PER_Visible_2_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
+
+typedef PER_Visible_t Not_PER_Visible_3_t;
+
+/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
+asn_struct_free_f Not_PER_Visible_3_free;
+asn_struct_print_f Not_PER_Visible_3_print;
+asn_constr_check_f Not_PER_Visible_3_constraint;
+ber_type_decoder_f Not_PER_Visible_3_decode_ber;
+der_type_encoder_f Not_PER_Visible_3_encode_der;
+xer_type_decoder_f Not_PER_Visible_3_decode_xer;
+xer_type_encoder_f Not_PER_Visible_3_encode_xer;
+per_type_decoder_f Not_PER_Visible_3_decode_uper;
+per_type_encoder_f Not_PER_Visible_3_encode_uper;
+
+/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 66)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Not-PER-Visible-3] >>> ***/
+
+int
+Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
+ "Not-PER-Visible-3",
+ "Not-PER-Visible-3",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Not_PER_Visible_3_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Not_PER_Visible_3_tags_1,
+ sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
+ asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
+ /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Not_PER_Visible_3_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
+
+typedef PER_Visible_t SIZE_but_not_FROM_t;
+
+/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
+asn_struct_free_f SIZE_but_not_FROM_free;
+asn_struct_print_f SIZE_but_not_FROM_print;
+asn_constr_check_f SIZE_but_not_FROM_constraint;
+ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
+der_type_encoder_f SIZE_but_not_FROM_encode_der;
+xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
+xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
+per_type_decoder_f SIZE_but_not_FROM_decode_uper;
+per_type_encoder_f SIZE_but_not_FROM_encode_uper;
+
+/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 68)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
+
+int
+SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 4)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
+ "SIZE-but-not-FROM",
+ "SIZE-but-not-FROM",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ SIZE_but_not_FROM_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIZE_but_not_FROM_tags_1,
+ sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
+ asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_SIZE_but_not_FROM_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
+
+typedef PER_Visible_t SIZE_and_FROM_t;
+
+/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
+asn_struct_free_f SIZE_and_FROM_free;
+asn_struct_print_f SIZE_and_FROM_print;
+asn_constr_check_f SIZE_and_FROM_constraint;
+ber_type_decoder_f SIZE_and_FROM_decode_ber;
+der_type_encoder_f SIZE_and_FROM_encode_der;
+xer_type_decoder_f SIZE_and_FROM_decode_xer;
+xer_type_encoder_f SIZE_and_FROM_encode_xer;
+per_type_decoder_f SIZE_and_FROM_decode_uper;
+per_type_encoder_f SIZE_and_FROM_encode_uper;
+
+/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 68)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [SIZE-and-FROM] >>> ***/
+
+int
+SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 4)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
+ { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
+ "SIZE-and-FROM",
+ "SIZE-and-FROM",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ SIZE_and_FROM_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIZE_and_FROM_tags_1,
+ sizeof(asn_DEF_SIZE_and_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
+ asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIZE_and_FROM_tags_1)
+ /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_SIZE_and_FROM_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
+
+#include "PER-Visible.h"
+
+/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
+
+typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
+
+/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
+asn_struct_free_f Neither_SIZE_nor_FROM_free;
+asn_struct_print_f Neither_SIZE_nor_FROM_print;
+asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
+ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
+der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
+xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
+xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
+per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
+per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
+
+/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 70)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
+
+int
+Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const PER_Visible_t *st = (const PER_Visible_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using PER_Visible,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
+ 0, 0 /* No PER character map necessary */
+};
+
+/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
+ "Neither-SIZE-nor-FROM",
+ "Neither-SIZE-nor-FROM",
+ IA5String_free,
+ IA5String_print,
+ IA5String_compare,
+ Neither_SIZE_nor_FROM_constraint,
+ IA5String_decode_ber,
+ IA5String_encode_der,
+ IA5String_decode_xer,
+ IA5String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ IA5String_decode_uper,
+ IA5String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Neither_SIZE_nor_FROM_tags_1,
+ sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
+ /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
+ asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
+ sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
+ /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-4] >>> ***/
+
+#include <UTF8String.h>
+
+/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
+
+typedef UTF8String_t Utf8_4_t;
+
+/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
+asn_struct_free_f Utf8_4_free;
+asn_struct_print_f Utf8_4_print;
+asn_constr_check_f Utf8_4_constraint;
+ber_type_decoder_f Utf8_4_decode_ber;
+der_type_encoder_f Utf8_4_encode_der;
+xer_type_decoder_f Utf8_4_decode_xer;
+xer_type_encoder_f Utf8_4_encode_xer;
+per_type_decoder_f Utf8_4_decode_uper;
+per_type_encoder_f Utf8_4_encode_uper;
+
+/*** <<< CTABLES [Utf8-4] >>> ***/
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ if(UTF8String_length((const UTF8String_t *)sptr) < 0)
+ return -1; /* Alphabet (sic!) test failed. */
+
+ return 0;
+}
+
+
+/*** <<< CODE [Utf8-4] >>> ***/
+
+int
+Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using UTF8String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Utf8-4] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Utf8-4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
+ "Utf8-4",
+ "Utf8-4",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ Utf8_4_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ UTF8String_decode_uper,
+ UTF8String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_4_tags_1,
+ sizeof(asn_DEF_Utf8_4_tags_1)
+ /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_4_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_4_tags_1)
+ /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Utf8_4_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-3] >>> ***/
+
+#include "Utf8-2.h"
+
+/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
+
+typedef Utf8_2_t Utf8_3_t;
+
+/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
+asn_struct_free_f Utf8_3_free;
+asn_struct_print_f Utf8_3_print;
+asn_constr_check_f Utf8_3_constraint;
+ber_type_decoder_f Utf8_3_decode_ber;
+der_type_encoder_f Utf8_3_encode_der;
+xer_type_decoder_f Utf8_3_decode_xer;
+xer_type_encoder_f Utf8_3_encode_xer;
+per_type_decoder_f Utf8_3_decode_uper;
+per_type_encoder_f Utf8_3_encode_uper;
+
+/*** <<< CTABLES [Utf8-3] >>> ***/
+
+static const int permitted_alphabet_table_1[128] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
+16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
+ 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
+42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
+};
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is UTF8String */
+ const UTF8String_t *st = (const UTF8String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(cv >= 0x80) return -1;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Utf8-3] >>> ***/
+
+int
+Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Utf8_2_t *st = (const Utf8_2_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = UTF8String_length(st);
+ if((ssize_t)size < 0) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: UTF-8: broken encoding (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((size >= 1 && size <= 2)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Utf8_2,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Utf8-3] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Utf8-3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
+ "Utf8-3",
+ "Utf8-3",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ Utf8_3_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ UTF8String_decode_uper,
+ UTF8String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_3_tags_1,
+ sizeof(asn_DEF_Utf8_3_tags_1)
+ /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_3_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_3_tags_1)
+ /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Utf8_3_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-2] >>> ***/
+
+#include "Utf8-1.h"
+
+/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
+
+typedef Utf8_1_t Utf8_2_t;
+
+/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_Utf8_2_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
+asn_struct_free_f Utf8_2_free;
+asn_struct_print_f Utf8_2_print;
+asn_constr_check_f Utf8_2_constraint;
+ber_type_decoder_f Utf8_2_decode_ber;
+der_type_encoder_f Utf8_2_encode_der;
+xer_type_decoder_f Utf8_2_decode_xer;
+xer_type_encoder_f Utf8_2_encode_xer;
+per_type_decoder_f Utf8_2_decode_uper;
+per_type_encoder_f Utf8_2_encode_uper;
+
+/*** <<< CODE [Utf8-2] >>> ***/
+
+int
+Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Utf8_1_t *st = (const Utf8_1_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = UTF8String_length(st);
+ if((ssize_t)size < 0) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: UTF-8: broken encoding (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((size >= 1 && size <= 2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Utf8_1,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Utf8-2] >>> ***/
+
+asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Utf8-2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
+ "Utf8-2",
+ "Utf8-2",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ Utf8_2_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ UTF8String_decode_uper,
+ UTF8String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_2_tags_1,
+ sizeof(asn_DEF_Utf8_2_tags_1)
+ /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_2_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_2_tags_1)
+ /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Utf8_2_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Utf8-1] >>> ***/
+
+#include <UTF8String.h>
+
+/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
+
+typedef UTF8String_t Utf8_1_t;
+
+/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
+asn_struct_free_f Utf8_1_free;
+asn_struct_print_f Utf8_1_print;
+asn_constr_check_f Utf8_1_constraint;
+ber_type_decoder_f Utf8_1_decode_ber;
+der_type_encoder_f Utf8_1_encode_der;
+xer_type_decoder_f Utf8_1_decode_xer;
+xer_type_encoder_f Utf8_1_encode_xer;
+per_type_decoder_f Utf8_1_decode_uper;
+per_type_encoder_f Utf8_1_encode_uper;
+
+/*** <<< CODE [Utf8-1] >>> ***/
+
+/*
+ * This type is implemented using UTF8String,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [Utf8-1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
+ "Utf8-1",
+ "Utf8-1",
+ UTF8String_free,
+ UTF8String_print,
+ UTF8String_compare,
+ UTF8String_constraint,
+ UTF8String_decode_ber,
+ UTF8String_encode_der,
+ UTF8String_decode_xer,
+ UTF8String_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ UTF8String_decode_uper,
+ UTF8String_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Utf8_1_tags_1,
+ sizeof(asn_DEF_Utf8_1_tags_1)
+ /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
+ asn_DEF_Utf8_1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Utf8_1_tags_1)
+ /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
+
+#include "Identifier.h"
+
+/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
+
+typedef Identifier_t VisibleIdentifier_t;
+
+/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
+asn_struct_free_f VisibleIdentifier_free;
+asn_struct_print_f VisibleIdentifier_print;
+asn_constr_check_f VisibleIdentifier_constraint;
+ber_type_decoder_f VisibleIdentifier_decode_ber;
+der_type_encoder_f VisibleIdentifier_encode_der;
+xer_type_decoder_f VisibleIdentifier_decode_xer;
+xer_type_encoder_f VisibleIdentifier_encode_xer;
+per_type_decoder_f VisibleIdentifier_decode_uper;
+per_type_encoder_f VisibleIdentifier_encode_uper;
+
+/*** <<< CTABLES [VisibleIdentifier] >>> ***/
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
+ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
+ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
+27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
+ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
+54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
+};
+static const int permitted_alphabet_code2value_1[64] = {
+36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
+70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
+86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
+107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
+};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is VisibleString */
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [VisibleIdentifier] >>> ***/
+
+int
+VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const Identifier_t *st = (const Identifier_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 32)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using Identifier,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
+ "VisibleIdentifier",
+ "VisibleIdentifier",
+ VisibleString_free,
+ VisibleString_print,
+ VisibleString_compare,
+ VisibleIdentifier_constraint,
+ VisibleString_decode_ber,
+ VisibleString_encode_der,
+ VisibleString_decode_xer,
+ VisibleString_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ VisibleString_decode_uper,
+ VisibleString_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_VisibleIdentifier_tags_1,
+ sizeof(asn_DEF_VisibleIdentifier_tags_1)
+ /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
+ asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
+ sizeof(asn_DEF_VisibleIdentifier_tags_1)
+ /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [Sequence] >>> ***/
+
+#include "Int1.h"
+#include "Int4.h"
+#include <BOOLEAN.h>
+#include <NativeEnumerated.h>
+#include <NULL.h>
+#include "Int5.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< DEPS [Sequence] >>> ***/
+
+typedef enum enum_c {
+ enum_c_one = 1,
+ enum_c_two = 2,
+ /*
+ * Enumeration is extensible
+ */
+ enum_c_three = 3
+} e_enum_c;
+
+/*** <<< TYPE-DECLS [Sequence] >>> ***/
+
+typedef struct Sequence {
+ Int1_t *int1_c /* DEFAULT 3 */;
+ Int4_t int4;
+ Int4_t int4_c;
+ BOOLEAN_t *Bool /* DEFAULT 1 */;
+ long enum_c;
+ NULL_t *null /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ Int5_t *int5_c /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Sequence_t;
+
+/*** <<< FUNC-DECLS [Sequence] >>> ***/
+
+/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_Sequence;
+extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
+extern asn_TYPE_member_t asn_MBR_Sequence_1[7];
+
+/*** <<< CODE [Sequence] >>> ***/
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static int
+memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 5 && value <= 7)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< CTDEFS [Sequence] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_enum_c_constr_6 GCC_NOTUSED = {
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 GCC_NOTUSED = {
+ { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Sequence] >>> ***/
+
+static int asn_DFL_2_set_3(int set_value, void **sptr) {
+ Int1_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 3 */
+ *st = 3;
+ return 0;
+ } else {
+ /* Test default value 3 */
+ return (*st == 3);
+ }
+}
+static int asn_DFL_5_set_1(int set_value, void **sptr) {
+ BOOLEAN_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 1 */
+ *st = 1;
+ return 0;
+ } else {
+ /* Test default value 1 */
+ return (*st == 1);
+ }
+}
+static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
+ { 1, 3, "one" },
+ { 2, 3, "two" },
+ { 3, 5, "three" }
+ /* This list is extensible */
+};
+static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
+ 0, /* one(1) */
+ 2, /* three(3) */
+ 1 /* two(2) */
+ /* This list is extensible */
+};
+static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
+ asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
+ asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
+ 3, /* Number of elements in the maps */
+ 3, /* Extensions before this member */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
+ "enum-c",
+ "enum-c",
+ NativeEnumerated_free,
+ NativeEnumerated_print,
+ NativeEnumerated_compare,
+ NativeEnumerated_constraint,
+ NativeEnumerated_decode_ber,
+ NativeEnumerated_encode_der,
+ NativeEnumerated_decode_xer,
+ NativeEnumerated_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeEnumerated_decode_uper,
+ NativeEnumerated_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_enum_c_tags_6,
+ sizeof(asn_DEF_enum_c_tags_6)
+ /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
+ asn_DEF_enum_c_tags_6, /* Same as above */
+ sizeof(asn_DEF_enum_c_tags_6)
+ /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_enum_c_constr_6,
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_enum_c_specs_6 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Sequence_1[] = {
+ { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Int1,
+ .type_selector = 0,
+ .memb_constraints = memb_int1_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_int1_c_constr_2,
+ .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
+ .name = "int1-c"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Int4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "int4"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Int4,
+ .type_selector = 0,
+ .memb_constraints = memb_int4_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_int4_c_constr_4,
+ .default_value = 0,
+ .name = "int4-c"
+ },
+ { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
+ .name = "bool"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_enum_c_6,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "enum-c"
+ },
+ { ATF_POINTER, 2, offsetof(struct Sequence, null),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "null"
+ },
+ { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Int5,
+ .type_selector = 0,
+ .memb_constraints = memb_int5_c_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = &asn_PER_memb_int5_c_constr_13,
+ .default_value = 0,
+ .name = "int5-c"
+ },
+};
+static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
+static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
+ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
+ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
+ sizeof(struct Sequence),
+ offsetof(struct Sequence, _asn_ctx),
+ asn_MAP_Sequence_tag2el_1,
+ 7, /* Count of tags in the map */
+ asn_MAP_Sequence_oms_1, /* Optional members */
+ 3, 1, /* Root/Additions */
+ 5, /* Start extensions */
+ 8 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Sequence = {
+ "Sequence",
+ "Sequence",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_decode_uper,
+ SEQUENCE_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Sequence_tags_1,
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ asn_DEF_Sequence_tags_1, /* Same as above */
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 7, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SequenceOf] >>> ***/
+
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+/*** <<< FWD-DECLS [SequenceOf] >>> ***/
+
+struct Sequence;
+
+/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
+
+typedef struct SequenceOf {
+ A_SEQUENCE_OF(struct Sequence) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SequenceOf_t;
+
+/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
+
+/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
+
+#include "Sequence.h"
+
+/*** <<< CTDEFS [SequenceOf] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [SequenceOf] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
+ sizeof(struct SequenceOf),
+ offsetof(struct SequenceOf, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
+ "SequenceOf",
+ "SequenceOf",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ SEQUENCE_OF_decode_uper,
+ SEQUENCE_OF_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SequenceOf_tags_1,
+ sizeof(asn_DEF_SequenceOf_tags_1)
+ /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
+ asn_DEF_SequenceOf_tags_1, /* Same as above */
+ sizeof(asn_DEF_SequenceOf_tags_1)
+ /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_SequenceOf_constr_1,
+ asn_MBR_SequenceOf_1,
+ 1, /* Single element */
+ &asn_SPC_SequenceOf_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum0] >>> ***/
+
+#include <NativeEnumerated.h>
+
+/*** <<< DEPS [Enum0] >>> ***/
+
+typedef enum Enum0 {
+ Enum0_one = 0,
+ Enum0_two = 1
+} e_Enum0;
+
+/*** <<< TYPE-DECLS [Enum0] >>> ***/
+
+typedef long Enum0_t;
+
+/*** <<< FUNC-DECLS [Enum0] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum0;
+asn_struct_free_f Enum0_free;
+asn_struct_print_f Enum0_print;
+asn_constr_check_f Enum0_constraint;
+ber_type_decoder_f Enum0_decode_ber;
+der_type_encoder_f Enum0_encode_der;
+xer_type_decoder_f Enum0_decode_xer;
+xer_type_encoder_f Enum0_encode_xer;
+per_type_decoder_f Enum0_decode_uper;
+per_type_encoder_f Enum0_encode_uper;
+
+/*** <<< CODE [Enum0] >>> ***/
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Enum0] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Enum0_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Enum0] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
+ { 0, 3, "one" },
+ { 1, 3, "two" }
+};
+static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
+ 0, /* one(0) */
+ 1 /* two(1) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
+ asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum0 = {
+ "Enum0",
+ "Enum0",
+ NativeEnumerated_free,
+ NativeEnumerated_print,
+ NativeEnumerated_compare,
+ NativeEnumerated_constraint,
+ NativeEnumerated_decode_ber,
+ NativeEnumerated_encode_der,
+ NativeEnumerated_decode_xer,
+ NativeEnumerated_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeEnumerated_decode_uper,
+ NativeEnumerated_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum0_tags_1,
+ sizeof(asn_DEF_Enum0_tags_1)
+ /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
+ asn_DEF_Enum0_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum0_tags_1)
+ /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Enum0_constr_1,
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Enum1] >>> ***/
+
+#include <NativeEnumerated.h>
+
+/*** <<< DEPS [Enum1] >>> ***/
+
+typedef enum Enum1 {
+ Enum1_one = 0,
+ Enum1_two = 1
+} e_Enum1;
+
+/*** <<< TYPE-DECLS [Enum1] >>> ***/
+
+typedef long Enum1_t;
+
+/*** <<< FUNC-DECLS [Enum1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Enum1;
+asn_struct_free_f Enum1_free;
+asn_struct_print_f Enum1_print;
+asn_constr_check_f Enum1_constraint;
+ber_type_decoder_f Enum1_decode_ber;
+der_type_encoder_f Enum1_encode_der;
+xer_type_decoder_f Enum1_decode_xer;
+xer_type_encoder_f Enum1_encode_xer;
+per_type_decoder_f Enum1_decode_uper;
+per_type_encoder_f Enum1_encode_uper;
+
+/*** <<< CODE [Enum1] >>> ***/
+
+int
+Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 0)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Enum1] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Enum1_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Enum1] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
+ { 0, 3, "one" },
+ { 1, 3, "two" }
+};
+static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
+ 0, /* one(0) */
+ 1 /* two(1) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
+ asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Enum1 = {
+ "Enum1",
+ "Enum1",
+ NativeEnumerated_free,
+ NativeEnumerated_print,
+ NativeEnumerated_compare,
+ Enum1_constraint,
+ NativeEnumerated_decode_ber,
+ NativeEnumerated_encode_der,
+ NativeEnumerated_decode_xer,
+ NativeEnumerated_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeEnumerated_decode_uper,
+ NativeEnumerated_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Enum1_tags_1,
+ sizeof(asn_DEF_Enum1_tags_1)
+ /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
+ asn_DEF_Enum1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Enum1_tags_1)
+ /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Enum1_constr_1,
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Enum1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Identifier] >>> ***/
+
+#include <VisibleString.h>
+
+/*** <<< TYPE-DECLS [Identifier] >>> ***/
+
+typedef VisibleString_t Identifier_t;
+
+/*** <<< FUNC-DECLS [Identifier] >>> ***/
+
+extern asn_per_constraints_t asn_PER_type_Identifier_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Identifier;
+asn_struct_free_f Identifier_free;
+asn_struct_print_f Identifier_print;
+asn_constr_check_f Identifier_constraint;
+ber_type_decoder_f Identifier_decode_ber;
+der_type_encoder_f Identifier_encode_der;
+xer_type_decoder_f Identifier_decode_xer;
+xer_type_encoder_f Identifier_encode_xer;
+per_type_decoder_f Identifier_decode_uper;
+per_type_encoder_f Identifier_encode_uper;
+
+/*** <<< CTABLES [Identifier] >>> ***/
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
+ 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
+ 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
+27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
+ 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
+54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
+};
+static const int permitted_alphabet_code2value_1[64] = {
+36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
+70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
+86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
+107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
+};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+ const int *table = permitted_alphabet_table_1;
+ /* The underlying type is VisibleString */
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!table[cv]) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Identifier] >>> ***/
+
+int
+Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const VisibleString_t *st = (const VisibleString_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size >= 1 && size <= 32)
+ && !check_permitted_alphabet_1(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
+ if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+ return -1;
+ return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
+ if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+ return -1;
+ return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using VisibleString,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [Identifier] >>> ***/
+
+asn_per_constraints_t asn_PER_type_Identifier_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
+ { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
+ asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
+ asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
+};
+
+/*** <<< STAT-DEFS [Identifier] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Identifier = {
+ "Identifier",
+ "Identifier",
+ VisibleString_free,
+ VisibleString_print,
+ VisibleString_compare,
+ Identifier_constraint,
+ VisibleString_decode_ber,
+ VisibleString_encode_der,
+ VisibleString_decode_xer,
+ VisibleString_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ VisibleString_decode_uper,
+ VisibleString_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Identifier_tags_1,
+ sizeof(asn_DEF_Identifier_tags_1)
+ /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
+ asn_DEF_Identifier_tags_1, /* Same as above */
+ sizeof(asn_DEF_Identifier_tags_1)
+ /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Identifier_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/51-constraint-SE.asn1 b/tests/tests-asn1c-compiler/51-constraint-SE.asn1
new file mode 100644
index 0000000..05df97b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/51-constraint-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .51
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 51 }
+ DEFINITIONS ::=
+BEGIN
+
+ Int ::= INTEGER (FROM("abc"))
+
+END
diff --git a/tests/tests-asn1c-compiler/52-constraint-SE.asn1 b/tests/tests-asn1c-compiler/52-constraint-SE.asn1
new file mode 100644
index 0000000..0345271
--- /dev/null
+++ b/tests/tests-asn1c-compiler/52-constraint-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .52
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 52 }
+ DEFINITIONS ::=
+BEGIN
+
+ Int ::= INTEGER (SIZE(0..4))
+
+END
diff --git a/tests/tests-asn1c-compiler/53-constraint-SE.asn1 b/tests/tests-asn1c-compiler/53-constraint-SE.asn1
new file mode 100644
index 0000000..f043938
--- /dev/null
+++ b/tests/tests-asn1c-compiler/53-constraint-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .53
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 53 }
+ DEFINITIONS ::=
+BEGIN
+
+ Int ::= INTEGER (1..32) (MIN..63)
+
+END
diff --git a/tests/tests-asn1c-compiler/54-constraint-SE.asn1 b/tests/tests-asn1c-compiler/54-constraint-SE.asn1
new file mode 100644
index 0000000..e481fb0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/54-constraint-SE.asn1
@@ -0,0 +1,17 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .54
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 54 }
+ DEFINITIONS ::=
+BEGIN
+
+ StrFine ::= NumericString (FROM(" ".."9")) -- That's fine
+ StrBad ::= NumericString (FROM("0".."9" | "#")) -- That's bad
+
+END
diff --git a/tests/tests-asn1c-compiler/55-components-of-OK.asn1 b/tests/tests-asn1c-compiler/55-components-of-OK.asn1
new file mode 100644
index 0000000..54ecc1f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/55-components-of-OK.asn1
@@ -0,0 +1,34 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .55
+
+ModuleTestComponentsOf
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 55 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ OneType ::= SEQUENCE {
+ one-1 INTEGER,
+ one-2 [1] BOOLEAN,
+ one-3 SEQUENCE {
+ alpha INTEGER,
+ beta INTEGER,
+ ...
+ },
+ ...,
+ ignored-in-SecondType INTEGER,
+ ...,
+ one-4 INTEGER
+ }
+
+ SecondType ::= SEQUENCE {
+ a IA5String,
+ COMPONENTS OF OneType,
+ b UniversalString
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/55-components-of-OK.asn1.-EF b/tests/tests-asn1c-compiler/55-components-of-OK.asn1.-EF
new file mode 100644
index 0000000..fb2f76d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/55-components-of-OK.asn1.-EF
@@ -0,0 +1,31 @@
+ModuleTestComponentsOf { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 55 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+OneType ::= SEQUENCE {
+ one-1 INTEGER,
+ one-2 [1] IMPLICIT BOOLEAN,
+ one-3 SEQUENCE {
+ alpha [0] IMPLICIT INTEGER,
+ beta [1] IMPLICIT INTEGER,
+ ...
+ },
+ one-4 INTEGER,
+ ...,
+ ignored-in-SecondType INTEGER
+}
+
+SecondType ::= SEQUENCE {
+ a [0] IMPLICIT IA5String,
+ one-1 [1] IMPLICIT INTEGER,
+ one-2 [2] IMPLICIT BOOLEAN,
+ one-3 [3] IMPLICIT SEQUENCE {
+ alpha [0] IMPLICIT INTEGER,
+ beta [1] IMPLICIT INTEGER
+ },
+ one-4 [4] IMPLICIT INTEGER,
+ b [5] IMPLICIT UniversalString
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/56-components-of-SE.asn1 b/tests/tests-asn1c-compiler/56-components-of-SE.asn1
new file mode 100644
index 0000000..26e0757
--- /dev/null
+++ b/tests/tests-asn1c-compiler/56-components-of-SE.asn1
@@ -0,0 +1,20 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .56
+
+ModuleTestComponentsOfInvalidReference
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 56 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ OneType ::= SEQUENCE {
+ a IA5String,
+ COMPONENTS OF INTEGER, -- Error is here
+ b UniversalString
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/57-components-of-OK.asn1 b/tests/tests-asn1c-compiler/57-components-of-OK.asn1
new file mode 100644
index 0000000..bb2c8bf
--- /dev/null
+++ b/tests/tests-asn1c-compiler/57-components-of-OK.asn1
@@ -0,0 +1,38 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .57
+
+ModuleTestComponentsOfCrossModule1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 57 1 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ SecondType ::= SEQUENCE {
+ a IA5String,
+ COMPONENTS OF ModuleTestComponentsOfCrossModule2.OneType,
+ b UniversalString
+ }
+
+END
+
+ModuleTestComponentsOfCrossModule2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 57 2 }
+ DEFINITIONS EXPLICIT TAGS ::=
+BEGIN
+
+ OneType ::= SEQUENCE {
+ x T1,
+ y T2,
+ z T3
+ }
+
+ T1 ::= INTEGER
+ T2 ::= INTEGER
+ T3 ::= INTEGER
+
+END
diff --git a/tests/tests-asn1c-compiler/58-param-OK.asn1 b/tests/tests-asn1c-compiler/58-param-OK.asn1
new file mode 100644
index 0000000..477cabe
--- /dev/null
+++ b/tests/tests-asn1c-compiler/58-param-OK.asn1
@@ -0,0 +1,23 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .58
+
+ModuleTestParam
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 58 }
+ DEFINITIONS ::=
+BEGIN
+
+ DirectoryString { INTEGER:maxSize } ::= CHOICE {
+ teletexString TeletexString (SIZE(1..maxSize)),
+ utf8String UTF8String (SIZE(1..maxSize))
+ }
+
+ DS1 ::= DirectoryString { ub-name }
+
+ ub-name INTEGER ::= 128
+
+END
diff --git a/tests/tests-asn1c-compiler/58-param-OK.asn1.-EF b/tests/tests-asn1c-compiler/58-param-OK.asn1.-EF
new file mode 100644
index 0000000..9258e5b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/58-param-OK.asn1.-EF
@@ -0,0 +1,15 @@
+ModuleTestParam { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 58 }
+DEFINITIONS ::=
+BEGIN
+
+DirectoryString{INTEGER:maxSize} ::= CHOICE {
+ teletexString TeletexString (SIZE(1..maxSize)),
+ utf8String UTF8String (SIZE(1..maxSize))
+}
+
+DS1 ::= DirectoryString{ub-name}
+
+ub-name INTEGER ::= 128
+
+END
diff --git a/tests/tests-asn1c-compiler/59-choice-extended-OK.asn1 b/tests/tests-asn1c-compiler/59-choice-extended-OK.asn1
new file mode 100644
index 0000000..0e49221
--- /dev/null
+++ b/tests/tests-asn1c-compiler/59-choice-extended-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .59
+
+ModuleTestExtensibleChoice
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 59 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ Choice ::= [123] CHOICE {
+ a INTEGER,
+ ...,
+ b INTEGER,
+ c Choice -- A reference to itself
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/59-choice-extended-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/59-choice-extended-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..5052aef
--- /dev/null
+++ b/tests/tests-asn1c-compiler/59-choice-extended-OK.asn1.-Pfwide-types
@@ -0,0 +1,130 @@
+
+/*** <<< INCLUDES [Choice] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_CHOICE.h>
+
+/*** <<< 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;
+
+/*** <<< FWD-DECLS [Choice] >>> ***/
+
+struct Choice;
+
+/*** <<< TYPE-DECLS [Choice] >>> ***/
+
+typedef struct Choice {
+ Choice_PR present;
+ union Choice_u {
+ INTEGER_t a;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ INTEGER_t b;
+ struct Choice *c;
+ } 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;
+extern asn_CHOICE_specifics_t asn_SPC_Choice_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice_1[3];
+
+/*** <<< POST-INCLUDE [Choice] >>> ***/
+
+#include "Choice.h"
+
+/*** <<< STAT-DEFS [Choice] >>> ***/
+
+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_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .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_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice, choice.c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Choice,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Choice_tags_1[] = {
+ (ASN_TAG_CLASS_CONTEXT | (123 << 2))
+};
+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_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),
+ asn_MAP_Choice_tag2el_1,
+ 3, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice = {
+ "Choice",
+ "Choice",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ asn_DEF_Choice_tags_1,
+ sizeof(asn_DEF_Choice_tags_1)
+ /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */
+ asn_DEF_Choice_tags_1, /* Same as above */
+ sizeof(asn_DEF_Choice_tags_1)
+ /sizeof(asn_DEF_Choice_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice_1,
+ 3, /* Elements count */
+ &asn_SPC_Choice_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/60-any-OK.asn1 b/tests/tests-asn1c-compiler/60-any-OK.asn1
new file mode 100644
index 0000000..e10c421
--- /dev/null
+++ b/tests/tests-asn1c-compiler/60-any-OK.asn1
@@ -0,0 +1,29 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .60
+
+ModuleTestANY
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 60 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T1 ::= SEQUENCE {
+ i INTEGER,
+ any ANY
+ }
+
+ T2 ::= SEQUENCE {
+ i INTEGER,
+ any [0] ANY OPTIONAL
+ }
+
+ T3 ::= SEQUENCE {
+ any1 ANY,
+ any2 ANY
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/60-any-OK.asn1.-EF b/tests/tests-asn1c-compiler/60-any-OK.asn1.-EF
new file mode 100644
index 0000000..89fa31d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/60-any-OK.asn1.-EF
@@ -0,0 +1,21 @@
+ModuleTestANY { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 60 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+T1 ::= SEQUENCE {
+ i INTEGER,
+ any ANY
+}
+
+T2 ::= SEQUENCE {
+ i INTEGER,
+ any [0] EXPLICIT ANY OPTIONAL
+}
+
+T3 ::= SEQUENCE {
+ any1 ANY,
+ any2 ANY
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/60-any-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/60-any-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..9890600
--- /dev/null
+++ b/tests/tests-asn1c-compiler/60-any-OK.asn1.-Pfwide-types
@@ -0,0 +1,264 @@
+
+/*** <<< INCLUDES [T1] >>> ***/
+
+#include <INTEGER.h>
+#include <ANY.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T1] >>> ***/
+
+typedef struct T1 {
+ INTEGER_t i;
+ ANY_t any;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T1_t;
+
+/*** <<< FUNC-DECLS [T1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T1;
+
+/*** <<< STAT-DEFS [T1] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T1_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T1, i),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+ { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct T1, any),
+ .tag = -1 /* Ambiguous tag (ANY?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_ANY,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "any"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T1_specs_1 = {
+ sizeof(struct T1),
+ offsetof(struct T1, _asn_ctx),
+ asn_MAP_T1_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T1 = {
+ "T1",
+ "T1",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T1_tags_1,
+ sizeof(asn_DEF_T1_tags_1)
+ /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
+ asn_DEF_T1_tags_1, /* Same as above */
+ sizeof(asn_DEF_T1_tags_1)
+ /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T1_1,
+ 2, /* Elements count */
+ &asn_SPC_T1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [T2] >>> ***/
+
+#include <INTEGER.h>
+#include <ANY.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T2] >>> ***/
+
+typedef struct T2 {
+ INTEGER_t i;
+ ANY_t *any /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T2_t;
+
+/*** <<< FUNC-DECLS [T2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T2;
+
+/*** <<< STAT-DEFS [T2] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T2, i),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "i"
+ },
+ { ATF_POINTER, 1, offsetof(struct T2, any),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_ANY,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "any"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* any */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1 = {
+ sizeof(struct T2),
+ offsetof(struct T2, _asn_ctx),
+ asn_MAP_T2_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T2 = {
+ "T2",
+ "T2",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T2_tags_1,
+ sizeof(asn_DEF_T2_tags_1)
+ /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
+ asn_DEF_T2_tags_1, /* Same as above */
+ sizeof(asn_DEF_T2_tags_1)
+ /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T2_1,
+ 2, /* Elements count */
+ &asn_SPC_T2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [T3] >>> ***/
+
+#include <ANY.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [T3] >>> ***/
+
+typedef struct T3 {
+ ANY_t any1;
+ ANY_t any2;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T3_t;
+
+/*** <<< FUNC-DECLS [T3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T3;
+
+/*** <<< STAT-DEFS [T3] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T3_1[] = {
+ { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct T3, any1),
+ .tag = -1 /* Ambiguous tag (ANY?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_ANY,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "any1"
+ },
+ { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct T3, any2),
+ .tag = -1 /* Ambiguous tag (ANY?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_ANY,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "any2"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T3_specs_1 = {
+ sizeof(struct T3),
+ offsetof(struct T3, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T3 = {
+ "T3",
+ "T3",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T3_tags_1,
+ sizeof(asn_DEF_T3_tags_1)
+ /sizeof(asn_DEF_T3_tags_1[0]), /* 1 */
+ asn_DEF_T3_tags_1, /* Same as above */
+ sizeof(asn_DEF_T3_tags_1)
+ /sizeof(asn_DEF_T3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T3_1,
+ 2, /* Elements count */
+ &asn_SPC_T3_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/61-any-1-SE.asn1 b/tests/tests-asn1c-compiler/61-any-1-SE.asn1
new file mode 100644
index 0000000..aa3cec3
--- /dev/null
+++ b/tests/tests-asn1c-compiler/61-any-1-SE.asn1
@@ -0,0 +1,19 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .61
+
+ModuleTestBadANY1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 61 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ i1 INTEGER OPTIONAL,
+ any ANY
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/62-any-OK.asn1 b/tests/tests-asn1c-compiler/62-any-OK.asn1
new file mode 100644
index 0000000..0e69e01
--- /dev/null
+++ b/tests/tests-asn1c-compiler/62-any-OK.asn1
@@ -0,0 +1,45 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .62
+
+ModuleTestANYSyntax
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 62 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= CHOICE {
+ s1 T1-ext,
+ s2 T2,
+ s3 T3,
+ s4 T4
+ }
+
+ T1-ext ::= SEQUENCE {
+ i INTEGER OPTIONAL,
+ any [1] ANY, -- Converted into [1] EXPLICIT ANY
+ ...
+ }
+
+ T2 ::= [16] SEQUENCE {
+ m1 [0] NumericString,
+ m2 [1] BOOLEAN,
+ m3 [3] SEQUENCE OF NumericString,
+ o4 [4] BOOLEAN OPTIONAL,
+ o5 [5] BOOLEAN OPTIONAL,
+ o6 [6] BOOLEAN OPTIONAL
+ }
+
+ T3 ::= SET {
+ m1 [0] NumericString,
+ m2 [1] BOOLEAN
+ }
+
+ T4 ::= [53] CHOICE {
+ m1 [1] IMPLICIT OCTET STRING
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/62-any-OK.asn1.-EF b/tests/tests-asn1c-compiler/62-any-OK.asn1.-EF
new file mode 100644
index 0000000..0316412
--- /dev/null
+++ b/tests/tests-asn1c-compiler/62-any-OK.asn1.-EF
@@ -0,0 +1,37 @@
+ModuleTestANYSyntax { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 62 }
+DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+T ::= CHOICE {
+ s1 T1-ext,
+ s2 T2,
+ s3 T3,
+ s4 T4
+}
+
+T1-ext ::= SEQUENCE {
+ i INTEGER OPTIONAL,
+ any [1] EXPLICIT ANY,
+ ...
+}
+
+T2 ::= [16] IMPLICIT SEQUENCE {
+ m1 [0] IMPLICIT NumericString,
+ m2 [1] IMPLICIT BOOLEAN,
+ m3 [3] IMPLICIT SEQUENCE OF NumericString,
+ o4 [4] IMPLICIT BOOLEAN OPTIONAL,
+ o5 [5] IMPLICIT BOOLEAN OPTIONAL,
+ o6 [6] IMPLICIT BOOLEAN OPTIONAL
+}
+
+T3 ::= SET {
+ m1 [0] IMPLICIT NumericString,
+ m2 [1] IMPLICIT BOOLEAN
+}
+
+T4 ::= [53] EXPLICIT CHOICE {
+ m1 [1] IMPLICIT OCTET STRING
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/63-any-2-SE.asn1 b/tests/tests-asn1c-compiler/63-any-2-SE.asn1
new file mode 100644
index 0000000..ca747cf
--- /dev/null
+++ b/tests/tests-asn1c-compiler/63-any-2-SE.asn1
@@ -0,0 +1,18 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .63
+
+ModuleTestBadANY2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 62 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ any [1] IMPLICIT ANY
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/64-oid-constr-OK.asn1 b/tests/tests-asn1c-compiler/64-oid-constr-OK.asn1
new file mode 100644
index 0000000..f6cb41d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/64-oid-constr-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .64
+
+ModuleTestOIDConstraint
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 64 }
+ DEFINITIONS ::=
+BEGIN
+
+ void OBJECT IDENTIFIER ::= { v 1 3 6 1 4 1 9363 1 5 1 64 1 1 }
+
+ Id ::= OBJECT IDENTIFIER (void)
+
+END
diff --git a/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1 b/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1
new file mode 100644
index 0000000..a6f85bb
--- /dev/null
+++ b/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1
@@ -0,0 +1,29 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .65
+
+ModuleTestMultipleTags
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 65 }
+ DEFINITIONS ::=
+BEGIN
+
+ T1 ::= [2] EXPLICIT T2
+ T2 ::= [3] EXPLICIT T3
+ T3 ::= [4] IMPLICIT T4
+ T4 ::= [5] EXPLICIT T5
+ T5 ::= [6] IMPLICIT T6
+ T6 ::= REAL
+
+ T ::= [0] IMPLICIT Ts
+
+ Ts ::= [123] IMPLICIT SEQUENCE {
+ m1 [1] IMPLICIT T2, -- [1][4][6]
+ m2 [2] EXPLICIT T3 OPTIONAL, -- [2][4][6]
+ m3 [3] IMPLICIT T3 -- [3][6]
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1.-Pfnative-types b/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1.-Pfnative-types
new file mode 100644
index 0000000..5e12b49
--- /dev/null
+++ b/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1.-Pfnative-types
@@ -0,0 +1,545 @@
+
+/*** <<< 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",
+ NativeReal_free,
+ NativeReal_print,
+ NativeReal_compare,
+ NativeReal_constraint,
+ NativeReal_decode_ber,
+ NativeReal_encode_der,
+ NativeReal_decode_xer,
+ NativeReal_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ NativeReal_free,
+ NativeReal_print,
+ NativeReal_compare,
+ NativeReal_constraint,
+ NativeReal_decode_ber,
+ NativeReal_encode_der,
+ NativeReal_decode_xer,
+ NativeReal_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ NativeReal_free,
+ NativeReal_print,
+ NativeReal_compare,
+ NativeReal_constraint,
+ NativeReal_decode_ber,
+ NativeReal_encode_der,
+ NativeReal_decode_xer,
+ NativeReal_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ NativeReal_free,
+ NativeReal_print,
+ NativeReal_compare,
+ NativeReal_constraint,
+ NativeReal_decode_ber,
+ NativeReal_encode_der,
+ NativeReal_decode_xer,
+ NativeReal_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ NativeReal_free,
+ NativeReal_print,
+ NativeReal_compare,
+ NativeReal_constraint,
+ NativeReal_decode_ber,
+ NativeReal_encode_der,
+ NativeReal_decode_xer,
+ NativeReal_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [T6] >>> ***/
+
+#include <NativeReal.h>
+
+/*** <<< TYPE-DECLS [T6] >>> ***/
+
+typedef double 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 NativeReal,
+ * 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",
+ NativeReal_free,
+ NativeReal_print,
+ NativeReal_compare,
+ NativeReal_constraint,
+ NativeReal_decode_ber,
+ NativeReal_encode_der,
+ NativeReal_decode_xer,
+ NativeReal_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Ts_1,
+ 3, /* Elements count */
+ &asn_SPC_Ts_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Ts] >>> ***/
+
+#include "T2.h"
+#include "T3.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< 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,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .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,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .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,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .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),
+ asn_MAP_Ts_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Ts = {
+ "Ts",
+ "Ts",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Ts_1,
+ 3, /* Elements count */
+ &asn_SPC_Ts_specs_1 /* Additional specs */
+};
+
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..dd6a889
--- /dev/null
+++ b/tests/tests-asn1c-compiler/65-multi-tag-OK.asn1.-Pfwide-types
@@ -0,0 +1,545 @@
+
+/*** <<< 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",
+ REAL_free,
+ REAL_print,
+ REAL_compare,
+ REAL_constraint,
+ REAL_decode_ber,
+ REAL_encode_der,
+ REAL_decode_xer,
+ REAL_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ REAL_free,
+ REAL_print,
+ REAL_compare,
+ REAL_constraint,
+ REAL_decode_ber,
+ REAL_encode_der,
+ REAL_decode_xer,
+ REAL_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ REAL_free,
+ REAL_print,
+ REAL_compare,
+ REAL_constraint,
+ REAL_decode_ber,
+ REAL_encode_der,
+ REAL_decode_xer,
+ REAL_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ REAL_free,
+ REAL_print,
+ REAL_compare,
+ REAL_constraint,
+ REAL_decode_ber,
+ REAL_encode_der,
+ REAL_decode_xer,
+ REAL_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ REAL_free,
+ REAL_print,
+ REAL_compare,
+ REAL_constraint,
+ REAL_decode_ber,
+ REAL_encode_der,
+ REAL_decode_xer,
+ REAL_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [T6] >>> ***/
+
+#include <REAL.h>
+
+/*** <<< 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",
+ REAL_free,
+ REAL_print,
+ REAL_compare,
+ REAL_constraint,
+ REAL_decode_ber,
+ REAL_encode_der,
+ REAL_decode_xer,
+ REAL_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 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",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Ts_1,
+ 3, /* Elements count */
+ &asn_SPC_Ts_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Ts] >>> ***/
+
+#include "T2.h"
+#include "T3.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< 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,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .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,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .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,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .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),
+ asn_MAP_Ts_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Ts = {
+ "Ts",
+ "Ts",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ 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, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Ts_1,
+ 3, /* Elements count */
+ &asn_SPC_Ts_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/66-ref-simple-OK.asn1 b/tests/tests-asn1c-compiler/66-ref-simple-OK.asn1
new file mode 100644
index 0000000..38254a9
--- /dev/null
+++ b/tests/tests-asn1c-compiler/66-ref-simple-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .66
+
+ModuleTestReferenceToNamedSimpleType
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 66 }
+ DEFINITIONS IMPLICIT TAGS ::=
+BEGIN
+
+ T ::= SET OF named SimpleType
+
+ SimpleType ::= ENUMERATED { one, two, three }
+
+END
diff --git a/tests/tests-asn1c-compiler/66-ref-simple-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/66-ref-simple-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..83122fc
--- /dev/null
+++ b/tests/tests-asn1c-compiler/66-ref-simple-OK.asn1.-Pfwide-types
@@ -0,0 +1,156 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include "SimpleType.h"
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ A_SET_OF(SimpleType_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_SimpleType,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "named"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ 1, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 1, /* Single element */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SimpleType] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [SimpleType] >>> ***/
+
+typedef enum SimpleType {
+ SimpleType_one = 0,
+ SimpleType_two = 1,
+ SimpleType_three = 2
+} e_SimpleType;
+
+/*** <<< TYPE-DECLS [SimpleType] >>> ***/
+
+typedef ENUMERATED_t SimpleType_t;
+
+/*** <<< FUNC-DECLS [SimpleType] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SimpleType;
+extern asn_INTEGER_specifics_t asn_SPC_SimpleType_specs_1;
+asn_struct_free_f SimpleType_free;
+asn_struct_print_f SimpleType_print;
+asn_constr_check_f SimpleType_constraint;
+ber_type_decoder_f SimpleType_decode_ber;
+der_type_encoder_f SimpleType_encode_der;
+xer_type_decoder_f SimpleType_decode_xer;
+xer_type_encoder_f SimpleType_encode_xer;
+
+/*** <<< CODE [SimpleType] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [SimpleType] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_SimpleType_value2enum_1[] = {
+ { 0, 3, "one" },
+ { 1, 3, "two" },
+ { 2, 5, "three" }
+};
+static const unsigned int asn_MAP_SimpleType_enum2value_1[] = {
+ 0, /* one(0) */
+ 2, /* three(2) */
+ 1 /* two(1) */
+};
+const asn_INTEGER_specifics_t asn_SPC_SimpleType_specs_1 = {
+ asn_MAP_SimpleType_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_SimpleType_enum2value_1, /* N => "tag"; sorted by N */
+ 3, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_SimpleType_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SimpleType = {
+ "SimpleType",
+ "SimpleType",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SimpleType_tags_1,
+ sizeof(asn_DEF_SimpleType_tags_1)
+ /sizeof(asn_DEF_SimpleType_tags_1[0]), /* 1 */
+ asn_DEF_SimpleType_tags_1, /* Same as above */
+ sizeof(asn_DEF_SimpleType_tags_1)
+ /sizeof(asn_DEF_SimpleType_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_SimpleType_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/67-embedded-choice-OK.asn1 b/tests/tests-asn1c-compiler/67-embedded-choice-OK.asn1
new file mode 100644
index 0000000..d3a1954
--- /dev/null
+++ b/tests/tests-asn1c-compiler/67-embedded-choice-OK.asn1
@@ -0,0 +1,35 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .67
+
+ModuleTestEmbeddedChoice
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 67 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ A ::= CHOICE {
+ a NULL,
+ b NULL,
+ ...
+ }
+
+ B ::= CHOICE {
+ a NULL,
+ b NULL,
+ ...,
+ other A -- Only AUTOMATIC TAGS make it right
+ }
+
+ C ::= SET {
+ a NULL,
+ b NULL,
+ ...,
+ other1 A,
+ other2 B
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/68-enum-default-OK.asn1 b/tests/tests-asn1c-compiler/68-enum-default-OK.asn1
new file mode 100644
index 0000000..0b26cf7
--- /dev/null
+++ b/tests/tests-asn1c-compiler/68-enum-default-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .68
+
+ModuleTestEnumeratedDefault
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 68 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type ::= SEQUENCE {
+ reportAmount ReportAmount DEFAULT ra-default,
+ reportInterval INTEGER
+ }
+
+ ReportAmount ::= ENUMERATED { a, b, c, ra-default }
+
+END
diff --git a/tests/tests-asn1c-compiler/69-reserved-words-OK.asn1 b/tests/tests-asn1c-compiler/69-reserved-words-OK.asn1
new file mode 100644
index 0000000..29014ee
--- /dev/null
+++ b/tests/tests-asn1c-compiler/69-reserved-words-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .69
+
+ModuleTestReservedWords
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 69 }
+ DEFINITIONS ::=
+BEGIN
+
+ T ::= SEQUENCE {
+ int INTEGER,
+ char OCTET STRING (SIZE(1)),
+ class SET { ... },
+ double REAL
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/69-reserved-words-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/69-reserved-words-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..32e4cab
--- /dev/null
+++ b/tests/tests-asn1c-compiler/69-reserved-words-OK.asn1.-Pfwide-types
@@ -0,0 +1,213 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <INTEGER.h>
+#include <OCTET_STRING.h>
+#include <REAL.h>
+#include <constr_SET.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum class_PR {
+} class_PR;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ INTEGER_t Int;
+ OCTET_STRING_t Char;
+ struct Class {
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pclass, class_PR_x) */
+ unsigned int _presence_map
+ [((0+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } Class;
+ REAL_t Double;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< CODE [T] >>> ***/
+
+static int
+memb_char_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ size = st->size;
+
+ if((size == 1)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_class_tags_4[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const uint8_t asn_MAP_class_mmap_4[(0 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ 0
+};
+static
+asn_SET_specifics_t asn_SPC_class_specs_4 = {
+ sizeof(struct Class),
+ offsetof(struct Class, _asn_ctx),
+ offsetof(struct Class, _presence_map),
+ asn_MAP_class_tag2el_4,
+ 0, /* Count of tags in the map */
+ asn_MAP_class_tag2el_4, /* Same as above */
+ 0, /* Count of tags in the CXER map */
+ 1, /* Whether extensible */
+ (const unsigned int *)asn_MAP_class_mmap_4 /* Mandatory elements map */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_class_4 = {
+ "class",
+ "class",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_class_tags_4,
+ sizeof(asn_DEF_class_tags_4)
+ /sizeof(asn_DEF_class_tags_4[0]), /* 1 */
+ asn_DEF_class_tags_4, /* Same as above */
+ sizeof(asn_DEF_class_tags_4)
+ /sizeof(asn_DEF_class_tags_4[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_class_specs_4 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, Int),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, Char),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_OCTET_STRING,
+ .type_selector = 0,
+ .memb_constraints = memb_char_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "char"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, Class),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_class_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "class"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct T, Double),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_REAL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "double"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* char */
+ { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 3, 0, 0 }, /* double */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* class */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ asn_MAP_T_tag2el_1,
+ 4, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 4, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/70-xer-test-OK.asn1 b/tests/tests-asn1c-compiler/70-xer-test-OK.asn1
new file mode 100644
index 0000000..2c23f52
--- /dev/null
+++ b/tests/tests-asn1c-compiler/70-xer-test-OK.asn1
@@ -0,0 +1,81 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .70
+
+ModuleTestXERDecoding
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 70 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+ /*
+ * This module defines several types for the XER decoder testing
+ * environment (defined elsewhere).
+ */
+
+ PDU ::= CHOICE {
+ sequence Sequence,
+ set Set,
+ sequenceOf SequenceOf,
+ extensibleSet ExtensibleSet,
+ extensibleSequence ExtensibleSequence,
+ extensibleSequence2 ExtensibleSequence2,
+ setOfNULL SetOfNULL,
+ setOfREAL SetOfREAL,
+ setOfEnums SetOfEnums,
+ namedSetOfNULL NamedSetOfNULL,
+ namedSetOfREAL NamedSetOfREAL,
+ namedSetOfEnums NamedSetOfEnums,
+ seqOfZuka SeqOfZuka,
+ setOfChoice SetOfChoice,
+ namedSetOfChoice NamedSetOfChoice,
+ ...
+ }
+
+ Sequence ::= SEQUENCE {
+ integer INTEGER,
+ sequence Sequence OPTIONAL, -- backreference
+ bits BIT STRING OPTIONAL,
+ string UTF8String
+ }
+
+ Set ::= SET {
+ roid RELATIVE-OID,
+ opaque OCTET STRING OPTIONAL
+ }
+
+ ExtensibleSet ::= SET {
+ string UTF8String OPTIONAL,
+ ...,
+ enum ENUMERATED { b, a }
+ }
+
+ ExtensibleSequence ::= SEQUENCE {
+ string UTF8String OPTIONAL,
+ ...,
+ integer INTEGER OPTIONAL,
+ gtime GeneralizedTime
+ }
+
+ ExtensibleSequence2 ::= SEQUENCE {
+ string UTF8String OPTIONAL,
+ ...,
+ integer INTEGER OPTIONAL
+ }
+
+ SetOfNULL ::= SET OF NULL
+ SetOfREAL ::= SET OF REAL
+ SetOfEnums ::= SET OF ENUMERATED { one, oneMore }
+ NamedSetOfNULL ::= SET OF y NULL
+ NamedSetOfREAL ::= SET OF name REAL
+ NamedSetOfEnums ::= SET OF name ENUMERATED { one, oneMore }
+ SequenceOf ::= SEQUENCE OF id INTEGER { one(1), two(2) }
+ SeqOfZuka ::= SEQUENCE OF zuka NULL
+ SetOfChoice ::= SET OF SimpleChoice
+ NamedSetOfChoice ::= SET OF whatever SimpleChoice
+
+ SimpleChoice ::= CHOICE { a NULL, b INTEGER }
+
+END
diff --git a/tests/tests-asn1c-compiler/70-xer-test-OK.asn1.-EF b/tests/tests-asn1c-compiler/70-xer-test-OK.asn1.-EF
new file mode 100644
index 0000000..983f40a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/70-xer-test-OK.asn1.-EF
@@ -0,0 +1,93 @@
+ModuleTestXERDecoding { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 70 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+PDU ::= CHOICE {
+ sequence [0] IMPLICIT Sequence,
+ set [1] IMPLICIT Set,
+ sequenceOf [2] IMPLICIT SequenceOf,
+ extensibleSet [3] IMPLICIT ExtensibleSet,
+ extensibleSequence [4] IMPLICIT ExtensibleSequence,
+ extensibleSequence2 [5] IMPLICIT ExtensibleSequence2,
+ setOfNULL [6] IMPLICIT SetOfNULL,
+ setOfREAL [7] IMPLICIT SetOfREAL,
+ setOfEnums [8] IMPLICIT SetOfEnums,
+ namedSetOfNULL [9] IMPLICIT NamedSetOfNULL,
+ namedSetOfREAL [10] IMPLICIT NamedSetOfREAL,
+ namedSetOfEnums [11] IMPLICIT NamedSetOfEnums,
+ seqOfZuka [12] IMPLICIT SeqOfZuka,
+ setOfChoice [13] IMPLICIT SetOfChoice,
+ namedSetOfChoice [14] IMPLICIT NamedSetOfChoice,
+ ...
+}
+
+Sequence ::= SEQUENCE {
+ integer [0] IMPLICIT INTEGER,
+ sequence [1] IMPLICIT Sequence OPTIONAL,
+ bits [2] IMPLICIT BIT STRING OPTIONAL,
+ string [3] IMPLICIT UTF8String
+}
+
+Set ::= SET {
+ roid [0] IMPLICIT RELATIVE-OID,
+ opaque [1] IMPLICIT OCTET STRING OPTIONAL
+}
+
+ExtensibleSet ::= SET {
+ string [0] IMPLICIT UTF8String OPTIONAL,
+ ...,
+ enum [1] IMPLICIT ENUMERATED {
+ b(0),
+ a(1)
+ }
+}
+
+ExtensibleSequence ::= SEQUENCE {
+ string [0] IMPLICIT UTF8String OPTIONAL,
+ ...,
+ integer [1] IMPLICIT INTEGER OPTIONAL,
+ gtime [2] IMPLICIT GeneralizedTime
+}
+
+ExtensibleSequence2 ::= SEQUENCE {
+ string [0] IMPLICIT UTF8String OPTIONAL,
+ ...,
+ integer [1] IMPLICIT INTEGER OPTIONAL
+}
+
+SetOfNULL ::= SET OF NULL
+
+SetOfREAL ::= SET OF REAL
+
+SetOfEnums ::= SET OF ENUMERATED {
+ one(0),
+ oneMore(1)
+ }
+
+NamedSetOfNULL ::= SET OF y NULL
+
+NamedSetOfREAL ::= SET OF name REAL
+
+NamedSetOfEnums ::= SET OF name ENUMERATED {
+ one(0),
+ oneMore(1)
+ }
+
+SequenceOf ::= SEQUENCE OF id INTEGER {
+ one(1),
+ two(2)
+ }
+
+SeqOfZuka ::= SEQUENCE OF zuka NULL
+
+SetOfChoice ::= SET OF SimpleChoice
+
+NamedSetOfChoice ::= SET OF whatever SimpleChoice
+
+SimpleChoice ::= CHOICE {
+ a [0] IMPLICIT NULL,
+ b [1] IMPLICIT INTEGER
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/70-xer-test-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/70-xer-test-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..b50ab26
--- /dev/null
+++ b/tests/tests-asn1c-compiler/70-xer-test-OK.asn1.-Pfwide-types
@@ -0,0 +1,1876 @@
+
+/*** <<< INCLUDES [PDU] >>> ***/
+
+#include "Sequence.h"
+#include "Set.h"
+#include "SequenceOf.h"
+#include "ExtensibleSet.h"
+#include "ExtensibleSequence.h"
+#include "ExtensibleSequence2.h"
+#include "SetOfNULL.h"
+#include "SetOfREAL.h"
+#include "SetOfEnums.h"
+#include "NamedSetOfNULL.h"
+#include "NamedSetOfREAL.h"
+#include "NamedSetOfEnums.h"
+#include "SeqOfZuka.h"
+#include "SetOfChoice.h"
+#include "NamedSetOfChoice.h"
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [PDU] >>> ***/
+
+typedef enum PDU_PR {
+ PDU_PR_NOTHING, /* No components present */
+ PDU_PR_sequence,
+ PDU_PR_set,
+ PDU_PR_sequenceOf,
+ PDU_PR_extensibleSet,
+ PDU_PR_extensibleSequence,
+ PDU_PR_extensibleSequence2,
+ PDU_PR_setOfNULL,
+ PDU_PR_setOfREAL,
+ PDU_PR_setOfEnums,
+ PDU_PR_namedSetOfNULL,
+ PDU_PR_namedSetOfREAL,
+ PDU_PR_namedSetOfEnums,
+ PDU_PR_seqOfZuka,
+ PDU_PR_setOfChoice,
+ PDU_PR_namedSetOfChoice
+ /* Extensions may appear below */
+
+} PDU_PR;
+
+/*** <<< TYPE-DECLS [PDU] >>> ***/
+
+typedef struct PDU {
+ PDU_PR present;
+ union PDU_u {
+ Sequence_t sequence;
+ Set_t set;
+ SequenceOf_t sequenceOf;
+ ExtensibleSet_t extensibleSet;
+ ExtensibleSequence_t extensibleSequence;
+ ExtensibleSequence2_t extensibleSequence2;
+ SetOfNULL_t setOfNULL;
+ SetOfREAL_t setOfREAL;
+ SetOfEnums_t setOfEnums;
+ NamedSetOfNULL_t namedSetOfNULL;
+ NamedSetOfREAL_t namedSetOfREAL;
+ NamedSetOfEnums_t namedSetOfEnums;
+ SeqOfZuka_t seqOfZuka;
+ SetOfChoice_t setOfChoice;
+ NamedSetOfChoice_t namedSetOfChoice;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} PDU_t;
+
+/*** <<< FUNC-DECLS [PDU] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_PDU;
+
+/*** <<< STAT-DEFS [PDU] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_PDU_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.sequence),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "sequence"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.set),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.sequenceOf),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_SequenceOf,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "sequenceOf"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.extensibleSet),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_ExtensibleSet,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "extensibleSet"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.extensibleSequence),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_ExtensibleSequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "extensibleSequence"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.extensibleSequence2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_ExtensibleSequence2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "extensibleSequence2"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfNULL),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_SetOfNULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "setOfNULL"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfREAL),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_SetOfREAL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "setOfREAL"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfEnums),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_SetOfEnums,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "setOfEnums"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfNULL),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NamedSetOfNULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "namedSetOfNULL"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfREAL),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (10 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NamedSetOfREAL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "namedSetOfREAL"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfEnums),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (11 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NamedSetOfEnums,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "namedSetOfEnums"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.seqOfZuka),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (12 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_SeqOfZuka,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "seqOfZuka"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.setOfChoice),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (13 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_SetOfChoice,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "setOfChoice"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU, choice.namedSetOfChoice),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (14 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NamedSetOfChoice,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "namedSetOfChoice"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sequence */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* set */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sequenceOf */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* extensibleSet */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* extensibleSequence */
+ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* extensibleSequence2 */
+ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* setOfNULL */
+ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* setOfREAL */
+ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* setOfEnums */
+ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* namedSetOfNULL */
+ { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0 }, /* namedSetOfREAL */
+ { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0 }, /* namedSetOfEnums */
+ { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 12, 0, 0 }, /* seqOfZuka */
+ { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 13, 0, 0 }, /* setOfChoice */
+ { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 14, 0, 0 } /* namedSetOfChoice */
+};
+static asn_CHOICE_specifics_t asn_SPC_PDU_specs_1 = {
+ sizeof(struct PDU),
+ offsetof(struct PDU, _asn_ctx),
+ offsetof(struct PDU, present),
+ sizeof(((struct PDU *)0)->present),
+ asn_MAP_PDU_tag2el_1,
+ 15, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 15 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_PDU = {
+ "PDU",
+ "PDU",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_PDU_1,
+ 15, /* Elements count */
+ &asn_SPC_PDU_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Sequence] >>> ***/
+
+#include <INTEGER.h>
+#include <BIT_STRING.h>
+#include <UTF8String.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Sequence] >>> ***/
+
+struct Sequence;
+
+/*** <<< TYPE-DECLS [Sequence] >>> ***/
+
+typedef struct Sequence {
+ INTEGER_t integer;
+ struct Sequence *sequence /* OPTIONAL */;
+ BIT_STRING_t *bits /* OPTIONAL */;
+ UTF8String_t string;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Sequence_t;
+
+/*** <<< FUNC-DECLS [Sequence] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Sequence;
+extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
+extern asn_TYPE_member_t asn_MBR_Sequence_1[4];
+
+/*** <<< POST-INCLUDE [Sequence] >>> ***/
+
+#include "Sequence.h"
+
+/*** <<< STAT-DEFS [Sequence] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Sequence_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, integer),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "integer"
+ },
+ { ATF_POINTER, 2, offsetof(struct Sequence, sequence),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "sequence"
+ },
+ { ATF_POINTER, 1, offsetof(struct Sequence, bits),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "bits"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, string),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "string"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* integer */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* sequence */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* bits */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* string */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
+ sizeof(struct Sequence),
+ offsetof(struct Sequence, _asn_ctx),
+ asn_MAP_Sequence_tag2el_1,
+ 4, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Sequence = {
+ "Sequence",
+ "Sequence",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Sequence_tags_1,
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ asn_DEF_Sequence_tags_1, /* Same as above */
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 4, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Set] >>> ***/
+
+#include <RELATIVE-OID.h>
+#include <OCTET_STRING.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [Set] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum Set_PR {
+ Set_PR_roid, /* Member roid is present */
+ Set_PR_opaque, /* Member opaque is present */
+} Set_PR;
+
+/*** <<< TYPE-DECLS [Set] >>> ***/
+
+typedef struct Set {
+ RELATIVE_OID_t roid;
+ OCTET_STRING_t *opaque /* OPTIONAL */;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pSet, Set_PR_x) */
+ unsigned int _presence_map
+ [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Set_t;
+
+/*** <<< FUNC-DECLS [Set] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Set;
+extern asn_SET_specifics_t asn_SPC_Set_specs_1;
+extern asn_TYPE_member_t asn_MBR_Set_1[2];
+
+/*** <<< STAT-DEFS [Set] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Set_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Set, roid),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_RELATIVE_OID,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "roid"
+ },
+ { ATF_POINTER, 1, offsetof(struct Set, opaque),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_OCTET_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "opaque"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Set_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Set_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* roid */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* opaque */
+};
+static const uint8_t asn_MAP_Set_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7) | (0 << 6)
+};
+asn_SET_specifics_t asn_SPC_Set_specs_1 = {
+ sizeof(struct Set),
+ offsetof(struct Set, _asn_ctx),
+ offsetof(struct Set, _presence_map),
+ asn_MAP_Set_tag2el_1,
+ 2, /* Count of tags in the map */
+ asn_MAP_Set_tag2el_1, /* Same as above */
+ 2, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_Set_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_Set = {
+ "Set",
+ "Set",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Set_tags_1,
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ asn_DEF_Set_tags_1, /* Same as above */
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Set_1,
+ 2, /* Elements count */
+ &asn_SPC_Set_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ExtensibleSet] >>> ***/
+
+#include <UTF8String.h>
+#include <ENUMERATED.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [ExtensibleSet] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum ExtensibleSet_PR {
+ ExtensibleSet_PR_string, /* Member string is present */
+ ExtensibleSet_PR_enum, /* Member enum is present */
+} ExtensibleSet_PR;
+typedef enum Enum {
+ enum_b = 0,
+ enum_a = 1
+} e_enum;
+
+/*** <<< TYPE-DECLS [ExtensibleSet] >>> ***/
+
+typedef struct ExtensibleSet {
+ UTF8String_t *string /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ ENUMERATED_t *Enum;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pExtensibleSet, ExtensibleSet_PR_x) */
+ unsigned int _presence_map
+ [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ExtensibleSet_t;
+
+/*** <<< FUNC-DECLS [ExtensibleSet] >>> ***/
+
+/* extern asn_TYPE_descriptor_t asn_DEF_enum_4; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_ExtensibleSet;
+extern asn_SET_specifics_t asn_SPC_ExtensibleSet_specs_1;
+extern asn_TYPE_member_t asn_MBR_ExtensibleSet_1[2];
+
+/*** <<< CODE [ExtensibleSet] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [ExtensibleSet] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_enum_value2enum_4[] = {
+ { 0, 1, "b" },
+ { 1, 1, "a" }
+};
+static const unsigned int asn_MAP_enum_enum2value_4[] = {
+ 1, /* a(1) */
+ 0 /* b(0) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_enum_specs_4 = {
+ asn_MAP_enum_value2enum_4, /* "tag" => N; sorted by tag */
+ asn_MAP_enum_enum2value_4, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_enum_tags_4[] = {
+ (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_enum_4 = {
+ "enum",
+ "enum",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_enum_tags_4,
+ sizeof(asn_DEF_enum_tags_4)
+ /sizeof(asn_DEF_enum_tags_4[0]) - 1, /* 1 */
+ asn_DEF_enum_tags_4, /* Same as above */
+ sizeof(asn_DEF_enum_tags_4)
+ /sizeof(asn_DEF_enum_tags_4[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_enum_specs_4 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ExtensibleSet_1[] = {
+ { ATF_POINTER, 2, offsetof(struct ExtensibleSet, string),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "string"
+ },
+ { ATF_POINTER, 1, offsetof(struct ExtensibleSet, Enum),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_enum_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "enum"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ExtensibleSet_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ExtensibleSet_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* string */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* enum */
+};
+static const uint8_t asn_MAP_ExtensibleSet_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (0 << 7) | (0 << 6)
+};
+asn_SET_specifics_t asn_SPC_ExtensibleSet_specs_1 = {
+ sizeof(struct ExtensibleSet),
+ offsetof(struct ExtensibleSet, _asn_ctx),
+ offsetof(struct ExtensibleSet, _presence_map),
+ asn_MAP_ExtensibleSet_tag2el_1,
+ 2, /* Count of tags in the map */
+ asn_MAP_ExtensibleSet_tag2el_1, /* Same as above */
+ 2, /* Count of tags in the CXER map */
+ 1, /* Whether extensible */
+ (const unsigned int *)asn_MAP_ExtensibleSet_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_ExtensibleSet = {
+ "ExtensibleSet",
+ "ExtensibleSet",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ExtensibleSet_tags_1,
+ sizeof(asn_DEF_ExtensibleSet_tags_1)
+ /sizeof(asn_DEF_ExtensibleSet_tags_1[0]), /* 1 */
+ asn_DEF_ExtensibleSet_tags_1, /* Same as above */
+ sizeof(asn_DEF_ExtensibleSet_tags_1)
+ /sizeof(asn_DEF_ExtensibleSet_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ExtensibleSet_1,
+ 2, /* Elements count */
+ &asn_SPC_ExtensibleSet_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ExtensibleSequence] >>> ***/
+
+#include <UTF8String.h>
+#include <INTEGER.h>
+#include <GeneralizedTime.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [ExtensibleSequence] >>> ***/
+
+typedef struct ExtensibleSequence {
+ UTF8String_t *string /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ INTEGER_t *integer /* OPTIONAL */;
+ GeneralizedTime_t *gtime;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ExtensibleSequence_t;
+
+/*** <<< FUNC-DECLS [ExtensibleSequence] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence;
+extern asn_SEQUENCE_specifics_t asn_SPC_ExtensibleSequence_specs_1;
+extern asn_TYPE_member_t asn_MBR_ExtensibleSequence_1[3];
+
+/*** <<< STAT-DEFS [ExtensibleSequence] >>> ***/
+
+asn_TYPE_member_t asn_MBR_ExtensibleSequence_1[] = {
+ { ATF_POINTER, 3, offsetof(struct ExtensibleSequence, string),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "string"
+ },
+ { ATF_POINTER, 2, offsetof(struct ExtensibleSequence, integer),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "integer"
+ },
+ { ATF_POINTER, 1, offsetof(struct ExtensibleSequence, gtime),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_GeneralizedTime,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "gtime"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ExtensibleSequence_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ExtensibleSequence_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* string */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* integer */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* gtime */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ExtensibleSequence_specs_1 = {
+ sizeof(struct ExtensibleSequence),
+ offsetof(struct ExtensibleSequence, _asn_ctx),
+ asn_MAP_ExtensibleSequence_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 0, /* Start extensions */
+ 4 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence = {
+ "ExtensibleSequence",
+ "ExtensibleSequence",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ExtensibleSequence_tags_1,
+ sizeof(asn_DEF_ExtensibleSequence_tags_1)
+ /sizeof(asn_DEF_ExtensibleSequence_tags_1[0]), /* 1 */
+ asn_DEF_ExtensibleSequence_tags_1, /* Same as above */
+ sizeof(asn_DEF_ExtensibleSequence_tags_1)
+ /sizeof(asn_DEF_ExtensibleSequence_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ExtensibleSequence_1,
+ 3, /* Elements count */
+ &asn_SPC_ExtensibleSequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ExtensibleSequence2] >>> ***/
+
+#include <UTF8String.h>
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [ExtensibleSequence2] >>> ***/
+
+typedef struct ExtensibleSequence2 {
+ UTF8String_t *string /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ INTEGER_t *integer /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ExtensibleSequence2_t;
+
+/*** <<< FUNC-DECLS [ExtensibleSequence2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence2;
+extern asn_SEQUENCE_specifics_t asn_SPC_ExtensibleSequence2_specs_1;
+extern asn_TYPE_member_t asn_MBR_ExtensibleSequence2_1[2];
+
+/*** <<< STAT-DEFS [ExtensibleSequence2] >>> ***/
+
+asn_TYPE_member_t asn_MBR_ExtensibleSequence2_1[] = {
+ { ATF_POINTER, 2, offsetof(struct ExtensibleSequence2, string),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_UTF8String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "string"
+ },
+ { ATF_POINTER, 1, offsetof(struct ExtensibleSequence2, integer),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "integer"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ExtensibleSequence2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ExtensibleSequence2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* string */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* integer */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ExtensibleSequence2_specs_1 = {
+ sizeof(struct ExtensibleSequence2),
+ offsetof(struct ExtensibleSequence2, _asn_ctx),
+ asn_MAP_ExtensibleSequence2_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 0, /* Start extensions */
+ 3 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ExtensibleSequence2 = {
+ "ExtensibleSequence2",
+ "ExtensibleSequence2",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ExtensibleSequence2_tags_1,
+ sizeof(asn_DEF_ExtensibleSequence2_tags_1)
+ /sizeof(asn_DEF_ExtensibleSequence2_tags_1[0]), /* 1 */
+ asn_DEF_ExtensibleSequence2_tags_1, /* Same as above */
+ sizeof(asn_DEF_ExtensibleSequence2_tags_1)
+ /sizeof(asn_DEF_ExtensibleSequence2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ExtensibleSequence2_1,
+ 2, /* Elements count */
+ &asn_SPC_ExtensibleSequence2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SetOfNULL] >>> ***/
+
+#include <NULL.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< TYPE-DECLS [SetOfNULL] >>> ***/
+
+typedef struct SetOfNULL {
+ A_SET_OF(NULL_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SetOfNULL_t;
+
+/*** <<< FUNC-DECLS [SetOfNULL] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SetOfNULL;
+extern asn_SET_OF_specifics_t asn_SPC_SetOfNULL_specs_1;
+extern asn_TYPE_member_t asn_MBR_SetOfNULL_1[1];
+
+/*** <<< STAT-DEFS [SetOfNULL] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SetOfNULL_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SetOfNULL_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_SetOfNULL_specs_1 = {
+ sizeof(struct SetOfNULL),
+ offsetof(struct SetOfNULL, _asn_ctx),
+ 1, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_SetOfNULL = {
+ "SetOfNULL",
+ "SetOfNULL",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SetOfNULL_tags_1,
+ sizeof(asn_DEF_SetOfNULL_tags_1)
+ /sizeof(asn_DEF_SetOfNULL_tags_1[0]), /* 1 */
+ asn_DEF_SetOfNULL_tags_1, /* Same as above */
+ sizeof(asn_DEF_SetOfNULL_tags_1)
+ /sizeof(asn_DEF_SetOfNULL_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SetOfNULL_1,
+ 1, /* Single element */
+ &asn_SPC_SetOfNULL_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SetOfREAL] >>> ***/
+
+#include <REAL.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< TYPE-DECLS [SetOfREAL] >>> ***/
+
+typedef struct SetOfREAL {
+ A_SET_OF(REAL_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SetOfREAL_t;
+
+/*** <<< FUNC-DECLS [SetOfREAL] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SetOfREAL;
+extern asn_SET_OF_specifics_t asn_SPC_SetOfREAL_specs_1;
+extern asn_TYPE_member_t asn_MBR_SetOfREAL_1[1];
+
+/*** <<< STAT-DEFS [SetOfREAL] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SetOfREAL_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_REAL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SetOfREAL_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_SetOfREAL_specs_1 = {
+ sizeof(struct SetOfREAL),
+ offsetof(struct SetOfREAL, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_SetOfREAL = {
+ "SetOfREAL",
+ "SetOfREAL",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SetOfREAL_tags_1,
+ sizeof(asn_DEF_SetOfREAL_tags_1)
+ /sizeof(asn_DEF_SetOfREAL_tags_1[0]), /* 1 */
+ asn_DEF_SetOfREAL_tags_1, /* Same as above */
+ sizeof(asn_DEF_SetOfREAL_tags_1)
+ /sizeof(asn_DEF_SetOfREAL_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SetOfREAL_1,
+ 1, /* Single element */
+ &asn_SPC_SetOfREAL_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SetOfEnums] >>> ***/
+
+#include <ENUMERATED.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< DEPS [SetOfEnums] >>> ***/
+
+typedef enum Member {
+ Member_one = 0,
+ Member_oneMore = 1
+} e_Member;
+
+/*** <<< TYPE-DECLS [SetOfEnums] >>> ***/
+
+typedef struct SetOfEnums {
+ A_SET_OF(ENUMERATED_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SetOfEnums_t;
+
+/*** <<< FUNC-DECLS [SetOfEnums] >>> ***/
+
+/* extern asn_TYPE_descriptor_t asn_DEF_Member_2; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_SetOfEnums;
+extern asn_SET_OF_specifics_t asn_SPC_SetOfEnums_specs_1;
+extern asn_TYPE_member_t asn_MBR_SetOfEnums_1[1];
+
+/*** <<< CODE [SetOfEnums] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [SetOfEnums] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_Member_value2enum_2[] = {
+ { 0, 3, "one" },
+ { 1, 7, "oneMore" }
+};
+static const unsigned int asn_MAP_Member_enum2value_2[] = {
+ 0, /* one(0) */
+ 1 /* oneMore(1) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Member_specs_2 = {
+ asn_MAP_Member_value2enum_2, /* "tag" => N; sorted by tag */
+ asn_MAP_Member_enum2value_2, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_Member_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_Member_2 = {
+ "ENUMERATED",
+ "ENUMERATED",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Member_tags_2,
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ asn_DEF_Member_tags_2, /* Same as above */
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_Member_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SetOfEnums_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Member_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SetOfEnums_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_SetOfEnums_specs_1 = {
+ sizeof(struct SetOfEnums),
+ offsetof(struct SetOfEnums, _asn_ctx),
+ 1, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_SetOfEnums = {
+ "SetOfEnums",
+ "SetOfEnums",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SetOfEnums_tags_1,
+ sizeof(asn_DEF_SetOfEnums_tags_1)
+ /sizeof(asn_DEF_SetOfEnums_tags_1[0]), /* 1 */
+ asn_DEF_SetOfEnums_tags_1, /* Same as above */
+ sizeof(asn_DEF_SetOfEnums_tags_1)
+ /sizeof(asn_DEF_SetOfEnums_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SetOfEnums_1,
+ 1, /* Single element */
+ &asn_SPC_SetOfEnums_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NamedSetOfNULL] >>> ***/
+
+#include <NULL.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< TYPE-DECLS [NamedSetOfNULL] >>> ***/
+
+typedef struct NamedSetOfNULL {
+ A_SET_OF(NULL_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} NamedSetOfNULL_t;
+
+/*** <<< FUNC-DECLS [NamedSetOfNULL] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfNULL;
+extern asn_SET_OF_specifics_t asn_SPC_NamedSetOfNULL_specs_1;
+extern asn_TYPE_member_t asn_MBR_NamedSetOfNULL_1[1];
+
+/*** <<< STAT-DEFS [NamedSetOfNULL] >>> ***/
+
+asn_TYPE_member_t asn_MBR_NamedSetOfNULL_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "y"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_NamedSetOfNULL_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_NamedSetOfNULL_specs_1 = {
+ sizeof(struct NamedSetOfNULL),
+ offsetof(struct NamedSetOfNULL, _asn_ctx),
+ 1, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_NamedSetOfNULL = {
+ "NamedSetOfNULL",
+ "NamedSetOfNULL",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NamedSetOfNULL_tags_1,
+ sizeof(asn_DEF_NamedSetOfNULL_tags_1)
+ /sizeof(asn_DEF_NamedSetOfNULL_tags_1[0]), /* 1 */
+ asn_DEF_NamedSetOfNULL_tags_1, /* Same as above */
+ sizeof(asn_DEF_NamedSetOfNULL_tags_1)
+ /sizeof(asn_DEF_NamedSetOfNULL_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_NamedSetOfNULL_1,
+ 1, /* Single element */
+ &asn_SPC_NamedSetOfNULL_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NamedSetOfREAL] >>> ***/
+
+#include <REAL.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< TYPE-DECLS [NamedSetOfREAL] >>> ***/
+
+typedef struct NamedSetOfREAL {
+ A_SET_OF(REAL_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} NamedSetOfREAL_t;
+
+/*** <<< FUNC-DECLS [NamedSetOfREAL] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfREAL;
+extern asn_SET_OF_specifics_t asn_SPC_NamedSetOfREAL_specs_1;
+extern asn_TYPE_member_t asn_MBR_NamedSetOfREAL_1[1];
+
+/*** <<< STAT-DEFS [NamedSetOfREAL] >>> ***/
+
+asn_TYPE_member_t asn_MBR_NamedSetOfREAL_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_REAL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "name"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_NamedSetOfREAL_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_NamedSetOfREAL_specs_1 = {
+ sizeof(struct NamedSetOfREAL),
+ offsetof(struct NamedSetOfREAL, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_NamedSetOfREAL = {
+ "NamedSetOfREAL",
+ "NamedSetOfREAL",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NamedSetOfREAL_tags_1,
+ sizeof(asn_DEF_NamedSetOfREAL_tags_1)
+ /sizeof(asn_DEF_NamedSetOfREAL_tags_1[0]), /* 1 */
+ asn_DEF_NamedSetOfREAL_tags_1, /* Same as above */
+ sizeof(asn_DEF_NamedSetOfREAL_tags_1)
+ /sizeof(asn_DEF_NamedSetOfREAL_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_NamedSetOfREAL_1,
+ 1, /* Single element */
+ &asn_SPC_NamedSetOfREAL_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NamedSetOfEnums] >>> ***/
+
+#include <ENUMERATED.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< DEPS [NamedSetOfEnums] >>> ***/
+
+typedef enum name {
+ name_one = 0,
+ name_oneMore = 1
+} e_name;
+
+/*** <<< TYPE-DECLS [NamedSetOfEnums] >>> ***/
+
+typedef struct NamedSetOfEnums {
+ A_SET_OF(ENUMERATED_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} NamedSetOfEnums_t;
+
+/*** <<< FUNC-DECLS [NamedSetOfEnums] >>> ***/
+
+/* extern asn_TYPE_descriptor_t asn_DEF_name_2; // (Use -fall-defs-global to expose) */
+extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfEnums;
+extern asn_SET_OF_specifics_t asn_SPC_NamedSetOfEnums_specs_1;
+extern asn_TYPE_member_t asn_MBR_NamedSetOfEnums_1[1];
+
+/*** <<< CODE [NamedSetOfEnums] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NamedSetOfEnums] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_name_value2enum_2[] = {
+ { 0, 3, "one" },
+ { 1, 7, "oneMore" }
+};
+static const unsigned int asn_MAP_name_enum2value_2[] = {
+ 0, /* one(0) */
+ 1 /* oneMore(1) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_name_specs_2 = {
+ asn_MAP_name_value2enum_2, /* "tag" => N; sorted by tag */
+ asn_MAP_name_enum2value_2, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_name_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_name_2 = {
+ "ENUMERATED",
+ "ENUMERATED",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_name_tags_2,
+ sizeof(asn_DEF_name_tags_2)
+ /sizeof(asn_DEF_name_tags_2[0]), /* 1 */
+ asn_DEF_name_tags_2, /* Same as above */
+ sizeof(asn_DEF_name_tags_2)
+ /sizeof(asn_DEF_name_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_name_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_NamedSetOfEnums_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_name_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "name"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_NamedSetOfEnums_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_NamedSetOfEnums_specs_1 = {
+ sizeof(struct NamedSetOfEnums),
+ offsetof(struct NamedSetOfEnums, _asn_ctx),
+ 1, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_NamedSetOfEnums = {
+ "NamedSetOfEnums",
+ "NamedSetOfEnums",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NamedSetOfEnums_tags_1,
+ sizeof(asn_DEF_NamedSetOfEnums_tags_1)
+ /sizeof(asn_DEF_NamedSetOfEnums_tags_1[0]), /* 1 */
+ asn_DEF_NamedSetOfEnums_tags_1, /* Same as above */
+ sizeof(asn_DEF_NamedSetOfEnums_tags_1)
+ /sizeof(asn_DEF_NamedSetOfEnums_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_NamedSetOfEnums_1,
+ 1, /* Single element */
+ &asn_SPC_NamedSetOfEnums_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SequenceOf] >>> ***/
+
+#include <INTEGER.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
+
+typedef struct SequenceOf {
+ A_SEQUENCE_OF(INTEGER_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SequenceOf_t;
+
+/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
+extern asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1;
+extern asn_TYPE_member_t asn_MBR_SequenceOf_1[1];
+
+/*** <<< STAT-DEFS [SequenceOf] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "id"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
+ sizeof(struct SequenceOf),
+ offsetof(struct SequenceOf, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
+ "SequenceOf",
+ "SequenceOf",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SequenceOf_tags_1,
+ sizeof(asn_DEF_SequenceOf_tags_1)
+ /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
+ asn_DEF_SequenceOf_tags_1, /* Same as above */
+ sizeof(asn_DEF_SequenceOf_tags_1)
+ /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SequenceOf_1,
+ 1, /* Single element */
+ &asn_SPC_SequenceOf_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SeqOfZuka] >>> ***/
+
+#include <NULL.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+/*** <<< TYPE-DECLS [SeqOfZuka] >>> ***/
+
+typedef struct SeqOfZuka {
+ A_SEQUENCE_OF(NULL_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SeqOfZuka_t;
+
+/*** <<< FUNC-DECLS [SeqOfZuka] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SeqOfZuka;
+extern asn_SET_OF_specifics_t asn_SPC_SeqOfZuka_specs_1;
+extern asn_TYPE_member_t asn_MBR_SeqOfZuka_1[1];
+
+/*** <<< STAT-DEFS [SeqOfZuka] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SeqOfZuka_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "zuka"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SeqOfZuka_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_SeqOfZuka_specs_1 = {
+ sizeof(struct SeqOfZuka),
+ offsetof(struct SeqOfZuka, _asn_ctx),
+ 1, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_SeqOfZuka = {
+ "SeqOfZuka",
+ "SeqOfZuka",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SeqOfZuka_tags_1,
+ sizeof(asn_DEF_SeqOfZuka_tags_1)
+ /sizeof(asn_DEF_SeqOfZuka_tags_1[0]), /* 1 */
+ asn_DEF_SeqOfZuka_tags_1, /* Same as above */
+ sizeof(asn_DEF_SeqOfZuka_tags_1)
+ /sizeof(asn_DEF_SeqOfZuka_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SeqOfZuka_1,
+ 1, /* Single element */
+ &asn_SPC_SeqOfZuka_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SetOfChoice] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< FWD-DECLS [SetOfChoice] >>> ***/
+
+struct SimpleChoice;
+
+/*** <<< TYPE-DECLS [SetOfChoice] >>> ***/
+
+typedef struct SetOfChoice {
+ A_SET_OF(struct SimpleChoice) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SetOfChoice_t;
+
+/*** <<< FUNC-DECLS [SetOfChoice] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SetOfChoice;
+extern asn_SET_OF_specifics_t asn_SPC_SetOfChoice_specs_1;
+extern asn_TYPE_member_t asn_MBR_SetOfChoice_1[1];
+
+/*** <<< POST-INCLUDE [SetOfChoice] >>> ***/
+
+#include "SimpleChoice.h"
+
+/*** <<< STAT-DEFS [SetOfChoice] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SetOfChoice_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_SimpleChoice,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SetOfChoice_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_SetOfChoice_specs_1 = {
+ sizeof(struct SetOfChoice),
+ offsetof(struct SetOfChoice, _asn_ctx),
+ 2, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_SetOfChoice = {
+ "SetOfChoice",
+ "SetOfChoice",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SetOfChoice_tags_1,
+ sizeof(asn_DEF_SetOfChoice_tags_1)
+ /sizeof(asn_DEF_SetOfChoice_tags_1[0]), /* 1 */
+ asn_DEF_SetOfChoice_tags_1, /* Same as above */
+ sizeof(asn_DEF_SetOfChoice_tags_1)
+ /sizeof(asn_DEF_SetOfChoice_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SetOfChoice_1,
+ 1, /* Single element */
+ &asn_SPC_SetOfChoice_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NamedSetOfChoice] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+
+/*** <<< FWD-DECLS [NamedSetOfChoice] >>> ***/
+
+struct SimpleChoice;
+
+/*** <<< TYPE-DECLS [NamedSetOfChoice] >>> ***/
+
+typedef struct NamedSetOfChoice {
+ A_SET_OF(struct SimpleChoice) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} NamedSetOfChoice_t;
+
+/*** <<< FUNC-DECLS [NamedSetOfChoice] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NamedSetOfChoice;
+extern asn_SET_OF_specifics_t asn_SPC_NamedSetOfChoice_specs_1;
+extern asn_TYPE_member_t asn_MBR_NamedSetOfChoice_1[1];
+
+/*** <<< POST-INCLUDE [NamedSetOfChoice] >>> ***/
+
+#include "SimpleChoice.h"
+
+/*** <<< STAT-DEFS [NamedSetOfChoice] >>> ***/
+
+asn_TYPE_member_t asn_MBR_NamedSetOfChoice_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_SimpleChoice,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "whatever"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_NamedSetOfChoice_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_NamedSetOfChoice_specs_1 = {
+ sizeof(struct NamedSetOfChoice),
+ offsetof(struct NamedSetOfChoice, _asn_ctx),
+ 2, /* XER encoding is XMLValueList */
+};
+asn_TYPE_descriptor_t asn_DEF_NamedSetOfChoice = {
+ "NamedSetOfChoice",
+ "NamedSetOfChoice",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NamedSetOfChoice_tags_1,
+ sizeof(asn_DEF_NamedSetOfChoice_tags_1)
+ /sizeof(asn_DEF_NamedSetOfChoice_tags_1[0]), /* 1 */
+ asn_DEF_NamedSetOfChoice_tags_1, /* Same as above */
+ sizeof(asn_DEF_NamedSetOfChoice_tags_1)
+ /sizeof(asn_DEF_NamedSetOfChoice_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_NamedSetOfChoice_1,
+ 1, /* Single element */
+ &asn_SPC_NamedSetOfChoice_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SimpleChoice] >>> ***/
+
+#include <NULL.h>
+#include <INTEGER.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [SimpleChoice] >>> ***/
+
+typedef enum SimpleChoice_PR {
+ SimpleChoice_PR_NOTHING, /* No components present */
+ SimpleChoice_PR_a,
+ SimpleChoice_PR_b
+} SimpleChoice_PR;
+
+/*** <<< TYPE-DECLS [SimpleChoice] >>> ***/
+
+typedef struct SimpleChoice {
+ SimpleChoice_PR present;
+ union SimpleChoice_u {
+ NULL_t a;
+ INTEGER_t b;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SimpleChoice_t;
+
+/*** <<< FUNC-DECLS [SimpleChoice] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SimpleChoice;
+extern asn_CHOICE_specifics_t asn_SPC_SimpleChoice_specs_1;
+extern asn_TYPE_member_t asn_MBR_SimpleChoice_1[2];
+
+/*** <<< STAT-DEFS [SimpleChoice] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SimpleChoice_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SimpleChoice, choice.a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct SimpleChoice, choice.b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_SimpleChoice_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* b */
+};
+asn_CHOICE_specifics_t asn_SPC_SimpleChoice_specs_1 = {
+ sizeof(struct SimpleChoice),
+ offsetof(struct SimpleChoice, _asn_ctx),
+ offsetof(struct SimpleChoice, present),
+ sizeof(((struct SimpleChoice *)0)->present),
+ asn_MAP_SimpleChoice_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_SimpleChoice = {
+ "SimpleChoice",
+ "SimpleChoice",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SimpleChoice_1,
+ 2, /* Elements count */
+ &asn_SPC_SimpleChoice_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/71-duplicate-types-SE.asn1 b/tests/tests-asn1c-compiler/71-duplicate-types-SE.asn1
new file mode 100644
index 0000000..64d340e
--- /dev/null
+++ b/tests/tests-asn1c-compiler/71-duplicate-types-SE.asn1
@@ -0,0 +1,27 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .71 1
+-- .71 2
+
+ModuleDuplicateTypes1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 71 1 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type ::= INTEGER -- Original type.
+
+END
+
+ModuleDuplicateTypes2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 71 2 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type ::= INTEGER -- A duplicate type.
+
+END
diff --git a/tests/tests-asn1c-compiler/72-same-names-OK.asn1 b/tests/tests-asn1c-compiler/72-same-names-OK.asn1
new file mode 100644
index 0000000..8d89dac
--- /dev/null
+++ b/tests/tests-asn1c-compiler/72-same-names-OK.asn1
@@ -0,0 +1,46 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .72
+
+ModuleTestSameNames
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 72 }
+ DEFINITIONS ::=
+BEGIN
+
+ /*
+ * This test checks whether different top-level types containing
+ * similarly named inner types may be compiled by the target language
+ * compiler successfully. This was not the case before asn1c-0.9.11.
+ */
+
+ Type ::= SET OF SEQUENCE {
+ t1 Type1,
+ t2 Type2
+ }
+
+ Type1 ::= SEQUENCE {
+ one-name CHOICE {
+ another-name SEQUENCE { a INTEGER, b INTEGER }
+ }
+ }
+
+ Type2 ::= CHOICE {
+ one-name SEQUENCE {
+ another-name SEQUENCE {
+ a BIT STRING { one(0) } SIZE(2),
+ b INTEGER
+ }
+ },
+ two-name SET {
+ another-name SEQUENCE {
+ a BIT STRING { one(0) } SIZE(2),
+ b INTEGER
+ }
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/72-same-names-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/72-same-names-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..03948a1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/72-same-names-OK.asn1.-Pfwide-types
@@ -0,0 +1,830 @@
+
+/*** <<< INCLUDES [Type] >>> ***/
+
+#include <asn_SET_OF.h>
+#include "Type1.h"
+#include "Type2.h"
+#include <constr_SEQUENCE.h>
+#include <constr_SET_OF.h>
+
+/*** <<< FWD-DEFS [Type] >>> ***/
+
+typedef struct Member {
+ Type1_t t1;
+ Type2_t t2;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Member;
+
+/*** <<< TYPE-DECLS [Type] >>> ***/
+
+typedef struct Type {
+ A_SET_OF(Member) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Type_t;
+
+/*** <<< FUNC-DECLS [Type] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Type;
+
+/*** <<< STAT-DEFS [Type] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Member_2[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Member, t1),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Type1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Member, t2),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_Type2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "t2"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Member_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* t1 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 }, /* one-name */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = {
+ sizeof(struct Member),
+ offsetof(struct Member, _asn_ctx),
+ asn_MAP_Member_tag2el_2,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_Member_2 = {
+ "SEQUENCE",
+ "SEQUENCE",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Member_tags_2,
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ asn_DEF_Member_tags_2, /* Same as above */
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Member_2,
+ 2, /* Elements count */
+ &asn_SPC_Member_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_Type_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Member_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_Type_specs_1 = {
+ sizeof(struct Type),
+ offsetof(struct Type, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Type = {
+ "Type",
+ "Type",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Type_tags_1,
+ sizeof(asn_DEF_Type_tags_1)
+ /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
+ asn_DEF_Type_tags_1, /* Same as above */
+ sizeof(asn_DEF_Type_tags_1)
+ /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Type_1,
+ 1, /* Single element */
+ &asn_SPC_Type_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Type1] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Type1] >>> ***/
+
+typedef enum one_name_PR {
+ one_name_PR_NOTHING, /* No components present */
+ one_name_PR_another_name
+} one_name_PR;
+
+/*** <<< TYPE-DECLS [Type1] >>> ***/
+
+typedef struct Type1 {
+ struct one_name {
+ one_name_PR present;
+ union Type1__one_name_u {
+ struct another_name {
+ INTEGER_t a;
+ INTEGER_t b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } another_name;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } one_name;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Type1_t;
+
+/*** <<< FUNC-DECLS [Type1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Type1;
+extern asn_SEQUENCE_specifics_t asn_SPC_Type1_specs_1;
+extern asn_TYPE_member_t asn_MBR_Type1_1[1];
+
+/*** <<< STAT-DEFS [Type1] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_another_name_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct another_name, a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct another_name, b),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_another_name_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* a */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* b */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = {
+ sizeof(struct another_name),
+ offsetof(struct another_name, _asn_ctx),
+ asn_MAP_another_name_tag2el_3,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_another_name_3 = {
+ "another-name",
+ "another-name",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_another_name_tags_3,
+ sizeof(asn_DEF_another_name_tags_3)
+ /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
+ asn_DEF_another_name_tags_3, /* Same as above */
+ sizeof(asn_DEF_another_name_tags_3)
+ /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_another_name_3,
+ 2, /* Elements count */
+ &asn_SPC_another_name_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_one_name_2[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct one_name, choice.another_name),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_another_name_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "another-name"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
+};
+static asn_CHOICE_specifics_t asn_SPC_one_name_specs_2 = {
+ sizeof(struct one_name),
+ offsetof(struct one_name, _asn_ctx),
+ offsetof(struct one_name, present),
+ sizeof(((struct one_name *)0)->present),
+ asn_MAP_one_name_tag2el_2,
+ 1, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_one_name_2 = {
+ "one-name",
+ "one-name",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_one_name_2,
+ 1, /* Elements count */
+ &asn_SPC_one_name_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Type1_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Type1, one_name),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_one_name_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "one-name"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Type1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Type1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Type1_specs_1 = {
+ sizeof(struct Type1),
+ offsetof(struct Type1, _asn_ctx),
+ asn_MAP_Type1_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Type1 = {
+ "Type1",
+ "Type1",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Type1_tags_1,
+ sizeof(asn_DEF_Type1_tags_1)
+ /sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */
+ asn_DEF_Type1_tags_1, /* Same as above */
+ sizeof(asn_DEF_Type1_tags_1)
+ /sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Type1_1,
+ 1, /* Elements count */
+ &asn_SPC_Type1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Type2] >>> ***/
+
+#include <BIT_STRING.h>
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+#include <constr_SET.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Type2] >>> ***/
+
+typedef enum Type2_PR {
+ Type2_PR_NOTHING, /* No components present */
+ Type2_PR_one_name,
+ Type2_PR_two_name
+} Type2_PR;
+typedef enum a {
+ a_one = 0
+} e_a;
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum two_name_PR {
+ two_name_PR_another_name, /* Member another_name is present */
+} two_name_PR;
+typedef enum a {
+ a_one = 0
+} e_a;
+
+/*** <<< TYPE-DECLS [Type2] >>> ***/
+
+typedef struct Type2 {
+ Type2_PR present;
+ union Type2_u {
+ struct one_name {
+ struct another_name {
+ BIT_STRING_t a;
+ INTEGER_t b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } another_name;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } one_name;
+ struct two_name {
+ struct another_name {
+ BIT_STRING_t a;
+ INTEGER_t b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } another_name;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(ptwo_name, two_name_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } two_name;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Type2_t;
+
+/*** <<< FUNC-DECLS [Type2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Type2;
+extern asn_CHOICE_specifics_t asn_SPC_Type2_specs_1;
+extern asn_TYPE_member_t asn_MBR_Type2_1[2];
+
+/*** <<< CODE [Type2] >>> ***/
+
+static int
+memb_a_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(st->size > 0) {
+ /* Size in bits */
+ size = 8 * st->size - (st->bits_unused & 0x07);
+ } else {
+ size = 0;
+ }
+
+ if((size == 2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_a_constraint_8(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+ size_t size;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(st->size > 0) {
+ /* Size in bits */
+ size = 8 * st->size - (st->bits_unused & 0x07);
+ } else {
+ size = 0;
+ }
+
+ if((size == 2)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [Type2] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_another_name_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct another_name, a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = memb_a_constraint_3,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct another_name, b),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_another_name_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = {
+ sizeof(struct another_name),
+ offsetof(struct another_name, _asn_ctx),
+ asn_MAP_another_name_tag2el_3,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_another_name_3 = {
+ "another-name",
+ "another-name",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_another_name_tags_3,
+ sizeof(asn_DEF_another_name_tags_3)
+ /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
+ asn_DEF_another_name_tags_3, /* Same as above */
+ sizeof(asn_DEF_another_name_tags_3)
+ /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_another_name_3,
+ 2, /* Elements count */
+ &asn_SPC_another_name_specs_3 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_one_name_2[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct one_name, another_name),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_another_name_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "another-name"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_one_name_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_one_name_specs_2 = {
+ sizeof(struct one_name),
+ offsetof(struct one_name, _asn_ctx),
+ asn_MAP_one_name_tag2el_2,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_one_name_2 = {
+ "one-name",
+ "one-name",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_one_name_tags_2,
+ sizeof(asn_DEF_one_name_tags_2)
+ /sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */
+ asn_DEF_one_name_tags_2, /* Same as above */
+ sizeof(asn_DEF_one_name_tags_2)
+ /sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_one_name_2,
+ 1, /* Elements count */
+ &asn_SPC_one_name_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_another_name_8[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct another_name, a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = memb_a_constraint_8,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct another_name, b),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_another_name_tags_8[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_8[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_8 = {
+ sizeof(struct another_name),
+ offsetof(struct another_name, _asn_ctx),
+ asn_MAP_another_name_tag2el_8,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_another_name_8 = {
+ "another-name",
+ "another-name",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_another_name_tags_8,
+ sizeof(asn_DEF_another_name_tags_8)
+ /sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */
+ asn_DEF_another_name_tags_8, /* Same as above */
+ sizeof(asn_DEF_another_name_tags_8)
+ /sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_another_name_8,
+ 2, /* Elements count */
+ &asn_SPC_another_name_specs_8 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_two_name_7[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct two_name, another_name),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_another_name_8,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "another-name"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_two_name_tags_7[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_two_name_tag2el_7[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
+};
+static const uint8_t asn_MAP_two_name_mmap_7[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+static
+asn_SET_specifics_t asn_SPC_two_name_specs_7 = {
+ sizeof(struct two_name),
+ offsetof(struct two_name, _asn_ctx),
+ offsetof(struct two_name, _presence_map),
+ asn_MAP_two_name_tag2el_7,
+ 1, /* Count of tags in the map */
+ asn_MAP_two_name_tag2el_7, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_two_name_mmap_7 /* Mandatory elements map */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_two_name_7 = {
+ "two-name",
+ "two-name",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_two_name_tags_7,
+ sizeof(asn_DEF_two_name_tags_7)
+ /sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */
+ asn_DEF_two_name_tags_7, /* Same as above */
+ sizeof(asn_DEF_two_name_tags_7)
+ /sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_two_name_7,
+ 1, /* Elements count */
+ &asn_SPC_two_name_specs_7 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Type2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.one_name),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_one_name_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "one-name"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.two_name),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_two_name_7,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "two-name"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Type2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* one-name */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name */
+};
+asn_CHOICE_specifics_t asn_SPC_Type2_specs_1 = {
+ sizeof(struct Type2),
+ offsetof(struct Type2, _asn_ctx),
+ offsetof(struct Type2, present),
+ sizeof(((struct Type2 *)0)->present),
+ asn_MAP_Type2_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Type2 = {
+ "Type2",
+ "Type2",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Type2_1,
+ 2, /* Elements count */
+ &asn_SPC_Type2_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/73-circular-OK.asn1 b/tests/tests-asn1c-compiler/73-circular-OK.asn1
new file mode 100644
index 0000000..c4d1ea5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/73-circular-OK.asn1
@@ -0,0 +1,36 @@
+
+-- OK: Everything is Fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .73
+
+ModuleTestCircularReferences
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 73 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type ::= SEQUENCE {
+ data SEQUENCE OF EpytRef
+ }
+
+ EpytRef ::= Epyt
+
+ Epyt ::= SEQUENCE {
+ stype SET OF Type,
+ type Type OPTIONAL,
+ ypet Ypet OPTIONAL
+ }
+
+ Ypet ::= SET {
+ epyt Epyt,
+ plain INTEGER DEFAULT 7,
+ senums SET OF EnumType,
+ patest1 [1] IA5String (FROM("A".."Z")),
+ patest2 [2] IA5String (FROM("a".."z"))
+ }
+
+ EnumType ::= ENUMERATED { one, two }
+
+END
diff --git a/tests/tests-asn1c-compiler/73-circular-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/73-circular-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..544c482
--- /dev/null
+++ b/tests/tests-asn1c-compiler/73-circular-OK.asn1.-Pfwide-types
@@ -0,0 +1,771 @@
+
+/*** <<< INCLUDES [Type] >>> ***/
+
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Type] >>> ***/
+
+struct Epyt;
+
+/*** <<< TYPE-DECLS [Type] >>> ***/
+
+typedef struct Type {
+ struct data {
+ A_SEQUENCE_OF(struct Epyt) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } data;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Type_t;
+
+/*** <<< FUNC-DECLS [Type] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Type;
+extern asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1;
+extern asn_TYPE_member_t asn_MBR_Type_1[1];
+
+/*** <<< POST-INCLUDE [Type] >>> ***/
+
+#include "EpytRef.h"
+
+/*** <<< STAT-DEFS [Type] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_data_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_EpytRef,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_data_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = {
+ sizeof(struct data),
+ offsetof(struct data, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_data_2 = {
+ "data",
+ "data",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_data_tags_2,
+ sizeof(asn_DEF_data_tags_2)
+ /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
+ asn_DEF_data_tags_2, /* Same as above */
+ sizeof(asn_DEF_data_tags_2)
+ /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_data_2,
+ 1, /* Single element */
+ &asn_SPC_data_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Type_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Type, data),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_data_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "data"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = {
+ sizeof(struct Type),
+ offsetof(struct Type, _asn_ctx),
+ asn_MAP_Type_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Type = {
+ "Type",
+ "Type",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Type_tags_1,
+ sizeof(asn_DEF_Type_tags_1)
+ /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
+ asn_DEF_Type_tags_1, /* Same as above */
+ sizeof(asn_DEF_Type_tags_1)
+ /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Type_1,
+ 1, /* Elements count */
+ &asn_SPC_Type_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [EpytRef] >>> ***/
+
+#include "Epyt.h"
+
+/*** <<< TYPE-DECLS [EpytRef] >>> ***/
+
+typedef Epyt_t EpytRef_t;
+
+/*** <<< FUNC-DECLS [EpytRef] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
+asn_struct_free_f EpytRef_free;
+asn_struct_print_f EpytRef_print;
+asn_constr_check_f EpytRef_constraint;
+ber_type_decoder_f EpytRef_decode_ber;
+der_type_encoder_f EpytRef_encode_der;
+xer_type_decoder_f EpytRef_decode_xer;
+xer_type_encoder_f EpytRef_encode_xer;
+
+/*** <<< CODE [EpytRef] >>> ***/
+
+/*
+ * This type is implemented using Epyt,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [EpytRef] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_EpytRef = {
+ "EpytRef",
+ "EpytRef",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_EpytRef_tags_1,
+ sizeof(asn_DEF_EpytRef_tags_1)
+ /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
+ asn_DEF_EpytRef_tags_1, /* Same as above */
+ sizeof(asn_DEF_EpytRef_tags_1)
+ /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Epyt_1,
+ 3, /* Elements count */
+ &asn_SPC_Epyt_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Epyt] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Epyt] >>> ***/
+
+struct Type;
+struct Ypet;
+
+/*** <<< TYPE-DECLS [Epyt] >>> ***/
+
+typedef struct Epyt {
+ struct stype {
+ A_SET_OF(struct Type) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } stype;
+ struct Type *type /* OPTIONAL */;
+ struct Ypet *ypet /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Epyt_t;
+
+/*** <<< FUNC-DECLS [Epyt] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Epyt;
+extern asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1;
+extern asn_TYPE_member_t asn_MBR_Epyt_1[3];
+
+/*** <<< POST-INCLUDE [Epyt] >>> ***/
+
+#include "Type.h"
+#include "Ypet.h"
+
+/*** <<< STAT-DEFS [Epyt] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_stype_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Type,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_stype_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = {
+ sizeof(struct stype),
+ offsetof(struct stype, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_stype_2 = {
+ "stype",
+ "stype",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_stype_tags_2,
+ sizeof(asn_DEF_stype_tags_2)
+ /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
+ asn_DEF_stype_tags_2, /* Same as above */
+ sizeof(asn_DEF_stype_tags_2)
+ /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_stype_2,
+ 1, /* Single element */
+ &asn_SPC_stype_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Epyt_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_stype_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "stype"
+ },
+ { ATF_POINTER, 2, offsetof(struct Epyt, type),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Type,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "type"
+ },
+ { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Ypet,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ypet"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = {
+ sizeof(struct Epyt),
+ offsetof(struct Epyt, _asn_ctx),
+ asn_MAP_Epyt_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Epyt = {
+ "Epyt",
+ "Epyt",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Epyt_tags_1,
+ sizeof(asn_DEF_Epyt_tags_1)
+ /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
+ asn_DEF_Epyt_tags_1, /* Same as above */
+ sizeof(asn_DEF_Epyt_tags_1)
+ /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Epyt_1,
+ 3, /* Elements count */
+ &asn_SPC_Epyt_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Ypet] >>> ***/
+
+#include <INTEGER.h>
+#include <IA5String.h>
+#include "EnumType.h"
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [Ypet] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum Ypet_PR {
+ Ypet_PR_epyt, /* Member epyt is present */
+ Ypet_PR_plain, /* Member plain is present */
+ Ypet_PR_senums, /* Member senums is present */
+ Ypet_PR_patest1, /* Member patest1 is present */
+ Ypet_PR_patest2, /* Member patest2 is present */
+} Ypet_PR;
+
+/*** <<< FWD-DECLS [Ypet] >>> ***/
+
+struct Epyt;
+
+/*** <<< TYPE-DECLS [Ypet] >>> ***/
+
+typedef struct Ypet {
+ struct Epyt *epyt;
+ INTEGER_t *plain /* DEFAULT 7 */;
+ struct senums {
+ A_SET_OF(EnumType_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } senums;
+ IA5String_t patest1;
+ IA5String_t patest2;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
+ unsigned int _presence_map
+ [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Ypet_t;
+
+/*** <<< FUNC-DECLS [Ypet] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Ypet;
+extern asn_SET_specifics_t asn_SPC_Ypet_specs_1;
+extern asn_TYPE_member_t asn_MBR_Ypet_1[5];
+
+/*** <<< POST-INCLUDE [Ypet] >>> ***/
+
+#include "Epyt.h"
+
+/*** <<< CTABLES [Ypet] >>> ***/
+
+static int check_permitted_alphabet_6(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 65 && cv <= 90)) return -1;
+ }
+ return 0;
+}
+
+static int check_permitted_alphabet_7(const void *sptr) {
+ /* The underlying type is IA5String */
+ const IA5String_t *st = (const IA5String_t *)sptr;
+ const uint8_t *ch = st->buf;
+ const uint8_t *end = ch + st->size;
+
+ for(; ch < end; ch++) {
+ uint8_t cv = *ch;
+ if(!(cv >= 97 && cv <= 122)) return -1;
+ }
+ return 0;
+}
+
+
+/*** <<< CODE [Ypet] >>> ***/
+
+static int
+memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_6(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const IA5String_t *st = (const IA5String_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(!check_permitted_alphabet_7(st)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [Ypet] >>> ***/
+
+static int asn_DFL_3_set_7(int set_value, void **sptr) {
+ INTEGER_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 7 */
+ return asn_long2INTEGER(st, 7);
+ } else {
+ /* Test default value 7 */
+ long value;
+ if(asn_INTEGER2long(st, &value))
+ return -1;
+ return (value == 7);
+ }
+}
+static asn_TYPE_member_t asn_MBR_senums_4[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_EnumType,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_senums_tags_4[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = {
+ sizeof(struct senums),
+ offsetof(struct senums, _asn_ctx),
+ 1, /* XER encoding is XMLValueList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_senums_4 = {
+ "senums",
+ "senums",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_senums_tags_4,
+ sizeof(asn_DEF_senums_tags_4)
+ /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
+ asn_DEF_senums_tags_4, /* Same as above */
+ sizeof(asn_DEF_senums_tags_4)
+ /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_senums_4,
+ 1, /* Single element */
+ &asn_SPC_senums_specs_4 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Ypet_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Epyt,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "epyt"
+ },
+ { ATF_POINTER, 1, offsetof(struct Ypet, plain),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */
+ .name = "plain"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_senums_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "senums"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = memb_patest1_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "patest1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = memb_patest2_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "patest2"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 */
+};
+static const uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
+};
+asn_SET_specifics_t asn_SPC_Ypet_specs_1 = {
+ sizeof(struct Ypet),
+ offsetof(struct Ypet, _asn_ctx),
+ offsetof(struct Ypet, _presence_map),
+ asn_MAP_Ypet_tag2el_1,
+ 5, /* Count of tags in the map */
+ asn_MAP_Ypet_tag2el_1, /* Same as above */
+ 5, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_Ypet = {
+ "Ypet",
+ "Ypet",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Ypet_tags_1,
+ sizeof(asn_DEF_Ypet_tags_1)
+ /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
+ asn_DEF_Ypet_tags_1, /* Same as above */
+ sizeof(asn_DEF_Ypet_tags_1)
+ /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Ypet_1,
+ 5, /* Elements count */
+ &asn_SPC_Ypet_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [EnumType] >>> ***/
+
+#include <ENUMERATED.h>
+
+/*** <<< DEPS [EnumType] >>> ***/
+
+typedef enum EnumType {
+ EnumType_one = 0,
+ EnumType_two = 1
+} e_EnumType;
+
+/*** <<< TYPE-DECLS [EnumType] >>> ***/
+
+typedef ENUMERATED_t EnumType_t;
+
+/*** <<< FUNC-DECLS [EnumType] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_EnumType;
+extern asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1;
+asn_struct_free_f EnumType_free;
+asn_struct_print_f EnumType_print;
+asn_constr_check_f EnumType_constraint;
+ber_type_decoder_f EnumType_decode_ber;
+der_type_encoder_f EnumType_encode_der;
+xer_type_decoder_f EnumType_decode_xer;
+xer_type_encoder_f EnumType_encode_xer;
+
+/*** <<< CODE [EnumType] >>> ***/
+
+/*
+ * This type is implemented using ENUMERATED,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [EnumType] >>> ***/
+
+static const asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = {
+ { 0, 3, "one" },
+ { 1, 3, "two" }
+};
+static const unsigned int asn_MAP_EnumType_enum2value_1[] = {
+ 0, /* one(0) */
+ 1 /* two(1) */
+};
+const asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = {
+ asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */
+ asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */
+ 2, /* Number of elements in the maps */
+ 0, /* Enumeration is not extensible */
+ 1, /* Strict enumeration */
+ 0, /* Native long size */
+ 0
+};
+static const ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_EnumType = {
+ "EnumType",
+ "EnumType",
+ ENUMERATED_free,
+ ENUMERATED_print,
+ ENUMERATED_compare,
+ ENUMERATED_constraint,
+ ENUMERATED_decode_ber,
+ ENUMERATED_encode_der,
+ ENUMERATED_decode_xer,
+ ENUMERATED_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_EnumType_tags_1,
+ sizeof(asn_DEF_EnumType_tags_1)
+ /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
+ asn_DEF_EnumType_tags_1, /* Same as above */
+ sizeof(asn_DEF_EnumType_tags_1)
+ /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ &asn_SPC_EnumType_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/74-int-enum-constraints-OK.asn1 b/tests/tests-asn1c-compiler/74-int-enum-constraints-OK.asn1
new file mode 100644
index 0000000..9697788
--- /dev/null
+++ b/tests/tests-asn1c-compiler/74-int-enum-constraints-OK.asn1
@@ -0,0 +1,22 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .74
+
+ModuleTestIntegerAndEnumeratedConstraints
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 74 }
+ DEFINITIONS ::=
+BEGIN
+
+ -- Enumeration constrained by the second choice.
+ Enum ::= ENUMERATED { one, two } (two|one)
+
+ -- Integer constrained by the only choice.
+ Int ::= INTEGER { v1-0(123) } (v1-0)
+
+ EnumRef ::= Enum (two)
+
+END
diff --git a/tests/tests-asn1c-compiler/74-int-enum-constraints-OK.asn1.-EFprint-constraints b/tests/tests-asn1c-compiler/74-int-enum-constraints-OK.asn1.-EFprint-constraints
new file mode 100644
index 0000000..22175a1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/74-int-enum-constraints-OK.asn1.-EFprint-constraints
@@ -0,0 +1,42 @@
+ModuleTestIntegerAndEnumeratedConstraints { iso org(3) dod(6) internet(1)
+ private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1)
+ 74 }
+DEFINITIONS ::=
+BEGIN
+
+Enum ::= ENUMERATED {
+ one(0)
+-- Practical constraints (one):
+-- OER-visible constraints (one):
+-- PER-visible constraints (one):
+,
+ two(1)
+-- Practical constraints (two):
+-- OER-visible constraints (two):
+-- PER-visible constraints (two):
+
+} (1 | 0)
+-- Combined constraints: (1 | 0)
+-- Practical constraints (Enum): (0..1)
+-- OER-visible constraints (Enum): (0..1)
+-- PER-visible constraints (Enum): (0..1)
+
+Int ::= INTEGER {
+ v1-0(123)
+-- Practical constraints (v1-0):
+-- OER-visible constraints (v1-0):
+-- PER-visible constraints (v1-0):
+
+} (123)
+-- Combined constraints: (123)
+-- Practical constraints (Int): (123)
+-- OER-visible constraints (Int): (123)
+-- PER-visible constraints (Int): (123)
+
+EnumRef ::= Enum (1)
+-- Combined constraints: (1 | 0)(1)
+-- Practical constraints (Enum): (1)
+-- OER-visible constraints (Enum): (1)
+-- PER-visible constraints (Enum): (1)
+
+END
diff --git a/tests/tests-asn1c-compiler/75-duplicate-modules-SE.asn1 b/tests/tests-asn1c-compiler/75-duplicate-modules-SE.asn1
new file mode 100644
index 0000000..a17189f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/75-duplicate-modules-SE.asn1
@@ -0,0 +1,23 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .75 1
+-- .75 1
+
+ModuleDuplicateModuleName
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 75 1 }
+ DEFINITIONS ::=
+BEGIN
+
+END
+
+ModuleDuplicateModuleName
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 75 1 }
+ DEFINITIONS ::=
+BEGIN
+
+END
diff --git a/tests/tests-asn1c-compiler/76-duplicate-modules-SW.asn1 b/tests/tests-asn1c-compiler/76-duplicate-modules-SW.asn1
new file mode 100644
index 0000000..d7d254b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/76-duplicate-modules-SW.asn1
@@ -0,0 +1,23 @@
+
+-- SW: Semantically suspicious
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .76 1
+-- .76 2
+
+ModuleDuplicateModuleName
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 76 1 }
+ DEFINITIONS ::=
+BEGIN
+
+END
+
+ModuleDuplicateModuleName
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 76 2 }
+ DEFINITIONS ::=
+BEGIN
+
+END
diff --git a/tests/tests-asn1c-compiler/77-str-default-OK.asn1 b/tests/tests-asn1c-compiler/77-str-default-OK.asn1
new file mode 100644
index 0000000..64c9137
--- /dev/null
+++ b/tests/tests-asn1c-compiler/77-str-default-OK.asn1
@@ -0,0 +1,26 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .77
+
+ModuleTestStringDefault1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 77 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ Type ::= SEQUENCE {
+ cntry PRString DEFAULT country1,
+ cntry1 PrintableString DEFAULT country1,
+ cntry2 UniversalString DEFAULT country2,
+ ...
+ }
+
+ country1 PrintableString ::= "Rwanda"
+ country2 PRString ::= "United Kingdom"
+
+ PRString ::= PrintableString
+
+END
diff --git a/tests/tests-asn1c-compiler/78-str-default-SE.asn1 b/tests/tests-asn1c-compiler/78-str-default-SE.asn1
new file mode 100644
index 0000000..787d61f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/78-str-default-SE.asn1
@@ -0,0 +1,21 @@
+
+-- SE: Semantic error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .78
+
+ModuleTestStringDefault2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 78 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ Type ::= SEQUENCE {
+ country UTF8String DEFAULT country1,
+ ...
+ }
+
+ country1 GeneralString ::= "Cyprus"
+
+END
diff --git a/tests/tests-asn1c-compiler/79-constrained-by-OK.asn1 b/tests/tests-asn1c-compiler/79-constrained-by-OK.asn1
new file mode 100644
index 0000000..abbcae5
--- /dev/null
+++ b/tests/tests-asn1c-compiler/79-constrained-by-OK.asn1
@@ -0,0 +1,19 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .79
+
+ModuleTestConstrainedBy
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 79 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type ::= SEQUENCE {
+ int INTEGER,
+ ...
+ } (CONSTRAINED BY { -- nothing -- })
+
+END
diff --git a/tests/tests-asn1c-compiler/79-constrained-by-OK.asn1.-EF b/tests/tests-asn1c-compiler/79-constrained-by-OK.asn1.-EF
new file mode 100644
index 0000000..f462be0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/79-constrained-by-OK.asn1.-EF
@@ -0,0 +1,11 @@
+ModuleTestConstrainedBy { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 79 }
+DEFINITIONS ::=
+BEGIN
+
+Type ::= SEQUENCE {
+ int INTEGER,
+ ...
+} (CONSTRAINED BY { -- nothing -- })
+
+END
diff --git a/tests/tests-asn1c-compiler/80-chardefs-OK.asn1 b/tests/tests-asn1c-compiler/80-chardefs-OK.asn1
new file mode 100644
index 0000000..52b0eda
--- /dev/null
+++ b/tests/tests-asn1c-compiler/80-chardefs-OK.asn1
@@ -0,0 +1,25 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .80
+
+ModuleCharacterDefinitions
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 80 }
+ DEFINITIONS ::=
+BEGIN
+ -- Elements taken from ASN1-CHARACTER-MODULE (X.680:07/2002)
+ -- { joint-iso-itu-t asn1(1) specification(0) modules(0) iso10646(0) }
+ nul IA5String ::= {0, 0}
+ null BMPString ::= {0, 0, 0, 0}
+ space BMPString ::= {0, 0, 0, 32}
+ tilde BMPString ::= {0, 0, 0, 126}
+
+ BasicLatin ::= BMPString(FROM (space..tilde))
+ BasicGreek ::= BMPString(FROM ({0, 0, 3, 112}..{0, 0, 3, 207}))
+
+ NotSpace ::= BMPString (FROM(ALL EXCEPT space))
+
+END
diff --git a/tests/tests-asn1c-compiler/81-type-default-OK.asn1 b/tests/tests-asn1c-compiler/81-type-default-OK.asn1
new file mode 100644
index 0000000..e1fe6a1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/81-type-default-OK.asn1
@@ -0,0 +1,20 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .81
+
+ModuleTestTypeDefault1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 81 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type ::= SEQUENCE {
+ other SEQUENCE {
+ member-1 INTEGER
+ } DEFAULT { member-1 5 }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/82-with-comps-OK.asn1 b/tests/tests-asn1c-compiler/82-with-comps-OK.asn1
new file mode 100644
index 0000000..adb44e0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/82-with-comps-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .82
+
+ModuleTestWithComponents
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 82 }
+ DEFINITIONS ::=
+BEGIN
+
+ BunchOfStrings ::= SEQUENCE OF VisibleString
+ Address ::= BunchOfStrings (SIZE (1..6)) (WITH COMPONENT (SIZE (1..32)))
+
+ Type ::= SEQUENCE {
+ one INTEGER DEFAULT 1
+ } (WITH COMPONENTS { ..., one (1) PRESENT })
+
+END
diff --git a/tests/tests-asn1c-compiler/82-with-comps-OK.asn1.-EF b/tests/tests-asn1c-compiler/82-with-comps-OK.asn1.-EF
new file mode 100644
index 0000000..f4fe9aa
--- /dev/null
+++ b/tests/tests-asn1c-compiler/82-with-comps-OK.asn1.-EF
@@ -0,0 +1,14 @@
+ModuleTestWithComponents { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 82 }
+DEFINITIONS ::=
+BEGIN
+
+BunchOfStrings ::= SEQUENCE OF VisibleString
+
+Address ::= BunchOfStrings (SIZE(1..6))(WITH COMPONENT (SIZE(1..32)))
+
+Type ::= SEQUENCE {
+ one INTEGER DEFAULT 1
+} (WITH COMPONENTS { ..., one (1) PRESENT })
+
+END
diff --git a/tests/tests-asn1c-compiler/83-with-comps-OK.asn1 b/tests/tests-asn1c-compiler/83-with-comps-OK.asn1
new file mode 100644
index 0000000..7202c5c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/83-with-comps-OK.asn1
@@ -0,0 +1,20 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .83
+
+ModuleTestWithComponents2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 83 }
+ DEFINITIONS ::=
+BEGIN
+
+ Type1 ::= SET {}
+
+ Type2 ::= SET {
+ COMPONENTS OF Type1 (WITH COMPONENTS { ... })
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/84-param-tags-OK.asn1 b/tests/tests-asn1c-compiler/84-param-tags-OK.asn1
new file mode 100644
index 0000000..cddf846
--- /dev/null
+++ b/tests/tests-asn1c-compiler/84-param-tags-OK.asn1
@@ -0,0 +1,41 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .84 1
+-- .84 2
+
+ModuleTestParameterizationTags1
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 84 1 }
+ DEFINITIONS ::=
+BEGIN
+
+ TestType {Parameter} ::= SEQUENCE {
+ common Parameter DEFAULT 0
+ }
+
+ TestChoice ::= CHOICE {
+ type1 TestType {INTEGER (1..10)},
+ type2 [0] IMPLICIT TestType {BOOLEAN}
+ }
+
+END
+
+ModuleTestParameterizationTagsAuto2
+ { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 84 2 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ AutoType {Parameter} ::= SEQUENCE {
+ common Parameter (0)
+ }
+
+ AutoChoice ::= CHOICE {
+ type1 AutoType {INTEGER (0..1)},
+ type2 AutoType {BOOLEAN}
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/84-param-tags-OK.asn1.-EF b/tests/tests-asn1c-compiler/84-param-tags-OK.asn1.-EF
new file mode 100644
index 0000000..a307434
--- /dev/null
+++ b/tests/tests-asn1c-compiler/84-param-tags-OK.asn1.-EF
@@ -0,0 +1,31 @@
+ModuleTestParameterizationTags1 { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 1 }
+DEFINITIONS ::=
+BEGIN
+
+TestType{Parameter} ::= SEQUENCE {
+ common Parameter DEFAULT 0
+}
+
+TestChoice ::= CHOICE {
+ type1 TestType{ INTEGER (1..10)},
+ type2 [0] IMPLICIT TestType{ BOOLEAN}
+}
+
+END
+
+ModuleTestParameterizationTagsAuto2 { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 2 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+AutoType{Parameter} ::= SEQUENCE {
+ common Parameter (0)
+}
+
+AutoChoice ::= CHOICE {
+ type1 [0] IMPLICIT AutoType{ INTEGER (0..1)},
+ type2 [1] IMPLICIT AutoType{ BOOLEAN}
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/84-param-tags-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/84-param-tags-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..b36cb13
--- /dev/null
+++ b/tests/tests-asn1c-compiler/84-param-tags-OK.asn1.-Pfwide-types
@@ -0,0 +1,595 @@
+
+/*** <<< INCLUDES [TestType] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+#include <BOOLEAN.h>
+
+/*** <<< TYPE-DECLS [TestType] >>> ***/
+
+typedef struct TestType_16P0 {
+ long common /* DEFAULT 0 */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TestType_16P0_t;
+typedef struct TestType_16P1 {
+ BOOLEAN_t common /* DEFAULT 0 */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TestType_16P1_t;
+
+/*** <<< FUNC-DECLS [TestType] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TestType_16P0;
+extern asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_TestType_16P0_1[1];
+extern asn_TYPE_descriptor_t asn_DEF_TestType_16P1;
+extern asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3;
+extern asn_TYPE_member_t asn_MBR_TestType_16P1_3[1];
+
+/*** <<< CODE [TestType] >>> ***/
+
+static int
+memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 1 && value <= 10)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [TestType] >>> ***/
+
+static int asn_DFL_2_set_0(int set_value, void **sptr) {
+ long *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 0 */
+ *st = 0;
+ return 0;
+ } else {
+ /* Test default value 0 */
+ return (*st == 0);
+ }
+}
+asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = {
+ { ATF_NOFLAGS, 1, offsetof(struct TestType_16P0, common),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_common_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_2_set_0, /* DEFAULT 0 */
+ .name = "common"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common */
+};
+asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = {
+ sizeof(struct TestType_16P0),
+ offsetof(struct TestType_16P0, _asn_ctx),
+ asn_MAP_TestType_16P0_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = {
+ "TestType",
+ "TestType",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_TestType_16P0_tags_1,
+ sizeof(asn_DEF_TestType_16P0_tags_1)
+ /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
+ asn_DEF_TestType_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_TestType_16P0_tags_1)
+ /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_TestType_16P0_1,
+ 1, /* Elements count */
+ &asn_SPC_TestType_16P0_specs_1 /* Additional specs */
+};
+
+static int asn_DFL_4_set_0(int set_value, void **sptr) {
+ BOOLEAN_t *st = *sptr;
+
+ if(!st) {
+ if(!set_value) return -1; /* Not a default value */
+ st = (*sptr = CALLOC(1, sizeof(*st)));
+ if(!st) return -1;
+ }
+
+ if(set_value) {
+ /* Install default value 0 */
+ *st = 0;
+ return 0;
+ } else {
+ /* Test default value 0 */
+ return (*st == 0);
+ }
+}
+asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = {
+ { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */
+ .name = "common"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common */
+};
+asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = {
+ sizeof(struct TestType_16P1),
+ offsetof(struct TestType_16P1, _asn_ctx),
+ asn_MAP_TestType_16P1_tag2el_3,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = {
+ "TestType",
+ "TestType",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_TestType_16P1_tags_3,
+ sizeof(asn_DEF_TestType_16P1_tags_3)
+ /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
+ asn_DEF_TestType_16P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_TestType_16P1_tags_3)
+ /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_TestType_16P1_3,
+ 1, /* Elements count */
+ &asn_SPC_TestType_16P1_specs_3 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [TestChoice] >>> ***/
+
+#include "TestType.h"
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [TestChoice] >>> ***/
+
+typedef enum TestChoice_PR {
+ TestChoice_PR_NOTHING, /* No components present */
+ TestChoice_PR_type1,
+ TestChoice_PR_type2
+} TestChoice_PR;
+
+/*** <<< TYPE-DECLS [TestChoice] >>> ***/
+
+typedef struct TestChoice {
+ TestChoice_PR present;
+ union TestChoice_u {
+ TestType_16P0_t type1;
+ TestType_16P1_t type2;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TestChoice_t;
+
+/*** <<< FUNC-DECLS [TestChoice] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
+
+/*** <<< STAT-DEFS [TestChoice] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_TestType_16P0,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "type1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TestType_16P1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "type2"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 */
+};
+static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = {
+ sizeof(struct TestChoice),
+ offsetof(struct TestChoice, _asn_ctx),
+ offsetof(struct TestChoice, present),
+ sizeof(((struct TestChoice *)0)->present),
+ asn_MAP_TestChoice_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_TestChoice = {
+ "TestChoice",
+ "TestChoice",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_TestChoice_1,
+ 2, /* Elements count */
+ &asn_SPC_TestChoice_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [AutoType] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+#include <BOOLEAN.h>
+
+/*** <<< TYPE-DECLS [AutoType] >>> ***/
+
+typedef struct AutoType_34P0 {
+ long common;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} AutoType_34P0_t;
+typedef struct AutoType_34P1 {
+ BOOLEAN_t common;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} AutoType_34P1_t;
+
+/*** <<< FUNC-DECLS [AutoType] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0;
+extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_AutoType_34P0_1[1];
+extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1;
+extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3;
+extern asn_TYPE_member_t asn_MBR_AutoType_34P1_3[1];
+
+/*** <<< CODE [AutoType] >>> ***/
+
+static int
+memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 0)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ BOOLEAN_t value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = (*(const long *)sptr) ? 1 : 0;
+
+ if((value <= 0)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [AutoType] >>> ***/
+
+asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_common_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "common"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
+};
+asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = {
+ sizeof(struct AutoType_34P0),
+ offsetof(struct AutoType_34P0, _asn_ctx),
+ asn_MAP_AutoType_34P0_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = {
+ "AutoType",
+ "AutoType",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_AutoType_34P0_tags_1,
+ sizeof(asn_DEF_AutoType_34P0_tags_1)
+ /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
+ asn_DEF_AutoType_34P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_AutoType_34P0_tags_1)
+ /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_AutoType_34P0_1,
+ 1, /* Elements count */
+ &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = memb_common_constraint_3,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "common"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
+};
+asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = {
+ sizeof(struct AutoType_34P1),
+ offsetof(struct AutoType_34P1, _asn_ctx),
+ asn_MAP_AutoType_34P1_tag2el_3,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = {
+ "AutoType",
+ "AutoType",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_AutoType_34P1_tags_3,
+ sizeof(asn_DEF_AutoType_34P1_tags_3)
+ /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
+ asn_DEF_AutoType_34P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_AutoType_34P1_tags_3)
+ /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_AutoType_34P1_3,
+ 1, /* Elements count */
+ &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [AutoChoice] >>> ***/
+
+#include "AutoType.h"
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [AutoChoice] >>> ***/
+
+typedef enum AutoChoice_PR {
+ AutoChoice_PR_NOTHING, /* No components present */
+ AutoChoice_PR_type1,
+ AutoChoice_PR_type2
+} AutoChoice_PR;
+
+/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
+
+typedef struct AutoChoice {
+ AutoChoice_PR present;
+ union AutoChoice_u {
+ AutoType_34P0_t type1;
+ AutoType_34P1_t type2;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} AutoChoice_t;
+
+/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
+
+/*** <<< STAT-DEFS [AutoChoice] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_AutoType_34P0,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "type1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_AutoType_34P1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "type2"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 */
+};
+static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = {
+ sizeof(struct AutoChoice),
+ offsetof(struct AutoChoice, _asn_ctx),
+ offsetof(struct AutoChoice, present),
+ sizeof(((struct AutoChoice *)0)->present),
+ asn_MAP_AutoChoice_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_AutoChoice = {
+ "AutoChoice",
+ "AutoChoice",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_AutoChoice_1,
+ 2, /* Elements count */
+ &asn_SPC_AutoChoice_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/85-comments-OK.asn1 b/tests/tests-asn1c-compiler/85-comments-OK.asn1
new file mode 100644
index 0000000..f1f4a8c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/85-comments-OK.asn1
@@ -0,0 +1,26 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .85
+
+ModuleTestComments
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 85 }
+ DEFINITIONS ::=
+BEGIN
+
+ T1 ::= SEQUENCE--comment-- { ... }
+ T2 ::= SEQUENCE-- comment-- { ... }
+ T3 ::= SEQUENCE--- comment --- { ... }
+ T4 ::= SEQUENCE----comment---- { ... }
+ T5 ::= SEQUENCE---- comment ---- { ... }
+
+ ----- Another ambiguous comment ---
+
+ -- Immediately terminating ambiguous comment ----
+ -------------
+ -- cmt1 ---- cmt2 ----
+
+END
diff --git a/tests/tests-asn1c-compiler/86-atags-OK.asn1 b/tests/tests-asn1c-compiler/86-atags-OK.asn1
new file mode 100644
index 0000000..afd0585
--- /dev/null
+++ b/tests/tests-asn1c-compiler/86-atags-OK.asn1
@@ -0,0 +1,20 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .86
+
+ModuleAutoTags
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 86 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ A ::= SEQUENCE { a INTEGER }
+ B ::= SEQUENCE { a [0] INTEGER }
+ C ::= SEQUENCE { a [0] IMPLICIT INTEGER }
+ D ::= SEQUENCE { a [0] EXPLICIT INTEGER }
+ E ::= SEQUENCE { a [0] CHOICE { b INTEGER } }
+
+END
diff --git a/tests/tests-asn1c-compiler/86-atags-OK.asn1.-EF b/tests/tests-asn1c-compiler/86-atags-OK.asn1.-EF
new file mode 100644
index 0000000..ebadd3a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/86-atags-OK.asn1.-EF
@@ -0,0 +1,28 @@
+ModuleAutoTags { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 86 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+A ::= SEQUENCE {
+ a [0] IMPLICIT INTEGER
+}
+
+B ::= SEQUENCE {
+ a [0] IMPLICIT INTEGER
+}
+
+C ::= SEQUENCE {
+ a [0] IMPLICIT INTEGER
+}
+
+D ::= SEQUENCE {
+ a [0] EXPLICIT INTEGER
+}
+
+E ::= SEQUENCE {
+ a [0] EXPLICIT CHOICE {
+ b [0] IMPLICIT INTEGER
+ }
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/87-old-syntax-OK.asn1 b/tests/tests-asn1c-compiler/87-old-syntax-OK.asn1
new file mode 100644
index 0000000..58e1a0c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/87-old-syntax-OK.asn1
@@ -0,0 +1,29 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .87
+
+ModuleObsoleteSyntax
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 87 }
+DEFINITIONS ::=
+BEGIN
+
+ Tc ::= CHOICE {
+ INTEGER,
+ BOOLEAN
+ }
+
+ Ts ::= SET {
+ INTEGER,
+ BOOLEAN,
+ SEQUENCE {
+ OBJECT IDENTIFIER,
+ RELATIVE-OID,
+ Tc
+ }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/88-integer-enum-OK.asn1 b/tests/tests-asn1c-compiler/88-integer-enum-OK.asn1
new file mode 100644
index 0000000..3753fa0
--- /dev/null
+++ b/tests/tests-asn1c-compiler/88-integer-enum-OK.asn1
@@ -0,0 +1,16 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .88
+
+ModuleIntegerEnumeration
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 88 }
+DEFINITIONS ::=
+BEGIN
+
+ T ::= INTEGER { a(1), b(2) }
+
+END
diff --git a/tests/tests-asn1c-compiler/88-integer-enum-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/88-integer-enum-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..f29777d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/88-integer-enum-OK.asn1.-Pfwide-types
@@ -0,0 +1,65 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum T {
+ T_a = 1,
+ T_b = 2
+} e_T;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef INTEGER_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 INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ INTEGER_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_T_tags_1,
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ asn_DEF_T_tags_1, /* Same as above */
+ sizeof(asn_DEF_T_tags_1)
+ /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1 b/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1
new file mode 100644
index 0000000..615525c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .89
+
+ModuleBitStringEnumeration
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 89 }
+DEFINITIONS ::=
+BEGIN
+
+ T ::= CHOICE {
+ bs BIT STRING { a(1), b(2) }
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1.-Pfcompound-names b/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1.-Pfcompound-names
new file mode 100644
index 0000000..5956b58
--- /dev/null
+++ b/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1.-Pfcompound-names
@@ -0,0 +1,86 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum T_PR {
+ T_PR_NOTHING, /* No components present */
+ T_PR_bs
+} T_PR;
+typedef enum T__bs {
+ T__bs_a = 1,
+ T__bs_b = 2
+} e_T__bs;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ T_PR present;
+ union T_u {
+ BIT_STRING_t bs;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.bs),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "bs"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* bs */
+};
+static asn_CHOICE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ offsetof(struct T, present),
+ sizeof(((struct T *)0)->present),
+ asn_MAP_T_tag2el_1,
+ 1, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 1, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..d69c79a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/89-bit-string-enum-OK.asn1.-Pfwide-types
@@ -0,0 +1,86 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum T_PR {
+ T_PR_NOTHING, /* No components present */
+ T_PR_bs
+} T_PR;
+typedef enum bs {
+ bs_a = 1,
+ bs_b = 2
+} e_bs;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ T_PR present;
+ union T_u {
+ BIT_STRING_t bs;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.bs),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "bs"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* bs */
+};
+static asn_CHOICE_specifics_t asn_SPC_T_specs_1 = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ offsetof(struct T, present),
+ sizeof(((struct T *)0)->present),
+ asn_MAP_T_tag2el_1,
+ 1, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_T_1,
+ 1, /* Elements count */
+ &asn_SPC_T_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1 b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1
new file mode 100644
index 0000000..46d9dbd
--- /dev/null
+++ b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1
@@ -0,0 +1,33 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .90
+
+ModuleConditionalIntegerType
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 90 }
+DEFINITIONS ::=
+BEGIN
+
+ CN-IntegerUnlimited ::= INTEGER
+ CN-IntegerMinMax ::= INTEGER (MIN..MAX)
+ CN-IntegerMinLow ::= INTEGER (MIN..1)
+ NO-IntegerMinHigh ::= INTEGER (MIN..3000000000)
+ NO-IntegerLowHigh ::= INTEGER (1..3000000000)
+ CN-IntegerLowMax ::= INTEGER (1..MAX)
+ NO-IntegerHighMax ::= INTEGER (3000000000..MAX)
+ NO-IntegerLowestMax ::= INTEGER (-3000000000..MAX)
+ NO-IntegerOutRange ::= INTEGER (3000000000..3000000001)
+ NO-IntegerOutValue ::= INTEGER (3000000000)
+ OK-IntegerInRange1 ::= INTEGER (-100..100)
+ OK-IntegerInRange2 ::= INTEGER (-100|100)
+ OK-IntegerInRange3 ::= INTEGER (-2147483648..2147483647)
+ OK-IntegerInRange4 ::= INTEGER (-2147483648|2147483647)
+ OK-IntegerInRange5 ::= INTEGER (-2147483648|2147483647,...)
+ NO-IntegerInRange6 ::= INTEGER (0..4294967295)
+ CN-IntegerEnumerated1 ::= INTEGER { a(1), b(2) }
+ NO-IntegerEnumerated2 ::= INTEGER { a(1), b(3000000000) }
+
+END
diff --git a/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-EFprint-constraints b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-EFprint-constraints
new file mode 100644
index 0000000..7ebee1d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-EFprint-constraints
@@ -0,0 +1,133 @@
+ModuleConditionalIntegerType { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 90 }
+DEFINITIONS ::=
+BEGIN
+
+CN-IntegerUnlimited ::= INTEGER
+-- Practical constraints (CN-IntegerUnlimited): (MIN..MAX)
+-- OER-visible constraints (CN-IntegerUnlimited): (MIN..MAX)
+-- PER-visible constraints (CN-IntegerUnlimited): (MIN..MAX)
+
+CN-IntegerMinMax ::= INTEGER (MIN..MAX)
+-- Combined constraints: (MIN..MAX)
+-- Practical constraints (CN-IntegerMinMax): (MIN..MAX)
+-- OER-visible constraints (CN-IntegerMinMax): (MIN..MAX)
+-- PER-visible constraints (CN-IntegerMinMax): (MIN..MAX)
+
+CN-IntegerMinLow ::= INTEGER (MIN..1)
+-- Combined constraints: (MIN..1)
+-- Practical constraints (CN-IntegerMinLow): (MIN..1)
+-- OER-visible constraints (CN-IntegerMinLow): (MIN..1)
+-- PER-visible constraints (CN-IntegerMinLow): (MIN..1)
+
+NO-IntegerMinHigh ::= INTEGER (MIN..3000000000)
+-- Combined constraints: (MIN..3000000000)
+-- Practical constraints (NO-IntegerMinHigh): (MIN..3000000000)
+-- OER-visible constraints (NO-IntegerMinHigh): (MIN..3000000000)
+-- PER-visible constraints (NO-IntegerMinHigh): (MIN..3000000000)
+
+NO-IntegerLowHigh ::= INTEGER (1..3000000000)
+-- Combined constraints: (1..3000000000)
+-- Practical constraints (NO-IntegerLowHigh): (1..3000000000)
+-- OER-visible constraints (NO-IntegerLowHigh): (1..3000000000)
+-- PER-visible constraints (NO-IntegerLowHigh): (1..3000000000)
+
+CN-IntegerLowMax ::= INTEGER (1..MAX)
+-- Combined constraints: (1..MAX)
+-- Practical constraints (CN-IntegerLowMax): (1..MAX)
+-- OER-visible constraints (CN-IntegerLowMax): (1..MAX)
+-- PER-visible constraints (CN-IntegerLowMax): (1..MAX)
+
+NO-IntegerHighMax ::= INTEGER (3000000000..MAX)
+-- Combined constraints: (3000000000..MAX)
+-- Practical constraints (NO-IntegerHighMax): (3000000000..MAX)
+-- OER-visible constraints (NO-IntegerHighMax): (3000000000..MAX)
+-- PER-visible constraints (NO-IntegerHighMax): (3000000000..MAX)
+
+NO-IntegerLowestMax ::= INTEGER (-3000000000..MAX)
+-- Combined constraints: (-3000000000..MAX)
+-- Practical constraints (NO-IntegerLowestMax): (-3000000000..MAX)
+-- OER-visible constraints (NO-IntegerLowestMax): (-3000000000..MAX)
+-- PER-visible constraints (NO-IntegerLowestMax): (-3000000000..MAX)
+
+NO-IntegerOutRange ::= INTEGER (3000000000..3000000001)
+-- Combined constraints: (3000000000..3000000001)
+-- Practical constraints (NO-IntegerOutRange): (3000000000..3000000001)
+-- OER-visible constraints (NO-IntegerOutRange): (3000000000..3000000001)
+-- PER-visible constraints (NO-IntegerOutRange): (3000000000..3000000001)
+
+NO-IntegerOutValue ::= INTEGER (3000000000)
+-- Combined constraints: (3000000000)
+-- Practical constraints (NO-IntegerOutValue): (3000000000)
+-- OER-visible constraints (NO-IntegerOutValue): (3000000000)
+-- PER-visible constraints (NO-IntegerOutValue): (3000000000)
+
+OK-IntegerInRange1 ::= INTEGER (-100..100)
+-- Combined constraints: (-100..100)
+-- Practical constraints (OK-IntegerInRange1): (-100..100)
+-- OER-visible constraints (OK-IntegerInRange1): (-100..100)
+-- PER-visible constraints (OK-IntegerInRange1): (-100..100)
+
+OK-IntegerInRange2 ::= INTEGER (-100 | 100)
+-- Combined constraints: (-100 | 100)
+-- Practical constraints (OK-IntegerInRange2): (-100 | 100)
+-- OER-visible constraints (OK-IntegerInRange2): (-100 | 100)
+-- PER-visible constraints (OK-IntegerInRange2): (-100 | 100)
+
+OK-IntegerInRange3 ::= INTEGER (-2147483648..2147483647)
+-- Combined constraints: (-2147483648..2147483647)
+-- Practical constraints (OK-IntegerInRange3): (-2147483648..2147483647)
+-- OER-visible constraints (OK-IntegerInRange3): (-2147483648..2147483647)
+-- PER-visible constraints (OK-IntegerInRange3): (-2147483648..2147483647)
+
+OK-IntegerInRange4 ::= INTEGER (-2147483648 | 2147483647)
+-- Combined constraints: (-2147483648 | 2147483647)
+-- Practical constraints (OK-IntegerInRange4): (-2147483648 | 2147483647)
+-- OER-visible constraints (OK-IntegerInRange4): (-2147483648 | 2147483647)
+-- PER-visible constraints (OK-IntegerInRange4): (-2147483648 | 2147483647)
+
+OK-IntegerInRange5 ::= INTEGER (-2147483648 | 2147483647,...)
+-- Combined constraints: (-2147483648 | 2147483647,...)
+-- Practical constraints (OK-IntegerInRange5): (-2147483648 | 2147483647,...)
+-- OER-visible constraints (OK-IntegerInRange5): (MIN..MAX)
+-- PER-visible constraints (OK-IntegerInRange5): (-2147483648 | 2147483647,...)
+
+NO-IntegerInRange6 ::= INTEGER (0..4294967295)
+-- Combined constraints: (0..4294967295)
+-- Practical constraints (NO-IntegerInRange6): (0..4294967295)
+-- OER-visible constraints (NO-IntegerInRange6): (0..4294967295)
+-- PER-visible constraints (NO-IntegerInRange6): (0..4294967295)
+
+CN-IntegerEnumerated1 ::= INTEGER {
+ a(1)
+-- Practical constraints (a):
+-- OER-visible constraints (a):
+-- PER-visible constraints (a):
+,
+ b(2)
+-- Practical constraints (b):
+-- OER-visible constraints (b):
+-- PER-visible constraints (b):
+
+}
+-- Practical constraints (CN-IntegerEnumerated1): (MIN..MAX)
+-- OER-visible constraints (CN-IntegerEnumerated1): (MIN..MAX)
+-- PER-visible constraints (CN-IntegerEnumerated1): (MIN..MAX)
+
+NO-IntegerEnumerated2 ::= INTEGER {
+ a(1)
+-- Practical constraints (a):
+-- OER-visible constraints (a):
+-- PER-visible constraints (a):
+,
+ b(3000000000)
+-- Practical constraints (b):
+-- OER-visible constraints (b):
+-- PER-visible constraints (b):
+
+}
+-- Practical constraints (NO-IntegerEnumerated2): (MIN..MAX)
+-- OER-visible constraints (NO-IntegerEnumerated2): (MIN..MAX)
+-- PER-visible constraints (NO-IntegerEnumerated2): (MIN..MAX)
+
+END
diff --git a/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-P b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-P
new file mode 100644
index 0000000..decff2b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-P
@@ -0,0 +1,1458 @@
+
+/*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/
+
+typedef long CN_IntegerUnlimited_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited;
+asn_struct_free_f CN_IntegerUnlimited_free;
+asn_struct_print_f CN_IntegerUnlimited_print;
+asn_constr_check_f CN_IntegerUnlimited_constraint;
+ber_type_decoder_f CN_IntegerUnlimited_decode_ber;
+der_type_encoder_f CN_IntegerUnlimited_encode_der;
+xer_type_decoder_f CN_IntegerUnlimited_decode_xer;
+xer_type_encoder_f CN_IntegerUnlimited_encode_xer;
+
+/*** <<< CODE [CN-IntegerUnlimited] >>> ***/
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = {
+ "CN-IntegerUnlimited",
+ "CN-IntegerUnlimited",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NativeInteger_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerUnlimited_tags_1,
+ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
+ /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
+ /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/
+
+typedef long CN_IntegerMinMax_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax;
+asn_struct_free_f CN_IntegerMinMax_free;
+asn_struct_print_f CN_IntegerMinMax_print;
+asn_constr_check_f CN_IntegerMinMax_constraint;
+ber_type_decoder_f CN_IntegerMinMax_decode_ber;
+der_type_encoder_f CN_IntegerMinMax_encode_der;
+xer_type_decoder_f CN_IntegerMinMax_decode_xer;
+xer_type_encoder_f CN_IntegerMinMax_encode_xer;
+
+/*** <<< CODE [CN-IntegerMinMax] >>> ***/
+
+int
+CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_NativeInteger.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = {
+ "CN-IntegerMinMax",
+ "CN-IntegerMinMax",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ CN_IntegerMinMax_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerMinMax_tags_1,
+ sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/
+
+typedef long CN_IntegerMinLow_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow;
+asn_struct_free_f CN_IntegerMinLow_free;
+asn_struct_print_f CN_IntegerMinLow_print;
+asn_constr_check_f CN_IntegerMinLow_constraint;
+ber_type_decoder_f CN_IntegerMinLow_decode_ber;
+der_type_encoder_f CN_IntegerMinLow_encode_der;
+xer_type_decoder_f CN_IntegerMinLow_decode_xer;
+xer_type_encoder_f CN_IntegerMinLow_encode_xer;
+
+/*** <<< CODE [CN-IntegerMinLow] >>> ***/
+
+int
+CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value <= 1)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = {
+ "CN-IntegerMinLow",
+ "CN-IntegerMinLow",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ CN_IntegerMinLow_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerMinLow_tags_1,
+ sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/
+
+typedef INTEGER_t NO_IntegerMinHigh_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh;
+asn_struct_free_f NO_IntegerMinHigh_free;
+asn_struct_print_f NO_IntegerMinHigh_print;
+asn_constr_check_f NO_IntegerMinHigh_constraint;
+ber_type_decoder_f NO_IntegerMinHigh_decode_ber;
+der_type_encoder_f NO_IntegerMinHigh_encode_der;
+xer_type_decoder_f NO_IntegerMinHigh_decode_xer;
+xer_type_encoder_f NO_IntegerMinHigh_encode_xer;
+
+/*** <<< CODE [NO-IntegerMinHigh] >>> ***/
+
+int
+NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value <= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = {
+ "NO-IntegerMinHigh",
+ "NO-IntegerMinHigh",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerMinHigh_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerMinHigh_tags_1,
+ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/
+
+typedef unsigned long NO_IntegerLowHigh_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh;
+asn_struct_free_f NO_IntegerLowHigh_free;
+asn_struct_print_f NO_IntegerLowHigh_print;
+asn_constr_check_f NO_IntegerLowHigh_constraint;
+ber_type_decoder_f NO_IntegerLowHigh_decode_ber;
+der_type_encoder_f NO_IntegerLowHigh_encode_der;
+xer_type_decoder_f NO_IntegerLowHigh_decode_xer;
+xer_type_encoder_f NO_IntegerLowHigh_encode_xer;
+
+/*** <<< CODE [NO-IntegerLowHigh] >>> ***/
+
+int
+NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value >= 1 && value <= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = {
+ "NO-IntegerLowHigh",
+ "NO-IntegerLowHigh",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerLowHigh_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerLowHigh_tags_1,
+ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/
+
+typedef long CN_IntegerLowMax_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax;
+asn_struct_free_f CN_IntegerLowMax_free;
+asn_struct_print_f CN_IntegerLowMax_print;
+asn_constr_check_f CN_IntegerLowMax_constraint;
+ber_type_decoder_f CN_IntegerLowMax_decode_ber;
+der_type_encoder_f CN_IntegerLowMax_encode_der;
+xer_type_decoder_f CN_IntegerLowMax_decode_xer;
+xer_type_encoder_f CN_IntegerLowMax_encode_xer;
+
+/*** <<< CODE [CN-IntegerLowMax] >>> ***/
+
+int
+CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 1)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = {
+ "CN-IntegerLowMax",
+ "CN-IntegerLowMax",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ CN_IntegerLowMax_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerLowMax_tags_1,
+ sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/
+
+typedef INTEGER_t NO_IntegerHighMax_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax;
+asn_struct_free_f NO_IntegerHighMax_free;
+asn_struct_print_f NO_IntegerHighMax_print;
+asn_constr_check_f NO_IntegerHighMax_constraint;
+ber_type_decoder_f NO_IntegerHighMax_decode_ber;
+der_type_encoder_f NO_IntegerHighMax_encode_der;
+xer_type_decoder_f NO_IntegerHighMax_decode_xer;
+xer_type_encoder_f NO_IntegerHighMax_encode_xer;
+
+/*** <<< CODE [NO-IntegerHighMax] >>> ***/
+
+int
+NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = {
+ "NO-IntegerHighMax",
+ "NO-IntegerHighMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerHighMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerHighMax_tags_1,
+ sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/
+
+typedef INTEGER_t NO_IntegerLowestMax_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax;
+asn_struct_free_f NO_IntegerLowestMax_free;
+asn_struct_print_f NO_IntegerLowestMax_print;
+asn_constr_check_f NO_IntegerLowestMax_constraint;
+ber_type_decoder_f NO_IntegerLowestMax_decode_ber;
+der_type_encoder_f NO_IntegerLowestMax_encode_der;
+xer_type_decoder_f NO_IntegerLowestMax_decode_xer;
+xer_type_encoder_f NO_IntegerLowestMax_encode_xer;
+
+/*** <<< CODE [NO-IntegerLowestMax] >>> ***/
+
+int
+NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= -3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = {
+ "NO-IntegerLowestMax",
+ "NO-IntegerLowestMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerLowestMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerLowestMax_tags_1,
+ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/
+
+typedef unsigned long NO_IntegerOutRange_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange;
+asn_struct_free_f NO_IntegerOutRange_free;
+asn_struct_print_f NO_IntegerOutRange_print;
+asn_constr_check_f NO_IntegerOutRange_constraint;
+ber_type_decoder_f NO_IntegerOutRange_decode_ber;
+der_type_encoder_f NO_IntegerOutRange_encode_der;
+xer_type_decoder_f NO_IntegerOutRange_decode_xer;
+xer_type_encoder_f NO_IntegerOutRange_encode_xer;
+
+/*** <<< CODE [NO-IntegerOutRange] >>> ***/
+
+int
+NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value >= 3000000000 && value <= 3000000001)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = {
+ "NO-IntegerOutRange",
+ "NO-IntegerOutRange",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerOutRange_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerOutRange_tags_1,
+ sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/
+
+typedef unsigned long NO_IntegerOutValue_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue;
+asn_struct_free_f NO_IntegerOutValue_free;
+asn_struct_print_f NO_IntegerOutValue_print;
+asn_constr_check_f NO_IntegerOutValue_constraint;
+ber_type_decoder_f NO_IntegerOutValue_decode_ber;
+der_type_encoder_f NO_IntegerOutValue_encode_der;
+xer_type_decoder_f NO_IntegerOutValue_decode_xer;
+xer_type_encoder_f NO_IntegerOutValue_encode_xer;
+
+/*** <<< CODE [NO-IntegerOutValue] >>> ***/
+
+int
+NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value == 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = {
+ "NO-IntegerOutValue",
+ "NO-IntegerOutValue",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerOutValue_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerOutValue_tags_1,
+ sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/
+
+typedef long OK_IntegerInRange1_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1;
+asn_struct_free_f OK_IntegerInRange1_free;
+asn_struct_print_f OK_IntegerInRange1_print;
+asn_constr_check_f OK_IntegerInRange1_constraint;
+ber_type_decoder_f OK_IntegerInRange1_decode_ber;
+der_type_encoder_f OK_IntegerInRange1_encode_der;
+xer_type_decoder_f OK_IntegerInRange1_decode_xer;
+xer_type_encoder_f OK_IntegerInRange1_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange1] >>> ***/
+
+int
+OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -100 && value <= 100)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = {
+ "OK-IntegerInRange1",
+ "OK-IntegerInRange1",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange1_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange1_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/
+
+typedef long OK_IntegerInRange2_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2;
+asn_struct_free_f OK_IntegerInRange2_free;
+asn_struct_print_f OK_IntegerInRange2_print;
+asn_constr_check_f OK_IntegerInRange2_constraint;
+ber_type_decoder_f OK_IntegerInRange2_decode_ber;
+der_type_encoder_f OK_IntegerInRange2_encode_der;
+xer_type_decoder_f OK_IntegerInRange2_decode_xer;
+xer_type_encoder_f OK_IntegerInRange2_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange2] >>> ***/
+
+int
+OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == -100) || (value == 100))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = {
+ "OK-IntegerInRange2",
+ "OK-IntegerInRange2",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange2_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange2_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/
+
+typedef long OK_IntegerInRange3_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3;
+asn_struct_free_f OK_IntegerInRange3_free;
+asn_struct_print_f OK_IntegerInRange3_print;
+asn_constr_check_f OK_IntegerInRange3_constraint;
+ber_type_decoder_f OK_IntegerInRange3_decode_ber;
+der_type_encoder_f OK_IntegerInRange3_encode_der;
+xer_type_decoder_f OK_IntegerInRange3_decode_xer;
+xer_type_encoder_f OK_IntegerInRange3_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange3] >>> ***/
+
+int
+OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= (-2147483647L - 1) && value <= 2147483647)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = {
+ "OK-IntegerInRange3",
+ "OK-IntegerInRange3",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange3_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange3_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/
+
+typedef long OK_IntegerInRange4_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4;
+asn_struct_free_f OK_IntegerInRange4_free;
+asn_struct_print_f OK_IntegerInRange4_print;
+asn_constr_check_f OK_IntegerInRange4_constraint;
+ber_type_decoder_f OK_IntegerInRange4_decode_ber;
+der_type_encoder_f OK_IntegerInRange4_encode_der;
+xer_type_decoder_f OK_IntegerInRange4_decode_xer;
+xer_type_encoder_f OK_IntegerInRange4_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange4] >>> ***/
+
+int
+OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = {
+ "OK-IntegerInRange4",
+ "OK-IntegerInRange4",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange4_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange4_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/
+
+typedef long OK_IntegerInRange5_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5;
+asn_struct_free_f OK_IntegerInRange5_free;
+asn_struct_print_f OK_IntegerInRange5_print;
+asn_constr_check_f OK_IntegerInRange5_constraint;
+ber_type_decoder_f OK_IntegerInRange5_decode_ber;
+der_type_encoder_f OK_IntegerInRange5_encode_der;
+xer_type_decoder_f OK_IntegerInRange5_decode_xer;
+xer_type_encoder_f OK_IntegerInRange5_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange5] >>> ***/
+
+int
+OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = {
+ "OK-IntegerInRange5",
+ "OK-IntegerInRange5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange5_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/
+
+typedef unsigned long NO_IntegerInRange6_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6;
+asn_struct_free_f NO_IntegerInRange6_free;
+asn_struct_print_f NO_IntegerInRange6_print;
+asn_constr_check_f NO_IntegerInRange6_constraint;
+ber_type_decoder_f NO_IntegerInRange6_decode_ber;
+der_type_encoder_f NO_IntegerInRange6_encode_der;
+xer_type_decoder_f NO_IntegerInRange6_decode_xer;
+xer_type_encoder_f NO_IntegerInRange6_encode_xer;
+
+/*** <<< CODE [NO-IntegerInRange6] >>> ***/
+
+int
+NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ /* Constraint check succeeded */
+ return 0;
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = {
+ "NO-IntegerInRange6",
+ "NO-IntegerInRange6",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerInRange6_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerInRange6_tags_1,
+ sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
+ /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
+ /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/
+
+typedef enum CN_IntegerEnumerated1 {
+ CN_IntegerEnumerated1_a = 1,
+ CN_IntegerEnumerated1_b = 2
+} e_CN_IntegerEnumerated1;
+
+/*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/
+
+typedef long CN_IntegerEnumerated1_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1;
+asn_struct_free_f CN_IntegerEnumerated1_free;
+asn_struct_print_f CN_IntegerEnumerated1_print;
+asn_constr_check_f CN_IntegerEnumerated1_constraint;
+ber_type_decoder_f CN_IntegerEnumerated1_decode_ber;
+der_type_encoder_f CN_IntegerEnumerated1_encode_der;
+xer_type_decoder_f CN_IntegerEnumerated1_decode_xer;
+xer_type_encoder_f CN_IntegerEnumerated1_encode_xer;
+
+/*** <<< CODE [CN-IntegerEnumerated1] >>> ***/
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = {
+ "CN-IntegerEnumerated1",
+ "CN-IntegerEnumerated1",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NativeInteger_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerEnumerated1_tags_1,
+ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
+ /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
+ /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/
+
+typedef enum NO_IntegerEnumerated2 {
+ NO_IntegerEnumerated2_a = 1,
+ NO_IntegerEnumerated2_b = 3000000000
+} e_NO_IntegerEnumerated2;
+
+/*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/
+
+typedef INTEGER_t NO_IntegerEnumerated2_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2;
+asn_struct_free_f NO_IntegerEnumerated2_free;
+asn_struct_print_f NO_IntegerEnumerated2_print;
+asn_constr_check_f NO_IntegerEnumerated2_constraint;
+ber_type_decoder_f NO_IntegerEnumerated2_decode_ber;
+der_type_encoder_f NO_IntegerEnumerated2_encode_der;
+xer_type_decoder_f NO_IntegerEnumerated2_decode_xer;
+xer_type_encoder_f NO_IntegerEnumerated2_encode_xer;
+
+/*** <<< CODE [NO-IntegerEnumerated2] >>> ***/
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = {
+ "NO-IntegerEnumerated2",
+ "NO-IntegerEnumerated2",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ INTEGER_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerEnumerated2_tags_1,
+ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
+ /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
+ /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..a13c18b
--- /dev/null
+++ b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-Pfwide-types
@@ -0,0 +1,1478 @@
+
+/*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/
+
+typedef INTEGER_t CN_IntegerUnlimited_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited;
+asn_struct_free_f CN_IntegerUnlimited_free;
+asn_struct_print_f CN_IntegerUnlimited_print;
+asn_constr_check_f CN_IntegerUnlimited_constraint;
+ber_type_decoder_f CN_IntegerUnlimited_decode_ber;
+der_type_encoder_f CN_IntegerUnlimited_encode_der;
+xer_type_decoder_f CN_IntegerUnlimited_decode_xer;
+xer_type_encoder_f CN_IntegerUnlimited_encode_xer;
+
+/*** <<< CODE [CN-IntegerUnlimited] >>> ***/
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = {
+ "CN-IntegerUnlimited",
+ "CN-IntegerUnlimited",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ INTEGER_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerUnlimited_tags_1,
+ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
+ /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
+ /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/
+
+typedef INTEGER_t CN_IntegerMinMax_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax;
+asn_struct_free_f CN_IntegerMinMax_free;
+asn_struct_print_f CN_IntegerMinMax_print;
+asn_constr_check_f CN_IntegerMinMax_constraint;
+ber_type_decoder_f CN_IntegerMinMax_decode_ber;
+der_type_encoder_f CN_IntegerMinMax_encode_der;
+xer_type_decoder_f CN_IntegerMinMax_decode_xer;
+xer_type_encoder_f CN_IntegerMinMax_encode_xer;
+
+/*** <<< CODE [CN-IntegerMinMax] >>> ***/
+
+int
+CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ (void)st; /* Unused variable */
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_INTEGER.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = {
+ "CN-IntegerMinMax",
+ "CN-IntegerMinMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ CN_IntegerMinMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerMinMax_tags_1,
+ sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/
+
+typedef INTEGER_t CN_IntegerMinLow_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow;
+asn_struct_free_f CN_IntegerMinLow_free;
+asn_struct_print_f CN_IntegerMinLow_print;
+asn_constr_check_f CN_IntegerMinLow_constraint;
+ber_type_decoder_f CN_IntegerMinLow_decode_ber;
+der_type_encoder_f CN_IntegerMinLow_encode_der;
+xer_type_decoder_f CN_IntegerMinLow_decode_xer;
+xer_type_encoder_f CN_IntegerMinLow_encode_xer;
+
+/*** <<< CODE [CN-IntegerMinLow] >>> ***/
+
+int
+CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value <= 1)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = {
+ "CN-IntegerMinLow",
+ "CN-IntegerMinLow",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ CN_IntegerMinLow_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerMinLow_tags_1,
+ sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/
+
+typedef INTEGER_t NO_IntegerMinHigh_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh;
+asn_struct_free_f NO_IntegerMinHigh_free;
+asn_struct_print_f NO_IntegerMinHigh_print;
+asn_constr_check_f NO_IntegerMinHigh_constraint;
+ber_type_decoder_f NO_IntegerMinHigh_decode_ber;
+der_type_encoder_f NO_IntegerMinHigh_encode_der;
+xer_type_decoder_f NO_IntegerMinHigh_decode_xer;
+xer_type_encoder_f NO_IntegerMinHigh_encode_xer;
+
+/*** <<< CODE [NO-IntegerMinHigh] >>> ***/
+
+int
+NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value <= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = {
+ "NO-IntegerMinHigh",
+ "NO-IntegerMinHigh",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerMinHigh_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerMinHigh_tags_1,
+ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/
+
+typedef unsigned long NO_IntegerLowHigh_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh;
+asn_struct_free_f NO_IntegerLowHigh_free;
+asn_struct_print_f NO_IntegerLowHigh_print;
+asn_constr_check_f NO_IntegerLowHigh_constraint;
+ber_type_decoder_f NO_IntegerLowHigh_decode_ber;
+der_type_encoder_f NO_IntegerLowHigh_encode_der;
+xer_type_decoder_f NO_IntegerLowHigh_decode_xer;
+xer_type_encoder_f NO_IntegerLowHigh_encode_xer;
+
+/*** <<< CODE [NO-IntegerLowHigh] >>> ***/
+
+int
+NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value >= 1 && value <= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = {
+ "NO-IntegerLowHigh",
+ "NO-IntegerLowHigh",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerLowHigh_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerLowHigh_tags_1,
+ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/
+
+typedef INTEGER_t CN_IntegerLowMax_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax;
+asn_struct_free_f CN_IntegerLowMax_free;
+asn_struct_print_f CN_IntegerLowMax_print;
+asn_constr_check_f CN_IntegerLowMax_constraint;
+ber_type_decoder_f CN_IntegerLowMax_decode_ber;
+der_type_encoder_f CN_IntegerLowMax_encode_der;
+xer_type_decoder_f CN_IntegerLowMax_decode_xer;
+xer_type_encoder_f CN_IntegerLowMax_encode_xer;
+
+/*** <<< CODE [CN-IntegerLowMax] >>> ***/
+
+int
+CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 1)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = {
+ "CN-IntegerLowMax",
+ "CN-IntegerLowMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ CN_IntegerLowMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerLowMax_tags_1,
+ sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/
+
+typedef INTEGER_t NO_IntegerHighMax_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax;
+asn_struct_free_f NO_IntegerHighMax_free;
+asn_struct_print_f NO_IntegerHighMax_print;
+asn_constr_check_f NO_IntegerHighMax_constraint;
+ber_type_decoder_f NO_IntegerHighMax_decode_ber;
+der_type_encoder_f NO_IntegerHighMax_encode_der;
+xer_type_decoder_f NO_IntegerHighMax_decode_xer;
+xer_type_encoder_f NO_IntegerHighMax_encode_xer;
+
+/*** <<< CODE [NO-IntegerHighMax] >>> ***/
+
+int
+NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = {
+ "NO-IntegerHighMax",
+ "NO-IntegerHighMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerHighMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerHighMax_tags_1,
+ sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/
+
+typedef INTEGER_t NO_IntegerLowestMax_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax;
+asn_struct_free_f NO_IntegerLowestMax_free;
+asn_struct_print_f NO_IntegerLowestMax_print;
+asn_constr_check_f NO_IntegerLowestMax_constraint;
+ber_type_decoder_f NO_IntegerLowestMax_decode_ber;
+der_type_encoder_f NO_IntegerLowestMax_encode_der;
+xer_type_decoder_f NO_IntegerLowestMax_decode_xer;
+xer_type_encoder_f NO_IntegerLowestMax_encode_xer;
+
+/*** <<< CODE [NO-IntegerLowestMax] >>> ***/
+
+int
+NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= -3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = {
+ "NO-IntegerLowestMax",
+ "NO-IntegerLowestMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerLowestMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerLowestMax_tags_1,
+ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/
+
+typedef unsigned long NO_IntegerOutRange_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange;
+asn_struct_free_f NO_IntegerOutRange_free;
+asn_struct_print_f NO_IntegerOutRange_print;
+asn_constr_check_f NO_IntegerOutRange_constraint;
+ber_type_decoder_f NO_IntegerOutRange_decode_ber;
+der_type_encoder_f NO_IntegerOutRange_encode_der;
+xer_type_decoder_f NO_IntegerOutRange_decode_xer;
+xer_type_encoder_f NO_IntegerOutRange_encode_xer;
+
+/*** <<< CODE [NO-IntegerOutRange] >>> ***/
+
+int
+NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value >= 3000000000 && value <= 3000000001)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = {
+ "NO-IntegerOutRange",
+ "NO-IntegerOutRange",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerOutRange_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerOutRange_tags_1,
+ sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/
+
+typedef unsigned long NO_IntegerOutValue_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue;
+asn_struct_free_f NO_IntegerOutValue_free;
+asn_struct_print_f NO_IntegerOutValue_print;
+asn_constr_check_f NO_IntegerOutValue_constraint;
+ber_type_decoder_f NO_IntegerOutValue_decode_ber;
+der_type_encoder_f NO_IntegerOutValue_encode_der;
+xer_type_decoder_f NO_IntegerOutValue_decode_xer;
+xer_type_encoder_f NO_IntegerOutValue_encode_xer;
+
+/*** <<< CODE [NO-IntegerOutValue] >>> ***/
+
+int
+NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value == 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = {
+ "NO-IntegerOutValue",
+ "NO-IntegerOutValue",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerOutValue_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerOutValue_tags_1,
+ sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/
+
+typedef long OK_IntegerInRange1_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1;
+asn_struct_free_f OK_IntegerInRange1_free;
+asn_struct_print_f OK_IntegerInRange1_print;
+asn_constr_check_f OK_IntegerInRange1_constraint;
+ber_type_decoder_f OK_IntegerInRange1_decode_ber;
+der_type_encoder_f OK_IntegerInRange1_encode_der;
+xer_type_decoder_f OK_IntegerInRange1_decode_xer;
+xer_type_encoder_f OK_IntegerInRange1_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange1] >>> ***/
+
+int
+OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -100 && value <= 100)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = {
+ "OK-IntegerInRange1",
+ "OK-IntegerInRange1",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange1_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange1_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/
+
+typedef long OK_IntegerInRange2_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2;
+asn_struct_free_f OK_IntegerInRange2_free;
+asn_struct_print_f OK_IntegerInRange2_print;
+asn_constr_check_f OK_IntegerInRange2_constraint;
+ber_type_decoder_f OK_IntegerInRange2_decode_ber;
+der_type_encoder_f OK_IntegerInRange2_encode_der;
+xer_type_decoder_f OK_IntegerInRange2_decode_xer;
+xer_type_encoder_f OK_IntegerInRange2_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange2] >>> ***/
+
+int
+OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == -100) || (value == 100))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = {
+ "OK-IntegerInRange2",
+ "OK-IntegerInRange2",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange2_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange2_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/
+
+typedef long OK_IntegerInRange3_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3;
+asn_struct_free_f OK_IntegerInRange3_free;
+asn_struct_print_f OK_IntegerInRange3_print;
+asn_constr_check_f OK_IntegerInRange3_constraint;
+ber_type_decoder_f OK_IntegerInRange3_decode_ber;
+der_type_encoder_f OK_IntegerInRange3_encode_der;
+xer_type_decoder_f OK_IntegerInRange3_decode_xer;
+xer_type_encoder_f OK_IntegerInRange3_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange3] >>> ***/
+
+int
+OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= (-2147483647L - 1) && value <= 2147483647)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = {
+ "OK-IntegerInRange3",
+ "OK-IntegerInRange3",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange3_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange3_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/
+
+typedef long OK_IntegerInRange4_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4;
+asn_struct_free_f OK_IntegerInRange4_free;
+asn_struct_print_f OK_IntegerInRange4_print;
+asn_constr_check_f OK_IntegerInRange4_constraint;
+ber_type_decoder_f OK_IntegerInRange4_decode_ber;
+der_type_encoder_f OK_IntegerInRange4_encode_der;
+xer_type_decoder_f OK_IntegerInRange4_decode_xer;
+xer_type_encoder_f OK_IntegerInRange4_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange4] >>> ***/
+
+int
+OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = {
+ "OK-IntegerInRange4",
+ "OK-IntegerInRange4",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange4_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange4_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/
+
+typedef INTEGER_t OK_IntegerInRange5_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5;
+asn_struct_free_f OK_IntegerInRange5_free;
+asn_struct_print_f OK_IntegerInRange5_print;
+asn_constr_check_f OK_IntegerInRange5_constraint;
+ber_type_decoder_f OK_IntegerInRange5_decode_ber;
+der_type_encoder_f OK_IntegerInRange5_encode_der;
+xer_type_decoder_f OK_IntegerInRange5_decode_xer;
+xer_type_encoder_f OK_IntegerInRange5_encode_xer;
+
+/*** <<< CODE [OK-IntegerInRange5] >>> ***/
+
+int
+OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = {
+ "OK-IntegerInRange5",
+ "OK-IntegerInRange5",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ OK_IntegerInRange5_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange5_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/
+
+typedef unsigned long NO_IntegerInRange6_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6;
+asn_struct_free_f NO_IntegerInRange6_free;
+asn_struct_print_f NO_IntegerInRange6_print;
+asn_constr_check_f NO_IntegerInRange6_constraint;
+ber_type_decoder_f NO_IntegerInRange6_decode_ber;
+der_type_encoder_f NO_IntegerInRange6_encode_der;
+xer_type_decoder_f NO_IntegerInRange6_decode_xer;
+xer_type_encoder_f NO_IntegerInRange6_encode_xer;
+
+/*** <<< CODE [NO-IntegerInRange6] >>> ***/
+
+int
+NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ /* Constraint check succeeded */
+ return 0;
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = {
+ "NO-IntegerInRange6",
+ "NO-IntegerInRange6",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerInRange6_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerInRange6_tags_1,
+ sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
+ /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
+ /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/
+
+typedef enum CN_IntegerEnumerated1 {
+ CN_IntegerEnumerated1_a = 1,
+ CN_IntegerEnumerated1_b = 2
+} e_CN_IntegerEnumerated1;
+
+/*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/
+
+typedef INTEGER_t CN_IntegerEnumerated1_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1;
+asn_struct_free_f CN_IntegerEnumerated1_free;
+asn_struct_print_f CN_IntegerEnumerated1_print;
+asn_constr_check_f CN_IntegerEnumerated1_constraint;
+ber_type_decoder_f CN_IntegerEnumerated1_decode_ber;
+der_type_encoder_f CN_IntegerEnumerated1_encode_der;
+xer_type_decoder_f CN_IntegerEnumerated1_decode_xer;
+xer_type_encoder_f CN_IntegerEnumerated1_encode_xer;
+
+/*** <<< CODE [CN-IntegerEnumerated1] >>> ***/
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = {
+ "CN-IntegerEnumerated1",
+ "CN-IntegerEnumerated1",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ INTEGER_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerEnumerated1_tags_1,
+ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
+ /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
+ /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/
+
+typedef enum NO_IntegerEnumerated2 {
+ NO_IntegerEnumerated2_a = 1,
+ NO_IntegerEnumerated2_b = 3000000000
+} e_NO_IntegerEnumerated2;
+
+/*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/
+
+typedef INTEGER_t NO_IntegerEnumerated2_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2;
+asn_struct_free_f NO_IntegerEnumerated2_free;
+asn_struct_print_f NO_IntegerEnumerated2_print;
+asn_constr_check_f NO_IntegerEnumerated2_constraint;
+ber_type_decoder_f NO_IntegerEnumerated2_decode_ber;
+der_type_encoder_f NO_IntegerEnumerated2_encode_der;
+xer_type_decoder_f NO_IntegerEnumerated2_decode_xer;
+xer_type_encoder_f NO_IntegerEnumerated2_encode_xer;
+
+/*** <<< CODE [NO-IntegerEnumerated2] >>> ***/
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = {
+ "NO-IntegerEnumerated2",
+ "NO-IntegerEnumerated2",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ INTEGER_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerEnumerated2_tags_1,
+ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
+ /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
+ /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..c1d4927
--- /dev/null
+++ b/tests/tests-asn1c-compiler/90-cond-int-type-OK.asn1.-Pgen-PER
@@ -0,0 +1,1632 @@
+
+/*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/
+
+typedef long CN_IntegerUnlimited_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited;
+asn_struct_free_f CN_IntegerUnlimited_free;
+asn_struct_print_f CN_IntegerUnlimited_print;
+asn_constr_check_f CN_IntegerUnlimited_constraint;
+ber_type_decoder_f CN_IntegerUnlimited_decode_ber;
+der_type_encoder_f CN_IntegerUnlimited_encode_der;
+xer_type_decoder_f CN_IntegerUnlimited_decode_xer;
+xer_type_encoder_f CN_IntegerUnlimited_encode_xer;
+per_type_decoder_f CN_IntegerUnlimited_decode_uper;
+per_type_encoder_f CN_IntegerUnlimited_encode_uper;
+
+/*** <<< CODE [CN-IntegerUnlimited] >>> ***/
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = {
+ "CN-IntegerUnlimited",
+ "CN-IntegerUnlimited",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NativeInteger_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerUnlimited_tags_1,
+ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
+ /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
+ /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/
+
+typedef long CN_IntegerMinMax_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax;
+asn_struct_free_f CN_IntegerMinMax_free;
+asn_struct_print_f CN_IntegerMinMax_print;
+asn_constr_check_f CN_IntegerMinMax_constraint;
+ber_type_decoder_f CN_IntegerMinMax_decode_ber;
+der_type_encoder_f CN_IntegerMinMax_encode_der;
+xer_type_decoder_f CN_IntegerMinMax_decode_xer;
+xer_type_encoder_f CN_IntegerMinMax_encode_xer;
+per_type_decoder_f CN_IntegerMinMax_decode_uper;
+per_type_encoder_f CN_IntegerMinMax_encode_uper;
+
+/*** <<< CODE [CN-IntegerMinMax] >>> ***/
+
+int
+CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_NativeInteger.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [CN-IntegerMinMax] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_CN_IntegerMinMax_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = {
+ "CN-IntegerMinMax",
+ "CN-IntegerMinMax",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ CN_IntegerMinMax_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerMinMax_tags_1,
+ sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_CN_IntegerMinMax_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/
+
+typedef long CN_IntegerMinLow_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow;
+asn_struct_free_f CN_IntegerMinLow_free;
+asn_struct_print_f CN_IntegerMinLow_print;
+asn_constr_check_f CN_IntegerMinLow_constraint;
+ber_type_decoder_f CN_IntegerMinLow_decode_ber;
+der_type_encoder_f CN_IntegerMinLow_encode_der;
+xer_type_decoder_f CN_IntegerMinLow_decode_xer;
+xer_type_encoder_f CN_IntegerMinLow_encode_xer;
+per_type_decoder_f CN_IntegerMinLow_decode_uper;
+per_type_encoder_f CN_IntegerMinLow_encode_uper;
+
+/*** <<< CODE [CN-IntegerMinLow] >>> ***/
+
+int
+CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value <= 1)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [CN-IntegerMinLow] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_CN_IntegerMinLow_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 } /* (MIN..1) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = {
+ "CN-IntegerMinLow",
+ "CN-IntegerMinLow",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ CN_IntegerMinLow_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerMinLow_tags_1,
+ sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
+ /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_CN_IntegerMinLow_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/
+
+typedef INTEGER_t NO_IntegerMinHigh_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh;
+asn_struct_free_f NO_IntegerMinHigh_free;
+asn_struct_print_f NO_IntegerMinHigh_print;
+asn_constr_check_f NO_IntegerMinHigh_constraint;
+ber_type_decoder_f NO_IntegerMinHigh_decode_ber;
+der_type_encoder_f NO_IntegerMinHigh_encode_der;
+xer_type_decoder_f NO_IntegerMinHigh_decode_xer;
+xer_type_encoder_f NO_IntegerMinHigh_encode_xer;
+per_type_decoder_f NO_IntegerMinHigh_decode_uper;
+per_type_encoder_f NO_IntegerMinHigh_encode_uper;
+
+/*** <<< CODE [NO-IntegerMinHigh] >>> ***/
+
+int
+NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value <= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [NO-IntegerMinHigh] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_NO_IntegerMinHigh_constr_1 GCC_NOTUSED = {
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 } /* (MIN..3000000000) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = {
+ "NO-IntegerMinHigh",
+ "NO-IntegerMinHigh",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerMinHigh_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ INTEGER_decode_uper,
+ INTEGER_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerMinHigh_tags_1,
+ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_NO_IntegerMinHigh_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/
+
+typedef unsigned long NO_IntegerLowHigh_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh;
+asn_struct_free_f NO_IntegerLowHigh_free;
+asn_struct_print_f NO_IntegerLowHigh_print;
+asn_constr_check_f NO_IntegerLowHigh_constraint;
+ber_type_decoder_f NO_IntegerLowHigh_decode_ber;
+der_type_encoder_f NO_IntegerLowHigh_encode_der;
+xer_type_decoder_f NO_IntegerLowHigh_decode_xer;
+xer_type_encoder_f NO_IntegerLowHigh_encode_xer;
+per_type_decoder_f NO_IntegerLowHigh_decode_uper;
+per_type_encoder_f NO_IntegerLowHigh_encode_uper;
+
+/*** <<< CODE [NO-IntegerLowHigh] >>> ***/
+
+int
+NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value >= 1 && value <= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [NO-IntegerLowHigh] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_NO_IntegerLowHigh_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, 1, 3000000000 } /* (1..3000000000) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = {
+ "NO-IntegerLowHigh",
+ "NO-IntegerLowHigh",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerLowHigh_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerLowHigh_tags_1,
+ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_NO_IntegerLowHigh_constr_1,
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/
+
+typedef long CN_IntegerLowMax_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax;
+asn_struct_free_f CN_IntegerLowMax_free;
+asn_struct_print_f CN_IntegerLowMax_print;
+asn_constr_check_f CN_IntegerLowMax_constraint;
+ber_type_decoder_f CN_IntegerLowMax_decode_ber;
+der_type_encoder_f CN_IntegerLowMax_encode_der;
+xer_type_decoder_f CN_IntegerLowMax_decode_xer;
+xer_type_encoder_f CN_IntegerLowMax_encode_xer;
+per_type_decoder_f CN_IntegerLowMax_decode_uper;
+per_type_encoder_f CN_IntegerLowMax_encode_uper;
+
+/*** <<< CODE [CN-IntegerLowMax] >>> ***/
+
+int
+CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 1)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [CN-IntegerLowMax] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_CN_IntegerLowMax_constr_1 GCC_NOTUSED = {
+ { APC_SEMI_CONSTRAINED, -1, -1, 1, 0 } /* (1..MAX) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = {
+ "CN-IntegerLowMax",
+ "CN-IntegerLowMax",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ CN_IntegerLowMax_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerLowMax_tags_1,
+ sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
+ /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_CN_IntegerLowMax_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/
+
+typedef INTEGER_t NO_IntegerHighMax_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax;
+asn_struct_free_f NO_IntegerHighMax_free;
+asn_struct_print_f NO_IntegerHighMax_print;
+asn_constr_check_f NO_IntegerHighMax_constraint;
+ber_type_decoder_f NO_IntegerHighMax_decode_ber;
+der_type_encoder_f NO_IntegerHighMax_encode_der;
+xer_type_decoder_f NO_IntegerHighMax_decode_xer;
+xer_type_encoder_f NO_IntegerHighMax_encode_xer;
+per_type_decoder_f NO_IntegerHighMax_decode_uper;
+per_type_encoder_f NO_IntegerHighMax_encode_uper;
+
+/*** <<< CODE [NO-IntegerHighMax] >>> ***/
+
+int
+NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [NO-IntegerHighMax] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_NO_IntegerHighMax_constr_1 GCC_NOTUSED = {
+ { APC_SEMI_CONSTRAINED, -1, -1, 3000000000, 0 } /* (3000000000..MAX) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = {
+ "NO-IntegerHighMax",
+ "NO-IntegerHighMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerHighMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ INTEGER_decode_uper,
+ INTEGER_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerHighMax_tags_1,
+ sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_NO_IntegerHighMax_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/
+
+typedef INTEGER_t NO_IntegerLowestMax_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax;
+asn_struct_free_f NO_IntegerLowestMax_free;
+asn_struct_print_f NO_IntegerLowestMax_print;
+asn_constr_check_f NO_IntegerLowestMax_constraint;
+ber_type_decoder_f NO_IntegerLowestMax_decode_ber;
+der_type_encoder_f NO_IntegerLowestMax_encode_der;
+xer_type_decoder_f NO_IntegerLowestMax_decode_xer;
+xer_type_encoder_f NO_IntegerLowestMax_encode_xer;
+per_type_decoder_f NO_IntegerLowestMax_decode_uper;
+per_type_encoder_f NO_IntegerLowestMax_encode_uper;
+
+/*** <<< CODE [NO-IntegerLowestMax] >>> ***/
+
+int
+NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ const INTEGER_t *st = (const INTEGER_t *)sptr;
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if(asn_INTEGER2long(st, &value)) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value too large (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ if((value >= -3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [NO-IntegerLowestMax] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_NO_IntegerLowestMax_constr_1 GCC_NOTUSED = {
+ { APC_SEMI_CONSTRAINED, -1, -1, -3000000000, 0 } /* (-3000000000..MAX) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = {
+ "NO-IntegerLowestMax",
+ "NO-IntegerLowestMax",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ NO_IntegerLowestMax_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ INTEGER_decode_uper,
+ INTEGER_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerLowestMax_tags_1,
+ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
+ /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_NO_IntegerLowestMax_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/
+
+typedef unsigned long NO_IntegerOutRange_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange;
+asn_struct_free_f NO_IntegerOutRange_free;
+asn_struct_print_f NO_IntegerOutRange_print;
+asn_constr_check_f NO_IntegerOutRange_constraint;
+ber_type_decoder_f NO_IntegerOutRange_decode_ber;
+der_type_encoder_f NO_IntegerOutRange_encode_der;
+xer_type_decoder_f NO_IntegerOutRange_decode_xer;
+xer_type_encoder_f NO_IntegerOutRange_encode_xer;
+per_type_decoder_f NO_IntegerOutRange_decode_uper;
+per_type_encoder_f NO_IntegerOutRange_encode_uper;
+
+/*** <<< CODE [NO-IntegerOutRange] >>> ***/
+
+int
+NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value >= 3000000000 && value <= 3000000001)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [NO-IntegerOutRange] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_NO_IntegerOutRange_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 1, -1, 3000000000, 3000000001 } /* (3000000000..3000000001) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = {
+ "NO-IntegerOutRange",
+ "NO-IntegerOutRange",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerOutRange_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerOutRange_tags_1,
+ sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_NO_IntegerOutRange_constr_1,
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/
+
+typedef unsigned long NO_IntegerOutValue_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue;
+asn_struct_free_f NO_IntegerOutValue_free;
+asn_struct_print_f NO_IntegerOutValue_print;
+asn_constr_check_f NO_IntegerOutValue_constraint;
+ber_type_decoder_f NO_IntegerOutValue_decode_ber;
+der_type_encoder_f NO_IntegerOutValue_encode_der;
+xer_type_decoder_f NO_IntegerOutValue_decode_xer;
+xer_type_encoder_f NO_IntegerOutValue_encode_xer;
+per_type_decoder_f NO_IntegerOutValue_decode_uper;
+per_type_encoder_f NO_IntegerOutValue_encode_uper;
+
+/*** <<< CODE [NO-IntegerOutValue] >>> ***/
+
+int
+NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ unsigned long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const unsigned long *)sptr;
+
+ if((value == 3000000000)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [NO-IntegerOutValue] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_NO_IntegerOutValue_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 0, -1, 3000000000, 3000000000 } /* (3000000000..3000000000) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = {
+ "NO-IntegerOutValue",
+ "NO-IntegerOutValue",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerOutValue_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerOutValue_tags_1,
+ sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
+ /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_NO_IntegerOutValue_constr_1,
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/
+
+typedef long OK_IntegerInRange1_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1;
+asn_struct_free_f OK_IntegerInRange1_free;
+asn_struct_print_f OK_IntegerInRange1_print;
+asn_constr_check_f OK_IntegerInRange1_constraint;
+ber_type_decoder_f OK_IntegerInRange1_decode_ber;
+der_type_encoder_f OK_IntegerInRange1_encode_der;
+xer_type_decoder_f OK_IntegerInRange1_decode_xer;
+xer_type_encoder_f OK_IntegerInRange1_encode_xer;
+per_type_decoder_f OK_IntegerInRange1_decode_uper;
+per_type_encoder_f OK_IntegerInRange1_encode_uper;
+
+/*** <<< CODE [OK-IntegerInRange1] >>> ***/
+
+int
+OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= -100 && value <= 100)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [OK-IntegerInRange1] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_OK_IntegerInRange1_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 8, 8, -100, 100 } /* (-100..100) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = {
+ "OK-IntegerInRange1",
+ "OK-IntegerInRange1",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange1_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange1_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_OK_IntegerInRange1_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/
+
+typedef long OK_IntegerInRange2_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2;
+asn_struct_free_f OK_IntegerInRange2_free;
+asn_struct_print_f OK_IntegerInRange2_print;
+asn_constr_check_f OK_IntegerInRange2_constraint;
+ber_type_decoder_f OK_IntegerInRange2_decode_ber;
+der_type_encoder_f OK_IntegerInRange2_encode_der;
+xer_type_decoder_f OK_IntegerInRange2_decode_xer;
+xer_type_encoder_f OK_IntegerInRange2_encode_xer;
+per_type_decoder_f OK_IntegerInRange2_decode_uper;
+per_type_encoder_f OK_IntegerInRange2_encode_uper;
+
+/*** <<< CODE [OK-IntegerInRange2] >>> ***/
+
+int
+OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == -100) || (value == 100))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [OK-IntegerInRange2] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_OK_IntegerInRange2_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 8, 8, -100, 100 } /* (-100..100) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = {
+ "OK-IntegerInRange2",
+ "OK-IntegerInRange2",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange2_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange2_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_OK_IntegerInRange2_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/
+
+typedef long OK_IntegerInRange3_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3;
+asn_struct_free_f OK_IntegerInRange3_free;
+asn_struct_print_f OK_IntegerInRange3_print;
+asn_constr_check_f OK_IntegerInRange3_constraint;
+ber_type_decoder_f OK_IntegerInRange3_decode_ber;
+der_type_encoder_f OK_IntegerInRange3_encode_der;
+xer_type_decoder_f OK_IntegerInRange3_decode_xer;
+xer_type_encoder_f OK_IntegerInRange3_encode_xer;
+per_type_decoder_f OK_IntegerInRange3_decode_uper;
+per_type_encoder_f OK_IntegerInRange3_encode_uper;
+
+/*** <<< CODE [OK-IntegerInRange3] >>> ***/
+
+int
+OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= (-2147483647L - 1) && value <= 2147483647)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [OK-IntegerInRange3] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_OK_IntegerInRange3_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = {
+ "OK-IntegerInRange3",
+ "OK-IntegerInRange3",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange3_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange3_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_OK_IntegerInRange3_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/
+
+typedef long OK_IntegerInRange4_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4;
+asn_struct_free_f OK_IntegerInRange4_free;
+asn_struct_print_f OK_IntegerInRange4_print;
+asn_constr_check_f OK_IntegerInRange4_constraint;
+ber_type_decoder_f OK_IntegerInRange4_decode_ber;
+der_type_encoder_f OK_IntegerInRange4_encode_der;
+xer_type_decoder_f OK_IntegerInRange4_decode_xer;
+xer_type_encoder_f OK_IntegerInRange4_encode_xer;
+per_type_decoder_f OK_IntegerInRange4_decode_uper;
+per_type_encoder_f OK_IntegerInRange4_encode_uper;
+
+/*** <<< CODE [OK-IntegerInRange4] >>> ***/
+
+int
+OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [OK-IntegerInRange4] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_OK_IntegerInRange4_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = {
+ "OK-IntegerInRange4",
+ "OK-IntegerInRange4",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange4_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange4_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_OK_IntegerInRange4_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/
+
+typedef long OK_IntegerInRange5_t;
+
+/*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5;
+asn_struct_free_f OK_IntegerInRange5_free;
+asn_struct_print_f OK_IntegerInRange5_print;
+asn_constr_check_f OK_IntegerInRange5_constraint;
+ber_type_decoder_f OK_IntegerInRange5_decode_ber;
+der_type_encoder_f OK_IntegerInRange5_encode_der;
+xer_type_decoder_f OK_IntegerInRange5_decode_xer;
+xer_type_encoder_f OK_IntegerInRange5_encode_xer;
+per_type_decoder_f OK_IntegerInRange5_decode_uper;
+per_type_encoder_f OK_IntegerInRange5_encode_uper;
+
+/*** <<< CODE [OK-IntegerInRange5] >>> ***/
+
+int
+OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [OK-IntegerInRange5] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_OK_IntegerInRange5_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647,...) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = {
+ "OK-IntegerInRange5",
+ "OK-IntegerInRange5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_IntegerInRange5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_IntegerInRange5_tags_1,
+ sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
+ asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
+ /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_OK_IntegerInRange5_constr_1,
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/
+
+typedef unsigned long NO_IntegerInRange6_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6;
+asn_struct_free_f NO_IntegerInRange6_free;
+asn_struct_print_f NO_IntegerInRange6_print;
+asn_constr_check_f NO_IntegerInRange6_constraint;
+ber_type_decoder_f NO_IntegerInRange6_decode_ber;
+der_type_encoder_f NO_IntegerInRange6_encode_der;
+xer_type_decoder_f NO_IntegerInRange6_decode_xer;
+xer_type_encoder_f NO_IntegerInRange6_encode_xer;
+per_type_decoder_f NO_IntegerInRange6_decode_uper;
+per_type_encoder_f NO_IntegerInRange6_encode_uper;
+
+/*** <<< CODE [NO-IntegerInRange6] >>> ***/
+
+int
+NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ /* Constraint check succeeded */
+ return 0;
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< CTDEFS [NO-IntegerInRange6] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_NO_IntegerInRange6_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/
+
+static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = {
+ 0, 0, 0, 0, 0,
+ 0, /* Native long size */
+ 1 /* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = {
+ "NO-IntegerInRange6",
+ "NO-IntegerInRange6",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_IntegerInRange6_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerInRange6_tags_1,
+ sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
+ /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
+ /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_NO_IntegerInRange6_constr_1,
+ 0, 0, /* No members */
+ &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/
+
+typedef enum CN_IntegerEnumerated1 {
+ CN_IntegerEnumerated1_a = 1,
+ CN_IntegerEnumerated1_b = 2
+} e_CN_IntegerEnumerated1;
+
+/*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/
+
+typedef long CN_IntegerEnumerated1_t;
+
+/*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1;
+asn_struct_free_f CN_IntegerEnumerated1_free;
+asn_struct_print_f CN_IntegerEnumerated1_print;
+asn_constr_check_f CN_IntegerEnumerated1_constraint;
+ber_type_decoder_f CN_IntegerEnumerated1_decode_ber;
+der_type_encoder_f CN_IntegerEnumerated1_encode_der;
+xer_type_decoder_f CN_IntegerEnumerated1_decode_xer;
+xer_type_encoder_f CN_IntegerEnumerated1_encode_xer;
+per_type_decoder_f CN_IntegerEnumerated1_decode_uper;
+per_type_encoder_f CN_IntegerEnumerated1_encode_uper;
+
+/*** <<< CODE [CN-IntegerEnumerated1] >>> ***/
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = {
+ "CN-IntegerEnumerated1",
+ "CN-IntegerEnumerated1",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NativeInteger_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ NativeInteger_decode_uper,
+ NativeInteger_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_CN_IntegerEnumerated1_tags_1,
+ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
+ /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
+ asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */
+ sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
+ /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/
+
+#include <INTEGER.h>
+
+/*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/
+
+typedef enum NO_IntegerEnumerated2 {
+ NO_IntegerEnumerated2_a = 1,
+ NO_IntegerEnumerated2_b = 3000000000
+} e_NO_IntegerEnumerated2;
+
+/*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/
+
+typedef INTEGER_t NO_IntegerEnumerated2_t;
+
+/*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2;
+asn_struct_free_f NO_IntegerEnumerated2_free;
+asn_struct_print_f NO_IntegerEnumerated2_print;
+asn_constr_check_f NO_IntegerEnumerated2_constraint;
+ber_type_decoder_f NO_IntegerEnumerated2_decode_ber;
+der_type_encoder_f NO_IntegerEnumerated2_encode_der;
+xer_type_decoder_f NO_IntegerEnumerated2_decode_xer;
+xer_type_encoder_f NO_IntegerEnumerated2_encode_xer;
+per_type_decoder_f NO_IntegerEnumerated2_decode_uper;
+per_type_encoder_f NO_IntegerEnumerated2_encode_uper;
+
+/*** <<< CODE [NO-IntegerEnumerated2] >>> ***/
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = {
+ "NO-IntegerEnumerated2",
+ "NO-IntegerEnumerated2",
+ INTEGER_free,
+ INTEGER_print,
+ INTEGER_compare,
+ INTEGER_constraint,
+ INTEGER_decode_ber,
+ INTEGER_encode_der,
+ INTEGER_decode_xer,
+ INTEGER_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ INTEGER_decode_uper,
+ INTEGER_encode_uper,
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_IntegerEnumerated2_tags_1,
+ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
+ /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
+ asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
+ /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/91-cond-int-blessSize-OK.asn1 b/tests/tests-asn1c-compiler/91-cond-int-blessSize-OK.asn1
new file mode 100644
index 0000000..0a8e543
--- /dev/null
+++ b/tests/tests-asn1c-compiler/91-cond-int-blessSize-OK.asn1
@@ -0,0 +1,20 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .91
+
+ModuleConditionalIntegerType-with-fblessSIZE
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 91 }
+DEFINITIONS ::=
+BEGIN
+
+ OK-Integer1 ::= INTEGER (SIZE(1))
+ OK-Integer2 ::= INTEGER (SIZE(2))
+ OK-Integer3 ::= INTEGER (SIZE(3))
+ OK-Integer4 ::= INTEGER (SIZE(4))
+ NO-Integer5 ::= INTEGER (SIZE(5))
+
+END
diff --git a/tests/tests-asn1c-compiler/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE b/tests/tests-asn1c-compiler/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE
new file mode 100644
index 0000000..c504ce2
--- /dev/null
+++ b/tests/tests-asn1c-compiler/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE
@@ -0,0 +1,395 @@
+
+/*** <<< INCLUDES [OK-Integer1] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-Integer1] >>> ***/
+
+typedef long OK_Integer1_t;
+
+/*** <<< FUNC-DECLS [OK-Integer1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_Integer1;
+asn_struct_free_f OK_Integer1_free;
+asn_struct_print_f OK_Integer1_print;
+asn_constr_check_f OK_Integer1_constraint;
+ber_type_decoder_f OK_Integer1_decode_ber;
+der_type_encoder_f OK_Integer1_encode_der;
+xer_type_decoder_f OK_Integer1_decode_xer;
+xer_type_encoder_f OK_Integer1_encode_xer;
+
+/*** <<< CODE [OK-Integer1] >>> ***/
+
+int
+OK_Integer1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_NativeInteger.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-Integer1] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_Integer1_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_Integer1 = {
+ "OK-Integer1",
+ "OK-Integer1",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_Integer1_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_Integer1_tags_1,
+ sizeof(asn_DEF_OK_Integer1_tags_1)
+ /sizeof(asn_DEF_OK_Integer1_tags_1[0]), /* 1 */
+ asn_DEF_OK_Integer1_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_Integer1_tags_1)
+ /sizeof(asn_DEF_OK_Integer1_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-Integer2] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-Integer2] >>> ***/
+
+typedef long OK_Integer2_t;
+
+/*** <<< FUNC-DECLS [OK-Integer2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_Integer2;
+asn_struct_free_f OK_Integer2_free;
+asn_struct_print_f OK_Integer2_print;
+asn_constr_check_f OK_Integer2_constraint;
+ber_type_decoder_f OK_Integer2_decode_ber;
+der_type_encoder_f OK_Integer2_encode_der;
+xer_type_decoder_f OK_Integer2_decode_xer;
+xer_type_encoder_f OK_Integer2_encode_xer;
+
+/*** <<< CODE [OK-Integer2] >>> ***/
+
+int
+OK_Integer2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_NativeInteger.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-Integer2] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_Integer2_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_Integer2 = {
+ "OK-Integer2",
+ "OK-Integer2",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_Integer2_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_Integer2_tags_1,
+ sizeof(asn_DEF_OK_Integer2_tags_1)
+ /sizeof(asn_DEF_OK_Integer2_tags_1[0]), /* 1 */
+ asn_DEF_OK_Integer2_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_Integer2_tags_1)
+ /sizeof(asn_DEF_OK_Integer2_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-Integer3] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-Integer3] >>> ***/
+
+typedef long OK_Integer3_t;
+
+/*** <<< FUNC-DECLS [OK-Integer3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_Integer3;
+asn_struct_free_f OK_Integer3_free;
+asn_struct_print_f OK_Integer3_print;
+asn_constr_check_f OK_Integer3_constraint;
+ber_type_decoder_f OK_Integer3_decode_ber;
+der_type_encoder_f OK_Integer3_encode_der;
+xer_type_decoder_f OK_Integer3_decode_xer;
+xer_type_encoder_f OK_Integer3_encode_xer;
+
+/*** <<< CODE [OK-Integer3] >>> ***/
+
+int
+OK_Integer3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_NativeInteger.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-Integer3] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_Integer3_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_Integer3 = {
+ "OK-Integer3",
+ "OK-Integer3",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_Integer3_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_Integer3_tags_1,
+ sizeof(asn_DEF_OK_Integer3_tags_1)
+ /sizeof(asn_DEF_OK_Integer3_tags_1[0]), /* 1 */
+ asn_DEF_OK_Integer3_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_Integer3_tags_1)
+ /sizeof(asn_DEF_OK_Integer3_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [OK-Integer4] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [OK-Integer4] >>> ***/
+
+typedef long OK_Integer4_t;
+
+/*** <<< FUNC-DECLS [OK-Integer4] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OK_Integer4;
+asn_struct_free_f OK_Integer4_free;
+asn_struct_print_f OK_Integer4_print;
+asn_constr_check_f OK_Integer4_constraint;
+ber_type_decoder_f OK_Integer4_decode_ber;
+der_type_encoder_f OK_Integer4_encode_der;
+xer_type_decoder_f OK_Integer4_decode_xer;
+xer_type_encoder_f OK_Integer4_encode_xer;
+
+/*** <<< CODE [OK-Integer4] >>> ***/
+
+int
+OK_Integer4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_NativeInteger.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [OK-Integer4] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_OK_Integer4_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_OK_Integer4 = {
+ "OK-Integer4",
+ "OK-Integer4",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ OK_Integer4_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OK_Integer4_tags_1,
+ sizeof(asn_DEF_OK_Integer4_tags_1)
+ /sizeof(asn_DEF_OK_Integer4_tags_1[0]), /* 1 */
+ asn_DEF_OK_Integer4_tags_1, /* Same as above */
+ sizeof(asn_DEF_OK_Integer4_tags_1)
+ /sizeof(asn_DEF_OK_Integer4_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [NO-Integer5] >>> ***/
+
+#include <NativeInteger.h>
+
+/*** <<< TYPE-DECLS [NO-Integer5] >>> ***/
+
+typedef long NO_Integer5_t;
+
+/*** <<< FUNC-DECLS [NO-Integer5] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NO_Integer5;
+asn_struct_free_f NO_Integer5_free;
+asn_struct_print_f NO_Integer5_print;
+asn_constr_check_f NO_Integer5_constraint;
+ber_type_decoder_f NO_Integer5_decode_ber;
+der_type_encoder_f NO_Integer5_encode_der;
+xer_type_decoder_f NO_Integer5_decode_xer;
+xer_type_encoder_f NO_Integer5_encode_xer;
+
+/*** <<< CODE [NO-Integer5] >>> ***/
+
+int
+NO_Integer5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_NativeInteger.check_constraints;
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [NO-Integer5] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_NO_Integer5_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NO_Integer5 = {
+ "NO-Integer5",
+ "NO-Integer5",
+ NativeInteger_free,
+ NativeInteger_print,
+ NativeInteger_compare,
+ NO_Integer5_constraint,
+ NativeInteger_decode_ber,
+ NativeInteger_encode_der,
+ NativeInteger_decode_xer,
+ NativeInteger_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NO_Integer5_tags_1,
+ sizeof(asn_DEF_NO_Integer5_tags_1)
+ /sizeof(asn_DEF_NO_Integer5_tags_1[0]), /* 1 */
+ asn_DEF_NO_Integer5_tags_1, /* Same as above */
+ sizeof(asn_DEF_NO_Integer5_tags_1)
+ /sizeof(asn_DEF_NO_Integer5_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0, 0, /* No members */
+ 0 /* No specifics */
+};
+
diff --git a/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1 b/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1
new file mode 100644
index 0000000..e57312d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1
@@ -0,0 +1,90 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .92
+
+ModuleCircularReferences
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 92 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ Everything ::= SEQUENCE {
+ ch1 Choice1,
+ ch2 Choice2,
+ ch3 Choice3,
+ set Set,
+ a Alpha,
+ b Beta,
+ g Gamma,
+ ot OneTwo,
+ tt TwoThree,
+ to ThreeOne
+ }
+
+ -- This type refers to the type directly containing itself.
+ Choice1 ::= CHOICE {
+ something Everything,
+ ...,
+ some2 Everything
+ }
+
+ Choice2 ::= CHOICE {
+ typeref TypeRef,
+ ...,
+ some3 Everything
+ }
+
+ Choice3 ::= CHOICE {
+ a SEQUENCE {
+ aa Everything
+ },
+ b Everything,
+ c SEQUENCE OF Choice3
+ }
+
+ Set ::= SET OF SEQUENCE {
+ int INTEGER,
+ set Set,
+ seq Sequence,
+ set2 Set OPTIONAL,
+ ...,
+ set3 Set
+ }
+
+ Sequence ::= SEQUENCE {
+ a INTEGER,
+ seq Sequence OPTIONAL,
+ ...,
+ b INTEGER,
+ set Set OPTIONAL
+ }
+
+ TypeRef ::= Sequence
+
+ Alpha ::= SEQUENCE {
+ a Beta,
+ b SEQUENCE {
+ b Beta OPTIONAL
+ }
+ }
+
+ Beta ::= SEQUENCE {
+ b Alpha OPTIONAL,
+ g Gamma OPTIONAL
+ }
+
+ Gamma ::= SEQUENCE {
+ o TwoThree,
+ a Alpha, -- expected inline
+ b Beta -- expected inline
+ }
+
+ -- This is a true superdependency.
+ OneTwo ::= SET { m12 TwoThree }
+ TwoThree ::= SET { m23 ThreeOne }
+ ThreeOne ::= SET { m31 OneTwo, g Gamma }
+
+END
diff --git a/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1.-Pfindirect-choice b/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1.-Pfindirect-choice
new file mode 100644
index 0000000..47430a9
--- /dev/null
+++ b/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1.-Pfindirect-choice
@@ -0,0 +1,1773 @@
+
+/*** <<< INCLUDES [Everything] >>> ***/
+
+#include "Set.h"
+#include "Alpha.h"
+#include "Beta.h"
+#include "Gamma.h"
+#include "OneTwo.h"
+#include "TwoThree.h"
+#include "ThreeOne.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Everything] >>> ***/
+
+struct Choice1;
+struct Choice2;
+struct Choice3;
+
+/*** <<< TYPE-DECLS [Everything] >>> ***/
+
+typedef struct Everything {
+ struct Choice1 *ch1;
+ struct Choice2 *ch2;
+ struct Choice3 *ch3;
+ Set_t set;
+ Alpha_t a;
+ Beta_t b;
+ Gamma_t g;
+ OneTwo_t ot;
+ TwoThree_t tt;
+ ThreeOne_t to;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Everything_t;
+
+/*** <<< FUNC-DECLS [Everything] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Everything;
+extern asn_SEQUENCE_specifics_t asn_SPC_Everything_specs_1;
+extern asn_TYPE_member_t asn_MBR_Everything_1[10];
+
+/*** <<< POST-INCLUDE [Everything] >>> ***/
+
+#include "Choice1.h"
+#include "Choice2.h"
+#include "Choice3.h"
+
+/*** <<< STAT-DEFS [Everything] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Everything_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Everything, ch1),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ch1"
+ },
+ { ATF_POINTER, 0, offsetof(struct Everything, ch2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ch2"
+ },
+ { ATF_POINTER, 0, offsetof(struct Everything, ch3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ch3"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, set),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Alpha,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, g),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Gamma,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "g"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, ot),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_OneTwo,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ot"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, tt),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TwoThree,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "tt"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, to),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_ThreeOne,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "to"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Everything_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Everything_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ch1 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ch2 */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ch3 */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* g */
+ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* ot */
+ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* tt */
+ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 } /* to */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Everything_specs_1 = {
+ sizeof(struct Everything),
+ offsetof(struct Everything, _asn_ctx),
+ asn_MAP_Everything_tag2el_1,
+ 10, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Everything = {
+ "Everything",
+ "Everything",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Everything_tags_1,
+ sizeof(asn_DEF_Everything_tags_1)
+ /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */
+ asn_DEF_Everything_tags_1, /* Same as above */
+ sizeof(asn_DEF_Everything_tags_1)
+ /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Everything_1,
+ 10, /* Elements count */
+ &asn_SPC_Everything_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice1] >>> ***/
+
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice1] >>> ***/
+
+typedef enum Choice1_PR {
+ Choice1_PR_NOTHING, /* No components present */
+ Choice1_PR_something,
+ /* Extensions may appear below */
+ Choice1_PR_some2
+} Choice1_PR;
+
+/*** <<< FWD-DECLS [Choice1] >>> ***/
+
+struct Everything;
+
+/*** <<< TYPE-DECLS [Choice1] >>> ***/
+
+typedef struct Choice1 {
+ Choice1_PR present;
+ union Choice1_u {
+ struct Everything *something;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ struct Everything *some2;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice1_t;
+
+/*** <<< FUNC-DECLS [Choice1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice1;
+extern asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice1_1[2];
+
+/*** <<< POST-INCLUDE [Choice1] >>> ***/
+
+#include "Everything.h"
+
+/*** <<< STAT-DEFS [Choice1] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Choice1_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Choice1, choice.something),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "something"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice1, choice.some2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "some2"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* something */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some2 */
+};
+asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1 = {
+ sizeof(struct Choice1),
+ offsetof(struct Choice1, _asn_ctx),
+ offsetof(struct Choice1, present),
+ sizeof(((struct Choice1 *)0)->present),
+ asn_MAP_Choice1_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice1 = {
+ "Choice1",
+ "Choice1",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice1_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice2] >>> ***/
+
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice2] >>> ***/
+
+typedef enum Choice2_PR {
+ Choice2_PR_NOTHING, /* No components present */
+ Choice2_PR_typeref,
+ /* Extensions may appear below */
+ Choice2_PR_some3
+} Choice2_PR;
+
+/*** <<< FWD-DECLS [Choice2] >>> ***/
+
+struct Sequence;
+struct Everything;
+
+/*** <<< TYPE-DECLS [Choice2] >>> ***/
+
+typedef struct Choice2 {
+ Choice2_PR present;
+ union Choice2_u {
+ struct Sequence *typeref;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ struct Everything *some3;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice2_t;
+
+/*** <<< FUNC-DECLS [Choice2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice2;
+extern asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice2_1[2];
+
+/*** <<< POST-INCLUDE [Choice2] >>> ***/
+
+#include "TypeRef.h"
+#include "Everything.h"
+
+/*** <<< STAT-DEFS [Choice2] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Choice2_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Choice2, choice.typeref),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TypeRef,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "typeref"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice2, choice.some3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "some3"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* typeref */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some3 */
+};
+asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
+ sizeof(struct Choice2),
+ offsetof(struct Choice2, _asn_ctx),
+ offsetof(struct Choice2, present),
+ sizeof(((struct Choice2 *)0)->present),
+ asn_MAP_Choice2_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice2 = {
+ "Choice2",
+ "Choice2",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice2_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice3] >>> ***/
+
+#include <constr_SEQUENCE.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice3] >>> ***/
+
+typedef enum Choice3_PR {
+ Choice3_PR_NOTHING, /* No components present */
+ Choice3_PR_a,
+ Choice3_PR_b,
+ Choice3_PR_c
+} Choice3_PR;
+
+/*** <<< FWD-DECLS [Choice3] >>> ***/
+
+struct Everything;
+struct Choice3;
+
+/*** <<< TYPE-DECLS [Choice3] >>> ***/
+
+typedef struct Choice3 {
+ Choice3_PR present;
+ union Choice3_u {
+ struct a {
+ struct Everything *aa;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *a;
+ struct Everything *b;
+ struct c {
+ A_SEQUENCE_OF(struct Choice3) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *c;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice3_t;
+
+/*** <<< FUNC-DECLS [Choice3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice3;
+extern asn_CHOICE_specifics_t asn_SPC_Choice3_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice3_1[3];
+
+/*** <<< POST-INCLUDE [Choice3] >>> ***/
+
+#include "Everything.h"
+#include "Choice3.h"
+
+/*** <<< STAT-DEFS [Choice3] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_a_2[] = {
+ { ATF_POINTER, 0, offsetof(struct a, aa),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "aa"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_a_tags_2[] = {
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_a_tag2el_2[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* aa */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_a_specs_2 = {
+ sizeof(struct a),
+ offsetof(struct a, _asn_ctx),
+ asn_MAP_a_tag2el_2,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_a_2 = {
+ "a",
+ "a",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_a_tags_2,
+ sizeof(asn_DEF_a_tags_2)
+ /sizeof(asn_DEF_a_tags_2[0]) - 1, /* 1 */
+ asn_DEF_a_tags_2, /* Same as above */
+ sizeof(asn_DEF_a_tags_2)
+ /sizeof(asn_DEF_a_tags_2[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_a_2,
+ 1, /* Elements count */
+ &asn_SPC_a_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_c_5[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_Choice3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_c_tags_5[] = {
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_c_specs_5 = {
+ sizeof(struct c),
+ offsetof(struct c, _asn_ctx),
+ 2, /* XER encoding is XMLValueList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_c_5 = {
+ "c",
+ "c",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_c_tags_5,
+ sizeof(asn_DEF_c_tags_5)
+ /sizeof(asn_DEF_c_tags_5[0]) - 1, /* 1 */
+ asn_DEF_c_tags_5, /* Same as above */
+ sizeof(asn_DEF_c_tags_5)
+ /sizeof(asn_DEF_c_tags_5[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_c_5,
+ 1, /* Single element */
+ &asn_SPC_c_specs_5 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Choice3_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Choice3, choice.a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_a_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice3, choice.b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice3, choice.c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_c_5,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice3_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_CHOICE_specifics_t asn_SPC_Choice3_specs_1 = {
+ sizeof(struct Choice3),
+ offsetof(struct Choice3, _asn_ctx),
+ offsetof(struct Choice3, present),
+ sizeof(((struct Choice3 *)0)->present),
+ asn_MAP_Choice3_tag2el_1,
+ 3, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice3 = {
+ "Choice3",
+ "Choice3",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice3_1,
+ 3, /* Elements count */
+ &asn_SPC_Choice3_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Set] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+#include <constr_SET_OF.h>
+
+/*** <<< FWD-DECLS [Set] >>> ***/
+
+struct Set;
+struct Sequence;
+
+/*** <<< FWD-DEFS [Set] >>> ***/
+
+typedef struct Member {
+ long Int;
+ struct Set *set;
+ struct Sequence *seq;
+ struct Set *set2 /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ struct Set *set3;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Member;
+
+/*** <<< TYPE-DECLS [Set] >>> ***/
+
+typedef struct Set {
+ A_SET_OF(Member) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Set_t;
+
+/*** <<< FUNC-DECLS [Set] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Set;
+extern asn_SET_OF_specifics_t asn_SPC_Set_specs_1;
+extern asn_TYPE_member_t asn_MBR_Set_1[1];
+
+/*** <<< POST-INCLUDE [Set] >>> ***/
+
+#include "Set.h"
+#include "Sequence.h"
+
+/*** <<< STAT-DEFS [Set] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Member_2[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Member, Int),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int"
+ },
+ { ATF_POINTER, 0, offsetof(struct Member, set),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set"
+ },
+ { ATF_POINTER, 0, offsetof(struct Member, seq),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "seq"
+ },
+ { ATF_POINTER, 2, offsetof(struct Member, set2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set2"
+ },
+ { ATF_POINTER, 1, offsetof(struct Member, set3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set3"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Member_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* set */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* seq */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set2 */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* set3 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = {
+ sizeof(struct Member),
+ offsetof(struct Member, _asn_ctx),
+ asn_MAP_Member_tag2el_2,
+ 5, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 3, /* Start extensions */
+ 6 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_Member_2 = {
+ "SEQUENCE",
+ "SEQUENCE",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Member_tags_2,
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ asn_DEF_Member_tags_2, /* Same as above */
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Member_2,
+ 5, /* Elements count */
+ &asn_SPC_Member_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Set_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Member_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Set_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_Set_specs_1 = {
+ sizeof(struct Set),
+ offsetof(struct Set, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Set = {
+ "Set",
+ "Set",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Set_tags_1,
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ asn_DEF_Set_tags_1, /* Same as above */
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Set_1,
+ 1, /* Single element */
+ &asn_SPC_Set_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Sequence] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Sequence] >>> ***/
+
+struct Sequence;
+struct Set;
+
+/*** <<< TYPE-DECLS [Sequence] >>> ***/
+
+typedef struct Sequence {
+ long a;
+ struct Sequence *seq /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ long *b;
+ struct Set *set /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Sequence_t;
+
+/*** <<< FUNC-DECLS [Sequence] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Sequence;
+extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
+extern asn_TYPE_member_t asn_MBR_Sequence_1[4];
+
+/*** <<< POST-INCLUDE [Sequence] >>> ***/
+
+#include "Sequence.h"
+#include "Set.h"
+
+/*** <<< STAT-DEFS [Sequence] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Sequence_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_POINTER, 3, offsetof(struct Sequence, seq),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "seq"
+ },
+ { ATF_POINTER, 2, offsetof(struct Sequence, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_POINTER, 1, offsetof(struct Sequence, set),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* seq */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* set */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
+ sizeof(struct Sequence),
+ offsetof(struct Sequence, _asn_ctx),
+ asn_MAP_Sequence_tag2el_1,
+ 4, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 5 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Sequence = {
+ "Sequence",
+ "Sequence",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Sequence_tags_1,
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ asn_DEF_Sequence_tags_1, /* Same as above */
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 4, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [TypeRef] >>> ***/
+
+#include "Sequence.h"
+
+/*** <<< TYPE-DECLS [TypeRef] >>> ***/
+
+typedef Sequence_t TypeRef_t;
+
+/*** <<< FUNC-DECLS [TypeRef] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TypeRef;
+asn_struct_free_f TypeRef_free;
+asn_struct_print_f TypeRef_print;
+asn_constr_check_f TypeRef_constraint;
+ber_type_decoder_f TypeRef_decode_ber;
+der_type_encoder_f TypeRef_encode_der;
+xer_type_decoder_f TypeRef_decode_xer;
+xer_type_encoder_f TypeRef_encode_xer;
+
+/*** <<< CODE [TypeRef] >>> ***/
+
+/*
+ * This type is implemented using Sequence,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [TypeRef] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_TypeRef_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TypeRef = {
+ "TypeRef",
+ "TypeRef",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_TypeRef_tags_1,
+ sizeof(asn_DEF_TypeRef_tags_1)
+ /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */
+ asn_DEF_TypeRef_tags_1, /* Same as above */
+ sizeof(asn_DEF_TypeRef_tags_1)
+ /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 4, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Alpha] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Alpha] >>> ***/
+
+struct Beta;
+
+/*** <<< TYPE-DECLS [Alpha] >>> ***/
+
+typedef struct Alpha {
+ struct Beta *a;
+ struct b {
+ struct Beta *b /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Alpha_t;
+
+/*** <<< FUNC-DECLS [Alpha] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Alpha;
+extern asn_SEQUENCE_specifics_t asn_SPC_Alpha_specs_1;
+extern asn_TYPE_member_t asn_MBR_Alpha_1[2];
+
+/*** <<< POST-INCLUDE [Alpha] >>> ***/
+
+#include "Beta.h"
+
+/*** <<< STAT-DEFS [Alpha] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_b_3[] = {
+ { ATF_POINTER, 1, offsetof(struct b, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_b_tags_3[] = {
+ (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* b */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_b_specs_3 = {
+ sizeof(struct b),
+ offsetof(struct b, _asn_ctx),
+ asn_MAP_b_tag2el_3,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_b_3 = {
+ "b",
+ "b",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_b_tags_3,
+ sizeof(asn_DEF_b_tags_3)
+ /sizeof(asn_DEF_b_tags_3[0]) - 1, /* 1 */
+ asn_DEF_b_tags_3, /* Same as above */
+ sizeof(asn_DEF_b_tags_3)
+ /sizeof(asn_DEF_b_tags_3[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_b_3,
+ 1, /* Elements count */
+ &asn_SPC_b_specs_3 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Alpha_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Alpha, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Alpha, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_b_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Alpha_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Alpha_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* b */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Alpha_specs_1 = {
+ sizeof(struct Alpha),
+ offsetof(struct Alpha, _asn_ctx),
+ asn_MAP_Alpha_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Alpha = {
+ "Alpha",
+ "Alpha",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Alpha_tags_1,
+ sizeof(asn_DEF_Alpha_tags_1)
+ /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */
+ asn_DEF_Alpha_tags_1, /* Same as above */
+ sizeof(asn_DEF_Alpha_tags_1)
+ /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Alpha_1,
+ 2, /* Elements count */
+ &asn_SPC_Alpha_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Beta] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Beta] >>> ***/
+
+struct Alpha;
+struct Gamma;
+
+/*** <<< TYPE-DECLS [Beta] >>> ***/
+
+typedef struct Beta {
+ struct Alpha *b /* OPTIONAL */;
+ struct Gamma *g /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Beta_t;
+
+/*** <<< FUNC-DECLS [Beta] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Beta;
+extern asn_SEQUENCE_specifics_t asn_SPC_Beta_specs_1;
+extern asn_TYPE_member_t asn_MBR_Beta_1[2];
+
+/*** <<< POST-INCLUDE [Beta] >>> ***/
+
+#include "Alpha.h"
+#include "Gamma.h"
+
+/*** <<< STAT-DEFS [Beta] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Beta_1[] = {
+ { ATF_POINTER, 2, offsetof(struct Beta, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Alpha,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_POINTER, 1, offsetof(struct Beta, g),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Gamma,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "g"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Beta_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Beta_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Beta_specs_1 = {
+ sizeof(struct Beta),
+ offsetof(struct Beta, _asn_ctx),
+ asn_MAP_Beta_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Beta = {
+ "Beta",
+ "Beta",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Beta_tags_1,
+ sizeof(asn_DEF_Beta_tags_1)
+ /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */
+ asn_DEF_Beta_tags_1, /* Same as above */
+ sizeof(asn_DEF_Beta_tags_1)
+ /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Beta_1,
+ 2, /* Elements count */
+ &asn_SPC_Beta_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Gamma] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Gamma] >>> ***/
+
+struct TwoThree;
+struct Alpha;
+struct Beta;
+
+/*** <<< TYPE-DECLS [Gamma] >>> ***/
+
+typedef struct Gamma {
+ struct TwoThree *o;
+ struct Alpha *a;
+ struct Beta *b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Gamma_t;
+
+/*** <<< FUNC-DECLS [Gamma] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Gamma;
+extern asn_SEQUENCE_specifics_t asn_SPC_Gamma_specs_1;
+extern asn_TYPE_member_t asn_MBR_Gamma_1[3];
+
+/*** <<< POST-INCLUDE [Gamma] >>> ***/
+
+#include "TwoThree.h"
+#include "Alpha.h"
+#include "Beta.h"
+
+/*** <<< STAT-DEFS [Gamma] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Gamma_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Gamma, o),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TwoThree,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "o"
+ },
+ { ATF_POINTER, 0, offsetof(struct Gamma, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Alpha,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_POINTER, 0, offsetof(struct Gamma, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Gamma_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Gamma_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* o */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Gamma_specs_1 = {
+ sizeof(struct Gamma),
+ offsetof(struct Gamma, _asn_ctx),
+ asn_MAP_Gamma_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Gamma = {
+ "Gamma",
+ "Gamma",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Gamma_tags_1,
+ sizeof(asn_DEF_Gamma_tags_1)
+ /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */
+ asn_DEF_Gamma_tags_1, /* Same as above */
+ sizeof(asn_DEF_Gamma_tags_1)
+ /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Gamma_1,
+ 3, /* Elements count */
+ &asn_SPC_Gamma_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [OneTwo] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [OneTwo] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum OneTwo_PR {
+ OneTwo_PR_m12, /* Member m12 is present */
+} OneTwo_PR;
+
+/*** <<< FWD-DECLS [OneTwo] >>> ***/
+
+struct TwoThree;
+
+/*** <<< TYPE-DECLS [OneTwo] >>> ***/
+
+typedef struct OneTwo {
+ struct TwoThree *m12;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pOneTwo, OneTwo_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} OneTwo_t;
+
+/*** <<< FUNC-DECLS [OneTwo] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OneTwo;
+extern asn_SET_specifics_t asn_SPC_OneTwo_specs_1;
+extern asn_TYPE_member_t asn_MBR_OneTwo_1[1];
+
+/*** <<< POST-INCLUDE [OneTwo] >>> ***/
+
+#include "TwoThree.h"
+
+/*** <<< STAT-DEFS [OneTwo] >>> ***/
+
+asn_TYPE_member_t asn_MBR_OneTwo_1[] = {
+ { ATF_POINTER, 0, offsetof(struct OneTwo, m12),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TwoThree,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m12"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_OneTwo_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_OneTwo_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m12 */
+};
+static const uint8_t asn_MAP_OneTwo_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+asn_SET_specifics_t asn_SPC_OneTwo_specs_1 = {
+ sizeof(struct OneTwo),
+ offsetof(struct OneTwo, _asn_ctx),
+ offsetof(struct OneTwo, _presence_map),
+ asn_MAP_OneTwo_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_OneTwo_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_OneTwo_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_OneTwo = {
+ "OneTwo",
+ "OneTwo",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OneTwo_tags_1,
+ sizeof(asn_DEF_OneTwo_tags_1)
+ /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */
+ asn_DEF_OneTwo_tags_1, /* Same as above */
+ sizeof(asn_DEF_OneTwo_tags_1)
+ /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_OneTwo_1,
+ 1, /* Elements count */
+ &asn_SPC_OneTwo_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [TwoThree] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [TwoThree] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum TwoThree_PR {
+ TwoThree_PR_m23, /* Member m23 is present */
+} TwoThree_PR;
+
+/*** <<< FWD-DECLS [TwoThree] >>> ***/
+
+struct ThreeOne;
+
+/*** <<< TYPE-DECLS [TwoThree] >>> ***/
+
+typedef struct TwoThree {
+ struct ThreeOne *m23;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pTwoThree, TwoThree_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TwoThree_t;
+
+/*** <<< FUNC-DECLS [TwoThree] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TwoThree;
+extern asn_SET_specifics_t asn_SPC_TwoThree_specs_1;
+extern asn_TYPE_member_t asn_MBR_TwoThree_1[1];
+
+/*** <<< POST-INCLUDE [TwoThree] >>> ***/
+
+#include "ThreeOne.h"
+
+/*** <<< STAT-DEFS [TwoThree] >>> ***/
+
+asn_TYPE_member_t asn_MBR_TwoThree_1[] = {
+ { ATF_POINTER, 0, offsetof(struct TwoThree, m23),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_ThreeOne,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m23"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_TwoThree_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_TwoThree_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m23 */
+};
+static const uint8_t asn_MAP_TwoThree_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+asn_SET_specifics_t asn_SPC_TwoThree_specs_1 = {
+ sizeof(struct TwoThree),
+ offsetof(struct TwoThree, _asn_ctx),
+ offsetof(struct TwoThree, _presence_map),
+ asn_MAP_TwoThree_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_TwoThree_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_TwoThree_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_TwoThree = {
+ "TwoThree",
+ "TwoThree",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_TwoThree_tags_1,
+ sizeof(asn_DEF_TwoThree_tags_1)
+ /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */
+ asn_DEF_TwoThree_tags_1, /* Same as above */
+ sizeof(asn_DEF_TwoThree_tags_1)
+ /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_TwoThree_1,
+ 1, /* Elements count */
+ &asn_SPC_TwoThree_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ThreeOne] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [ThreeOne] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum ThreeOne_PR {
+ ThreeOne_PR_m31, /* Member m31 is present */
+ ThreeOne_PR_g, /* Member g is present */
+} ThreeOne_PR;
+
+/*** <<< FWD-DECLS [ThreeOne] >>> ***/
+
+struct OneTwo;
+struct Gamma;
+
+/*** <<< TYPE-DECLS [ThreeOne] >>> ***/
+
+typedef struct ThreeOne {
+ struct OneTwo *m31;
+ struct Gamma *g;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pThreeOne, ThreeOne_PR_x) */
+ unsigned int _presence_map
+ [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ThreeOne_t;
+
+/*** <<< FUNC-DECLS [ThreeOne] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ThreeOne;
+extern asn_SET_specifics_t asn_SPC_ThreeOne_specs_1;
+extern asn_TYPE_member_t asn_MBR_ThreeOne_1[2];
+
+/*** <<< POST-INCLUDE [ThreeOne] >>> ***/
+
+#include "OneTwo.h"
+#include "Gamma.h"
+
+/*** <<< STAT-DEFS [ThreeOne] >>> ***/
+
+asn_TYPE_member_t asn_MBR_ThreeOne_1[] = {
+ { ATF_POINTER, 0, offsetof(struct ThreeOne, m31),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_OneTwo,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m31"
+ },
+ { ATF_POINTER, 0, offsetof(struct ThreeOne, g),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Gamma,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "g"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ThreeOne_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ThreeOne_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* m31 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g */
+};
+static const uint8_t asn_MAP_ThreeOne_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7) | (1 << 6)
+};
+asn_SET_specifics_t asn_SPC_ThreeOne_specs_1 = {
+ sizeof(struct ThreeOne),
+ offsetof(struct ThreeOne, _asn_ctx),
+ offsetof(struct ThreeOne, _presence_map),
+ asn_MAP_ThreeOne_tag2el_1,
+ 2, /* Count of tags in the map */
+ asn_MAP_ThreeOne_tag2el_1, /* Same as above */
+ 2, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_ThreeOne_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_ThreeOne = {
+ "ThreeOne",
+ "ThreeOne",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ThreeOne_tags_1,
+ sizeof(asn_DEF_ThreeOne_tags_1)
+ /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */
+ asn_DEF_ThreeOne_tags_1, /* Same as above */
+ sizeof(asn_DEF_ThreeOne_tags_1)
+ /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ThreeOne_1,
+ 2, /* Elements count */
+ &asn_SPC_ThreeOne_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..eb6796c
--- /dev/null
+++ b/tests/tests-asn1c-compiler/92-circular-loops-OK.asn1.-Pfwide-types
@@ -0,0 +1,1772 @@
+
+/*** <<< INCLUDES [Everything] >>> ***/
+
+#include "Set.h"
+#include "Alpha.h"
+#include "Beta.h"
+#include "Gamma.h"
+#include "OneTwo.h"
+#include "TwoThree.h"
+#include "ThreeOne.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Everything] >>> ***/
+
+struct Choice1;
+struct Choice2;
+struct Choice3;
+
+/*** <<< TYPE-DECLS [Everything] >>> ***/
+
+typedef struct Everything {
+ struct Choice1 *ch1;
+ struct Choice2 *ch2;
+ struct Choice3 *ch3;
+ Set_t set;
+ Alpha_t a;
+ Beta_t b;
+ Gamma_t g;
+ OneTwo_t ot;
+ TwoThree_t tt;
+ ThreeOne_t to;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Everything_t;
+
+/*** <<< FUNC-DECLS [Everything] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Everything;
+extern asn_SEQUENCE_specifics_t asn_SPC_Everything_specs_1;
+extern asn_TYPE_member_t asn_MBR_Everything_1[10];
+
+/*** <<< POST-INCLUDE [Everything] >>> ***/
+
+#include "Choice1.h"
+#include "Choice2.h"
+#include "Choice3.h"
+
+/*** <<< STAT-DEFS [Everything] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Everything_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Everything, ch1),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ch1"
+ },
+ { ATF_POINTER, 0, offsetof(struct Everything, ch2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ch2"
+ },
+ { ATF_POINTER, 0, offsetof(struct Everything, ch3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_Choice3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ch3"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, set),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Alpha,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, g),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Gamma,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "g"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, ot),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_OneTwo,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ot"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, tt),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TwoThree,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "tt"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Everything, to),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_ThreeOne,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "to"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Everything_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Everything_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ch1 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ch2 */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ch3 */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* g */
+ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* ot */
+ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* tt */
+ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 } /* to */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Everything_specs_1 = {
+ sizeof(struct Everything),
+ offsetof(struct Everything, _asn_ctx),
+ asn_MAP_Everything_tag2el_1,
+ 10, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Everything = {
+ "Everything",
+ "Everything",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Everything_tags_1,
+ sizeof(asn_DEF_Everything_tags_1)
+ /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */
+ asn_DEF_Everything_tags_1, /* Same as above */
+ sizeof(asn_DEF_Everything_tags_1)
+ /sizeof(asn_DEF_Everything_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Everything_1,
+ 10, /* Elements count */
+ &asn_SPC_Everything_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice1] >>> ***/
+
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice1] >>> ***/
+
+typedef enum Choice1_PR {
+ Choice1_PR_NOTHING, /* No components present */
+ Choice1_PR_something,
+ /* Extensions may appear below */
+ Choice1_PR_some2
+} Choice1_PR;
+
+/*** <<< FWD-DECLS [Choice1] >>> ***/
+
+struct Everything;
+
+/*** <<< TYPE-DECLS [Choice1] >>> ***/
+
+typedef struct Choice1 {
+ Choice1_PR present;
+ union Choice1_u {
+ struct Everything *something;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ struct Everything *some2;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice1_t;
+
+/*** <<< FUNC-DECLS [Choice1] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice1;
+extern asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice1_1[2];
+
+/*** <<< POST-INCLUDE [Choice1] >>> ***/
+
+#include "Everything.h"
+
+/*** <<< STAT-DEFS [Choice1] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Choice1_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Choice1, choice.something),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "something"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice1, choice.some2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "some2"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice1_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* something */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some2 */
+};
+asn_CHOICE_specifics_t asn_SPC_Choice1_specs_1 = {
+ sizeof(struct Choice1),
+ offsetof(struct Choice1, _asn_ctx),
+ offsetof(struct Choice1, present),
+ sizeof(((struct Choice1 *)0)->present),
+ asn_MAP_Choice1_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice1 = {
+ "Choice1",
+ "Choice1",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice1_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice1_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice2] >>> ***/
+
+#include "TypeRef.h"
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice2] >>> ***/
+
+typedef enum Choice2_PR {
+ Choice2_PR_NOTHING, /* No components present */
+ Choice2_PR_typeref,
+ /* Extensions may appear below */
+ Choice2_PR_some3
+} Choice2_PR;
+
+/*** <<< FWD-DECLS [Choice2] >>> ***/
+
+struct Everything;
+
+/*** <<< TYPE-DECLS [Choice2] >>> ***/
+
+typedef struct Choice2 {
+ Choice2_PR present;
+ union Choice2_u {
+ TypeRef_t typeref;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ struct Everything *some3;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice2_t;
+
+/*** <<< FUNC-DECLS [Choice2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice2;
+extern asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice2_1[2];
+
+/*** <<< POST-INCLUDE [Choice2] >>> ***/
+
+#include "Everything.h"
+
+/*** <<< STAT-DEFS [Choice2] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Choice2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.typeref),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TypeRef,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "typeref"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice2, choice.some3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "some3"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* typeref */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* some3 */
+};
+asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
+ sizeof(struct Choice2),
+ offsetof(struct Choice2, _asn_ctx),
+ offsetof(struct Choice2, present),
+ sizeof(((struct Choice2 *)0)->present),
+ asn_MAP_Choice2_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice2 = {
+ "Choice2",
+ "Choice2",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice2_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice3] >>> ***/
+
+#include <constr_SEQUENCE.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice3] >>> ***/
+
+typedef enum Choice3_PR {
+ Choice3_PR_NOTHING, /* No components present */
+ Choice3_PR_a,
+ Choice3_PR_b,
+ Choice3_PR_c
+} Choice3_PR;
+
+/*** <<< FWD-DECLS [Choice3] >>> ***/
+
+struct Everything;
+struct Choice3;
+
+/*** <<< TYPE-DECLS [Choice3] >>> ***/
+
+typedef struct Choice3 {
+ Choice3_PR present;
+ union Choice3_u {
+ struct a {
+ struct Everything *aa;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } a;
+ struct Everything *b;
+ struct c {
+ A_SEQUENCE_OF(struct Choice3) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } c;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice3_t;
+
+/*** <<< FUNC-DECLS [Choice3] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice3;
+extern asn_CHOICE_specifics_t asn_SPC_Choice3_specs_1;
+extern asn_TYPE_member_t asn_MBR_Choice3_1[3];
+
+/*** <<< POST-INCLUDE [Choice3] >>> ***/
+
+#include "Everything.h"
+#include "Choice3.h"
+
+/*** <<< STAT-DEFS [Choice3] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_a_2[] = {
+ { ATF_POINTER, 0, offsetof(struct a, aa),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "aa"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_a_tags_2[] = {
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_a_tag2el_2[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* aa */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_a_specs_2 = {
+ sizeof(struct a),
+ offsetof(struct a, _asn_ctx),
+ asn_MAP_a_tag2el_2,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_a_2 = {
+ "a",
+ "a",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_a_tags_2,
+ sizeof(asn_DEF_a_tags_2)
+ /sizeof(asn_DEF_a_tags_2[0]) - 1, /* 1 */
+ asn_DEF_a_tags_2, /* Same as above */
+ sizeof(asn_DEF_a_tags_2)
+ /sizeof(asn_DEF_a_tags_2[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_a_2,
+ 1, /* Elements count */
+ &asn_SPC_a_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_c_5[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_Choice3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_c_tags_5[] = {
+ (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_c_specs_5 = {
+ sizeof(struct c),
+ offsetof(struct c, _asn_ctx),
+ 2, /* XER encoding is XMLValueList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_c_5 = {
+ "c",
+ "c",
+ SEQUENCE_OF_free,
+ SEQUENCE_OF_print,
+ SEQUENCE_OF_compare,
+ SEQUENCE_OF_constraint,
+ SEQUENCE_OF_decode_ber,
+ SEQUENCE_OF_encode_der,
+ SEQUENCE_OF_decode_xer,
+ SEQUENCE_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_c_tags_5,
+ sizeof(asn_DEF_c_tags_5)
+ /sizeof(asn_DEF_c_tags_5[0]) - 1, /* 1 */
+ asn_DEF_c_tags_5, /* Same as above */
+ sizeof(asn_DEF_c_tags_5)
+ /sizeof(asn_DEF_c_tags_5[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_c_5,
+ 1, /* Single element */
+ &asn_SPC_c_specs_5 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Choice3_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice3, choice.a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_a_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice3, choice.b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Everything,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice3, choice.c),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_c_5,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "c"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice3_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_CHOICE_specifics_t asn_SPC_Choice3_specs_1 = {
+ sizeof(struct Choice3),
+ offsetof(struct Choice3, _asn_ctx),
+ offsetof(struct Choice3, present),
+ sizeof(((struct Choice3 *)0)->present),
+ asn_MAP_Choice3_tag2el_1,
+ 3, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice3 = {
+ "Choice3",
+ "Choice3",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice3_1,
+ 3, /* Elements count */
+ &asn_SPC_Choice3_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Set] >>> ***/
+
+#include <asn_SET_OF.h>
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+#include <constr_SET_OF.h>
+
+/*** <<< FWD-DECLS [Set] >>> ***/
+
+struct Set;
+struct Sequence;
+
+/*** <<< FWD-DEFS [Set] >>> ***/
+
+typedef struct Member {
+ INTEGER_t Int;
+ struct Set *set;
+ struct Sequence *seq;
+ struct Set *set2 /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ struct Set *set3;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Member;
+
+/*** <<< TYPE-DECLS [Set] >>> ***/
+
+typedef struct Set {
+ A_SET_OF(Member) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Set_t;
+
+/*** <<< FUNC-DECLS [Set] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Set;
+extern asn_SET_OF_specifics_t asn_SPC_Set_specs_1;
+extern asn_TYPE_member_t asn_MBR_Set_1[1];
+
+/*** <<< POST-INCLUDE [Set] >>> ***/
+
+#include "Set.h"
+#include "Sequence.h"
+
+/*** <<< STAT-DEFS [Set] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Member_2[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Member, Int),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int"
+ },
+ { ATF_POINTER, 0, offsetof(struct Member, set),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set"
+ },
+ { ATF_POINTER, 0, offsetof(struct Member, seq),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "seq"
+ },
+ { ATF_POINTER, 2, offsetof(struct Member, set2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set2"
+ },
+ { ATF_POINTER, 1, offsetof(struct Member, set3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set3"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Member_tags_2[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* set */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* seq */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* set2 */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* set3 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = {
+ sizeof(struct Member),
+ offsetof(struct Member, _asn_ctx),
+ asn_MAP_Member_tag2el_2,
+ 5, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 3, /* Start extensions */
+ 6 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_Member_2 = {
+ "SEQUENCE",
+ "SEQUENCE",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Member_tags_2,
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ asn_DEF_Member_tags_2, /* Same as above */
+ sizeof(asn_DEF_Member_tags_2)
+ /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Member_2,
+ 5, /* Elements count */
+ &asn_SPC_Member_specs_2 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Set_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Member_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Set_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_Set_specs_1 = {
+ sizeof(struct Set),
+ offsetof(struct Set, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Set = {
+ "Set",
+ "Set",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Set_tags_1,
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ asn_DEF_Set_tags_1, /* Same as above */
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Set_1,
+ 1, /* Single element */
+ &asn_SPC_Set_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Sequence] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Sequence] >>> ***/
+
+struct Sequence;
+struct Set;
+
+/*** <<< TYPE-DECLS [Sequence] >>> ***/
+
+typedef struct Sequence {
+ INTEGER_t a;
+ struct Sequence *seq /* OPTIONAL */;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ INTEGER_t *b;
+ struct Set *set /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Sequence_t;
+
+/*** <<< FUNC-DECLS [Sequence] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Sequence;
+extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
+extern asn_TYPE_member_t asn_MBR_Sequence_1[4];
+
+/*** <<< POST-INCLUDE [Sequence] >>> ***/
+
+#include "Sequence.h"
+#include "Set.h"
+
+/*** <<< STAT-DEFS [Sequence] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Sequence_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_POINTER, 3, offsetof(struct Sequence, seq),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "seq"
+ },
+ { ATF_POINTER, 2, offsetof(struct Sequence, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_POINTER, 1, offsetof(struct Sequence, set),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Set,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "set"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* seq */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* set */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
+ sizeof(struct Sequence),
+ offsetof(struct Sequence, _asn_ctx),
+ asn_MAP_Sequence_tag2el_1,
+ 4, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 5 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Sequence = {
+ "Sequence",
+ "Sequence",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Sequence_tags_1,
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ asn_DEF_Sequence_tags_1, /* Same as above */
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 4, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [TypeRef] >>> ***/
+
+#include "Sequence.h"
+
+/*** <<< TYPE-DECLS [TypeRef] >>> ***/
+
+typedef Sequence_t TypeRef_t;
+
+/*** <<< FUNC-DECLS [TypeRef] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TypeRef;
+asn_struct_free_f TypeRef_free;
+asn_struct_print_f TypeRef_print;
+asn_constr_check_f TypeRef_constraint;
+ber_type_decoder_f TypeRef_decode_ber;
+der_type_encoder_f TypeRef_encode_der;
+xer_type_decoder_f TypeRef_decode_xer;
+xer_type_encoder_f TypeRef_encode_xer;
+
+/*** <<< CODE [TypeRef] >>> ***/
+
+/*
+ * This type is implemented using Sequence,
+ * so here we adjust the DEF accordingly.
+ */
+
+/*** <<< STAT-DEFS [TypeRef] >>> ***/
+
+static const ber_tlv_tag_t asn_DEF_TypeRef_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TypeRef = {
+ "TypeRef",
+ "TypeRef",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_TypeRef_tags_1,
+ sizeof(asn_DEF_TypeRef_tags_1)
+ /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */
+ asn_DEF_TypeRef_tags_1, /* Same as above */
+ sizeof(asn_DEF_TypeRef_tags_1)
+ /sizeof(asn_DEF_TypeRef_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 4, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Alpha] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Alpha] >>> ***/
+
+struct Beta;
+
+/*** <<< TYPE-DECLS [Alpha] >>> ***/
+
+typedef struct Alpha {
+ struct Beta *a;
+ struct b {
+ struct Beta *b /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Alpha_t;
+
+/*** <<< FUNC-DECLS [Alpha] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Alpha;
+extern asn_SEQUENCE_specifics_t asn_SPC_Alpha_specs_1;
+extern asn_TYPE_member_t asn_MBR_Alpha_1[2];
+
+/*** <<< POST-INCLUDE [Alpha] >>> ***/
+
+#include "Beta.h"
+
+/*** <<< STAT-DEFS [Alpha] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_b_3[] = {
+ { ATF_POINTER, 1, offsetof(struct b, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_b_tags_3[] = {
+ (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* b */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_b_specs_3 = {
+ sizeof(struct b),
+ offsetof(struct b, _asn_ctx),
+ asn_MAP_b_tag2el_3,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_b_3 = {
+ "b",
+ "b",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_b_tags_3,
+ sizeof(asn_DEF_b_tags_3)
+ /sizeof(asn_DEF_b_tags_3[0]) - 1, /* 1 */
+ asn_DEF_b_tags_3, /* Same as above */
+ sizeof(asn_DEF_b_tags_3)
+ /sizeof(asn_DEF_b_tags_3[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_b_3,
+ 1, /* Elements count */
+ &asn_SPC_b_specs_3 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_Alpha_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Alpha, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Alpha, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_b_3,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Alpha_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Alpha_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* b */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Alpha_specs_1 = {
+ sizeof(struct Alpha),
+ offsetof(struct Alpha, _asn_ctx),
+ asn_MAP_Alpha_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Alpha = {
+ "Alpha",
+ "Alpha",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Alpha_tags_1,
+ sizeof(asn_DEF_Alpha_tags_1)
+ /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */
+ asn_DEF_Alpha_tags_1, /* Same as above */
+ sizeof(asn_DEF_Alpha_tags_1)
+ /sizeof(asn_DEF_Alpha_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Alpha_1,
+ 2, /* Elements count */
+ &asn_SPC_Alpha_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Beta] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Beta] >>> ***/
+
+struct Alpha;
+struct Gamma;
+
+/*** <<< TYPE-DECLS [Beta] >>> ***/
+
+typedef struct Beta {
+ struct Alpha *b /* OPTIONAL */;
+ struct Gamma *g /* OPTIONAL */;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Beta_t;
+
+/*** <<< FUNC-DECLS [Beta] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Beta;
+extern asn_SEQUENCE_specifics_t asn_SPC_Beta_specs_1;
+extern asn_TYPE_member_t asn_MBR_Beta_1[2];
+
+/*** <<< POST-INCLUDE [Beta] >>> ***/
+
+#include "Alpha.h"
+#include "Gamma.h"
+
+/*** <<< STAT-DEFS [Beta] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Beta_1[] = {
+ { ATF_POINTER, 2, offsetof(struct Beta, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Alpha,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+ { ATF_POINTER, 1, offsetof(struct Beta, g),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Gamma,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "g"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Beta_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Beta_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* b */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Beta_specs_1 = {
+ sizeof(struct Beta),
+ offsetof(struct Beta, _asn_ctx),
+ asn_MAP_Beta_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Beta = {
+ "Beta",
+ "Beta",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Beta_tags_1,
+ sizeof(asn_DEF_Beta_tags_1)
+ /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */
+ asn_DEF_Beta_tags_1, /* Same as above */
+ sizeof(asn_DEF_Beta_tags_1)
+ /sizeof(asn_DEF_Beta_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Beta_1,
+ 2, /* Elements count */
+ &asn_SPC_Beta_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Gamma] >>> ***/
+
+#include <constr_SEQUENCE.h>
+
+/*** <<< FWD-DECLS [Gamma] >>> ***/
+
+struct TwoThree;
+struct Alpha;
+struct Beta;
+
+/*** <<< TYPE-DECLS [Gamma] >>> ***/
+
+typedef struct Gamma {
+ struct TwoThree *o;
+ struct Alpha *a;
+ struct Beta *b;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Gamma_t;
+
+/*** <<< FUNC-DECLS [Gamma] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Gamma;
+extern asn_SEQUENCE_specifics_t asn_SPC_Gamma_specs_1;
+extern asn_TYPE_member_t asn_MBR_Gamma_1[3];
+
+/*** <<< POST-INCLUDE [Gamma] >>> ***/
+
+#include "TwoThree.h"
+#include "Alpha.h"
+#include "Beta.h"
+
+/*** <<< STAT-DEFS [Gamma] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Gamma_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Gamma, o),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TwoThree,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "o"
+ },
+ { ATF_POINTER, 0, offsetof(struct Gamma, a),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Alpha,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+ { ATF_POINTER, 0, offsetof(struct Gamma, b),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Beta,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "b"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Gamma_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Gamma_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* o */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* a */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Gamma_specs_1 = {
+ sizeof(struct Gamma),
+ offsetof(struct Gamma, _asn_ctx),
+ asn_MAP_Gamma_tag2el_1,
+ 3, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Gamma = {
+ "Gamma",
+ "Gamma",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Gamma_tags_1,
+ sizeof(asn_DEF_Gamma_tags_1)
+ /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */
+ asn_DEF_Gamma_tags_1, /* Same as above */
+ sizeof(asn_DEF_Gamma_tags_1)
+ /sizeof(asn_DEF_Gamma_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Gamma_1,
+ 3, /* Elements count */
+ &asn_SPC_Gamma_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [OneTwo] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [OneTwo] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum OneTwo_PR {
+ OneTwo_PR_m12, /* Member m12 is present */
+} OneTwo_PR;
+
+/*** <<< FWD-DECLS [OneTwo] >>> ***/
+
+struct TwoThree;
+
+/*** <<< TYPE-DECLS [OneTwo] >>> ***/
+
+typedef struct OneTwo {
+ struct TwoThree *m12;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pOneTwo, OneTwo_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} OneTwo_t;
+
+/*** <<< FUNC-DECLS [OneTwo] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_OneTwo;
+extern asn_SET_specifics_t asn_SPC_OneTwo_specs_1;
+extern asn_TYPE_member_t asn_MBR_OneTwo_1[1];
+
+/*** <<< POST-INCLUDE [OneTwo] >>> ***/
+
+#include "TwoThree.h"
+
+/*** <<< STAT-DEFS [OneTwo] >>> ***/
+
+asn_TYPE_member_t asn_MBR_OneTwo_1[] = {
+ { ATF_POINTER, 0, offsetof(struct OneTwo, m12),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_TwoThree,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m12"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_OneTwo_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_OneTwo_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m12 */
+};
+static const uint8_t asn_MAP_OneTwo_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+asn_SET_specifics_t asn_SPC_OneTwo_specs_1 = {
+ sizeof(struct OneTwo),
+ offsetof(struct OneTwo, _asn_ctx),
+ offsetof(struct OneTwo, _presence_map),
+ asn_MAP_OneTwo_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_OneTwo_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_OneTwo_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_OneTwo = {
+ "OneTwo",
+ "OneTwo",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_OneTwo_tags_1,
+ sizeof(asn_DEF_OneTwo_tags_1)
+ /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */
+ asn_DEF_OneTwo_tags_1, /* Same as above */
+ sizeof(asn_DEF_OneTwo_tags_1)
+ /sizeof(asn_DEF_OneTwo_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_OneTwo_1,
+ 1, /* Elements count */
+ &asn_SPC_OneTwo_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [TwoThree] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [TwoThree] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum TwoThree_PR {
+ TwoThree_PR_m23, /* Member m23 is present */
+} TwoThree_PR;
+
+/*** <<< FWD-DECLS [TwoThree] >>> ***/
+
+struct ThreeOne;
+
+/*** <<< TYPE-DECLS [TwoThree] >>> ***/
+
+typedef struct TwoThree {
+ struct ThreeOne *m23;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pTwoThree, TwoThree_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TwoThree_t;
+
+/*** <<< FUNC-DECLS [TwoThree] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TwoThree;
+extern asn_SET_specifics_t asn_SPC_TwoThree_specs_1;
+extern asn_TYPE_member_t asn_MBR_TwoThree_1[1];
+
+/*** <<< POST-INCLUDE [TwoThree] >>> ***/
+
+#include "ThreeOne.h"
+
+/*** <<< STAT-DEFS [TwoThree] >>> ***/
+
+asn_TYPE_member_t asn_MBR_TwoThree_1[] = {
+ { ATF_POINTER, 0, offsetof(struct TwoThree, m23),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_ThreeOne,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m23"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_TwoThree_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_TwoThree_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* m23 */
+};
+static const uint8_t asn_MAP_TwoThree_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+asn_SET_specifics_t asn_SPC_TwoThree_specs_1 = {
+ sizeof(struct TwoThree),
+ offsetof(struct TwoThree, _asn_ctx),
+ offsetof(struct TwoThree, _presence_map),
+ asn_MAP_TwoThree_tag2el_1,
+ 1, /* Count of tags in the map */
+ asn_MAP_TwoThree_tag2el_1, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_TwoThree_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_TwoThree = {
+ "TwoThree",
+ "TwoThree",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_TwoThree_tags_1,
+ sizeof(asn_DEF_TwoThree_tags_1)
+ /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */
+ asn_DEF_TwoThree_tags_1, /* Same as above */
+ sizeof(asn_DEF_TwoThree_tags_1)
+ /sizeof(asn_DEF_TwoThree_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_TwoThree_1,
+ 1, /* Elements count */
+ &asn_SPC_TwoThree_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [ThreeOne] >>> ***/
+
+#include <constr_SET.h>
+
+/*** <<< DEPS [ThreeOne] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum ThreeOne_PR {
+ ThreeOne_PR_m31, /* Member m31 is present */
+ ThreeOne_PR_g, /* Member g is present */
+} ThreeOne_PR;
+
+/*** <<< FWD-DECLS [ThreeOne] >>> ***/
+
+struct OneTwo;
+struct Gamma;
+
+/*** <<< TYPE-DECLS [ThreeOne] >>> ***/
+
+typedef struct ThreeOne {
+ struct OneTwo *m31;
+ struct Gamma *g;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pThreeOne, ThreeOne_PR_x) */
+ unsigned int _presence_map
+ [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} ThreeOne_t;
+
+/*** <<< FUNC-DECLS [ThreeOne] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_ThreeOne;
+extern asn_SET_specifics_t asn_SPC_ThreeOne_specs_1;
+extern asn_TYPE_member_t asn_MBR_ThreeOne_1[2];
+
+/*** <<< POST-INCLUDE [ThreeOne] >>> ***/
+
+#include "OneTwo.h"
+#include "Gamma.h"
+
+/*** <<< STAT-DEFS [ThreeOne] >>> ***/
+
+asn_TYPE_member_t asn_MBR_ThreeOne_1[] = {
+ { ATF_POINTER, 0, offsetof(struct ThreeOne, m31),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_OneTwo,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m31"
+ },
+ { ATF_POINTER, 0, offsetof(struct ThreeOne, g),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Gamma,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "g"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ThreeOne_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ThreeOne_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* m31 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* g */
+};
+static const uint8_t asn_MAP_ThreeOne_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7) | (1 << 6)
+};
+asn_SET_specifics_t asn_SPC_ThreeOne_specs_1 = {
+ sizeof(struct ThreeOne),
+ offsetof(struct ThreeOne, _asn_ctx),
+ offsetof(struct ThreeOne, _presence_map),
+ asn_MAP_ThreeOne_tag2el_1,
+ 2, /* Count of tags in the map */
+ asn_MAP_ThreeOne_tag2el_1, /* Same as above */
+ 2, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_ThreeOne_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_ThreeOne = {
+ "ThreeOne",
+ "ThreeOne",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ThreeOne_tags_1,
+ sizeof(asn_DEF_ThreeOne_tags_1)
+ /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */
+ asn_DEF_ThreeOne_tags_1, /* Same as above */
+ sizeof(asn_DEF_ThreeOne_tags_1)
+ /sizeof(asn_DEF_ThreeOne_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ThreeOne_1,
+ 2, /* Elements count */
+ &asn_SPC_ThreeOne_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1 b/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1
new file mode 100644
index 0000000..b1fb585
--- /dev/null
+++ b/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1
@@ -0,0 +1,34 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .93
+
+Module-asn1c-controls
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 93 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ Sequence ::= SEQUENCE {
+ ainl INTEGER,
+ --<ASN1C.RepresentAsPointer>--
+ aptr INTEGER
+ }
+
+ Set ::= SET {
+ ainl Sequence,
+ --<ASN1C.RepresentAsPointer>--
+ aptr Sequence
+ }
+
+ Choice ::= CHOICE {
+ --<ASN1C.RepresentAsPointer>--
+ setof SET OF INTEGER,
+ --<ASN1C.RepresentAsPointer>--
+ aptr Sequence,
+ ainl Sequence
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1.-EF b/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1.-EF
new file mode 100644
index 0000000..5288379
--- /dev/null
+++ b/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1.-EF
@@ -0,0 +1,26 @@
+Module-asn1c-controls { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 93 }
+DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+Sequence ::= SEQUENCE {
+ ainl [0] IMPLICIT INTEGER,
+ --<ASN1C.RepresentAsPointer>--
+ aptr [1] IMPLICIT INTEGER
+}
+
+Set ::= SET {
+ ainl [0] IMPLICIT Sequence,
+ --<ASN1C.RepresentAsPointer>--
+ aptr [1] IMPLICIT Sequence
+}
+
+Choice ::= CHOICE {
+ --<ASN1C.RepresentAsPointer>--
+ setof [0] IMPLICIT SET OF INTEGER,
+ --<ASN1C.RepresentAsPointer>--
+ aptr [1] IMPLICIT Sequence,
+ ainl [2] IMPLICIT Sequence
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..899be1d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/93-asn1c-controls-OK.asn1.-Pfwide-types
@@ -0,0 +1,385 @@
+
+/*** <<< INCLUDES [Sequence] >>> ***/
+
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Sequence] >>> ***/
+
+typedef struct Sequence {
+ INTEGER_t ainl;
+ INTEGER_t *aptr;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Sequence_t;
+
+/*** <<< FUNC-DECLS [Sequence] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Sequence;
+extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
+extern asn_TYPE_member_t asn_MBR_Sequence_1[2];
+
+/*** <<< STAT-DEFS [Sequence] >>> ***/
+
+asn_TYPE_member_t asn_MBR_Sequence_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Sequence, ainl),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ainl"
+ },
+ { ATF_POINTER, 0, offsetof(struct Sequence, aptr),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "aptr"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ainl */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* aptr */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
+ sizeof(struct Sequence),
+ offsetof(struct Sequence, _asn_ctx),
+ asn_MAP_Sequence_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Sequence = {
+ "Sequence",
+ "Sequence",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Sequence_tags_1,
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ asn_DEF_Sequence_tags_1, /* Same as above */
+ sizeof(asn_DEF_Sequence_tags_1)
+ /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Sequence_1,
+ 2, /* Elements count */
+ &asn_SPC_Sequence_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Set] >>> ***/
+
+#include "Sequence.h"
+#include <constr_SET.h>
+
+/*** <<< DEPS [Set] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum Set_PR {
+ Set_PR_ainl, /* Member ainl is present */
+ Set_PR_aptr, /* Member aptr is present */
+} Set_PR;
+
+/*** <<< FWD-DECLS [Set] >>> ***/
+
+struct Sequence;
+
+/*** <<< TYPE-DECLS [Set] >>> ***/
+
+typedef struct Set {
+ Sequence_t ainl;
+ struct Sequence *aptr;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pSet, Set_PR_x) */
+ unsigned int _presence_map
+ [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Set_t;
+
+/*** <<< FUNC-DECLS [Set] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Set;
+
+/*** <<< POST-INCLUDE [Set] >>> ***/
+
+#include "Sequence.h"
+
+/*** <<< STAT-DEFS [Set] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Set_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Set, ainl),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ainl"
+ },
+ { ATF_POINTER, 0, offsetof(struct Set, aptr),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "aptr"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Set_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Set_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ainl */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* aptr */
+};
+static const uint8_t asn_MAP_Set_mmap_1[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7) | (1 << 6)
+};
+static
+asn_SET_specifics_t asn_SPC_Set_specs_1 = {
+ sizeof(struct Set),
+ offsetof(struct Set, _asn_ctx),
+ offsetof(struct Set, _presence_map),
+ asn_MAP_Set_tag2el_1,
+ 2, /* Count of tags in the map */
+ asn_MAP_Set_tag2el_1, /* Same as above */
+ 2, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (const unsigned int *)asn_MAP_Set_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_Set = {
+ "Set",
+ "Set",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Set_tags_1,
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ asn_DEF_Set_tags_1, /* Same as above */
+ sizeof(asn_DEF_Set_tags_1)
+ /sizeof(asn_DEF_Set_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Set_1,
+ 2, /* Elements count */
+ &asn_SPC_Set_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice] >>> ***/
+
+#include "Sequence.h"
+#include <INTEGER.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice] >>> ***/
+
+typedef enum Choice_PR {
+ Choice_PR_NOTHING, /* No components present */
+ Choice_PR_setof,
+ Choice_PR_aptr,
+ Choice_PR_ainl
+} Choice_PR;
+
+/*** <<< FWD-DECLS [Choice] >>> ***/
+
+struct Sequence;
+
+/*** <<< TYPE-DECLS [Choice] >>> ***/
+
+typedef struct Choice {
+ Choice_PR present;
+ union Choice_u {
+ struct setof {
+ A_SET_OF(INTEGER_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *setof;
+ struct Sequence *aptr;
+ Sequence_t ainl;
+ } 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;
+
+/*** <<< POST-INCLUDE [Choice] >>> ***/
+
+#include "Sequence.h"
+
+/*** <<< STAT-DEFS [Choice] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_setof_2[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static const ber_tlv_tag_t asn_DEF_setof_tags_2[] = {
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_setof_specs_2 = {
+ sizeof(struct setof),
+ offsetof(struct setof, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_setof_2 = {
+ "setof",
+ "setof",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_compare,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_setof_tags_2,
+ sizeof(asn_DEF_setof_tags_2)
+ /sizeof(asn_DEF_setof_tags_2[0]) - 1, /* 1 */
+ asn_DEF_setof_tags_2, /* Same as above */
+ sizeof(asn_DEF_setof_tags_2)
+ /sizeof(asn_DEF_setof_tags_2[0]), /* 2 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_setof_2,
+ 1, /* Single element */
+ &asn_SPC_setof_specs_2 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_Choice_1[] = {
+ { ATF_POINTER, 0, offsetof(struct Choice, choice.setof),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_setof_2,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "setof"
+ },
+ { ATF_POINTER, 0, offsetof(struct Choice, choice.aptr),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "aptr"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ainl),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_Sequence,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ainl"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* setof */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* aptr */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ainl */
+};
+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),
+ asn_MAP_Choice_tag2el_1,
+ 3, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice = {
+ "Choice",
+ "Choice",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice_1,
+ 3, /* Elements count */
+ &asn_SPC_Choice_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/94-set-optionals-OK.asn1 b/tests/tests-asn1c-compiler/94-set-optionals-OK.asn1
new file mode 100644
index 0000000..665f5e6
--- /dev/null
+++ b/tests/tests-asn1c-compiler/94-set-optionals-OK.asn1
@@ -0,0 +1,28 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .94
+
+ModuleSetOptionals
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 94 }
+ DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+ TestSet ::= SET {
+ m0 [0] IMPLICIT VisibleString,
+ m1 [1] IMPLICIT VisibleString OPTIONAL,
+ m2 [2] IMPLICIT VisibleString,
+ m3 [3] IMPLICIT VisibleString,
+ m4 [4] IMPLICIT VisibleString OPTIONAL,
+ m5 [5] IMPLICIT VisibleString,
+ m6 [6] IMPLICIT VisibleString,
+ m7 [7] IMPLICIT VisibleString,
+ m8 [8] IMPLICIT VisibleString OPTIONAL,
+ m9 [9] IMPLICIT VisibleString,
+ ...
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/94-set-optionals-OK.asn1.-P b/tests/tests-asn1c-compiler/94-set-optionals-OK.asn1.-P
new file mode 100644
index 0000000..67e4e94
--- /dev/null
+++ b/tests/tests-asn1c-compiler/94-set-optionals-OK.asn1.-P
@@ -0,0 +1,227 @@
+
+/*** <<< INCLUDES [TestSet] >>> ***/
+
+#include <VisibleString.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [TestSet] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum TestSet_PR {
+ TestSet_PR_m0, /* Member m0 is present */
+ TestSet_PR_m1, /* Member m1 is present */
+ TestSet_PR_m2, /* Member m2 is present */
+ TestSet_PR_m3, /* Member m3 is present */
+ TestSet_PR_m4, /* Member m4 is present */
+ TestSet_PR_m5, /* Member m5 is present */
+ TestSet_PR_m6, /* Member m6 is present */
+ TestSet_PR_m7, /* Member m7 is present */
+ TestSet_PR_m8, /* Member m8 is present */
+ TestSet_PR_m9, /* Member m9 is present */
+} TestSet_PR;
+
+/*** <<< TYPE-DECLS [TestSet] >>> ***/
+
+typedef struct TestSet {
+ VisibleString_t m0;
+ VisibleString_t *m1 /* OPTIONAL */;
+ VisibleString_t m2;
+ VisibleString_t m3;
+ VisibleString_t *m4 /* OPTIONAL */;
+ VisibleString_t m5;
+ VisibleString_t m6;
+ VisibleString_t m7;
+ VisibleString_t *m8 /* OPTIONAL */;
+ VisibleString_t m9;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(pTestSet, TestSet_PR_x) */
+ unsigned int _presence_map
+ [((10+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TestSet_t;
+
+/*** <<< FUNC-DECLS [TestSet] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TestSet;
+
+/*** <<< STAT-DEFS [TestSet] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_TestSet_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct TestSet, m0),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m0"
+ },
+ { ATF_POINTER, 1, offsetof(struct TestSet, m1),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct TestSet, m2),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m2"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct TestSet, m3),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m3"
+ },
+ { ATF_POINTER, 1, offsetof(struct TestSet, m4),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m4"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct TestSet, m5),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m5"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct TestSet, m6),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m6"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct TestSet, m7),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m7"
+ },
+ { ATF_POINTER, 1, offsetof(struct TestSet, m8),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m8"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct TestSet, m9),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_VisibleString,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "m9"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_TestSet_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_TestSet_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* m0 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* m1 */
+ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* m2 */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* m3 */
+ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* m4 */
+ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* m5 */
+ { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* m6 */
+ { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* m7 */
+ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* m8 */
+ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 } /* m9 */
+};
+static const uint8_t asn_MAP_TestSet_mmap_1[(10 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (0 << 3) | (1 << 2) | (1 << 1) | (1 << 0),
+ (0 << 7) | (1 << 6)
+};
+static
+asn_SET_specifics_t asn_SPC_TestSet_specs_1 = {
+ sizeof(struct TestSet),
+ offsetof(struct TestSet, _asn_ctx),
+ offsetof(struct TestSet, _presence_map),
+ asn_MAP_TestSet_tag2el_1,
+ 10, /* Count of tags in the map */
+ asn_MAP_TestSet_tag2el_1, /* Same as above */
+ 10, /* Count of tags in the CXER map */
+ 1, /* Whether extensible */
+ (const unsigned int *)asn_MAP_TestSet_mmap_1 /* Mandatory elements map */
+};
+asn_TYPE_descriptor_t asn_DEF_TestSet = {
+ "TestSet",
+ "TestSet",
+ SET_free,
+ SET_print,
+ SET_compare,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_TestSet_tags_1,
+ sizeof(asn_DEF_TestSet_tags_1)
+ /sizeof(asn_DEF_TestSet_tags_1[0]), /* 1 */
+ asn_DEF_TestSet_tags_1, /* Same as above */
+ sizeof(asn_DEF_TestSet_tags_1)
+ /sizeof(asn_DEF_TestSet_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_TestSet_1,
+ 10, /* Elements count */
+ &asn_SPC_TestSet_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1 b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1
new file mode 100644
index 0000000..2aeb4f7
--- /dev/null
+++ b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1
@@ -0,0 +1,30 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .95
+
+ModuleCHOICE-PER-Ordering
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 95 }
+ DEFINITIONS ::=
+BEGIN
+
+ Choice ::= CHOICE {
+ roid RELATIVE-OID,
+ bitstr BIT STRING,
+ ch CHOICE {
+ null NULL,
+ int INTEGER
+ },
+ ...,
+ bool BOOLEAN
+ }
+
+ Choice2 ::= CHOICE {
+ bitstr [0] BIT STRING,
+ roid [1] RELATIVE-OID
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pfwide-types
new file mode 100644
index 0000000..44e2aea
--- /dev/null
+++ b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pfwide-types
@@ -0,0 +1,309 @@
+
+/*** <<< INCLUDES [Choice] >>> ***/
+
+#include <RELATIVE-OID.h>
+#include <BIT_STRING.h>
+#include <BOOLEAN.h>
+#include <NULL.h>
+#include <INTEGER.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice] >>> ***/
+
+typedef enum Choice_PR {
+ Choice_PR_NOTHING, /* No components present */
+ Choice_PR_roid,
+ Choice_PR_bitstr,
+ Choice_PR_ch,
+ /* Extensions may appear below */
+ Choice_PR_bool
+} Choice_PR;
+typedef enum ch_PR {
+ ch_PR_NOTHING, /* No components present */
+ ch_PR_null,
+ ch_PR_int
+} ch_PR;
+
+/*** <<< TYPE-DECLS [Choice] >>> ***/
+
+typedef struct Choice {
+ Choice_PR present;
+ union Choice_u {
+ RELATIVE_OID_t roid;
+ BIT_STRING_t bitstr;
+ struct ch {
+ ch_PR present;
+ union Choice__ch_u {
+ NULL_t null;
+ INTEGER_t Int;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } ch;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ BOOLEAN_t Bool;
+ } 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_ch_4[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ch, choice.null),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "null"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "int"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null */
+};
+static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = {
+ sizeof(struct ch),
+ offsetof(struct ch, _asn_ctx),
+ offsetof(struct ch, present),
+ sizeof(((struct ch *)0)->present),
+ asn_MAP_ch_tag2el_4,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ch_4 = {
+ "ch",
+ "ch",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_ch_4,
+ 2, /* Elements count */
+ &asn_SPC_ch_specs_4 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_Choice_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_RELATIVE_OID,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "roid"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "bitstr"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_ch_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "ch"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "bool"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr */
+ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null */
+ { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid */
+};
+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),
+ asn_MAP_Choice_tag2el_1,
+ 5, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = 3 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice = {
+ "Choice",
+ "Choice",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice_1,
+ 4, /* Elements count */
+ &asn_SPC_Choice_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice2] >>> ***/
+
+#include <BIT_STRING.h>
+#include <RELATIVE-OID.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice2] >>> ***/
+
+typedef enum Choice2_PR {
+ Choice2_PR_NOTHING, /* No components present */
+ Choice2_PR_bitstr,
+ Choice2_PR_roid
+} Choice2_PR;
+
+/*** <<< TYPE-DECLS [Choice2] >>> ***/
+
+typedef struct Choice2 {
+ Choice2_PR present;
+ union Choice2_u {
+ BIT_STRING_t bitstr;
+ RELATIVE_OID_t roid;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice2_t;
+
+/*** <<< FUNC-DECLS [Choice2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice2;
+
+/*** <<< STAT-DEFS [Choice2] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Choice2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "bitstr"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_RELATIVE_OID,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "roid"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid */
+};
+static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
+ sizeof(struct Choice2),
+ offsetof(struct Choice2, _asn_ctx),
+ offsetof(struct Choice2, present),
+ sizeof(((struct Choice2 *)0)->present),
+ asn_MAP_Choice2_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice2 = {
+ "Choice2",
+ "Choice2",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Choice2_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pgen-PER
new file mode 100644
index 0000000..366b1c8
--- /dev/null
+++ b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pgen-PER
@@ -0,0 +1,335 @@
+
+/*** <<< INCLUDES [Choice] >>> ***/
+
+#include <RELATIVE-OID.h>
+#include <BIT_STRING.h>
+#include <BOOLEAN.h>
+#include <NULL.h>
+#include <NativeInteger.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice] >>> ***/
+
+typedef enum Choice_PR {
+ Choice_PR_NOTHING, /* No components present */
+ Choice_PR_roid,
+ Choice_PR_bitstr,
+ Choice_PR_ch,
+ /* Extensions may appear below */
+ Choice_PR_bool
+} Choice_PR;
+typedef enum ch_PR {
+ ch_PR_NOTHING, /* No components present */
+ ch_PR_null,
+ ch_PR_int
+} ch_PR;
+
+/*** <<< TYPE-DECLS [Choice] >>> ***/
+
+typedef struct Choice {
+ Choice_PR present;
+ union Choice_u {
+ RELATIVE_OID_t roid;
+ BIT_STRING_t bitstr;
+ struct ch {
+ ch_PR present;
+ union Choice__ch_u {
+ NULL_t null;
+ long Int;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } ch;
+ /*
+ * This type is extensible,
+ * possible extensions are below.
+ */
+ BOOLEAN_t Bool;
+ } 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;
+
+/*** <<< CTDEFS [Choice] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_ch_constr_4 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static asn_per_constraints_t asn_PER_type_Choice_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Choice] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_ch_4[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ch, choice.null),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NULL,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "null"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "int"
+ },
+};
+static const int asn_MAP_ch_cmap_4[] = { 1, 0 };
+static const asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null */
+};
+static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = {
+ sizeof(struct ch),
+ offsetof(struct ch, _asn_ctx),
+ offsetof(struct ch, present),
+ sizeof(((struct ch *)0)->present),
+ asn_MAP_ch_tag2el_4,
+ 2, /* Count of tags in the map */
+ .canonical_order = asn_MAP_ch_cmap_4, /* Canonically sorted */
+ .ext_start = -1 /* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ch_4 = {
+ "ch",
+ "ch",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ CHOICE_decode_uper,
+ CHOICE_encode_uper,
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_ch_constr_4,
+ asn_MBR_ch_4,
+ 2, /* Elements count */
+ &asn_SPC_ch_specs_4 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_Choice_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_RELATIVE_OID,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "roid"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "bitstr"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = &asn_DEF_ch_4,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "ch"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_BOOLEAN,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "bool"
+ },
+};
+static const int asn_MAP_Choice_cmap_1[] = { 2, 1, 0, 3 };
+static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int */
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr */
+ { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null */
+ { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid */
+};
+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),
+ asn_MAP_Choice_tag2el_1,
+ 5, /* Count of tags in the map */
+ .canonical_order = asn_MAP_Choice_cmap_1, /* Canonically sorted */
+ .ext_start = 3 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice = {
+ "Choice",
+ "Choice",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ CHOICE_decode_uper,
+ CHOICE_encode_uper,
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Choice_constr_1,
+ asn_MBR_Choice_1,
+ 4, /* Elements count */
+ &asn_SPC_Choice_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Choice2] >>> ***/
+
+#include <BIT_STRING.h>
+#include <RELATIVE-OID.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [Choice2] >>> ***/
+
+typedef enum Choice2_PR {
+ Choice2_PR_NOTHING, /* No components present */
+ Choice2_PR_bitstr,
+ Choice2_PR_roid
+} Choice2_PR;
+
+/*** <<< TYPE-DECLS [Choice2] >>> ***/
+
+typedef struct Choice2 {
+ Choice2_PR present;
+ union Choice2_u {
+ BIT_STRING_t bitstr;
+ RELATIVE_OID_t roid;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Choice2_t;
+
+/*** <<< FUNC-DECLS [Choice2] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Choice2;
+
+/*** <<< CTDEFS [Choice2] >>> ***/
+
+static asn_per_constraints_t asn_PER_type_Choice2_constr_1 GCC_NOTUSED = {
+ { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+
+/*** <<< STAT-DEFS [Choice2] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Choice2_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_BIT_STRING,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "bitstr"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = &asn_DEF_RELATIVE_OID,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "roid"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid */
+};
+static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = {
+ sizeof(struct Choice2),
+ offsetof(struct Choice2, _asn_ctx),
+ offsetof(struct Choice2, present),
+ sizeof(((struct Choice2 *)0)->present),
+ asn_MAP_Choice2_tag2el_1,
+ 2, /* Count of tags in the map */
+ .canonical_order = 0,
+ .ext_start = -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Choice2 = {
+ "Choice2",
+ "Choice2",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_compare,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ CHOICE_decode_uper,
+ CHOICE_encode_uper,
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ 0, /* No OER visible constraints */
+ &asn_PER_type_Choice2_constr_1,
+ asn_MBR_Choice2_1,
+ 2, /* Elements count */
+ &asn_SPC_Choice2_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/96-type-identifier-OK.asn1 b/tests/tests-asn1c-compiler/96-type-identifier-OK.asn1
new file mode 100644
index 0000000..17ce5d3
--- /dev/null
+++ b/tests/tests-asn1c-compiler/96-type-identifier-OK.asn1
@@ -0,0 +1,22 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .96
+
+ModuleTypeIdentifier
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 96 }
+ DEFINITIONS ::=
+BEGIN
+
+ /*
+ * TYPE-IDENTIFIER shall be automatically available.
+ */
+ T ::= SEQUENCE {
+ id TYPE-IDENTIFIER.&id,
+ type TYPE-IDENTIFIER.&Type
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/97-type-identifier-SW.asn1 b/tests/tests-asn1c-compiler/97-type-identifier-SW.asn1
new file mode 100644
index 0000000..a956e01
--- /dev/null
+++ b/tests/tests-asn1c-compiler/97-type-identifier-SW.asn1
@@ -0,0 +1,43 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .97
+
+ModuleTypeIdentifier1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 97 1 }
+ DEFINITIONS ::=
+BEGIN
+
+ /*
+ * TYPE-IDENTIFIER is resolved to a clause below.
+ */
+ T1 ::= SEQUENCE {
+ id TYPE-IDENTIFIER.&id2,
+ type TYPE-IDENTIFIER.&Type
+ }
+
+ TYPE-IDENTIFIER ::= CLASS {
+ &id2 OBJECT IDENTIFIER UNIQUE,
+ &Type
+ } WITH SYNTAX { [ &Type -- comment --] IDENTIFIED BY &id2 }
+
+END
+
+ModuleTypeIdentifier2
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 97 2 }
+ DEFINITIONS ::=
+BEGIN
+
+ /*
+ * TYPE-IDENTIFIER is resolved to a default TYPE-IDENTIFIER class.
+ */
+ T2 ::= SEQUENCE {
+ id TYPE-IDENTIFIER.&id,
+ type TYPE-IDENTIFIER.&Type
+ }
+
+END
diff --git a/tests/tests-asn1c-compiler/97-type-identifier-SW.asn1.-EF b/tests/tests-asn1c-compiler/97-type-identifier-SW.asn1.-EF
new file mode 100644
index 0000000..71743b7
--- /dev/null
+++ b/tests/tests-asn1c-compiler/97-type-identifier-SW.asn1.-EF
@@ -0,0 +1,29 @@
+ModuleTypeIdentifier1 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 97 1 }
+DEFINITIONS ::=
+BEGIN
+
+T1 ::= SEQUENCE {
+ id TYPE-IDENTIFIER.&id2,
+ type TYPE-IDENTIFIER.&Type
+}
+
+TYPE-IDENTIFIER ::= CLASS {
+ &id2 OBJECT IDENTIFIER UNIQUE,
+ &Type ANY
+} WITH SYNTAX { [ &Type ] IDENTIFIED BY &id2 }
+
+
+END
+
+ModuleTypeIdentifier2 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 97 2 }
+DEFINITIONS ::=
+BEGIN
+
+T2 ::= SEQUENCE {
+ id TYPE-IDENTIFIER.&id,
+ type TYPE-IDENTIFIER.&Type
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1 b/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1
new file mode 100644
index 0000000..211401a
--- /dev/null
+++ b/tests/tests-asn1c-compiler/98-attribute-class-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)
+-- .98
+
+ModuleAttributeClass
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 98 }
+ DEFINITIONS ::=
+BEGIN
+
+ ATTRIBUTE ::= CLASS {
+ &id RELATIVE-OID UNIQUE
+ } WITH SYNTAX { ID &id }
+
+ Attribute ::= SEQUENCE {
+ identifier ATTRIBUTE.&id ({Attributes}),
+ siAttributeValue IA5String
+ }
+
+ Attributes ATTRIBUTE ::= { rafService | rcfService }
+
+ rafService ATTRIBUTE ::= { ID raf }
+ rcfService ATTRIBUTE ::= { ID rcf }
+
+ raf RELATIVE-OID ::= {3 2 1}
+ rcf RELATIVE-OID ::= {3 2 2}
+
+END
diff --git a/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-EF b/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-EF
new file mode 100644
index 0000000..e810e48
--- /dev/null
+++ b/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-EF
@@ -0,0 +1,26 @@
+ModuleAttributeClass { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 98 }
+DEFINITIONS ::=
+BEGIN
+
+ATTRIBUTE ::= CLASS {
+ &id RELATIVE-OID UNIQUE
+} WITH SYNTAX { ID &id }
+
+
+Attribute ::= SEQUENCE {
+ identifier ATTRIBUTE.&id ({Attributes}),
+ siAttributeValue IA5String
+}
+
+Attributes ATTRIBUTE ::= {{ ID raf } | { ID rcf }}
+
+rafService ATTRIBUTE ::= { ID raf }
+
+rcfService ATTRIBUTE ::= { ID rcf }
+
+raf RELATIVE-OID ::= {3 2 1}
+
+rcf RELATIVE-OID ::= {3 2 2}
+
+END
diff --git a/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-EFprint-class-matrix b/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-EFprint-class-matrix
new file mode 100644
index 0000000..718a946
--- /dev/null
+++ b/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-EFprint-class-matrix
@@ -0,0 +1,44 @@
+ModuleAttributeClass { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 98 }
+DEFINITIONS ::=
+BEGIN
+
+ATTRIBUTE ::= CLASS {
+ &id RELATIVE-OID UNIQUE
+} WITH SYNTAX { ID &id }
+
+-- Information Object Set has 2 entries:
+-- [&id]
+-- [1] raf
+-- [2] rcf
+
+
+Attribute ::= SEQUENCE {
+ identifier ATTRIBUTE.&id ({Attributes}),
+ siAttributeValue IA5String
+}
+
+Attributes ATTRIBUTE ::= {{ ID raf } | { ID rcf }}
+-- Information Object Set has 2 entries:
+-- [&id]
+-- [1] raf
+-- [2] rcf
+
+
+rafService ATTRIBUTE ::= { ID raf }
+-- Information Object Set has 1 entry:
+-- [&id]
+-- [1] raf
+
+
+rcfService ATTRIBUTE ::= { ID rcf }
+-- Information Object Set has 1 entry:
+-- [&id]
+-- [1] rcf
+
+
+raf RELATIVE-OID ::= {3 2 1}
+
+rcf RELATIVE-OID ::= {3 2 2}
+
+END
diff --git a/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-P b/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-P
new file mode 100644
index 0000000..623d89d
--- /dev/null
+++ b/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-P
@@ -0,0 +1,125 @@
+
+/*** <<< INCLUDES [Attribute] >>> ***/
+
+#include <RELATIVE-OID.h>
+#include <IA5String.h>
+#include <asn_ioc.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Attribute] >>> ***/
+
+typedef struct Attribute {
+ RELATIVE_OID_t identifier;
+ IA5String_t siAttributeValue;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Attribute_t;
+
+/*** <<< FUNC-DECLS [Attribute] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Attribute;
+
+/*** <<< IOC-TABLES [Attribute] >>> ***/
+
+static const RELATIVE_OID_t asn_VAL_raf_0 = { "not supported", 0 };
+static const RELATIVE_OID_t asn_VAL_rcf_0 = { "not supported", 0 };
+static const asn_ioc_cell_t asn_IOS_Attributes_1_rows[] = {
+ { "&id", aioc__value, &asn_DEF_RELATIVE_OID, &asn_VAL_raf_0 },
+ { "&id", aioc__value, &asn_DEF_RELATIVE_OID, &asn_VAL_rcf_0 }
+};
+static asn_ioc_set_t asn_IOS_Attributes_1[] = {
+ 2, 1, asn_IOS_Attributes_1_rows
+};
+
+/*** <<< CODE [Attribute] >>> ***/
+
+static int
+memb_identifier_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+
+ if(1 /* No applicable constraints whatsoever */) {
+ /* Nothing is here. See below */
+ }
+
+ return td->check_constraints(td, sptr, ctfailcb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [Attribute] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Attribute_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Attribute, identifier),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_RELATIVE_OID,
+ .type_selector = 0,
+ .memb_constraints = memb_identifier_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "identifier"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Attribute, siAttributeValue),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "siAttributeValue"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 }, /* identifier */
+ { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 } /* siAttributeValue */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = {
+ sizeof(struct Attribute),
+ offsetof(struct Attribute, _asn_ctx),
+ asn_MAP_Attribute_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Attribute = {
+ "Attribute",
+ "Attribute",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Attribute_tags_1,
+ sizeof(asn_DEF_Attribute_tags_1)
+ /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
+ asn_DEF_Attribute_tags_1, /* Same as above */
+ sizeof(asn_DEF_Attribute_tags_1)
+ /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Attribute_1,
+ 2, /* Elements count */
+ &asn_SPC_Attribute_specs_1 /* Additional specs */
+};
+
diff --git a/tests/tests-asn1c-compiler/99-class-sample-OK.asn1 b/tests/tests-asn1c-compiler/99-class-sample-OK.asn1
new file mode 100644
index 0000000..28e222f
--- /dev/null
+++ b/tests/tests-asn1c-compiler/99-class-sample-OK.asn1
@@ -0,0 +1,45 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .99
+
+ModuleClassSample
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 99 }
+ DEFINITIONS ::=
+BEGIN
+
+ SAMPLE-CLASS ::= CLASS {
+ &id RELATIVE-OID UNIQUE,
+ &code ENUMERATED { request, response, status }
+ DEFAULT request,
+ &Type OPTIONAL
+ } WITH SYNTAX { [TYPE &Type] [WITH CODE &code] IDENTIFIED BY &id }
+
+ SampleClassObjectSet SAMPLE-CLASS ::= {
+ request-Whatever | respond-Stuff | request-Status | request-Salt
+ }
+
+ request-Whatever SAMPLE-CLASS
+ ::= { IDENTIFIED BY request-whatever }
+
+ respond-Stuff SAMPLE-CLASS
+ ::= { WITH CODE 1 IDENTIFIED BY response-stuff }
+
+ request-Status SAMPLE-CLASS
+ ::= { TYPE SampleType WITH CODE 2 IDENTIFIED BY request-id }
+
+ request-Salt SAMPLE-CLASS
+ ::= { TYPE Salt IDENTIFIED BY request-salt }
+
+ request-id RELATIVE-OID ::= { 1 1 1 }
+ request-salt RELATIVE-OID ::= { 1 1 1 }
+ request-whatever RELATIVE-OID ::= { 1 1 5 }
+ response-stuff RELATIVE-OID ::= { 2 0 1 }
+
+ SampleType ::= SEQUENCE { ... }
+ Salt ::= SET { ... }
+
+END
diff --git a/tests/tests-asn1c-compiler/99-class-sample-OK.asn1.-EFprint-class-matrix b/tests/tests-asn1c-compiler/99-class-sample-OK.asn1.-EFprint-class-matrix
new file mode 100644
index 0000000..c806916
--- /dev/null
+++ b/tests/tests-asn1c-compiler/99-class-sample-OK.asn1.-EFprint-class-matrix
@@ -0,0 +1,73 @@
+ModuleClassSample { iso org(3) dod(6) internet(1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 99 }
+DEFINITIONS ::=
+BEGIN
+
+SAMPLE-CLASS ::= CLASS {
+ &id RELATIVE-OID UNIQUE,
+ &code ENUMERATED {
+ request(0),
+ response(1),
+ status(2)
+ } DEFAULT 0,
+ &Type OPTIONAL
+} WITH SYNTAX { [TYPE &Type] [WITH CODE &code] IDENTIFIED BY &id }
+
+-- Information Object Set has 4 entries:
+-- [ &id][ &code][ &Type]
+-- [1] request-whatever <no entry> <no entry>
+-- [2] response-stuff 1 <no entry>
+-- [3] request-id 2 SampleType
+-- [4] request-salt <no entry> Salt
+
+
+SampleClassObjectSet SAMPLE-CLASS ::= {{ IDENTIFIED BY request-whatever } | { WITH CODE 1 IDENTIFIED BY response-stuff } | { TYPE SampleType WITH CODE 2 IDENTIFIED BY request-id } | { TYPE Salt IDENTIFIED BY request-salt }}
+-- Information Object Set has 4 entries:
+-- [ &id][ &code][ &Type]
+-- [1] request-whatever <no entry> <no entry>
+-- [2] response-stuff 1 <no entry>
+-- [3] request-id 2 SampleType
+-- [4] request-salt <no entry> Salt
+
+
+request-Whatever SAMPLE-CLASS ::= { IDENTIFIED BY request-whatever }
+-- Information Object Set has 1 entry:
+-- [ &id][ &code][ &Type]
+-- [1] request-whatever <no entry> <no entry>
+
+
+respond-Stuff SAMPLE-CLASS ::= { WITH CODE 1 IDENTIFIED BY response-stuff }
+-- Information Object Set has 1 entry:
+-- [ &id][ &code][ &Type]
+-- [1] response-stuff 1 <no entry>
+
+
+request-Status SAMPLE-CLASS ::= { TYPE SampleType WITH CODE 2 IDENTIFIED BY request-id }
+-- Information Object Set has 1 entry:
+-- [ &id][ &code][ &Type]
+-- [1] request-id 2 SampleType
+
+
+request-Salt SAMPLE-CLASS ::= { TYPE Salt IDENTIFIED BY request-salt }
+-- Information Object Set has 1 entry:
+-- [ &id][ &code][ &Type]
+-- [1] request-salt <no entry> Salt
+
+
+request-id RELATIVE-OID ::= { 1 1 1 }
+
+request-salt RELATIVE-OID ::= { 1 1 1 }
+
+request-whatever RELATIVE-OID ::= { 1 1 5 }
+
+response-stuff RELATIVE-OID ::= { 2 0 1 }
+
+SampleType ::= SEQUENCE {
+ ...
+}
+
+Salt ::= SET {
+ ...
+}
+
+END
diff --git a/tests/tests-asn1c-compiler/Makefile.am b/tests/tests-asn1c-compiler/Makefile.am
new file mode 100644
index 0000000..7f549fc
--- /dev/null
+++ b/tests/tests-asn1c-compiler/Makefile.am
@@ -0,0 +1,7 @@
+
+dist_check_SCRIPTS = check-parsing.sh
+TESTS_ENVIRONMENT= top_srcdir=${top_srcdir} top_builddir=${top_builddir}
+TESTS = $(dist_check_SCRIPTS)
+CLEANFILES = .check-parsing.*.tmp
+
+EXTRA_DIST = README $(srcdir)/*asn1*
diff --git a/tests/tests-asn1c-compiler/README b/tests/tests-asn1c-compiler/README
new file mode 100644
index 0000000..5d1212e
--- /dev/null
+++ b/tests/tests-asn1c-compiler/README
@@ -0,0 +1,25 @@
+
+This is a collection of various little ASN.1 modules, used independently
+by several different testing engines below the main tree (i.e. libasn1fix)
+for stressing various aspects of compiler operation.
+
+The files follow certain naming conventions:
+
+Source file:
+ <Index>-<arbitrary-name>-{OK|SE|NP}.asn1
+
+Regenerator test file:
+ <Index>-<arbitrary-name>-{OK|SE|NP}.asn1.[<compiler-flags>]
+
+Where
+ <Index> is arbitrary number (digits)
+ <arbitrary-name> is arbitrary string, without dots
+ OK file syntax and semantics are absolutely correct
+ SE file semantics is wrong
+ SW file semantics is suspicious (warning)
+ NP file syntax is incorrect, file not parseable
+ <compiler-flags> command-line flags for compiler
+
+Example:
+ 07-int-OK.asn1 # Correct ASN.1 file
+ 07-int-OK.asn1.-EF # Test of file regeneration with -E -F flags.
diff --git a/tests/tests-asn1c-compiler/check-parsing-log2diff.pl b/tests/tests-asn1c-compiler/check-parsing-log2diff.pl
new file mode 100644
index 0000000..fca9626
--- /dev/null
+++ b/tests/tests-asn1c-compiler/check-parsing-log2diff.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/env perl
+#
+# Convert check-parsing.sh's log to diff format.
+#
+
+if(-t STDIN && $#ARGV == -1) {
+ print STDERR "Usage: check-parsing-log2diff.pl < check-parsing.sh.log > diff.patch\n";
+ exit(1);
+}
+
+$state = 0;
+while(<>) {
+ if ($state == 0) {
+ if (/^Checking\s*(.+?)\s*against\s*(.+?)$/) {
+ $source = $1;
+ $target = $2;
+ } elsif (/^\-\-\-\s(.+?)\s.*/) {
+ print "--- a/dev/null " . "\n";
+ } elsif (/^\+\+\+\s(.+?)\s.*/) {
+ print "+++ b" . $target . "\n";
+ $state = 1;
+ }
+ } else {
+ if (/^Checking\s*(.+?)\s*against\s*(.+?)$/) {
+ $source = $1;
+ $target = $2;
+ $state = 0;
+ } else {
+ print $_;
+ }
+ }
+}
diff --git a/tests/tests-asn1c-compiler/check-parsing.sh b/tests/tests-asn1c-compiler/check-parsing.sh
new file mode 100755
index 0000000..9edecb1
--- /dev/null
+++ b/tests/tests-asn1c-compiler/check-parsing.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# Test diff(1) capabilities
+diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files
+diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output
+
+ec=0
+
+if [ "$1" != "regenerate" ]; then
+ set -e
+fi
+
+PROCESSING=""
+print_status() {
+ echo "Error while processing $PROCESSING"
+}
+
+trap print_status EXIT
+
+top_srcdir="${top_srcdir:-../..}"
+top_builddir="${top_builddir:-../..}"
+
+for ref in ${top_srcdir}/tests/tests-asn1c-compiler/*.asn1.-*; do
+ # Figure out the initial source file used to generate this output.
+ src=$(echo "$ref" | sed -e 's/\.-[-a-zA-Z0-9=]*$//')
+ # Figure out compiler flags used to create the file.
+ flags=$(echo "$ref" | sed -e 's/.*\.-//')
+ echo "Checking $src against $ref"
+ template=.tmp.check-parsing.$$
+ oldversion=${template}.old
+ newversion=${template}.new
+ PROCESSING="$ref (from $src)"
+ LANG=C sed -e 's/^found in .*/found in .../' < "$ref" > "$oldversion"
+ (${top_builddir}/asn1c/asn1c -S ${top_srcdir}/skeletons "-$flags" "$src" | LANG=C sed -e 's/^found in .*/found in .../' > "$newversion") || ec=$?
+ if [ $? = 0 ]; then
+ diff $diffArgs "$oldversion" "$newversion" || ec=$?
+ fi
+ rm -f $oldversion $newversion
+ if [ "$1" = "regenerate" ]; then
+ ${top_builddir}/asn1c -S ${top_srcdir}/skeletons "-$flags" "$src" > "$ref"
+ fi
+done
+
+if [ $ec = 0 ]; then
+ trap '' EXIT
+fi
+
+exit $ec