aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/timers.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-21 00:17:31 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-21 00:17:31 +0100
commitaabefa50436af8d614520bb219d675953eeba6eb (patch)
tree9186ef07b94f12e75040d5163477ef1e549cee14 /src/wireguard/timers.rs
parentConstant renamed to be consistent with kernel WG (diff)
downloadwireguard-rs-aabefa50436af8d614520bb219d675953eeba6eb.tar.xz
wireguard-rs-aabefa50436af8d614520bb219d675953eeba6eb.zip
Remove unused test code.
- make naming consistent with the kernel module. - better distribution of functionality from src/wireguard.rs - more consistent "import pattern" throughout the project. - remove unused test code.
Diffstat (limited to 'src/wireguard/timers.rs')
-rw-r--r--src/wireguard/timers.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/wireguard/timers.rs b/src/wireguard/timers.rs
index 8f8a244..b8c6d99 100644
--- a/src/wireguard/timers.rs
+++ b/src/wireguard/timers.rs
@@ -7,10 +7,11 @@ use hjul::{Runner, Timer};
use log::debug;
use super::constants::*;
+use super::peer::{Peer, PeerInner};
use super::router::{message_data_len, Callbacks};
+use super::tun::Tun;
use super::types::KeyPair;
-use super::{tun, udp};
-use super::{Peer, PeerInner};
+use super::udp::UDP;
pub struct Timers {
// only updated during configuration
@@ -35,7 +36,7 @@ impl Timers {
}
}
-impl<T: tun::Tun, B: udp::UDP> PeerInner<T, B> {
+impl<T: Tun, B: UDP> PeerInner<T, B> {
pub fn get_keepalive_interval(&self) -> u64 {
self.timers().keepalive_interval
}
@@ -221,11 +222,7 @@ impl<T: tun::Tun, B: udp::UDP> PeerInner<T, B> {
}
impl Timers {
- pub fn new<T, B>(runner: &Runner, running: bool, peer: Peer<T, B>) -> Timers
- where
- T: tun::Tun,
- B: udp::UDP,
- {
+ pub fn new<T: Tun, B: UDP>(runner: &Runner, running: bool, peer: Peer<T, B>) -> Timers {
// create a timer instance for the provided peer
Timers {
enabled: running,
@@ -338,7 +335,7 @@ impl Timers {
pub struct Events<T, B>(PhantomData<(T, B)>);
-impl<T: tun::Tun, B: udp::UDP> Callbacks for Events<T, B> {
+impl<T: Tun, B: UDP> Callbacks for Events<T, B> {
type Opaque = Arc<PeerInner<T, B>>;
/* Called after the router encrypts a transport message destined for the peer.