summaryrefslogtreecommitdiff
path: root/toxcore/onion.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-12-30 12:20:30 -0500
committerirungentoo <irungentoo@gmail.com>2013-12-30 12:20:30 -0500
commit9c9e3b0e453f9a399876e72ae55c4e14439d91d0 (patch)
tree28e7b54b8c0f43417d8a47575c7f0d6c96b8290f /toxcore/onion.h
parent346dc5265e5269fc4a01cd9cbfc718ef1e8c0a69 (diff)
Added a function to create and send a onion packet.
Diffstat (limited to 'toxcore/onion.h')
-rw-r--r--toxcore/onion.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/toxcore/onion.h b/toxcore/onion.h
index 97ac3021..637692eb 100644
--- a/toxcore/onion.h
+++ b/toxcore/onion.h
@@ -28,6 +28,15 @@ typedef struct {
28 uint8_t secret_symmetric_key[crypto_secretbox_KEYBYTES]; 28 uint8_t secret_symmetric_key[crypto_secretbox_KEYBYTES];
29} Onion; 29} Onion;
30 30
31/* Create and send a onion packet.
32 *
33 * nodes is a list of 4 nodes, the packet will route through nodes 0, 1, 2 and the data
34 * with length length will arrive at 3.
35 *
36 * return -1 on failure.
37 * return 0 on success.
38 */
39int send_onion_packet(Onion *onion, Node_format *nodes, uint8_t *data, uint32_t length);
31 40
32Onion *new_onion(DHT *dht); 41Onion *new_onion(DHT *dht);
33 42