1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:57:34 +00:00

Kernel: A bunch of hacking towards initial Ethernet support.

This commit is contained in:
Andreas Kling 2019-03-10 20:59:23 +01:00
parent 4641ee49b5
commit 97664fad60
8 changed files with 239 additions and 5 deletions

View file

@ -4,17 +4,15 @@
#include <AK/Types.h>
#include <Kernel/StdLib.h>
class MACAddress {
class [[gnu::packed]] MACAddress {
public:
MACAddress() { }
MACAddress(const byte data[6])
: m_valid(true)
{
memcpy(m_data, data, 6);
}
~MACAddress() { }
bool is_valid() const { return m_valid; }
byte operator[](int i) const
{
ASSERT(i >= 0 && i < 6);
@ -23,5 +21,6 @@ public:
private:
byte m_data[6];
bool m_valid { false };
};
static_assert(sizeof(MACAddress) == 6);