Menu

Tree [7238b7] master v0.8.1 /
 History

HTTPS access


File Date Author Commit
 debian 2018-12-14 Martin Dummer Martin Dummer [4d0bff] import debian localisation files
 docs 2011-03-02 Michał Rzechonek Michał Rzechonek [f089b7] Initial import.
 redhat 2012-07-19 Martin Dummer Martin Dummer [8b0d7d] remove test/Makefile and redhat/atftp.spec from...
 test 2026-04-11 Martin Dummer Martin Dummer [b86dfa] test.sh: redirect stderr to /dev/null when coun...
 .gitignore 2021-10-24 Martin Dummer Martin Dummer [c68a89] autoconf: modify autogen.sh
 BUGS 2021-09-13 Martin Dummer Martin Dummer [694f87] text files: mark/convert all textfiles to UTF-8
 Changelog 2026-04-12 Martin Dummer Martin Dummer [7238b7] Version 0.8.1 (Bugfix Release)
 FAQ 2021-12-30 Martin Dummer Martin Dummer [581703] FAQ INSTALL README.CVS README.PCRE: cosmetic an...
 INSTALL 2021-12-30 Martin Dummer Martin Dummer [581703] FAQ INSTALL README.CVS README.PCRE: cosmetic an...
 LICENSE 2026-04-12 Martin Dummer Martin Dummer [77524d] update LICENSE from https://www.gnu.org/licenses/
 Makefile.am 2021-01-31 Martin Dummer Martin Dummer [b39ab6] Makefile.am: link against libpthread for atftp
 README.md 2026-04-11 Martin Dummer Martin Dummer [1aaa2e] merge README* to single README.md
 TODO 2021-09-13 Martin Dummer Martin Dummer [694f87] text files: mark/convert all textfiles to UTF-8
 argz.c 2018-01-09 Simon Rettberg Simon Rettberg [54f8a6] Fix check for argz support (HAVE_ARGZ -> HAVE_A...
 argz.h 2021-12-30 Martin Dummer Martin Dummer [ca87af] *.h: cosmetic and spelling fixes
 atftp.1 2022-09-04 Andreas B. Mundt Andreas B. Mundt [6df249] Fix multicast download.
 atftpd.8 2021-10-18 Andreas B. Mundt Andreas B. Mundt [8d301c] Add windowsize option as described in RFC7440
 autogen.sh 2021-10-24 Martin Dummer Martin Dummer [c68a89] autoconf: modify autogen.sh
 configure.ac 2026-04-12 Martin Dummer Martin Dummer [7238b7] Version 0.8.1 (Bugfix Release)
 logger.c 2025-09-02 Florian Eckert Florian Eckert [d3fc75] Fix pthread_t format warning for fprintf
 logger.h 2011-03-02 Michał Rzechonek Michał Rzechonek [f089b7] Initial import.
 options.c 2021-10-18 Andreas B. Mundt Andreas B. Mundt [bc4111] Do some cosmetic changes
 options.h 2021-10-18 Andreas B. Mundt Andreas B. Mundt [8d301c] Add windowsize option as described in RFC7440
 stats.c 2011-03-02 Michał Rzechonek Michał Rzechonek [6c5f81] Debian patchset 0.7.dfsg-6
 stats.h 2021-12-30 Martin Dummer Martin Dummer [ca87af] *.h: cosmetic and spelling fixes
 tftp.c 2022-09-04 Andreas B. Mundt Andreas B. Mundt [75e9ec] Fix/update minor issues in upstream
 tftp.h 2015-04-16 Peter Seiderer Peter Seiderer [f5c2fc] tftp.h/tftpd.h: fix musl compile (missing include)
 tftp_def.c 2022-09-04 Andreas B. Mundt Andreas B. Mundt [75e9ec] Fix/update minor issues in upstream
 tftp_def.h 2021-10-18 Andreas B. Mundt Andreas B. Mundt [8d301c] Add windowsize option as described in RFC7440
 tftp_file.c 2022-09-04 Andreas B. Mundt Andreas B. Mundt [6df249] Fix multicast download.
 tftp_io.c 2026-04-11 Martin Dummer Martin Dummer [7964d0] Fix fortify abort when LTO is enabled
 tftp_io.h 2021-12-30 Martin Dummer Martin Dummer [ca87af] *.h: cosmetic and spelling fixes
 tftp_mtftp.c 2022-09-04 Andreas B. Mundt Andreas B. Mundt [f59bee] Fix MTFTP support for atftp
 tftpd.c 2026-04-11 Martin Dummer Martin Dummer [cd892f] Fix uninitialized buffer data.
 tftpd.h 2021-12-30 Martin Dummer Martin Dummer [ca87af] *.h: cosmetic and spelling fixes
 tftpd_file.c 2022-09-04 Andreas B. Mundt Andreas B. Mundt [1ee139] Fix algorithm in case of packet loss in the las...
 tftpd_list.c 2019-04-21 Martin Dummer Martin Dummer [f78da6] fix Concurrency issue denial of service
 tftpd_mcast.c 2012-07-18 Florian Fainelli Florian Fainelli [44d49d] tftpd: warn when we fail to parse multicast rel...
 tftpd_mtftp.c 2022-09-04 Andreas B. Mundt Andreas B. Mundt [f59bee] Fix MTFTP support for atftp
 tftpd_mtftp.h 2021-12-30 Martin Dummer Martin Dummer [ca87af] *.h: cosmetic and spelling fixes
 tftpd_pcre.c 2025-09-02 Florian Eckert Florian Eckert [6a0389] Fix incompatible-pointer-types for pcre2_substr...
 tftpd_pcre.h 2021-12-29 Andreas B. Mundt Andreas B. Mundt [5739ed] Port to maintained PCRE2 API

Read Me

ATFTP Readme

Original README

By Jean-Pierre Lefebvre helix@step.polymtl.ca / August 20th, 2000

atftp stands for Advanced Trivial File Transfer Protocol

It is called "advanced", by contrast to others TFTP servers, for two reasons.

Firstly, it is intended to be fully compliant with all related RFCs. This include RFC1350, RFC2090, RFC2347, RFC2348, RFC2349 and RFC7440.

To my knowledge, there is no TFTP server currently available in the public domain that fulfils this requirement.

Secondly, atftp is intended for serving boot files to large clusters. It is multi-threaded and support multicast (RFC2090 and PXE), allowing faster boot of hundreds of machine simultaneously.

I started writing the atftp server after trying to boot Debian from the LAN using pxelinux (distributed with syslinux). Since pxelinux needs support for the "tsize" option defined in RFC2349, I looked for different TFTP servers but found none that fulfilled my needs.

With atftp, I have successfully used pxelinux and dhcpd to boot from the LAN. Unfortunately, new development will slow down since I do it on my spare time and atftp now does what I need. However, atftp is actively maintained.

Comments, bug reports and patches are welcome.

Great thanks to my brother Remi who works on the client and server implementation and the debian packaging.

Project Home

is SourceForge
with a mirror on GitHub


Multicast TFTP

Atftp supports multicast transfer. This feature allows the server to send a file to many clients at once.

There are two ways of doing multicast TFTP.
One is documented in RFC2090 and the other is known as MTFTP and documented in Intel's PXE specification.

Atftp supports both protocols.

RFC2090

Multicast using RFC2090 is very similar to any other TFTP transfer. The read request sent by the client contains an option to inform the server to
use multicast. The server will send configuration information (IP and port) through the option acknowledge mechanism. The initial read
request is done at the same port as without multicast (port 69 in most configuration). Data transfer is done at IP and port chosen by the server.

When more clients connect to the server, atftpd tries to find a thread currently sending the same file. If it exists, this thread will take
care of the new client. If not, a new thread is started for that new client. It is possible to send many different files to many clients
when using multicast. Each file transfer uses a unique IP and port.

MTFTP

The PXE specification uses a completely different (and incompatible with RFC2090) way of doing things. Basically, the TFTP
request is sent at a different port than a normal TFTP request. Various options like IP address, port and timeout value are fetched by the client
from a DHCP server. Server configuration is done with command line arguments and a configuration file. It is much less flexible than
RFC2090 since configuration of the DHCP server must match the configuration of atftpd. See the file mtftp.conf as an example. Most boot ROMs use this
method for multicast transfer since it is part of the PXE specification (ftp://download.intel.com/labs/manage/wfm/download/pxespec.pdf).

Note: mtftp support starting in atftp 0.7 is experimental.


File name mangling with PCRE in atftpd

Here is an attempt at using PCRE (Perl Compatible Regular Expressions) with a TFTP server. The first question on your mind is most likely "Why in
blazes would anyone want to use a regular expression with a TFTP server?"
Imagine you have a network of machines that all download an identical config file, but each machine requests its file as <serialno>.conf where
<serialno> is the serial number of the machine. This setup is useful when you wish each machine to have individual configs. When you wish to have
identical configurations on each box this is annoying. The solution is to map all requested files ending in .conf to one master.conf file via a
regex. The exact expression I use is

^\w*\.conf$     master.conf

The left hand side is the expression to match, the right hand side is the substitution. This is equivalent to perl's s/// statement. One or more of these
expressions can be stored in a file (one per line) and feed to atftpd via a --pcre <filename> switch on the command line.

Example:

./atftpd --daemon --pcre ./test/pcre_pattern.txt /tftpboot/

Also included is a test program using the --pcre-test <filename> option. You can interactively (or via redirection) feed file name to atftpd and look at
the substitution to verify your rules.

Example:

./atftpd --pcre-test ./test/pcre_pattern.txt

Authors

Jean-Pierre Lefebvre helix@step.polymtl.ca

Remi Lefebvre remi@debian.org

Contributors

may be incomplete

Jeff Miller jeff.miller@transact.com.au

Leif Lindholm leif.lindholm@i3micro.com

Jens Schmidt Jens.A.Schmidt@dxd.ericsson.se

Svend Odgaard Svend.Odgaard@dxd.ericsson.se

Joshua Aune luken@linuxnetworx.com

Mario Lorenz Mario.Lorenz@km3.de

Allen Reese areese@lnxi.com

Thayne Harbaugh tharbaugh@lnxi.com

Thomas Anders thomas.anders@blue-cable.de

Michał Rzechonek m.rzechonek@kelvatek.com

Jeff jeffm@ghostgun.com

Florian Fainelli f.fainelli@gmail.com

Denis Andzakovic denis.andzakovic@pulsesecurity.co.nz

Rosen Penev rosenp@gmail.com

Peter Kaestle peter.kaestle@nokia.com

Grant Edwards

Ryan Barnett ryan.barnett@rockwellcollins.com

Peter Seiderer ps.report@gmx.net

Simon Rettberg simon.rettberg@rz.uni-freiburg.de

Andreas B. Mundt andi@debian.org

Florian Eckert fe@dev.tdt.de

Florian Schmaus flo@geekplace.eu

Kasparek Tomas kasparek@fit.vutbr.cz

Aurelien Jarno aurel32@debian.org

James Cowgill jcowgill@debian.org

MongoDB Logo MongoDB