diff options
Diffstat (limited to 'toxcore/onion_announce.h')
-rw-r--r-- | toxcore/onion_announce.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/toxcore/onion_announce.h b/toxcore/onion_announce.h index d06865c8..c8d9b442 100644 --- a/toxcore/onion_announce.h +++ b/toxcore/onion_announce.h | |||
@@ -20,17 +20,25 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef ONION_ANNOUNCE_H | ||
24 | #define ONION_ANNOUNCE_H | ||
25 | |||
23 | #include "onion.h" | 26 | #include "onion.h" |
24 | 27 | ||
25 | #define ONION_ANNOUNCE_MAX_ENTRIES 32 | 28 | #define ONION_ANNOUNCE_MAX_ENTRIES 32 |
29 | #define ONION_ANNOUNCE_TIMEOUT 300 | ||
30 | |||
26 | typedef struct { | 31 | typedef struct { |
27 | DHT *dht; | ||
28 | Networking_Core *net; | ||
29 | struct { | ||
30 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; | 32 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; |
31 | IP_Port first; | 33 | IP_Port ret_ip_port; |
32 | uint8_t ret[ONION_RETURN_3]; | 34 | uint8_t ret[ONION_RETURN_3]; |
33 | } entries[ONION_ANNOUNCE_MAX_ENTRIES]; | 35 | uint64_t time; |
36 | } Onion_Announce_Entry; | ||
37 | |||
38 | typedef struct { | ||
39 | DHT *dht; | ||
40 | Networking_Core *net; | ||
41 | Onion_Announce_Entry entries[ONION_ANNOUNCE_MAX_ENTRIES]; | ||
34 | /* This is crypto_secretbox_KEYBYTES long just so we can use new_symmetric_key() to fill it */ | 42 | /* This is crypto_secretbox_KEYBYTES long just so we can use new_symmetric_key() to fill it */ |
35 | uint8_t secret_bytes[crypto_secretbox_KEYBYTES]; | 43 | uint8_t secret_bytes[crypto_secretbox_KEYBYTES]; |
36 | } Onion_Announce; | 44 | } Onion_Announce; |
@@ -40,3 +48,6 @@ typedef struct { | |||
40 | Onion_Announce *new_onion_announce(DHT *dht); | 48 | Onion_Announce *new_onion_announce(DHT *dht); |
41 | 49 | ||
42 | void kill_onion_announce(Onion_Announce *onion_a); | 50 | void kill_onion_announce(Onion_Announce *onion_a); |
51 | |||
52 | |||
53 | #endif | ||