aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_manipulation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-30 20:35:10 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-30 20:35:10 +0000
commita0ba5b741b56036bd35bd9ba88164324b2ff7ada (patch)
tree3fd10a0fc15f9a9e7cf5415b2bec86d97d7fe825 /src/transport/gnunet-service-transport_manipulation.c
parent427dd6f998fb1fde515a3b5c800f9f6d308197b2 (diff)
downloadgnunet-a0ba5b741b56036bd35bd9ba88164324b2ff7ada.tar.gz
gnunet-a0ba5b741b56036bd35bd9ba88164324b2ff7ada.zip
-getting ATS and transport to compile again (part of #3047)
Diffstat (limited to 'src/transport/gnunet-service-transport_manipulation.c')
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index 0ebe18c55..7762d1811 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -114,7 +114,7 @@ struct GST_ManipulationHandle
114 /** 114 /**
115 * Hashmap contain all peers currently manipulated 115 * Hashmap contain all peers currently manipulated
116 */ 116 */
117 struct GNUNET_CONTAINER_MultiHashMap *peers; 117 struct GNUNET_CONTAINER_MultiPeerMap *peers;
118 118
119 /** 119 /**
120 * Peer containing information for general manipulation 120 * Peer containing information for general manipulation
@@ -325,7 +325,7 @@ GST_manipulation_set_metric (void *cls, struct GNUNET_SERVER_Client *client,
325 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received traffic metrics for peer `%s'\n", 325 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received traffic metrics for peer `%s'\n",
326 GNUNET_i2s(&tm->peer)); 326 GNUNET_i2s(&tm->peer));
327 327
328 if (NULL == (tmp = GNUNET_CONTAINER_multihashmap_get (man_handle.peers, &tm->peer.hashPubKey))) 328 if (NULL == (tmp = GNUNET_CONTAINER_multipeermap_get (man_handle.peers, &tm->peer)))
329 { 329 {
330 tmp = GNUNET_malloc (sizeof (struct TM_Peer)); 330 tmp = GNUNET_malloc (sizeof (struct TM_Peer));
331 tmp->peer = (tm->peer); 331 tmp->peer = (tm->peer);
@@ -336,7 +336,9 @@ GST_manipulation_set_metric (void *cls, struct GNUNET_SERVER_Client *client,
336 tmp->metrics[c][c2] = UINT32_MAX; 336 tmp->metrics[c][c2] = UINT32_MAX;
337 } 337 }
338 } 338 }
339 GNUNET_CONTAINER_multihashmap_put (man_handle.peers, &tm->peer.hashPubKey, tmp, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); 339 GNUNET_CONTAINER_multipeermap_put (man_handle.peers,
340 &tm->peer, tmp,
341 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
340 } 342 }
341 343
342 ats = (struct GNUNET_ATS_Information *) &tm[1]; 344 ats = (struct GNUNET_ATS_Information *) &tm[1];
@@ -411,7 +413,7 @@ GST_manipulation_send (const struct GNUNET_PeerIdentity *target, const void *msg
411 struct DelayQueueEntry *dqe; 413 struct DelayQueueEntry *dqe;
412 struct GNUNET_TIME_Relative delay; 414 struct GNUNET_TIME_Relative delay;
413 415
414 if (NULL != (tmp = GNUNET_CONTAINER_multihashmap_get (man_handle.peers, &target->hashPubKey))) 416 if (NULL != (tmp = GNUNET_CONTAINER_multipeermap_get (man_handle.peers, target)))
415 { 417 {
416 GNUNET_break (GNUNET_YES == GST_neighbours_test_connected(target)); 418 GNUNET_break (GNUNET_YES == GST_neighbours_test_connected(target));
417 /* Manipulate here */ 419 /* Manipulate here */
@@ -494,7 +496,7 @@ GST_manipulation_manipulate_metrics (const struct GNUNET_PeerIdentity *peer,
494 uint32_t m_tmp; 496 uint32_t m_tmp;
495 uint32_t g_tmp; 497 uint32_t g_tmp;
496 int d; 498 int d;
497 tmp = GNUNET_CONTAINER_multihashmap_get (man_handle.peers, &peer->hashPubKey); 499 tmp = GNUNET_CONTAINER_multipeermap_get (man_handle.peers, peer);
498 500
499 for (d = 0; d < ats_count; d++) 501 for (d = 0; d < ats_count; d++)
500 { 502 {
@@ -546,7 +548,7 @@ GST_manipulation_recv (void *cls,
546 else 548 else
547 m_delay = GNUNET_TIME_UNIT_ZERO; 549 m_delay = GNUNET_TIME_UNIT_ZERO;
548 550
549 if (NULL != (tmp = GNUNET_CONTAINER_multihashmap_get (man_handle.peers, &peer->hashPubKey))) 551 if (NULL != (tmp = GNUNET_CONTAINER_multipeermap_get (man_handle.peers, peer)))
550 { 552 {
551 /* Manipulate receive delay */ 553 /* Manipulate receive delay */
552 p_recv_delay = find_metric (tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_RECEIVE); 554 p_recv_delay = find_metric (tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_RECEIVE);
@@ -632,13 +634,13 @@ GST_manipulation_init (const struct GNUNET_CONFIGURATION_Handle *GST_cfg)
632 GNUNET_ATS_QUALITY_NET_DELAY, 634 GNUNET_ATS_QUALITY_NET_DELAY,
633 delay.rel_value_us); 635 delay.rel_value_us);
634 } 636 }
635 man_handle.peers = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); 637 man_handle.peers = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO);
636} 638}
637 639
638 640
639static int 641static int
640free_tmps (void *cls, 642free_tmps (void *cls,
641 const struct GNUNET_HashCode * key, 643 const struct GNUNET_PeerIdentity *key,
642 void *value) 644 void *value)
643{ 645{
644 struct DelayQueueEntry *dqe; 646 struct DelayQueueEntry *dqe;
@@ -648,7 +650,7 @@ free_tmps (void *cls,
648 { 650 {
649 struct TM_Peer *tmp = (struct TM_Peer *) value; 651 struct TM_Peer *tmp = (struct TM_Peer *) value;
650 652
651 if (GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (man_handle.peers, key, value)) 653 if (GNUNET_YES != GNUNET_CONTAINER_multipeermap_remove (man_handle.peers, key, value))
652 GNUNET_break (0); 654 GNUNET_break (0);
653 free_metric (tmp); 655 free_metric (tmp);
654 next = tmp->send_head; 656 next = tmp->send_head;
@@ -683,7 +685,7 @@ GST_manipulation_peer_disconnect (const struct GNUNET_PeerIdentity *peer)
683 struct DelayQueueEntry *dqe; 685 struct DelayQueueEntry *dqe;
684 struct DelayQueueEntry *next; 686 struct DelayQueueEntry *next;
685 687
686 if (NULL != (tmp = GNUNET_CONTAINER_multihashmap_get (man_handle.peers, &peer->hashPubKey))) 688 if (NULL != (tmp = GNUNET_CONTAINER_multipeermap_get (man_handle.peers, peer)))
687 { 689 {
688 next = tmp->send_head; 690 next = tmp->send_head;
689 while (NULL != (dqe = next)) 691 while (NULL != (dqe = next))
@@ -729,8 +731,8 @@ GST_manipulation_stop ()
729{ 731{
730 struct DelayQueueEntry *cur; 732 struct DelayQueueEntry *cur;
731 struct DelayQueueEntry *next; 733 struct DelayQueueEntry *next;
732 GNUNET_CONTAINER_multihashmap_iterate (man_handle.peers, &free_tmps,NULL); 734 GNUNET_CONTAINER_multipeermap_iterate (man_handle.peers, &free_tmps,NULL);
733 GNUNET_CONTAINER_multihashmap_destroy (man_handle.peers); 735 GNUNET_CONTAINER_multipeermap_destroy (man_handle.peers);
734 736
735 next = generic_dqe_head; 737 next = generic_dqe_head;
736 while (NULL != (cur = next)) 738 while (NULL != (cur = next))