summaryrefslogtreecommitdiff
path: root/node/Network.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-09 12:42:25 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-09 12:42:25 -0700
commitd5e0f7e3e453482bf6e7d6d8cb76a68ecc26b287 (patch)
treee0274527ce9afeb54917767e377d800cf943e27c /node/Network.hpp
parent620e64c58f1332d6b9948108dcd1ebf99223074d (diff)
downloadinfinitytier-d5e0f7e3e453482bf6e7d6d8cb76a68ecc26b287.tar.gz
infinitytier-d5e0f7e3e453482bf6e7d6d8cb76a68ecc26b287.zip
Reorg multicast packet, and a whole bunch of refactoring around the pushing of certificates of membership.
Diffstat (limited to 'node/Network.hpp')
-rw-r--r--node/Network.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/node/Network.hpp b/node/Network.hpp
index 90ac34d6..a2a49584 100644
--- a/node/Network.hpp
+++ b/node/Network.hpp
@@ -215,18 +215,19 @@ public:
void addMembershipCertificate(const CertificateOfMembership &cert,bool forceAccept);
/**
- * Push our membership certificate to a peer
+ * Check if we should push membership certificate to a peer, and update last pushed
*
- * @param peer Destination peer address
- * @param force If true, push even if we've already done so within required time frame
+ * If we haven't pushed a cert to this peer in a long enough time, this returns
+ * true and updates the last pushed time. Otherwise it returns false.
+ *
+ * This doesn't actually send anything, since COMs can hitch a ride with several
+ * different kinds of packets.
+ *
+ * @param to Destination peer
* @param now Current time
+ * @return True if we should include a COM with whatever we're currently sending
*/
- inline void pushMembershipCertificate(const Address &peer,bool force,uint64_t now)
- {
- Mutex::Lock _l(_lock);
- if ((_config)&&(!_config->isPublic())&&(_config->com()))
- _pushMembershipCertificate(peer,force,now);
- }
+ bool peerNeedsOurMembershipCertificate(const Address &to,uint64_t now);
/**
* @param peer Peer address to check
@@ -445,7 +446,6 @@ public:
private:
static void _CBhandleTapData(void *arg,const MAC &from,const MAC &to,unsigned int etherType,const Buffer<4096> &data);
- void _pushMembershipCertificate(const Address &peer,bool force,uint64_t now);
void _restoreState();
void _dumpMembershipCerts();