The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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. HOST is the name of the remote host to which a TFTP connection is required.

OPTIONS are 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 mode with the first argument set accordingly

get ( REMOTE_FILE [, LOCAL_FILE ] )

Get REMOTE_FILE from the server and store locally. LOCAL_FILE may 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 if LOCAL_FILE is not given.

put ( LOCAL_FILE [, REMOTE_FILE ] )

Put a file on the remote server. LOCAL_FILE may be a name or a filehandle. If LOCAL_FILE is a filehandle then REMOTE_FILE must be specified. If REMOTE_FILE is not specified then the file will be stored in the current directory with the same leafname as LOCAL_FILE.

Returns REMOTE_FILE, or the generated remote filename if REMOTE_FILE is 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.