-bump name to 97
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_local.c
index 989def2112fe8948d6037be3e16e4b37478f8e93..9714034ba44f1f9c4e237952c41e176adcc2e396 100644 (file)
 
 
 #include "platform.h"
+#include "gnunet_util_lib.h"
+
+#include "gnunet_statistics_service.h"
+
 #include "mesh_enc.h"
 #include "mesh_protocol_enc.h" // GNUNET_MESH_Data is shared
+
 #include "gnunet-service-mesh_local.h"
+#include "gnunet-service-mesh_tunnel.h"
+
+#define LOG(level, ...) GNUNET_log_from(level,"mesh-loc",__VA_ARGS__)
 
 /******************************************************************************/
 /********************************   STRUCTS  **********************************/
@@ -30,7 +38,7 @@
 
 /**
  * Struct containing information about a client of the service
- * 
+ *
  * TODO: add a list of 'waiting' ports
  */
 struct MeshClient
@@ -82,6 +90,11 @@ struct MeshClient
 /*******************************   GLOBALS  ***********************************/
 /******************************************************************************/
 
+/**
+ * Global handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
+
 /**
  * Handle to server lib.
  */
@@ -137,7 +150,7 @@ client_release_ports (void *cls,
   if (GNUNET_YES != res)
   {
     GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+    LOG (GNUNET_ERROR_TYPE_WARNING,
                 "Port %u by client %p was not registered.\n",
                 key, value);
   }
@@ -157,8 +170,8 @@ client_release_ports (void *cls,
  * @param cls Closure (unused).
  * @param client Client handler.
  */
-void
-GMLH_client_connect (void *cls, struct GNUNET_SERVER_Client *client)
+static void
+handle_client_connect (void *cls, struct GNUNET_SERVER_Client *client)
 {
   struct MeshClient *c;
 
@@ -180,22 +193,22 @@ GMLH_client_connect (void *cls, struct GNUNET_SERVER_Client *client)
  * @param client identification of the client; NULL
  *        for the last call when the server is destroyed
  */
-void
-GMLH_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
+static void
+handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
 {
   struct MeshClient *c;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "client disconnected: %p\n", client);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "client disconnected: %p\n", client);
   if (client == NULL)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   (SERVER DOWN)\n");
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "   (SERVER DOWN)\n");
     return;
   }
 
   c = client_get (client);
   if (NULL != c)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "matching client found (%u, %p)\n",
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "matching client found (%u, %p)\n",
                 c->id, c);
     GNUNET_SERVER_client_drop (c->handle);
     c->shutting_down = GNUNET_YES;
@@ -221,14 +234,14 @@ GMLH_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
     }
     GNUNET_CONTAINER_DLL_remove (clients_head, clients_tail, c);
     GNUNET_STATISTICS_update (stats, "# clients", -1, GNUNET_NO);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  client free (%p)\n", c);
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "  client free (%p)\n", c);
     GNUNET_free (c);
   }
   else
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, " context NULL!\n");
+    LOG (GNUNET_ERROR_TYPE_WARNING, " context NULL!\n");
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "done!\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "done!\n");
   return;
 }
 
@@ -240,9 +253,9 @@ GMLH_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
  * @param client identification of the client
  * @param message the actual message, which includes messages the client wants
  */
-void
-GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client,
-                         const struct GNUNET_MessageHeader *message)
+static void
+handle_new_client (void *cls, struct GNUNET_SERVER_Client *client,
+                   const struct GNUNET_MessageHeader *message)
 {
   struct GNUNET_MESH_ClientConnect *cc_msg;
   struct MeshClient *c;
@@ -250,7 +263,7 @@ GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client,
   uint32_t *p;
   unsigned int i;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "new client connected %p\n", client);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "new client connected %p\n", client);
 
   /* Check data sanity */
   size = ntohs (message->size) - sizeof (struct GNUNET_MESH_ClientConnect);
@@ -265,8 +278,8 @@ GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client,
 
   /* Initialize new client structure */
   c = GNUNET_SERVER_client_get_user_context (client, struct MeshClient);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  client id %u\n", c->id);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  client has %u ports\n", size);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  client id %u\n", c->id);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  client has %u ports\n", size);
   if (size > 0)
   {
     uint32_t u32;
@@ -276,7 +289,7 @@ GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client,
     for (i = 0; i < size; i++)
     {
       u32 = ntohl (p[i]);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "    port: %u\n", u32);
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "    port: %u\n", u32);
 
       /* store in client's hashmap */
       GNUNET_CONTAINER_multihashmap32_put (c->ports, u32, c,
@@ -295,7 +308,7 @@ GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client,
   GNUNET_STATISTICS_update (stats, "# clients", 1, GNUNET_NO);
 
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "new client processed\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "new client processed\n");
 }
 
 
@@ -306,9 +319,9 @@ GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client,
  * @param client Identification of the client.
  * @param message The actual message.
  */
-void
-GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
-                            const struct GNUNET_MessageHeader *message)
+static void
+handle_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
+                       const struct GNUNET_MessageHeader *message)
 {
   struct GNUNET_MESH_ChannelMessage *msg;
   struct MeshPeer *peer;
@@ -317,7 +330,7 @@ GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
   struct MeshClient *c;
   MESH_ChannelNumber chid;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "new channel requested\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "new channel requested\n");
 
   /* Sanity check for client registration */
   if (NULL == (c = client_get (client)))
@@ -326,7 +339,7 @@ GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
 
   /* Message size sanity check */
   if (sizeof (struct GNUNET_MESH_ChannelMessage) != ntohs (message->size))
@@ -337,7 +350,7 @@ GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
   }
 
   msg = (struct GNUNET_MESH_ChannelMessage *) message;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  towards %s:%u\n",
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  towards %s:%u\n",
               GNUNET_i2s (&msg->peer), ntohl (msg->port));
   chid = ntohl (msg->channel_id);
 
@@ -381,7 +394,7 @@ GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
   ch->root_rel->ch = ch;
   ch->root_rel->expected_delay = MESH_RETRANSMIT_TIME;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s[%x]:%u (%x)\n",
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s[%x]:%u (%x)\n",
               peer2s (t->peer), ch->gid, ch->port, ch->lid_root);
 
   /* Send create channel */
@@ -394,7 +407,7 @@ GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
     msgcc.port = msg->port;
     msgcc.opt = msg->opt;
 
-    tunnel_queue_data (t, ch, &msgcc.header, GNUNET_YES);
+    GMT_queue_data (t, ch, &msgcc.header, GNUNET_YES);
   }
 
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -409,9 +422,9 @@ GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
  * @param client identification of the client
  * @param message the actual message
  */
-void
-GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
-                             const struct GNUNET_MessageHeader *message)
+static void
+handle_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
+                        const struct GNUNET_MessageHeader *message)
 {
   struct GNUNET_MESH_ChannelMessage *msg;
   struct MeshClient *c;
@@ -419,7 +432,7 @@ GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
   struct MeshTunnel2 *t;
   MESH_ChannelNumber chid;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
               "Got a DESTROY CHANNEL from client!\n");
 
   /* Sanity check for client registration */
@@ -429,7 +442,7 @@ GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
 
   /* Message sanity check */
   if (sizeof (struct GNUNET_MESH_ChannelMessage) != ntohs (message->size))
@@ -446,7 +459,7 @@ GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
   ch = channel_get_by_local_id (c, chid);
   if (NULL == ch)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "  channel %X not found\n", chid);
+    LOG (GNUNET_ERROR_TYPE_ERROR, "  channel %X not found\n", chid);
     GNUNET_break (0);
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
@@ -462,9 +475,9 @@ GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
   {
     ch->root = NULL;
   }
-  else 
+  else
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+    LOG (GNUNET_ERROR_TYPE_ERROR,
                 "  channel %X client %p (%p, %p)\n",
                 chid, c, ch->root, ch->dest);
     GNUNET_break (0);
@@ -486,9 +499,9 @@ GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
  * @param client identification of the client
  * @param message the actual message
  */
-void
-GMLH_data (void *cls, struct GNUNET_SERVER_Client *client,
-                   const struct GNUNET_MessageHeader *message)
+static void
+handle_data (void *cls, struct GNUNET_SERVER_Client *client,
+             const struct GNUNET_MessageHeader *message)
 {
   struct GNUNET_MESH_LocalData *msg;
   struct MeshClient *c;
@@ -498,7 +511,7 @@ GMLH_data (void *cls, struct GNUNET_SERVER_Client *client,
   size_t size;
   int fwd;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
               "Got data from a client!\n");
 
   /* Sanity check for client registration */
@@ -508,7 +521,7 @@ GMLH_data (void *cls, struct GNUNET_SERVER_Client *client,
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
 
   msg = (struct GNUNET_MESH_LocalData *) message;
 
@@ -538,7 +551,7 @@ GMLH_data (void *cls, struct GNUNET_SERVER_Client *client,
            ch->root->handle == client)
          ||
           (!fwd &&
-           ch->dest && 
+           ch->dest &&
            ch->dest->handle == client) ) )
   {
     GNUNET_break (0);
@@ -562,7 +575,7 @@ GMLH_data (void *cls, struct GNUNET_SERVER_Client *client,
     payload->header.size = htons (p2p_size);
     payload->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_DATA);
     payload->chid = htonl (ch->gid);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  sending on channel...\n");
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "  sending on channel...\n");
     send_prebuilt_message_channel (&payload->header, ch, fwd);
 
     if (GNUNET_YES == ch->reliable)
@@ -570,7 +583,7 @@ GMLH_data (void *cls, struct GNUNET_SERVER_Client *client,
   }
   if (tunnel_get_buffer (ch->t, fwd) > 0)
     send_local_ack (ch, fwd);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "receive done OK\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "receive done OK\n");
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 
   return;
@@ -584,9 +597,9 @@ GMLH_data (void *cls, struct GNUNET_SERVER_Client *client,
  * @param client Identification of the client.
  * @param message The actual message.
  */
-void
-GMLH_ack (void *cls, struct GNUNET_SERVER_Client *client,
-                  const struct GNUNET_MessageHeader *message)
+static void
+handle_ack (void *cls, struct GNUNET_SERVER_Client *client,
+            const struct GNUNET_MessageHeader *message)
 {
   struct GNUNET_MESH_LocalAck *msg;
   struct MeshChannelReliability *rel;
@@ -595,7 +608,7 @@ GMLH_ack (void *cls, struct GNUNET_SERVER_Client *client,
   MESH_ChannelNumber chid;
   int fwd;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got a local ACK\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Got a local ACK\n");
 
   /* Sanity check for client registration */
   if (NULL == (c = client_get (client)))
@@ -604,20 +617,20 @@ GMLH_ack (void *cls, struct GNUNET_SERVER_Client *client,
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  by client %u\n", c->id);
 
   msg = (struct GNUNET_MESH_LocalAck *) message;
 
   /* Channel exists? */
   chid = ntohl (msg->channel_id);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  on channel %X\n", chid);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  on channel %X\n", chid);
   ch = channel_get_by_local_id (c, chid);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   -- ch %p\n", ch);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "   -- ch %p\n", ch);
   if (NULL == ch)
   {
     GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Channel %X unknown.\n", chid);
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "  for client %u.\n", c->id);
+    LOG (GNUNET_ERROR_TYPE_WARNING, "Channel %X unknown.\n", chid);
+    LOG (GNUNET_ERROR_TYPE_WARNING, "  for client %u.\n", c->id);
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
@@ -654,16 +667,16 @@ GMLH_ack (void *cls, struct GNUNET_SERVER_Client *client,
 //   struct GNUNET_SERVER_Client *client = cls;
 //   struct MeshChannel *ch = value;
 //   struct GNUNET_MESH_LocalMonitor *msg;
-// 
+//
 //   msg = GNUNET_malloc (sizeof(struct GNUNET_MESH_LocalMonitor));
 //   msg->channel_id = htonl (ch->gid);
 //   msg->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor));
 //   msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS);
-// 
-//   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+//
+//   LOG (GNUNET_ERROR_TYPE_INFO,
 //               "*  sending info about tunnel %s\n",
 //               GNUNET_i2s (&msg->owner));
-// 
+//
 //   GNUNET_SERVER_notification_context_unicast (nc, client,
 //                                               &msg->header, GNUNET_NO);
 //   return GNUNET_YES;
@@ -677,9 +690,9 @@ GMLH_ack (void *cls, struct GNUNET_SERVER_Client *client,
  * @param client Identification of the client.
  * @param message The actual message.
  */
-void
-GMLH_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client,
-                          const struct GNUNET_MessageHeader *message)
+static void
+handle_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client,
+                    const struct GNUNET_MessageHeader *message)
 {
   struct MeshClient *c;
 
@@ -691,13 +704,13 @@ GMLH_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client,
     return;
   }
 
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+  LOG (GNUNET_ERROR_TYPE_INFO,
               "Received get tunnels request from client %u\n",
               c->id);
 //   GNUNET_CONTAINER_multihashmap_iterate (tunnels,
 //                                          monitor_all_tunnels_iterator,
 //                                          client);
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+  LOG (GNUNET_ERROR_TYPE_INFO,
               "Get tunnels request from client %u completed\n",
               c->id);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -712,8 +725,8 @@ GMLH_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client,
  * @param message The actual message.
  */
 void
-GMLH_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
-                          const struct GNUNET_MessageHeader *message)
+handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
+                    const struct GNUNET_MessageHeader *message)
 {
   const struct GNUNET_MESH_LocalMonitor *msg;
   struct GNUNET_MESH_LocalMonitor *resp;
@@ -729,7 +742,7 @@ GMLH_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
   }
 
   msg = (struct GNUNET_MESH_LocalMonitor *) message;
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+  LOG (GNUNET_ERROR_TYPE_INFO,
               "Received tunnel info request from client %u for tunnel %s[%X]\n",
               c->id,
               &msg->owner,
@@ -757,7 +770,7 @@ GMLH_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
                                               &resp->header, GNUNET_NO);
   GNUNET_free (resp);
 
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+  LOG (GNUNET_ERROR_TYPE_INFO,
               "Monitor tunnel request from client %u completed\n",
               c->id);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -768,17 +781,17 @@ GMLH_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
  * Functions to handle messages from clients
  */
 static struct GNUNET_SERVER_MessageHandler client_handlers[] = {
-  {&GMLH_new_client, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT, 0},
-  {&GMLH_channel_create, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE,
+  {&handle_new_client, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT, 0},
+  {&handle_channel_create, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE,
    sizeof (struct GNUNET_MESH_ChannelMessage)},
-  {&GMLH_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY,
+  {&handle_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY,
    sizeof (struct GNUNET_MESH_ChannelMessage)},
-  {&GMLH_data, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA, 0},
-  {&GMLH_ack, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK,
+  {&handle_data, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA, 0},
+  {&handle_ack, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK,
    sizeof (struct GNUNET_MESH_LocalAck)},
-  {&GMLH_get_tunnels, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS,
+  {&handle_get_tunnels, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS,
    sizeof (struct GNUNET_MessageHeader)},
-  {&GMLH_show_tunnel, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNEL,
+  {&handle_show_tunnel, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNEL,
    sizeof (struct GNUNET_MESH_LocalMonitor)},
   {NULL, NULL, 0, 0}
 };
@@ -802,6 +815,7 @@ GML_init (struct GNUNET_SERVER_Handle *handle)
   ports = GNUNET_CONTAINER_multihashmap32_create (32);
 }
 
+
 /**
  * Install server (service) handlers and start listening to clients.
  */
@@ -809,8 +823,8 @@ void
 GML_start (void)
 {
   GNUNET_SERVER_add_handlers (server_handle, client_handlers);
-  GNUNET_SERVER_connect_notify (server_handle,  &GMLH_client_connect, NULL);
-  GNUNET_SERVER_disconnect_notify (server_handle, &GMLH_client_disconnect,
+  GNUNET_SERVER_connect_notify (server_handle,  &handle_client_connect, NULL);
+  GNUNET_SERVER_disconnect_notify (server_handle, &handle_client_disconnect,
                                    NULL);
   nc = GNUNET_SERVER_notification_context_create (server_handle, 1);
 
@@ -865,14 +879,14 @@ GML_client_delete_channel (struct MeshClient *c, struct MeshChannel *ch)
     res = GNUNET_CONTAINER_multihashmap32_remove (c->own_channels,
                                                   ch->lid_root, ch);
     if (GNUNET_YES != res)
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "client_delete_channel owner KO\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "client_delete_channel owner KO\n");
   }
   if (c == ch->dest)
   {
     res = GNUNET_CONTAINER_multihashmap32_remove (c->incoming_channels,
                                                   ch->lid_dest, ch);
     if (GNUNET_YES != res)
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "client_delete_tunnel client KO\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "client_delete_tunnel client KO\n");
   }
 }
 
@@ -900,7 +914,7 @@ GML_send_ack (struct MeshChannel *ch, int fwd)
 
   rel->client_ready = GNUNET_YES;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
               "send local %s ack on %s:%X towards %p\n",
               fwd ? "FWD" : "BCK", peer2s (ch->t->peer), ch->gid, c);