aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-10-27 21:37:16 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-10-27 21:37:16 +0000
commita653f8615d33ff59518f4134c0820ba477647fff (patch)
tree0ed76b2e07527f04900d61ac7d0d5fa7af2e7706 /src/transport
parentaf6a96ea9ba1c400309d3b1b12d6b49e2a3e8a33 (diff)
downloadgnunet-a653f8615d33ff59518f4134c0820ba477647fff.tar.gz
gnunet-a653f8615d33ff59518f4134c0820ba477647fff.zip
new test
modified makefile
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/Makefile.am30
-rw-r--r--src/transport/gnunet-service-transport_neighbours_3way.c39
-rw-r--r--src/transport/test_transport_api_disconnect_tcp_peer1.conf31
-rw-r--r--src/transport/test_transport_api_disconnect_tcp_peer2.conf30
4 files changed, 104 insertions, 26 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index aa387ff2c..5a04a81bc 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -129,6 +129,25 @@ gnunet_transport_LDADD = \
129gnunet_transport_DEPENDENCIES = \ 129gnunet_transport_DEPENDENCIES = \
130 libgnunettransport.la 130 libgnunettransport.la
131 131
132# transport with 3way handshake
133gnunet_service_transport_SOURCES = \
134 gnunet-service-transport_3way.c gnunet-service-transport.h \
135 gnunet-service-transport_blacklist.h gnunet-service-transport_blacklist.c \
136 gnunet-service-transport_clients.h gnunet-service-transport_clients.c \
137 gnunet-service-transport_hello.h gnunet-service-transport_hello.c \
138 gnunet-service-transport_neighbours.h gnunet-service-transport_neighbours_3way.c \
139 gnunet-service-transport_plugins.h gnunet-service-transport_plugins.c \
140 gnunet-service-transport_validation.h gnunet-service-transport_validation.c
141gnunet_service_transport_LDADD = \
142 $(top_builddir)/src/ats/libgnunetats.la \
143 $(top_builddir)/src/hello/libgnunethello.la \
144 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
145 $(top_builddir)/src/statistics/libgnunetstatistics.la \
146 $(top_builddir)/src/util/libgnunetutil.la \
147 $(GN_GLPK) \
148 $(GN_LIBINTL)
149#
150
132gnunet_service_transport_SOURCES = \ 151gnunet_service_transport_SOURCES = \
133 gnunet-service-transport.c gnunet-service-transport.h \ 152 gnunet-service-transport.c gnunet-service-transport.h \
134 gnunet-service-transport_blacklist.h gnunet-service-transport_blacklist.c \ 153 gnunet-service-transport_blacklist.h gnunet-service-transport_blacklist.c \
@@ -244,7 +263,7 @@ libgnunet_plugin_transport_https_la_CPPFLAGS = \
244check_PROGRAMS = \ 263check_PROGRAMS = \
245 test_transport_testing \ 264 test_transport_testing \
246 test_transport_startonly \ 265 test_transport_startonly \
247 test_transport_api_disconnect \ 266 test_transport_api_disconnect_tcp \
248 test_transport_api_tcp \ 267 test_transport_api_tcp \
249 test_transport_api_timeout_tcp \ 268 test_transport_api_timeout_tcp \
250 test_transport_api_limited_sockets_tcp \ 269 test_transport_api_limited_sockets_tcp \
@@ -282,7 +301,7 @@ if ENABLE_TEST_RUN
282TESTS = \ 301TESTS = \
283 test_transport_testing \ 302 test_transport_testing \
284 test_transport_startonly \ 303 test_transport_startonly \
285 test_transport_api_disconnect \ 304 test_transport_api_disconnect_tcp \
286 test_transport_api_tcp \ 305 test_transport_api_tcp \
287 test_transport_api_timeout_tcp \ 306 test_transport_api_timeout_tcp \
288 test_transport_api_limited_sockets_tcp \ 307 test_transport_api_limited_sockets_tcp \
@@ -333,13 +352,14 @@ test_transport_testing_LDADD = \
333# $(top_builddir)/src/util/libgnunetutil.la \ 352# $(top_builddir)/src/util/libgnunetutil.la \
334# $(top_builddir)/src/transport/libgnunettransporttesting.la 353# $(top_builddir)/src/transport/libgnunettransporttesting.la
335 354
336test_transport_api_disconnect_SOURCES = \ 355test_transport_api_disconnect_tcp_SOURCES = \
337 test_transport_api_disconnect.c 356 test_transport_api_disconnect.c
338test_transport_api_disconnect_LDADD = \ 357test_transport_api_disconnect_tcp_LDADD = \
339 $(top_builddir)/src/transport/libgnunettransport.la \ 358 $(top_builddir)/src/transport/libgnunettransport.la \
340 $(top_builddir)/src/hello/libgnunethello.la \ 359 $(top_builddir)/src/hello/libgnunethello.la \
341 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 360 $(top_builddir)/src/statistics/libgnunetstatistics.la \
342 $(top_builddir)/src/util/libgnunetutil.la 361 $(top_builddir)/src/util/libgnunetutil.la \
362 $(top_builddir)/src/transport/libgnunettransporttesting.la
343 363
344test_transport_startonly_SOURCES = \ 364test_transport_startonly_SOURCES = \
345 test_transport_startonly.c 365 test_transport_startonly.c
diff --git a/src/transport/gnunet-service-transport_neighbours_3way.c b/src/transport/gnunet-service-transport_neighbours_3way.c
index 62d444166..a10d23240 100644
--- a/src/transport/gnunet-service-transport_neighbours_3way.c
+++ b/src/transport/gnunet-service-transport_neighbours_3way.c
@@ -708,10 +708,10 @@ send_disconnect (struct NeighbourMapEntry *n)
708 &disconnect_msg.purpose, 708 &disconnect_msg.purpose,
709 &disconnect_msg.signature)); 709 &disconnect_msg.signature));
710 710
711 ret = send_with_plugin(&n->id, 711 ret = send_with_plugin(&n->id, (const char *) &disconnect_msg, sizeof (disconnect_msg),
712 (const char *) &disconnect_msg, sizeof (disconnect_msg), 712 UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
713 UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL, n->session, n->plugin_name, n->addr, n->addrlen, 713 n->session, n->plugin_name, n->addr, n->addrlen,
714 GNUNET_YES, NULL, NULL); 714 GNUNET_YES, NULL, NULL);
715 715
716 if (ret == GNUNET_SYSERR) 716 if (ret == GNUNET_SYSERR)
717 return GNUNET_SYSERR; 717 return GNUNET_SYSERR;
@@ -1155,17 +1155,10 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer,
1155 connect_msg.timestamp = 1155 connect_msg.timestamp =
1156 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); 1156 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
1157 1157
1158 ret = send_with_plugin (peer, (const char *) &connect_msg, msg_len, 0, GNUNET_TIME_UNIT_FOREVER_REL, session, plugin_name, address, address_len, GNUNET_YES, &send_connect_continuation, n); 1158 ret = send_with_plugin (peer, (const char *) &connect_msg, msg_len, UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
1159 if (ret == GNUNET_SYSERR) 1159 session, plugin_name, address, address_len,
1160 { 1160 GNUNET_YES, &send_connect_continuation, n);
1161 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1161
1162 "Failed to send CONNECT_MESSAGE to `%4s' using plugin `%s' address '%s' session %X\n",
1163 GNUNET_i2s (peer), plugin_name,
1164 (address_len == 0) ? "<inbound>" : GST_plugins_a2s (plugin_name,
1165 address,
1166 address_len),
1167 session);
1168 }
1169 return GNUNET_NO; 1162 return GNUNET_NO;
1170 } 1163 }
1171 /* We received a CONNECT message and asked ATS for an address */ 1164 /* We received a CONNECT message and asked ATS for an address */
@@ -1178,7 +1171,9 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer,
1178 connect_msg.reserved = htonl (0); 1171 connect_msg.reserved = htonl (0);
1179 connect_msg.timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); 1172 connect_msg.timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
1180 1173
1181 ret = send_with_plugin(&n->id, (const void *) &connect_msg, msg_len, 0, GNUNET_TIME_UNIT_FOREVER_REL, session, plugin_name, address, address_len, GNUNET_YES, &send_connect_ack_continuation, n); 1174 ret = send_with_plugin(&n->id, (const void *) &connect_msg, msg_len, UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
1175 session, plugin_name, address, address_len,
1176 GNUNET_YES, &send_connect_ack_continuation, n);
1182 if (ret == GNUNET_SYSERR) 1177 if (ret == GNUNET_SYSERR)
1183 { 1178 {
1184 change_state (n, S_NOT_CONNECTED); 1179 change_state (n, S_NOT_CONNECTED);
@@ -1197,7 +1192,9 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer,
1197 connect_msg.timestamp = 1192 connect_msg.timestamp =
1198 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); 1193 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
1199 1194
1200 ret = send_with_plugin (peer, (const char *) &connect_msg, msg_len, 0, GNUNET_TIME_UNIT_FOREVER_REL, session, plugin_name, address, address_len, GNUNET_YES, &send_switch_address_continuation, n); 1195 ret = send_with_plugin (peer, (const char *) &connect_msg, msg_len, UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
1196 session, plugin_name, address, address_len,
1197 GNUNET_YES, &send_switch_address_continuation, n);
1201 if (ret == GNUNET_SYSERR) 1198 if (ret == GNUNET_SYSERR)
1202 { 1199 {
1203 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1200 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1843,10 +1840,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
1843 msg.size = htons (msg_len); 1840 msg.size = htons (msg_len);
1844 msg.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_ACK); 1841 msg.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_ACK);
1845 1842
1846 ret = send_with_plugin (&n->id, (const char *) &msg, msg_len, 0, 1843 ret = send_with_plugin (&n->id, (const char *) &msg, msg_len, UINT32_MAX,
1847 GNUNET_TIME_UNIT_FOREVER_REL, 1844 GNUNET_TIME_UNIT_FOREVER_REL,
1848 n->session, n->plugin_name, n->addr, n->addrlen, 1845 n->session, n->plugin_name, n->addr, n->addrlen,
1849 GNUNET_YES, NULL, NULL); 1846 GNUNET_YES, NULL, NULL);
1850 1847
1851 if (ret == GNUNET_SYSERR) 1848 if (ret == GNUNET_SYSERR)
1852 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1849 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_disconnect_tcp_peer1.conf b/src/transport/test_transport_api_disconnect_tcp_peer1.conf
new file mode 100644
index 000000000..2df5a6175
--- /dev/null
+++ b/src/transport/test_transport_api_disconnect_tcp_peer1.conf
@@ -0,0 +1,31 @@
1@INLINE@ template_cfg_peer1.conf
2[PATHS]
3SERVICEHOME = /tmp/test-transport/api-tcp-p1/
4DEFAULTCONFIG = test_transport_api_tcp_peer1.conf
5
6[transport-tcp]
7PORT = 12000
8TIMEOUT = 5000
9
10[arm]
11PORT = 12005
12DEFAULTSERVICES = transport
13UNIXPATH = /tmp/gnunet-p1-service-arm.sock
14
15[statistics]
16PORT = 12004
17UNIXPATH = /tmp/gnunet-p1-service-statistics.sock
18
19[resolver]
20PORT = 12003
21UNIXPATH = /tmp/gnunet-p1-service-resolver.sock
22
23[peerinfo]
24PORT = 12002
25UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
26
27[transport]
28PORT = 12001
29UNIXPATH = /tmp/gnunet-p1-service-transport.sock
30#DEBUG = YES
31
diff --git a/src/transport/test_transport_api_disconnect_tcp_peer2.conf b/src/transport/test_transport_api_disconnect_tcp_peer2.conf
new file mode 100644
index 000000000..04500ea17
--- /dev/null
+++ b/src/transport/test_transport_api_disconnect_tcp_peer2.conf
@@ -0,0 +1,30 @@
1@INLINE@ template_cfg_peer2.conf
2[PATHS]
3SERVICEHOME = /tmp/test-transport/api-tcp-p2/
4DEFAULTCONFIG = test_transport_api_tcp_peer2.conf
5
6[transport-tcp]
7PORT = 12015
8TIMEOUT = 5000
9
10[arm]
11PORT = 12014
12DEFAULTSERVICES = transport
13UNIXPATH = /tmp/gnunet-p2-service-arm.sock
14
15[statistics]
16PORT = 12013
17UNIXPATH = /tmp/gnunet-p2-service-statistics.sock
18
19[resolver]
20PORT = 12012
21UNIXPATH = /tmp/gnunet-p2-service-resolver.sock
22
23[peerinfo]
24PORT = 12011
25UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
26
27[transport]
28PORT = 12010
29UNIXPATH = /tmp/gnunet-p2-service-transport.sock
30