summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-08-16 18:15:14 +0200
committerSander Vrijders <sander@ouroboros.rocks>2023-08-23 13:09:11 +0200
commitab8ee0b24335790e49127b1330f9d7bcca7f6bfa (patch)
treeb58fa560f7bf52d951547522f9b6d87244af3e06 /src/ipcpd/unicast
parentde9674f090c2ae71cacd5f8bd6dcf5e8657ad686 (diff)
downloadouroboros-ab8ee0b24335790e49127b1330f9d7bcca7f6bfa.tar.gz
ouroboros-ab8ee0b24335790e49127b1330f9d7bcca7f6bfa.zip
include: Revise printing hashes
The code was a bit convoluted to print hashes as hex strings. Renamed to HASH_FMT32 and HASH_VAL32 to make clear we are printing the first 32 bits only, and added options to print 64 up to 512 bits as well. This doesn't depend on endianness anymore. Adds a small test for the hash (printing) functions. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r--src/ipcpd/unicast/dir/dht.c1
-rw-r--r--src/ipcpd/unicast/fa.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/ipcpd/unicast/dir/dht.c b/src/ipcpd/unicast/dir/dht.c
index e97d5c5f..adc6feb2 100644
--- a/src/ipcpd/unicast/dir/dht.c
+++ b/src/ipcpd/unicast/dir/dht.c
@@ -31,6 +31,7 @@
#define DHT "dht"
#define OUROBOROS_PREFIX DHT
+#include <ouroboros/endian.h>
#include <ouroboros/hash.h>
#include <ouroboros/ipcp-dev.h>
#include <ouroboros/bitmap.h>
diff --git a/src/ipcpd/unicast/fa.c b/src/ipcpd/unicast/fa.c
index 90550ebc..2591a162 100644
--- a/src/ipcpd/unicast/fa.c
+++ b/src/ipcpd/unicast/fa.c
@@ -31,6 +31,7 @@
#define FA "flow-allocator"
#define OUROBOROS_PREFIX FA
+#include <ouroboros/endian.h>
#include <ouroboros/logs.h>
#include <ouroboros/fqueue.h>
#include <ouroboros/errno.h>