aboutsummaryrefslogtreecommitdiff
path: root/src/exit/gnunet-daemon-exit.c
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/exit/gnunet-daemon-exit.c
parent6d754e6c89fda8cb0da00c4152ffc6dcc707e6ce (diff)
downloadgnunet-772ff3ec73c14c01997d5b561eef9c13fd4f5f6f.tar.gz
gnunet-772ff3ec73c14c01997d5b561eef9c13fd4f5f6f.zip
-basic setup/tear down for statistics in mesh/vpn
Diffstat (limited to 'src/exit/gnunet-daemon-exit.c')
-rw-r--r--src/exit/gnunet-daemon-exit.c12
1 files changed, 12 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");