
SunOS 5.5 Protocols arp(7P)
NAME arp, ARP − Address Resolution Protocol
SYNOPSIS #include <sys/fcntl.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <netinet/in.h>
s = socket(AF_INET, SOCK_DGRAM, 0);
d = open ("/dev/arp", oflag);
DESCRIPTION ARP is a protocol used to map dynamically between InternetProtocol (IP) and 10Mb/s
Ethernet addresses. It is used by all the 10Mb/s Ethernetdatalink providers (interface
drivers) and it can be used by other datalink providers that support broadcast (such as
FDDI and Token Ring). ARP is not specific to the Internet Protocol but this implementa-
tion supports only that network layer protocol.
ARP cachesIP-to-Ethernet address mappings. When an interface requests a mapping for
an address not in the cache, ARP queues the message that requires the mapping and
broadcasts a message on the associated network requesting the address mapping. If a
response is provided, the new mappingis cached and any pending message is transmit-
ted. ARP will queue at most four packets while waiting for a mapping request to be
responded to; only the four most recently transmitted packets are kept.
APPLICATION
PROGRAMMING
INTERFACE
The STREAMS device /dev/arp is not a Transport Level Interface (TLI) transport provider
and may not be used with the TLI interface.
To facilitate communications with systems which do not useARP, ioctl() requests are
provided to enter and delete entries in theIP-to-Ethernet tables.
#include <sys/sockio.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_arp.h>
struct arpreq arpreq;
ioctl(s, SIOCSARP, (caddr_t)&arpreq);
ioctl(s, SIOCGARP, (caddr_t)&arpreq);
ioctl(s, SIOCDARP, (caddr_t)&arpreq);
Each ioctl() request takes the same structure as an argument. SIOCSARP sets anARP
entry, SIOCGARP gets an ARP entry, and SIOCDARP deletes anARP entry. These ioctl()
requests may be applied to any Internet family socket descriptor s, or to a descriptor for
the ARP device, but only by the privileged user.
modified 23 Aug 1994 7P-17
Kommentare zu diesen Handbüchern