aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index ffe40f8c1..685113b10 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -186,16 +186,9 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
186 im->header.size = htons (size); 186 im->header.size = htons (size);
187 im->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RECV); 187 im->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RECV);
188 im->peer = *peer; 188 im->peer = *peer;
189
190 fprintf (stderr, "FIX THIS: %s:%u \n", __FILE__, __LINE__);
191 /*
192 ap[ats_count].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
193 ap[ats_count].value =
194 htonl ((uint32_t) GST_neighbour_get_latency (peer).rel_value);*/
195 memcpy (&im[1], message, ntohs (message->size)); 189 memcpy (&im[1], message, ntohs (message->size));
196 190
197 GNUNET_ATS_address_add (GST_ats, address, session, NULL, 0); 191 GNUNET_ATS_address_add (GST_ats, address, session, NULL, 0);
198 GNUNET_ATS_address_update (GST_ats, address, session, NULL, 0);
199 GST_clients_broadcast (&im->header, GNUNET_YES); 192 GST_clients_broadcast (&im->header, GNUNET_YES);
200 193
201 return ret; 194 return ret;
@@ -407,6 +400,16 @@ plugin_env_address_to_type (void *cls,
407 return GNUNET_ATS_address_get_type(GST_ats, addr, addrlen); 400 return GNUNET_ATS_address_get_type(GST_ats, addr, addrlen);
408} 401}
409 402
403void
404GST_update_ats_metrics (struct GNUNET_PeerIdentity *peer,
405 struct GNUNET_HELLO_Address *address,
406 struct Session *session,
407 struct GNUNET_ATS_Information *ats,
408 uint32_t ats_count)
409{
410 GNUNET_ATS_address_update (GST_ats, address, session, ats, ats_count);
411}
412
410/** 413/**
411 * Function that will be called to figure if an address is an loopback, 414 * Function that will be called to figure if an address is an loopback,
412 * LAN, WAN etc. address 415 * LAN, WAN etc. address
@@ -418,8 +421,8 @@ plugin_env_address_to_type (void *cls,
418 */ 421 */
419static void 422static void
420plugin_env_update_metrics (void *cls, 423plugin_env_update_metrics (void *cls,
421 const struct GNUNET_PeerIdentity *peer, 424 struct GNUNET_PeerIdentity *peer,
422 const char *address, 425 const void *address,
423 uint16_t address_len, 426 uint16_t address_len,
424 struct Session *session, 427 struct Session *session,
425 struct GNUNET_ATS_Information *ats, 428 struct GNUNET_ATS_Information *ats,
@@ -437,7 +440,7 @@ plugin_env_update_metrics (void *cls,
437 haddress.address_length = address_len; 440 haddress.address_length = address_len;
438 haddress.transport_name = plugin_name; 441 haddress.transport_name = plugin_name;
439 442
440 GNUNET_ATS_address_update (GST_ats, &haddress, session, ats, ats_count); 443 GST_update_ats_metrics (peer, &haddress, session, ats, ats_count);
441} 444}
442 445
443 446
@@ -688,7 +691,7 @@ key_generation_cb (void *cls,
688 &plugin_env_address_change_notification, 691 &plugin_env_address_change_notification,
689 &plugin_env_session_end, 692 &plugin_env_session_end,
690 &plugin_env_address_to_type, 693 &plugin_env_address_to_type,
691 &GST_manipulation_metrics_recv); 694 &plugin_env_update_metrics);
692 GST_neighbours_start (NULL, 695 GST_neighbours_start (NULL,
693 &neighbours_connect_notification, 696 &neighbours_connect_notification,
694 &neighbours_disconnect_notification, 697 &neighbours_disconnect_notification,