.\" @(#)man/man8/mkhpath.an	1.3 8/2/92 03:32:38
.de pP
.if n .sp 1
.if t .sp .4
..
.de tP
.pP
.ta \\n(pDu
.ti -\\n(pDu
..
.TH MKHPATH X_MAN8_EXT_X "31 January 1988" "Local"
.SH NAME
mkhpath \- produce path data from an /etc/hosts file
.SH SYNOPSIS
.na
.B X_UTIL_BIN_DIR_X/mkhpath
[
.B \-n
.I netname
] [
.B \-c
.I cost
] [
.B \-g
.I gateway
] [
.B \-d
] [
.B \-
|
.I filename
]
.br
.ad
.SH DESCRIPTION
.I Mkhpath
takes as input a
.I hosts
file, in the format of the 4.3BSD file
.IR /etc/hosts ,
and creates path data suitable for use by a
.IR smail (8)
.B pathalias
router (see
.IR smail (5)
for information on routers).
The output is also suitable for merging in with the output of
.IR pathalias (8),
and can be made suitable as input to
.IR pathalias .
.PP
The hostnames
.I localhost
and
.I loghost
are ignored, as are any domain names (names containing dot characters).
.PP
This command is useful for sending information about a network's
connectivity to hosts that are not on that network.  As a general
rule, the smail
.B gethostbyname
router driver precludes the need for this tool.
.SH OPTIONS
The following options are recognized by
.IR mkhpath :
.TP
\fB\-n\fP \fInetname\fP
Generate output which is suitable as input to
.IR pathalias (8)
as a description of an interconnected network named
.I netname
connecting together all hosts named in the
.I hosts
file.
.TP
\fB\-c\fP \fIcost\fP
Set the cost for the network gateway to
.IR cost .
This may be any valid
.I pathalias
cost expression and is only useful with the
.B \-n
option.
.TP
\fB\-g\fP \fIgateway\fP
Set the gateway for all of the hosts in the
.I hosts
file to
.I gateway.
This can be used either with or without the
.B \-n
option.  If neither
.B \-g
nor
.B \-n
are used, then the local host is assumed to connect to all of the
hosts directly.
.TP
.B \-d
Only use lines that contain a domain name (i.e., a name containing
one or more dots) as one of the names for a host.
Such domain names are not used themselves, but lines that do not
contain any domain names are ignored.
.PP
If a
.I filename
argument is used, then the host information is read from this file.
If an argument of
.B \-
is specified instead, then the standard input is used.  Otherwise the
file
.I /etc/hosts
is used to obtain host information.
.SH "SEE ALSO"
.IR pathalias (X_MAN8_EXT_X),
.IR smail (X_MAN5_EXT_X),
.IR smail (X_MAN8_EXT_X),
.IR mkpath (X_MAN8_EXT_X),
and
.IR pathmerge (X_MAN8_EXT_X).
.SH COPYRIGHT
Copyright(C)1987, 1988 Ronald S. Karr and Landon Curt Noll
.br
Copyright(C)1992 Ronald S. Karr
.br
See a file COPYING,
distributed with the source code,
or type
.I "smail \-bc"
for distribution rights and restrictions
associated with this software.
