--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+// This is not defined, thus type 'int' doesn't exists.
+// typealias integer { size = 32; align = 32; signed = false; base = hex; } := int;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = string;
+ fields := struct {
+ /* An untyped enum is typed with "int". */
+ enum {
+ VAL1
+ } field;
+ };
+};
+
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+/* This is ugly: 'int' is defined as a 'string'. */
+typealias string { encoding = ascii; } := int;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = string;
+ fields := struct {
+ /* An untyped enum is typed with "int" (a string). */
+ enum {
+ VAL1
+ } field;
+ };
+};
+
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias floating_point { exp_dig = 8; mant_dig = 24; } := FLOAT;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Enum can be nameless */
+event {
+ name = string;
+ fields := struct {
+ enum Z: FLOAT { X } Y;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Enum can be nameless */
+event {
+ name = string;
+ fields := struct {
+ enum : uint8_t {
+ VAL1,
+ VAL2 = VAL1,
+ VAL3 = VAL2
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := TYPE;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Value 1024 is above the max value of TYPE. */
+event {
+ name = string;
+ fields := struct {
+ enum : TYPE {
+ VAL1,
+ VAL2,
+ VAL3 = 1024
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias integer { size = 32; align = 32; signed = true; base = hex; } := TYPE;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Value -1024 is below the min value of TYPE. */
+event {
+ name = string;
+ fields := struct {
+ enum : TYPE {
+ VAL1,
+ VAL2,
+ VAL3 = -1024
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* The first character is an escape char and is removed. */
+/* Thus str and _str are the same field, and should fail. */
+event {
+ name = string;
+ fields := struct {
+ string str;
+ string _str;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* The first character is an escape char and is removed. */
+/* Thus the field _ will produce an empty string. */
+event {
+ name = string;
+ fields := struct {
+ string _;
+ string __;
+ string ___;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := int;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = string;
+ fields := struct {
+ // To be specified into the standard.
+ enum {} field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Enum can be nameless */
+event {
+ name = string;
+ fields := struct {
+ enum : uint8_t {
+ VAL1, VAL2, VAL3
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Enum can be nameless */
+event {
+ name = string;
+ fields := struct {
+ enum : uint8_t {
+ "VAL1",
+ "VAL 1",
+ VAL_1
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := int;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = string;
+ fields := struct {
+ /* An untyped enum is typed with "int". */
+ enum {
+ VAL1
+ } field;
+ };
+};
+
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias integer { size = 32; align = 32; signed = true; base = hex; } := TYPE;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Value 127 is the max value of TYPE. */
+event {
+ name = string;
+ fields := struct {
+ enum : TYPE {
+ VAL1,
+ VAL2,
+ VAL3 = 127
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias integer { size = 32; align = 32; signed = true; base = hex; } := TYPE;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Value -128 is the min value of TYPE. */
+event {
+ name = string;
+ fields := struct {
+ enum : TYPE {
+ VAL1,
+ VAL2,
+ VAL3 = -128
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias integer { size = 8; align = 8; signed = true; base = 10; } := TYPE;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Negative value are allowed for signed enum. */
+event {
+ name = string;
+ fields := struct {
+ enum : TYPE {
+ VAL1,
+ VAL2,
+ VAL3 = -1
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := TYPE;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Value 255 is the max value of TYPE. */
+event {
+ name = string;
+ fields := struct {
+ enum : TYPE {
+ VAL1,
+ VAL2,
+ VAL3 = 255
+ } field;
+ };
+};