summaryrefslogtreecommitdiff
path: root/auto_tests/TCP_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests/TCP_test.c')
-rw-r--r--auto_tests/TCP_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/auto_tests/TCP_test.c b/auto_tests/TCP_test.c
index d7312be8..98edc357 100644
--- a/auto_tests/TCP_test.c
+++ b/auto_tests/TCP_test.c
@@ -130,7 +130,7 @@ struct sec_TCP_con {
130 uint8_t shared_key[crypto_box_BEFORENMBYTES]; 130 uint8_t shared_key[crypto_box_BEFORENMBYTES];
131}; 131};
132 132
133struct sec_TCP_con *new_TCP_con(TCP_Server *tcp_s) 133static struct sec_TCP_con *new_TCP_con(TCP_Server *tcp_s)
134{ 134{
135 struct sec_TCP_con *sec_c = malloc(sizeof(struct sec_TCP_con)); 135 struct sec_TCP_con *sec_c = malloc(sizeof(struct sec_TCP_con));
136 sock_t sock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); 136 sock_t sock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
@@ -176,13 +176,13 @@ struct sec_TCP_con *new_TCP_con(TCP_Server *tcp_s)
176 return sec_c; 176 return sec_c;
177} 177}
178 178
179void kill_TCP_con(struct sec_TCP_con *con) 179static void kill_TCP_con(struct sec_TCP_con *con)
180{ 180{
181 kill_sock(con->sock); 181 kill_sock(con->sock);
182 free(con); 182 free(con);
183} 183}
184 184
185int write_packet_TCP_secure_connection(struct sec_TCP_con *con, uint8_t *data, uint16_t length) 185static int write_packet_TCP_secure_connection(struct sec_TCP_con *con, uint8_t *data, uint16_t length)
186{ 186{
187 uint8_t packet[sizeof(uint16_t) + length + crypto_box_MACBYTES]; 187 uint8_t packet[sizeof(uint16_t) + length + crypto_box_MACBYTES];
188 188
@@ -200,7 +200,7 @@ int write_packet_TCP_secure_connection(struct sec_TCP_con *con, uint8_t *data, u
200 return 0; 200 return 0;
201} 201}
202 202
203int read_packet_sec_TCP(struct sec_TCP_con *con, uint8_t *data, uint16_t length) 203static int read_packet_sec_TCP(struct sec_TCP_con *con, uint8_t *data, uint16_t length)
204{ 204{
205 int len = recv(con->sock, data, length, 0); 205 int len = recv(con->sock, data, length, 0);
206 ck_assert_msg(len == length, "wrong len %i\n", len); 206 ck_assert_msg(len == length, "wrong len %i\n", len);
@@ -731,7 +731,7 @@ START_TEST(test_tcp_connection2)
731} 731}
732END_TEST 732END_TEST
733 733
734Suite *TCP_suite(void) 734static Suite *TCP_suite(void)
735{ 735{
736 Suite *s = suite_create("TCP"); 736 Suite *s = suite_create("TCP");
737 737