*/
SP_START_CORE,
+ /**
+ * CORE is up, now make sure we get the HELLO for this peer.
+ */
+ SP_GET_HELLO,
+
/**
* Core has notified us that we've established a connection to the service.
* The main FSM halts here and waits to be moved to UPDATE or CLEANUP.
*/
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.
*/
*
* @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
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,
* allowed to take?
* @param max_connect_attempts how many times should we try to reconnect
* (within timeout)
+ * @param send_hello GNUNET_YES to send the HELLO, GNUNET_NO to assume
+ * the HELLO has already been exchanged
* @param cb function to call at the end
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
- struct GNUNET_TESTING_Daemon *d2,
- struct GNUNET_TIME_Relative timeout,
- unsigned int max_connect_attempts,
- GNUNET_TESTING_NotifyConnection cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
+ struct GNUNET_TESTING_Daemon *d2,
+ struct GNUNET_TIME_Relative timeout,
+ unsigned int max_connect_attempts,
+ int send_hello,
+ GNUNET_TESTING_NotifyConnection cb,
+ void *cb_cls);
* @param cfg configuration template to use
* @param total number of daemons to start
* @param max_concurrent_connections for testing, how many peers can
- * we connect to simultaneously
+* we connect to simultaneously
+ * @param max_concurrent_ssh when starting with ssh, how many ssh
+ * connections will we allow at once (based on remote hosts allowed!)
* @param timeout total time allowed for peers to start
* @param hostkey_callback function to call on each peers hostkey generation
* if NULL, peers will be started by this call, if non-null,
GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
unsigned int total,
unsigned int max_concurrent_connections,
+ unsigned int max_concurrent_ssh,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyHostkeyCreated
hostkey_callback, void *hostkey_cls,
GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg,
GNUNET_TESTING_NotifyTopology cb, void *cls);
+/**
+ * Stop the connection process temporarily.
+ *
+ * @param pg the peer group to stop connecting
+ */
+void GNUNET_TESTING_stop_connections(struct GNUNET_TESTING_PeerGroup *pg);
+
+/**
+ * Resume the connection process.
+ *
+ * @param pg the peer group to resume connecting
+ */
+void GNUNET_TESTING_resume_connections(struct GNUNET_TESTING_PeerGroup *pg);
+
/**
* There are many ways to connect peers that are supported by this function.
* To connect peers in the same topology that was created via the
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 */
{