[−][src]Crate async_tftp
Executor agnostic async TFTP implementation, written with smol building blocks. Currently it implements only server side.
The following RFCs are implemented:
- RFC 1350 - The TFTP Protocol (Revision 2).
- RFC 2347 - TFTP Option Extension.
- RFC 2348 - TFTP Blocksize Option.
- RFC 2349 - TFTP Timeout Interval and Transfer Size Options.
Features:
- Async implementation.
- Works with any runtime/executor.
- Serve read (RRQ) and write (WRQ) requests.
- Unlimited transfer file size (block number roll-over).
- You can set non-standard reply
timeout
. This is useful for faster file transfer in unstable environments. - You can set block size limit. This is useful if you are accessing client through a VPN.
- You can implement your own
Handler
for more advance cases than just serving a directory. Checktftpd-targz.rs
for an example.
Example
ⓘThis example is not tested
use async_tftp::server::TftpServerBuilder; use async_tftp::Result; fn main() -> Result<()> { smol::run(async { // or any other runtime/executor let tftpd = TftpServerBuilder::with_dir_ro(".")?.build().await?; tftpd.serve().await?; Ok(()) }) }
Add in Cargo.toml
:
[dependencies]
smol = "0.3" # or any other runtime/executor
async-tftp = "0.3"
Modules
packet | Packet definitions that are needed in public API. |
server | Server side implementation. |
Enums
Error | Error type of this crate. |
Type Definitions
Result | Type alias to |
Attribute Macros
async_trait | Re-export of |