aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2019-03-03 14:02:17 +0100
committerReiner Herrmann <reiner@reiner-h.de>2019-03-03 14:02:17 +0100
commita62e0c10aed3639aedb0c228c7685926b391aae8 (patch)
tree3b37b1de5cc323d1755005439084aa6ff0a39e7c /src/lib.rs
parent960ea9072b03cf265a113c2ff978c0d2fb4735a3 (diff)
Implement Transfer Size Option (RFC 2349, part 2)
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6a45eeb..f9fc57e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,6 +24,7 @@ pub enum Opcodes {
pub struct TftpOptions {
blksize: usize,
timeout: u8,
+ tsize: usize,
}
pub struct Tftp {
@@ -34,6 +35,7 @@ fn default_options() -> TftpOptions {
TftpOptions {
blksize: 512,
timeout: 3,
+ tsize: 0,
}
}
@@ -142,6 +144,15 @@ impl Tftp {
_ => false
}
}
+ "tsize" => {
+ match val.parse() {
+ Ok(t) => {
+ self.options.tsize = t;
+ true
+ }
+ _ => false
+ }
+ }
_ => false
}
});