diff options
Diffstat (limited to 'toxcore/onion_client.h')
-rw-r--r-- | toxcore/onion_client.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h index a5f72e82..5becca48 100644 --- a/toxcore/onion_client.h +++ b/toxcore/onion_client.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "onion_announce.h" | 27 | #include "onion_announce.h" |
28 | 28 | ||
29 | #define MAX_ONION_CLIENTS 8 | 29 | #define MAX_ONION_CLIENTS 8 |
30 | 30 | #define ONION_NODE_TIMEOUT 200 | |
31 | typedef struct { | 31 | typedef struct { |
32 | uint8_t client_id[CLIENT_ID_SIZE]; | 32 | uint8_t client_id[CLIENT_ID_SIZE]; |
33 | IP_Port ip_port; | 33 | IP_Port ip_port; |
@@ -36,7 +36,14 @@ typedef struct { | |||
36 | } Onion_Node; | 36 | } Onion_Node; |
37 | 37 | ||
38 | typedef struct { | 38 | typedef struct { |
39 | uint8_t status; /* 0 if friend is not valid, 1 if friend is valid.*/ | ||
40 | |||
41 | uint8_t fake_client_id[crypto_box_PUBLICKEYBYTES]; | ||
42 | uint8_t real_client_id[crypto_box_PUBLICKEYBYTES]; | ||
43 | |||
39 | Onion_Node clients_list[MAX_ONION_CLIENTS]; | 44 | Onion_Node clients_list[MAX_ONION_CLIENTS]; |
45 | uint8_t temp_public_key[crypto_box_PUBLICKEYBYTES]; | ||
46 | uint8_t temp_secret_key[crypto_box_SECRETKEYBYTES]; | ||
40 | } Onion_Friend; | 47 | } Onion_Friend; |
41 | 48 | ||
42 | typedef struct { | 49 | typedef struct { |
@@ -56,6 +63,15 @@ int onion_delfriend(Onion_Client *onion_c, uint8_t *client_id); | |||
56 | 63 | ||
57 | int onion_getfriendip(Onion_Client *onion_c, uint8_t *client_id, IP_Port *ip_port); | 64 | int onion_getfriendip(Onion_Client *onion_c, uint8_t *client_id, IP_Port *ip_port); |
58 | 65 | ||
66 | /* Takes 3 random nodes that we know and puts them in nodes | ||
67 | * | ||
68 | * nodes must be longer than 3. | ||
69 | * | ||
70 | * return -1 on failure | ||
71 | * return 0 on success | ||
72 | * | ||
73 | */ | ||
74 | int random_path(Onion_Client *onion_c, Node_format *nodes); | ||
59 | 75 | ||
60 | void do_onion_client(Onion_Client *onion_c); | 76 | void do_onion_client(Onion_Client *onion_c); |
61 | 77 | ||