From dcae7fc5412204814bd9fc39aae8cbd603d92903 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 12 Jan 2015 14:03:20 -0500 Subject: [PATCH] participating request --- I2PControl.cpp | 6 ++++++ I2PControl.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/I2PControl.cpp b/I2PControl.cpp index 030676f3..a614ff37 100644 --- a/I2PControl.cpp +++ b/I2PControl.cpp @@ -27,6 +27,7 @@ namespace client // RouterInfo m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS] = &I2PControlService::NetDbKnownPeersHandler; + m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = &I2PControlService::TunnelsParticipatingHandler; // RouterManager m_RouterManagerHandlers[I2P_CONTROL_ROUTER_MANAGER_SHUTDOWN] = &I2PControlService::ShutdownHandler; @@ -224,6 +225,11 @@ namespace client results[I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS] = boost::lexical_cast(i2p::data::netdb.GetNumRouters ()); } + void I2PControlService::TunnelsParticipatingHandler (std::map& results) + { + results[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = boost::lexical_cast(i2p::tunnel::tunnels.GetTransitTunnels ().size ()); + } + // RouterManager void I2PControlService::RouterManagerHandler (const std::map& params, std::map& results) diff --git a/I2PControl.h b/I2PControl.h index db530b09..a2b976ac 100644 --- a/I2PControl.h +++ b/I2PControl.h @@ -36,7 +36,8 @@ namespace client // RouterInfo requests const char I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS[] = "i2p.router.netdb.knownpeers"; - + const char I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING[] = "i2p.router.net.tunnels.participating"; + // RouterManager requests const char I2P_CONTROL_ROUTER_MANAGER_SHUTDOWN[] = "Shutdown"; const char I2P_CONTROL_ROUTER_MANAGER_SHUTDOWN_GRACEFUL[] = "ShutdownGraceful"; @@ -78,6 +79,7 @@ namespace client // RouterInfo typedef void (I2PControlService::*RouterInfoRequestHandler)(std::map& results); void NetDbKnownPeersHandler (std::map& results); + void TunnelsParticipatingHandler (std::map& results); // RouterManager typedef void (I2PControlService::*RouterManagerRequestHandler)(std::map& results);