-avoid side-effect in assertion
[oweals/gnunet.git] / src / testbed / testbed.h
index c94e6a54b1145db245c470fb76e5d0aa15d9c278..904e7acbaa1a568df40d8e03babcb5d224ce0226 100644 (file)
@@ -1,6 +1,6 @@
 /*
       This file is part of GNUnet
-      (C) 2012 Christian Grothoff (and other contributing authors)
+      (C) 2008--2013 Christian Grothoff (and other contributing authors)
 
       GNUnet is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published
@@ -133,34 +133,6 @@ struct GNUNET_TESTBED_HostConfirmedMessage
 };
 
 
-/**
- * Message to testing service: configure service sharing
- * at a host.
- */
-struct GNUNET_TESTBED_ConfigureSharedServiceMessage
-{
-
-  /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHARE_SERVICE
-   */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * Host that is being configured.
-   */
-  uint32_t host_id GNUNET_PACKED;
-
-  /**
-   * Number of peers that should share a service instance;
-   * 1 for no sharing, 0 to forcefully disable the service.
-   */
-  uint32_t num_peers GNUNET_PACKED;
-
-  /* followed by 0-terminated name of the service */
-
-};
-
-
 /**
  * Client notifies controller that it should delegate
  * requests for a particular client to a particular
@@ -189,20 +161,12 @@ struct GNUNET_TESTBED_ControllerLinkRequest
    */
   uint32_t slave_host_id GNUNET_PACKED;
 
-  /**
-   * The size of the uncompressed configuration
-   */
-  uint16_t config_size GNUNET_PACKED;
-
   /**
    * Set to 1 if the receiving controller is the master controller for
    * the slave host (and thus responsible for starting it?). 0 if not
    */
   uint8_t is_subordinate;
 
-  /* followed by serialized slave configuration;
-   * gzip'ed configuration file in INI format */
-
 };
 
 
@@ -255,14 +219,14 @@ struct GNUNET_TESTBED_PeerCreateMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * Unique operation id
+   * On which host should the peer be started?
    */
-  uint64_t operation_id GNUNET_PACKED;
+  uint32_t host_id GNUNET_PACKED;
 
   /**
-   * On which host should the peer be started?
+   * Unique operation id
    */
-  uint32_t host_id GNUNET_PACKED;
+  uint64_t operation_id GNUNET_PACKED;
 
   /**
    * Unique ID for the peer.
@@ -272,7 +236,7 @@ struct GNUNET_TESTBED_PeerCreateMessage
   /**
    * Size of the uncompressed configuration
    */
-  uint32_t config_size GNUNET_PACKED;
+  uint16_t config_size GNUNET_PACKED;
 
   /* followed by serialized peer configuration;
    * gzip'ed configuration file in INI format */
@@ -288,7 +252,7 @@ struct GNUNET_TESTBED_PeerReconfigureMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER
    */
   struct GNUNET_MessageHeader header;
 
@@ -302,6 +266,11 @@ struct GNUNET_TESTBED_PeerReconfigureMessage
    */
   uint64_t operation_id GNUNET_PACKED;
 
+  /**
+   * The length of the serialized configuration when uncompressed
+   */
+  uint16_t config_size GNUNET_PACKED;
+
   /* followed by serialized peer configuration;
    * gzip'ed configuration file in INI format */
 
@@ -751,6 +720,54 @@ struct GNUNET_TESTBED_SlaveConfiguration
 };
 
 
+/**
+ * Shutdown peers message
+ */
+struct GNUNET_TESTBED_ShutdownPeersMessage
+{
+  /**
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Operation ID
+   */
+  uint64_t operation_id GNUNET_PACKED;
+};
+
+
+/**
+ * Message to start/stop services of a peer
+ */
+struct GNUNET_TESTBED_ManagePeerServiceMessage
+{
+  /**
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Unique ID of the peer whose service has to be managed.
+   */
+  uint32_t peer_id GNUNET_PACKED;
+
+  /**
+   * Operation ID
+   */
+  uint64_t operation_id GNUNET_PACKED;
+
+  /**
+   * set this to 1 to start the service; 0 to stop the service
+   */
+  uint8_t start;
+  
+  /**
+   * The NULL-terminated name of the service to start/stop follows here
+   */
+};
+
+
 GNUNET_NETWORK_STRUCT_END
 #endif
 /* end of testbed.h */