summaryrefslogtreecommitdiff
path: root/node/Peer.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-01-12 09:49:11 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-01-12 09:49:11 -0800
commitfbc6ca28b7ee0b5d9917cdf6f7251e65dbb0d3ee (patch)
tree56787fd56d1fdafeabeb2e82e9bb3d8174f57468 /node/Peer.hpp
parent72f926dc41bed699f6510a273f5ebbe30d84f755 (diff)
parenteab3ca1401b083b3d91d30d2c6f571dcb5c8a2a6 (diff)
downloadinfinitytier-fbc6ca28b7ee0b5d9917cdf6f7251e65dbb0d3ee.tar.gz
infinitytier-fbc6ca28b7ee0b5d9917cdf6f7251e65dbb0d3ee.zip
Merge branch 'adamierymenko-dev' of ssh://earth.zerotier.net:55522/git/ZeroTierOne into adamierymenko-dev
Diffstat (limited to 'node/Peer.hpp')
-rw-r--r--node/Peer.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/node/Peer.hpp b/node/Peer.hpp
index 142002a8..09bf0e04 100644
--- a/node/Peer.hpp
+++ b/node/Peer.hpp
@@ -341,6 +341,32 @@ public:
inline unsigned int remoteVersionMinor() const throw() { return _vMinor; }
inline unsigned int remoteVersionRevision() const throw() { return _vRevision; }
+ /**
+ * Check whether this peer's version is both known and is at least what is specified
+ *
+ * @param major Major version to check against
+ * @param minor Minor version
+ * @param rev Revision
+ * @return True if peer's version is at least supplied tuple
+ */
+ inline bool atLeastVersion(unsigned int major,unsigned int minor,unsigned int rev)
+ throw()
+ {
+ if ((_vMajor > 0)||(_vMinor > 0)||(_vRevision > 0)) {
+ if (_vMajor > major)
+ return true;
+ else if (_vMajor == major) {
+ if (_vMinor > minor)
+ return true;
+ else if (_vMinor == minor) {
+ if (_vRevision >= rev)
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
inline bool remoteVersionKnown() const throw() { return ((_vMajor > 0)||(_vMinor > 0)||(_vRevision > 0)); }
/**