Giter Site home page Giter Site logo

ensc / r-tftpd Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 188 KB

TFTP server with RFC 7440 "windowsize" support (mirror-only of https://gitlab-ext.sigma-chemnitz.de/ensc/r-tftpd)

Home Page: https://gitlab-ext.sigma-chemnitz.de/ensc/r-tftpd

License: GNU General Public License v3.0

M4 1.34% Makefile 4.67% Rust 92.79% Shell 1.21%
proxy proxy-server rust tftp tftp-protocol tftp-server linux tftpd rfc7440

r-tftpd's Introduction

About

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.

Implemented standards

Usage

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

build

make
cargo build

see r-tftp.spec for ways how to customize it by using makefile variables.

standalone

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).

systemd socket activation

see contrib/

Proxy mode

"r-tftpd" supports relaying of tftp requests to other servers. It allows pseudo virtual hosting by creating (dead) symlinks pointing to an url.

supported uris

  • 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

examples

$ 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

License

GPL-3.0 or later

r-tftpd's People

Contributors

ensc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.