-only trigger check config if we actually need it
[oweals/gnunet.git] / src / fs / fs.h
index 3aa9fcc1b0efef97d6ff9df623e60926a931a1c2..83b9073c7a3bcb036cf59e860d6368a8b5c3a8ed 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2003--2012 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.
 */
 
 /**
@@ -37,7 +37,7 @@
 /**
  * Size of the individual blocks used for file-sharing.
  */
-#define DBLOCK_SIZE (32*1024)
+#define DBLOCK_SIZE (32 * 1024)
 
 /**
  * Blocksize to use when hashing files for indexing (blocksize for IO,
@@ -66,6 +66,77 @@ struct ContentHashKey
 
 GNUNET_NETWORK_STRUCT_BEGIN
 
+
+/**
+ * Message sent from a GNUnet (fs) publishing activity to sign
+ * a LOC URI.
+ */
+struct RequestLocSignatureMessage
+{
+
+  /**
+   * Message type will be #GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGN.
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Requested signature purpose.  For now, always
+   * #GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT.
+   */
+  uint32_t purpose GNUNET_PACKED;
+
+  /**
+   * Requested expiration time.
+   */
+  struct GNUNET_TIME_AbsoluteNBO expiration_time;
+
+  /**
+   * Information about the shared file (to be signed).
+   */
+  struct ContentHashKey chk;
+
+  /**
+   * Size of the shared file (to be signed).
+   */
+  uint64_t file_length;
+};
+
+
+/**
+ * Message sent from the service with the signed LOC URI.
+ */
+struct ResponseLocSignatureMessage
+{
+
+  /**
+   * Message type will be
+   * #GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE.
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Purpose of the generated signature.  For now, always
+   * #GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT.
+   */
+  uint32_t purpose GNUNET_PACKED;
+
+  /**
+   * Expiration time that was actually used (rounded!).
+   */
+  struct GNUNET_TIME_AbsoluteNBO expiration_time;
+
+  /**
+   * The requested signature.
+   */
+  struct GNUNET_CRYPTO_EddsaSignature signature;
+
+  /**
+   * Identity of the peer sharing the file.
+   */
+  struct GNUNET_PeerIdentity peer;
+};
+
+
 /**
  * Message sent from a GNUnet (fs) publishing activity to the
  * gnunet-fs-service to initiate indexing of a file.  The service is
@@ -83,7 +154,7 @@ struct IndexStartMessage
 {
 
   /**
-   * Message type will be GNUNET_MESSAGE_TYPE_FS_INDEX_START.
+   * Message type will be #GNUNET_MESSAGE_TYPE_FS_INDEX_START.
    */
   struct GNUNET_MessageHeader header;
 
@@ -129,7 +200,7 @@ struct IndexInfoMessage
 {
   /**
    * Message type will be
-   * GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY.
+   * #GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY.
    */
   struct GNUNET_MessageHeader header;
 
@@ -161,8 +232,7 @@ struct UnindexMessage
 {
 
   /**
-   * Message type will be
-   * GNUNET_MESSAGE_TYPE_FS_UNINDEX.
+   * Message type will be #GNUNET_MESSAGE_TYPE_FS_UNINDEX.
    */
   struct GNUNET_MessageHeader header;
 
@@ -206,8 +276,7 @@ struct SearchMessage
 {
 
   /**
-   * Message type will be
-   * GNUNET_MESSAGE_TYPE_FS_START_SEARCH.
+   * Message type will be #GNUNET_MESSAGE_TYPE_FS_START_SEARCH.
    */
   struct GNUNET_MessageHeader header;
 
@@ -240,26 +309,21 @@ struct SearchMessage
    * nevertheless, we should probably not use it for a DHT-lookup
    * or similar blunt actions in order to avoid exposing ourselves).
    * <p>
-   * If the request is for an SBLOCK, this is the identity of the
-   * pseudonym to which the SBLOCK belongs.
-   * <p>
-   * If the request is for a KBLOCK, "target" must be all zeros.
+   * Otherwise, "target" must be all zeros.
    */
-  struct GNUNET_HashCode target;
+  struct GNUNET_PeerIdentity target;
 
   /**
-   * Hash of the keyword (aka query) for KBLOCKs; Hash of
-   * the CHK-encoded block for DBLOCKS and IBLOCKS (aka query)
-   * and hash of the identifier XORed with the target for
-   * SBLOCKS (aka query).
+   * Hash of the public key for UBLOCKs; Hash of
+   * the CHK-encoded block for DBLOCKS and IBLOCKS.
    */
   struct GNUNET_HashCode query;
 
   /* this is followed by the hash codes of already-known
    * results (which should hence be excluded from what
    * the service returns); naturally, this only applies
-   * to queries that can have multiple results, such as
-   * those for KBLOCKS (KSK) and SBLOCKS (SKS) */
+   * to queries that can have multiple results (UBLOCKS).
+   */
 };
 
 
@@ -273,7 +337,7 @@ struct PutMessage
 {
 
   /**
-   * Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
+   * Message type will be #GNUNET_MESSAGE_TYPE_FS_PUT.
    */
   struct GNUNET_MessageHeader header;
 
@@ -301,7 +365,7 @@ struct ClientPutMessage
 {
 
   /**
-   * Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
+   * Message type will be #GNUNET_MESSAGE_TYPE_FS_PUT.
    */
   struct GNUNET_MessageHeader header;
 
@@ -321,6 +385,18 @@ struct ClientPutMessage
    */
   struct GNUNET_TIME_AbsoluteNBO last_transmission;
 
+  /**
+   * How often did we transmit this query before getting an
+   * answer (estimate).
+   */
+  uint32_t num_transmissions;
+
+  /**
+   * How much respect did we offer (in total) before getting an
+   * answer (estimate).
+   */
+  uint32_t respect_offered;
+
   /* this is followed by the actual encrypted content */
 
 };