summaryrefslogtreecommitdiff
path: root/core/DHT.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/DHT.h')
-rw-r--r--core/DHT.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/core/DHT.h b/core/DHT.h
index 0290ef92..c80d17fc 100644
--- a/core/DHT.h
+++ b/core/DHT.h
@@ -26,13 +26,13 @@
26#ifndef DHT_H 26#ifndef DHT_H
27#define DHT_H 27#define DHT_H
28 28
29#include "network.h" 29#include "net_crypto.h"
30 30
31//Current time, unix format 31//Current time, unix format
32#define unix_time() ((uint32_t)time(NULL)) 32#define unix_time() ((uint32_t)time(NULL))
33 33
34//size of the client_id in bytes 34//size of the client_id in bytes
35#define CLIENT_ID_SIZE 32 35#define CLIENT_ID_SIZE crypto_box_PUBLICKEYBYTES
36 36
37 37
38 38
@@ -68,18 +68,14 @@ void doDHT();
68int DHT_handlepacket(uint8_t * packet, uint32_t length, IP_Port source); 68int DHT_handlepacket(uint8_t * packet, uint32_t length, IP_Port source);
69 69
70//Use this function to bootstrap the client 70//Use this function to bootstrap the client
71//Sends a get nodes request to the given ip port 71//Sends a get nodes request to the given node with ip port and public_key
72void DHT_bootstrap(IP_Port ip_port); 72void DHT_bootstrap(IP_Port ip_port, uint8_t * public_key);
73 73
74 74
75//TODO: 75//TODO:
76//Add functions to save and load the state(client list, friends list) 76//Add functions to save and load the state(client list, friends list)
77 77
78 78
79//Global variables
80
81//Our client id
82extern uint8_t self_client_id[CLIENT_ID_SIZE];
83 79
84 80
85 81