-.PP
-To facilitate communications with systems which do not use ARP,
-.IR ioctl \^s
-are provided to enter and delete entries in the Internet-to-Ethernet tables.
-Usage:
-.LP
-.nf
-.ft B
- #include <sys/ioctl.h>
- #include <sys/socket.h>
- #include <net/if.h>
- struct arpreq arpreq;
-
- ioctl(s, SIOCSARP, (caddr_t)&arpreq);
- ioctl(s, SIOCGARP, (caddr_t)&arpreq);
- ioctl(s, SIOCDARP, (caddr_t)&arpreq);
-.fi
-.ft R
-Each ioctl takes the same structure as an argument.
-SIOCSARP sets an ARP entry, SIOCGARP gets an ARP entry, and SIOCDARP
-deletes an ARP entry. These ioctls may be applied to any socket descriptor
-.I s,
-but only by the super-user.
-The
-.I arpreq
-structure contains:
-.LP
-.RS
-.ta \w'#define\ \ 'u +\w'ATF_USETRAILERS\ \ 'u +\w'0x08\ \ \ \ 'u
-.nf
-/*
- * ARP ioctl request
- */
-struct arpreq {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
-};
-/* arp_flags field values */
-#define ATF_COM 0x02 /* completed entry (arp_ha valid) */
-#define ATF_PERM 0x04 /* permanent entry */
-#define ATF_PUBL 0x08 /* publish (respond for other host) */
-#define ATF_USETRAILERS 0x10 /* send trailer packets to host */
-.fi
-.RE
-.LP
-The address family for the
-.I arp_pa
-sockaddr must be AF_INET; for the
-.I arp_ha
-sockaddr it must be AF_UNSPEC.
-The only flag bits which may be written are ATF_PERM, ATF_PUBL
-and ATF_USETRAILERS.
-ATF_PERM causes the entry to be permanent if the ioctl call succeeds.
-The peculiar nature of the ARP tables may cause the ioctl to fail if more
-than 8 (permanent) Internet host addresses hash to the same slot.
-ATF_PUBL specifies that the ARP code should respond to ARP requests for the
-indicated host coming from other machines. This allows a host to act as an
-``ARP server,'' which may be useful in convincing an ARP-only machine to talk
-to a non-ARP machine.
-.PP
-ARP is also used to negotiate the use of trailer IP encapsulations;
-trailers are an alternate encapsulation used to allow efficient packet
-alignment for large packets despite variable-sized headers.
-Hosts which wish to receive trailer encapsulations so indicate
-by sending gratuitous ARP translation replies along with replies
-to IP requests; they are also sent in reply to IP translation replies.
-The negotiation is thus fully symmetrical, in that either or both hosts
-may request trailers.
-The ATF_USETRAILERS flag is used to record the receipt of such a reply,
-and enables the transmission of trailer packets to that host.
-.PP
+If the target host does not respond after several requests,
+the host is considered to be down for a short period (normally 20 seconds),
+allowing an error to be returned to transmission attempts during this
+interval.
+The error is
+.Li EHOSTDOWN
+for a non-responding destination host, and
+.Li EHOSTUNREACH
+for a non-responding router.
+.Pp
+The ARP cache is stored in the system routing table as
+dynamically-created host routes.
+The route to a directly-attached Ethernet network is installed as a
+.Dq cloning
+route (one with the
+.Li RTF_CLONING
+flag set),
+causing routes to individual hosts on that network to be created on
+demand.
+These routes time out periodically (normally 20 minutes after validated;
+entries are not validated when not in use).
+An entry for a host which is not responding is a
+.Dq reject
+route (one with the
+.Li RTF_REJECT
+flag set).
+.Pp
+ARP entries may be added, deleted or changed with the
+.Xr arp 8
+utility.
+Manually-added entries may be temporary or permanent,
+and may be
+.Dq published ,
+in which case the system will respond to ARP requests for that host
+as if it were the target of the request.
+.Pp
+In the past,
+ARP was used to negotiate the use of a trailer encapsulation.
+This is no longer supported.
+.Pp