summaryrefslogtreecommitdiff
path: root/toxcore/onion.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-12-25 15:01:12 -0500
committerirungentoo <irungentoo@gmail.com>2014-12-25 15:01:12 -0500
commit18b45ffade3984b30739eed793a79d26cbbb1c8a (patch)
tree6bc744ca1637c248e61ed75cd9a3f53fb8e2a3a9 /toxcore/onion.h
parentd8b0d2e19b2a1f312799da3e9efa34e98698db5b (diff)
Add function to get nodes from onion path.
Diffstat (limited to 'toxcore/onion.h')
-rw-r--r--toxcore/onion.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/toxcore/onion.h b/toxcore/onion.h
index 1e80eba3..b05d2c8c 100644
--- a/toxcore/onion.h
+++ b/toxcore/onion.h
@@ -63,8 +63,13 @@ typedef struct {
63 uint8_t public_key3[crypto_box_PUBLICKEYBYTES]; 63 uint8_t public_key3[crypto_box_PUBLICKEYBYTES];
64 64
65 IP_Port ip_port1; 65 IP_Port ip_port1;
66 uint8_t node_public_key1[crypto_box_PUBLICKEYBYTES];
67
66 IP_Port ip_port2; 68 IP_Port ip_port2;
69 uint8_t node_public_key2[crypto_box_PUBLICKEYBYTES];
70
67 IP_Port ip_port3; 71 IP_Port ip_port3;
72 uint8_t node_public_key3[crypto_box_PUBLICKEYBYTES];
68 73
69 uint32_t path_num; 74 uint32_t path_num;
70} Onion_Path; 75} Onion_Path;
@@ -80,6 +85,13 @@ typedef struct {
80 */ 85 */
81int create_onion_path(const DHT *dht, Onion_Path *new_path, const Node_format *nodes); 86int create_onion_path(const DHT *dht, Onion_Path *new_path, const Node_format *nodes);
82 87
88/* Dump nodes in onion path to nodes of length num_nodes;
89 *
90 * return -1 on failure.
91 * return 0 on success.
92 */
93int onion_path_to_nodes(Node_format *nodes, unsigned int num_nodes, const Onion_Path *path);
94
83/* Create a onion packet. 95/* Create a onion packet.
84 * 96 *
85 * Use Onion_Path path to create packet for data of length to dest. 97 * Use Onion_Path path to create packet for data of length to dest.