12using namespace MaxOS::common;
13using namespace MaxOS::net;
14using namespace MaxOS::drivers;
15using namespace MaxOS::drivers::ethernet;
28 this->internet_protocol_handler = internet_protocol_handler;
29 this->error_messages = error_messages;
32net::AddressResolutionProtocol::~AddressResolutionProtocol() =
default;
Defines the Address Resolution Protocol (ARP) for resolving IP addresses to MAC addresses.
iterator find(Key)
Finds an element in the map based on the key.
iterator end()
Returns the end of the map.
void insert(Key, Value)
Updates the value of an element, or adds a new element if it does not exist.
A stream that strings can be written to.
Stores the left, top, width and height of a rectangle.
void request_mac_address(InternetProtocolAddress address)
Request the MAC address of a given IP address.
drivers::ethernet::MediaAccessControlAddress resolve(InternetProtocolAddress address) final
Get the MAC address from an IP via ARP.
void store(InternetProtocolAddress internet_protocol_address, drivers::ethernet::MediaAccessControlAddress media_access_control_address) final
store a mapping of an IP address to a MAC address.
AddressResolutionProtocol(EthernetFrameHandler *ethernet_frame_handler, InternetProtocolHandler *internet_protocol_handler, common::OutputStream *error_messages)
Constructs an AddressResolutionProtocol handler.
bool handle_ethernetframe_payload(uint8_t *etherframe_payload, uint32_t size) final
Called when an ARP packet is received.
Handles incoming Ethernet Frames and routes them to the appropriate payload handlers.
drivers::ethernet::MediaAccessControlAddress get_mac()
Get the MAC address of this device.
Handles a specific type of Ethernet Frame payload.
void send(uint64_t destination, uint8_t *data, uint32_t size)
send an packet via the backend driver
EthernetFrameHandler * frame_handler
The Ethernet frame handler this payload handler is connected to.
Resolves IP addresses to MAC addresses.
Handles IPv4 packets over Ethernet frames.
InternetProtocolAddress get_internet_protocol_address() const
Gets the IP address of this device.
drivers::ethernet::MediaAccessControlAddress get_media_access_control_address()
Gets the MAC address of this device.
uint64_t MediaAccessControlAddress
Used to make MAC addresses more readable.
uint32_t InternetProtocolAddress
An IPv4 address.
uint64_t dst_mac
The MAC address of the target.