33 bool ARPService::onPacketReceived()
39 ACTRACE(
"processHeader");
69 void ARPService::tick()
79 if (entry->status_TTL > 0)
99 if (ip.
u == entry->ip.u && entry->status_TTL > 0)
106 makeWhoHasARPRequest(ip);
115 void ARPService::makeWhoHasARPRequest(
IPAddress& ip)
135 void ARPService::makeARPReply()
146 void ARPService::processARPReply()
154 selectedEntry = entry;
158 if (entry->status_TTL <= lowest)
161 selectedEntry = entry;
165 ACBREAK(selectedEntry!=NULL,
"selectedEntry is NULL");
static const int16_t MAX_ARP_TTL
Time the ARP entry is considered fresh, in minutes.
Stores a MAC address in memory.
uint8_t HLEN
Hardware address length.
MACAddress * whoHas(IPAddress &ip)
Attempts to return the MAC address associated with the provided IP address.
uint32_t u
access the IP as a uint32_t for convenience
static EthBuffer packet
in-memory packet buffer currently being processed.
uint8_t PLEN
Protocol address length.
static const uint8_t ARP_OPCODE_REPLY_L
ARP Opcode for reply.
static const uint8_t ARP_OPCODE_REQ_L
ARP Opcode for request.
IPAddress targetIP
Target protocol address.
MACAddress mac
MAC address.
represents an IP address in memory
static void packetSend(uint16_t len)
uint8_t b[6]
byte-wise access to the MAC address
static const uint8_t ARP_TABLE_LENGTH
Maximum number of entries in the ARP table.
MACAddress senderMAC
Sender hardware address.
static const uint16_t ETHTYPE_ARP
Ethernet header protocol type for ARP.
static MACAddress localMAC
Ethernet MAC address.
MACAddress targetMAC
Target hardware address.
uint8_t l
least significant byte
static IPAddress localIP
IP address of this application.
static uint16_t minuteTimer
nint16_t HTYPE
Hardware type.
static const uint16_t NETWORK_TIMER_RESOLUTION
Resolution of the NetworkService timer.
IPAddress senderIP
Sender protocol address.
nint16_t PTYPE
Protocol type.
int8_t status_TTL
TTL in minutes to consider the entry valid.