-docu, style fixes
[oweals/gnunet.git] / src / testbed / testbed.h
index 73cf8c29495faca54d551b34700c44e1e5974917..6f6a3f31e81d96378c098e2ebb4c8cb69b2a945b 100644 (file)
@@ -33,11 +33,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;
 
@@ -175,7 +175,7 @@ struct GNUNET_TESTBED_ControllerLinkRequest
  */
 struct GNUNET_TESTBED_ControllerLinkResponse
 {
-  
+
   /**
    * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT
    */
@@ -252,7 +252,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 +285,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 +310,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 +335,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 +360,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 +397,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 +431,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 +454,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 +467,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;
 
@@ -638,7 +640,7 @@ struct GNUNET_TESTBED_PeerConfigurationInformationMessage
 {
 
   /**
-   * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION
+   * Type is #GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION
    */
   struct GNUNET_MessageHeader header;
 
@@ -691,7 +693,7 @@ 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
 {
@@ -761,18 +763,60 @@ 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
  */
@@ -784,22 +828,29 @@ struct GNUNET_TESTBED_BarrierInit
   struct GNUNET_MessageHeader header;
 
   /**
-   * Unused.  Only of alignment.
+   * The quorum percentage needed for crossing the barrier
    */
-  uint32_t unused;
-  
+  uint8_t quorum;
+
   /**
-   * The operation id
+   * name of the barrier.  Non NULL-terminated.
    */
-  uint64_t op_id;
-  
+  char name[0];
+};
+
+
+/**
+ * Message to cancel a barrier
+ */
+struct GNUNET_TESTBED_BarrierCancel
+{
   /**
-   * The quorum percentage needed for crossing the barrier
+   * Type is GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL
    */
-  uint8_t quorum;
+  struct GNUNET_MessageHeader header;
 
   /**
-   * name of the barrier.  Non NULL-terminated.
+   * The barrier name.  Non NULL terminated
    */
   char name[0];
 };
@@ -814,17 +865,17 @@ 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;
+  uint16_t status GNUNET_PACKED;
 
   /**
    * strlen of the barrier name
    */
-  uint16_t name_len;
-  
+  uint16_t name_len GNUNET_PACKED;
+
   /**
    * the barrier name (NULL terminated) concatenated with an error message (NULL
    * terminated) if the status were to indicate an error