- distribute peers equally among island nodes on SuperMUC
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed.h
index 149a1ad77979d115d02c179a93690da0906aea80..ceb209877f348a47924b8bc995a0b9804b5dd8c0 100644 (file)
@@ -260,7 +260,7 @@ struct Context
   /**
    * The network address of the master controller
    */
-  char *master_ip;
+  char *master_ips;
 
   /**
    * The TESTING system handle for starting peers locally
@@ -344,23 +344,6 @@ struct ForwardedOverlayConnectContext
 };
 
 
-/**
- * The type for data structures which commonly arrive at the slave_event_callback
- */
-enum ClosureType
-{
-  /**
-   * Type for RegisteredHostContext closures
-   */
-  CLOSURE_TYPE_RHC = 1,
-
-  /**
-   * Type for LinkControllersForwardingContext closures
-   */
-  CLOSURE_TYPE_LCF
-};
-
-
 /**
  * This context information will be created for each host that is registered at
  * slave controllers during overlay connects.
@@ -429,7 +412,7 @@ struct HandlerContext_ShutdownPeers
 /**
  * Our configuration
  */
-struct GNUNET_CONFIGURATION_Handle *our_config;
+extern struct GNUNET_CONFIGURATION_Handle *our_config;
 
 /**
  * The master context; generated with the first INIT message
@@ -482,16 +465,16 @@ extern unsigned int GST_host_list_size;
 extern char *GST_stats_dir;
 
 /**
- * Condition to check if host id is invalid
+ * Condition to check if host id is valid
  */
-#define INVALID_HOST_ID(id) \
-  ( ((id) >= GST_host_list_size) || (NULL == GST_host_list[id]) )
+#define VALID_HOST_ID(id) \
+  ( ((id) < GST_host_list_size) && (NULL != GST_host_list[id]) )
 
 /**
- * Condition to check if peer id is invalid
+ * Condition to check if peer id is valid
  */
-#define INVALID_PEER_ID(id) \
-  ( ((id) >= GST_peer_list_size) || (NULL == GST_peer_list[id]) )
+#define VALID_PEER_ID(id) \
+  ( ((id) < GST_peer_list_size) && (NULL != GST_peer_list[id]) )
 
 
 /**
@@ -733,6 +716,20 @@ GST_handle_manage_peer_service (void *cls, struct GNUNET_SERVER_Client *client,
                                 const struct GNUNET_MessageHeader *message);
 
 
+/**
+ * Handler for GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER type messages.
+ * Should stop the peer asyncronously, destroy it and create it again with the
+ * new configuration.
+ *
+ * @param cls NULL
+ * @param client identification of the client
+ * @param message the actual message
+ */
+void
+GST_handle_peer_reconfigure (void *cls, struct GNUNET_SERVER_Client *client,
+                             const struct GNUNET_MessageHeader *message);
+
+
 /**
  * Frees the ManageServiceContext queue
  */
@@ -786,6 +783,13 @@ void
 GST_free_roccq ();
 
 
+/**
+ * Cleans up the Peer reconfigure context list
+ */
+void
+GST_free_prcq ();
+
+
 /**
  * Initializes the cache
  *