log: add \n
[oweals/gnunet.git] / src / set / set.h
index b470ebf92c800c4b90a90839e2ecd5d2a0840def..f31216cb8f3427fc52b7b19b29de0ba2606dc3bc 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2012-2014 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
@@ -14,8 +14,8 @@
 
      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.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file set/set.h
 
 #include "platform.h"
 #include "gnunet_common.h"
-
-/**
- * FIXME
- */
-#define GNUNET_SET_ACK_WINDOW 10
-
+#include "gnunet_set_service.h"
 
 GNUNET_NETWORK_STRUCT_BEGIN
 
@@ -185,7 +180,7 @@ struct GNUNET_SET_EvaluateMessage
 
   /**
    * Id of our set to evaluate, chosen implicitly by the client when it
-   * calls #GNUNE_SET_commit().
+   * calls #GNUNET_SET_commit().
    */
   uint32_t request_id GNUNET_PACKED;
 
@@ -194,6 +189,12 @@ struct GNUNET_SET_EvaluateMessage
 };
 
 
+/**
+ * Message sent by the service to the client to indicate an
+ * element that is removed (set intersection) or added
+ * (set union) or part of the final result, depending on
+ * options specified for the operation.
+ */
 struct GNUNET_SET_ResultMessage
 {
   /**
@@ -207,13 +208,13 @@ struct GNUNET_SET_ResultMessage
   uint32_t request_id GNUNET_PACKED;
 
   /**
-   * Was the evaluation successful?
+   * Was the evaluation successful? Contains
+   * an `enum GNUNET_SET_Status` in NBO.
    */
   uint16_t result_status GNUNET_PACKED;
 
   /**
-   * Type of the element attachted to the message,
-   * if any.
+   * Type of the element attachted to the message, if any.
    */
   uint16_t element_type GNUNET_PACKED;
 
@@ -265,13 +266,23 @@ struct GNUNET_SET_CancelMessage
 };
 
 
+/**
+ * Set element transmitted by service to client in response to a set
+ * iteration request.
+ */
 struct GNUNET_SET_IterResponseMessage
 {
   /**
-   * Type: #GNUNET_MESSAGE_TYPE_SET_ITER_RESPONSE
+   * Type: #GNUNET_MESSAGE_TYPE_SET_ITER_ELEMENT
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * To which set iteration does this reponse belong to?  First
+   * iteration (per client) has counter zero. Wraps around.
+   */
+  uint16_t iteration_id GNUNET_PACKED;
+
   /**
    * Type of the element attachted to the message,
    * if any.
@@ -281,6 +292,10 @@ struct GNUNET_SET_IterResponseMessage
   /* rest: element */
 };
 
+
+/**
+ * Client acknowledges receiving element in iteration.
+ */
 struct GNUNET_SET_IterAckMessage
 {
   /**
@@ -294,6 +309,41 @@ struct GNUNET_SET_IterAckMessage
   uint32_t send_more;
 };
 
+
+/**
+ * Server responds to a lazy copy request.
+ */
+struct GNUNET_SET_CopyLazyResponseMessage
+{
+  /**
+   * Type: #GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_RESPONSE
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Temporary name for the copied set.
+   */
+  uint32_t cookie;
+};
+
+
+/**
+ * Client connects to a lazily copied set.
+ */
+struct GNUNET_SET_CopyLazyConnectMessage
+{
+  /**
+   * Type: #GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_CONNECT
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Temporary name for the copied set.
+   */
+  uint32_t cookie;
+};
+
+
 GNUNET_NETWORK_STRUCT_END
 
 #endif