participating request

This commit is contained in:
orignal 2015-01-12 14:03:20 -05:00
parent aeb2e235e5
commit dcae7fc541
2 changed files with 9 additions and 1 deletions

View File

@ -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<std::string>(i2p::data::netdb.GetNumRouters ());
}
void I2PControlService::TunnelsParticipatingHandler (std::map<std::string, std::string>& results)
{
results[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = boost::lexical_cast<std::string>(i2p::tunnel::tunnels.GetTransitTunnels ().size ());
}
// RouterManager
void I2PControlService::RouterManagerHandler (const std::map<std::string, std::string>& params, std::map<std::string, std::string>& results)

View File

@ -36,6 +36,7 @@ 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";
@ -78,6 +79,7 @@ namespace client
// RouterInfo
typedef void (I2PControlService::*RouterInfoRequestHandler)(std::map<std::string, std::string>& results);
void NetDbKnownPeersHandler (std::map<std::string, std::string>& results);
void TunnelsParticipatingHandler (std::map<std::string, std::string>& results);
// RouterManager
typedef void (I2PControlService::*RouterManagerRequestHandler)(std::map<std::string, std::string>& results);