aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/.gitignore1
-rw-r--r--src/transport/gnunet-communicator-tcp.c18
2 files changed, 12 insertions, 7 deletions
diff --git a/src/transport/.gitignore b/src/transport/.gitignore
index e2f12c230..169604467 100644
--- a/src/transport/.gitignore
+++ b/src/transport/.gitignore
@@ -85,3 +85,4 @@ test_transport_testing_restart
85test_transport_testing_startstop 85test_transport_testing_startstop
86gnunet-communicator-unix 86gnunet-communicator-unix
87gnunet-service-tng 87gnunet-service-tng
88gnunet-communicator-tcp
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c
index 884fbb0cb..2980ad532 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -24,7 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * 25 *
26 * TODO: 26 * TODO:
27 * - NAT service API change to handle address stops! 27 * - support DNS names in BINDTO option
28 * - support NAT connection reversal method 28 * - support NAT connection reversal method
29 * - support other TCP-specific NAT traversal methods 29 * - support other TCP-specific NAT traversal methods
30 */ 30 */
@@ -2180,28 +2180,32 @@ nat_address_cb (void *cls,
2180 socklen_t addrlen) 2180 socklen_t addrlen)
2181{ 2181{
2182 char *my_addr; 2182 char *my_addr;
2183 static struct GNUNET_TRANSPORT_AddressIdentifier *ai; // FIXME: store in *ctx of NAT! 2183 struct GNUNET_TRANSPORT_AddressIdentifier *ai;
2184 2184
2185 if (GNUNET_YES == add_remove) 2185 if (GNUNET_YES == add_remove)
2186 { 2186 {
2187 // FIXME: do better job at stringification of @a addr? 2187 enum GNUNET_NetworkType nt;
2188
2188 GNUNET_asprintf (&my_addr, 2189 GNUNET_asprintf (&my_addr,
2189 "%s-%s", 2190 "%s-%s",
2190 COMMUNICATOR_ADDRESS_PREFIX, 2191 COMMUNICATOR_ADDRESS_PREFIX,
2191 GNUNET_a2s (addr, 2192 GNUNET_a2s (addr,
2192 addrlen)); 2193 addrlen));
2193 // FIXME: translate 'ac' to 'nt'? 2194 nt = GNUNET_NT_scanner_get_type (is,
2195 addr,
2196 addrlen);
2194 ai = GNUNET_TRANSPORT_communicator_address_add (ch, 2197 ai = GNUNET_TRANSPORT_communicator_address_add (ch,
2195 my_addr, 2198 my_addr,
2196 GNUNET_NT_LOOPBACK, // FIXME: wrong NT! 2199 nt,
2197 GNUNET_TIME_UNIT_FOREVER_REL); 2200 GNUNET_TIME_UNIT_FOREVER_REL);
2198 GNUNET_free (my_addr); 2201 GNUNET_free (my_addr);
2202 *app_ctx = ai;
2199 } 2203 }
2200 else 2204 else
2201 { 2205 {
2202 // FIXME: support removal! => improve NAT API! 2206 ai = *app_ctx;
2203 GNUNET_TRANSPORT_communicator_address_remove (ai); 2207 GNUNET_TRANSPORT_communicator_address_remove (ai);
2204 ai = NULL; 2208 *app_ctx = NULL;
2205 } 2209 }
2206} 2210}
2207 2211