mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
show uptime through I2PControl
This commit is contained in:
parent
c46a82420d
commit
dc18c012ed
@ -35,6 +35,7 @@ namespace client
|
||||
m_MethodHandlers[I2P_CONTROL_METHOD_NETWORK_SETTING] = &I2PControlService::NetworkSettingHandler;
|
||||
|
||||
// RouterInfo
|
||||
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_UPTIME] = &I2PControlService::UptimeHandler;
|
||||
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS] = &I2PControlService::NetDbKnownPeersHandler;
|
||||
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS] = &I2PControlService::NetDbActivePeersHandler;
|
||||
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = &I2PControlService::TunnelsParticipatingHandler;
|
||||
@ -291,6 +292,11 @@ namespace client
|
||||
}
|
||||
}
|
||||
|
||||
void I2PControlService::UptimeHandler (std::map<std::string, std::string>& results)
|
||||
{
|
||||
results[I2P_CONTROL_ROUTER_INFO_UPTIME] = boost::lexical_cast<std::string>(i2p::context.GetUptime ()*1000);
|
||||
}
|
||||
|
||||
void I2PControlService::NetDbKnownPeersHandler (std::map<std::string, std::string>& results)
|
||||
{
|
||||
results[I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS] = boost::lexical_cast<std::string>(i2p::data::netdb.GetNumRouters ());
|
||||
|
@ -44,6 +44,7 @@ namespace client
|
||||
const char I2P_CONTROL_I2PCONTROL_PORT[] = "i2pcontrol.port";
|
||||
|
||||
// RouterInfo requests
|
||||
const char I2P_CONTROL_ROUTER_INFO_UPTIME[] = "i2p.router.uptime";
|
||||
const char I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS[] = "i2p.router.netdb.knownpeers";
|
||||
const char I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS[] = "i2p.router.netdb.activepeers";
|
||||
const char I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING[] = "i2p.router.net.tunnels.participating";
|
||||
@ -94,6 +95,7 @@ namespace client
|
||||
|
||||
// RouterInfo
|
||||
typedef void (I2PControlService::*RouterInfoRequestHandler)(std::map<std::string, std::string>& results);
|
||||
void UptimeHandler (std::map<std::string, std::string>& results);
|
||||
void NetDbKnownPeersHandler (std::map<std::string, std::string>& results);
|
||||
void NetDbActivePeersHandler (std::map<std::string, std::string>& results);
|
||||
void TunnelsParticipatingHandler (std::map<std::string, std::string>& results);
|
||||
|
Loading…
x
Reference in New Issue
Block a user