aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-03-30 16:01:34 +0000
committerChristian Grothoff <christian@grothoff.org>2013-03-30 16:01:34 +0000
commit9d28dc341890a1a5963c99708f870326910ad42c (patch)
treee89776c80a83462e8217f20f5d69d60cfa85029c /src
parent3f52cf4378a93860d14e8475e7de62c1bb0b4c24 (diff)
downloadgnunet-9d28dc341890a1a5963c99708f870326910ad42c.tar.gz
gnunet-9d28dc341890a1a5963c99708f870326910ad42c.zip
-more distance removing
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c26
-rw-r--r--src/transport/plugin_transport_unix.c5
2 files changed, 12 insertions, 19 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index 838aec5bc..e8e087276 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -145,9 +145,10 @@ broadcast_ipv4_mst_cb (void *cls, void *client,
145 struct Plugin *plugin = cls; 145 struct Plugin *plugin = cls;
146 struct Mstv4Context *mc = client; 146 struct Mstv4Context *mc = client;
147 const struct GNUNET_MessageHeader *hello; 147 const struct GNUNET_MessageHeader *hello;
148 struct UDP_Beacon_Message *msg; 148 const struct UDP_Beacon_Message *msg;
149 struct GNUNET_ATS_Information atsi;
149 150
150 msg = (struct UDP_Beacon_Message *) message; 151 msg = (const struct UDP_Beacon_Message *) message;
151 152
152 if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != 153 if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON !=
153 ntohs (msg->header.type)) 154 ntohs (msg->header.type))
@@ -157,29 +158,26 @@ broadcast_ipv4_mst_cb (void *cls, void *client,
157 ntohs (msg->header.size), GNUNET_i2s (&msg->sender), 158 ntohs (msg->header.size), GNUNET_i2s (&msg->sender),
158 udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); 159 udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr)));
159 160
160 struct GNUNET_ATS_Information atsi[2];
161 161
162 /* setup ATS */ 162 /* setup ATS */
163 atsi[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); 163 atsi.type = htonl (GNUNET_ATS_NETWORK_TYPE);
164 atsi[0].value = htonl (1); 164 atsi.value = mc->ats_address_network_type;
165 atsi[1].type = htonl (GNUNET_ATS_NETWORK_TYPE);
166 atsi[1].value = mc->ats_address_network_type;
167 GNUNET_break (ntohl(mc->ats_address_network_type) != GNUNET_ATS_NET_UNSPECIFIED); 165 GNUNET_break (ntohl(mc->ats_address_network_type) != GNUNET_ATS_NET_UNSPECIFIED);
168 166
169 hello = (struct GNUNET_MessageHeader *) &msg[1]; 167 hello = (struct GNUNET_MessageHeader *) &msg[1];
170 plugin->env->receive (plugin->env->cls, 168 plugin->env->receive (plugin->env->cls,
171 &msg->sender, 169 &msg->sender,
172 hello, 170 hello,
173 NULL, 171 NULL,
174 (const char *) &mc->addr, 172 (const char *) &mc->addr,
175 sizeof (mc->addr)); 173 sizeof (mc->addr));
176 174
177 plugin->env->update_address_metrics (plugin->env->cls, 175 plugin->env->update_address_metrics (plugin->env->cls,
178 &msg->sender, 176 &msg->sender,
179 (const char *) &mc->addr, 177 (const char *) &mc->addr,
180 sizeof (mc->addr), 178 sizeof (mc->addr),
181 NULL, 179 NULL,
182 (struct GNUNET_ATS_Information *) &atsi, 2); 180 &atsi, 1);
183 181
184 GNUNET_STATISTICS_update (plugin->env->stats, 182 GNUNET_STATISTICS_update (plugin->env->stats,
185 _ 183 _
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index a27144efa..646695f79 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -48,11 +48,6 @@
48 48
49#define LOG(kind,...) GNUNET_log_from (kind, "transport-unix",__VA_ARGS__) 49#define LOG(kind,...) GNUNET_log_from (kind, "transport-unix",__VA_ARGS__)
50 50
51/*
52 * Transport cost to peer, always 1 for UNIX (direct connection)
53 */
54#define UNIX_DIRECT_DISTANCE 1
55
56#define DEFAULT_NAT_PORT 0 51#define DEFAULT_NAT_PORT 0
57 52
58/** 53/**