get quota config
authorChristian Grothoff <christian@grothoff.org>
Sun, 16 Oct 2011 13:56:18 +0000 (13:56 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 16 Oct 2011 13:56:18 +0000 (13:56 +0000)
src/ats/gnunet-service-ats.c
src/ats/gnunet-service-ats_scheduling.c
src/ats/gnunet-service-ats_scheduling.h

index 14bb963b91543592ce082b731d455b7b5edfc328..d3f81865304d8dd6d5d6c1ac3bb237cdc3b8e2ca 100644 (file)
@@ -131,7 +131,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   };
   GAS_reservations_init ();
   GAS_performance_init (server);
-  GAS_scheduling_init (server);
+  GAS_scheduling_init (server, cfg);
   GAS_addresses_init ();
   GNUNET_SERVER_disconnect_notify (server, 
                                   &client_disconnect_handler,
index 9eebe2c3e7caecacc05351ea2dd06560d50adddb..8125b8664c2e538b451a89545a58f09d6a176de7 100644 (file)
@@ -73,6 +73,10 @@ static struct SchedulingClient *sc_tail;
  */
 static struct GNUNET_SERVER_NotificationContext *nc;
 
+static unsigned long long total_quota_in;
+
+static unsigned long long total_quota_out;
+
 
 /**
  * Find the scheduling client associated with the given
@@ -355,10 +359,22 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
  * Initialize scheduling subsystem.
  *
  * @param server handle to our server
+ * @param cfg configuration to use
  */
 void
-GAS_scheduling_init (struct GNUNET_SERVER_Handle *server)
+GAS_scheduling_init (struct GNUNET_SERVER_Handle *server,
+                    const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
+  GNUNET_assert (GNUNET_OK ==
+                GNUNET_CONFIGURATION_get_value_number (cfg,
+                                                       "core",
+                                                       "TOTAL_QUOTA_IN",
+                                                       &total_quota_in));
+  GNUNET_assert (GNUNET_OK ==
+                GNUNET_CONFIGURATION_get_value_number (cfg,
+                                                       "core",
+                                                       "TOTAL_QUOTA_OUT",
+                                                       &total_quota_out));
   nc = GNUNET_SERVER_notification_context_create (server, 128);
 }
 
index 8d6fa977d28973ad1edf0fbe6fb5dee9797699c2..273126fffa2f5a8de3ebc747e9ece5b20d877bcb 100644 (file)
@@ -117,9 +117,11 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
  * Initialize scheduling subsystem.
  *
  * @param server handle to our server
+ * @param cfg configuration to use
  */
 void
-GAS_scheduling_init (struct GNUNET_SERVER_Handle *server);
+GAS_scheduling_init (struct GNUNET_SERVER_Handle *server,
+                    const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
 /**