mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 16:34:13 +00:00
added SetFamilyString(); GetFamilyString() and shows family in webiface
This commit is contained in:
parent
c54f7c81c4
commit
a78caa2976
@ -417,6 +417,7 @@ namespace util
|
||||
default: s << "Unknown";
|
||||
}
|
||||
s << "<br>\r\n";
|
||||
s << "<b>Family:</b> " << i2p::context.GetFamilyString() << "<br>\r\n";
|
||||
s << "<b>Tunnel creation success rate:</b> " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate () << "%<br>\r\n";
|
||||
s << "<b>Received:</b> ";
|
||||
s << std::fixed << std::setprecision(2);
|
||||
|
@ -149,11 +149,23 @@ namespace i2p
|
||||
UpdateRouterInfo ();
|
||||
}
|
||||
|
||||
std::string RouterContext::GetFamilyString () const
|
||||
{
|
||||
return m_FamilyString;
|
||||
}
|
||||
|
||||
void RouterContext::SetFamily (const std::string& family)
|
||||
{
|
||||
|
||||
m_FamilyString = family;
|
||||
if (m_FamilyString.length() == 0)
|
||||
m_FamilyString = "<undefined>";
|
||||
|
||||
std::string signature;
|
||||
if (family.length () > 0)
|
||||
{
|
||||
signature = i2p::data::CreateFamilySignature (family, GetIdentHash ());
|
||||
}
|
||||
if (signature.length () > 0)
|
||||
{
|
||||
m_RouterInfo.SetProperty (i2p::data::ROUTER_INFO_PROPERTY_FAMILY, family);
|
||||
|
@ -59,6 +59,7 @@ namespace i2p
|
||||
bool IsFloodfill () const { return m_IsFloodfill; };
|
||||
void SetFloodfill (bool floodfill);
|
||||
void SetFamily (const std::string& family);
|
||||
std::string GetFamilyString () const;
|
||||
void SetBandwidth (int limit); /* in kilobytes */
|
||||
void SetBandwidth (char L); /* by letter */
|
||||
bool AcceptsTunnels () const { return m_AcceptsTunnels; };
|
||||
@ -100,6 +101,7 @@ namespace i2p
|
||||
i2p::data::PrivateKeys m_Keys;
|
||||
uint64_t m_LastUpdateTime;
|
||||
bool m_AcceptsTunnels, m_IsFloodfill;
|
||||
std::string m_FamilyString;
|
||||
uint64_t m_StartupTime; // in seconds since epoch
|
||||
uint32_t m_BandwidthLimit; // allowed bandwidth
|
||||
RouterStatus m_Status;
|
||||
|
Loading…
x
Reference in New Issue
Block a user