mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
handle i2p.router.netdb.activepeers
This commit is contained in:
parent
98e930bd46
commit
02b7cd71c5
|
@ -10,6 +10,7 @@
|
||||||
#include "Daemon.h"
|
#include "Daemon.h"
|
||||||
#include "Tunnel.h"
|
#include "Tunnel.h"
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
|
#include "Transports.h"
|
||||||
|
|
||||||
namespace i2p
|
namespace i2p
|
||||||
{
|
{
|
||||||
|
@ -28,6 +29,7 @@ namespace client
|
||||||
|
|
||||||
// RouterInfo
|
// RouterInfo
|
||||||
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_TUNNELS_PARTICIPATING] = &I2PControlService::TunnelsParticipatingHandler;
|
m_RouterInfoHandlers[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = &I2PControlService::TunnelsParticipatingHandler;
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
|
@ -226,9 +228,14 @@ namespace client
|
||||||
results[I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS] = boost::lexical_cast<std::string>(i2p::data::netdb.GetNumRouters ());
|
results[I2P_CONTROL_ROUTER_INFO_NETDB_KNOWNPEERS] = boost::lexical_cast<std::string>(i2p::data::netdb.GetNumRouters ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void I2PControlService::NetDbActivePeersHandler (std::map<std::string, std::string>& results)
|
||||||
|
{
|
||||||
|
results[I2P_CONTROL_ROUTER_INFO_NETDB_ACTIVEPEERS] = boost::lexical_cast<std::string>(i2p::data::netdb.GetNumRouters ());
|
||||||
|
}
|
||||||
|
|
||||||
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::transport::transports.GetPeers ().size ());
|
||||||
}
|
}
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace client
|
||||||
|
|
||||||
// RouterInfo requests
|
// RouterInfo requests
|
||||||
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_TUNNELS_PARTICIPATING[] = "i2p.router.net.tunnels.participating";
|
const char I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING[] = "i2p.router.net.tunnels.participating";
|
||||||
|
|
||||||
// RouterManager requests
|
// RouterManager requests
|
||||||
|
@ -80,7 +81,8 @@ namespace client
|
||||||
|
|
||||||
// RouterInfo
|
// RouterInfo
|
||||||
typedef void (I2PControlService::*RouterInfoRequestHandler)(std::map<std::string, std::string>& results);
|
typedef void (I2PControlService::*RouterInfoRequestHandler)(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 TunnelsParticipatingHandler (std::map<std::string, std::string>& results);
|
void TunnelsParticipatingHandler (std::map<std::string, std::string>& results);
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
|
|
|
@ -114,6 +114,7 @@ namespace transport
|
||||||
// for HTTP only
|
// for HTTP only
|
||||||
const NTCPServer * GetNTCPServer () const { return m_NTCPServer; };
|
const NTCPServer * GetNTCPServer () const { return m_NTCPServer; };
|
||||||
const SSUServer * GetSSUServer () const { return m_SSUServer; };
|
const SSUServer * GetSSUServer () const { return m_SSUServer; };
|
||||||
|
const decltype(m_Peers)& GetPeers () const { return m_Peers; };
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Transports transports;
|
extern Transports transports;
|
||||||
|
|
Loading…
Reference in a new issue