removing remenants of abstract unix domain socket handling, this finishes addressing...
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed.h
index 149a1ad77979d115d02c179a93690da0906aea80..55861faba0fbd468d143bf0accdd913360391e48 100644 (file)
@@ -4,7 +4,7 @@
 
   GNUnet is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published
-  by the Free Software Foundation; either version 2, or (at your
+  by the Free Software Foundation; either version 3, or (at your
   option) any later version.
 
   GNUnet is distributed in the hope that it will be useful, but
@@ -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 *GST_config;
 
 /**
  * The master context; generated with the first INIT message
@@ -471,6 +454,11 @@ const extern struct GNUNET_TIME_Relative GST_timeout;
  */
 extern unsigned int GST_peer_list_size;
 
+/**
+ * The current number of peers running locally under this controller
+ */
+extern unsigned int GST_num_local_peers;
+
 /**
  * The size of the host list
  */
@@ -482,16 +470,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 +721,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 +788,13 @@ void
 GST_free_roccq ();
 
 
+/**
+ * Cleans up the Peer reconfigure context list
+ */
+void
+GST_free_prcq ();
+
+
 /**
  * Initializes the cache
  *