diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-11 13:48:13 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-11 13:48:13 +0000 |
commit | 4ab00798bd41084fea7dd1361c5ebfe5771e315b (patch) | |
tree | f1faf214501b6c0b2b26aea8d1c2046f862dfa6a /src/testbed/testbed_api_testbed.c | |
parent | 19a850a8d8723fb70ce265304590d390f6782557 (diff) | |
download | gnunet-4ab00798bd41084fea7dd1361c5ebfe5771e315b.tar.gz gnunet-4ab00798bd41084fea7dd1361c5ebfe5771e315b.zip |
fix 2689
Diffstat (limited to 'src/testbed/testbed_api_testbed.c')
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 3617f9a3d..a6beb6aff 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -163,14 +163,14 @@ struct RunContext | |||
163 | void *cc_cls; | 163 | void *cc_cls; |
164 | 164 | ||
165 | /** | 165 | /** |
166 | * Master task to call when testbed initialization is done | 166 | * TestMaster callback to call when testbed initialization is done |
167 | */ | 167 | */ |
168 | GNUNET_SCHEDULER_Task master; | 168 | GNUNET_TESTBED_TestMaster test_master; |
169 | 169 | ||
170 | /** | 170 | /** |
171 | * The closure for the master task | 171 | * The closure for the TestMaster callback |
172 | */ | 172 | */ |
173 | void *master_cls; | 173 | void *test_master_cls; |
174 | 174 | ||
175 | /** | 175 | /** |
176 | * The head element of DLL operations | 176 | * The head element of DLL operations |
@@ -493,9 +493,8 @@ call_master (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
493 | GNUNET_TESTBED_operation_done (rc->topology_operation); | 493 | GNUNET_TESTBED_operation_done (rc->topology_operation); |
494 | rc->topology_operation = NULL; | 494 | rc->topology_operation = NULL; |
495 | } | 495 | } |
496 | if (NULL != rc->master) | 496 | if (NULL != rc->test_master) |
497 | GNUNET_SCHEDULER_add_continuation (rc->master, rc->master_cls, | 497 | rc->test_master (rc->test_master_cls, rc->num_peers, rc->peers); |
498 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
499 | } | 498 | } |
500 | 499 | ||
501 | 500 | ||
@@ -645,7 +644,7 @@ event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | |||
645 | } | 644 | } |
646 | 645 | ||
647 | call_cc: | 646 | call_cc: |
648 | if ((0 != (rc->event_mask && (1LL << event->type))) && (NULL != rc->cc)) | 647 | if ((0 != (rc->event_mask & (1LL << event->type))) && (NULL != rc->cc)) |
649 | rc->cc (rc->cc_cls, event); | 648 | rc->cc (rc->cc_cls, event); |
650 | if (GNUNET_TESTBED_ET_PEER_START != event->type) | 649 | if (GNUNET_TESTBED_ET_PEER_START != event->type) |
651 | return; | 650 | return; |
@@ -809,6 +808,7 @@ controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
809 | event_mask = rc->event_mask; | 808 | event_mask = rc->event_mask; |
810 | event_mask |= (1LL << GNUNET_TESTBED_ET_PEER_STOP); | 809 | event_mask |= (1LL << GNUNET_TESTBED_ET_PEER_STOP); |
811 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); | 810 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); |
811 | event_mask |= (1LL << GNUNET_TESTBED_ET_PEER_START); | ||
812 | if (rc->topology < GNUNET_TESTBED_TOPOLOGY_NONE) | 812 | if (rc->topology < GNUNET_TESTBED_TOPOLOGY_NONE) |
813 | event_mask |= GNUNET_TESTBED_ET_CONNECT; | 813 | event_mask |= GNUNET_TESTBED_ET_CONNECT; |
814 | rc->c = | 814 | rc->c = |
@@ -909,15 +909,16 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, int status | |||
909 | * set in the event_mask as this is the only way get access to the | 909 | * set in the event_mask as this is the only way get access to the |
910 | * handle of each peer | 910 | * handle of each peer |
911 | * @param cc_cls closure for cc | 911 | * @param cc_cls closure for cc |
912 | * @param master task to run once the testbed is ready | 912 | * @param test_master this callback will be called once the test is ready |
913 | * @param master_cls | 913 | * @param test_master_cls closure for 'test_master'. |
914 | */ | 914 | */ |
915 | void | 915 | void |
916 | GNUNET_TESTBED_run (const char *host_filename, | 916 | GNUNET_TESTBED_run (const char *host_filename, |
917 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 917 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
918 | unsigned int num_peers, uint64_t event_mask, | 918 | unsigned int num_peers, uint64_t event_mask, |
919 | GNUNET_TESTBED_ControllerCallback cc, void *cc_cls, | 919 | GNUNET_TESTBED_ControllerCallback cc, void *cc_cls, |
920 | GNUNET_SCHEDULER_Task master, void *master_cls) | 920 | GNUNET_TESTBED_TestMaster test_master, |
921 | void *test_master_cls) | ||
921 | { | 922 | { |
922 | struct RunContext *rc; | 923 | struct RunContext *rc; |
923 | char *topology; | 924 | char *topology; |
@@ -945,11 +946,10 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
945 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); | 946 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); |
946 | rc->num_peers = num_peers; | 947 | rc->num_peers = num_peers; |
947 | rc->event_mask = event_mask; | 948 | rc->event_mask = event_mask; |
948 | rc->event_mask |= (1LL << GNUNET_TESTBED_ET_PEER_START); | ||
949 | rc->cc = cc; | 949 | rc->cc = cc; |
950 | rc->cc_cls = cc_cls; | 950 | rc->cc_cls = cc_cls; |
951 | rc->master = master; | 951 | rc->test_master = test_master; |
952 | rc->master_cls = master_cls; | 952 | rc->test_master_cls = test_master_cls; |
953 | rc->state = RC_INIT; | 953 | rc->state = RC_INIT; |
954 | rc->topology = GNUNET_TESTBED_TOPOLOGY_NONE; | 954 | rc->topology = GNUNET_TESTBED_TOPOLOGY_NONE; |
955 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (rc->cfg, "testbed", | 955 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (rc->cfg, "testbed", |