diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-09-17 16:11:57 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-09-17 16:11:57 -0400 |
| commit | f9079a110ee8336a8403efe466e2a75620c95ab1 (patch) | |
| tree | 887584d8d1f538f517e1564479697745a1237d90 /node/Network.hpp | |
| parent | 4c06fcfc9dd0ba25ec2c50ce03f10f1d93f168f5 (diff) | |
| download | infinitytier-f9079a110ee8336a8403efe466e2a75620c95ab1.tar.gz infinitytier-f9079a110ee8336a8403efe466e2a75620c95ab1.zip | |
Make network multicast breadth/depth parameters configurable on a per-net basis.
Diffstat (limited to 'node/Network.hpp')
| -rw-r--r-- | node/Network.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/node/Network.hpp b/node/Network.hpp index ec4b9299..3e428ac2 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -318,6 +318,28 @@ public: } /** + * @return Breadth for multicast propagation + */ + inline unsigned int multicastPropagationBreadth() const + { + const_iterator mcb(find("mcb")); + if (mcb == end()) + return ZT_MULTICAST_DEFAULT_PROPAGATION_BREADTH; + return Utils::hexStrToUInt(mcb->second.c_str()); + } + + /** + * @return Depth for multicast propagation + */ + inline unsigned int multicastPropagationDepth() const + { + const_iterator mcd(find("mcd")); + if (mcd == end()) + return ZT_MULTICAST_DEFAULT_PROPAGATION_DEPTH; + return Utils::hexStrToUInt(mcd->second.c_str()); + } + + /** * @return Certificate of membership for this network, or empty cert if none */ inline CertificateOfMembership certificateOfMembership() const @@ -586,6 +608,24 @@ public: //return tmp; } + /** + * @return Breadth for multicast rumor mill propagation + */ + inline unsigned int multicastPropagationBreadth() const + throw() + { + return _multicastPropagationBreadth; + } + + /** + * @return Depth for multicast rumor mill propagation + */ + inline unsigned int multicastPropagationDepth() const + throw() + { + return _multicastPropagationDepth; + } + private: static void _CBhandleTapData(void *arg,const MAC &from,const MAC &to,unsigned int etherType,const Buffer<4096> &data); void _restoreState(); @@ -606,6 +646,8 @@ private: Config _configuration; CertificateOfMembership _myCertificate; // memoized from _configuration MulticastRates _mcRates; // memoized from _configuration + unsigned int _multicastPropagationBreadth; // memoized from _configuration + unsigned int _multicastPropagationDepth; // memoized from _configuration // Ethertype whitelist bit field, set from config, for really fast lookup unsigned char _etWhitelist[65536 / 8]; |
