-improve UDP logging
[oweals/gnunet.git] / src / regex / gnunet-daemon-regexprofiler.c
index 0fb47d23a6e17d8d27314027388af9d720444396..449f692c16bc3ff263eb74df52cb4658dc8f61f1 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2012, 2013 Christian Grothoff
+     Copyright (C) 2012, 2013 Christian Grothoff
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -20,9 +20,9 @@
 
 /**
  * @file regex/gnunet-daemon-regexprofiler.c
- * @brief daemon that uses mesh to announce a regular expression. Used in
+ * @brief daemon that uses cadet to announce a regular expression. Used in
  * conjunction with gnunet-regex-profiler to announce regexes on serveral peers
- * without the need to explicitly connect to the mesh service running on the
+ * without the need to explicitly connect to the cadet service running on the
  * peer from within the profiler.
  * @author Maximilian Szengel
  * @author Bartlomiej Polot
@@ -62,7 +62,7 @@ static struct REGEX_INTERNAL_Announcement *announce_handle;
 /**
  * Periodically reannounce regex.
  */
-static GNUNET_SCHEDULER_TaskIdentifier reannounce_task;
+static struct GNUNET_SCHEDULER_Task * reannounce_task;
 
 /**
  * What's the maximum reannounce period.
@@ -98,7 +98,7 @@ static unsigned int rounds = 3;
 /**
  * Private key for this peer.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 
 
@@ -135,7 +135,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 /**
  * Announce a previously announced regex re-using cached data.
- * 
+ *
  * @param cls Closure (regex to announce if needed).
  * @param tc TaskContext.
  */
@@ -145,7 +145,7 @@ reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct GNUNET_TIME_Relative random_delay;
   char *regex = cls;
 
-  reannounce_task = GNUNET_SCHEDULER_NO_TASK;
+  reannounce_task = NULL;
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
   {
     GNUNET_free (regex);
@@ -192,7 +192,7 @@ reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * Announce the given regular expression using regex and the path compression
  * length read from config.
  *
- * @param regex regular expression to announce on this peer's mesh.
+ * @param regex regular expression to announce on this peer's cadet.
  */
 static void
 announce_regex (const char * regex)
@@ -208,7 +208,7 @@ announce_regex (const char * regex)
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Daemon for %s starting\n",
               policy_filename);
-  GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == reannounce_task);
+  GNUNET_assert (NULL == reannounce_task);
   copy = GNUNET_strdup (regex);
   reannounce_task = GNUNET_SCHEDULER_add_now (reannounce_regex, (void *) copy);
 }
@@ -258,7 +258,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
 
   cfg = cfg_;
 
-  my_private_key = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
+  my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
   GNUNET_assert (NULL != my_private_key);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (cfg, "REGEXPROFILER",
@@ -309,7 +309,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
                                            "REANNOUNCE_PERIOD_MAX",
                                            &reannounce_period_max))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "reannounce_period_max not given. Using 10 minutes.\n");
     reannounce_period_max =
       GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 10);
@@ -377,7 +377,7 @@ main (int argc, char *const *argv)
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc, argv, "regexprofiler",
                               gettext_noop
-                              ("Daemon to announce regular expressions for the peer using mesh."),
+                              ("Daemon to announce regular expressions for the peer using cadet."),
                               options, &run, NULL)) ? global_ret : 1;
 }