summaryrefslogtreecommitdiff
path: root/node/RemotePath.hpp
diff options
context:
space:
mode:
authorGrant Limberg <glimberg@gmail.com>2015-09-26 13:47:55 -0700
committerGrant Limberg <glimberg@gmail.com>2015-09-26 13:47:55 -0700
commite8cdff3eafd8096da22122eabddf57a09fe2bb90 (patch)
treed231aa6d9ccccc8ced6e1ead606ce16ff551cab9 /node/RemotePath.hpp
parent53d98343b7b444508259f6f1643e8d6724fb11e9 (diff)
parentf69454ec9879a0b0a424f743ca144d1123ef7e99 (diff)
downloadinfinitytier-e8cdff3eafd8096da22122eabddf57a09fe2bb90.tar.gz
infinitytier-e8cdff3eafd8096da22122eabddf57a09fe2bb90.zip
Merge branch 'adamierymenko-dev' into android-jni-dev
also update for changed function calls that now accept a local address # Conflicts: # include/ZeroTierOne.h # java/CMakeLists.txt # java/jni/Android.mk # java/jni/ZT1_jnicache.cpp # java/jni/ZT1_jnilookup.h # java/jni/ZT1_jniutils.cpp # java/jni/com_zerotierone_sdk_Node.cpp
Diffstat (limited to 'node/RemotePath.hpp')
-rw-r--r--node/RemotePath.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/node/RemotePath.hpp b/node/RemotePath.hpp
index 291943c9..0034242e 100644
--- a/node/RemotePath.hpp
+++ b/node/RemotePath.hpp
@@ -53,14 +53,18 @@ public:
Path(),
_lastSend(0),
_lastReceived(0),
+ _localAddress(),
_fixed(false) {}
- RemotePath(const InetAddress &addr,bool fixed) :
+ RemotePath(const InetAddress &localAddress,const InetAddress &addr,bool fixed) :
Path(addr,0,TRUST_NORMAL),
_lastSend(0),
_lastReceived(0),
+ _localAddress(localAddress),
_fixed(fixed) {}
+ inline const InetAddress &localAddress() const throw() { return _localAddress; }
+
inline uint64_t lastSend() const throw() { return _lastSend; }
inline uint64_t lastReceived() const throw() { return _lastReceived; }
@@ -123,7 +127,7 @@ public:
*/
inline bool send(const RuntimeEnvironment *RR,const void *data,unsigned int len,uint64_t now)
{
- if (RR->node->putPacket(address(),data,len)) {
+ if (RR->node->putPacket(_localAddress,address(),data,len)) {
sent(now);
RR->antiRec->logOutgoingZT(data,len);
return true;
@@ -134,6 +138,7 @@ public:
private:
uint64_t _lastSend;
uint64_t _lastReceived;
+ InetAddress _localAddress;
bool _fixed;
};