summaryrefslogtreecommitdiff
path: root/toxcore/DHT.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/DHT.h')
-rw-r--r--toxcore/DHT.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/toxcore/DHT.h b/toxcore/DHT.h
index 25a257e3..c42bceb8 100644
--- a/toxcore/DHT.h
+++ b/toxcore/DHT.h
@@ -35,6 +35,9 @@
35/* A list of the clients mathematically closest to ours. */ 35/* A list of the clients mathematically closest to ours. */
36#define LCLIENT_LIST 32 36#define LCLIENT_LIST 32
37 37
38/* The max number of nodes to send with send nodes. */
39#define MAX_SENT_NODES 8
40
38/* Maximum newly announced nodes to ping per TIME_TOPING seconds. */ 41/* Maximum newly announced nodes to ping per TIME_TOPING seconds. */
39#define MAX_TOPING 16 42#define MAX_TOPING 16
40 43
@@ -204,6 +207,19 @@ int DHT_getfriendip(DHT *dht, uint8_t *client_id, IP_Port *ip_port);
204 */ 207 */
205int id_closest(uint8_t *id, uint8_t *id1, uint8_t *id2); 208int id_closest(uint8_t *id, uint8_t *id1, uint8_t *id2);
206 209
210/* Get the (maximum MAX_SENT_NODES) closest nodes to client_id we know
211 * and put them in nodes_list (must be MAX_SENT_NODES big).
212 *
213 * sa_family = family (IPv4 or IPv6)?
214 * is_LAN = return some LAN ips (true or false)
215 * want_good = do we want tested nodes or not? (TODO)
216 *
217 * return the number of nodes returned.
218 *
219 */
220int get_close_nodes(DHT *dht, uint8_t *client_id, Node_format *nodes_list, sa_family_t sa_family, uint8_t is_LAN,
221 uint8_t want_good);
222
207/* Run this function at least a couple times per second (It's the main loop). */ 223/* Run this function at least a couple times per second (It's the main loop). */
208void do_DHT(DHT *dht); 224void do_DHT(DHT *dht);
209 225