From ffad0b27809f8ec0cca11a5dabd9624340857f57 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 11 Jul 2013 16:19:06 -0400 Subject: Factoring out packet decoder from Switch to put that object on a little bit of a diet. Work in progress, wont build yet. --- node/Packet.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'node/Packet.hpp') diff --git a/node/Packet.hpp b/node/Packet.hpp index 7eae9880..a5c450fb 100644 --- a/node/Packet.hpp +++ b/node/Packet.hpp @@ -562,6 +562,18 @@ public: setVerb(v); } + /** + * Generate a new IV / packet ID in place + * + * This can be used to re-use a packet buffer multiple times to send + * technically different but otherwise identical copies of the same + * packet. + */ + inline void newInitializationVector() + { + Utils::getSecureRandom(field(ZT_PACKET_IDX_IV,8),8); + } + /** * Set this packet's destination * -- cgit v1.2.3