* @param cfg template configuration to use for the remote controller; the
* remote controller will be started with a slightly modified
* configuration (port numbers, unix domain sockets and service home
- * values are changed as per TESTING library on the remote host)
+ * values are changed as per TESTING library on the remote host). The
+ * modified configuration replaces the host's existing configuration
+ * before signalling success through the
+ * GNUNET_TESTBED_ControllerStatusCallback()
* @param cb function called when the controller is successfully started or
* dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be
* called if cb is called with GNUNET_SYSERR as status. Will never be
/**
- * Connect to a controller process using the given configuration at the
- * given host.
+ * Connect to a controller process. The configuration to use for the connection
+ * is retreived from the given host where a controller is started using
+ * GNUNET_TESTBED_controller_start().
*
- * @param cfg configuration to use
* @param host host to run the controller on; This should be the same host if
* the controller was previously started with
* GNUNET_TESTBED_controller_start; NULL for localhost
* @return handle to the controller
*/
struct GNUNET_TESTBED_Controller *
-GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TESTBED_Host *host,
+GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
uint64_t event_mask,
GNUNET_TESTBED_ControllerCallback cc,
void *cc_cls);
event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
event_mask |= (1LL << GNUNET_TESTBED_ET_DISCONNECT);
event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
- mc = GNUNET_TESTBED_controller_connect (config, hosts[0], event_mask,
+ mc = GNUNET_TESTBED_controller_connect (hosts[0], event_mask,
&controller_event_cb, NULL);
if (NULL == mc)
{
goto clean_lcc;
}
slave->controller =
- GNUNET_TESTBED_controller_connect (cfg, GST_host_list[slave->host_id],
+ GNUNET_TESTBED_controller_connect (GST_host_list[slave->host_id],
EVENT_MASK, &slave_event_callback,
slave);
if (NULL != slave->controller)
if (1 != msg->is_subordinate)
{
slave->controller =
- GNUNET_TESTBED_controller_connect (cfg, GST_host_list[slave->host_id],
+ GNUNET_TESTBED_controller_connect (GST_host_list[slave->host_id],
EVENT_MASK, &slave_event_callback,
slave);
if (NULL != slave->controller)
event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT);
event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED);
controller =
- GNUNET_TESTBED_controller_connect (cfg_, host, event_mask, &controller_cb,
+ GNUNET_TESTBED_controller_connect (host, event_mask, &controller_cb,
NULL);
FAIL_TEST (NULL != controller, return);
neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0);
event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT);
event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED);
controller =
- GNUNET_TESTBED_controller_connect (cfg_, host, event_mask, &controller_cb,
+ GNUNET_TESTBED_controller_connect (host, event_mask, &controller_cb,
NULL);
FAIL_TEST (NULL != controller);
neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0);
{
case INIT:
controller1 =
- GNUNET_TESTBED_controller_connect (config, host, event_mask,
+ GNUNET_TESTBED_controller_connect (host, event_mask,
&controller_cb, NULL);
if (NULL == controller1)
{
event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP);
event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT);
event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED);
- mc = GNUNET_TESTBED_controller_connect (config, host, event_mask,
+ mc = GNUNET_TESTBED_controller_connect (host, event_mask,
&controller_cb, NULL);
FAIL_TEST (NULL != mc);
result = MASTER_STARTED;
* @return handle to the controller
*/
struct GNUNET_TESTBED_Controller *
-GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle
- *cfg, struct GNUNET_TESTBED_Host *host,
+GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
uint64_t event_mask,
GNUNET_TESTBED_ControllerCallback cc,
void *cc_cls)
{
struct GNUNET_TESTBED_Controller *controller;
struct GNUNET_TESTBED_InitMessage *msg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
const char *controller_hostname;
unsigned long long max_parallel_operations;
unsigned long long max_parallel_service_connections;
unsigned long long max_parallel_topology_config_operations;
+ GNUNET_assert (NULL != (cfg = GNUNET_TESTBED_host_get_cfg_ (host)));
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg, "testbed",
"MAX_PARALLEL_OPERATIONS",
if (rc->topology < GNUNET_TESTBED_TOPOLOGY_NONE)
event_mask |= GNUNET_TESTBED_ET_CONNECT;
rc->c =
- GNUNET_TESTBED_controller_connect (rc->cfg, rc->h, event_mask, &event_cb,
- rc);
+ GNUNET_TESTBED_controller_connect (rc->h, event_mask, &event_cb, rc);
if (0 < rc->num_hosts)
{
rc->reg_hosts = 0;