diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-31 15:03:14 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-31 15:03:14 +0200 |
commit | 51179f5433fbc1617d59e25493a22072c0987726 (patch) | |
tree | 3034f4ca9d35da77c55750e5c0c058bafeea22ff /src/types/tun.rs | |
parent | Move to RustCrypto AEAD crate for handshake (diff) | |
download | wireguard-rs-51179f5433fbc1617d59e25493a22072c0987726.tar.xz wireguard-rs-51179f5433fbc1617d59e25493a22072c0987726.zip |
Better management of key material
Diffstat (limited to 'src/types/tun.rs')
-rw-r--r-- | src/types/tun.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/types/tun.rs b/src/types/tun.rs index 72caa71..b36089e 100644 --- a/src/types/tun.rs +++ b/src/types/tun.rs @@ -1,6 +1,6 @@ use std::error; -pub trait Tun: Send + Sync { +pub trait Tun: Send + Sync + 'static { type Error: error::Error; /// Returns the MTU of the device @@ -22,13 +22,13 @@ pub trait Tun: Send + Sync { /// /// # Arguments /// - /// - dst: Destination buffer (enough space for MTU bytes + header) + /// - buf: Destination buffer (enough space for MTU bytes + header) /// - offset: Offset for the beginning of the IP packet /// /// # Returns /// /// The size of the IP packet (ignoring the header) or an std::error::Error instance: - fn read(&self, dst: &mut [u8], offset: usize) -> Result<usize, Self::Error>; + fn read(&self, buf: &mut [u8], offset: usize) -> Result<usize, Self::Error>; /// Writes an IP packet to the tunnel device /// |