From 4e95384ad60c853f01c50e233b8cb48f239f033f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 5 Jan 2015 17:47:59 -0800 Subject: Cleanup, add tristate to config code in Network, and happy new year! --- node/NetworkConfig.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'node/NetworkConfig.hpp') diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index ea27d525..c3bf2a6b 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -1,6 +1,6 @@ /* * ZeroTier One - Global Peer to Peer Ethernet - * Copyright (C) 2011-2014 ZeroTier Networks LLC + * Copyright (C) 2011-2015 ZeroTier Networks * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,9 +82,13 @@ public: { MulticastRate() throw() {} MulticastRate(uint32_t pl,uint32_t maxb,uint32_t acc) throw() : preload(pl),maxBalance(maxb),accrual(acc) {} + uint32_t preload; uint32_t maxBalance; uint32_t accrual; + + inline bool operator==(const MulticastRate &mr) const { return ((preload == mr.preload)&&(maxBalance == mr.maxBalance)&&(accrual == mr.accrual)); } + inline bool operator!=(const MulticastRate &mr) const { return (!(*this == mr)); } }; /** @@ -159,15 +163,18 @@ public: const MulticastRate &multicastRate(const MulticastGroup &mg) const throw(); + bool operator==(const NetworkConfig &nc) const; + inline bool operator!=(const NetworkConfig &nc) const { return (!(*this == nc)); } + private: NetworkConfig() {} ~NetworkConfig() {} void _fromDictionary(const Dictionary &d); - unsigned char _etWhitelist[65536 / 8]; uint64_t _nwid; uint64_t _timestamp; + unsigned char _etWhitelist[65536 / 8]; Address _issuedTo; unsigned int _multicastLimit; bool _allowPassiveBridging; -- cgit v1.2.3