summaryrefslogtreecommitdiff
path: root/toxcore/onion_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/onion_client.h')
-rw-r--r--toxcore/onion_client.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h
index cf0975d3..5b89a8d9 100644
--- a/toxcore/onion_client.h
+++ b/toxcore/onion_client.h
@@ -103,6 +103,10 @@ typedef struct {
103 void *tcp_relay_node_callback_object; 103 void *tcp_relay_node_callback_object;
104 uint32_t tcp_relay_node_callback_number; 104 uint32_t tcp_relay_node_callback_number;
105 105
106 void (*dht_pk_callback)(void *data, int32_t number, const uint8_t *dht_public_key);
107 void *dht_pk_callback_object;
108 uint32_t dht_pk_callback_number;
109
106 uint32_t run_count; 110 uint32_t run_count;
107} Onion_Friend; 111} Onion_Friend;
108 112
@@ -205,6 +209,17 @@ int onion_getfriendip(const Onion_Client *onion_c, int friend_num, IP_Port *ip_p
205int recv_tcp_relay_handler(Onion_Client *onion_c, int friend_num, int (*tcp_relay_node_callback)(void *object, 209int recv_tcp_relay_handler(Onion_Client *onion_c, int friend_num, int (*tcp_relay_node_callback)(void *object,
206 uint32_t number, IP_Port ip_port, const uint8_t *public_key), void *object, uint32_t number); 210 uint32_t number, IP_Port ip_port, const uint8_t *public_key), void *object, uint32_t number);
207 211
212
213/* Set the function for this friend that will be callbacked with object and number
214 * when that friend gives us his DHT temporary public key.
215 *
216 * object and number will be passed as argument to this function.
217 *
218 * return -1 on failure.
219 * return 0 on success.
220 */
221int onion_dht_pk_callback(Onion_Client *onion_c, int friend_num, void (*function)(void *data, int32_t number, const uint8_t *dht_public_key), void *object, uint32_t number);
222
208/* Set a friends DHT public key. 223/* Set a friends DHT public key.
209 * timestamp is the time (current_time_monotonic()) at which the key was last confirmed belonging to 224 * timestamp is the time (current_time_monotonic()) at which the key was last confirmed belonging to
210 * the other peer. 225 * the other peer.