aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/router/outbound.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-09 13:38:08 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-09 13:38:08 +0100
commit3b376cd6fba75787b08bb9bed8413a0d40998c26 (patch)
treea951aeb5ab0d7b48396593832c48388d6df27ece /src/wireguard/router/outbound.rs
parentMerge branch 'runq' of ssh://git.zx2c4.com/wireguard-rs into runq (diff)
downloadwireguard-rs-3b376cd6fba75787b08bb9bed8413a0d40998c26.tar.xz
wireguard-rs-3b376cd6fba75787b08bb9bed8413a0d40998c26.zip
Formatting
Diffstat (limited to 'src/wireguard/router/outbound.rs')
-rw-r--r--src/wireguard/router/outbound.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/wireguard/router/outbound.rs b/src/wireguard/router/outbound.rs
index 6c42d8f..9ecffd8 100644
--- a/src/wireguard/router/outbound.rs
+++ b/src/wireguard/router/outbound.rs
@@ -1,3 +1,4 @@
+use super::device::Device;
use super::messages::{TransportHeader, TYPE_TRANSPORT};
use super::peer::Peer;
use super::pool::*;
@@ -5,7 +6,6 @@ use super::types::Callbacks;
use super::KeyPair;
use super::REJECT_AFTER_MESSAGES;
use super::{tun, udp, Endpoint};
-use super::device::Device;
use std::sync::mpsc::Receiver;
use std::sync::Arc;
@@ -35,7 +35,6 @@ impl Outbound {
pub fn parallel<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>>(
device: Device<E, C, T, B>,
receiver: Receiver<Job<Peer<E, C, T, B>, Outbound>>,
-
) {
fn work<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>>(
_peer: &Peer<E, C, T, B>,
@@ -67,8 +66,9 @@ pub fn parallel<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>>(
let nonce = Nonce::assume_unique_for_key(nonce);
// do the weird ring AEAD dance
- let key =
- LessSafeKey::new(UnboundKey::new(&CHACHA20_POLY1305, &body.keypair.send.key[..]).unwrap());
+ let key = LessSafeKey::new(
+ UnboundKey::new(&CHACHA20_POLY1305, &body.keypair.send.key[..]).unwrap(),
+ );
// encrypt content of transport message in-place
let end = packet.len() - SIZE_TAG;
@@ -83,7 +83,6 @@ pub fn parallel<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>>(
worker_parallel(device, |dev| &dev.run_outbound, receiver, work);
}
-
#[inline(always)]
pub fn sequential<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>>(
device: Device<E, C, T, B>,
@@ -105,4 +104,4 @@ pub fn sequential<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>>(
);
});
});
-} \ No newline at end of file
+}