diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-10-09 15:08:26 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-10-09 15:08:26 +0200 |
commit | 761c46064d7510303f08cde27c9e13b07293f3af (patch) | |
tree | 7b914169725952e557223972b3f0b611c54e6829 /src/main.rs | |
parent | Restructure dummy implementations (diff) | |
download | wireguard-rs-761c46064d7510303f08cde27c9e13b07293f3af.tar.xz wireguard-rs-761c46064d7510303f08cde27c9e13b07293f3af.zip |
Restructure IO traits.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 6133884..7a31119 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ extern crate jemallocator; #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +// mod config; mod constants; mod handshake; mod router; @@ -14,7 +15,8 @@ mod wireguard; #[cfg(test)] mod tests { - use crate::types::{dummy, Bind}; + use crate::types::tun::Tun; + use crate::types::{bind, dummy, tun}; use crate::wireguard::Wireguard; use std::thread; @@ -27,7 +29,8 @@ mod tests { #[test] fn test_pure_wireguard() { init(); - let wg = Wireguard::new(dummy::TunTest::new(), dummy::VoidBind::new()); + let (reader, writer, mtu) = dummy::TunTest::create("name").unwrap(); + let wg: Wireguard<dummy::TunTest, dummy::PairBind> = Wireguard::new(reader, writer, mtu); thread::sleep(Duration::from_millis(500)); } } |