summaryrefslogtreecommitdiff
path: root/src/proto.h
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2025-07-18 09:32:16 +0200
committerJesper Jensen <jesper@jnsn.dev>2025-07-18 09:32:33 +0200
commit69528489cddd27b4d4b9411d00b60cccc175b0e8 (patch)
treeeeed9d13f99858b3fd5660bc8d57e86bf81088a3 /src/proto.h
parenta46e9a5cbb8fc233a0ccb47708e7686c2b561ac0 (diff)
Add a simple API for lookups
Diffstat (limited to 'src/proto.h')
-rw-r--r--src/proto.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/proto.h b/src/proto.h
index 95c7d7e..aaa3b3b 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -4,6 +4,7 @@
#include "sha256.h"
#include <sys/socket.h>
#include <arpa/inet.h>
+#include <pthread.h>
#define TOKEN_ITMO 20
#define TOKEN_VTMO 60
@@ -26,6 +27,8 @@ enum Operation {
OP_PENDING,
OP_ACTIVE,
OP_COMPLETED,
+
+ OP_LEN,
};
struct lookup {
@@ -74,6 +77,8 @@ typedef PROCESS_REPONSE(resp);
typedef PROCESS_TIMEOUT(tmout);
struct dht {
+ pthread_mutex_t mutex;
+
struct nodeid self;
int sfd;