diff options
author | irungentoo <irungentoo@gmail.com> | 2014-12-25 15:01:12 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-12-25 15:01:12 -0500 |
commit | 18b45ffade3984b30739eed793a79d26cbbb1c8a (patch) | |
tree | 6bc744ca1637c248e61ed75cd9a3f53fb8e2a3a9 /toxcore/onion.h | |
parent | d8b0d2e19b2a1f312799da3e9efa34e98698db5b (diff) |
Add function to get nodes from onion path.
Diffstat (limited to 'toxcore/onion.h')
-rw-r--r-- | toxcore/onion.h | 12 |
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 | */ |
81 | int create_onion_path(const DHT *dht, Onion_Path *new_path, const Node_format *nodes); | 86 | int 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 | */ | ||
93 | int 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. |