mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
show bandwidth caps for hops
This commit is contained in:
parent
ee8449fa05
commit
fd4513ebb2
@ -417,6 +417,15 @@ namespace http {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ShowHop(std::stringstream& s, const i2p::data::IdentityEx& ident)
|
||||||
|
{
|
||||||
|
auto identHash = ident.GetIdentHash();
|
||||||
|
auto router = i2p::data::netdb.FindRouter(identHash);
|
||||||
|
s << i2p::data::GetIdentHashAbbreviation(identHash);
|
||||||
|
if (router)
|
||||||
|
s << "<small style=\"color:gray\"> " << router->GetBandwidthCap() << "</small>";
|
||||||
|
}
|
||||||
|
|
||||||
static void ShowLeaseSetDestination (std::stringstream& s, std::shared_ptr<const i2p::client::LeaseSetDestination> dest, uint32_t token)
|
static void ShowLeaseSetDestination (std::stringstream& s, std::shared_ptr<const i2p::client::LeaseSetDestination> dest, uint32_t token)
|
||||||
{
|
{
|
||||||
s << "<b>Base32:</b><br>\r\n<textarea readonly cols=\"80\" rows=\"1\">";
|
s << "<b>Base32:</b><br>\r\n<textarea readonly cols=\"80\" rows=\"1\">";
|
||||||
@ -482,7 +491,9 @@ namespace http {
|
|||||||
it->VisitTunnelHops(
|
it->VisitTunnelHops(
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
||||||
{
|
{
|
||||||
s << "⇒ " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " ";
|
s << "⇒ ";
|
||||||
|
ShowHop(s, *hopIdent);
|
||||||
|
s << " ";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -503,7 +514,9 @@ namespace http {
|
|||||||
it->VisitTunnelHops(
|
it->VisitTunnelHops(
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
||||||
{
|
{
|
||||||
s << " " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " ⇒";
|
s << " ";
|
||||||
|
ShowHop(s, *hopIdent);
|
||||||
|
s << " ⇒";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -699,7 +712,9 @@ namespace http {
|
|||||||
it->VisitTunnelHops(
|
it->VisitTunnelHops(
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
||||||
{
|
{
|
||||||
s << "⇒ " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " ";
|
s << "⇒ ";
|
||||||
|
ShowHop(s, *hopIdent);
|
||||||
|
s << " ";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -720,7 +735,9 @@ namespace http {
|
|||||||
it->VisitTunnelHops(
|
it->VisitTunnelHops(
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
||||||
{
|
{
|
||||||
s << " " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " ⇒";
|
s << " ";
|
||||||
|
ShowHop(s, *hopIdent);
|
||||||
|
s << " ⇒";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -514,13 +514,20 @@ namespace data
|
|||||||
case CAPS_FLAG_FLOODFILL:
|
case CAPS_FLAG_FLOODFILL:
|
||||||
m_Caps |= Caps::eFloodfill;
|
m_Caps |= Caps::eFloodfill;
|
||||||
break;
|
break;
|
||||||
|
case CAPS_FLAG_LOW_BANDWIDTH1:
|
||||||
|
case CAPS_FLAG_LOW_BANDWIDTH2:
|
||||||
|
case CAPS_FLAG_LOW_BANDWIDTH3:
|
||||||
|
m_BandwidthCap = *cap;
|
||||||
|
break;
|
||||||
case CAPS_FLAG_HIGH_BANDWIDTH1:
|
case CAPS_FLAG_HIGH_BANDWIDTH1:
|
||||||
case CAPS_FLAG_HIGH_BANDWIDTH2:
|
case CAPS_FLAG_HIGH_BANDWIDTH2:
|
||||||
m_Caps |= Caps::eHighBandwidth;
|
m_Caps |= Caps::eHighBandwidth;
|
||||||
|
m_BandwidthCap = *cap;
|
||||||
break;
|
break;
|
||||||
case CAPS_FLAG_EXTRA_BANDWIDTH1:
|
case CAPS_FLAG_EXTRA_BANDWIDTH1:
|
||||||
case CAPS_FLAG_EXTRA_BANDWIDTH2:
|
case CAPS_FLAG_EXTRA_BANDWIDTH2:
|
||||||
m_Caps |= Caps::eExtraBandwidth | Caps::eHighBandwidth;
|
m_Caps |= Caps::eExtraBandwidth | Caps::eHighBandwidth;
|
||||||
|
m_BandwidthCap = *cap;
|
||||||
break;
|
break;
|
||||||
case CAPS_FLAG_HIDDEN:
|
case CAPS_FLAG_HIDDEN:
|
||||||
m_Caps |= Caps::eHidden;
|
m_Caps |= Caps::eHidden;
|
||||||
|
@ -258,6 +258,7 @@ namespace data
|
|||||||
bool IsHighCongestion (bool highBandwidth) const;
|
bool IsHighCongestion (bool highBandwidth) const;
|
||||||
|
|
||||||
uint8_t GetCaps () const { return m_Caps; };
|
uint8_t GetCaps () const { return m_Caps; };
|
||||||
|
char GetBandwidthCap() const { return m_BandwidthCap; };
|
||||||
void SetCaps (uint8_t caps) { m_Caps = caps; };
|
void SetCaps (uint8_t caps) { m_Caps = caps; };
|
||||||
|
|
||||||
Congestion GetCongestion () const { return m_Congestion; };
|
Congestion GetCongestion () const { return m_Congestion; };
|
||||||
@ -329,6 +330,7 @@ namespace data
|
|||||||
bool m_IsUpdated, m_IsUnreachable;
|
bool m_IsUpdated, m_IsUnreachable;
|
||||||
CompatibleTransports m_SupportedTransports, m_ReachableTransports;
|
CompatibleTransports m_SupportedTransports, m_ReachableTransports;
|
||||||
uint8_t m_Caps;
|
uint8_t m_Caps;
|
||||||
|
char m_BandwidthCap;
|
||||||
int m_Version;
|
int m_Version;
|
||||||
Congestion m_Congestion;
|
Congestion m_Congestion;
|
||||||
mutable std::shared_ptr<RouterProfile> m_Profile;
|
mutable std::shared_ptr<RouterProfile> m_Profile;
|
||||||
|
Loading…
Reference in New Issue
Block a user