summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-id128/id128-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-11 13:40:50 -0400
committerGitHub <noreply@github.com>2016-10-11 13:40:50 -0400
commitb744e8937ce603090a9bf64ac7d8cc2c1a29e4f0 (patch)
treed6873059fd870c78dae268671ad0e12ac8c493db /src/libsystemd/sd-id128/id128-util.c
parent40f45ff0c339971fd088e6f9cc2e61444087685d (diff)
parenta46eac1bbddcdd15e741fc6c8389078db1067f81 (diff)
Merge pull request #4067 from poettering/invocation-id
Add an "invocation ID" concept to the service manager
Diffstat (limited to 'src/libsystemd/sd-id128/id128-util.c')
-rw-r--r--src/libsystemd/sd-id128/id128-util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd/sd-id128/id128-util.c b/src/libsystemd/sd-id128/id128-util.c
index c3f527d657..337eae24b4 100644
--- a/src/libsystemd/sd-id128/id128-util.c
+++ b/src/libsystemd/sd-id128/id128-util.c
@@ -192,3 +192,16 @@ int id128_write(const char *p, Id128Format f, sd_id128_t id, bool do_sync) {
return id128_write_fd(fd, f, id, do_sync);
}
+
+void id128_hash_func(const void *p, struct siphash *state) {
+ siphash24_compress(p, 16, state);
+}
+
+int id128_compare_func(const void *a, const void *b) {
+ return memcmp(a, b, 16);
+}
+
+const struct hash_ops id128_hash_ops = {
+ .hash = id128_hash_func,
+ .compare = id128_compare_func,
+};