diff options
author | irungentoo <irungentoo@gmail.com> | 2014-02-26 12:18:47 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-02-26 12:18:47 -0500 |
commit | cebae58ddc492869b627eb7b69c7565084a74a34 (patch) | |
tree | 8e2db2e5b60a306ebe61c55497687a9892f8c5fe /toxcore/onion_announce.h | |
parent | b01c19ce56ae73c1c9b6303cf2fabde6373db95b (diff) |
Major speed/cpu usage/bandwidth improvements to onion.
Diffstat (limited to 'toxcore/onion_announce.h')
-rw-r--r-- | toxcore/onion_announce.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/toxcore/onion_announce.h b/toxcore/onion_announce.h index 27b25bd4..24240436 100644 --- a/toxcore/onion_announce.h +++ b/toxcore/onion_announce.h | |||
@@ -58,8 +58,7 @@ typedef struct { | |||
58 | 58 | ||
59 | /* Create and send an onion announce request packet. | 59 | /* Create and send an onion announce request packet. |
60 | * | 60 | * |
61 | * nodes is a list of 4 nodes, the packet will route through nodes 0, 1, 2 and the announe | 61 | * path is the path the request will take before it is sent to dest. |
62 | * request will be sent to 3. | ||
63 | * | 62 | * |
64 | * public_key and secret_key is the kepair which will be used to encrypt the request. | 63 | * public_key and secret_key is the kepair which will be used to encrypt the request. |
65 | * ping_id is the ping id that will be sent in the request. | 64 | * ping_id is the ping id that will be sent in the request. |
@@ -71,13 +70,13 @@ typedef struct { | |||
71 | * return -1 on failure. | 70 | * return -1 on failure. |
72 | * return 0 on success. | 71 | * return 0 on success. |
73 | */ | 72 | */ |
74 | int send_announce_request(DHT *dht, Node_format *nodes, uint8_t *public_key, uint8_t *secret_key, uint8_t *ping_id, | 73 | int send_announce_request(Networking_Core *net, Onion_Path *path, Node_format dest, uint8_t *public_key, |
75 | uint8_t *client_id, uint8_t *data_public_key, uint8_t *sendback_data); | 74 | uint8_t *secret_key, uint8_t *ping_id, uint8_t *client_id, uint8_t *data_public_key, uint8_t *sendback_data); |
76 | 75 | ||
77 | /* Create and send an onion data request packet. | 76 | /* Create and send an onion data request packet. |
78 | * | 77 | * |
79 | * nodes is a list of 4 nodes, the packet will route through nodes 0, 1, 2 and the data | 78 | * path is the path the request will take before it is sent to dest. |
80 | * request packet will arrive at 3. (if 3 knows the person with the public_key they should | 79 | * (if dest knows the person with the public_key they should |
81 | * send the packet to that person in the form of a response) | 80 | * send the packet to that person in the form of a response) |
82 | * | 81 | * |
83 | * public_key is the real public key of the node which we want to send the data of length length to. | 82 | * public_key is the real public key of the node which we want to send the data of length length to. |
@@ -88,8 +87,8 @@ int send_announce_request(DHT *dht, Node_format *nodes, uint8_t *public_key, uin | |||
88 | * return -1 on failure. | 87 | * return -1 on failure. |
89 | * return 0 on success. | 88 | * return 0 on success. |
90 | */ | 89 | */ |
91 | int send_data_request(DHT *dht, Node_format *nodes, uint8_t *public_key, uint8_t *encrypt_public_key, uint8_t *nonce, | 90 | int send_data_request(Networking_Core *net, Onion_Path *path, IP_Port dest, uint8_t *public_key, |
92 | uint8_t *data, uint16_t length); | 91 | uint8_t *encrypt_public_key, uint8_t *nonce, uint8_t *data, uint16_t length); |
93 | 92 | ||
94 | 93 | ||
95 | Onion_Announce *new_onion_announce(DHT *dht); | 94 | Onion_Announce *new_onion_announce(DHT *dht); |