summaryrefslogtreecommitdiff
path: root/toxcore/TCP_server.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-03-13 20:48:01 -0400
committerirungentoo <irungentoo@gmail.com>2014-03-13 20:48:01 -0400
commit29afa26396feb109966e507481022e884aaad09f (patch)
treea4cd41c5e576ffd13b9aafc2fa449891bef7ee19 /toxcore/TCP_server.h
parentcb9b8fc7cdb03b7f6fa3b4b57818af8cf3203da5 (diff)
Slightly more work done on the TCP relay server.
Diffstat (limited to 'toxcore/TCP_server.h')
-rw-r--r--toxcore/TCP_server.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/toxcore/TCP_server.h b/toxcore/TCP_server.h
index d2c32fda..573108af 100644
--- a/toxcore/TCP_server.h
+++ b/toxcore/TCP_server.h
@@ -28,7 +28,8 @@
28 28
29#define MAX_INCOMMING_CONNECTIONS 32 29#define MAX_INCOMMING_CONNECTIONS 32
30 30
31#define TCP_SERVER_HANDSHAKE_SIZE (crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES + crypto_box_MACBYTES) 31#define TCP_HANDSHAKE_PLAIN_SIZE (crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES)
32#define TCP_SERVER_HANDSHAKE_SIZE (crypto_box_NONCEBYTES + TCP_HANDSHAKE_PLAIN_SIZE + crypto_box_MACBYTES)
32#define TCP_CLIENT_HANDSHAKE_SIZE (crypto_box_PUBLICKEYBYTES + TCP_SERVER_HANDSHAKE_SIZE) 33#define TCP_CLIENT_HANDSHAKE_SIZE (crypto_box_PUBLICKEYBYTES + TCP_SERVER_HANDSHAKE_SIZE)
33 34
34enum { 35enum {
@@ -52,12 +53,16 @@ typedef struct {
52 sock_t *socks_listening; 53 sock_t *socks_listening;
53 unsigned int num_listening_socks; 54 unsigned int num_listening_socks;
54 55
56 uint8_t public_key[crypto_box_PUBLICKEYBYTES];
57 uint8_t secret_key[crypto_box_SECRETKEYBYTES];
55 TCP_Secure_Connection incomming_connection_queue[MAX_INCOMMING_CONNECTIONS]; 58 TCP_Secure_Connection incomming_connection_queue[MAX_INCOMMING_CONNECTIONS];
59 uint16_t incomming_connection_queue_index;
56} TCP_Server; 60} TCP_Server;
57 61
58/* Create new TCP server instance. 62/* Create new TCP server instance.
59 */ 63 */
60TCP_Server *new_TCP_server(uint8_t ipv6_enabled, uint16_t num_sockets, uint16_t *ports); 64TCP_Server *new_TCP_server(uint8_t ipv6_enabled, uint16_t num_sockets, uint16_t *ports, uint8_t *public_key,
65 uint8_t *secret_key);
61 66
62/* Run the TCP_server 67/* Run the TCP_server
63 */ 68 */