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:
parent
4641ee49b5
commit
97664fad60
8 changed files with 239 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue