From a653f8615d33ff59518f4134c0820ba477647fff Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 27 Oct 2011 21:37:16 +0000 Subject: new test modified makefile --- src/transport/Makefile.am | 30 ++++++++++++++--- .../gnunet-service-transport_neighbours_3way.c | 39 ++++++++++------------ .../test_transport_api_disconnect_tcp_peer1.conf | 31 +++++++++++++++++ .../test_transport_api_disconnect_tcp_peer2.conf | 30 +++++++++++++++++ 4 files changed, 104 insertions(+), 26 deletions(-) create mode 100644 src/transport/test_transport_api_disconnect_tcp_peer1.conf create mode 100644 src/transport/test_transport_api_disconnect_tcp_peer2.conf (limited to 'src/transport') 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 = \ gnunet_transport_DEPENDENCIES = \ libgnunettransport.la +# transport with 3way handshake +gnunet_service_transport_SOURCES = \ + gnunet-service-transport_3way.c gnunet-service-transport.h \ + gnunet-service-transport_blacklist.h gnunet-service-transport_blacklist.c \ + gnunet-service-transport_clients.h gnunet-service-transport_clients.c \ + gnunet-service-transport_hello.h gnunet-service-transport_hello.c \ + gnunet-service-transport_neighbours.h gnunet-service-transport_neighbours_3way.c \ + gnunet-service-transport_plugins.h gnunet-service-transport_plugins.c \ + gnunet-service-transport_validation.h gnunet-service-transport_validation.c +gnunet_service_transport_LDADD = \ + $(top_builddir)/src/ats/libgnunetats.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(GN_GLPK) \ + $(GN_LIBINTL) +# + gnunet_service_transport_SOURCES = \ gnunet-service-transport.c gnunet-service-transport.h \ gnunet-service-transport_blacklist.h gnunet-service-transport_blacklist.c \ @@ -244,7 +263,7 @@ libgnunet_plugin_transport_https_la_CPPFLAGS = \ check_PROGRAMS = \ test_transport_testing \ test_transport_startonly \ - test_transport_api_disconnect \ + test_transport_api_disconnect_tcp \ test_transport_api_tcp \ test_transport_api_timeout_tcp \ test_transport_api_limited_sockets_tcp \ @@ -282,7 +301,7 @@ if ENABLE_TEST_RUN TESTS = \ test_transport_testing \ test_transport_startonly \ - test_transport_api_disconnect \ + test_transport_api_disconnect_tcp \ test_transport_api_tcp \ test_transport_api_timeout_tcp \ test_transport_api_limited_sockets_tcp \ @@ -333,13 +352,14 @@ test_transport_testing_LDADD = \ # $(top_builddir)/src/util/libgnunetutil.la \ # $(top_builddir)/src/transport/libgnunettransporttesting.la -test_transport_api_disconnect_SOURCES = \ +test_transport_api_disconnect_tcp_SOURCES = \ test_transport_api_disconnect.c -test_transport_api_disconnect_LDADD = \ +test_transport_api_disconnect_tcp_LDADD = \ $(top_builddir)/src/transport/libgnunettransport.la \ $(top_builddir)/src/hello/libgnunethello.la \ $(top_builddir)/src/statistics/libgnunetstatistics.la \ - $(top_builddir)/src/util/libgnunetutil.la + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/transport/libgnunettransporttesting.la test_transport_startonly_SOURCES = \ 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) &disconnect_msg.purpose, &disconnect_msg.signature)); - ret = send_with_plugin(&n->id, - (const char *) &disconnect_msg, sizeof (disconnect_msg), - UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL, n->session, n->plugin_name, n->addr, n->addrlen, - GNUNET_YES, NULL, NULL); + ret = send_with_plugin(&n->id, (const char *) &disconnect_msg, sizeof (disconnect_msg), + UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL, + n->session, n->plugin_name, n->addr, n->addrlen, + GNUNET_YES, NULL, NULL); if (ret == GNUNET_SYSERR) return GNUNET_SYSERR; @@ -1155,17 +1155,10 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, connect_msg.timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); - 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); - if (ret == GNUNET_SYSERR) - { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Failed to send CONNECT_MESSAGE to `%4s' using plugin `%s' address '%s' session %X\n", - GNUNET_i2s (peer), plugin_name, - (address_len == 0) ? "" : GST_plugins_a2s (plugin_name, - address, - address_len), - session); - } + ret = send_with_plugin (peer, (const char *) &connect_msg, msg_len, UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL, + session, plugin_name, address, address_len, + GNUNET_YES, &send_connect_continuation, n); + return GNUNET_NO; } /* 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, connect_msg.reserved = htonl (0); connect_msg.timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); - 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); + ret = send_with_plugin(&n->id, (const void *) &connect_msg, msg_len, UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL, + session, plugin_name, address, address_len, + GNUNET_YES, &send_connect_ack_continuation, n); if (ret == GNUNET_SYSERR) { change_state (n, S_NOT_CONNECTED); @@ -1197,7 +1192,9 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, connect_msg.timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); - 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); + ret = send_with_plugin (peer, (const char *) &connect_msg, msg_len, UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL, + session, plugin_name, address, address_len, + GNUNET_YES, &send_switch_address_continuation, n); if (ret == GNUNET_SYSERR) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -1843,10 +1840,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, msg.size = htons (msg_len); msg.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_ACK); - ret = send_with_plugin (&n->id, (const char *) &msg, msg_len, 0, - GNUNET_TIME_UNIT_FOREVER_REL, - n->session, n->plugin_name, n->addr, n->addrlen, - GNUNET_YES, NULL, NULL); + ret = send_with_plugin (&n->id, (const char *) &msg, msg_len, UINT32_MAX, + GNUNET_TIME_UNIT_FOREVER_REL, + n->session, n->plugin_name, n->addr, n->addrlen, + GNUNET_YES, NULL, NULL); if (ret == GNUNET_SYSERR) 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 @@ +@INLINE@ template_cfg_peer1.conf +[PATHS] +SERVICEHOME = /tmp/test-transport/api-tcp-p1/ +DEFAULTCONFIG = test_transport_api_tcp_peer1.conf + +[transport-tcp] +PORT = 12000 +TIMEOUT = 5000 + +[arm] +PORT = 12005 +DEFAULTSERVICES = transport +UNIXPATH = /tmp/gnunet-p1-service-arm.sock + +[statistics] +PORT = 12004 +UNIXPATH = /tmp/gnunet-p1-service-statistics.sock + +[resolver] +PORT = 12003 +UNIXPATH = /tmp/gnunet-p1-service-resolver.sock + +[peerinfo] +PORT = 12002 +UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock + +[transport] +PORT = 12001 +UNIXPATH = /tmp/gnunet-p1-service-transport.sock +#DEBUG = YES + 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 @@ +@INLINE@ template_cfg_peer2.conf +[PATHS] +SERVICEHOME = /tmp/test-transport/api-tcp-p2/ +DEFAULTCONFIG = test_transport_api_tcp_peer2.conf + +[transport-tcp] +PORT = 12015 +TIMEOUT = 5000 + +[arm] +PORT = 12014 +DEFAULTSERVICES = transport +UNIXPATH = /tmp/gnunet-p2-service-arm.sock + +[statistics] +PORT = 12013 +UNIXPATH = /tmp/gnunet-p2-service-statistics.sock + +[resolver] +PORT = 12012 +UNIXPATH = /tmp/gnunet-p2-service-resolver.sock + +[peerinfo] +PORT = 12011 +UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock + +[transport] +PORT = 12010 +UNIXPATH = /tmp/gnunet-p2-service-transport.sock + -- cgit v1.2.3