diff options
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/TCP_connection.h')
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/TCP_connection.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/TCP_connection.h b/protocols/Tox/libtox/src/toxcore/TCP_connection.h index 0434a73eb0..2d35919f10 100644 --- a/protocols/Tox/libtox/src/toxcore/TCP_connection.h +++ b/protocols/Tox/libtox/src/toxcore/TCP_connection.h @@ -10,10 +10,18 @@ #define C_TOXCORE_TOXCORE_TCP_CONNECTION_H #include <stdbool.h> +#include <stdint.h> #include "DHT.h" // for Node_format #include "TCP_client.h" #include "TCP_common.h" +#include "attributes.h" +#include "crypto_core.h" +#include "forwarding.h" +#include "logger.h" +#include "mem.h" +#include "mono_time.h" +#include "network.h" #define TCP_CONN_NONE 0 #define TCP_CONN_VALID 1 @@ -120,7 +128,7 @@ bool tcp_get_random_conn_ip_port(const TCP_Connections *tcp_c, IP_Port *ip_port) * return -1 on failure. */ non_null() -int tcp_send_onion_request(TCP_Connections *tcp_c, unsigned int tcp_connections_number, const uint8_t *data, +int tcp_send_onion_request(TCP_Connections *tcp_c, uint32_t tcp_connections_number, const uint8_t *data, uint16_t length); /** @brief Set if we want TCP_connection to allocate some connection for onion use. @@ -156,7 +164,7 @@ non_null() int tcp_send_oob_packet(const TCP_Connections *tcp_c, unsigned int tcp_connections_number, const uint8_t *public_key, const uint8_t *packet, uint16_t length); -typedef int tcp_data_cb(void *object, int id, const uint8_t *data, uint16_t length, void *userdata); +typedef int tcp_data_cb(void *object, int crypt_connection_id, const uint8_t *packet, uint16_t length, void *userdata); non_null() int tcp_send_oob_packet_using_relay(const TCP_Connections *tcp_c, const uint8_t *relay_pk, const uint8_t *public_key, @@ -178,9 +186,8 @@ void set_forwarding_packet_tcp_connection_callback(TCP_Connections *tcp_c, forwarded_response_cb *tcp_forwarded_response_callback, void *object); - typedef int tcp_oob_cb(void *object, const uint8_t *public_key, unsigned int tcp_connections_number, - const uint8_t *data, uint16_t length, void *userdata); + const uint8_t *packet, uint16_t length, void *userdata); /** @brief Set the callback for TCP oob data packets. */ non_null() @@ -298,9 +305,8 @@ uint32_t tcp_copy_connected_relays_index(const TCP_Connections *tcp_c, Node_form * Returns NULL on failure. */ non_null() -TCP_Connections *new_tcp_connections( - const Logger *logger, const Random *rng, const Network *ns, Mono_Time *mono_time, - const uint8_t *secret_key, const TCP_Proxy_Info *proxy_info); +TCP_Connections *new_tcp_connections(const Logger *logger, const Memory *mem, const Random *rng, const Network *ns, + Mono_Time *mono_time, const uint8_t *secret_key, const TCP_Proxy_Info *proxy_info); non_null() int kill_tcp_relay_connection(TCP_Connections *tcp_c, int tcp_connections_number); @@ -311,4 +317,4 @@ void do_tcp_connections(const Logger *logger, TCP_Connections *tcp_c, void *user nullable(1) void kill_tcp_connections(TCP_Connections *tcp_c); -#endif +#endif /* C_TOXCORE_TOXCORE_TCP_CONNECTION_H */ |