Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
char buf[4096];
int ret = 0;
char buf[4096];
int ret = 0;
- readlen = fread(&header, sizeof(header), 1, in);
+ readlen = fread(&header, header_sizeof(header), 1, in);
if (readlen < 1)
return -EINVAL;
if (readlen < 1)
return -EINVAL;
+#define HEADER_END char end_field
+#define header_sizeof(type) offsetof(typeof(type), end_field)
+
struct metadata_packet_header {
uint32_t magic; /* 0x75D11D57 */
uint8_t uuid[16]; /* Unique Universal Identifier */
struct metadata_packet_header {
uint32_t magic; /* 0x75D11D57 */
uint8_t uuid[16]; /* Unique Universal Identifier */
uint8_t compression_scheme; /* 0 if unused */
uint8_t encryption_scheme; /* 0 if unused */
uint8_t checksum_scheme; /* 0 if unused */
uint8_t compression_scheme; /* 0 if unused */
uint8_t encryption_scheme; /* 0 if unused */
uint8_t checksum_scheme; /* 0 if unused */
-} __attribute__((packed));
#endif /* _BABELTRACE_CTF_METADATA_H */
#endif /* _BABELTRACE_CTF_METADATA_H */