summaryrefslogtreecommitdiff
path: root/node/Node.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-01-11 10:17:44 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-01-11 10:17:44 -0800
commitb3e3d4cacca37a4850e4e1a91fb8c42a5b13cb26 (patch)
tree0fbeba94f3021f8d55ada20c5ed8d193f574d70f /node/Node.hpp
parentba2a89c760f9bfa4936f3cf89155aafd047af917 (diff)
downloadinfinitytier-b3e3d4cacca37a4850e4e1a91fb8c42a5b13cb26.tar.gz
infinitytier-b3e3d4cacca37a4850e4e1a91fb8c42a5b13cb26.zip
Instead of using binary packet comparison, add a callback to the API to explicitly check whether paths should be used. Check in with this callback (if present) when learning new paths or sending initial packets.
Diffstat (limited to 'node/Node.hpp')
-rw-r--r--node/Node.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/node/Node.hpp b/node/Node.hpp
index 15295139..b6b32363 100644
--- a/node/Node.hpp
+++ b/node/Node.hpp
@@ -71,6 +71,7 @@ public:
ZT_WirePacketSendFunction wirePacketSendFunction,
ZT_VirtualNetworkFrameFunction virtualNetworkFrameFunction,
ZT_VirtualNetworkConfigFunction virtualNetworkConfigFunction,
+ ZT_PathCheckFunction pathCheckFunction,
ZT_EventCallback eventCallback);
~Node();
@@ -189,6 +190,13 @@ public:
len);
}
+ /**
+ * @param localAddress Local address
+ * @param remoteAddress Remote address
+ * @return True if path should be used
+ */
+ bool shouldUsePathForZeroTierTraffic(const InetAddress &localAddress,const InetAddress &remoteAddress);
+
inline SharedPtr<Network> network(uint64_t nwid) const
{
Mutex::Lock _l(_networks_m);
@@ -288,6 +296,7 @@ private:
ZT_WirePacketSendFunction _wirePacketSendFunction;
ZT_VirtualNetworkFrameFunction _virtualNetworkFrameFunction;
ZT_VirtualNetworkConfigFunction _virtualNetworkConfigFunction;
+ ZT_PathCheckFunction _pathCheckFunction;
ZT_EventCallback _eventCallback;
std::vector< std::pair< uint64_t, SharedPtr<Network> > > _networks;