-peer review
[oweals/gnunet.git] / src / include / gnunet_testbed_service.h
index ca7230504af838fbe96bdce13629f1074d08e5c8..5563bd6be3088e6578ac6af6732bf3b22583466b 100644 (file)
@@ -118,7 +118,7 @@ GNUNET_TESTBED_host_create_with_id (uint32_t id,
  */
 unsigned int
 GNUNET_TESTBED_hosts_load_from_file (const char *filename,
-                                    struct GNUNET_TESTBED_Host **hosts);
+                                    struct GNUNET_TESTBED_Host ***hosts);
 
 
 /**
@@ -380,8 +380,7 @@ typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls,
 
 
 /**
- * Starts a controller process at the host. FIXME: add controller start callback
- * with the configuration with which the controller is started
+ * Starts a controller process at the host. 
  *
  * @param controller_ip the ip address of the controller. Will be set as TRUSTED
  *          host when starting testbed controller at host
@@ -735,9 +734,10 @@ typedef void (*GNUNET_TESTBED_PeerInfoCallback) (void *cb_cls,
 
 
 /**
- * Request information about a peer. The controller callback will be called with
- * event type GNUNET_TESTBED_ET_OPERATION_FINISHED when result for this
- * operation is available
+ * Request information about a peer. The controller callback will not be called
+ * with event type GNUNET_TESTBED_ET_OPERATION_FINISHED when result for this
+ * operation is available. Instead, the GNUNET_TESTBED_PeerInfoCallback() will
+ * be called.
  *
  * @param peer peer to request information about
  * @param pit desired information
@@ -1024,6 +1024,7 @@ GNUNET_TESTBED_overlay_configure_topology (void *op_cls,
  * Ask the testbed controller to write the current overlay topology to
  * a file.  Naturally, the file will only contain a snapshot as the
  * topology may evolve all the time.
+ * FIXME: needs continuation!?
  *
  * @param controller overlay controller to inspect
  * @param filename name of the file the topology should
@@ -1199,6 +1200,44 @@ void
 GNUNET_TESTBED_destroy (struct GNUNET_TESTBED_Testbed *testbed);
 
 
+/**
+ * Callback function to process statistic values from all peers.
+ *
+ * @param cls closure
+ * @param peer the peer the statistic belong to
+ * @param subsystem name of subsystem that created the statistic
+ * @param name the name of the datum
+ * @param value the current value
+ * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
+ * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ */
+typedef int (*GNUNET_TESTBED_StatisticsIterator) (void *cls,
+                                                 const struct GNUNET_TESTBED_Peer *peer,
+                                                 const char *subsystem,
+                                                 const char *name,
+                                                 uint64_t value,
+                                                 int is_persistent);
+
+
+/**
+ * Convenience method that iterates over all (running) peers 
+ * and retrieves all statistics from each peer.
+ *
+ * @param num_peers number of peers to iterate over
+ * @param peers array of peers to iterate over
+ * @param proc processing function for each statistic retrieved
+ * @param cont continuation to call once call is completed(?)
+ * @param cls closure to pass to proc and cont
+ * @return operation handle to cancel the operation
+ */
+struct GNUNET_TESTBED_Operation *
+GNUNET_TESTBED_get_statistics (unsigned int num_peers,
+                              struct GNUNET_TESTBED_Peer **peers,
+                               GNUNET_TESTBED_StatisticsIterator proc,
+                               GNUNET_TESTBED_OperationCompletionCallback cont,
+                               void *cls);
+
+
 /**
  * Convenience method for running a testbed with
  * a single call.  Underlay and overlay topology