+.\" $NetBSD: tftp.1,v 1.18 2003/08/07 11:16:14 agc Exp $
+.\"
.\" Copyright (c) 1990, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
.\"
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
+.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\"
.\" @(#)tftp.1 8.2 (Berkeley) 4/18/94
.\"
-.Dd April 18, 1994
+.Dd June 11, 2003
.Dt TFTP 1
-.Os BSD 4.3
+.Os
.Sh NAME
.Nm tftp
.Nd trivial file transfer program
.Sh SYNOPSIS
-.Nm tftp
+.Nm
+.Op Fl e
.Op Ar host
+.Op Ar port
.Sh DESCRIPTION
-.Nm Tftp
+.Nm
is the user interface to the Internet
.Tn TFTP
(Trivial File Transfer Protocol),
which allows users to transfer files to and from a remote machine.
The remote
.Ar host
+(and optional
+.Ar port )
may be specified on the command line, in which case
-.Nm tftp
+.Nm
uses
.Ar host
-as the default host for future transfers (see the
+(and
+.Ar port )
+as the default for future transfers (see the
.Cm connect
command below).
+.Pp
+The optional
+.Fl e
+argument sets a binary transfer mode as well as setting the extended options
+as if
+.Cm tout ,
+.Cm tsize ,
+and
+.Cm blksize 65464 ,
+had been given.
.Sh COMMANDS
Once
-.Nm tftp
+.Nm
is running, it issues the prompt
-.LI tftp>
+.Ql tftp\*[Gt]
and recognizes the following commands:
.Pp
.Bl -tag -width verbose -compact
.It Cm binary
Shorthand for "mode binary"
.Pp
+.It Cm blksize Ar blk-size
+Set the tftp blksize option to
+.Ar blk-size
+octets (8-bit bytes). Since the number of blocks in a tftp
+.Cm get
+or
+.Cm put
+is 65535, the default block size of 512 bytes only allows a maximum of
+just under 32 megabytes to be transferred. The value given for
+.Ar blk-size
+must be between 8 and 65464, inclusive.
+Note that many servers will not respect this option.
+.Pp
.It Cm connect Ar host-name Op Ar port
Set the
.Ar host
.Cm connect
command does not actually create a connection,
but merely remembers what host is to be used for transfers.
-You do not have to use the
+You do not have to use the
.Cm connect
command; the remote host can be specified as part of the
.Cm get
the last hostname specified becomes the default for future transfers.
.Pp
.It Cm mode Ar transfer-mode
-Set the mode for transfers;
+Set the mode for transfers;
.Ar transfer-mode
may be one of
.Em ascii
the hostname specified becomes the default for future transfers.
If the remote-directory form is used, the remote host is
assumed to be a
-.Tn UNIX
+.Ux
machine.
+If you need to specify IPv6 numeric address to
+.Ar hosts ,
+wrap them using square bracket like
+.Ar [hosts]:filename
+to disambiguate the colon.
.Pp
.It Cm quit
Exit
-.Nm tftp .
+.Nm .
An end of file also exits.
.Pp
.It Cm rexmt Ar retransmission-timeout
.It Cm timeout Ar total-transmission-timeout
Set the total transmission timeout, in seconds.
.Pp
+.It Cm tout
+Toggle the tftp "timeout" option. If enabled, the client will pass its
+.Ar retransmission-timeout
+to the server.
+Note that many servers will not respect this option.
+.Pp
.It Cm trace
Toggle packet tracing.
.Pp
+.It Cm tsize
+Toggle the tftp "tsize" option. If enabled, the client will pass and
+request the filesize of a file at the beginning of a file transfer.
+Note that many servers will not respect this option.
+.Pp
.It Cm verbose
Toggle verbose mode.
.El
-.Sh BUGS
-.Pp
-Because there is no user-login or validation within
-the
-.Tn TFTP
-protocol, the remote site will probably have some
-sort of file-access restrictions in place. The
-exact methods are specific to each site and therefore
-difficult to document here.
.Sh HISTORY
The
.Nm
command appeared in
.Bx 4.3 .
+IPv6 support was implemented by WIDE/KAME project in 1999.
+TFTP options were implemented by Wasabi Systems, Inc., in 2003,
+and first appeared in
+.Nx 2.0 .
+.Sh SECURITY CONSIDERATIONS
+Because there is no user-login or validation within
+the
+.Tn TFTP
+protocol, the remote site will probably have some
+sort of file-access restrictions in place.
+The exact methods are specific to each site and therefore
+difficult to document here.