diff options
Diffstat (limited to 'core/DHT.h')
-rw-r--r-- | core/DHT.h | 11 |
1 files changed, 0 insertions, 11 deletions
@@ -21,7 +21,6 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | |||
25 | #ifndef DHT_H | 24 | #ifndef DHT_H |
26 | #define DHT_H | 25 | #define DHT_H |
27 | 26 | ||
@@ -37,8 +36,6 @@ extern "C" { | |||
37 | /* size of the client_id in bytes */ | 36 | /* size of the client_id in bytes */ |
38 | #define CLIENT_ID_SIZE crypto_box_PUBLICKEYBYTES | 37 | #define CLIENT_ID_SIZE crypto_box_PUBLICKEYBYTES |
39 | 38 | ||
40 | |||
41 | |||
42 | /* Add a new friend to the friends list | 39 | /* Add a new friend to the friends list |
43 | client_id must be CLIENT_ID_SIZE bytes long. | 40 | client_id must be CLIENT_ID_SIZE bytes long. |
44 | returns 0 if success | 41 | returns 0 if success |
@@ -51,7 +48,6 @@ int DHT_addfriend(uint8_t * client_id); | |||
51 | returns 1 if failure (client_id not in friends list) */ | 48 | returns 1 if failure (client_id not in friends list) */ |
52 | int DHT_delfriend(uint8_t * client_id); | 49 | int DHT_delfriend(uint8_t * client_id); |
53 | 50 | ||
54 | |||
55 | /* Get ip of friend | 51 | /* Get ip of friend |
56 | client_id must be CLIENT_ID_SIZE bytes long. | 52 | client_id must be CLIENT_ID_SIZE bytes long. |
57 | ip must be 4 bytes long. | 53 | ip must be 4 bytes long. |
@@ -61,7 +57,6 @@ int DHT_delfriend(uint8_t * client_id); | |||
61 | returns ip of 1 if friend is not in list. */ | 57 | returns ip of 1 if friend is not in list. */ |
62 | IP_Port DHT_getfriendip(uint8_t * client_id); | 58 | IP_Port DHT_getfriendip(uint8_t * client_id); |
63 | 59 | ||
64 | |||
65 | /* Run this function at least a couple times per second (It's the main loop) */ | 60 | /* Run this function at least a couple times per second (It's the main loop) */ |
66 | void doDHT(); | 61 | void doDHT(); |
67 | 62 | ||
@@ -74,8 +69,6 @@ int DHT_handlepacket(uint8_t * packet, uint32_t length, IP_Port source); | |||
74 | Sends a get nodes request to the given node with ip port and public_key */ | 69 | Sends a get nodes request to the given node with ip port and public_key */ |
75 | void DHT_bootstrap(IP_Port ip_port, uint8_t * public_key); | 70 | void DHT_bootstrap(IP_Port ip_port, uint8_t * public_key); |
76 | 71 | ||
77 | |||
78 | |||
79 | /* ROUTING FUNCTIONS */ | 72 | /* ROUTING FUNCTIONS */ |
80 | 73 | ||
81 | /* send the given packet to node with client_id | 74 | /* send the given packet to node with client_id |
@@ -86,8 +79,6 @@ int route_packet(uint8_t * client_id, uint8_t * packet, uint32_t length); | |||
86 | returns the number of nodes it sent the packet to */ | 79 | returns the number of nodes it sent the packet to */ |
87 | int route_tofriend(uint8_t * friend_id, uint8_t * packet, uint32_t length); | 80 | int route_tofriend(uint8_t * friend_id, uint8_t * packet, uint32_t length); |
88 | 81 | ||
89 | |||
90 | |||
91 | /* NAT PUNCHING FUNCTIONS */ | 82 | /* NAT PUNCHING FUNCTIONS */ |
92 | 83 | ||
93 | /* Puts all the different ips returned by the nodes for a friend_id into array ip_portlist | 84 | /* Puts all the different ips returned by the nodes for a friend_id into array ip_portlist |
@@ -96,8 +87,6 @@ int route_tofriend(uint8_t * friend_id, uint8_t * packet, uint32_t length); | |||
96 | returns -1 if no such friend*/ | 87 | returns -1 if no such friend*/ |
97 | int friend_ips(IP_Port * ip_portlist, uint8_t * friend_id); | 88 | int friend_ips(IP_Port * ip_portlist, uint8_t * friend_id); |
98 | 89 | ||
99 | |||
100 | |||
101 | /* SAVE/LOAD functions */ | 90 | /* SAVE/LOAD functions */ |
102 | 91 | ||
103 | /* get the size of the DHT (for saving) */ | 92 | /* get the size of the DHT (for saving) */ |