diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-03-30 11:59:49 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-03-30 11:59:49 +0000 |
commit | afef053a2ee08002fe50f3e1842e5c8153e6c507 (patch) | |
tree | 8ffc70786908ded09ee74007df75fe33f77d4b72 /src/transport/plugin_transport_wlan.c | |
parent | 4eb0a75f98349e55a405212404b258a987fb6145 (diff) | |
download | gnunet-afef053a2ee08002fe50f3e1842e5c8153e6c507.tar.gz gnunet-afef053a2ee08002fe50f3e1842e5c8153e6c507.zip |
-no longer pass distance information from non-DV plugins
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index ecf1efb86..eb635615f 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -1132,18 +1132,15 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1132 | struct Plugin *plugin = cls; | 1132 | struct Plugin *plugin = cls; |
1133 | struct MacAndSession *mas = client; | 1133 | struct MacAndSession *mas = client; |
1134 | struct MacAndSession xmas; | 1134 | struct MacAndSession xmas; |
1135 | #define NUM_ATS 2 | 1135 | struct GNUNET_ATS_Information ats; |
1136 | struct GNUNET_ATS_Information ats[NUM_ATS]; /* FIXME: do better here */ | ||
1137 | struct FragmentMessage *fm; | 1136 | struct FragmentMessage *fm; |
1138 | struct GNUNET_PeerIdentity tmpsource; | 1137 | struct GNUNET_PeerIdentity tmpsource; |
1139 | const struct WlanHeader *wlanheader; | 1138 | const struct WlanHeader *wlanheader; |
1140 | int ret; | 1139 | int ret; |
1141 | uint16_t msize; | 1140 | uint16_t msize; |
1142 | 1141 | ||
1143 | ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); | 1142 | ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); |
1144 | ats[0].value = htonl (1); | 1143 | ats.value = htonl (GNUNET_ATS_NET_WLAN); |
1145 | ats[1].type = htonl (GNUNET_ATS_NETWORK_TYPE); | ||
1146 | ats[1].value = htonl (GNUNET_ATS_NET_WLAN); | ||
1147 | msize = ntohs (hdr->size); | 1144 | msize = ntohs (hdr->size); |
1148 | 1145 | ||
1149 | GNUNET_STATISTICS_update (plugin->env->stats, | 1146 | GNUNET_STATISTICS_update (plugin->env->stats, |
@@ -1176,11 +1173,11 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1176 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | 1173 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, |
1177 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress)); | 1174 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress)); |
1178 | plugin->env->update_address_metrics (plugin->env->cls, | 1175 | plugin->env->update_address_metrics (plugin->env->cls, |
1179 | &tmpsource, | 1176 | &tmpsource, |
1180 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | 1177 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, |
1181 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress), | 1178 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress), |
1182 | mas->session, | 1179 | mas->session, |
1183 | (struct GNUNET_ATS_Information *) &ats, NUM_ATS); | 1180 | &ats, 1); |
1184 | break; | 1181 | break; |
1185 | case GNUNET_MESSAGE_TYPE_FRAGMENT: | 1182 | case GNUNET_MESSAGE_TYPE_FRAGMENT: |
1186 | if (NULL == mas->endpoint) | 1183 | if (NULL == mas->endpoint) |
@@ -1299,16 +1296,15 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1299 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | 1296 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, |
1300 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress)); | 1297 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress)); |
1301 | plugin->env->update_address_metrics (plugin->env->cls, | 1298 | plugin->env->update_address_metrics (plugin->env->cls, |
1302 | &mas->session->target, | 1299 | &mas->session->target, |
1303 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | 1300 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, |
1304 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress), | 1301 | (mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress), |
1305 | mas->session, | 1302 | mas->session, |
1306 | (struct GNUNET_ATS_Information *) &ats, NUM_ATS); | 1303 | &ats, 1); |
1307 | break; | 1304 | break; |
1308 | } | 1305 | } |
1309 | return GNUNET_OK; | 1306 | return GNUNET_OK; |
1310 | } | 1307 | } |
1311 | #undef NUM_ATS | ||
1312 | 1308 | ||
1313 | 1309 | ||
1314 | /** | 1310 | /** |