11#ifndef MAXOS_NET_ETHERNETFRAME_H
12#define MAXOS_NET_ETHERNETFRAME_H
36 } ethernet_frame_header_t;
49 } ethernet_frame_footer_t;
51 class EthernetFrameHandler;
69 void send(uint64_t destination, uint8_t* data, uint32_t size);
91 void send_ethernet_frame(uint64_t destination_mac, uint16_t frame_type, uint8_t* data, uint32_t size);
A stream that strings can be written to.
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,...
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
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
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 an EthernetDriver class for managing Ethernet communication, including sending and receiving ...
uint64_t MediaAccessControlAddress
Used to make MAC addresses more readable.
Defines a Map class for storing key-value pairs.
Defines a MemoryManager class for handling memory allocation and deallocation.