add nick name for cached records
[oweals/gnunet.git] / src / ats-tool / gnunet-ats.c
index 2fd30c1a55d9ff1c54e58dcc078977ae7e5e7666..a873ab0f2c66444d31df09eebe3251f7f8504f07 100644 (file)
@@ -110,7 +110,7 @@ static struct PendingResolutions *head;
 static struct PendingResolutions *tail;
 
 
-static void 
+static void
 end (void *cls,
      const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
@@ -149,7 +149,7 @@ end (void *cls,
 }
 
 
-static void 
+static void
 transport_addr_to_str_cb (void *cls, const char *address)
 {
   struct PendingResolutions * pr = cls;
@@ -226,7 +226,7 @@ transport_addr_to_str_cb (void *cls, const char *address)
 }
 
 
-static void 
+static void
 ats_perf_cb (void *cls,
             const struct GNUNET_HELLO_Address *address,
             int active,
@@ -250,7 +250,9 @@ ats_perf_cb (void *cls,
     pr->bandwidth_in = bandwidth_in;
     pr->bandwidth_out = bandwidth_out;
     pr->tats_ctx = GNUNET_TRANSPORT_address_to_string(cfg, address,
-                      resolve_addresses_numeric, GNUNET_TIME_UNIT_FOREVER_REL, transport_addr_to_str_cb, pr);
+                      resolve_addresses_numeric,
+                                                         GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10),
+                      transport_addr_to_str_cb, pr);
     GNUNET_CONTAINER_DLL_insert (head, tail, pr);
     results++;
     pending++;
@@ -350,7 +352,9 @@ testservice_ats (void *cls,
 
   if (NULL != pid_str)
   {
-    if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (pid_str, &pid.hashPubKey))
+    if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (pid_str,
+                                                                   strlen (pid_str),
+                                                                   &pid.public_key))
     {
       FPRINTF (stderr, _("Failed to parse peer identity `%s'\n"), pid_str);
       return;
@@ -452,7 +456,7 @@ testservice_ats (void *cls,
             if (NULL == ph)
               fprintf (stderr, _("Cannot connect to ATS service, exiting...\n"));
 
-            GNUNET_ATS_change_preference (ph, &pid, type, (double) value, GNUNET_ATS_PREFERENCE_END);
+            GNUNET_ATS_performance_change_preference (ph, &pid, type, (double) value, GNUNET_ATS_PREFERENCE_END);
 
             end_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &end, NULL);
     }