unsigned long long max_concurrent_ssh;
struct GNUNET_TIME_Absolute timeout;
GNUNET_TESTING_NotifyConnection connect_cb;
- void *connect_cb_cls;
GNUNET_TESTING_NotifyCompletion peergroup_cb;
- void *peergroup_cb_cls;
+
+ /**
+ * Closure for all peergroup callbacks.
+ */
+ void *cls;
+
const struct GNUNET_TESTING_Host *hostnames;
enum GNUNET_TESTING_Topology topology;
{
struct PeerGroupStartupContext *pg_start_ctx = cls;
if (emsg != NULL)
- pg_start_ctx->peergroup_cb(pg_start_ctx->peergroup_cb_cls, emsg);
+ pg_start_ctx->peergroup_cb(pg_start_ctx->cls, emsg);
else
- pg_start_ctx->peergroup_cb(pg_start_ctx->peergroup_cb_cls, pg_start_ctx->fail_reason);
+ pg_start_ctx->peergroup_cb(pg_start_ctx->cls, pg_start_ctx->fail_reason);
}
/**
GNUNET_assert(pg_start_ctx->connect_meter != NULL);
if (pg_start_ctx->connect_cb != NULL)
- pg_start_ctx->connect_cb(pg_start_ctx->connect_cb_cls, first,
+ pg_start_ctx->connect_cb(pg_start_ctx->cls, first,
second,
distance,
first_cfg,
/* Call final callback, signifying that the peer group has been started and connected */
if (pg_start_ctx->peergroup_cb != NULL)
- pg_start_ctx->peergroup_cb(pg_start_ctx->peergroup_cb_cls, NULL);
+ pg_start_ctx->peergroup_cb(pg_start_ctx->cls, NULL);
}
}
* @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 connect_cb_cls closure for connect_callback
* @param peergroup_cb function to call once all peers are up and connected
- * @param peergroup_cb_cls closure for peergroup_cb
+ * @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)
- * @param verbose GNUNET_YES to print progress bars, GNUNET_NO otherwise
*
* @return NULL on error, otherwise handle to control peer group
*/
unsigned int total,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyConnection connect_cb,
- void *connect_cb_cls,
GNUNET_TESTING_NotifyCompletion peergroup_cb,
- void *peergroup_cb_cls,
- const struct GNUNET_TESTING_Host *hostnames,
- int verbose)
+ void *peergroup_cls,
+ const struct GNUNET_TESTING_Host *hostnames)
{
struct PeerGroupStartupContext *pg_start_ctx;
unsigned long long temp_config_number;
return NULL;
}
+ if (GNUNET_SYSERR == (pg_start_ctx->verbose = GNUNET_CONFIGURATION_get_value_yesno (cfg, "testing",
+ "use_progressbars")))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
+ "testing", "use_progressbars");
+ GNUNET_free(pg_start_ctx);
+ return NULL;
+ }
+
if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number (cfg, "testing",
"peergroup_timeout",
&temp_config_number))
pg_start_ctx->cfg = cfg;
pg_start_ctx->total = total;
pg_start_ctx->peers_left = total;
- pg_start_ctx->connect_cb = connect_cb_cls;
+ pg_start_ctx->connect_cb = connect_cb;
pg_start_ctx->peergroup_cb = peergroup_cb;
- pg_start_ctx->peergroup_cb_cls = peergroup_cb_cls;
+ pg_start_ctx->cls = peergroup_cls;
pg_start_ctx->hostnames = hostnames;
- pg_start_ctx->verbose = verbose;
pg_start_ctx->hostkey_meter = create_meter (pg_start_ctx->peers_left, "Hostkeys created ", pg_start_ctx->verbose);
pg_start_ctx->peer_start_meter = create_meter (pg_start_ctx->peers_left, "Peers started ", pg_start_ctx->verbose);
/* Make compilers happy */