REST: nothing triggers rest
[oweals/gnunet.git] / src / ats / perf_ats_solver.c
index 7d3ff180b54a256c31799425af0c8c4770393a10..33180a953adea101c9ad8e2a06e308fb57dbb6e8 100644 (file)
@@ -3,7 +3,7 @@
  Copyright (C) 2010,2011 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
+ 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.
 
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Affero General Public License for more details.
+
+ 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/perf_ats_solver.c
@@ -1108,11 +1113,11 @@ perf_run_iteration (void)
       /* Add address */
 
       /* Random network selection */
-      //net = 1 + GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_ATS_NetworkTypeCount - 1);
+      //net = 1 + GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_NT_COUNT - 1);
       /* Random equally distributed network selection */
-      net = 1 + (ca %  (GNUNET_ATS_NetworkTypeCount - 1));
+      net = 1 + (ca %  (GNUNET_NT_COUNT - 1));
       /* fprintf (stderr, "Network: %u `%s'\n",
-       * mod_net , GNUNET_ATS_print_network_type(mod_net)); */
+       * mod_net , GNUNET_NT_to_string(mod_net)); */
 
       cur_addr->atsi = GNUNET_new (struct GNUNET_ATS_Information);
       cur_addr->atsi_count = 1;
@@ -1124,7 +1129,7 @@ perf_run_iteration (void)
       perf_address_initial_update (NULL, ph.addresses, cur_addr);
       GNUNET_log(GNUNET_ERROR_TYPE_INFO,
           "Adding address for peer %u address %u in network %s\n", cp, ca,
-          GNUNET_ATS_print_network_type(net));
+          GNUNET_NT_to_string(net));
     }
     /* Notify solver about request */
     ph.sf->s_get (ph.sf->cls, &ph.peers[cp].id);
@@ -1207,8 +1212,8 @@ run (void *cls, char * const *args, const char *cfgfile,
   char *solver;
   char *plugin;
   struct GNUNET_CONFIGURATION_Handle *solver_cfg;
-  unsigned long long quotas_in[GNUNET_ATS_NetworkTypeCount];
-  unsigned long long quotas_out[GNUNET_ATS_NetworkTypeCount];
+  unsigned long long quotas_in[GNUNET_NT_COUNT];
+  unsigned long long quotas_out[GNUNET_NT_COUNT];
   int c;
   int c2;
 
@@ -1283,8 +1288,8 @@ run (void *cls, char * const *args, const char *cfgfile,
     end_now (1);
     return;
   }
-  if (GNUNET_ATS_NetworkTypeCount != load_quotas (solver_cfg,
-      quotas_out, quotas_in, GNUNET_ATS_NetworkTypeCount))
+  if (GNUNET_NT_COUNT != load_quotas (solver_cfg,
+      quotas_out, quotas_in, GNUNET_NT_COUNT))
   {
     GNUNET_break(0);
     end_now (1);
@@ -1303,16 +1308,16 @@ run (void *cls, char * const *args, const char *cfgfile,
   ph.env.bandwidth_changed_cb = bandwidth_changed_cb;
   ph.env.get_connectivity = &get_connectivity_cb;
   ph.env.get_preferences = &get_preferences_cb;
-  ph.env.network_count = GNUNET_ATS_NetworkTypeCount;
+  ph.env.network_count = GNUNET_NT_COUNT;
   ph.env.info_cb = &solver_info_cb;
 
-  for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++)
+  for (c = 0; c < GNUNET_NT_COUNT; c++)
   {
     ph.env.out_quota[c] = quotas_out[c];
     ph.env.in_quota[c] = quotas_in[c];
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Loading network quotas: `%s' %llu %llu \n",
-                GNUNET_ATS_print_network_type (c),
+                GNUNET_NT_to_string (c),
                 ph.env.out_quota[c],
                 ph.env.in_quota[c]);
   }