This was built on FreeBSD. It has also been tested on Debian.
IPv4 and IPv6 are supported.
% make
To build on linux will require the BSD make tool. This can normally be found in the bmake package for your distribution.
$ bmake
Two options can be passed to the makefile:
- -DDEBUG : Produce more verbose output during execution of both the server and client.
- SERVER_PORT=port# : Override the default tftp port (69).
Two binaries are produced in the same diretory as the makefile:
- tftpd The tftp server
- tftp The tftp client
There is a clean target in the makefile for removing the binaries and object files.
These are the command line options available for the server:
- -p port# : An alternative port number to the one built with.
- -T : Redirect output to stdout
- -D : Daemonize the server
- -C : Path the daemonized server will chroot into
If -D is specified, -C must also be specified.
The command line for the client follows a specified format:
tftp server_ip [port#] command file
- server_ip is the address of the tftp server
- port# is an optional port number
- command is either GET or PUT (case insensitive)
- file is the name of the file to send or receive
Only mode octet is supported by the server and client. An error will be returned by the server if anything else is requested.
Logging defaults to syslog unless -T is specified.
Link-local addresses are ignored by the server when creating sockets.
tftpd only has access to the directory it is executed from. Paths are stripped from the file name by the server.
As this is an RFC1350 implementation the maximum file size is 33553919 bytes. ((2^16 - 1) * 512) - 1.