- Notifications
You must be signed in to change notification settings - Fork13
Executor agnostic async TFTP implementation
License
NotificationsYou must be signed in to change notification settings
oblique/async-tftp-rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Executor agnostic async TFTP implementation, written withsmolbuilding 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 fasterfile transfer in unstable environments. - You can setblock size limit. This is useful if you are accessingclient through a VPN.
- You can implement your own
Handler
for more advance cases thanjust serving a directory. Checktftpd-targz.rs
for an example.
use async_tftp::server::TftpServerBuilder;use async_tftp::Result;#[tokio::main]// or any other runtime/executorasyncfnmain() ->Result<()>{let tftpd =TftpServerBuilder::with_dir_ro(".")?.build().await?; tftpd.serve().await?;Ok(())}
Add inCargo.toml
:
[dependencies]async-tftp ="0.3"# or any other runtime/executortokio = {version ="1",features = ["rt-multi-thread","macros"] }
There are some examples included with this crate.You can run them from a source checkout with cargo:
$ cargo run --example tftpd-dirTFTP directory: ...Listening on: 0.0.0.0:6969^C$ cargo run --example tftpd-targz<archive-path>Listening on: 0.0.0.0:6969^C
About
Executor agnostic async TFTP implementation
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.