sa = (const struct sockaddr_in *) addr;
if (h->data != sa->sin_port)
{
-#if DEBUG_NAT
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received connection reversal request for wrong port\n");
-#endif
return; /* wrong port */
}
/* report success */
{
if (data == tst->data)
tst->report (tst->report_cls, GNUNET_OK);
-#if DEBUG_NAT
else
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received data mismatches expected value\n");
-#endif
}
-#if DEBUG_NAT
else
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Failed to receive data from inbound connection\n");
-#endif
}
{
if (data == tst->data)
tst->report (tst->report_cls, GNUNET_OK);
-#if DEBUG_NAT
else
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received data mismatches expected value\n");
-#endif
}
-#if DEBUG_NAT
else
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Failed to receive data from inbound connection\n");
-#endif
GNUNET_NETWORK_socket_close (na->sock);
GNUNET_free (na);
}
GNUNET_log_strerror (GNUNET_ERROR_TYPE_INFO, "accept");
return; /* odd error */
}
-#if DEBUG_NAT
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Got an inbound connection, waiting for data\n");
-#endif
wl = GNUNET_malloc (sizeof (struct NatActivity));
wl->sock = s;
wl->h = tst;
if (GNUNET_YES != add_remove)
return;
if (addrlen != sizeof (struct sockaddr_in))
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "NAT test ignores IPv6 address `%s' returned from NAT library\n",
+ GNUNET_a2s (addr, addrlen));
return; /* ignore IPv6 here */
-#if DEBUG_NAT
+ }
LOG (GNUNET_ERROR_TYPE_DEBUG, "Asking gnunet-nat-server to connect to `%s'\n",
GNUNET_a2s (addr, addrlen));
-#endif
sa = (const struct sockaddr_in *) addr;
msg.header.size = htons (sizeof (struct GNUNET_NAT_TestMessage));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_NAT_TEST);
GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
ret->lsock, &do_udp_read, ret);
}
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "NAT test listens on port %u (%s)\n",
+ bnd_port,
+ (GNUNET_YES == is_tcp) ? "tcp" : "udp");
ret->nat =
GNUNET_NAT_register (cfg, is_tcp, adv_port, 1, addrs, addrlens,
&addr_cb, NULL, ret);
struct NatActivity *pos;
struct ClientActivity *cpos;
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Stopping NAT test\n");
while (NULL != (cpos = tst->ca_head))
{
GNUNET_CONTAINER_DLL_remove (tst->ca_head, tst->ca_tail, cpos);
- GNUNET_CLIENT_disconnect (cpos->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (cpos->client);
GNUNET_free (cpos);
}
while (NULL != (pos = tst->na_head))