add specific peer check to core iteration api
authorNathan S. Evans <evans@in.tum.de>
Wed, 16 Feb 2011 16:25:01 +0000 (16:25 +0000)
committerNathan S. Evans <evans@in.tum.de>
Wed, 16 Feb 2011 16:25:01 +0000 (16:25 +0000)
src/include/gnunet_core_service.h

index b93c86b795fef35780df0dc0ac7220d2f74c08f3..5664d34fcf845573f391a12599d37f06d5169888 100644 (file)
@@ -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.