diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:19:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:07:37 +0000 |
commit | b485aab7e71c1625cfc27e0f92c9509f42378458 (patch) | |
tree | ae9abe108601079d1679194de237c9a435ae5b55 /src/libnetdata/uuid/uuid.h | |
parent | Adding upstream version 1.44.3. (diff) | |
download | netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.tar.xz netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.zip |
Adding upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/libnetdata/uuid/uuid.h (renamed from libnetdata/uuid/uuid.h) | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libnetdata/uuid/uuid.h b/src/libnetdata/uuid/uuid.h index 567646846..6d5f024f8 100644 --- a/libnetdata/uuid/uuid.h +++ b/src/libnetdata/uuid/uuid.h @@ -10,6 +10,24 @@ UUID_DEFINE(health_alert_transition_msgid, 0x9c, 0xe0, 0xcb, 0x58, 0xab, 0x8b, 0 // this is also defined in alarm-notify.sh.in UUID_DEFINE(health_alert_notification_msgid, 0x6d, 0xb0, 0x01, 0x8e, 0x83, 0xe3, 0x43, 0x20, 0xae, 0x2a, 0x65, 0x9d, 0x78, 0x01, 0x9f, 0xb7); +typedef struct { + union { + uuid_t uuid; + struct { + uint64_t hig64; + uint64_t low64; + } parts; + }; +} UUID; +UUID UUID_generate_from_hash(const void *payload, size_t payload_len); + +#define UUIDeq(a, b) ((a).parts.hig64 == (b).parts.hig64 && (a).parts.low64 == (b).parts.low64) + +static inline UUID uuid2UUID(uuid_t uu1) { + UUID *ret = (UUID *)uu1; + return *ret; +} + #define UUID_COMPACT_STR_LEN 33 void uuid_unparse_lower_compact(const uuid_t uuid, char *out); int uuid_parse_compact(const char *in, uuid_t uuid); |