de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen/* Generate a GUID (contains host name) */
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainenconst char *guid_generate(void);
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen/* Generate 128 bit GUID */
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen/* Returns TRUE if GUID is empty (not set / unknown). */
518781a0a4ba2403f23dbadda445b107fbb87daaPhil Carmodybool guid_128_is_empty(const guid_128_t guid) ATTR_PURE;
33750ba29b605a925af5aed58d3f3735422b1e25Phil Carmodystatic inline void guid_128_empty(guid_128_t guid)
40ac30b9267c710f5fcdd4b2f6bcd7718a631843Timo Sirainen/* Returns TRUE if two GUIDs are equal. */
518781a0a4ba2403f23dbadda445b107fbb87daaPhil Carmodybool guid_128_equals(const guid_128_t guid1, const guid_128_t guid2) ATTR_PURE;
8562f8de469e87ad4104747cebec6b133fa3a0f5Timo Sirainen/* Copy GUID */
8562f8de469e87ad4104747cebec6b133fa3a0f5Timo Sirainenstatic inline void guid_128_copy(guid_128_t dest, const guid_128_t src)
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen/* Returns GUID as a hex string. */
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainenconst char *guid_128_to_string(const guid_128_t guid);
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen/* Parse GUID from a string. Returns 0 if ok, -1 if GUID isn't valid. */
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainenint guid_128_from_string(const char *str, guid_128_t guid_r);
7c681809344b880aae61e99b6ab74ae19945ff9eAki Tuomi/* Returns GUID as a UUID hex string. */
7c681809344b880aae61e99b6ab74ae19945ff9eAki Tuomiconst char *guid_128_to_uuid_string(const guid_128_t guid, enum uuid_format format);
7c681809344b880aae61e99b6ab74ae19945ff9eAki Tuomi/* Parse GUID from a UUID string. Returns 0 if ok, -1 if UIID isn't valid. */
7c681809344b880aae61e99b6ab74ae19945ff9eAki Tuomiint guid_128_from_uuid_string(const char *str, guid_128_t guid_r);
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen/* guid_128 hash/cmp functions for hash.h */
518781a0a4ba2403f23dbadda445b107fbb87daaPhil Carmodyunsigned int guid_128_hash(const guid_128_t guid) ATTR_PURE;
518781a0a4ba2403f23dbadda445b107fbb87daaPhil Carmodyint guid_128_cmp(const guid_128_t guid1, const guid_128_t guid2) ATTR_PURE;
af49da69a12b5383b89c7b2fa574c2a85b9ca310Timo Sirainen/* Return the hash of host used by guid_128_generate(). */