-bump name to 97
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_tunnel.c
index 83f0d1f680e4d8278cac126b6e29e07803b9b106..44ac78567a9d453eef55ec5c79eda6933da6b6a2 100644 (file)
@@ -21,6 +21,8 @@
 #include "platform.h"
 #include "gnunet_util_lib.h"
 
+#include "gnunet_statistics_service.h"
+
 #include "mesh_protocol_enc.h"
 
 #include "gnunet-service-mesh_tunnel.h"
@@ -179,6 +181,11 @@ struct MeshTunnelQueue
 /*******************************   GLOBALS  ***********************************/
 /******************************************************************************/
 
+/**
+ * Global handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
+
 /**
  * Default TTL for payload packets.
  */
@@ -204,7 +211,6 @@ const static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
 /********************************   STATIC  ***********************************/
 /******************************************************************************/
 
-
 /**
  * Get string description for tunnel state.
  *
@@ -366,6 +372,10 @@ tunnel_send_queued_data (struct MeshTunnel2 *t, int fwd)
 }
 
 
+/******************************************************************************/
+/********************************    API    ***********************************/
+/******************************************************************************/
+
 /**
  * Cache a message to be sent once tunnel is online.
  *
@@ -394,11 +404,6 @@ GMT_queue_data (struct MeshTunnel2 *t,
 }
 
 
-
-/******************************************************************************/
-/********************************    API    ***********************************/
-/******************************************************************************/
-
 /**
  * Initialize the tunnel subsystem.
  *
@@ -591,7 +596,7 @@ GMT_destroy (struct MeshTunnel2 *t)
   }
 
   GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO);
-  t->peer->tunnel = NULL;
+  GMP_set_tunnel (t->peer, NULL);
 
   GNUNET_free (t);
 }