net: add All() in ReachableNets

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
brunoerg 2024-02-15 09:33:24 -03:00
parent e4fb97a512
commit f698636ec8

View file

@ -134,6 +134,13 @@ public:
return Contains(addr.GetNetwork());
}
[[nodiscard]] std::unordered_set<Network> All() const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
{
AssertLockNotHeld(m_mutex);
LOCK(m_mutex);
return m_reachable;
}
private:
mutable Mutex m_mutex;