diff options
author | aunsane <aunsane@gmail.com> | 2018-07-18 00:17:16 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-07-18 00:17:42 +0300 |
commit | adf1f2e587159bb99d820faa983ef3e357d41f40 (patch) | |
tree | 988f428bfd45cb46576dae4b4decf82dcb0078f5 /protocols/Tox/libtox/src/toxcore/onion.h | |
parent | 5a8dadd96ca13797f67c39079ba5c4889ef8c421 (diff) |
Tox: updated libtox to v0.2.3
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/onion.h')
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/onion.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/onion.h b/protocols/Tox/libtox/src/toxcore/onion.h index e81b3a52ae..0e025a1ceb 100644 --- a/protocols/Tox/libtox/src/toxcore/onion.h +++ b/protocols/Tox/libtox/src/toxcore/onion.h @@ -26,7 +26,9 @@ #include "DHT.h" -typedef struct { +typedef int onion_recv_1_cb(void *object, IP_Port dest, const uint8_t *data, uint16_t length); + +typedef struct Onion { DHT *dht; Networking_Core *net; uint8_t secret_symmetric_key[CRYPTO_SYMMETRIC_KEY_SIZE]; @@ -36,7 +38,7 @@ typedef struct { Shared_Keys shared_keys_2; Shared_Keys shared_keys_3; - int (*recv_1_function)(void *, IP_Port, const uint8_t *, uint16_t); + onion_recv_1_cb *recv_1_function; void *callback_object; } Onion; @@ -56,7 +58,7 @@ typedef struct { #define ONION_PATH_LENGTH 3 -typedef struct { +typedef struct Onion_Path { uint8_t shared_key1[CRYPTO_SHARED_KEY_SIZE]; uint8_t shared_key2[CRYPTO_SHARED_KEY_SIZE]; uint8_t shared_key3[CRYPTO_SHARED_KEY_SIZE]; @@ -154,8 +156,7 @@ int onion_send_1(const Onion *onion, const uint8_t *plain, uint16_t len, IP_Port * * Format: function(void *object, IP_Port dest, uint8_t *data, uint16_t length) */ -void set_callback_handle_recv_1(Onion *onion, int (*function)(void *, IP_Port, const uint8_t *, uint16_t), - void *object); +void set_callback_handle_recv_1(Onion *onion, onion_recv_1_cb *function, void *object); Onion *new_onion(DHT *dht); |