+/**
+ * Kill a #Slave object
+ *
+ * @param slave the #Slave object
+ */
+static void
+kill_slave (struct Slave *slave)
+{
+ struct HostRegistration *hr_entry;
+
+ while (NULL != (hr_entry = slave->hr_dll_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (slave->hr_dll_head, slave->hr_dll_tail,
+ hr_entry);
+ GNUNET_free (hr_entry);
+ }
+ if (NULL != slave->rhandle)
+ GNUNET_TESTBED_cancel_registration (slave->rhandle);
+ GNUNET_assert (GNUNET_SYSERR !=
+ GNUNET_CONTAINER_multihashmap_iterate (slave->reghost_map,
+ reghost_free_iterator,
+ slave));
+ GNUNET_CONTAINER_multihashmap_destroy (slave->reghost_map);
+ if (NULL != slave->controller)
+ GNUNET_TESTBED_controller_disconnect (slave->controller);
+ if (NULL != slave->controller_proc)
+ {
+ LOG_DEBUG ("Stopping a slave\n");
+ GNUNET_TESTBED_controller_kill_ (slave->controller_proc);
+ }
+}
+
+
+/**
+ * Destroy a #Slave object
+ *
+ * @param slave the #Slave object
+ */
+static void
+destroy_slave (struct Slave *slave)
+{
+ if (NULL != slave->controller_proc)
+ {
+ GNUNET_TESTBED_controller_destroy_ (slave->controller_proc);
+ LOG_DEBUG ("Slave stopped\n");
+ }
+ GST_slave_list[slave->host_id] = NULL;
+ GNUNET_free (slave);
+}
+
+