clique topology
[oweals/gnunet.git] / src / testbed / testbed.h
index caeed6e08bddf4d6784e5522ad0f8968d51a69c2..9274846ca0a752b61e197456bff8daeaad649354 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "gnunet_util_lib.h"
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
  * Initial message from a client to a testing control service.
@@ -103,7 +104,7 @@ struct GNUNET_TESTBED_HostConfirmedMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOSTSUCCESS
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOSTCONFIRMED
    */
   struct GNUNET_MessageHeader header;
 
@@ -113,8 +114,7 @@ struct GNUNET_TESTBED_HostConfirmedMessage
   uint32_t host_id GNUNET_PACKED;
 
   /* followed by the 0-terminated error message (on failure)
-   * (typical errors include failure to login and
-   * host-id already in use) */
+   * (typical errors include host-id already in use) */
 
 };
 
@@ -397,6 +397,45 @@ struct GNUNET_TESTBED_OverlayConnectMessage
    */
   uint32_t peer2 GNUNET_PACKED;
 
+  /**
+   * The ID of the host which runs peer2
+   */
+  uint32_t peer2_host_id GNUNET_PACKED;
+
+};
+
+
+/**
+ * Message sent from host controller of a peer(A) to the host controller of
+ * another peer(B) to request B to connect to A
+ */
+struct GNUNET_TESTBED_RequestConnectMessage
+{
+  /**
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The Unique ID of B
+   */
+  uint32_t peer GNUNET_PACKED;
+
+  /**
+   * The Operation ID that is used to identify this operation
+   */
+  uint64_t operation_id GNUNET_PACKED;
+
+  /**
+   * Identity of A
+   */
+  struct GNUNET_PeerIdentity peer_identity;
+  
+  /**
+   * To be followed by the HELLO message of A
+   */
+  struct GNUNET_MessageHeader hello[0];
+  
 };
 
 
@@ -477,7 +516,7 @@ struct GNUNET_TESTBED_OperationFailureEventMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONEVENT
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT
    */
   struct GNUNET_MessageHeader header;
 
@@ -548,8 +587,6 @@ struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
 };
 
 
-
-
 /**
  * Message sent from client to testing service to
  * obtain the configuration of a peer.
@@ -575,9 +612,8 @@ struct GNUNET_TESTBED_PeerGetConfigurationMessage
 };
 
 
-
 /**
- * Event notification from a controller to a client.
+ * Peer configuration and identity reply from controller to a client.
  */
 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
 {
@@ -605,11 +641,90 @@ struct GNUNET_TESTBED_PeerConfigurationInformationMessage
   /**
    * The size of configuration when uncompressed
    */
-  uint16_t config_size;
+  uint16_t config_size GNUNET_PACKED;
 
   /* followed by gzip-compressed configuration of the peer */
 
 };
 
 
+/**
+ * Message to request configuration of a slave controller
+ */
+struct GNUNET_TESTBED_SlaveGetConfigurationMessage
+{
+  /**
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETSLAVECONFIG
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The id of the slave host
+   */
+  uint32_t slave_id GNUNET_PACKED;
+
+  /**
+   * Operation ID
+   */
+  uint64_t operation_id GNUNET_PACKED;
+
+};
+
+
+/**
+ * Reply to GETSLAVECONFIG message
+ */
+struct GNUNET_TESTBED_SlaveConfiguration
+{
+  /**
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVECONFIG
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The id of the host where the slave is running
+   */
+  uint32_t slave_id GNUNET_PACKED;
+
+  /**
+   * Operation ID
+   */
+  uint64_t operation_id GNUNET_PACKED;
+
+  /**
+   * The size of the configuration when uncompressed
+   */
+  uint16_t config_size GNUNET_PACKED;
+
+  /* followed by gzip-compressed configuration of the peer */
+
+};
+
+
+/**
+ * Message sent from a controller to the testbed API seeking the configuration
+ * of the host whose id is contained in the message.
+ */
+struct GNUNET_TESTBED_NeedControllerConfig
+{
+  /**
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The id of the controller host
+   */
+  uint32_t controller_host_id GNUNET_PACKED;
+
+  /**
+   * Operation ID
+   */
+  uint64_t operation_id GNUNET_PACKED;
+
+};
+
+GNUNET_NETWORK_STRUCT_END
+
 #endif
+/* end of testbed.h */