aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_constants.h31
-rw-r--r--src/include/gnunet_crypto_lib.h10
-rw-r--r--src/include/gnunet_network_lib.h10
-rw-r--r--src/include/gnunet_time_lib.h16
4 files changed, 29 insertions, 38 deletions
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index 93eec8ded..f10483424 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -52,30 +52,11 @@ extern "C"
52#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) 52#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
53 53
54/** 54/**
55 * After how long do we consider a connection to a peer dead
56 * if we got an explicit disconnect and were unable to reconnect?
57 */
58#define GNUNET_CONSTANTS_DISCONNECT_SESSION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
59
60/**
61 * How long do we delay reading more from a peer after a quota violation? 55 * How long do we delay reading more from a peer after a quota violation?
62 */ 56 */
63#define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2) 57#define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2)
64 58
65/** 59/**
66 * How long do we wait after a FORK+EXEC before testing for the
67 * resulting process to be up (port open, waitpid, etc.)?
68 */
69#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 200)
70
71/**
72 * After how long do we retry a service connection that was
73 * unavailable? Used in cases where an exponential back-off
74 * seems inappropriate.
75 */
76#define GNUNET_CONSTANTS_SERVICE_RETRY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 500)
77
78/**
79 * After how long do we consider a service unresponsive 60 * After how long do we consider a service unresponsive
80 * even if we assume that the service commonly does not 61 * even if we assume that the service commonly does not
81 * respond instantly (DNS, Database, etc.). 62 * respond instantly (DNS, Database, etc.).
@@ -119,18 +100,6 @@ extern "C"
119#define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof (struct GNUNET_HashCode)) 100#define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof (struct GNUNET_HashCode))
120 101
121/** 102/**
122 * Size of the 'struct OutboundMessage' of the transport
123 * (which, in combination with the
124 * GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE) defines
125 * the headers that must be pre-pendable to all GNUnet
126 * messages. Taking GNUNET_SERVER_MAX_MESSAGE_SIZE
127 * and subtracting these two constants defines the largest
128 * message core can handle.
129 */
130#define GNUNET_CONSTANTS_TRANSPORT_SIZE_OUTBOUND_MESSAGE (16 + sizeof (struct GNUNET_PeerIdentity))
131
132
133/**
134 * What is the maximum size for encrypted messages? Note that this 103 * What is the maximum size for encrypted messages? Note that this
135 * number imposes a clear limit on the maximum size of any message. 104 * number imposes a clear limit on the maximum size of any message.
136 * Set to a value close to 64k but not so close that transports will 105 * Set to a value close to 64k but not so close that transports will
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 3bb60d9e5..ff7bffdbb 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -71,7 +71,6 @@ enum GNUNET_CRYPTO_Quality
71 */ 71 */
72#define GNUNET_CRYPTO_AES_KEY_LENGTH (256/8) 72#define GNUNET_CRYPTO_AES_KEY_LENGTH (256/8)
73 73
74
75/** 74/**
76 * @brief Length of RSA encrypted data (2048 bit) 75 * @brief Length of RSA encrypted data (2048 bit)
77 * 76 *
@@ -84,30 +83,27 @@ enum GNUNET_CRYPTO_Quality
84 */ 83 */
85#define GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH 256 84#define GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH 256
86 85
87
88/** 86/**
89 * Length of an RSA KEY (n,e,len), 2048 bit (=256 octests) key n, 2 byte e 87 * Length of an RSA KEY (n,e,len), 2048 bit (=256 octests) key n, 2 byte e
90 */ 88 */
91#define GNUNET_CRYPTO_RSA_KEY_LENGTH 258 89#define GNUNET_CRYPTO_RSA_KEY_LENGTH 258
92 90
93
94/** 91/**
95 * Length of a hash value 92 * Length of a hash value
96 */ 93 */
97#define GNUNET_CRYPTO_HASH_LENGTH 512/8 94#define GNUNET_CRYPTO_HASH_LENGTH 512/8
98 95
99
100/** 96/**
101 * FIXME: what is an acceptable value here? 97 * FIXME: what is an acceptable value here?
102 * Note: round to multiple of 8 minus 2. 98 * Note: round to multiple of 8 minus 2.
103 */ 99 */
104#define GNUNET_CRYPTO_ECC_DATA_ENCODING_LENGTH 510 100#define GNUNET_CRYPTO_ECC_SIGNATURE_DATA_ENCODING_LENGTH 138
105 101
106/** 102/**
107 * FIXME: what is an acceptable value here? 103 * FIXME: what is an acceptable value here?
108 * Maximum length of the public key (q-point, Q = dP) when encoded. 104 * Maximum length of the public key (q-point, Q = dP) when encoded.
109 */ 105 */
110#define GNUNET_CRYPTO_ECC_MAX_PUBLIC_KEY_LENGTH 254 106#define GNUNET_CRYPTO_ECC_MAX_PUBLIC_KEY_LENGTH 140
111 107
112 108
113/** 109/**
@@ -277,7 +273,7 @@ struct GNUNET_CRYPTO_EccSignature
277 /** 273 /**
278 * S-expression, padded with zeros. 274 * S-expression, padded with zeros.
279 */ 275 */
280 char sexpr[GNUNET_CRYPTO_ECC_DATA_ENCODING_LENGTH]; 276 char sexpr[GNUNET_CRYPTO_ECC_SIGNATURE_DATA_ENCODING_LENGTH];
281}; 277};
282 278
283 279
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 06a5ce903..1618b2442 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -73,6 +73,16 @@ struct GNUNET_NETWORK_FDSet
73 73
74 74
75/** 75/**
76 * Test if the given protocol family is supported by this system.
77 *
78 * @param pf protocol family to test (PF_INET, PF_INET6, PF_UNIX)
79 * @return GNUNET_OK if the PF is supported
80 */
81int
82GNUNET_NETWORK_test_pf (int pf);
83
84
85/**
76 * Given a unixpath that is too long (larger than UNIX_PATH_MAX), 86 * Given a unixpath that is too long (larger than UNIX_PATH_MAX),
77 * shorten it to an acceptable length while keeping it unique 87 * shorten it to an acceptable length while keeping it unique
78 * and making sure it remains a valid filename (if possible). 88 * and making sure it remains a valid filename (if possible).
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index da22ab31e..d131e4eef 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -150,6 +150,22 @@ GNUNET_NETWORK_STRUCT_END
150#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ () 150#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ ()
151 151
152 152
153
154/**
155 * Threshold after which exponential backoff should not increase (15 m).
156 */
157#define GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15)
158
159
160/**
161 * Perform our standard exponential back-off calculation, starting at 1mst
162 * and then going by a factor of 2 up unto a maximum of 1s.
163 *
164 * @param r current backoff time, initially zero
165 */
166#define GNUNET_TIME_STD_BACKOFF(r) GNUNET_TIME_relative_min (GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD, \
167 GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, (r)), 2));
168
153/** 169/**
154 * Return relative time of 0ms. 170 * Return relative time of 0ms.
155 */ 171 */