summaryrefslogtreecommitdiff
path: root/toxcore/TCP_server.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/TCP_server.h')
-rw-r--r--toxcore/TCP_server.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/TCP_server.h b/toxcore/TCP_server.h
index 5862a473..46dd0330 100644
--- a/toxcore/TCP_server.h
+++ b/toxcore/TCP_server.h
@@ -69,8 +69,8 @@ size_t tcp_server_listen_count(const TCP_Server *tcp_server);
69 69
70/* Create new TCP server instance. 70/* Create new TCP server instance.
71 */ 71 */
72TCP_Server *new_TCP_server(uint8_t ipv6_enabled, uint16_t num_sockets, const uint16_t *ports, const uint8_t *secret_key, 72TCP_Server *new_TCP_server(const Logger *logger, uint8_t ipv6_enabled, uint16_t num_sockets, const uint16_t *ports,
73 Onion *onion); 73 const uint8_t *secret_key, Onion *onion);
74 74
75/* Run the TCP_server 75/* Run the TCP_server
76 */ 76 */
@@ -87,21 +87,21 @@ void kill_TCP_server(TCP_Server *tcp_server);
87 * return 0 if nothing has been read from socket. 87 * return 0 if nothing has been read from socket.
88 * return -1 on failure. 88 * return -1 on failure.
89 */ 89 */
90uint16_t read_TCP_length(Socket sock); 90uint16_t read_TCP_length(const Logger *logger, Socket sock);
91 91
92/* Read length bytes from socket. 92/* Read length bytes from socket.
93 * 93 *
94 * return length on success 94 * return length on success
95 * return -1 on failure/no data in buffer. 95 * return -1 on failure/no data in buffer.
96 */ 96 */
97int read_TCP_packet(Socket sock, uint8_t *data, uint16_t length); 97int read_TCP_packet(const Logger *logger, Socket sock, uint8_t *data, uint16_t length);
98 98
99/* return length of received packet on success. 99/* return length of received packet on success.
100 * return 0 if could not read any packet. 100 * return 0 if could not read any packet.
101 * return -1 on failure (connection must be killed). 101 * return -1 on failure (connection must be killed).
102 */ 102 */
103int read_packet_TCP_secure_connection(Socket sock, uint16_t *next_packet_length, const uint8_t *shared_key, 103int read_packet_TCP_secure_connection(const Logger *logger, Socket sock, uint16_t *next_packet_length,
104 uint8_t *recv_nonce, uint8_t *data, uint16_t max_len); 104 const uint8_t *shared_key, uint8_t *recv_nonce, uint8_t *data, uint16_t max_len);
105 105
106 106
107#endif 107#endif