summaryrefslogtreecommitdiff
path: root/toxcore/onion_announce.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-01-04 19:40:43 -0500
committerirungentoo <irungentoo@gmail.com>2014-01-04 19:40:43 -0500
commit7e2d21271a549347575a38e5c3859d7374d496ed (patch)
treec8e4c56cd4793fd24e1e0bf3f989755b5d1cd036 /toxcore/onion_announce.h
parentd46891c3b7cf70a2b436562ae387d85384f05d5c (diff)
Some work on the onion part done.
Diffstat (limited to 'toxcore/onion_announce.h')
-rw-r--r--toxcore/onion_announce.h21
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
26typedef struct { 31typedef 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
38typedef 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 {
40Onion_Announce *new_onion_announce(DHT *dht); 48Onion_Announce *new_onion_announce(DHT *dht);
41 49
42void kill_onion_announce(Onion_Announce *onion_a); 50void kill_onion_announce(Onion_Announce *onion_a);
51
52
53#endif