aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-15 16:35:44 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-15 16:35:44 +0000
commit772ff3ec73c14c01997d5b561eef9c13fd4f5f6f (patch)
tree84e14402d051521dac63e1f94cc16e88296613c8 /src
parent6d754e6c89fda8cb0da00c4152ffc6dcc707e6ce (diff)
downloadgnunet-772ff3ec73c14c01997d5b561eef9c13fd4f5f6f.tar.gz
gnunet-772ff3ec73c14c01997d5b561eef9c13fd4f5f6f.zip
-basic setup/tear down for statistics in mesh/vpn
Diffstat (limited to 'src')
-rw-r--r--src/exit/gnunet-daemon-exit.c12
-rw-r--r--src/vpn/gnunet-service-vpn.c12
2 files changed, 24 insertions, 0 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index cf72bf964..bfa600e48 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -43,6 +43,7 @@
43#include "gnunet_protocols.h" 43#include "gnunet_protocols.h"
44#include "gnunet_applications.h" 44#include "gnunet_applications.h"
45#include "gnunet_mesh_service.h" 45#include "gnunet_mesh_service.h"
46#include "gnunet_statistics_service.h"
46#include "gnunet_constants.h" 47#include "gnunet_constants.h"
47#include "tcpip_tun.h" 48#include "tcpip_tun.h"
48#include "exit.h" 49#include "exit.h"
@@ -243,6 +244,11 @@ static char *exit_argv[7];
243static unsigned long long ipv6prefix; 244static unsigned long long ipv6prefix;
244 245
245/** 246/**
247 * Statistics.
248 */
249static struct GNUNET_STATISTICS_Handle *stats;
250
251/**
246 * The handle to mesh 252 * The handle to mesh
247 */ 253 */
248static struct GNUNET_MESH_Handle *mesh_handle; 254static struct GNUNET_MESH_Handle *mesh_handle;
@@ -1878,6 +1884,11 @@ cleanup (void *cls GNUNET_UNUSED,
1878 GNUNET_CONTAINER_multihashmap_destroy (udp_services); 1884 GNUNET_CONTAINER_multihashmap_destroy (udp_services);
1879 udp_services = NULL; 1885 udp_services = NULL;
1880 } 1886 }
1887 if (stats != NULL)
1888 {
1889 GNUNET_STATISTICS_destroy (stats, GNUNET_YES);
1890 stats = NULL;
1891 }
1881 for (i=0;i<5;i++) 1892 for (i=0;i<5;i++)
1882 GNUNET_free_non_null (exit_argv[i]); 1893 GNUNET_free_non_null (exit_argv[i]);
1883} 1894}
@@ -2072,6 +2083,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
2072 struct in6_addr v6; 2083 struct in6_addr v6;
2073 2084
2074 cfg = cfg_; 2085 cfg = cfg_;
2086 stats = GNUNET_STATISTICS_create ("exit", cfg);
2075 ipv4_exit = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "EXIT_IPV4"); 2087 ipv4_exit = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "EXIT_IPV4");
2076 ipv6_exit = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "EXIT_IPV6"); 2088 ipv6_exit = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "EXIT_IPV6");
2077 ipv4_enabled = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "ENABLE_IPV4"); 2089 ipv4_enabled = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "ENABLE_IPV4");
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index b1b00dd98..ba14b0664 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -46,6 +46,7 @@
46#include "gnunet_protocols.h" 46#include "gnunet_protocols.h"
47#include "gnunet_applications.h" 47#include "gnunet_applications.h"
48#include "gnunet_mesh_service.h" 48#include "gnunet_mesh_service.h"
49#include "gnunet_statistics_service.h"
49#include "gnunet_constants.h" 50#include "gnunet_constants.h"
50#include "tcpip_tun.h" 51#include "tcpip_tun.h"
51#include "vpn.h" 52#include "vpn.h"
@@ -314,6 +315,11 @@ static struct GNUNET_CONTAINER_MultiHashMap *tunnel_map;
314static struct GNUNET_CONTAINER_Heap *tunnel_heap; 315static struct GNUNET_CONTAINER_Heap *tunnel_heap;
315 316
316/** 317/**
318 * Statistics.
319 */
320static struct GNUNET_STATISTICS_Handle *stats;
321
322/**
317 * The handle to the VPN helper process "gnunet-helper-vpn". 323 * The handle to the VPN helper process "gnunet-helper-vpn".
318 */ 324 */
319static struct GNUNET_HELPER_Handle *helper_handle; 325static struct GNUNET_HELPER_Handle *helper_handle;
@@ -2119,6 +2125,11 @@ cleanup (void *cls GNUNET_UNUSED,
2119 GNUNET_SERVER_notification_context_destroy (nc); 2125 GNUNET_SERVER_notification_context_destroy (nc);
2120 nc = NULL; 2126 nc = NULL;
2121 } 2127 }
2128 if (stats != NULL)
2129 {
2130 GNUNET_STATISTICS_destroy (stats, GNUNET_YES);
2131 stats = NULL;
2132 }
2122 for (i=0;i<5;i++) 2133 for (i=0;i<5;i++)
2123 GNUNET_free_non_null (vpn_argv[i]); 2134 GNUNET_free_non_null (vpn_argv[i]);
2124} 2135}
@@ -2237,6 +2248,7 @@ run (void *cls,
2237 struct in6_addr v6; 2248 struct in6_addr v6;
2238 2249
2239 cfg = cfg_; 2250 cfg = cfg_;
2251 stats = GNUNET_STATISTICS_create ("vpn", cfg);
2240 if (GNUNET_OK != 2252 if (GNUNET_OK !=
2241 GNUNET_CONFIGURATION_get_value_number (cfg, "vpn", "MAX_MAPPING", 2253 GNUNET_CONFIGURATION_get_value_number (cfg, "vpn", "MAX_MAPPING",
2242 &max_destination_mappings)) 2254 &max_destination_mappings))