net: add All() in ReachableNets

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
brunoergandVasil Dimov committed 2024-09-10 11:20:40 -03:00
1 parent e4fb97a512
commit f698636ec8
1 file changed
+7
+7
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;