summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/uuid.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/include/uuid.h b/src/include/uuid.h
index 0209055e9e..b8827b0510 100644
--- a/src/include/uuid.h
+++ b/src/include/uuid.h
@@ -18,6 +18,22 @@
#include <string.h>
+#define UUID_LEN 16
+#define UUID_STRLEN 36
+
+/*
+ * Parses a canonical UUID string into the common byte representation
+ * where the first three words are interpreted as little endian:
+ *
+ * The UUID
+ * "00112233-4455-6677-8899-aabbccddeeff"
+ * is stored as
+ * 33 22 11 00 55 44 77 66 88 99 aa bb cc dd ee ff
+ *
+ * Returns negative value on error, 0 on success.
+ */
+int parse_uuid(uint8_t *uuid, const char *uuid_str);
+
typedef struct {
uint8_t b[16];
} __packed guid_t;