diff --git a/I2PControl.cpp b/I2PControl.cpp index c60104b9..0432ea34 100644 --- a/I2PControl.cpp +++ b/I2PControl.cpp @@ -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& results) + { + results[I2P_CONTROL_ROUTER_INFO_UPTIME] = boost::lexical_cast(i2p::context.GetUptime ()*1000); + } + void I2PControlService::NetDbKnownPeersHandler (std::map& results) { results[I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS] = boost::lexical_cast(i2p::data::netdb.GetNumRouters ()); diff --git a/I2PControl.h b/I2PControl.h index e032c6fc..ffd06dba 100644 --- a/I2PControl.h +++ b/I2PControl.h @@ -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& results); + void UptimeHandler (std::map& results); void NetDbKnownPeersHandler (std::map& results); void NetDbActivePeersHandler (std::map& results); void TunnelsParticipatingHandler (std::map& results);