diff options
author | irungentoo <irungentoo@gmail.com> | 2014-08-14 14:31:26 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-08-14 14:31:26 -0400 |
commit | 78dd2234e017ea9f9e621c98ae9399caaf1f2601 (patch) | |
tree | 85db23c09c32bbe074a45f530ccc832cb8f00af5 /toxcore/TCP_client.h | |
parent | f4b10c99ff0cbf5cdf88c639ee36516f76316ee5 (diff) |
Added basic socks5 proxy support to TCP client.
Diffstat (limited to 'toxcore/TCP_client.h')
-rw-r--r-- | toxcore/TCP_client.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/toxcore/TCP_client.h b/toxcore/TCP_client.h index 9998d20c..83cb48ba 100644 --- a/toxcore/TCP_client.h +++ b/toxcore/TCP_client.h | |||
@@ -29,8 +29,14 @@ | |||
29 | 29 | ||
30 | #define TCP_CONNECTION_TIMEOUT 10 | 30 | #define TCP_CONNECTION_TIMEOUT 10 |
31 | 31 | ||
32 | typedef struct { | ||
33 | IP_Port ip_port; | ||
34 | } TCP_Proxy_Info; | ||
35 | |||
32 | enum { | 36 | enum { |
33 | TCP_CLIENT_NO_STATUS, | 37 | TCP_CLIENT_NO_STATUS, |
38 | TCP_CLIENT_PROXY_CONNECTING, | ||
39 | TCP_CLIENT_PROXY_UNCONFIRMED, | ||
34 | TCP_CLIENT_CONNECTING, | 40 | TCP_CLIENT_CONNECTING, |
35 | TCP_CLIENT_UNCONFIRMED, | 41 | TCP_CLIENT_UNCONFIRMED, |
36 | TCP_CLIENT_CONFIRMED, | 42 | TCP_CLIENT_CONFIRMED, |
@@ -39,8 +45,10 @@ enum { | |||
39 | typedef struct { | 45 | typedef struct { |
40 | uint8_t status; | 46 | uint8_t status; |
41 | sock_t sock; | 47 | sock_t sock; |
48 | uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; /* our public key */ | ||
42 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; /* public key of the server */ | 49 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; /* public key of the server */ |
43 | IP_Port ip_port; /* The ip and port of the server */ | 50 | IP_Port ip_port; /* The ip and port of the server */ |
51 | TCP_Proxy_Info proxy_info; | ||
44 | uint8_t recv_nonce[crypto_box_NONCEBYTES]; /* Nonce of received packets. */ | 52 | uint8_t recv_nonce[crypto_box_NONCEBYTES]; /* Nonce of received packets. */ |
45 | uint8_t sent_nonce[crypto_box_NONCEBYTES]; /* Nonce of sent packets. */ | 53 | uint8_t sent_nonce[crypto_box_NONCEBYTES]; /* Nonce of sent packets. */ |
46 | uint8_t shared_key[crypto_box_BEFORENMBYTES]; | 54 | uint8_t shared_key[crypto_box_BEFORENMBYTES]; |
@@ -85,7 +93,7 @@ typedef struct { | |||
85 | /* Create new TCP connection to ip_port/public_key | 93 | /* Create new TCP connection to ip_port/public_key |
86 | */ | 94 | */ |
87 | TCP_Client_Connection *new_TCP_connection(IP_Port ip_port, const uint8_t *public_key, const uint8_t *self_public_key, | 95 | TCP_Client_Connection *new_TCP_connection(IP_Port ip_port, const uint8_t *public_key, const uint8_t *self_public_key, |
88 | const uint8_t *self_secret_key); | 96 | const uint8_t *self_secret_key, TCP_Proxy_Info *proxy_info); |
89 | 97 | ||
90 | /* Run the TCP connection | 98 | /* Run the TCP connection |
91 | */ | 99 | */ |