Crate tftpd

source ·
Expand description

Multithreaded TFTP daemon implemented in pure Rust.

This server implements RFC 1350, The TFTP Protocol (Revision 2). It also supports the following RFC 2347 TFTP Option Extensions:

§Security

Since TFTP servers do not offer any type of login or access control mechanisms, this server only allows transfer and receiving inside a chosen folder, and disallows external file access.

Structs§

  • Configuration struct used for parsing TFTP options from user input.
  • Allows conversions between byte arrays and other types.
  • Server struct is used for handling incoming TFTP requests.
  • ServerSocket struct is used as an abstraction layer for a server Socket. This struct is used for abstraction of single socket communication.
  • TransferOption struct represents the TFTP transfer options.
  • Window struct is used to store chunks of data from a file. It is used to help store the data that is being sent or received for the RFC 7440 Windowsize option.
  • Worker struct is used for multithreaded file sending and receiving. It creates a new socket using the Server’s IP and a random port requested from the OS to communicate with the requesting client.

Enums§

  • ErrorCode enum represents the error codes used in the TFTP definition.
  • Opcode enum represents the opcodes used in the TFTP definition.
  • OptionType enum represents the TFTP option types
  • Packet enum represents the valid TFTP packet types.

Traits§

  • Socket trait is used to allow building custom sockets to be used for TFTP communication.