aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-16 13:58:36 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-16 13:58:36 +0000
commit3a6c268283d47fd7408063b4b953d5d3cbfa4b11 (patch)
tree187b9bcbcefb7fd9e6a1dc41cc6d036fb9c1b358 /src/ats
parent5419748cc47ea35b77a616ff269aae822cab8cea (diff)
downloadgnunet-3a6c268283d47fd7408063b4b953d5d3cbfa4b11.tar.gz
gnunet-3a6c268283d47fd7408063b4b953d5d3cbfa4b11.zip
move get quota config to addrs
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/gnunet-service-ats.c4
-rw-r--r--src/ats/gnunet-service-ats_addresses.c19
-rw-r--r--src/ats/gnunet-service-ats_addresses.h3
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c18
-rw-r--r--src/ats/gnunet-service-ats_scheduling.h4
5 files changed, 24 insertions, 24 deletions
diff --git a/src/ats/gnunet-service-ats.c b/src/ats/gnunet-service-ats.c
index d3f818653..a2c0e8c73 100644
--- a/src/ats/gnunet-service-ats.c
+++ b/src/ats/gnunet-service-ats.c
@@ -131,8 +131,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
131 }; 131 };
132 GAS_reservations_init (); 132 GAS_reservations_init ();
133 GAS_performance_init (server); 133 GAS_performance_init (server);
134 GAS_scheduling_init (server, cfg); 134 GAS_scheduling_init (server);
135 GAS_addresses_init (); 135 GAS_addresses_init (cfg);
136 GNUNET_SERVER_disconnect_notify (server, 136 GNUNET_SERVER_disconnect_notify (server,
137 &client_disconnect_handler, 137 &client_disconnect_handler,
138 NULL); 138 NULL);
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 17675ed94..eda7093e7 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -55,6 +55,11 @@ struct ATS_Address
55static struct GNUNET_CONTAINER_MultiHashMap * addresses; 55static struct GNUNET_CONTAINER_MultiHashMap * addresses;
56 56
57 57
58static unsigned long long total_quota_in;
59
60static unsigned long long total_quota_out;
61
62
58struct CompareAddressContext 63struct CompareAddressContext
59{ 64{
60 struct ATS_Address * search; 65 struct ATS_Address * search;
@@ -252,10 +257,22 @@ GAS_addresses_request_address (const struct GNUNET_PeerIdentity *peer)
252 257
253/** 258/**
254 * Initialize address subsystem. 259 * Initialize address subsystem.
260 *
261 * @param cfg configuration to use
255 */ 262 */
256void 263void
257GAS_addresses_init () 264GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
258{ 265{
266 GNUNET_assert (GNUNET_OK ==
267 GNUNET_CONFIGURATION_get_value_number (cfg,
268 "core",
269 "TOTAL_QUOTA_IN",
270 &total_quota_in));
271 GNUNET_assert (GNUNET_OK ==
272 GNUNET_CONFIGURATION_get_value_number (cfg,
273 "core",
274 "TOTAL_QUOTA_OUT",
275 &total_quota_out));
259 addresses = GNUNET_CONTAINER_multihashmap_create(128); 276 addresses = GNUNET_CONTAINER_multihashmap_create(128);
260} 277}
261 278
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h
index dc70bf553..849e9b31a 100644
--- a/src/ats/gnunet-service-ats_addresses.h
+++ b/src/ats/gnunet-service-ats_addresses.h
@@ -32,9 +32,10 @@
32 32
33/** 33/**
34 * Initialize address subsystem. 34 * Initialize address subsystem.
35 * @param cfg configuration to use
35 */ 36 */
36void 37void
37GAS_addresses_init (void); 38GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
38 39
39 40
40/** 41/**
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index 8125b8664..ca4e86ca4 100644
--- a/src/ats/gnunet-service-ats_scheduling.c
+++ b/src/ats/gnunet-service-ats_scheduling.c
@@ -73,10 +73,6 @@ static struct SchedulingClient *sc_tail;
73 */ 73 */
74static struct GNUNET_SERVER_NotificationContext *nc; 74static struct GNUNET_SERVER_NotificationContext *nc;
75 75
76static unsigned long long total_quota_in;
77
78static unsigned long long total_quota_out;
79
80 76
81/** 77/**
82 * Find the scheduling client associated with the given 78 * Find the scheduling client associated with the given
@@ -359,22 +355,10 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
359 * Initialize scheduling subsystem. 355 * Initialize scheduling subsystem.
360 * 356 *
361 * @param server handle to our server 357 * @param server handle to our server
362 * @param cfg configuration to use
363 */ 358 */
364void 359void
365GAS_scheduling_init (struct GNUNET_SERVER_Handle *server, 360GAS_scheduling_init (struct GNUNET_SERVER_Handle *server)
366 const struct GNUNET_CONFIGURATION_Handle *cfg)
367{ 361{
368 GNUNET_assert (GNUNET_OK ==
369 GNUNET_CONFIGURATION_get_value_number (cfg,
370 "core",
371 "TOTAL_QUOTA_IN",
372 &total_quota_in));
373 GNUNET_assert (GNUNET_OK ==
374 GNUNET_CONFIGURATION_get_value_number (cfg,
375 "core",
376 "TOTAL_QUOTA_OUT",
377 &total_quota_out));
378 nc = GNUNET_SERVER_notification_context_create (server, 128); 362 nc = GNUNET_SERVER_notification_context_create (server, 128);
379} 363}
380 364
diff --git a/src/ats/gnunet-service-ats_scheduling.h b/src/ats/gnunet-service-ats_scheduling.h
index 273126fff..8d6fa977d 100644
--- a/src/ats/gnunet-service-ats_scheduling.h
+++ b/src/ats/gnunet-service-ats_scheduling.h
@@ -117,11 +117,9 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
117 * Initialize scheduling subsystem. 117 * Initialize scheduling subsystem.
118 * 118 *
119 * @param server handle to our server 119 * @param server handle to our server
120 * @param cfg configuration to use
121 */ 120 */
122void 121void
123GAS_scheduling_init (struct GNUNET_SERVER_Handle *server, 122GAS_scheduling_init (struct GNUNET_SERVER_Handle *server);
124 const struct GNUNET_CONFIGURATION_Handle *cfg);
125 123
126 124
127/** 125/**