diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-10-08 14:06:30 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-10-08 14:06:30 +0000 |
commit | ede5e3950ffad6c6b812d1f210f90cd066961cad (patch) | |
tree | 973a2067d6b80bf3c5fd1503a05117a3d37d0c40 /src/mesh | |
parent | b8cfe698546bd64e4e8a062cf923cf5351f2a49a (diff) | |
download | gnunet-ede5e3950ffad6c6b812d1f210f90cd066961cad.tar.gz gnunet-ede5e3950ffad6c6b812d1f210f90cd066961cad.zip |
- share one statistics handle across all subsystems
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh-enc.c | 10 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_channel.c | 23 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 21 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_dht.c | 6 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_local.c | 9 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_peer.c | 6 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.c | 17 |
7 files changed, 80 insertions, 12 deletions
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c index 1767f5a1a..55b189da1 100644 --- a/src/mesh/gnunet-service-mesh-enc.c +++ b/src/mesh/gnunet-service-mesh-enc.c | |||
@@ -72,16 +72,14 @@ | |||
72 | /*********************** GLOBAL VARIABLES ****************************/ | 72 | /*********************** GLOBAL VARIABLES ****************************/ |
73 | /******************************************************************************/ | 73 | /******************************************************************************/ |
74 | 74 | ||
75 | /************************** Configuration parameters **************************/ | 75 | /****************************** Global variables ******************************/ |
76 | |||
77 | |||
78 | |||
79 | /*************************** Static global variables **************************/ | ||
80 | 76 | ||
81 | /** | 77 | /** |
82 | * Handle to the statistics service. | 78 | * Handle to the statistics service. |
83 | */ | 79 | */ |
84 | static struct GNUNET_STATISTICS_Handle *stats; | 80 | struct GNUNET_STATISTICS_Handle *stats; |
81 | |||
82 | /*************************** Static global variables **************************/ | ||
85 | 83 | ||
86 | /** | 84 | /** |
87 | * Local peer own ID (memory efficient handle). | 85 | * Local peer own ID (memory efficient handle). |
diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index e1c60b743..8d1ccb0b9 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c | |||
@@ -20,8 +20,13 @@ | |||
20 | 20 | ||
21 | 21 | ||
22 | #include "platform.h" | 22 | #include "platform.h" |
23 | #include "gnunet_util_lib.h" | ||
24 | |||
25 | #include "gnunet_statistics_service.h" | ||
26 | |||
23 | #include "mesh_enc.h" | 27 | #include "mesh_enc.h" |
24 | #include "mesh_protocol_enc.h" | 28 | #include "mesh_protocol_enc.h" |
29 | |||
25 | #include "gnunet-service-mesh_channel.h" | 30 | #include "gnunet-service-mesh_channel.h" |
26 | #include "gnunet-service-mesh_local.h" | 31 | #include "gnunet-service-mesh_local.h" |
27 | #include "gnunet-service-mesh_tunnel.h" | 32 | #include "gnunet-service-mesh_tunnel.h" |
@@ -245,6 +250,20 @@ struct MeshChannel | |||
245 | }; | 250 | }; |
246 | 251 | ||
247 | 252 | ||
253 | /******************************************************************************/ | ||
254 | /******************************* GLOBALS ***********************************/ | ||
255 | /******************************************************************************/ | ||
256 | |||
257 | /** | ||
258 | * Global handle to the statistics service. | ||
259 | */ | ||
260 | extern struct GNUNET_STATISTICS_Handle *stats; | ||
261 | |||
262 | |||
263 | /******************************************************************************/ | ||
264 | /******************************** STATIC ***********************************/ | ||
265 | /******************************************************************************/ | ||
266 | |||
248 | /** | 267 | /** |
249 | * We have received a message out of order, or the client is not ready. | 268 | * We have received a message out of order, or the client is not ready. |
250 | * Buffer it until we receive an ACK from the client or the missing | 269 | * Buffer it until we receive an ACK from the client or the missing |
@@ -1177,6 +1196,10 @@ send (const struct GNUNET_MessageHeader *message, | |||
1177 | } | 1196 | } |
1178 | 1197 | ||
1179 | 1198 | ||
1199 | /******************************************************************************/ | ||
1200 | /******************************** API ***********************************/ | ||
1201 | /******************************************************************************/ | ||
1202 | |||
1180 | /** | 1203 | /** |
1181 | * Count channels in a DLL. | 1204 | * Count channels in a DLL. |
1182 | * | 1205 | * |
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 0d7168e69..d30eabf5c 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | 29 | ||
30 | #include "gnunet_statistics_service.h" | ||
31 | |||
30 | #include "gnunet-service-mesh_connection.h" | 32 | #include "gnunet-service-mesh_connection.h" |
31 | #include "gnunet-service-mesh_peer.h" | 33 | #include "gnunet-service-mesh_peer.h" |
32 | #include "mesh_protocol_enc.h" | 34 | #include "mesh_protocol_enc.h" |
@@ -68,6 +70,9 @@ enum MeshConnectionState | |||
68 | }; | 70 | }; |
69 | 71 | ||
70 | 72 | ||
73 | /******************************************************************************/ | ||
74 | /******************************** STRUCTS **********************************/ | ||
75 | /******************************************************************************/ | ||
71 | 76 | ||
72 | /** | 77 | /** |
73 | * Struct containing info about a queued transmission to this peer | 78 | * Struct containing info about a queued transmission to this peer |
@@ -248,6 +253,14 @@ struct MeshConnection | |||
248 | int destroy; | 253 | int destroy; |
249 | }; | 254 | }; |
250 | 255 | ||
256 | /******************************************************************************/ | ||
257 | /******************************* GLOBALS ***********************************/ | ||
258 | /******************************************************************************/ | ||
259 | |||
260 | /** | ||
261 | * Global handle to the statistics service. | ||
262 | */ | ||
263 | extern struct GNUNET_STATISTICS_Handle *stats; | ||
251 | 264 | ||
252 | /** | 265 | /** |
253 | * Connections known, indexed by cid (MeshConnection). | 266 | * Connections known, indexed by cid (MeshConnection). |
@@ -272,6 +285,10 @@ static unsigned long long max_msgs_queue; | |||
272 | static struct GNUNET_TIME_Relative refresh_connection_time; | 285 | static struct GNUNET_TIME_Relative refresh_connection_time; |
273 | 286 | ||
274 | 287 | ||
288 | /******************************************************************************/ | ||
289 | /******************************** STATIC ***********************************/ | ||
290 | /******************************************************************************/ | ||
291 | |||
275 | #if 0 // avoid compiler warning for unused static function | 292 | #if 0 // avoid compiler warning for unused static function |
276 | static void | 293 | static void |
277 | fc_debug (struct MeshFlowControl *fc) | 294 | fc_debug (struct MeshFlowControl *fc) |
@@ -1014,6 +1031,10 @@ register_neighbors (struct MeshConnection *c) | |||
1014 | } | 1031 | } |
1015 | 1032 | ||
1016 | 1033 | ||
1034 | /******************************************************************************/ | ||
1035 | /******************************** API ***********************************/ | ||
1036 | /******************************************************************************/ | ||
1037 | |||
1017 | /** | 1038 | /** |
1018 | * Core handler for connection creation. | 1039 | * Core handler for connection creation. |
1019 | * | 1040 | * |
diff --git a/src/mesh/gnunet-service-mesh_dht.c b/src/mesh/gnunet-service-mesh_dht.c index e09c6b65e..3beb2da8a 100644 --- a/src/mesh/gnunet-service-mesh_dht.c +++ b/src/mesh/gnunet-service-mesh_dht.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "gnunet_util_lib.h" | 23 | #include "gnunet_util_lib.h" |
24 | 24 | ||
25 | #include "gnunet_dht_service.h" | 25 | #include "gnunet_dht_service.h" |
26 | #include "gnunet_statistics_service.h" | ||
26 | 27 | ||
27 | #include "mesh_path.h" | 28 | #include "mesh_path.h" |
28 | #include "gnunet-service-mesh_dht.h" | 29 | #include "gnunet-service-mesh_dht.h" |
@@ -56,6 +57,11 @@ struct GMD_search_handle | |||
56 | /******************************************************************************/ | 57 | /******************************************************************************/ |
57 | 58 | ||
58 | /** | 59 | /** |
60 | * Global handle to the statistics service. | ||
61 | */ | ||
62 | extern struct GNUNET_STATISTICS_Handle *stats; | ||
63 | |||
64 | /** | ||
59 | * Handle to use DHT. | 65 | * Handle to use DHT. |
60 | */ | 66 | */ |
61 | static struct GNUNET_DHT_Handle *dht_handle; | 67 | static struct GNUNET_DHT_Handle *dht_handle; |
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c index 6612915e4..9714034ba 100644 --- a/src/mesh/gnunet-service-mesh_local.c +++ b/src/mesh/gnunet-service-mesh_local.c | |||
@@ -20,6 +20,10 @@ | |||
20 | 20 | ||
21 | 21 | ||
22 | #include "platform.h" | 22 | #include "platform.h" |
23 | #include "gnunet_util_lib.h" | ||
24 | |||
25 | #include "gnunet_statistics_service.h" | ||
26 | |||
23 | #include "mesh_enc.h" | 27 | #include "mesh_enc.h" |
24 | #include "mesh_protocol_enc.h" // GNUNET_MESH_Data is shared | 28 | #include "mesh_protocol_enc.h" // GNUNET_MESH_Data is shared |
25 | 29 | ||
@@ -87,6 +91,11 @@ struct MeshClient | |||
87 | /******************************************************************************/ | 91 | /******************************************************************************/ |
88 | 92 | ||
89 | /** | 93 | /** |
94 | * Global handle to the statistics service. | ||
95 | */ | ||
96 | extern struct GNUNET_STATISTICS_Handle *stats; | ||
97 | |||
98 | /** | ||
90 | * Handle to server lib. | 99 | * Handle to server lib. |
91 | */ | 100 | */ |
92 | static struct GNUNET_SERVER_Handle *server_handle; | 101 | static struct GNUNET_SERVER_Handle *server_handle; |
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index 008ba5a51..6c8963864 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "gnunet_util_lib.h" | 23 | #include "gnunet_util_lib.h" |
24 | 24 | ||
25 | #include "gnunet_core_service.h" | 25 | #include "gnunet_core_service.h" |
26 | #include "gnunet_statistics_service.h" | ||
26 | 27 | ||
27 | #include "mesh_protocol_enc.h" | 28 | #include "mesh_protocol_enc.h" |
28 | 29 | ||
@@ -106,6 +107,11 @@ struct MeshPeer | |||
106 | /******************************************************************************/ | 107 | /******************************************************************************/ |
107 | 108 | ||
108 | /** | 109 | /** |
110 | * Global handle to the statistics service. | ||
111 | */ | ||
112 | extern struct GNUNET_STATISTICS_Handle *stats; | ||
113 | |||
114 | /** | ||
109 | * Peers known, indexed by PeerIdentity (MeshPeer). | 115 | * Peers known, indexed by PeerIdentity (MeshPeer). |
110 | */ | 116 | */ |
111 | static struct GNUNET_CONTAINER_MultiPeerMap *peers; | 117 | static struct GNUNET_CONTAINER_MultiPeerMap *peers; |
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 0c4e163e5..44ac78567 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include "platform.h" | 21 | #include "platform.h" |
22 | #include "gnunet_util_lib.h" | 22 | #include "gnunet_util_lib.h" |
23 | 23 | ||
24 | #include "gnunet_statistics_service.h" | ||
25 | |||
24 | #include "mesh_protocol_enc.h" | 26 | #include "mesh_protocol_enc.h" |
25 | 27 | ||
26 | #include "gnunet-service-mesh_tunnel.h" | 28 | #include "gnunet-service-mesh_tunnel.h" |
@@ -180,6 +182,11 @@ struct MeshTunnelQueue | |||
180 | /******************************************************************************/ | 182 | /******************************************************************************/ |
181 | 183 | ||
182 | /** | 184 | /** |
185 | * Global handle to the statistics service. | ||
186 | */ | ||
187 | extern struct GNUNET_STATISTICS_Handle *stats; | ||
188 | |||
189 | /** | ||
183 | * Default TTL for payload packets. | 190 | * Default TTL for payload packets. |
184 | */ | 191 | */ |
185 | static unsigned long long default_ttl; | 192 | static unsigned long long default_ttl; |
@@ -204,7 +211,6 @@ const static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; | |||
204 | /******************************** STATIC ***********************************/ | 211 | /******************************** STATIC ***********************************/ |
205 | /******************************************************************************/ | 212 | /******************************************************************************/ |
206 | 213 | ||
207 | |||
208 | /** | 214 | /** |
209 | * Get string description for tunnel state. | 215 | * Get string description for tunnel state. |
210 | * | 216 | * |
@@ -366,6 +372,10 @@ tunnel_send_queued_data (struct MeshTunnel2 *t, int fwd) | |||
366 | } | 372 | } |
367 | 373 | ||
368 | 374 | ||
375 | /******************************************************************************/ | ||
376 | /******************************** API ***********************************/ | ||
377 | /******************************************************************************/ | ||
378 | |||
369 | /** | 379 | /** |
370 | * Cache a message to be sent once tunnel is online. | 380 | * Cache a message to be sent once tunnel is online. |
371 | * | 381 | * |
@@ -394,11 +404,6 @@ GMT_queue_data (struct MeshTunnel2 *t, | |||
394 | } | 404 | } |
395 | 405 | ||
396 | 406 | ||
397 | |||
398 | /******************************************************************************/ | ||
399 | /******************************** API ***********************************/ | ||
400 | /******************************************************************************/ | ||
401 | |||
402 | /** | 407 | /** |
403 | * Initialize the tunnel subsystem. | 408 | * Initialize the tunnel subsystem. |
404 | * | 409 | * |