* are stored in a 'struct GSF_RequestPlan'. (We need
* to be able to lookup all pending requests corresponding
* to a given plan entry.)
- *
+ *
* Similarly head and tail of the "PR" MDLL are stored
* with the 'struct GSF_PendingRequest'. (We need
* to be able to lookup all plan entries corresponding
/**
* Hash map from peer identities to PeerPlans.
*/
-static struct GNUNET_CONTAINER_MultiHashMap *plans;
+static struct GNUNET_CONTAINER_MultiPeerMap *plans;
/**
* Sum of all transmission counters (equals total delay for all plan entries).
if (NULL == bi)
return NULL; /* should never happen */
ret = bi->pr;
- bi = bi->next_PE;
+ bi = bi->next_PE;
while (NULL != bi)
{
if (GSF_pending_request_get_data_ (bi->pr)->ttl.abs_value_us >
GNUNET_assert (NULL != cp);
id = GSF_connected_peer_get_identity2_ (cp);
- pp = GNUNET_CONTAINER_multihashmap_get (plans, &id->hashPubKey);
+ pp = GNUNET_CONTAINER_multipeermap_get (plans, id);
if (NULL == pp)
{
pp = GNUNET_new (struct PeerPlan);
pp->delay_heap =
GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
pp->cp = cp;
- GNUNET_CONTAINER_multihashmap_put (plans,
- &id->hashPubKey, pp,
+ GNUNET_CONTAINER_multipeermap_put (plans,
+ id, pp,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
}
mpc.merged = GNUNET_NO;
struct GSF_PendingRequestPlanBijection *bi;
id = GSF_connected_peer_get_identity2_ (cp);
- pp = GNUNET_CONTAINER_multihashmap_get (plans, &id->hashPubKey);
+ pp = GNUNET_CONTAINER_multipeermap_get (plans, id);
if (NULL == pp)
return; /* nothing was ever planned for this peer */
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (plans, &id->hashPubKey,
+ GNUNET_CONTAINER_multipeermap_remove (plans, id,
pp));
if (NULL != pp->pth)
{
void
GSF_plan_init ()
{
- plans = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_YES);
+ plans = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_YES);
}
void
GSF_plan_done ()
{
- GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (plans));
- GNUNET_CONTAINER_multihashmap_destroy (plans);
+ GNUNET_assert (0 == GNUNET_CONTAINER_multipeermap_size (plans));
+ GNUNET_CONTAINER_multipeermap_destroy (plans);
}