Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials
[oweals/gnunet.git] / src / datastore / datastore.h
index 87ceb0134c133d2a2ea3a5946cf6ec9890515034..dc3d9d1f26a0c7d927f11f8c8704facc88a04cf2 100644 (file)
@@ -1,10 +1,10 @@
 /*
      This file is part of GNUnet
 /*
      This file is part of GNUnet
-     (C) 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2004, 2005, 2006, 2007, 2009 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
 
      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 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -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
 
      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.
 */
 
 /**
 */
 
 /**
@@ -106,12 +106,10 @@ struct ReleaseReserveMessage
  * Message to the datastore service asking about specific
  * content.
  */
  * Message to the datastore service asking about specific
  * content.
  */
-struct GetMessage
+struct GetKeyMessage
 {
   /**
 {
   /**
-   * Type is GNUNET_MESSAGE_TYPE_DATASTORE_GET.  Size
-   * can either be "sizeof(struct GetMessage)" or
-   * "sizeof(struct GetMessage) - sizeof(GNUNET_HashCode)"!
+   * Type is #GNUNET_MESSAGE_TYPE_DATASTORE_GET_KEY.
    */
   struct GNUNET_MessageHeader header;
 
    */
   struct GNUNET_MessageHeader header;
 
@@ -126,10 +124,33 @@ struct GetMessage
   uint64_t offset GNUNET_PACKED;
 
   /**
   uint64_t offset GNUNET_PACKED;
 
   /**
-   * Desired key (optional).  Check the "size" of the
-   * header to see if the key is actually present.
+   * Desired key.
+   */
+  struct GNUNET_HashCode key;
+
+};
+
+
+/**
+ * Message to the datastore service asking about specific
+ * content.
+ */
+struct GetMessage
+{
+  /**
+   * Type is #GNUNET_MESSAGE_TYPE_DATASTORE_GET.
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Desired content type.  (actually an enum GNUNET_BLOCK_Type)
+   */
+  uint32_t type GNUNET_PACKED;
+
+  /**
+   * Offset of the result.
    */
    */
-  GNUNET_HashCode key;
+  uint64_t offset GNUNET_PACKED;
 
 };
 
 
 };
 
@@ -252,7 +273,7 @@ struct DataMessage
   /**
    * Key under which the item can be found.
    */
   /**
    * Key under which the item can be found.
    */
-  GNUNET_HashCode key;
+  struct GNUNET_HashCode key;
 
 };
 GNUNET_NETWORK_STRUCT_END
 
 };
 GNUNET_NETWORK_STRUCT_END