summaryrefslogtreecommitdiff
path: root/node/Switch.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-06-02 12:49:36 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-06-02 12:49:36 -0700
commit3d6c1860ca8169f618ad70ae92e4a8cd2f4746c8 (patch)
treeca93fd3ca8dc6fb9afffcc78b0167a3c6d204eec /node/Switch.hpp
parentf0be5e814eb0c9496d6c163e2d5bc213e7b483c4 (diff)
parent79efceb57bd71e91f5733dc4c54b3213a3f95636 (diff)
downloadinfinitytier-3d6c1860ca8169f618ad70ae92e4a8cd2f4746c8.tar.gz
infinitytier-3d6c1860ca8169f618ad70ae92e4a8cd2f4746c8.zip
Merge branch 'adamierymenko-dev' into android-jni
Diffstat (limited to 'node/Switch.hpp')
-rw-r--r--node/Switch.hpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/node/Switch.hpp b/node/Switch.hpp
index e944c843..0ba4c138 100644
--- a/node/Switch.hpp
+++ b/node/Switch.hpp
@@ -111,8 +111,9 @@ public:
*
* @param packet Packet to send
* @param encrypt Encrypt packet payload? (always true except for HELLO)
+ * @param nwid Network ID or 0 if message is not related to a specific network
*/
- void send(const Packet &packet,bool encrypt);
+ void send(const Packet &packet,bool encrypt,uint64_t nwid);
/**
* Send RENDEZVOUS to two peers to permit them to directly connect
@@ -183,15 +184,8 @@ private:
void _handleRemotePacketFragment(const InetAddress &fromAddr,const void *data,unsigned int len);
void _handleRemotePacketHead(const InetAddress &fromAddr,const void *data,unsigned int len);
void _handleBeacon(const InetAddress &fromAddr,const Buffer<ZT_PROTO_BEACON_LENGTH> &data);
-
- Address _sendWhoisRequest(
- const Address &addr,
- const Address *peersAlreadyConsulted,
- unsigned int numPeersAlreadyConsulted);
-
- bool _trySend(
- const Packet &packet,
- bool encrypt);
+ Address _sendWhoisRequest(const Address &addr,const Address *peersAlreadyConsulted,unsigned int numPeersAlreadyConsulted);
+ bool _trySend(const Packet &packet,bool encrypt,uint64_t nwid);
const RuntimeEnvironment *const RR;
volatile uint64_t _lastBeacon;
@@ -226,13 +220,15 @@ private:
struct TXQueueEntry
{
TXQueueEntry() {}
- TXQueueEntry(uint64_t ct,const Packet &p,bool enc) :
+ TXQueueEntry(uint64_t ct,const Packet &p,bool enc,uint64_t nw) :
creationTime(ct),
+ nwid(nw),
packet(p),
encrypt(enc) {}
uint64_t creationTime;
- Packet packet; // unencrypted/untagged for TX queue
+ uint64_t nwid;
+ Packet packet; // unencrypted/unMAC'd packet -- this is done at send time
bool encrypt;
};
std::multimap< Address,TXQueueEntry > _txQueue;