summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-11 11:45:04 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-11 11:45:04 -0700
commitc1a53a26536d2635118262f5f719795b2e70e5fa (patch)
tree5c53f7bc648ce7fc05ef9541cb727202eaa66736 /node
parent9dc2ef554997f5598c9cf2c4d3ca041c3152a962 (diff)
downloadinfinitytier-c1a53a26536d2635118262f5f719795b2e70e5fa.tar.gz
infinitytier-c1a53a26536d2635118262f5f719795b2e70e5fa.zip
ARP cache and responder agent code for use in netcon and iOS.
Diffstat (limited to 'node')
-rw-r--r--node/Hashtable.hpp5
-rw-r--r--node/MAC.hpp6
2 files changed, 11 insertions, 0 deletions
diff --git a/node/Hashtable.hpp b/node/Hashtable.hpp
index bcc111e3..d2b85c15 100644
--- a/node/Hashtable.hpp
+++ b/node/Hashtable.hpp
@@ -380,6 +380,11 @@ private:
* hash an integer key index in a hash table. */
return (unsigned long)i;
}
+ static inline unsigned long _hc(const uint32_t i)
+ {
+ // In the uint32_t case we use a simple multiplier for hashing to ensure coverage
+ return ((unsigned long)i * (unsigned long)2654435761);
+ }
inline void _grow()
{
diff --git a/node/MAC.hpp b/node/MAC.hpp
index 619b7195..a9cd43cf 100644
--- a/node/MAC.hpp
+++ b/node/MAC.hpp
@@ -250,6 +250,12 @@ public:
_m = m._m;
return *this;
}
+ inline MAC &operator=(const uint64_t m)
+ throw()
+ {
+ _m = m;
+ return *this;
+ }
inline bool operator==(const MAC &m) const throw() { return (_m == m._m); }
inline bool operator!=(const MAC &m) const throw() { return (_m != m._m); }