diff options
Diffstat (limited to 'toxcore/net_crypto.h')
-rw-r--r-- | toxcore/net_crypto.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index 0d27ae4d..736d3070 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h | |||
@@ -40,6 +40,10 @@ | |||
40 | 40 | ||
41 | #define MAX_CRYPTO_PACKET_SIZE 1400 | 41 | #define MAX_CRYPTO_PACKET_SIZE 1400 |
42 | #define MAX_CRYPTO_DATA_SIZE (MAX_CRYPTO_PACKET_SIZE - (1 + sizeof(uint16_t) + crypto_box_MACBYTES)) | 42 | #define MAX_CRYPTO_DATA_SIZE (MAX_CRYPTO_PACKET_SIZE - (1 + sizeof(uint16_t) + crypto_box_MACBYTES)) |
43 | |||
44 | /* Interval in ms between sending cookie request/handshake packets. */ | ||
45 | #define CRYPTO_SEND_PACKET_INTERVAL 500 | ||
46 | |||
43 | typedef struct { | 47 | typedef struct { |
44 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; /* The real public key of the peer. */ | 48 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; /* The real public key of the peer. */ |
45 | uint8_t recv_nonce[crypto_box_NONCEBYTES]; /* Nonce of received packets. */ | 49 | uint8_t recv_nonce[crypto_box_NONCEBYTES]; /* Nonce of received packets. */ |
@@ -64,6 +68,10 @@ typedef struct { | |||
64 | uint8_t *temp_packet; /* Where the cookie request/handshake packet is stored while it is being sent. */ | 68 | uint8_t *temp_packet; /* Where the cookie request/handshake packet is stored while it is being sent. */ |
65 | uint16_t temp_packet_length; | 69 | uint16_t temp_packet_length; |
66 | uint64_t temp_packet_sent_time; /* The time at which the last temp_packet was sent in ms. */ | 70 | uint64_t temp_packet_sent_time; /* The time at which the last temp_packet was sent in ms. */ |
71 | |||
72 | IP_Port ip_port; /* The ip and port to contact this guy directly.*/ | ||
73 | uint64_t direct_lastrecv_time; /* The Time at which we last receive a direct packet. */ | ||
74 | |||
67 | } Crypto_Connection; | 75 | } Crypto_Connection; |
68 | 76 | ||
69 | typedef struct { | 77 | typedef struct { |