#include <rtl.h>
BOOL arp_cache_ip (
U8* ipadr, /* Pointer to buffer containing the 4 octets of the IP address. */
U8 type ); /* Specifies whether the IP address is fixed or temporary. */
Description
The arp_cache_ip function determines whether the ARP table
has a MAC (ethernet) address entry for the requested IP address. If
an entry does not exist, the function forces the TCPnet system to
resolve and cache the MAC address into the internal ARP table buffer.
To resolve the MAC address, the TCPnet system sends an arp
request to the network.
The argument ipadr points to a buffer containing the four
octets of the dotted decimal IP address to be resolved.
The argument type specifies whether the IP address is fixed
or temporary. This consequently determines whether or not the TCPnet
system automatically refreshes the IP address entry in the ARP
cache.
Type
Description
ARP_TEMP_IP
The IP address is temporary, and thus TCPnet removes the IP
address entry from the ARP cache after a timeout.
ARP_FIXED_IP
The IP address is fixed, and thus TCPnet's ARP module
automatically refreshes the IP address entry after the
timeout.
The arp_cache_ip function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
Only the ethernet network interface needs to use the
arp_cache_ip function. There is no ARP protocol for the PPP
and SLIP network interfaces.
The arp_cache_ip function is primarily useful before
sending the first UDP packet. The function is not necessary before
sending TCP packets because the TCP module can retransmit the
packet if the remote machine did not receive the packet.
Return Value
__TRUE = when both subsequent conditions are satisfied:
The requested IP address could be resolved.
The ARP table contains an entry for the IP address and its
MAC address.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.