aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_unix.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-12-14 13:32:40 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-12-14 13:32:40 +0000
commite8609f2fc7dfb7347398f09aed6446b30a77a700 (patch)
tree041ea39a39aa5354876fe2f8730c286eb429efa0 /src/transport/plugin_transport_unix.c
parentcf5de44a6784fc5cfaf5a32808c594bee4d26060 (diff)
downloadgnunet-e8609f2fc7dfb7347398f09aed6446b30a77a700.tar.gz
gnunet-e8609f2fc7dfb7347398f09aed6446b30a77a700.zip
wan/lan detection in plugins
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r--src/transport/plugin_transport_unix.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index fc5719b3d..5f6c967f2 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -331,6 +331,10 @@ struct Plugin
331 */ 331 */
332 char *unix_socket_path; 332 char *unix_socket_path;
333 333
334 /**
335 * ATS network
336 */
337 struct GNUNET_ATS_Information ats_network;
334}; 338};
335 339
336/** 340/**
@@ -723,8 +727,8 @@ unix_demultiplexer (struct Plugin *plugin, struct GNUNET_PeerIdentity *sender,
723 727
724 ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); 728 ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
725 ats[0].value = htonl (UNIX_DIRECT_DISTANCE); 729 ats[0].value = htonl (UNIX_DIRECT_DISTANCE);
726 ats[1].type = htonl (GNUNET_ATS_NETWORK_TYPE); 730 ats[1] = plugin->ats_network;
727 ats[1].value = htonl (GNUNET_ATS_NET_LOOPBACK); 731 GNUNET_break (ntohl(plugin->ats_network.value) != GNUNET_ATS_NET_UNSPECIFIED);
728 732
729 GNUNET_assert (fromlen >= sizeof (struct sockaddr_un)); 733 GNUNET_assert (fromlen >= sizeof (struct sockaddr_un));
730 734
@@ -867,7 +871,7 @@ unix_transport_server_start (void *cls)
867#if LINUX 871#if LINUX
868 un.sun_path[0] = '\0'; 872 un.sun_path[0] = '\0';
869#endif 873#endif
870 874 plugin->ats_network = plugin->env->get_address_type (plugin->env->cls, serverAddr, addrlen);
871 plugin->unix_sock.desc = 875 plugin->unix_sock.desc =
872 GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_DGRAM, 0); 876 GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_DGRAM, 0);
873 if (NULL == plugin->unix_sock.desc) 877 if (NULL == plugin->unix_sock.desc)