12using namespace MaxOS::common;
13using namespace MaxOS::net;
14using namespace MaxOS::drivers;
15using namespace MaxOS::drivers::ethernet;
16using namespace MaxOS::memory;
79 driver->connect_event_handler(
this);
83EthernetFrameHandler::~EthernetFrameHandler() =
default;
118 if(
frame->destination_mac == 0xFFFFFFFFFFFF
191 frame->destination_mac = destination_mac;
A stream that strings can be written to.
virtual void write_hex(uint64_t hex_to_write)
Writes a hex to the output stream.
void write(string string_to_write) override
Writes a string to the output stream.
Stores the left, top, width and height of a rectangle.
Handles the events that are triggered by the Ethernet Driver.
Driver for the Ethernet Controller, manages the sending and receiving of data, the mac address,...
virtual MediaAccessControlAddress get_media_access_control_address()
Get the MAC address.
void send(uint8_t *buffer, uint32_t size)
send data to the network via the driver backend
static void * kmalloc(size_t size)
Allocates a block of memory in the KERNEL space.
static void kfree(void *pointer)
Frees a block of memory using the kernel memory manager.
Handles incoming Ethernet Frames and routes them to the appropriate payload handlers.
void send_ethernet_frame(uint64_t destination_mac, uint16_t frame_type, uint8_t *data, uint32_t size)
send an packet via the backend driver
void connect_handler(EthernetFramePayloadHandler *handler)
connect a handler to the frame handler
EthernetFrameHandler(drivers::ethernet::EthernetDriver *driver, common::OutputStream *error_messages)
Construct a new Ether Frame Handler object.
drivers::ethernet::MediaAccessControlAddress get_mac()
Get the MAC address of this device.
common::Map< uint16_t, EthernetFramePayloadHandler * > frame_handlers
The map of frame handlers by type.
bool data_received(uint8_t *data, uint32_t size) override
Handle the received packet.
drivers::ethernet::EthernetDriver * ethernet_driver
The driver this frame handler is using.
common::OutputStream * error_messages
The output stream for error messages.
Handles a specific type of Ethernet Frame payload.
~EthernetFramePayloadHandler()
Destroy the EtherFrameHandler:: EtherFrameHandler object, Removes it from the handler list.
void send(uint64_t destination, uint8_t *data, uint32_t size)
send an packet via the backend driver
EthernetFramePayloadHandler(EthernetFrameHandler *frame_handler, uint16_t handled_type)
Construct a new Ether Frame Payload Handler object.
uint16_t handled_type
The Ethernet frame type this handler handles.
virtual bool handle_ethernetframe_payload(uint8_t *ethernetframe_payload, uint32_t size)
Handle the received ethernet frame payload.
EthernetFrameHandler * frame_handler
The Ethernet frame handler this payload handler is connected to.
Defines classes for handling Ethernet Frames and their payloads.