mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
Kernel: Cache MAC<->IP mappings (from ARP responses) seen on the wire.
This commit is contained in:
parent
05c1a79454
commit
90f60d2f65
5 changed files with 67 additions and 14 deletions
|
@ -47,7 +47,22 @@ private:
|
|||
char m_inline_buffer[0];
|
||||
};
|
||||
|
||||
inline dword string_hash(const char* characters, int length)
|
||||
{
|
||||
dword hash = 0;
|
||||
for (int i = 0; i < length; ++i) {
|
||||
hash += (dword)characters[i];
|
||||
hash += (hash << 10);
|
||||
hash ^= (hash >> 6);
|
||||
}
|
||||
hash += hash << 3;
|
||||
hash ^= hash >> 11;
|
||||
hash += hash << 15;
|
||||
return hash;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using AK::StringImpl;
|
||||
using AK::Chomp;
|
||||
using AK::string_hash;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue