aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_performance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ats/gnunet-service-ats_performance.c')
-rw-r--r--src/ats/gnunet-service-ats_performance.c76
1 files changed, 33 insertions, 43 deletions
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c
index 7e9b4802e..5a1d8cc66 100644
--- a/src/ats/gnunet-service-ats_performance.c
+++ b/src/ats/gnunet-service-ats_performance.c
@@ -507,52 +507,42 @@ GAS_handle_request_address_list (void *cls, struct GNUNET_SERVER_Client *client,
507 507
508void 508void
509GAS_handle_performance_update (struct GNUNET_PeerIdentity *peer, 509GAS_handle_performance_update (struct GNUNET_PeerIdentity *peer,
510 const char *plugin_name, 510 const char *plugin_name, const void *plugin_addr, size_t plugin_addr_len,
511 const void *plugin_addr, 511 const int active, struct GNUNET_ATS_Information *ats, uint32_t ats_count,
512 size_t plugin_addr_len, 512 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
513 const int active, 513 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
514 struct GNUNET_ATS_Information *ats,
515 uint32_t ats_count,
516 struct GNUNET_BANDWIDTH_Value32NBO
517 bandwidth_out,
518 struct GNUNET_BANDWIDTH_Value32NBO
519 bandwidth_in)
520{ 514{
521/* Notify here */ 515 /* Notify here */
522 GAS_performance_notify_all_clients (peer, 516 GAS_performance_notify_all_clients (peer, plugin_name, plugin_addr,
523 plugin_name, 517 plugin_addr_len, active, ats, ats_count, bandwidth_out, bandwidth_in);
524 plugin_addr, plugin_addr_len,
525 active,
526 ats, ats_count,
527 bandwidth_out, bandwidth_in);
528 518
529#if 0 519#if 0
530 struct PerformanceClient *cur; 520 struct PerformanceClient *cur;
531 struct PerformanceMonitorClient *curm; 521 struct PerformanceMonitorClient *curm;
532 struct MonitorResponseMessage *mrm; 522 struct MonitorResponseMessage *mrm;
533 size_t msglen; 523 size_t msglen;
534 524
535 msglen = sizeof (struct MonitorResponseMessage) + 525 msglen = sizeof (struct MonitorResponseMessage) +
536 ats_count * sizeof (struct GNUNET_ATS_Information); 526 ats_count * sizeof (struct GNUNET_ATS_Information);
537 mrm = GNUNET_malloc (msglen); 527 mrm = GNUNET_malloc (msglen);
538 528
539 mrm->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_MONITOR_RESPONSE); 529 mrm->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_MONITOR_RESPONSE);
540 mrm->header.size = htons (msglen); 530 mrm->header.size = htons (msglen);
541 mrm->ats_count = htonl (ats_count); 531 mrm->ats_count = htonl (ats_count);
542 mrm->peer = *peer; 532 mrm->peer = *peer;
543 memcpy (&mrm[1], ats, ats_count * sizeof (struct GNUNET_ATS_Information)); 533 memcpy (&mrm[1], ats, ats_count * sizeof (struct GNUNET_ATS_Information));
544 534
545 for (cur = pc_head; NULL != cur; cur = cur->next) 535 for (cur = pc_head; NULL != cur; cur = cur->next)
546 for (curm = cur->pm_head; NULL != curm; curm = curm->next) 536 for (curm = cur->pm_head; NULL != curm; curm = curm->next)
547 { 537 {
548 /* Notify client about update */ 538 /* Notify client about update */
549 mrm->id = htonl (curm->id); 539 mrm->id = htonl (curm->id);
550 GNUNET_SERVER_notification_context_unicast (nc, 540 GNUNET_SERVER_notification_context_unicast (nc,
551 cur->client, 541 cur->client,
552 (struct GNUNET_MessageHeader *) mrm, 542 (struct GNUNET_MessageHeader *) mrm,
553 GNUNET_YES); 543 GNUNET_YES);
554 } 544 }
555 GNUNET_free (mrm); 545 GNUNET_free (mrm);
556#endif 546#endif
557} 547}
558 548