mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 19:15:06 +00:00
Kernel: Add a NetworkTask and a received network packet queue.
It will be easier to deal with incoming packets in a separate task.
This commit is contained in:
parent
47b096feb4
commit
35098cbde1
10 changed files with 90 additions and 11 deletions
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/SinglyLinkedList.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/MACAddress.h>
|
||||
#include <Kernel/ARPPacket.h>
|
||||
|
@ -13,11 +15,15 @@ public:
|
|||
|
||||
void send(const MACAddress&, const ARPPacket&);
|
||||
|
||||
ByteBuffer dequeue_packet();
|
||||
|
||||
protected:
|
||||
NetworkAdapter();
|
||||
void set_mac_address(const MACAddress& mac_address) { m_mac_address = mac_address; }
|
||||
virtual void send_raw(const byte*, int) = 0;
|
||||
void did_receive(const byte*, int);
|
||||
|
||||
private:
|
||||
MACAddress m_mac_address;
|
||||
SinglyLinkedList<ByteBuffer> m_packet_queue;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue