summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-06-23 16:06:38 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-06-23 16:06:38 -0700
commit2225bb093ae57099c04ff3eabc020468920be11a (patch)
treed92db7b45a723ca2d64e84a79aeb282744ee9348 /osdep
parent75a6a7bacaeadceaf2be01eef36f5df2e0f51d81 (diff)
parentdd68c207f4ed13c4f71bc4d019732f21d633575c (diff)
downloadinfinitytier-2225bb093ae57099c04ff3eabc020468920be11a.tar.gz
infinitytier-2225bb093ae57099c04ff3eabc020468920be11a.zip
Merge branch 'edge' into dev
Diffstat (limited to 'osdep')
-rw-r--r--osdep/Binder.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp
index 1839ecc2..a0b47367 100644
--- a/osdep/Binder.hpp
+++ b/osdep/Binder.hpp
@@ -57,6 +57,7 @@
#include <algorithm>
#include <utility>
#include <map>
+#include <set>
#include "../node/NonCopyable.hpp"
#include "../node/InetAddress.hpp"
@@ -471,6 +472,20 @@ Binder_send_packet:
return aa;
}
+ /**
+ * @param addr Address to check
+ * @return True if this is a bound local interface address
+ */
+ inline bool isBoundLocalInterfaceAddress(const InetAddress &addr) const
+ {
+ Mutex::Lock _l(_lock);
+ for(std::vector<_Binding>::const_iterator b(_bindings.begin());b!=_bindings.end();++b) {
+ if (b->address == addr)
+ return true;
+ }
+ return false;
+ }
+
private:
std::vector<_Binding> _bindings;
Mutex _lock;