aboutgitcodebugslistschat
path: root/pesto.h
diff options
context:
space:
mode:
Diffstat (limited to 'pesto.h')
-rw-r--r--pesto.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/pesto.h b/pesto.h
index e9b329f..3c93d3e 100644
--- a/pesto.h
+++ b/pesto.h
@@ -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 */