diff options
Diffstat (limited to 'pesto.h')
| -rw-r--r-- | pesto.h | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -9,4 +9,26 @@ #ifndef PESTO_H #define PESTO_H +#include <assert.h> +#include <stdint.h> + +#define PESTO_SERVER_MAGIC "basil:s" + +/* Version 0 is reserved for unreleased / unsupported experimental versions */ +#define PESTO_PROTOCOL_VERSION 1 + +/** + * struct pesto_hello - Server introduction message + * @magic: PESTO_SERVER_MAGIC + * @version: Version number + */ +struct pesto_hello { + char magic[8]; + uint32_t version; +} __attribute__ ((__packed__)); + +static_assert(sizeof(PESTO_SERVER_MAGIC) + == sizeof(((struct pesto_hello *)0)->magic), + "PESTO_SERVER_MAGIC has wrong size"); + #endif /* PESTO_H */ |
