aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-05 20:31:58 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-05 20:31:58 +0000
commitcb4610c2c23191e0977738402d87e7b6bd0808c9 (patch)
treebb6f7ad28dd92895680c909adbe3d54a3cce62b6 /src/include
parent78a3d311f2c3c82affe6003b9bd3c17c0b2d200b (diff)
downloadgnunet-cb4610c2c23191e0977738402d87e7b6bd0808c9.tar.gz
gnunet-cb4610c2c23191e0977738402d87e7b6bd0808c9.zip
trying to fix bandwidth calculations
Diffstat (limited to 'src/include')
-rw-r--r--src/include/Makefile.am1
-rw-r--r--src/include/gnunet_constants.h12
-rw-r--r--src/include/gnunet_core_service.h12
-rw-r--r--src/include/gnunet_transport_service.h9
-rw-r--r--src/include/gnunet_util_lib.h1
5 files changed, 20 insertions, 15 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 39fb2f0f5..605cbbe1e 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -13,6 +13,7 @@ nodist_gnunetinclude_HEADERS = \
13 13
14gnunetinclude_HEADERS = \ 14gnunetinclude_HEADERS = \
15 gnunet_arm_service.h \ 15 gnunet_arm_service.h \
16 gnunet_bandwidth_lib.h \
16 gnunet_bio_lib.h \ 17 gnunet_bio_lib.h \
17 gnunet_client_lib.h \ 18 gnunet_client_lib.h \
18 gnunet_common.h \ 19 gnunet_common.h \
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index eb8addf5f..035cc60b9 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -35,13 +35,15 @@ extern "C"
35#endif 35#endif
36#endif 36#endif
37 37
38#include "gnunet_bandwidth_lib.h"
39
38/** 40/**
39 * Amount of bytes per minute (in/out) to assume initially (before 41 * Bandwidth (in/out) to assume initially (before either peer has
40 * either peer has communicated any particular preference). Should be 42 * communicated any particular preference). Should be rather low; set
41 * rather low; set so that at least one maximum-size message can be 43 * so that at least one maximum-size message can be send roughly once
42 * send each minute. 44 * per minute.
43 */ 45 */
44#define GNUNET_CONSTANTS_DEFAULT_BPM_IN_OUT GNUNET_SERVER_MAX_MESSAGE_SIZE 46#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024)
45 47
46/** 48/**
47 * After how long do we consider a connection to a peer dead 49 * After how long do we consider a connection to a peer dead
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h
index af0a4eaa9..47b8d6f98 100644
--- a/src/include/gnunet_core_service.h
+++ b/src/include/gnunet_core_service.h
@@ -281,8 +281,8 @@ typedef void
281 (*GNUNET_CORE_PeerConfigurationInfoCallback) (void *cls, 281 (*GNUNET_CORE_PeerConfigurationInfoCallback) (void *cls,
282 const struct 282 const struct
283 GNUNET_PeerIdentity * peer, 283 GNUNET_PeerIdentity * peer,
284 unsigned int bpm_in, 284 struct GNUNET_BANDWIDTH_Value32NBO bpm_in,
285 unsigned int bpm_out, 285 struct GNUNET_BANDWIDTH_Value32NBO bpm_out,
286 int amount, 286 int amount,
287 uint64_t preference); 287 uint64_t preference);
288 288
@@ -302,11 +302,11 @@ struct GNUNET_CORE_InformationRequestContext;
302 * @param peer identifies the peer 302 * @param peer identifies the peer
303 * @param timeout after how long should we give up (and call "info" with NULL 303 * @param timeout after how long should we give up (and call "info" with NULL
304 * for "peer" to signal an error)? 304 * for "peer" to signal an error)?
305 * @param bpm_out set to the current bandwidth limit (sending) for this peer, 305 * @param bw_out set to the current bandwidth limit (sending) for this peer,
306 * caller should set "bpm_out" to "-1" to avoid changing 306 * caller should set "bpm_out" to "-1" to avoid changing
307 * the current value; otherwise "bpm_out" will be lowered to 307 * the current value; otherwise "bw_out" will be lowered to
308 * the specified value; passing a pointer to "0" can be used to force 308 * the specified value; passing a pointer to "0" can be used to force
309 * us to disconnect from the peer; "bpm_out" might not increase 309 * us to disconnect from the peer; "bw_out" might not increase
310 * as specified since the upper bound is generally 310 * as specified since the upper bound is generally
311 * determined by the other peer! 311 * determined by the other peer!
312 * @param amount reserve N bytes for receiving, negative 312 * @param amount reserve N bytes for receiving, negative
@@ -324,7 +324,7 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_SCHEDULER_Handle *sched,
324 const struct GNUNET_CONFIGURATION_Handle *cfg, 324 const struct GNUNET_CONFIGURATION_Handle *cfg,
325 const struct GNUNET_PeerIdentity *peer, 325 const struct GNUNET_PeerIdentity *peer,
326 struct GNUNET_TIME_Relative timeout, 326 struct GNUNET_TIME_Relative timeout,
327 uint32_t bpm_out, 327 struct GNUNET_BANDWIDTH_Value32NBO bw_out,
328 int32_t amount, 328 int32_t amount,
329 uint64_t preference, 329 uint64_t preference,
330 GNUNET_CORE_PeerConfigurationInfoCallback info, 330 GNUNET_CORE_PeerConfigurationInfoCallback info,
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 7a3ccbf7b..47d4334bb 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -35,6 +35,7 @@ extern "C"
35#endif 35#endif
36#endif 36#endif
37 37
38#include "gnunet_bandwidth_lib.h"
38#include "gnunet_configuration_lib.h" 39#include "gnunet_configuration_lib.h"
39#include "gnunet_crypto_lib.h" 40#include "gnunet_crypto_lib.h"
40#include "gnunet_connection_lib.h" 41#include "gnunet_connection_lib.h"
@@ -153,8 +154,8 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle);
153 * 154 *
154 * @param handle connection to transport service 155 * @param handle connection to transport service
155 * @param target who's bandwidth quota is being changed 156 * @param target who's bandwidth quota is being changed
156 * @param quota_in incoming bandwidth quota in bytes per ms 157 * @param quota_in incoming bandwidth quota
157 * @param quota_out outgoing bandwidth quota in bytes per ms 158 * @param quota_out outgoing bandwidth quota
158 * @param timeout how long to wait until signaling failure if 159 * @param timeout how long to wait until signaling failure if
159 * we can not communicate the quota change 160 * we can not communicate the quota change
160 * @param cont continuation to call when done, will be called 161 * @param cont continuation to call when done, will be called
@@ -164,8 +165,8 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle);
164void 165void
165GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, 166GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle,
166 const struct GNUNET_PeerIdentity *target, 167 const struct GNUNET_PeerIdentity *target,
167 uint32_t quota_in, 168 struct GNUNET_BANDWIDTH_Value32NBO quota_in,
168 uint32_t quota_out, 169 struct GNUNET_BANDWIDTH_Value32NBO quota_out,
169 struct GNUNET_TIME_Relative timeout, 170 struct GNUNET_TIME_Relative timeout,
170 GNUNET_SCHEDULER_Task cont, void *cont_cls); 171 GNUNET_SCHEDULER_Task cont, void *cont_cls);
171 172
diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h
index 1c5e1d7a1..e0a5b0774 100644
--- a/src/include/gnunet_util_lib.h
+++ b/src/include/gnunet_util_lib.h
@@ -37,6 +37,7 @@ extern "C"
37#endif 37#endif
38 38
39#include "gnunet_common.h" 39#include "gnunet_common.h"
40#include "gnunet_bandwidth_lib.h"
40#include "gnunet_bio_lib.h" 41#include "gnunet_bio_lib.h"
41#include "gnunet_client_lib.h" 42#include "gnunet_client_lib.h"
42#include "gnunet_configuration_lib.h" 43#include "gnunet_configuration_lib.h"