Crates.io | r-tftpd |
lib.rs | r-tftpd |
version | 0.3.3 |
source | src |
created_at | 2024-02-10 11:35:11.422419 |
updated_at | 2024-06-08 19:02:44.918144 |
description | TFTP server with RFC 7440 windowsize support |
homepage | https://github.com/ensc/r-tftpd |
repository | https://gitlab-ext.sigma-chemnitz.de/ensc/r-tftpd |
max_upload_size | |
id | 1134884 |
size | 181,729 |
r-tftpd is a tftp server with RFC 7440 "windowsize" support and it can relay tftp requests to http servers.
It allows RRQ
(read) requests; WRQ
support is incomplete and
exists only for testing purposes.
RRQ
: yesWRQ
: only for testing purposes; e.g. accepts only the data but does not store it. No window size support eitherRFC 2347 "TFTP Option Extension":
--no-rfc2347
flagRFC 7440 "TFTP Windowsize Option"
RRQ
, but not for WRQ
Usage: r-tftpd [OPTIONS]
Options:
-s, --systemd use systemd fd propagation
-p, --port <PORT> port to listen on [default: 69]
-l, --listen <IP> ip address to listen on [default: ::]
-m, --max-connections <NUM> maximum number of connections [default: 64]
-t, --timeout <TIMEOUT> timeout in seconds during tftp transfers [default: 3]
-f, --fallback <URI> fallback uri
-L, --log-format <FMT> log format [default: default] [possible values: default, compact, full, json]
-C, --cache-dir <DIR> directory used for cache files
--no-rfc2347 disable RFC 2347 (OACK) support; only useful for testing some clients
--wrq-devnull accept WRQ but throw it away; only useful for testing some clients
--disable-proxy disable proxy support
-h, --help Print help information
-V, --version Print version information
make
cargo build
see r-tftp.spec for ways how to customize it by using makefile variables.
cd /var/lib/tftpboot && r-tftpd --port 1234
Listening on privileged ports (e.g. the standard 69 one) requires the
CAP_NET_BIND_SERVICE
capability (see man 7 capabilities
).
see contrib/
"r-tftpd" supports relaying of tftp requests to other servers. It allows pseudo virtual hosting by creating (dead) symlinks pointing to an url.
http://
+ https://
Schemes accept the following, "plus" sign separated modifiers:
nocache
: downloaded resources will not be cached; by default usual
http caching mechanisms (Cache-Control
, Etag
, ...) are applied
and resources are kept locally. They are not accessible on disk but
created by O_TMPFILE
.
The cache is cleared periodically
nocompress
: resources are requested with identity
encoding; by
default, compression is enabled. When compression is enabled, the
whole file must be downloaded when starting the transaction because
its size can not be determined else.
Without compression, Content-Length
information are used and tftp
upload and http download happen in parallel, This helps to avoid
tftp timeouts
$ tree
.
├── domain1 -> http+nocache://domain1.example.org/
├── domain2 -> http+nocompress://domain2.example.org/
├── existing
├── remote-file -> http+nocompress+nocache://domain3.example.org/some-file
└── subdir
└── file
$ r-tftp --fallback http://fallback.example.org/
requested path | returned resource | flags |
---|---|---|
existing |
local existing file |
|
subdir/file |
local subdir/file |
|
domain1/foo |
remote http://domain1.example.org/foo |
without caching |
domain2/bar |
remote http://domain2.example.org/bar |
without http compression |
remote-file |
remote http://fallback.example.org/remote-file |
without http compression nor caching |
not-here |
remote http://fallback.example.org/not-here |
GPL-3.0 or later