diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-07-11 14:49:46 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-07-11 14:49:46 +0000 |
commit | 8dc32abbeff6b4b348253afed6c60543665a34c2 (patch) | |
tree | 0fe942debb1a57fcfef9d3526aab7217377b101a /src/nat/nat.c | |
parent | c7c9e6915281826e3027bc215ddffb14c2a72e47 (diff) | |
download | gnunet-8dc32abbeff6b4b348253afed6c60543665a34c2.tar.gz gnunet-8dc32abbeff6b4b348253afed6c60543665a34c2.zip |
logging
Diffstat (limited to 'src/nat/nat.c')
-rw-r--r-- | src/nat/nat.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nat/nat.c b/src/nat/nat.c index bf9565877..d09fd79fc 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c | |||
@@ -24,15 +24,14 @@ | |||
24 | * external IP address retrieval | 24 | * external IP address retrieval |
25 | * @author Milan Bouchet-Valat | 25 | * @author Milan Bouchet-Valat |
26 | * @author Christian Grothoff | 26 | * @author Christian Grothoff |
27 | * | ||
28 | * TODO: | ||
29 | * - implement UPnP/PMP support | ||
30 | */ | 27 | */ |
31 | #include "platform.h" | 28 | #include "platform.h" |
32 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
33 | #include "gnunet_resolver_service.h" | 30 | #include "gnunet_resolver_service.h" |
34 | #include "gnunet_nat_lib.h" | 31 | #include "gnunet_nat_lib.h" |
35 | 32 | ||
33 | #define DEBUG_NAT GNUNET_NO | ||
34 | |||
36 | /** | 35 | /** |
37 | * How often do we scan for changes in our IP address from our local | 36 | * How often do we scan for changes in our IP address from our local |
38 | * interfaces? | 37 | * interfaces? |
@@ -767,7 +766,7 @@ nat_server_read (void *cls, | |||
767 | sizeof(mybuf)); | 766 | sizeof(mybuf)); |
768 | if (bytes < 1) | 767 | if (bytes < 1) |
769 | { | 768 | { |
770 | #if DEBUG_TCP_NAT | 769 | #if DEBUG_NAT |
771 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, | 770 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, |
772 | "nat", | 771 | "nat", |
773 | "Finished reading from server stdout with code: %d\n", | 772 | "Finished reading from server stdout with code: %d\n", |
@@ -1136,10 +1135,13 @@ GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1136 | struct in_addr in_addr; | 1135 | struct in_addr in_addr; |
1137 | unsigned int i; | 1136 | unsigned int i; |
1138 | 1137 | ||
1139 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1138 | #if DEBUG_NAT |
1140 | "Registered with NAT service at port %u with %u IP bound local addresses\n", | 1139 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, |
1141 | (unsigned int) adv_port, | 1140 | "nat", |
1142 | num_addrs); | 1141 | "Registered with NAT service at port %u with %u IP bound local addresses\n", |
1142 | (unsigned int) adv_port, | ||
1143 | num_addrs); | ||
1144 | #endif | ||
1143 | h = GNUNET_malloc (sizeof (struct GNUNET_NAT_Handle)); | 1145 | h = GNUNET_malloc (sizeof (struct GNUNET_NAT_Handle)); |
1144 | h->server_retry_delay = GNUNET_TIME_UNIT_SECONDS; | 1146 | h->server_retry_delay = GNUNET_TIME_UNIT_SECONDS; |
1145 | h->cfg = cfg; | 1147 | h->cfg = cfg; |
@@ -1432,7 +1434,7 @@ GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | |||
1432 | sizeof (port_as_string), | 1434 | sizeof (port_as_string), |
1433 | "%d", | 1435 | "%d", |
1434 | h->adv_port); | 1436 | h->adv_port); |
1435 | #if DEBUG_TCP_NAT | 1437 | #if DEBUG_NAT |
1436 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, | 1438 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, |
1437 | "nat", | 1439 | "nat", |
1438 | _("Running gnunet-helper-nat-client %s %s %u\n"), | 1440 | _("Running gnunet-helper-nat-client %s %s %u\n"), |