summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/plugin_transport_http_server.c2
-rw-r--r--src/transport/plugin_transport_tcp.c5
-rw-r--r--src/transport/plugin_transport_udp.c14
-rw-r--r--src/transport/plugin_transport_udp.h5
4 files changed, 22 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index b4130f945..0000a604d 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -2761,7 +2761,7 @@ server_start_report_addresses (struct HTTP_Server_Plugin *plugin)
plugin->port,
(unsigned int) res,
(const struct sockaddr **) addrs, addrlens,
- &server_nat_port_map_callback, NULL, plugin);
+ &server_nat_port_map_callback, NULL, plugin, NULL);
while (res > 0)
{
res--;
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index ec66a4388..b4bcde60f 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -2960,7 +2960,7 @@ libgnunet_plugin_transport_tcp_init (void *cls)
(const struct sockaddr **) addrs, addrlens,
&tcp_nat_port_map_callback,
&try_connection_reversal,
- plugin);
+ plugin, NULL);
for (ret = ret_s -1; ret >= 0; ret--)
GNUNET_free (addrs[ret]);
GNUNET_free_non_null (addrs);
@@ -2976,7 +2976,8 @@ libgnunet_plugin_transport_tcp_init (void *cls)
NULL,
NULL,
&try_connection_reversal,
- plugin);
+ plugin,
+ NULL);
}
api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions);
api->cls = plugin;
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 91839bbff..d031e6008 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -2854,6 +2854,13 @@ udp_select_read (struct Plugin *plugin,
/* Connection failure or something. Not a protocol violation. */
return;
}
+
+
+ /* PROCESS STUN PACKET */
+ if(GNUNET_NAT_try_decode_stun_packet(plugin->nat,(uint8_t *)buf, size ))
+ return;
+
+
if (size < sizeof(struct GNUNET_MessageHeader))
{
LOG (GNUNET_ERROR_TYPE_WARNING,
@@ -2866,6 +2873,10 @@ udp_select_read (struct Plugin *plugin,
GNUNET_break_op (0);
return;
}
+
+
+
+
msg = (const struct GNUNET_MessageHeader *) buf;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"UDP received %u-byte message from `%s' type %u\n",
@@ -3533,7 +3544,8 @@ setup_sockets (struct Plugin *plugin,
addrlens,
&udp_nat_port_map_callback,
NULL,
- plugin);
+ plugin,
+ plugin->sockv4);
return sockets_created;
}
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h
index 603e13e1a..5f8366636 100644
--- a/src/transport/plugin_transport_udp.h
+++ b/src/transport/plugin_transport_udp.h
@@ -190,6 +190,11 @@ struct Plugin
struct GNUNET_NAT_Handle *nat;
/**
+ * Handle to NAT traversal support.
+ */
+ struct GNUNET_NAT_STUN_Handle *stun;
+
+ /**
* The read socket for IPv4
*/
struct GNUNET_NETWORK_Handle *sockv4;