Implemented DHT

This commit is contained in:
t
2025-01-10 01:59:20 +01:00
parent b06a71186a
commit 3c3e8127c9
6 changed files with 258 additions and 54 deletions
+29
View File
@@ -0,0 +1,29 @@
#ifndef LOOKUP_H
#define LOOKUP_H
#include "dht.h"
#define TABLE_SIZE 10
typedef struct lookup_table
{
lookup_request *request;
struct lookup_table *next;
}lookup_table;
typedef struct lookup_head
{
lookup_table *head;
}lookup_head;
static lookup_head *table;
static int free_space = TABLE_SIZE;
void init_lookup_table();
void push_lookup(lookup_request *request);
lookup_request *find_lookup(const uint16_t hash_id);
void free_lookup_table();
#endif //LOOKUP_H