summaryrefslogtreecommitdiff
path: root/toxcore/TCP_connection.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-21 20:23:46 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-09-22 16:42:36 +0100
commit18b298a3d690d0691e7002977ba83b3965f78510 (patch)
tree343d6369ce797bd94630fc8222cb1ab3eaab8e23 /toxcore/TCP_connection.c
parentfd50660f407bf3457c4c5ae943c3978aa6054bba (diff)
Make TCP_Connections module-private.
Diffstat (limited to 'toxcore/TCP_connection.c')
-rw-r--r--toxcore/TCP_connection.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/toxcore/TCP_connection.c b/toxcore/TCP_connection.c
index 25dfa09c..e838c281 100644
--- a/toxcore/TCP_connection.c
+++ b/toxcore/TCP_connection.c
@@ -29,6 +29,42 @@
29 29
30#include "util.h" 30#include "util.h"
31 31
32
33struct TCP_Connections {
34 DHT *dht;
35
36 uint8_t self_public_key[crypto_box_PUBLICKEYBYTES];
37 uint8_t self_secret_key[crypto_box_SECRETKEYBYTES];
38
39 TCP_Connection_to *connections;
40 uint32_t connections_length; /* Length of connections array. */
41
42 TCP_con *tcp_connections;
43 uint32_t tcp_connections_length; /* Length of tcp_connections array. */
44
45 int (*tcp_data_callback)(void *object, int id, const uint8_t *data, uint16_t length, void *userdata);
46 void *tcp_data_callback_object;
47
48 int (*tcp_oob_callback)(void *object, const uint8_t *public_key, unsigned int tcp_connections_number,
49 const uint8_t *data, uint16_t length, void *userdata);
50 void *tcp_oob_callback_object;
51
52 int (*tcp_onion_callback)(void *object, const uint8_t *data, uint16_t length, void *userdata);
53 void *tcp_onion_callback_object;
54
55 TCP_Proxy_Info proxy_info;
56
57 bool onion_status;
58 uint16_t onion_num_conns;
59};
60
61
62const uint8_t *tcp_connections_public_key(const TCP_Connections *tcp_c)
63{
64 return tcp_c->self_public_key;
65}
66
67
32/* Set the size of the array to num. 68/* Set the size of the array to num.
33 * 69 *
34 * return -1 if realloc fails. 70 * return -1 if realloc fails.