summaryrefslogtreecommitdiff
path: root/node/Packet.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-01 14:36:52 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-01 14:36:52 -0800
commit1d39be61b267a85adebeee9e979bd1d84f55da3c (patch)
tree2fa5efbe2406a9a60686c1de422ff2c574802ba5 /node/Packet.hpp
parent2bf9145ae65385bf968542619ffcf204cf6241d8 (diff)
downloadinfinitytier-1d39be61b267a85adebeee9e979bd1d84f55da3c.tar.gz
infinitytier-1d39be61b267a85adebeee9e979bd1d84f55da3c.zip
ZeroTier now has link quality measurement. We are not using this yet but decided to put it in to prep for future QoS support and SD-WAN stuff.
Diffstat (limited to 'node/Packet.hpp')
-rw-r--r--node/Packet.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/node/Packet.hpp b/node/Packet.hpp
index 2017ce8e..d5817708 100644
--- a/node/Packet.hpp
+++ b/node/Packet.hpp
@@ -59,15 +59,17 @@
* + Otherwise backward compatible with protocol v4
* 6 - 1.1.5 ... 1.1.10
* + Network configuration format revisions including binary values
- * 7 - 1.1.10 -- 1.2.0
+ * 7 - 1.1.10 ... 1.1.17
* + Introduce trusted paths for local SDN use
- * 8 - 1.2.0 -- CURRENT
+ * 8 - 1.1.17 ... 1.2.0
* + Multipart network configurations for large network configs
* + Tags and Capabilities
* + Inline push of CertificateOfMembership deprecated
* + Certificates of representation for federation and mesh
+ * 9 - 1.2.0 ... CURRENT
+ * + In-band encoding of packet counter for link quality measurement
*/
-#define ZT_PROTO_VERSION 8
+#define ZT_PROTO_VERSION 9
/**
* Minimum supported protocol version
@@ -1320,6 +1322,11 @@ public:
inline uint64_t packetId() const { return at<uint64_t>(ZT_PACKET_IDX_IV); }
/**
+ * @return Value of link quality counter extracted from this packet's ID, range 0 to 7 (3 bits)
+ */
+ inline unsigned int linkQualityCounter() const { return (unsigned int)(reinterpret_cast<const uint8_t *>(data())[7] & 7); }
+
+ /**
* Set packet verb
*
* This also has the side-effect of clearing any verb flags, such as