From 9c9e3b0e453f9a399876e72ae55c4e14439d91d0 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Mon, 30 Dec 2013 12:20:30 -0500 Subject: Added a function to create and send a onion packet. --- toxcore/onion.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'toxcore/onion.h') 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 { uint8_t secret_symmetric_key[crypto_secretbox_KEYBYTES]; } Onion; +/* Create and send a onion packet. + * + * nodes is a list of 4 nodes, the packet will route through nodes 0, 1, 2 and the data + * with length length will arrive at 3. + * + * return -1 on failure. + * return 0 on success. + */ +int send_onion_packet(Onion *onion, Node_format *nodes, uint8_t *data, uint32_t length); Onion *new_onion(DHT *dht); -- cgit v1.2.3