diff options
Diffstat (limited to 'core/DHT.h')
-rw-r--r-- | core/DHT.h | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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(); | |||
68 | int DHT_handlepacket(uint8_t * packet, uint32_t length, IP_Port source); | 68 | int 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 |
72 | void DHT_bootstrap(IP_Port ip_port); | 72 | void 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 | ||
82 | extern uint8_t self_client_id[CLIENT_ID_SIZE]; | ||
83 | 79 | ||
84 | 80 | ||
85 | 81 | ||