diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-31 22:02:38 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-31 22:02:38 +0000 |
commit | 4c6147e904989108966da156417f20599f1fe99c (patch) | |
tree | 0c3b999ccc837956fab244b358ca64afa468a94d /src/include/gnunet_constants.h | |
parent | 37e18e24a0be2ed99eb63108a9909121b96447a5 (diff) | |
download | gnunet-4c6147e904989108966da156417f20599f1fe99c.tar.gz gnunet-4c6147e904989108966da156417f20599f1fe99c.zip |
more constants
Diffstat (limited to 'src/include/gnunet_constants.h')
-rw-r--r-- | src/include/gnunet_constants.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h index 5c8749ed0..c32add92a 100644 --- a/src/include/gnunet_constants.h +++ b/src/include/gnunet_constants.h | |||
@@ -91,6 +91,37 @@ extern "C" | |||
91 | */ | 91 | */ |
92 | #define GNUNET_CONSTANTS_IDLE_LOAD_THRESHOLD 70 | 92 | #define GNUNET_CONSTANTS_IDLE_LOAD_THRESHOLD 70 |
93 | 93 | ||
94 | /** | ||
95 | * Size of the 'struct EncryptedMessage' of the core (which | ||
96 | * is the per-message overhead of the core). | ||
97 | */ | ||
98 | #define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof (GNUNET_HashCode)) | ||
99 | |||
100 | /** | ||
101 | * Size of the 'struct OutboundMessage' of the transport | ||
102 | * (which, in combination with the | ||
103 | * GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE) defines | ||
104 | * the headers that must be pre-pendable to all GNUnet | ||
105 | * messages. Taking GNUNET_SERVER_MAX_MESSAGE_SIZE | ||
106 | * and subtracting these two constants defines the largest | ||
107 | * message core can handle. | ||
108 | */ | ||
109 | #define GNUNET_CONSTANTS_TRANSPORT_SIZE_OUTBOUND_MESSAGE (16 + sizeof (struct GNUNET_PeerIdentity)) | ||
110 | |||
111 | |||
112 | /** | ||
113 | * What is the maximum size for encrypted messages? Note that this | ||
114 | * number imposes a clear limit on the maximum size of any message. | ||
115 | * Set to a value close to 64k but not so close that transports will | ||
116 | * have trouble with their headers. | ||
117 | * | ||
118 | * Could theoretically be 64k minus (GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE + | ||
119 | * GNUNET_CONSTANTS_TRANSPORT_SIZE_OUTBOUND_MESSAGE), but we're going | ||
120 | * to be more conservative for now. | ||
121 | */ | ||
122 | #define GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE (63 * 1024) | ||
123 | |||
124 | |||
94 | 125 | ||
95 | #if 0 /* keep Emacsens' auto-indent happy */ | 126 | #if 0 /* keep Emacsens' auto-indent happy */ |
96 | { | 127 | { |