summaryrefslogtreecommitdiff
path: root/node/RemotePath.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-24 16:21:36 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-24 16:21:36 -0700
commitf69454ec9879a0b0a424f743ca144d1123ef7e99 (patch)
treea53bd7f8ebc2d164ead7d530a8e9ef17ffe73ddb /node/RemotePath.hpp
parent0e5aac6a117c28fde63f4cdb94e6c9fc415ca098 (diff)
downloadinfinitytier-f69454ec9879a0b0a424f743ca144d1123ef7e99.tar.gz
infinitytier-f69454ec9879a0b0a424f743ca144d1123ef7e99.zip
(1) Make ZT_ naming convention consistent (get rid of ZT1_), (2) Make local interface a full sockaddr_storage instead of an int identifier, which turns out to be better for multi-homing and other uses.
Diffstat (limited to 'node/RemotePath.hpp')
-rw-r--r--node/RemotePath.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/node/RemotePath.hpp b/node/RemotePath.hpp
index a7ef141b..0034242e 100644
--- a/node/RemotePath.hpp
+++ b/node/RemotePath.hpp
@@ -53,17 +53,17 @@ public:
Path(),
_lastSend(0),
_lastReceived(0),
- _localInterfaceId(-1),
+ _localAddress(),
_fixed(false) {}
- RemotePath(int localInterfaceId,const InetAddress &addr,bool fixed) :
+ RemotePath(const InetAddress &localAddress,const InetAddress &addr,bool fixed) :
Path(addr,0,TRUST_NORMAL),
_lastSend(0),
_lastReceived(0),
- _localInterfaceId(localInterfaceId),
+ _localAddress(localAddress),
_fixed(fixed) {}
- inline int localInterfaceId() const throw() { return _localInterfaceId; }
+ inline const InetAddress &localAddress() const throw() { return _localAddress; }
inline uint64_t lastSend() const throw() { return _lastSend; }
inline uint64_t lastReceived() const throw() { return _lastReceived; }
@@ -127,7 +127,7 @@ public:
*/
inline bool send(const RuntimeEnvironment *RR,const void *data,unsigned int len,uint64_t now)
{
- if (RR->node->putPacket(_localInterfaceId,address(),data,len)) {
+ if (RR->node->putPacket(_localAddress,address(),data,len)) {
sent(now);
RR->antiRec->logOutgoingZT(data,len);
return true;
@@ -138,7 +138,7 @@ public:
private:
uint64_t _lastSend;
uint64_t _lastReceived;
- int _localInterfaceId;
+ InetAddress _localAddress;
bool _fixed;
};