![]() |
Max OS 0.3
|
Handles ARP requests and replies. More...
#include <arp.h>
Public Member Functions | |
| 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. | |
| 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. | |
Public Member Functions inherited from MaxOS::net::EthernetFramePayloadHandler | |
| EthernetFramePayloadHandler (EthernetFrameHandler *frame_handler, uint16_t handled_type) | |
| Construct a new Ether Frame Payload Handler object. | |
| ~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 | |
Public Member Functions inherited from MaxOS::net::IPV4AddressResolver | |
| IPV4AddressResolver (InternetProtocolHandler *internet_protocol_handler) | |
| Construct a new IPV4 Address Resolver object and register it with the Internet Protocol Handler. | |
Additional Inherited Members | |
Protected Attributes inherited from MaxOS::net::EthernetFramePayloadHandler | |
| EthernetFrameHandler * | frame_handler |
| The Ethernet frame handler this payload handler is connected to. | |
| uint16_t | handled_type |
| The Ethernet frame type this handler handles. | |
| net::AddressResolutionProtocol::AddressResolutionProtocol | ( | EthernetFrameHandler * | ethernet_frame_handler, |
| InternetProtocolHandler * | internet_protocol_handler, | ||
| common::OutputStream * | error_messages | ||
| ) |
Constructs an AddressResolutionProtocol handler.
| ethernet_frame_handler | The Ethernet frame handler to use. |
| internet_protocol_handler | The Internet protocol handler to use. |
| error_messages | The output stream to use for error messages. |
Definition at line 25 of file arp.cpp.
|
finalvirtual |
Called when an ARP packet is received.
| ethernetframePayload | The payload of the ARP packet. |
| size | The size of the ARP packet. |
Reimplemented from MaxOS::net::EthernetFramePayloadHandler.
Definition at line 41 of file arp.cpp.
References MaxOS::net::InternetProtocolHandler::get_internet_protocol_address(), MaxOS::net::InternetProtocolHandler::get_media_access_control_address(), and MaxOS::common::Map< Key, Value >::insert().
| void AddressResolutionProtocol::request_mac_address | ( | InternetProtocolAddress | address | ) |
Request the MAC address of a given IP address.
| address | The IP address in BigEndian. |
Definition at line 95 of file arp.cpp.
References MaxOS::net::ARPMessage::dst_mac, MaxOS::net::EthernetFramePayloadHandler::frame_handler, MaxOS::net::InternetProtocolHandler::get_internet_protocol_address(), MaxOS::net::EthernetFrameHandler::get_mac(), and MaxOS::net::EthernetFramePayloadHandler::send().
Referenced by resolve().
|
finalvirtual |
Get the MAC address from an IP via ARP.
| address | The IP address to get the MAC address from. |
Reimplemented from MaxOS::net::IPV4AddressResolver.
Definition at line 128 of file arp.cpp.
References MaxOS::common::Map< Key, Value >::end(), MaxOS::common::Map< Key, Value >::find(), and request_mac_address().
|
finalvirtual |
store a mapping of an IP address to a MAC address.
| internet_protocol_address | The IP address. |
| media_access_control_address | The MAC address. |
Reimplemented from MaxOS::net::IPV4AddressResolver.
Definition at line 155 of file arp.cpp.
References MaxOS::common::Map< Key, Value >::insert().