-.sp 1
-.fi
-with
-.I rt_flags
-defined from,
-.sp 1
-.nf
-._d
-#define RTF_UP 0x1 /* route usable */
-#define RTF_GATEWAY 0x2 /* destination is a gateway */
-#define RTF_HOST 0x4 /* host entry (net otherwise) */
-#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
-.fi
-.PP
-Routing table entries come in three flavors: for a specific
-host, for all hosts on a specific network, for any destination
-not matched by entries of the first two types (a wildcard route).
-When the system is booted and addresses are assigned
-to the network interfaces, each protocol family
-installs a routing table entry for each interface when it is ready for traffic.
-Normally the protocol specifies the route
-through each interface as a ``direct'' connection to the destination host
-or network. If the route is direct, the transport layer of
-a protocol family usually requests the packet be sent to the
-same host specified in the packet. Otherwise, the interface
-is requested to address the packet to the gateway listed in the routing entry
-(i.e. the packet is forwarded).
-.PP
-Routing table entries installed by a user process may not specify
-the hash, reference count, use, or interface fields; these are filled
-in by the routing routines. If
-a route is in use when it is deleted
-.RI ( rt_refcnt
-is non-zero),
-the routing entry will be marked down and removed from the routing table,
-but the resources associated with it will not
-be reclaimed until all references to it are released.
-The routing code returns EEXIST if
-requested to duplicate an existing entry, ESRCH if
-requested to delete a non-existent entry,
-or ENOBUFS if insufficient resources were available
-to install a new route.
-User processes read the routing tables through the
-.I /dev/kmem
-device.
-The
-.I rt_use
-field contains the number of packets sent along the route.
-.PP
-When routing a packet,
-the kernel will first attempt to find a route to the destination host.
-Failing that, a search is made for a route to the network of the destination.
-Finally, any route to a default (``wildcard'') gateway is chosen.
-If multiple routes are present in the table,
-the first route found will be used.
-If no entry is found, the destination is declared to be unreachable.
-.PP
-A wildcard routing entry is specified with a zero
-destination address value. Wildcard routes are used
-only when the system fails to find a route to the
-destination host and network. The combination of wildcard
-routes and routing redirects can provide an economical
-mechanism for routing traffic.
-.SH INTERFACES
+.Ed
+.Pp
+The field
+.Ar sa_len
+contains the total length of the of the structure,
+which may exceed 16 bytes.
+The following address values for
+.Ar sa_family
+are known to the system
+(and additional formats are defined for possible future implementation):
+.Bd -literal
+#define AF_UNIX 1 /* local to host (pipes, portals) */
+#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
+#define AF_NS 6 /* Xerox NS protocols */
+#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_ISO 18 /* ISO protocols */
+.Ed
+.Sh ROUTING
+.Tn UNIX
+provides some packet routing facilities.
+The kernel maintains a routing information database, which
+is used in selecting the appropriate network interface when
+transmitting packets.
+.Pp
+A user process (or possibly multiple co-operating processes)
+maintains this database by sending messages over a special kind
+of socket.
+This supplants fixed size
+.Xr ioctl 2
+used in earlier releases.
+.Pp
+This facility is described in
+.Xr route 4 .
+.Sh INTERFACES