Functions | |
arp_list_type * | arp_check_ip_address (uint32_t ip, uint16_t dev_nr) |
Perform MAC address lookup in local ARP cache to find MAC address for specified IP address. More... | |
arp_list_type * | check_arp_address (SOCKET *so, uint32_t request_time) |
Perform address resolution. More... | |
void | arp_clear_cache (void) |
Invalidate ARP cache. More... | |
void | arp_set_timeout (uint32_t val) |
Set timebase for ARP cache. More... | |
void | arp_invalid_ip_address (uint32_t ip) |
Invalidates specific IP address. More... | |
arp_list_type * arp_check_ip_address | ( | uint32_t | ip, |
uint16_t | dev_nr | ||
) |
Before a message can be sent over Ethernet the destination MAC address must be known. Use this function to search the local ARP cache for a valid MAC address. The returned pointer to the valid MAC address (arp->addr) can be used as parameter for send_ip(). All higher level send functions (net_send(), net_send_ready() and net_send_string() ) use this function and arp_check_address() for address resolution.
ip | - IP address ( in network byte order) |
dev_nr | - Adapter |
arp_list_type * check_arp_address | ( | SOCKET * | so, |
uint32_t | request_time | ||
) |
This function performs a ARP cache lookup for the destination IP address the socket so is configured to. If the address is not found or invalid a new ARP request is started. In case of a new ARP request the function configures the stack for the time between two consecutive requests and returns after sending the first request. Please note that in this case the returned pointer is NULL because a wait for the ARP answer could take a undetermined period of time.
so | - socket with unresolved or resolved IP address |
request_time | - time between two requests |
void arp_clear_cache | ( | void | ) |
When the device is plugged from one hub or router to another it may be necessary to clear the ARP cache. Use this function to initiate a full ARP cache clear.
- |
void arp_set_timeout | ( | uint32_t | val | ) |