=head1 NAME

xtftp - FTP protocol server driver

=head1 SYNOPSIS

B<xtftp>
I<-h hostname>
[ I<-p port> ]
[ I<-d> ]
[ I<-u username> ]
[ I<-w password> ]
[ I<-o outfile> ]
[ I<-i infile> ]
[ I<-D directory> ]
[ I<-T timeout> ]
[ I<-A host> ]
[ I<-T> ]
[ I<-B> ]

=head1 DESCRIPTION

B<xtftp> is a terminal server program for use by B<GNUspool> where
the destination is a server which accepts FTP protocol. Data is taken
from standard input, unless overridden by the B<-i> option.

=head1 OPTIONS

=over 8

=item -h I<hostname>

This is the host name or IP address to be used to access the
printer. In B<GNUspool> setup files, it may be appropriate to
substitute C<$SPOOLDEV> or C<$SPOOLPTR> here.

=item -A I<hostname>

Specifies the sending hostname or IP address to be as given. This may
be required when sending from hosts with multiple IP addresses.

=item -p I<port number>

This is the port number to be used, if not I<ftp>.

=item -u I<user>

This is the user name to be quoted to the FTP server.

=item -w I<word>

This is the password to be quoted to the FTP server.

=item -o I<outfile>

This is the output file to be stored at the server end. In some cases
this may designate the actual printer, and it may be useful to use
C<$SPOOLDEV> as the argument to be expanded in B<GNUspool> setup files.

=item -D I<directory>

This is the output file to be stored in at the server end, if not the
"home directory". In some cases this may designate tha actual printer,
and it may be useful to use C<$SPOOLDEV> as the argument to be
expanded in B<GNUspool> setup files.

=item -T I<timeout>

This gives the timeout in milliseconds to await for responses from the
server.

=item -i I<input>

Specify input file if not standard input.

=item -t

Specify text mode.

=item -b

Specify binary mode.

=item -d

Debug. Displays activities on standard error. Increasing information
is given if more than one B<-d> option is specified.

=back

=head1 DIAGNOSTICS

B<xtftp> generates any appropriate diagnostics on standard error.

=head1 EXIT CODES

Normal termination is denoted by an exit code of zero.

=over 4

=item 1

Usage error, invalid option etc.

=item 2

No host name or ip address given.

=item 3

Cannot open input file.

=item 4

Expecting password as well as user name.

=item 5

Incorrect password.

=item 6

Transmit failure - file rejected.

=item 18

Data accept failed.

=item 41

Cannot create/bind control socket.

=item 42

Cannot connect control socket.

=item 44

Cannot create data socket.

=item 45

Cannot bind data socket.

=item 46

Cannot listen data socket.

=item 47

Cannot get socket name data socket.

=item 50

Unknown service name

=item 51

Invalid IP address

=item 52

Invalid host name

=item 60

Socket write error.

=item 61

Socket read error.

=item 62

No response code from server.

=item 71

Port or store command failed.

=item 100

Generated command too long (excessive length file name etc).

=item 200

Aborted with a signal.

=back

=head1 SEE ALSO

xilp(8),
xtelnet(8),
xtlpc(8),
xtlhp(8).

=head1 COPYRIGHT

Copyright (c) 2009 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
<http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

=head1 AUTHOR

John M Collins, Xi Software Ltd.

=cut

## Local Variables:
## mode: nroff
## End:
