* Configuration we use.
*/
const struct GNUNET_CONFIGURATION_Handle *cfg;
-
+
/**
* Message queue for communicating with the NAT service.
*/
*/
struct GNUNET_NAT_AUTO_AutoHandle *
GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_NAT_AUTO_AutoResultCallback cb,
- void *cb_cls)
+ GNUNET_NAT_AUTO_AutoResultCallback cb,
+ void *cb_cls)
{
struct GNUNET_NAT_AUTO_AutoHandle *ah = GNUNET_new (struct GNUNET_NAT_AUTO_AutoHandle);
struct GNUNET_MQ_MessageHandler handlers[] = {
#include "gnunet_nat_auto_service.h"
#include "nat-auto.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "nat", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "nat-auto", __VA_ARGS__)
#define NAT_SERVER_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
{
nh->lsock
= GNUNET_NETWORK_socket_create (AF_INET,
- proto,
- 0);
+ (IPPROTO_UDP == proto)
+ ? SOCK_DGRAM
+ : SOCK_STREAM,
+ proto);
if ( (NULL == nh->lsock) ||
(GNUNET_OK !=
GNUNET_NETWORK_socket_bind (nh->lsock,
(const struct sockaddr *) &sa,
sizeof (sa))))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Failed to create listen socket bound to `%s' for NAT test: %s\n"),
- GNUNET_a2s ((const struct sockaddr *) &sa,
- sizeof (sa)),
- STRERROR (errno));
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _("Failed to create socket bound to `%s' for NAT test: %s\n"),
+ GNUNET_a2s ((const struct sockaddr *) &sa,
+ sizeof (sa)),
+ STRERROR (errno));
if (NULL != nh->lsock)
{
GNUNET_NETWORK_socket_close (nh->lsock);