test_transport_api_udp_nat \
test_transport_api_reliability_tcp \
test_transport_api_reliability_tcp_nat \
+ test_transport_api_reliability_http \
+ test_transport_api_reliability_udp \
test_transport_api_http
# TODO: add tests for nat, etc.
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
+test_transport_api_reliability_udp_SOURCES = \
+ test_transport_api_reliability.c
+test_transport_api_reliability_udp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la
+
+test_transport_api_reliability_http_SOURCES = \
+ test_transport_api_reliability.c
+test_transport_api_reliability_http_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la
+
test_transport_api_udp_SOURCES = \
test_transport_api.c
test_transport_api_udp_LDADD = \
#include "microhttpd.h"
#include <curl/curl.h>
-
#define DEBUG_CURL GNUNET_NO
#define DEBUG_HTTP GNUNET_NO
#define DEBUG_CONNECTIONS GNUNET_NO
if (addrlen == sizeof (struct IPv4HttpAddress))
{
v4 = (struct IPv4HttpAddress *) addr;
+ /* Not skipping loopback
if (INADDR_LOOPBACK == ntohl(v4->ipv4_addr))
{
return GNUNET_SYSERR;
- }
+ } */
port = ntohs (v4->u_port);
if (port != plugin->port_inbound)
{
if (af == AF_INET)
{
t4 = GNUNET_malloc(sizeof(struct IPv4HttpAddress));
+ /* Not skipping loopback addresses
if (INADDR_LOOPBACK == ntohl(((struct sockaddr_in *) addr)->sin_addr.s_addr))
{
- /* skip loopback addresses */
+
return GNUNET_OK;
}
+ */
t4->ipv4_addr = ((struct sockaddr_in *) addr)->sin_addr.s_addr;
t4->u_port = htons (plugin->port_inbound);
plugin->env->notify_address(plugin->env->cls,"http",t4, sizeof (struct IPv4HttpAddress), GNUNET_TIME_UNIT_FOREVER_REL);
/* skip link local addresses */
return GNUNET_OK;
}
+ /* Not skipping loopback addresses
if (IN6_IS_ADDR_LOOPBACK (&((struct sockaddr_in6 *) addr)->sin6_addr))
{
- /* skip loopback addresses */
+
return GNUNET_OK;
}
+ */
memcpy (&t6->ipv6_addr,
&((struct sockaddr_in6 *) addr)->sin6_addr,
sizeof (struct in6_addr));
t6->u6_port = htons (plugin->port_inbound);
plugin->env->notify_address(plugin->env->cls,"http",t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL);
}
+ return GNUNET_NO;
return GNUNET_OK;
}
#include "gnunet_statistics_service.h"
#include "transport.h"
#include <curl/curl.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#define VERBOSE GNUNET_YES
#define DEBUG GNUNET_NO
GNUNET_assert (GNUNET_SYSERR == suggest_res);
/* Suggesting addresses with wrong address*/
- failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK);
+ failing_addr.ipv4_addr = htonl(0xffc00000);
failing_addr.u_port = htons(12389);
- suggest_res = api->check_address (api->cls,&failing_addr,sizeof (struct IPv4HttpAddress));
+ suggest_res = api->check_address (api->cls,&failing_addr,100);
GNUNET_assert (GNUNET_SYSERR == suggest_res);
/* test sending to client */
static int is_http;
+static int is_udp;
+
static int connected;
static unsigned long long total_bytes;
setup_peer (&p1, "test_transport_api_http_peer1.conf");
setup_peer (&p2, "test_transport_api_http_peer2.conf");
}
+ else if (is_udp)
+ {
+ setup_peer (&p1, "test_transport_api_udp_peer1.conf");
+ setup_peer (&p2, "test_transport_api_udp_peer2.conf");
+ }
else if (is_tcp_nat)
{
setup_peer (&p1, "test_transport_api_tcp_nat_peer1.conf");
{
is_http = GNUNET_YES;
}
+ else if (strstr(argv[0], "udp") != NULL)
+ {
+ is_udp = GNUNET_YES;
+ }
GNUNET_log_setup ("test-transport-api-reliability",
#if VERBOSE
"DEBUG",