Browse Source

handle i2p.router.netdb.activepeers

pull/150/head
orignal 10 years ago
parent
commit
02b7cd71c5
  1. 9
      I2PControl.cpp
  2. 4
      I2PControl.h
  3. 1
      Transports.h

9
I2PControl.cpp

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
#include "Daemon.h"
#include "Tunnel.h"
#include "Timestamp.h"
#include "Transports.h"
namespace i2p
{
@ -28,6 +29,7 @@ namespace client @@ -28,6 +29,7 @@ namespace client
// RouterInfo
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;
// RouterManager
@ -226,9 +228,14 @@ namespace client @@ -226,9 +228,14 @@ namespace client
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)
{
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

4
I2PControl.h

@ -37,6 +37,7 @@ namespace client @@ -37,6 +37,7 @@ namespace client
// RouterInfo requests
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";
// RouterManager requests
@ -80,7 +81,8 @@ namespace client @@ -80,7 +81,8 @@ namespace client
// RouterInfo
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);
// RouterManager

1
Transports.h

@ -114,6 +114,7 @@ namespace transport @@ -114,6 +114,7 @@ namespace transport
// for HTTP only
const NTCPServer * GetNTCPServer () const { return m_NTCPServer; };
const SSUServer * GetSSUServer () const { return m_SSUServer; };
const decltype(m_Peers)& GetPeers () const { return m_Peers; };
};
extern Transports transports;

Loading…
Cancel
Save