1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

Kernel: Bring up enough networking code that we can respond to ARP requests.

This is all pretty rickety but we can now respond to "arping" from the host
while running inside QEMU. Very cool. :^)
This commit is contained in:
Andreas Kling 2019-03-11 23:21:38 +01:00
parent 10dcd3a47f
commit 318b01e055
12 changed files with 229 additions and 40 deletions

View file

@ -4,6 +4,7 @@
#include <AK/SinglyLinkedList.h>
#include <AK/Types.h>
#include <Kernel/MACAddress.h>
#include <Kernel/IPv4Address.h>
#include <Kernel/ARPPacket.h>
class NetworkAdapter {
@ -12,6 +13,9 @@ public:
virtual const char* class_name() const = 0;
MACAddress mac_address() { return m_mac_address; }
IPv4Address ipv4_address() const { return m_ipv4_address; }
void set_ipv4_address(const IPv4Address&);
void send(const MACAddress&, const ARPPacket&);
@ -25,5 +29,6 @@ protected:
private:
MACAddress m_mac_address;
IPv4Address m_ipv4_address;
SinglyLinkedList<ByteBuffer> m_packet_queue;
};