diff --git a/I2PControl.cpp b/I2PControl.cpp index 4183476d..5f5995bc 100644 --- a/I2PControl.cpp +++ b/I2PControl.cpp @@ -38,6 +38,7 @@ namespace client 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_STATUS] = &I2PControlService::StatusHandler; m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = &I2PControlService::TunnelsParticipatingHandler; // RouterManager @@ -307,6 +308,11 @@ namespace client results[I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS] = boost::lexical_cast(i2p::transport::transports.GetPeers ().size ()); } + void I2PControlService::StatusHandler (std::map& results) + { + results[I2P_CONTROL_ROUTER_INFO_STATUS] = boost::lexical_cast((int)i2p::context.GetStatus ()); + } + void I2PControlService::TunnelsParticipatingHandler (std::map& results) { results[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = boost::lexical_cast(i2p::tunnel::tunnels.GetTransitTunnels ().size ()); diff --git a/I2PControl.h b/I2PControl.h index ffd06dba..96bc7d1b 100644 --- a/I2PControl.h +++ b/I2PControl.h @@ -47,6 +47,7 @@ namespace client 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_STATUS[] = "i2p.router.net.status"; const char I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING[] = "i2p.router.net.tunnels.participating"; // RouterManager requests @@ -97,7 +98,8 @@ namespace client typedef void (I2PControlService::*RouterInfoRequestHandler)(std::map& results); void UptimeHandler (std::map& results); void NetDbKnownPeersHandler (std::map& results); - void NetDbActivePeersHandler (std::map& results); + void NetDbActivePeersHandler (std::map& results); + void StatusHandler (std::map& results); void TunnelsParticipatingHandler (std::map& results); // RouterManager