print active/inactive information
[oweals/gnunet.git] / src / regex / gnunet-service-regex.c
index e44d11b7d0a2d9bb38ae00bd5c1a5f0215ee0e33..6daab0be3be7dd2e8803025e88fdef86bb7caf0c 100644 (file)
@@ -102,7 +102,7 @@ static struct GNUNET_SERVER_NotificationContext *nc;
 /**
  * Private key for this peer.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 
 /**
@@ -120,7 +120,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   stats = NULL;
   GNUNET_SERVER_notification_context_destroy (nc);
   nc = NULL;
-  GNUNET_CRYPTO_ecc_key_free (my_private_key);
+  GNUNET_free (my_private_key);
   my_private_key = NULL;
 }
 
@@ -193,7 +193,7 @@ reannounce (void *cls,
  * @param message the actual message
  */
 static void
-handle_announce (void *cls, 
+handle_announce (void *cls,
                 struct GNUNET_SERVER_Client *client,
                 const struct GNUNET_MessageHeader *message)
 {
@@ -238,7 +238,7 @@ handle_announce (void *cls,
     return;
   }
   GNUNET_CONTAINER_DLL_insert (client_head,
-                              client_tail, 
+                              client_tail,
                               ce);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }
@@ -254,7 +254,7 @@ handle_announce (void *cls,
  * @param put_path Path of the put request.
  * @param put_path_length Length of the put_path.
  */
-static void 
+static void
 handle_search_result (void *cls,
                      const struct GNUNET_PeerIdentity *id,
                      const struct GNUNET_PeerIdentity *get_path,
@@ -283,11 +283,11 @@ handle_search_result (void *cls,
   result->put_path_length = htons ((uint16_t) put_path_length);
   result->id = *id;
   gp = &result->id;
-  memcpy (&gp[1], 
+  memcpy (&gp[1],
          get_path,
          get_path_length * sizeof (struct GNUNET_PeerIdentity));
-  memcpy (&gp[1 + get_path_length], 
-         put_path, 
+  memcpy (&gp[1 + get_path_length],
+         put_path,
          put_path_length * sizeof (struct GNUNET_PeerIdentity));
   GNUNET_SERVER_notification_context_unicast (nc,
                                              ce->client,
@@ -304,20 +304,20 @@ handle_search_result (void *cls,
  * @param message the actual message
  */
 static void
-handle_search (void *cls, 
+handle_search (void *cls,
               struct GNUNET_SERVER_Client *client,
               const struct GNUNET_MessageHeader *message)
 {
-  const struct SearchMessage *sm;
+  const struct RegexSearchMessage *sm;
   const char *string;
   struct ClientEntry *ce;
   uint16_t size;
 
   size = ntohs (message->size);
-  sm = (const struct SearchMessage *) message;
+  sm = (const struct RegexSearchMessage *) message;
   string = (const char *) &sm[1];
-  if ( (size <= sizeof (struct SearchMessage)) ||
-       ('\0' != string[size - sizeof (struct SearchMessage) - 1]) )
+  if ( (size <= sizeof (struct RegexSearchMessage)) ||
+       ('\0' != string[size - sizeof (struct RegexSearchMessage) - 1]) )
   {
     GNUNET_break (0);
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -338,7 +338,7 @@ handle_search (void *cls,
     return;
   }
   GNUNET_CONTAINER_DLL_insert (client_head,
-                              client_tail, 
+                              client_tail,
                               ce);
   GNUNET_SERVER_notification_context_add (nc, client);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -362,16 +362,16 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
     {NULL, NULL, 0, 0}
   };
 
-  my_private_key = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
+  my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
   if (NULL == my_private_key)
-  {   
+  {
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
   dht = GNUNET_DHT_connect (cfg, 1024);
   if (NULL == dht)
   {
-    GNUNET_CRYPTO_ecc_key_free (my_private_key);
+    GNUNET_free (my_private_key);
     my_private_key = NULL;
     GNUNET_SCHEDULER_shutdown ();
     return;