-/* ********************* GNUNET_CORE_iterate_peers *********************** */
-
-/**
- * Context for 'iterate_peers' helper function.
- */
-struct IterationContext
-{
- /**
- * Callback to call.
- */
- GNUNET_CORE_ConnectEventHandler peer_cb;
-
- /**
- * Closure for 'peer_cb'.
- */
- void *cb_cls;
-};
-
-
-/**
- * Call callback for each peer.
- *
- * @param cls the 'struct IterationContext'
- * @param hc peer identity, not used
- * @param value the 'struct PeerRecord'
- * @return GNUNET_YES (continue iteration)
- */
-static int
-iterate_peers (void *cls,
- const GNUNET_HashCode *hc,
- void *value)
-{
- struct IterationContext *ic = cls;
- struct PeerRecord *pr = value;
-
- ic->peer_cb (ic->cb_cls,
- &pr->peer,
- NULL /* FIXME: pass atsi? */);
- return GNUNET_YES;
-}
-
-
-/**
- * Obtain statistics and/or change preferences for the given peer.
- *
- * @param h handle to core
- * @param peer_cb function to call with the peer information
- * @param cb_cls closure for peer_cb
- * @return GNUNET_OK if iterating, GNUNET_SYSERR on error
- */
-int
-GNUNET_CORE_iterate_peers (struct GNUNET_CORE_Handle *h,
- GNUNET_CORE_ConnectEventHandler peer_cb,
- void *cb_cls)
-{
- struct IterationContext ic;
-
- ic.peer_cb = peer_cb;
- ic.cb_cls = cb_cls;
- GNUNET_CONTAINER_multihashmap_iterate (h->peers,
- &iterate_peers,
- &ic);
- return GNUNET_OK;
-}
-
-