(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.
This commit is contained in:
parent
0e5aac6a11
commit
f69454ec98
29 changed files with 622 additions and 622 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue