- share one statistics handle across all subsystems
authorBart Polot <bart@net.in.tum.de>
Tue, 8 Oct 2013 14:06:30 +0000 (14:06 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 8 Oct 2013 14:06:30 +0000 (14:06 +0000)
src/mesh/gnunet-service-mesh-enc.c
src/mesh/gnunet-service-mesh_channel.c
src/mesh/gnunet-service-mesh_connection.c
src/mesh/gnunet-service-mesh_dht.c
src/mesh/gnunet-service-mesh_local.c
src/mesh/gnunet-service-mesh_peer.c
src/mesh/gnunet-service-mesh_tunnel.c

index 1767f5a1aff7acfdabd33f9cb410ca850bb3c2b6..55b189da1a9970d5ce606356180bc4c2804c775d 100644 (file)
 /***********************      GLOBAL VARIABLES     ****************************/
 /******************************************************************************/
 
-/************************** Configuration parameters **************************/
-
-
-
-/*************************** Static global variables **************************/
+/****************************** Global variables ******************************/
 
 /**
  * Handle to the statistics service.
  */
-static struct GNUNET_STATISTICS_Handle *stats;
+struct GNUNET_STATISTICS_Handle *stats;
+
+/*************************** Static global variables **************************/
 
 /**
  * Local peer own ID (memory efficient handle).
index e1c60b743f8cfe4a0dfd98f9c6f853bdee18e2dd..8d1ccb0b992d9acb903b8da5f0ce0b3b30134627 100644 (file)
 
 
 #include "platform.h"
+#include "gnunet_util_lib.h"
+
+#include "gnunet_statistics_service.h"
+
 #include "mesh_enc.h"
 #include "mesh_protocol_enc.h"
+
 #include "gnunet-service-mesh_channel.h"
 #include "gnunet-service-mesh_local.h"
 #include "gnunet-service-mesh_tunnel.h"
@@ -245,6 +250,20 @@ struct MeshChannel
 };
 
 
+/******************************************************************************/
+/*******************************   GLOBALS  ***********************************/
+/******************************************************************************/
+
+/**
+ * Global handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
+
+
+/******************************************************************************/
+/********************************   STATIC  ***********************************/
+/******************************************************************************/
+
 /**
  * We have received a message out of order, or the client is not ready.
  * Buffer it until we receive an ACK from the client or the missing
@@ -1177,6 +1196,10 @@ send (const struct GNUNET_MessageHeader *message,
 }
 
 
+/******************************************************************************/
+/********************************    API    ***********************************/
+/******************************************************************************/
+
 /**
  * Count channels in a DLL.
  * 
index 0d7168e69a580ecf3238da3b182d89d06e51b8af..d30eabf5cdb60050b7ed375201788aa4ffc03ae1 100644 (file)
@@ -27,6 +27,8 @@
 #include "platform.h"
 #include "gnunet_util_lib.h"
 
+#include "gnunet_statistics_service.h"
+
 #include "gnunet-service-mesh_connection.h"
 #include "gnunet-service-mesh_peer.h"
 #include "mesh_protocol_enc.h"
@@ -68,6 +70,9 @@ enum MeshConnectionState
 };
 
 
+/******************************************************************************/
+/********************************   STRUCTS  **********************************/
+/******************************************************************************/
 
 /**
  * Struct containing info about a queued transmission to this peer
@@ -248,6 +253,14 @@ struct MeshConnection
   int destroy;
 };
 
+/******************************************************************************/
+/*******************************   GLOBALS  ***********************************/
+/******************************************************************************/
+
+/**
+ * Global handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
 
 /**
  * Connections known, indexed by cid (MeshConnection).
@@ -272,6 +285,10 @@ static unsigned long long max_msgs_queue;
 static struct GNUNET_TIME_Relative refresh_connection_time;
 
 
+/******************************************************************************/
+/********************************   STATIC  ***********************************/
+/******************************************************************************/
+
 #if 0 // avoid compiler warning for unused static function
 static void
 fc_debug (struct MeshFlowControl *fc)
@@ -1014,6 +1031,10 @@ register_neighbors (struct MeshConnection *c)
 }
 
 
+/******************************************************************************/
+/********************************    API    ***********************************/
+/******************************************************************************/
+
 /**
  * Core handler for connection creation.
  *
index e09c6b65e41aebe974057be79ab29b420a7c3668..3beb2da8a85bc3bebe822a8a8166badfd44ccb4d 100644 (file)
@@ -23,6 +23,7 @@
 #include "gnunet_util_lib.h"
 
 #include "gnunet_dht_service.h"
+#include "gnunet_statistics_service.h"
 
 #include "mesh_path.h"
 #include "gnunet-service-mesh_dht.h"
@@ -55,6 +56,11 @@ struct GMD_search_handle
 /*******************************   GLOBALS  ***********************************/
 /******************************************************************************/
 
+/**
+ * Global handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
+
 /**
  * Handle to use DHT.
  */
index 6612915e445450fc7ce8368d54bb81f9f02e0eaf..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
 
@@ -86,6 +90,11 @@ struct MeshClient
 /*******************************   GLOBALS  ***********************************/
 /******************************************************************************/
 
+/**
+ * Global handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
+
 /**
  * Handle to server lib.
  */
index 008ba5a5192661e9eb690bba5f7db47478f7480a..6c89638648f22233ef9f8d3cfbd5823161076f0b 100644 (file)
@@ -23,6 +23,7 @@
 #include "gnunet_util_lib.h"
 
 #include "gnunet_core_service.h"
+#include "gnunet_statistics_service.h"
 
 #include "mesh_protocol_enc.h"
 
@@ -105,6 +106,11 @@ struct MeshPeer
 /*******************************   GLOBALS  ***********************************/
 /******************************************************************************/
 
+/**
+ * Global handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
+
 /**
  * Peers known, indexed by PeerIdentity (MeshPeer).
  */
index 0c4e163e5add936e9d57541fd4410c334a74de5d..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.
  *