#include "net/arp.h"
Defines | |
#define | ARP_TABLE_SIZE 8 |
#define | ARP_CACHE_TIME_TO_LIVE 100 |
Functions | |
void | arpInit (void) |
void | arpSetAddress (struct netEthAddr *myeth, uint32_t myip) |
void | arpArpIn (unsigned int len, struct netEthArpHeader *packet) |
void | arpIpIn (struct netEthIpHeader *packet) |
void | arpIpOut (struct netEthIpHeader *packet, uint32_t phyDstIp) |
void | arpTimer (void) |
int | arpMatchIp (uint32_t ipaddr) |
void | arpPrintHeader (struct netArpHeader *packet) |
Print diagnotic information about ARP packet. | |
void | arpPrintTable (void) |
Print diagnotic information about ARP cache. |
|
Processes incoming ARP packets. This function is to be called when an ARP type packet has arrived over the network. If the packet type is an ARP request for us, an ARP reply will be generated and sent. |
|
Initialize ARP system. Clears ARP table and prepares it for use. This is typically done once at program initialization. |
|
Process incoming IP packets to harvest IP<->MAC relationships. This function should be called when IP packets are received over the network. It does nothing more than harvest the IP<->MAC address relationships from the ethernet and IP header of the packet. The packet is not changed nor processed. Nothing is sent on the network. Use of this command is not required, but it is a good way to automatically fill the ARP table with information about nodes that are active on the network.
|
|
Process outgoing IP packet to fill in ethernet header information. To be sent on a network, an IP packet must have the correct ethernet header information appended to the front. This function will fill in this information. A physical destination IP address argument is needed to support sending to a gateway (i.e. when a packet is destined for a node that is not on this network, IP addressing is as usual, but we phyiscally send the packet to the gateway's ethernet address/interface).
|
|
Check if this IP address is present in the ARP cache. Internal function. If IP address is found, function returns index of entry. If not found, returns -1. |
|
Set IP and Ethernet hardware/MAC address. This must be done before valid replies can be generated for ARP requests. Typically done once at program initialization. |
|
Periodic ARP cache maintenance. This function is to be called once per second and will slowly expire old ARP cache entries. |