|
|
@ -173,24 +173,25 @@ namespace llarp
|
|
|
|
util::StatusObject
|
|
|
|
util::StatusObject
|
|
|
|
ILinkLayer::ExtractStatus() const
|
|
|
|
ILinkLayer::ExtractStatus() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::vector<util::StatusObject> pending, established;
|
|
|
|
std::vector< util::StatusObject > pending, established;
|
|
|
|
|
|
|
|
|
|
|
|
std::transform(m_Pending.begin(), m_Pending.end(), std::back_inserter(pending), [](const auto & item) -> util::StatusObject {
|
|
|
|
std::transform(m_Pending.begin(), m_Pending.end(),
|
|
|
|
return item.second->ExtractStatus();
|
|
|
|
std::back_inserter(pending),
|
|
|
|
});
|
|
|
|
[](const auto& item) -> util::StatusObject {
|
|
|
|
std::transform(m_AuthedLinks.begin(), m_AuthedLinks.end(), std::back_inserter(established), [](const auto & item) -> util::StatusObject {
|
|
|
|
return item.second->ExtractStatus();
|
|
|
|
return item.second->ExtractStatus();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
std::transform(m_AuthedLinks.begin(), m_AuthedLinks.end(),
|
|
|
|
|
|
|
|
std::back_inserter(established),
|
|
|
|
return {
|
|
|
|
[](const auto& item) -> util::StatusObject {
|
|
|
|
{"name", Name()},
|
|
|
|
return item.second->ExtractStatus();
|
|
|
|
{"rank", uint64_t(Rank())},
|
|
|
|
});
|
|
|
|
{"addr", m_ourAddr.ToString()},
|
|
|
|
|
|
|
|
{"sessions", util::StatusObject{
|
|
|
|
return {{"name", Name()},
|
|
|
|
{"pending", pending},
|
|
|
|
{"rank", uint64_t(Rank())},
|
|
|
|
{"established", established}
|
|
|
|
{"addr", m_ourAddr.ToString()},
|
|
|
|
}}
|
|
|
|
{"sessions",
|
|
|
|
};
|
|
|
|
util::StatusObject{{"pending", pending},
|
|
|
|
|
|
|
|
{"established", established}}}};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|