From 6ba4e3ed384f9c3e5afd6595b6c0ca42be55f336 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Wed, 16 Feb 2011 16:25:01 +0000 Subject: [PATCH] add specific peer check to core iteration api --- src/include/gnunet_core_service.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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. -- 2.25.1