summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2020-03-14 02:22:39 +0000
committeriphydf <iphydf@users.noreply.github.com>2020-03-14 13:28:42 +0000
commitcb22b3df5f0b7509a37e091360ecbb4d8a9f2873 (patch)
treedd12e81f5f61e6ec268bd03d2e6951a7abee9506 /toxcore/net_crypto.c
parent11ad5471b91dc1b36552ba4e5a3ea434c8a30f5f (diff)
Fix up comments a bit to start being more uniform.
Tokstyle (check-cimple) will start enforcing comment formats at some point. It will not support arbitrary stuff in comments, and will parse them. The result can then be semantically analysed.
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r--toxcore/net_crypto.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index 4eacb250..6a69bb5b 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -30,17 +30,17 @@ typedef struct Packet_Data {
30typedef struct Packets_Array { 30typedef struct Packets_Array {
31 Packet_Data *buffer[CRYPTO_PACKET_BUFFER_SIZE]; 31 Packet_Data *buffer[CRYPTO_PACKET_BUFFER_SIZE];
32 uint32_t buffer_start; 32 uint32_t buffer_start;
33 uint32_t buffer_end; /* packet numbers in array: {buffer_start, buffer_end) */ 33 uint32_t buffer_end; /* packet numbers in array: `{buffer_start, buffer_end)` */
34} Packets_Array; 34} Packets_Array;
35 35
36typedef enum Crypto_Conn_State { 36typedef enum Crypto_Conn_State {
37 CRYPTO_CONN_FREE = 0, /* the connection slot is free; this value is 0 so it is valid after 37 CRYPTO_CONN_FREE = 0, /* the connection slot is free. This value is 0 so it is valid after
38 * crypto_memzero(...) of the parent struct 38 * `crypto_memzero(...)` of the parent struct
39 */ 39 */
40 CRYPTO_CONN_NO_CONNECTION, /* the connection is allocated, but not yet used */ 40 CRYPTO_CONN_NO_CONNECTION, /* the connection is allocated, but not yet used */
41 CRYPTO_CONN_COOKIE_REQUESTING, /* we are sending cookie request packets */ 41 CRYPTO_CONN_COOKIE_REQUESTING, /* we are sending cookie request packets */
42 CRYPTO_CONN_HANDSHAKE_SENT, /* we are sending handshake packets */ 42 CRYPTO_CONN_HANDSHAKE_SENT, /* we are sending handshake packets */
43 CRYPTO_CONN_NOT_CONFIRMED, /* we are sending handshake packets; 43 CRYPTO_CONN_NOT_CONFIRMED, /* we are sending handshake packets.
44 * we have received one from the other, but no data */ 44 * we have received one from the other, but no data */
45 CRYPTO_CONN_ESTABLISHED, /* the connection is established */ 45 CRYPTO_CONN_ESTABLISHED, /* the connection is established */
46} Crypto_Conn_State; 46} Crypto_Conn_State;
@@ -725,7 +725,7 @@ static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t
725 return -1; 725 return -1;
726} 726}
727 727
728/** START: Array Related functions **/ 728/** START: Array Related functions */
729 729
730 730
731/* Return number of packets in array 731/* Return number of packets in array
@@ -1045,7 +1045,7 @@ static int handle_request_packet(Mono_Time *mono_time, const Logger *log, Packet
1045 return requested; 1045 return requested;
1046} 1046}
1047 1047
1048/** END: Array Related functions **/ 1048/** END: Array Related functions */
1049 1049
1050#define MAX_DATA_DATA_PACKET_SIZE (MAX_CRYPTO_PACKET_SIZE - (1 + sizeof(uint16_t) + CRYPTO_MAC_SIZE)) 1050#define MAX_DATA_DATA_PACKET_SIZE (MAX_CRYPTO_PACKET_SIZE - (1 + sizeof(uint16_t) + CRYPTO_MAC_SIZE))
1051 1051