diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-10 14:25:55 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-10 14:25:55 +0000 |
commit | f4446e40904ba3f3177a8eaf1f9756e48dcc03a9 (patch) | |
tree | d854bfd39195ec0605f75b049641d4fec3310e58 /src | |
parent | bcb48ad6fa905f02703fcbd53d74326c51730afc (diff) | |
download | gnunet-f4446e40904ba3f3177a8eaf1f9756e48dcc03a9.tar.gz gnunet-f4446e40904ba3f3177a8eaf1f9756e48dcc03a9.zip |
- use host's configuration while connecting to controller
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_testbed_service.h | 14 | ||||
-rw-r--r-- | src/regex/gnunet-regex-profiler.c | 2 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_links.c | 4 | ||||
-rw-r--r-- | src/testbed/test_testbed_api.c | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_2peers_1controller.c | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_3peers_3controllers.c | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_controllerlink.c | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 5 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 3 |
9 files changed, 19 insertions, 17 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 522484821..61b347e78 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -447,7 +447,10 @@ typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls, | |||
447 | * @param cfg template configuration to use for the remote controller; the | 447 | * @param cfg template configuration to use for the remote controller; the |
448 | * remote controller will be started with a slightly modified | 448 | * remote controller will be started with a slightly modified |
449 | * configuration (port numbers, unix domain sockets and service home | 449 | * configuration (port numbers, unix domain sockets and service home |
450 | * values are changed as per TESTING library on the remote host) | 450 | * values are changed as per TESTING library on the remote host). The |
451 | * modified configuration replaces the host's existing configuration | ||
452 | * before signalling success through the | ||
453 | * GNUNET_TESTBED_ControllerStatusCallback() | ||
451 | * @param cb function called when the controller is successfully started or | 454 | * @param cb function called when the controller is successfully started or |
452 | * dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be | 455 | * dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be |
453 | * called if cb is called with GNUNET_SYSERR as status. Will never be | 456 | * called if cb is called with GNUNET_SYSERR as status. Will never be |
@@ -478,10 +481,10 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc); | |||
478 | 481 | ||
479 | 482 | ||
480 | /** | 483 | /** |
481 | * Connect to a controller process using the given configuration at the | 484 | * Connect to a controller process. The configuration to use for the connection |
482 | * given host. | 485 | * is retreived from the given host where a controller is started using |
486 | * GNUNET_TESTBED_controller_start(). | ||
483 | * | 487 | * |
484 | * @param cfg configuration to use | ||
485 | * @param host host to run the controller on; This should be the same host if | 488 | * @param host host to run the controller on; This should be the same host if |
486 | * the controller was previously started with | 489 | * the controller was previously started with |
487 | * GNUNET_TESTBED_controller_start; NULL for localhost | 490 | * GNUNET_TESTBED_controller_start; NULL for localhost |
@@ -495,8 +498,7 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc); | |||
495 | * @return handle to the controller | 498 | * @return handle to the controller |
496 | */ | 499 | */ |
497 | struct GNUNET_TESTBED_Controller * | 500 | struct GNUNET_TESTBED_Controller * |
498 | GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 501 | GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, |
499 | struct GNUNET_TESTBED_Host *host, | ||
500 | uint64_t event_mask, | 502 | uint64_t event_mask, |
501 | GNUNET_TESTBED_ControllerCallback cc, | 503 | GNUNET_TESTBED_ControllerCallback cc, |
502 | void *cc_cls); | 504 | void *cc_cls); |
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index 25fb4b6a3..b53209457 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c | |||
@@ -1805,7 +1805,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int stat | |||
1805 | event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); | 1805 | event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); |
1806 | event_mask |= (1LL << GNUNET_TESTBED_ET_DISCONNECT); | 1806 | event_mask |= (1LL << GNUNET_TESTBED_ET_DISCONNECT); |
1807 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); | 1807 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); |
1808 | mc = GNUNET_TESTBED_controller_connect (config, hosts[0], event_mask, | 1808 | mc = GNUNET_TESTBED_controller_connect (hosts[0], event_mask, |
1809 | &controller_event_cb, NULL); | 1809 | &controller_event_cb, NULL); |
1810 | if (NULL == mc) | 1810 | if (NULL == mc) |
1811 | { | 1811 | { |
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c index 6f71d8a61..0e2a88c40 100644 --- a/src/testbed/gnunet-service-testbed_links.c +++ b/src/testbed/gnunet-service-testbed_links.c | |||
@@ -520,7 +520,7 @@ slave_status_callback (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
520 | goto clean_lcc; | 520 | goto clean_lcc; |
521 | } | 521 | } |
522 | slave->controller = | 522 | slave->controller = |
523 | GNUNET_TESTBED_controller_connect (cfg, GST_host_list[slave->host_id], | 523 | GNUNET_TESTBED_controller_connect (GST_host_list[slave->host_id], |
524 | EVENT_MASK, &slave_event_callback, | 524 | EVENT_MASK, &slave_event_callback, |
525 | slave); | 525 | slave); |
526 | if (NULL != slave->controller) | 526 | if (NULL != slave->controller) |
@@ -644,7 +644,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
644 | if (1 != msg->is_subordinate) | 644 | if (1 != msg->is_subordinate) |
645 | { | 645 | { |
646 | slave->controller = | 646 | slave->controller = |
647 | GNUNET_TESTBED_controller_connect (cfg, GST_host_list[slave->host_id], | 647 | GNUNET_TESTBED_controller_connect (GST_host_list[slave->host_id], |
648 | EVENT_MASK, &slave_event_callback, | 648 | EVENT_MASK, &slave_event_callback, |
649 | slave); | 649 | slave); |
650 | if (NULL != slave->controller) | 650 | if (NULL != slave->controller) |
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c index 2e18f3411..e579536c0 100644 --- a/src/testbed/test_testbed_api.c +++ b/src/testbed/test_testbed_api.c | |||
@@ -423,7 +423,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg_, int status | |||
423 | event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT); | 423 | event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT); |
424 | event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED); | 424 | event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED); |
425 | controller = | 425 | controller = |
426 | GNUNET_TESTBED_controller_connect (cfg_, host, event_mask, &controller_cb, | 426 | GNUNET_TESTBED_controller_connect (host, event_mask, &controller_cb, |
427 | NULL); | 427 | NULL); |
428 | FAIL_TEST (NULL != controller, return); | 428 | FAIL_TEST (NULL != controller, return); |
429 | neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0); | 429 | neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0); |
diff --git a/src/testbed/test_testbed_api_2peers_1controller.c b/src/testbed/test_testbed_api_2peers_1controller.c index 4907be746..5f7bd3de7 100644 --- a/src/testbed/test_testbed_api_2peers_1controller.c +++ b/src/testbed/test_testbed_api_2peers_1controller.c | |||
@@ -469,7 +469,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg_, int status | |||
469 | event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT); | 469 | event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT); |
470 | event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED); | 470 | event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED); |
471 | controller = | 471 | controller = |
472 | GNUNET_TESTBED_controller_connect (cfg_, host, event_mask, &controller_cb, | 472 | GNUNET_TESTBED_controller_connect (host, event_mask, &controller_cb, |
473 | NULL); | 473 | NULL); |
474 | FAIL_TEST (NULL != controller); | 474 | FAIL_TEST (NULL != controller); |
475 | neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0); | 475 | neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0); |
diff --git a/src/testbed/test_testbed_api_3peers_3controllers.c b/src/testbed/test_testbed_api_3peers_3controllers.c index 0a416145e..48e60f108 100644 --- a/src/testbed/test_testbed_api_3peers_3controllers.c +++ b/src/testbed/test_testbed_api_3peers_3controllers.c | |||
@@ -803,7 +803,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, | |||
803 | { | 803 | { |
804 | case INIT: | 804 | case INIT: |
805 | controller1 = | 805 | controller1 = |
806 | GNUNET_TESTBED_controller_connect (config, host, event_mask, | 806 | GNUNET_TESTBED_controller_connect (host, event_mask, |
807 | &controller_cb, NULL); | 807 | &controller_cb, NULL); |
808 | if (NULL == controller1) | 808 | if (NULL == controller1) |
809 | { | 809 | { |
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c index 483127795..7475cd0e2 100644 --- a/src/testbed/test_testbed_api_controllerlink.c +++ b/src/testbed/test_testbed_api_controllerlink.c | |||
@@ -658,7 +658,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, | |||
658 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP); | 658 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP); |
659 | event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT); | 659 | event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT); |
660 | event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED); | 660 | event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED); |
661 | mc = GNUNET_TESTBED_controller_connect (config, host, event_mask, | 661 | mc = GNUNET_TESTBED_controller_connect (host, event_mask, |
662 | &controller_cb, NULL); | 662 | &controller_cb, NULL); |
663 | FAIL_TEST (NULL != mc); | 663 | FAIL_TEST (NULL != mc); |
664 | result = MASTER_STARTED; | 664 | result = MASTER_STARTED; |
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 95ff9e432..faaa739cc 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -1346,19 +1346,20 @@ oprelease_get_slave_config (void *cls) | |||
1346 | * @return handle to the controller | 1346 | * @return handle to the controller |
1347 | */ | 1347 | */ |
1348 | struct GNUNET_TESTBED_Controller * | 1348 | struct GNUNET_TESTBED_Controller * |
1349 | GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle | 1349 | GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, |
1350 | *cfg, struct GNUNET_TESTBED_Host *host, | ||
1351 | uint64_t event_mask, | 1350 | uint64_t event_mask, |
1352 | GNUNET_TESTBED_ControllerCallback cc, | 1351 | GNUNET_TESTBED_ControllerCallback cc, |
1353 | void *cc_cls) | 1352 | void *cc_cls) |
1354 | { | 1353 | { |
1355 | struct GNUNET_TESTBED_Controller *controller; | 1354 | struct GNUNET_TESTBED_Controller *controller; |
1356 | struct GNUNET_TESTBED_InitMessage *msg; | 1355 | struct GNUNET_TESTBED_InitMessage *msg; |
1356 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
1357 | const char *controller_hostname; | 1357 | const char *controller_hostname; |
1358 | unsigned long long max_parallel_operations; | 1358 | unsigned long long max_parallel_operations; |
1359 | unsigned long long max_parallel_service_connections; | 1359 | unsigned long long max_parallel_service_connections; |
1360 | unsigned long long max_parallel_topology_config_operations; | 1360 | unsigned long long max_parallel_topology_config_operations; |
1361 | 1361 | ||
1362 | GNUNET_assert (NULL != (cfg = GNUNET_TESTBED_host_get_cfg_ (host))); | ||
1362 | if (GNUNET_OK != | 1363 | if (GNUNET_OK != |
1363 | GNUNET_CONFIGURATION_get_value_number (cfg, "testbed", | 1364 | GNUNET_CONFIGURATION_get_value_number (cfg, "testbed", |
1364 | "MAX_PARALLEL_OPERATIONS", | 1365 | "MAX_PARALLEL_OPERATIONS", |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 280b4d803..57d57050a 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -875,8 +875,7 @@ controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
875 | if (rc->topology < GNUNET_TESTBED_TOPOLOGY_NONE) | 875 | if (rc->topology < GNUNET_TESTBED_TOPOLOGY_NONE) |
876 | event_mask |= GNUNET_TESTBED_ET_CONNECT; | 876 | event_mask |= GNUNET_TESTBED_ET_CONNECT; |
877 | rc->c = | 877 | rc->c = |
878 | GNUNET_TESTBED_controller_connect (rc->cfg, rc->h, event_mask, &event_cb, | 878 | GNUNET_TESTBED_controller_connect (rc->h, event_mask, &event_cb, rc); |
879 | rc); | ||
880 | if (0 < rc->num_hosts) | 879 | if (0 < rc->num_hosts) |
881 | { | 880 | { |
882 | rc->reg_hosts = 0; | 881 | rc->reg_hosts = 0; |