regex profiler fixes
[oweals/gnunet.git] / src / ats / ats.h
index fbc6ca7120a145ebda5bfffc7806f20f493116c6..f4c3d9fbac16360bf622ffe196330eb1fb7def1e 100644 (file)
 
 enum StartFlag
 {
-  
+
   START_FLAG_SCHEDULING = 0,
 
   START_FLAG_PERFORMANCE_WITH_PIC = 1,
 
   START_FLAG_PERFORMANCE_NO_PIC = 2
-
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 struct ClientStartMessage
 {
@@ -48,14 +48,23 @@ struct ClientStartMessage
   /**
    * NBO value of an 'enum StartFlag'.
    */
-  uint32_t start_flag;
+  uint32_t start_flag GNUNET_PACKED;
 };
 
 
 struct RequestAddressMessage
 {
   struct GNUNET_MessageHeader header;
+
+  uint32_t reserved GNUNET_PACKED;
+
+  struct GNUNET_PeerIdentity peer;
+};
+
+struct ResetBackoffMessage
+{
+  struct GNUNET_MessageHeader header;
+
   uint32_t reserved GNUNET_PACKED;
 
   struct GNUNET_PeerIdentity peer;
@@ -77,10 +86,31 @@ struct AddressUpdateMessage
   uint32_t session_id GNUNET_PACKED;
 
   /* followed by:
-     - struct GNUNET_ATS_Information [ats_count];
-     - char address[address_length]
-     - char plugin_name[plugin_name_length] (including '\0'-termination).
-  */
+   * - struct GNUNET_ATS_Information [ats_count];
+   * - char address[address_length]
+   * - char plugin_name[plugin_name_length] (including '\0'-termination).
+   */
+
+};
+
+struct AddressUseMessage
+{
+  struct GNUNET_MessageHeader header;
+
+  struct GNUNET_PeerIdentity peer;
+
+  uint16_t in_use GNUNET_PACKED;
+
+  uint16_t address_length GNUNET_PACKED;
+
+  uint16_t plugin_name_length GNUNET_PACKED;
+
+  uint32_t session_id GNUNET_PACKED;
+
+  /* followed by:
+   * - char address[address_length]
+   * - char plugin_name[plugin_name_length] (including '\0'-termination).
+   */
 
 };
 
@@ -100,9 +130,9 @@ struct AddressDestroyedMessage
   uint32_t session_id GNUNET_PACKED;
 
   /* followed by:
-     - char address[address_length]
-     - char plugin_name[plugin_name_length] (including '\0'-termination).
-  */
+   * - char address[address_length]
+   * - char plugin_name[plugin_name_length] (including '\0'-termination).
+   */
 
 };
 
@@ -122,14 +152,14 @@ struct AddressSuggestionMessage
   uint32_t session_id GNUNET_PACKED;
 
   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
-  
+
   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
 
   /* followed by:
-     - struct GNUNET_ATS_Information [ats_count];
-     - char address[address_length]
-     - char plugin_name[plugin_name_length] (including '\0'-termination).
-  */
+   * - struct GNUNET_ATS_Information [ats_count];
+   * - char address[address_length]
+   * - char plugin_name[plugin_name_length] (including '\0'-termination).
+   */
 
 };
 
@@ -147,14 +177,14 @@ struct PeerInformationMessage
   uint16_t plugin_name_length GNUNET_PACKED;
 
   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
-  
+
   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
 
-  /* followed by: 
-     - struct GNUNET_ATS_Information [ats_count];
-     - char address[address_length]
-     - char plugin_name[plugin_name_length] (including '\0'-termination).
-  */
+  /* followed by:
+   * - struct GNUNET_ATS_Information [ats_count];
+   * - char address[address_length]
+   * - char plugin_name[plugin_name_length] (including '\0'-termination).
+   */
 
 };
 
@@ -169,6 +199,20 @@ struct ReservationRequestMessage
 };
 
 
+/**
+ * Message sent by ATS service to client to confirm that it is done
+ * using the given session ID.
+ */
+struct SessionReleaseMessage
+{
+  struct GNUNET_MessageHeader header;
+
+  uint32_t session_id GNUNET_PACKED;
+
+  struct GNUNET_PeerIdentity peer;
+};
+
+
 struct ReservationResultMessage
 {
   struct GNUNET_MessageHeader header;
@@ -180,14 +224,13 @@ struct ReservationResultMessage
   struct GNUNET_TIME_RelativeNBO res_delay;
 };
 
-
 struct PreferenceInformation
 {
 
   uint32_t preference_kind GNUNET_PACKED;
 
   float preference_value GNUNET_PACKED;
-  
+
 };
 
 
@@ -199,9 +242,10 @@ struct ChangePreferenceMessage
 
   struct GNUNET_PeerIdentity peer;
 
-  /* followed by 'num_preferences' 
-     struct PreferenceInformation values */
+  /* followed by 'num_preferences'
+   * struct PreferenceInformation values */
 };
+GNUNET_NETWORK_STRUCT_END