- for (c_m = 0; c_m < num_masters; c_m++)
- {
- if (NULL != mps[c_m].peer_id_op)
- {
- GNUNET_TESTBED_operation_done (mps[c_m].peer_id_op);
- mps[c_m].peer_id_op = NULL;
- }
-
- if (GNUNET_SCHEDULER_NO_TASK != mps[c_m].ats_task)
- GNUNET_SCHEDULER_cancel (mps[c_m].ats_task);
- mps[c_m].ats_task = GNUNET_SCHEDULER_NO_TASK;
-
- for (c_op = 0; c_op < num_slaves; c_op++)
- {
-
- if (NULL != mps[c_m].partners[c_op].cth)
- {
- GNUNET_CORE_notify_transmit_ready_cancel (mps[c_m].partners[c_op].cth);
- mps[c_m].partners[c_op].cth = NULL;
- }
-
- if (NULL != mps[c_m].core_connect_ops[c_op].connect_op)
- {
- GNUNET_log(GNUNET_ERROR_TYPE_INFO,
- _("Failed to connect peer 0 and %u\n"), c_op);
- GNUNET_TESTBED_operation_done (
- mps[c_m].core_connect_ops[c_op].connect_op);
- mps[c_m].core_connect_ops[c_op].connect_op = NULL;
- result = 1;
- }
- }
-
- if (NULL != mps[c_m].ats_perf_op)
- {
- GNUNET_TESTBED_operation_done (mps[c_m].ats_perf_op);
- mps[c_m].ats_perf_op = NULL;
- }
-
- if (NULL != mps[c_m].core_op)
- {
- GNUNET_TESTBED_operation_done (mps[c_m].core_op);
- mps[c_m].core_op = NULL;
- }
- GNUNET_free(mps[c_m].core_connect_ops);
- GNUNET_free(mps[c_m].partners);
- mps[c_m].partners = NULL;
- }
-
- for (c_s = 0; c_s < num_slaves; c_s++)
- {
- if (NULL != sps[c_s].peer_id_op)
- {
- GNUNET_TESTBED_operation_done (sps[c_s].peer_id_op);
- sps[c_s].peer_id_op = NULL;
- }
-
- for (c_op = 0; c_op < num_slaves; c_op++)
- {
- if (NULL != sps[c_s].partners[c_op].cth)
- {
- GNUNET_CORE_notify_transmit_ready_cancel (sps[c_s].partners[c_op].cth);
- sps[c_s].partners[c_op].cth = NULL;
- }
- }
-
- if (NULL != sps[c_s].ats_perf_op)
- {
- GNUNET_TESTBED_operation_done (sps[c_s].ats_perf_op);
- sps[c_s].ats_perf_op = NULL;
- }
- if (NULL != sps[c_s].core_op)
- {
- GNUNET_TESTBED_operation_done (sps[c_s].core_op);
- sps[c_s].core_op = NULL;
- }
-
- GNUNET_free(sps[c_s].partners);
- sps[c_s].partners = NULL;
- }
-
- GNUNET_SCHEDULER_shutdown ();
-}
-
-static struct BenchmarkPeer *
-find_peer (const struct GNUNET_PeerIdentity * peer)
-{
- int c_p;
-
- for (c_p = 0; c_p < num_masters; c_p++)
- {
- if (0 == memcmp (&mps[c_p].id, peer, sizeof(struct GNUNET_PeerIdentity)))
- return &mps[c_p];
- }
-
- for (c_p = 0; c_p < num_slaves; c_p++)
- {
- if (0 == memcmp (&sps[c_p].id, peer, sizeof(struct GNUNET_PeerIdentity)))
- return &sps[c_p];
- }
- return NULL ;
-}
-
-/**
- * Controller event callback
- *
- * @param cls NULL
- * @param event the controller event
- */
-static void
-controller_event_cb (void *cls,
- const struct GNUNET_TESTBED_EventInformation *event)
-{
- //struct BenchmarkPeer *p = cls;
- switch (event->type)
- {
- case GNUNET_TESTBED_ET_CONNECT:
- break;
- case GNUNET_TESTBED_ET_OPERATION_FINISHED:
- break;
- default:
- GNUNET_break(0);
- result = 2;
- GNUNET_SCHEDULER_cancel (shutdown_task);
- shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL );
- }