From: Nathan S. Evans Date: Wed, 16 Feb 2011 16:25:01 +0000 (+0000) Subject: add specific peer check to core iteration api X-Git-Tag: initial-import-from-subversion-38251~19118 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6ba4e3ed384f9c3e5afd6595b6c0ca42be55f336;p=oweals%2Fgnunet.git add specific peer check to core iteration api --- diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index b93c86b79..5664d34fc 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h @@ -380,6 +380,25 @@ GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CORE_ConnectEventHandler peer_cb, void *cb_cls); +/** + * Iterate over all currently connected peers. + * Calls peer_cb with each connected peer, and then + * once with NULL to indicate that all peers have + * been handled. + * + * @param cfg configuration to use + * @param peer the specific peer to check for + * @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_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_PeerIdentity *peer, + GNUNET_CORE_ConnectEventHandler peer_cb, + void *cb_cls); + /** * Handle for a transmission request.