-nicer logging
[oweals/gnunet.git] / src / include / gnunet_constants.h
index 705809186e1d512b615bdd99a762da55b69ec6d0..d010f7ec0f9395a4bc00848f40d0d07592f5c207 100644 (file)
@@ -1,6 +1,6 @@
 /*
      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
@@ -120,6 +120,22 @@ extern "C"
  */
 #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.
  */