#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
The arp_cache_ip function returns __TRUE when both of the
following conditions are satisfied:
The requested IP address is resolved.
The ARP table contains an entry for the IP address and its MAC
address.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.