summaryrefslogtreecommitdiff
path: root/node/RemotePath.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-23 13:49:56 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-23 13:49:56 -0700
commit367ffde00cf6eecbca0f9fff391dcaf7faf72c6e (patch)
treea3e345de1a0a5998ca7eec6fe9e2ff2283da6c80 /node/RemotePath.hpp
parent4464fa5d392dd930bf847c2dc1c5886398e5d8dd (diff)
downloadinfinitytier-367ffde00cf6eecbca0f9fff391dcaf7faf72c6e.tar.gz
infinitytier-367ffde00cf6eecbca0f9fff391dcaf7faf72c6e.zip
Plumb through localInterfaceId to track local interfaces corresponding with remote addresses.
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..a7ef141b 100644
--- a/node/RemotePath.hpp
+++ b/node/RemotePath.hpp
@@ -53,14 +53,18 @@ public:
Path(),
_lastSend(0),
_lastReceived(0),
+ _localInterfaceId(-1),
_fixed(false) {}
- RemotePath(const InetAddress &addr,bool fixed) :
+ RemotePath(int localInterfaceId,const InetAddress &addr,bool fixed) :
Path(addr,0,TRUST_NORMAL),
_lastSend(0),
_lastReceived(0),
+ _localInterfaceId(localInterfaceId),
_fixed(fixed) {}
+ inline int localInterfaceId() const throw() { return _localInterfaceId; }
+
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(_localInterfaceId,address(),data,len)) {
sent(now);
RR->antiRec->logOutgoingZT(data,len);
return true;
@@ -134,6 +138,7 @@ public:
private:
uint64_t _lastSend;
uint64_t _lastReceived;
+ int _localInterfaceId;
bool _fixed;
};