summaryrefslogtreecommitdiff
path: root/core/DHT.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/DHT.h')
-rw-r--r--core/DHT.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/core/DHT.h b/core/DHT.h
index 68d181e8..f561d559 100644
--- a/core/DHT.h
+++ b/core/DHT.h
@@ -72,12 +72,34 @@ int DHT_handlepacket(uint8_t * packet, uint32_t length, IP_Port source);
72void DHT_bootstrap(IP_Port ip_port, uint8_t * public_key); 72void DHT_bootstrap(IP_Port ip_port, uint8_t * public_key);
73 73
74 74
75
76/* ROUTING FUNCTIONS */
77
78/* send the given packet to node with client_id
79 returns -1 if failure */
80int route_packet(uint8_t * client_id, uint8_t * packet, uint32_t length);
81
82/* Send the following packet to everyone who tells us they are connected to friend_id
83 returns the number of nodes it sent the packet to */
84int route_tofriend(uint8_t * friend_id, uint8_t * packet, uint32_t length);
85
86
87
88/* NAT PUNCHING FUNCTIONS */
89
90/* Puts all the different ips returned by the nodes for a friend_id into array ip_portlist
91 ip_portlist must be at least MAX_FRIEND_CLIENTS big
92 returns the number of ips returned
93 returns -1 if no such friend*/
94int friend_ips(IP_Port * ip_portlist, uint8_t * friend_id);
95
96
97
75/* SAVE/LOAD functions */ 98/* SAVE/LOAD functions */
76 99
77/* get the size of the DHT (for saving) */ 100/* get the size of the DHT (for saving) */
78uint32_t DHT_size(); 101uint32_t DHT_size();
79 102
80
81/* save the DHT in data where data is an array of size DHT_size() */ 103/* save the DHT in data where data is an array of size DHT_size() */
82void DHT_save(uint8_t * data); 104void DHT_save(uint8_t * data);
83 105