NAME
TFTP - TFTP Client class
SYNOPSIS
use TFTP;
$tftp = new TFTP("some.host.name");
$tftp->get("that.file");
$tftp->octet;
$tftp->put("this.file");
$tftp->quit;
DESCRIPTION
TFTP is a class implementing a simple TFTP client in Perl as described in RFC783.
OVERVIEW
TFTP stands for Trivial File Transfer Protocol.
CONSTRUCTOR
- new (HOST [,OPTIONS])
-
This is the constructor for a new TFTP object.
HOSTis the name of the remote host to which a TFTP connection is required.OPTIONSare passed in a hash like fashion, using key and value pairs. Possible options are:Port - The port number to connect to on the remote machine for the TFTP connection
Mode - Set the transfer mode [NETASCII, OCTET] (defaults to NETASCII)
Timeout - Set the timeout value before retry (defaults to 2 sec)
MaxTimeout - Set the maximum timeout value before retry (defaults to 8 sec)
Retries - Set the number of retries (defaults to 3 with arithmetic backoff)
METHODS
- mode (TYPE)
-
This method will set the mode to be used with the remote TFTP server to specify the type of data transfer. The return value is the previous value.
- netascii, ascii, octet, binary
-
Synonyms for
modewith the first argument set accordingly - get ( REMOTE_FILE [, LOCAL_FILE ] )
-
Get
REMOTE_FILEfrom the server and store locally.LOCAL_FILEmay be a filename or a filehandle. If not specified the the file will be stored in the current directory with the same leafname as the remote file.Returns
LOCAL_FILE, or the generated local file name ifLOCAL_FILEis not given. - put ( LOCAL_FILE [, REMOTE_FILE ] )
-
Put a file on the remote server.
LOCAL_FILEmay be a name or a filehandle. IfLOCAL_FILEis a filehandle thenREMOTE_FILEmust be specified. IfREMOTE_FILEis not specified then the file will be stored in the current directory with the same leafname asLOCAL_FILE.Returns
REMOTE_FILE, or the generated remote filename ifREMOTE_FILEis not given. - quit
-
Close the current socket and release any resources. A more complete way to release resources is to call 'undef $tftp;' on the session object.
REPORTING BUGS
When reporting bugs/problems please include as much information as possible. It may be difficult for me to reproduce the problem as almost every setup is different.
A small script which yields the problem will probably be of help. It would also be useful if this script was run with the extra options debug = 1> passed to the constructor, and the output sent with the bug report. If you cannot include a small script then please include a Debug trace from a run of your program which does yield the problem.
AUTHOR
G. S. Marzot <gmarzot@baynetworks.com>
SEE ALSO
tftp(1), tftpd(8), RFC 783 http://info.internet.isi.edu:80/in-notes/rfc/files/rfc783.txt
Copyright (c) 1998 G. S. Marzot. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.