diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-07-11 13:10:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-07-11 13:10:26 +0000 |
commit | adc0e2a714e9a59f801ef2d93daa7f8fcb3091f8 (patch) | |
tree | 79c8bb79c23f96d5013a4e5910167fdd5fe72bb6 /src | |
parent | fd394923d6aaae8507fa1ecd101b671d791f2079 (diff) | |
download | gnunet-adc0e2a714e9a59f801ef2d93daa7f8fcb3091f8.tar.gz gnunet-adc0e2a714e9a59f801ef2d93daa7f8fcb3091f8.zip |
-breaking testbed again...
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_testbed_service.h | 30 | ||||
-rw-r--r-- | src/testbed/test_testbed_api.c | 4 |
2 files changed, 31 insertions, 3 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index e6997db1f..46be98b79 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -402,13 +402,39 @@ struct GNUNET_TESTBED_ControllerProc; | |||
402 | 402 | ||
403 | 403 | ||
404 | /** | 404 | /** |
405 | * Function called on errors with the controller. | ||
406 | * | ||
407 | * @param cls closure | ||
408 | * @param emsg error message if available; can be NULL, which does NOT mean | ||
409 | * that there was no error | ||
410 | */ | ||
411 | typedef void (*GNUNET_TESTBED_ControllerErrorCallback)(void *cls, | ||
412 | const char *emsg); | ||
413 | |||
414 | |||
415 | /** | ||
405 | * Starts a controller process at the host | 416 | * Starts a controller process at the host |
406 | * | 417 | * |
418 | * @param system used for reserving ports if host is NULL and to determine | ||
419 | * which 'host' to set as TRUSTED ('controller') when starting testbed remotely | ||
407 | * @param host the host where the controller has to be started; NULL for localhost | 420 | * @param host the host where the controller has to be started; NULL for localhost |
408 | * @return the controller process handle | 421 | * @param cfg template configuration to use for the remote controller; will |
422 | * be modified to contain the actual host/port/unixpath used for | ||
423 | * the testbed service | ||
424 | * @param cec function called if the contoller dies unexpectedly; will not be | ||
425 | * invoked after GNUNET_TESTBED_controller_stop, if 'cec' was called, | ||
426 | * GNUNET_TESTBED_controller_stop must no longer be called; will | ||
427 | * never be called in the same task as 'GNUNET_TESTBED_controller_start' | ||
428 | * (synchronous errors will be signalled by returning NULL) | ||
429 | * @param cec_cls closure for 'cec' | ||
430 | * @return the controller process handle, NULL on errors | ||
409 | */ | 431 | */ |
410 | struct GNUNET_TESTBED_ControllerProc * | 432 | struct GNUNET_TESTBED_ControllerProc * |
411 | GNUNET_TESTBED_controller_start (struct GNUNET_TESTBED_Host *host); | 433 | GNUNET_TESTBED_controller_start (struct GNUNET_TESTING_System *system, |
434 | struct GNUNET_TESTBED_Host *host, | ||
435 | struct GNUNET_CONFIGURATION_Handle *cfg, | ||
436 | GNUNET_TESTBED_ControllerErrorCallback cec, | ||
437 | void *cec_cls); | ||
412 | 438 | ||
413 | 439 | ||
414 | /** | 440 | /** |
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c index 6c50c93d7..1fdb7169a 100644 --- a/src/testbed/test_testbed_api.c +++ b/src/testbed/test_testbed_api.c | |||
@@ -182,11 +182,13 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
182 | const struct GNUNET_CONFIGURATION_Handle *config) | 182 | const struct GNUNET_CONFIGURATION_Handle *config) |
183 | { | 183 | { |
184 | uint64_t event_mask; | 184 | uint64_t event_mask; |
185 | struct GNUNET_CONFIGURATION_Handle *cdup; | ||
185 | 186 | ||
186 | cfg = config; | 187 | cfg = config; |
187 | host = GNUNET_TESTBED_host_create (NULL, NULL, 0); | 188 | host = GNUNET_TESTBED_host_create (NULL, NULL, 0); |
188 | GNUNET_assert (NULL != host); | 189 | GNUNET_assert (NULL != host); |
189 | cp = GNUNET_TESTBED_controller_start (host); | 190 | cdup = GNUNET_CONFIGURATION_dup (config); |
191 | cp = GNUNET_TESTBED_controller_start (system, host, cdup, NULL, NULL); | ||
190 | event_mask = 0; | 192 | event_mask = 0; |
191 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_START); | 193 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_START); |
192 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP); | 194 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP); |