-nicer logging
[oweals/gnunet.git] / src / include / gnunet_constants.h
index 99dd5bfcf962f419e3d707ab2bc5fc45f4bee469..d010f7ec0f9395a4bc00848f40d0d07592f5c207 100644 (file)
@@ -1,10 +1,10 @@
 /*
      This file is part of GNUnet.
-     (C) 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009 Christian Grothoff (and other contributing authors)
 
      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
@@ -35,7 +35,10 @@ extern "C"
 #endif
 #endif
 
-#include "gnunet_bandwidth_lib.h"
+/**
+ * Last resort choice for configuration file name.
+ */
+#define GNUNET_DEFAULT_USER_CONFIG_FILE "~/.config/gnunet.conf"
 
 /**
  * Bandwidth (in/out) to assume initially (before either peer has
@@ -49,7 +52,7 @@ extern "C"
  * After how long do we consider a connection to a peer dead
  * if we don't receive messages from the peer?
  */
-#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS, 5)
+#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
 
 /**
  * How long do we delay reading more from a peer after a quota violation?
@@ -61,7 +64,7 @@ extern "C"
  * even if we assume that the service commonly does not
  * respond instantly (DNS, Database, etc.).
  */
-#define GNUNET_CONSTANTS_SERVICE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS, 10)
+#define GNUNET_CONSTANTS_SERVICE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 10)
 
 /**
  * How long do we delay messages to get larger packet sizes (CORKing)?
@@ -94,15 +97,13 @@ extern "C"
 
 
 /**
- * After how long do we expire an address in a HELLO that we just
- * validated?  This value is also used for our own addresses when we
- * create a HELLO.
+ * How long do we cache records at most in the DHT?
  */
 #define GNUNET_CONSTANTS_DHT_MAX_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 24)
 
 
 /**
- * Size of the 'struct EncryptedMessage' of the core (which
+ * Size of the `struct EncryptedMessage` of the core (which
  * is the per-message overhead of the core).
  */
 #define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof (struct GNUNET_HashCode))
@@ -113,15 +114,31 @@ extern "C"
  * Set to a value close to 64k but not so close that transports will
  * have trouble with their headers.
  *
- * Could theoretically be 64k minus (GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE +
- * GNUNET_CONSTANTS_TRANSPORT_SIZE_OUTBOUND_MESSAGE), but we're going
+ * Could theoretically be 64k minus (#GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE +
+ * #GNUNET_CONSTANTS_TRANSPORT_SIZE_OUTBOUND_MESSAGE), but we're going
  * to be more conservative for now.
  */
 #define GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE (63 * 1024)
 
+/**
+ * Size of the CADET message overhead:
+ * + sizeof (struct GNUNET_CADET_Encrypted)
+ * + sizeof (struct GNUNET_CADET_Data)
+ * + sizeof (struct GNUNET_CADET_ACK))
+ *
+ * Checked for correcteness in gnunet-service-cadet_tunnel.c: GCT_init().
+ */
+#define GNUNET_CONSTANTS_CADET_P2P_OVERHEAD 132
+
+/**
+ * Maximum message size that can be sent on CADET.
+ */
+#define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE \
+(GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE - GNUNET_CONSTANTS_CADET_P2P_OVERHEAD)
+
 /**
  * Largest block that can be stored in the DHT.
- */ 
+ */
 #define GNUNET_CONSTANTS_MAX_BLOCK_SIZE (62 * 1024)