REST/NAMESTORE: rework API
[oweals/gnunet.git] / src / ats-tests / ats-testing-preferences.c
index ba69ae8c5deae3c8cd6c3aa7960d2883911bdaf3..ba2f133b93b80cea2b15d2fdf38ad3245b70c1a8 100644 (file)
@@ -1,21 +1,21 @@
 /*
  This file is part of GNUnet.
- (C) 2010-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010-2013 GNUnet e.V.
 
- GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
 
  GNUnet is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
Affero General Public License for more details.
 
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING.  If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ You should have received a copy of the GNU Affero General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+     SPDX-License-Identifier: AGPL3.0-or-later
  */
 /**
  * @file ats-tests/ats-testing-preferences.c
@@ -91,8 +91,7 @@ get_preference (struct PreferenceGenerator *pg)
 
 
 static void
-set_pref_task (void *cls,
-                    const struct GNUNET_SCHEDULER_TaskContext *tc)
+set_pref_task (void *cls)
 {
   struct BenchmarkPartner *p = cls;
   double pref_value;
@@ -106,7 +105,10 @@ set_pref_task (void *cls,
       GNUNET_ATS_print_preference_type (p->pg->kind), pref_value);
 
   GNUNET_ATS_performance_change_preference(p->me->ats_perf_handle,
-      &p->dest->id, p->pg->kind, pref_value, GNUNET_ATS_PREFERENCE_END);
+                                           &p->dest->id,
+                                           p->pg->kind,
+                                           pref_value,
+                                           GNUNET_ATS_PREFERENCE_END);
 
   switch (p->pg->kind) {
     case GNUNET_ATS_PREFERENCE_BANDWIDTH:
@@ -141,13 +143,13 @@ set_pref_task (void *cls,
  */
 struct PreferenceGenerator *
 GNUNET_ATS_TEST_generate_preferences_start (struct BenchmarkPeer *src,
-    struct BenchmarkPartner *dest,
-    enum GeneratorType type,
-    long int base_value,
-    long int value_rate,
-    struct GNUNET_TIME_Relative period,
-    struct GNUNET_TIME_Relative frequency,
-    enum GNUNET_ATS_PreferenceKind kind)
+                                            struct BenchmarkPartner *dest,
+                                            enum GeneratorType type,
+                                            unsigned int base_value,
+                                            unsigned int value_rate,
+                                            struct GNUNET_TIME_Relative period,
+                                            struct GNUNET_TIME_Relative frequency,
+                                            enum GNUNET_ATS_PreferenceKind kind)
 {
   struct PreferenceGenerator *pg;
 
@@ -172,31 +174,31 @@ GNUNET_ATS_TEST_generate_preferences_start (struct BenchmarkPeer *src,
   switch (type) {
     case GNUNET_ATS_TEST_TG_CONSTANT:
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-          "Setting up constant preference generator master[%u] `%s' and slave [%u] `%s' max %u Bips\n",
-          dest->me->no, GNUNET_i2s (&dest->me->id),
-          dest->dest->no, GNUNET_i2s (&dest->dest->id),
-          base_value);
+                  "Setting up constant preference generator master[%u] `%s' and slave [%u] `%s' max %u Bips\n",
+                  dest->me->no, GNUNET_i2s (&dest->me->id),
+                  dest->dest->no, GNUNET_i2s (&dest->dest->id),
+                  base_value);
       break;
     case GNUNET_ATS_TEST_TG_LINEAR:
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-          "Setting up linear preference generator master[%u] `%s' and slave [%u] `%s' min %u Bips max %u Bips\n",
-          dest->me->no, GNUNET_i2s (&dest->me->id),
-          dest->dest->no, GNUNET_i2s (&dest->dest->id),
-          base_value, value_rate);
+                  "Setting up linear preference generator master[%u] `%s' and slave [%u] `%s' min %u Bips max %u Bips\n",
+                  dest->me->no, GNUNET_i2s (&dest->me->id),
+                  dest->dest->no, GNUNET_i2s (&dest->dest->id),
+                  base_value, value_rate);
       break;
     case GNUNET_ATS_TEST_TG_SINUS:
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-          "Setting up sinus preference generator master[%u] `%s' and slave [%u] `%s' baserate %u Bips, amplitude %u Bps\n",
-          dest->me->no, GNUNET_i2s (&dest->me->id),
-          dest->dest->no, GNUNET_i2s (&dest->dest->id),
-          base_value, value_rate);
+                  "Setting up sinus preference generator master[%u] `%s' and slave [%u] `%s' baserate %u Bips, amplitude %u Bps\n",
+                  dest->me->no, GNUNET_i2s (&dest->me->id),
+                  dest->dest->no, GNUNET_i2s (&dest->dest->id),
+                  base_value, value_rate);
       break;
     case GNUNET_ATS_TEST_TG_RANDOM:
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-          "Setting up random preference generator master[%u] `%s' and slave [%u] `%s' min %u Bips max %u Bps\n",
-          dest->me->no, GNUNET_i2s (&dest->me->id),
-          dest->dest->no, GNUNET_i2s (&dest->dest->id),
-          base_value, value_rate);
+                  "Setting up random preference generator master[%u] `%s' and slave [%u] `%s' min %u Bips max %u Bps\n",
+                  dest->me->no, GNUNET_i2s (&dest->me->id),
+                  dest->dest->no, GNUNET_i2s (&dest->dest->id),
+                  base_value, value_rate);
       break;
     default:
       break;
@@ -241,4 +243,3 @@ GNUNET_ATS_TEST_generate_preferences_stop_all ()
 }
 
 /* end of file ats-testing-preferences.c */
-