aboutsummaryrefslogtreecommitdiffstats
path: root/src/router/tests.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-15 15:15:15 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-15 15:15:15 +0200
commitf46762183a5fad4aba88379714abf1d21c3e1c54 (patch)
treec1d6070a4cd356ea24ac2e7ba7ba88896c54799c /src/router/tests.rs
parentBegin work on the pure Wireguard implemenation (diff)
downloadwireguard-rs-f46762183a5fad4aba88379714abf1d21c3e1c54.tar.xz
wireguard-rs-f46762183a5fad4aba88379714abf1d21c3e1c54.zip
Sent staged packets when key-pair confirmed
Diffstat (limited to 'src/router/tests.rs')
-rw-r--r--src/router/tests.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/router/tests.rs b/src/router/tests.rs
index c2ea225..ca6312d 100644
--- a/src/router/tests.rs
+++ b/src/router/tests.rs
@@ -12,7 +12,7 @@ use num_cpus;
use pnet::packet::ipv4::MutableIpv4Packet;
use pnet::packet::ipv6::MutableIpv6Packet;
-use super::super::types::{Bind, Key, KeyPair, Tun};
+use super::super::types::{Bind, Endpoint, Key, KeyPair, Tun};
use super::{Callbacks, Device, SIZE_MESSAGE_PREFIX};
extern crate test;
@@ -70,14 +70,11 @@ impl fmt::Display for TunError {
#[derive(Clone, Copy)]
struct UnitEndpoint {}
-impl From<SocketAddr> for UnitEndpoint {
- fn from(addr: SocketAddr) -> UnitEndpoint {
+impl Endpoint for UnitEndpoint {
+ fn from_address(_: SocketAddr) -> UnitEndpoint {
UnitEndpoint {}
}
-}
-
-impl Into<SocketAddr> for UnitEndpoint {
- fn into(self) -> SocketAddr {
+ fn into_address(&self) -> SocketAddr {
"127.0.0.1:8080".parse().unwrap()
}
}