Partial application of diff send in beberking, Issue #5476
[oweals/gnunet.git] / src / testbed / testbed.h
index 904e7acbaa1a568df40d8e03babcb5d224ce0226..5b01a8e7fa015e60d23005834a9f22b1722697d3 100644 (file)
@@ -1,21 +1,19 @@
 /*
       This file is part of GNUnet
-      (C) 2008--2013 Christian Grothoff (and other contributing authors)
+      Copyright (C) 2008--2013 GNUnet e.V.
 
-      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 3, or (at your
-      option) any later version.
+      GNUnet is free software: you can redistribute it and/or modify it
+      under the terms of the GNU Affero General Public License as published
+      by the Free Software Foundation, either version 3 of the License,
+      or (at your option) any later version.
 
       GNUnet is distributed in the hope that it will be useful, but
       WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      General Public License for more details.
-
-      You should have received a copy of the GNU General Public License
-      along with GNUnet; see the file COPYING.  If not, write to the
-      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-      Boston, MA 02111-1307, USA.
+      Affero General Public License for more details.
+     
+      You should have received a copy of the GNU Affero General Public License
+      along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /**
@@ -33,11 +31,11 @@ GNUNET_NETWORK_STRUCT_BEGIN
 /**
  * Initial message from a client to a testing control service.
  */
-    struct GNUNET_TESTBED_InitMessage
+struct GNUNET_TESTBED_InitMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_INIT
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_INIT
    */
   struct GNUNET_MessageHeader header;
 
@@ -66,7 +64,7 @@ struct GNUNET_TESTBED_AddHostMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST
    */
   struct GNUNET_MessageHeader header;
 
@@ -103,7 +101,7 @@ struct GNUNET_TESTBED_AddHostMessage
   /* followed by non 0-terminated host name */
 
   /* followed by gzip compressed configuration to start or connect to a
-     controller on this host.  While starting the controller this configration
+     controller on this host.  While starting the controller this configuration
      is used as a template */
 
 };
@@ -142,7 +140,7 @@ struct GNUNET_TESTBED_ControllerLinkRequest
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS
    */
   struct GNUNET_MessageHeader header;
 
@@ -175,9 +173,9 @@ struct GNUNET_TESTBED_ControllerLinkRequest
  */
 struct GNUNET_TESTBED_ControllerLinkResponse
 {
-  
+
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT
    */
   struct GNUNET_MessageHeader header;
 
@@ -188,7 +186,7 @@ struct GNUNET_TESTBED_ControllerLinkResponse
   uint16_t config_size GNUNET_PACKED;
 
   /**
-   * Set to GNUNET_YES to signify SUCCESS; GNUNET_NO to signify failure
+   * Set to #GNUNET_YES to signify SUCCESS; #GNUNET_NO to signify failure
    */
   uint16_t success GNUNET_PACKED;
 
@@ -214,7 +212,7 @@ struct GNUNET_TESTBED_PeerCreateMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER
    */
   struct GNUNET_MessageHeader header;
 
@@ -252,7 +250,7 @@ struct GNUNET_TESTBED_PeerReconfigureMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER
    */
   struct GNUNET_MessageHeader header;
 
@@ -285,7 +283,7 @@ struct GNUNET_TESTBED_PeerStartMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_START_PEER
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_START_PEER
    */
   struct GNUNET_MessageHeader header;
 
@@ -310,7 +308,7 @@ struct GNUNET_TESTBED_PeerStopMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER
    */
   struct GNUNET_MessageHeader header;
 
@@ -335,7 +333,7 @@ struct GNUNET_TESTBED_PeerDestroyMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
    */
   struct GNUNET_MessageHeader header;
 
@@ -360,7 +358,7 @@ struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
    */
   struct GNUNET_MessageHeader header;
 
@@ -397,7 +395,7 @@ struct GNUNET_TESTBED_OverlayConnectMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
    */
   struct GNUNET_MessageHeader header;
 
@@ -431,7 +429,7 @@ struct GNUNET_TESTBED_OverlayConnectMessage
 struct GNUNET_TESTBED_RemoteOverlayConnectMessage
 {
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
    */
   struct GNUNET_MessageHeader header;
 
@@ -454,6 +452,8 @@ struct GNUNET_TESTBED_RemoteOverlayConnectMessage
    * To be followed by the HELLO message of A
    */
   struct GNUNET_MessageHeader hello[0];
+  // FIXME: we usually do not use this gcc-hack as some
+  // compilers / tools really get messed up by it...
 
 };
 
@@ -465,13 +465,13 @@ struct GNUNET_TESTBED_PeerEventMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
    */
   struct GNUNET_MessageHeader header;
 
   /**
-   * 'enum GNUNET_TESTBED_EventType' (in NBO);
-   * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
+   * `enum GNUNET_TESTBED_EventType` (in NBO);
+   * either #GNUNET_TESTBED_ET_PEER_START or #GNUNET_TESTBED_ET_PEER_STOP.
    */
   int32_t event_type GNUNET_PACKED;
 
@@ -500,13 +500,13 @@ struct GNUNET_TESTBED_ConnectionEventMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
    */
   struct GNUNET_MessageHeader header;
 
   /**
    * 'enum GNUNET_TESTBED_EventType' (in NBO);
-   * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
+   * either #GNUNET_TESTBED_ET_CONNECT or #GNUNET_TESTBED_ET_DISCONNECT.
    */
   int32_t event_type GNUNET_PACKED;
 
@@ -535,13 +535,13 @@ struct GNUNET_TESTBED_OperationFailureEventMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
    */
   struct GNUNET_MessageHeader header;
 
   /**
    * 'enum GNUNET_TESTBED_EventType' (in NBO);
-   * GNUNET_TESTBED_ET_OPERATION_FINISHED.
+   * #GNUNET_TESTBED_ET_OPERATION_FINISHED.
    */
   int32_t event_type GNUNET_PACKED;
 
@@ -562,7 +562,7 @@ struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
    */
   struct GNUNET_MessageHeader header;
 
@@ -588,13 +588,13 @@ struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
    */
   struct GNUNET_MessageHeader header;
 
   /**
    * 'enum GNUNET_TESTBED_EventType' (in NBO);
-   * GNUNET_TESTBED_ET_OPERATION_FINISHED.
+   * #GNUNET_TESTBED_ET_OPERATION_FINISHED.
    */
   int32_t event_type GNUNET_PACKED;
 
@@ -614,7 +614,7 @@ struct GNUNET_TESTBED_PeerGetConfigurationMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_CONFIGURATION
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_INFORMATION
    */
   struct GNUNET_MessageHeader header;
 
@@ -638,7 +638,7 @@ struct GNUNET_TESTBED_PeerConfigurationInformationMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONFIGURATION
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION
    */
   struct GNUNET_MessageHeader header;
 
@@ -673,7 +673,7 @@ struct GNUNET_TESTBED_PeerConfigurationInformationMessage
 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
 {
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
    */
   struct GNUNET_MessageHeader header;
 
@@ -691,12 +691,12 @@ struct GNUNET_TESTBED_SlaveGetConfigurationMessage
 
 
 /**
- * Reply to GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIG message
+ * Reply to #GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION message
  */
 struct GNUNET_TESTBED_SlaveConfiguration
 {
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
    */
   struct GNUNET_MessageHeader header;
 
@@ -726,7 +726,7 @@ struct GNUNET_TESTBED_SlaveConfiguration
 struct GNUNET_TESTBED_ShutdownPeersMessage
 {
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
    */
   struct GNUNET_MessageHeader header;
 
@@ -743,7 +743,7 @@ struct GNUNET_TESTBED_ShutdownPeersMessage
 struct GNUNET_TESTBED_ManagePeerServiceMessage
 {
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
    */
   struct GNUNET_MessageHeader header;
 
@@ -761,13 +761,145 @@ struct GNUNET_TESTBED_ManagePeerServiceMessage
    * 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
    */
 };
 
 
+/**
+ * Message to send underlay link model of a peer.  This message will be
+ * forwarded to the controller running the peer.
+ */
+struct GNUNET_TESTBED_UnderlayLinkModelMsg
+{
+  /**
+   * Type is #GNUNET_MESSAGE_TYPE_UNDERLAYLINKMODELMSG
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The number of peer entries contained in this message
+   */
+  uint32_t nentries GNUNET_PACKED;
+
+  /**
+   * The number of link properties contained in this message
+   */
+  uint32_t nprops GNUNET_PACKED;
+
+  /**
+   * Array of ids of peers to be in the blacklist/whitelist.  Each id is of type
+   * uint32_t.  Number of ids should be equal to nentries.
+   */
+
+  /**
+   * Array of link properties.  Each link property is to be arraged in a
+   * sequence of four integers of type uint32_t: peer_id, latency, loss and
+   * bandwidth.
+   */
+
+};
+
+
+/**************************************/
+/* Barriers IPC messages and protocol */
+/**************************************/
+
+
+/**
+ * The environmental variable which when available refers to the configuration
+ * file the local testbed controller is using
+ */
+#define ENV_TESTBED_CONFIG "GNUNET_TESTBED_CONTROLLER_CONFIG"
+
+
+/**
+ * Message to initialise a barrier
+ */
+struct GNUNET_TESTBED_BarrierInit
+{
+  /**
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The quorum percentage needed for crossing the barrier
+   */
+  uint8_t quorum;
+
+  /**
+   * name of the barrier.  Non NULL-terminated.
+   */
+  char name[0];
+};
+
+
+/**
+ * Message to cancel a barrier
+ */
+struct GNUNET_TESTBED_BarrierCancel
+{
+  /**
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The barrier name.  Non NULL terminated
+   */
+  char name[0];
+};
+
+
+/**
+ * Message for signalling status changes of a barrier
+ */
+struct GNUNET_TESTBED_BarrierStatusMsg
+{
+  /**
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * status.  Use enumerated values of enum BarrierStatus
+   */
+  uint16_t status GNUNET_PACKED;
+
+  /**
+   * strlen of the barrier name
+   */
+  uint16_t name_len GNUNET_PACKED;
+
+  /**
+   * the barrier name (0-terminated) concatenated with an error message
+   * (0-terminated) if the status were to indicate an error
+   */
+  char data[0];
+};
+
+
+/**
+ * Message sent from peers to the testbed-barrier service to indicate that they
+ * have reached a barrier and are waiting for it to be crossed
+ */
+struct GNUNET_TESTBED_BarrierWait
+{
+  /**
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_WAIT
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * The name of the barrier they have reached.  Non-NULL terminated.
+   */
+  char name[0];
+};
+
+
 GNUNET_NETWORK_STRUCT_END
 #endif
 /* end of testbed.h */