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 029f5624..0d2e84a5 100644
--- a/toxcore/onion_client.h
+++ b/toxcore/onion_client.h
@@ -102,6 +102,10 @@ typedef struct {
102 102
103 Last_Pinged last_pinged[MAX_STORED_PINGED_NODES]; 103 Last_Pinged last_pinged[MAX_STORED_PINGED_NODES];
104 uint8_t last_pinged_index; 104 uint8_t last_pinged_index;
105
106 int (*tcp_relay_node_callback)(void *object, uint32_t number, IP_Port ip_port, uint8_t *public_key);
107 void *tcp_relay_node_callback_object;
108 uint32_t tcp_relay_node_callback_number;
105} Onion_Friend; 109} Onion_Friend;
106 110
107typedef int (*oniondata_handler_callback)(void *object, uint8_t *source_pubkey, uint8_t *data, uint32_t len); 111typedef int (*oniondata_handler_callback)(void *object, uint8_t *source_pubkey, uint8_t *data, uint32_t len);
@@ -176,6 +180,17 @@ int onion_set_friend_online(Onion_Client *onion_c, int friend_num, uint8_t is_on
176 */ 180 */
177int onion_getfriendip(Onion_Client *onion_c, int friend_num, IP_Port *ip_port); 181int onion_getfriendip(Onion_Client *onion_c, int friend_num, IP_Port *ip_port);
178 182
183/* Set the function for this friend that will be callbacked with object and number
184 * when that friends gives us one of the TCP relays he is connected to.
185 *
186 * object and number will be passed as argument to this function.
187 *
188 * return -1 on failure.
189 * return 0 on success.
190 */
191int recv_tcp_relay_handler(Onion_Client *onion_c, int friend_num, int (*tcp_relay_node_callback)(void *object,
192 uint32_t number, IP_Port ip_port, uint8_t *public_key), void *object, uint32_t number);
193
179/* Set a friends DHT public key. 194/* Set a friends DHT public key.
180 * timestamp is the time (current_time_monotonic()) at which the key was last confirmed belonging to 195 * timestamp is the time (current_time_monotonic()) at which the key was last confirmed belonging to
181 * the other peer. 196 * the other peer.