mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
35098cbde1
It will be easier to deal with incoming packets in a separate task.
29 lines
715 B
C++
29 lines
715 B
C++
#pragma once
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
#include <AK/SinglyLinkedList.h>
|
|
#include <AK/Types.h>
|
|
#include <Kernel/MACAddress.h>
|
|
#include <Kernel/ARPPacket.h>
|
|
|
|
class NetworkAdapter {
|
|
public:
|
|
virtual ~NetworkAdapter();
|
|
|
|
virtual const char* class_name() const = 0;
|
|
MACAddress mac_address() { return m_mac_address; }
|
|
|
|
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;
|
|
};
|