mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 22:57:52 +00:00
show router status through I2PControl
This commit is contained in:
parent
9d273acd42
commit
42f314669f
@ -38,6 +38,7 @@ namespace client
|
|||||||
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_UPTIME] = &I2PControlService::UptimeHandler;
|
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_KNOWNPEERS] = &I2PControlService::NetDbKnownPeersHandler;
|
||||||
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS] = &I2PControlService::NetDbActivePeersHandler;
|
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS] = &I2PControlService::NetDbActivePeersHandler;
|
||||||
|
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_STATUS] = &I2PControlService::StatusHandler;
|
||||||
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = &I2PControlService::TunnelsParticipatingHandler;
|
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = &I2PControlService::TunnelsParticipatingHandler;
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
@ -307,6 +308,11 @@ namespace client
|
|||||||
results[I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS] = boost::lexical_cast<std::string>(i2p::transport::transports.GetPeers ().size ());
|
results[I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS] = boost::lexical_cast<std::string>(i2p::transport::transports.GetPeers ().size ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void I2PControlService::StatusHandler (std::map<std::string, std::string>& results)
|
||||||
|
{
|
||||||
|
results[I2P_CONTROL_ROUTER_INFO_STATUS] = boost::lexical_cast<std::string>((int)i2p::context.GetStatus ());
|
||||||
|
}
|
||||||
|
|
||||||
void I2PControlService::TunnelsParticipatingHandler (std::map<std::string, std::string>& results)
|
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 ());
|
results[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = boost::lexical_cast<std::string>(i2p::tunnel::tunnels.GetTransitTunnels ().size ());
|
||||||
|
@ -47,6 +47,7 @@ namespace client
|
|||||||
const char I2P_CONTROL_ROUTER_INFO_UPTIME[] = "i2p.router.uptime";
|
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_KNOWNPEERS[] = "i2p.router.netdb.knownpeers";
|
||||||
const char I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS[] = "i2p.router.netdb.activepeers";
|
const char I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS[] = "i2p.router.netdb.activepeers";
|
||||||
|
const char I2P_CONTROL_ROUTER_INFO_STATUS[] = "i2p.router.net.status";
|
||||||
const char I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING[] = "i2p.router.net.tunnels.participating";
|
const char I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING[] = "i2p.router.net.tunnels.participating";
|
||||||
|
|
||||||
// RouterManager requests
|
// RouterManager requests
|
||||||
@ -98,6 +99,7 @@ namespace client
|
|||||||
void UptimeHandler (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 NetDbKnownPeersHandler (std::map<std::string, std::string>& results);
|
||||||
void NetDbActivePeersHandler (std::map<std::string, std::string>& results);
|
void NetDbActivePeersHandler (std::map<std::string, std::string>& results);
|
||||||
|
void StatusHandler (std::map<std::string, std::string>& results);
|
||||||
void TunnelsParticipatingHandler (std::map<std::string, std::string>& results);
|
void TunnelsParticipatingHandler (std::map<std::string, std::string>& results);
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
|
Loading…
Reference in New Issue
Block a user