wip
[oweals/gnunet.git] / src / include / gnunet_testing_lib.h
index af57613c60488d3df380000f64df5e1de8e29389..8c76457e3f050abfbf5a29d69ba9208450f07f6e 100644 (file)
@@ -300,6 +300,12 @@ struct GNUNET_TESTING_Daemon
    */
   int dead;
 
+  /**
+   * GNUNET_YES if the hostkey has been created
+   * for this peer, GNUNET_NO otherwise.
+   */
+  int have_hostkey;
+
   /**
    * PID of the process that we started last.
    */
@@ -412,6 +418,8 @@ typedef void (*GNUNET_TESTING_NotifyTopology)(void *cls,
  *
  * @param cfg configuration to use
  * @param timeout how long to wait starting up peers
+ * @param pretend GNUNET_YES to set up files but not start peer GNUNET_NO
+ *                to really start the peer (default)
  * @param hostname name of the machine where to run GNUnet
  *        (use NULL for localhost).
  * @param ssh_username ssh username to use when connecting to hostname
@@ -428,6 +436,7 @@ typedef void (*GNUNET_TESTING_NotifyTopology)(void *cls,
 struct GNUNET_TESTING_Daemon *
 GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
                              struct GNUNET_TIME_Relative timeout,
+                             int pretend,
                              const char *hostname,
                              const char *ssh_username,
                              uint16_t sshport,
@@ -961,6 +970,33 @@ GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg,
                             GNUNET_TESTING_NotifyCompletion cb,
                             void *cb_cls);
 
+/**
+ * Start a peer group with a given number of peers.  Notify
+ * on completion of peer startup and connection based on given
+ * topological constraints.  Optionally notify on each
+ * established connection.
+ *
+ * @param cfg configuration template to use
+ * @param total number of daemons to start
+ * @param timeout total time allowed for peers to start
+ * @param connect_cb function to call each time two daemons are connected
+ * @param peergroup_cb function to call once all peers are up and connected
+ * @param peergroup_cls closure for peergroup callbacks
+ * @param hostnames linked list of host structs to use to start peers on
+ *                  (NULL to run on localhost only)
+ *
+ * @return NULL on error, otherwise handle to control peer group
+ */
+struct GNUNET_TESTING_PeerGroup *
+GNUNET_TESTING_peergroup_start(
+                               const struct GNUNET_CONFIGURATION_Handle *cfg,
+                               unsigned int total,
+                               struct GNUNET_TIME_Relative timeout,
+                               GNUNET_TESTING_NotifyConnection connect_cb,
+                               GNUNET_TESTING_NotifyCompletion peergroup_cb,
+                               void *peergroup_cls,
+                               const struct GNUNET_TESTING_Host *hostnames);
+
 
 #if 0                           /* keep Emacsens' auto-indent happy */
 {