aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-27 11:37:20 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-27 11:37:20 +0200
commite28a9274d089b45f2aec4852cf6de1e0d0ec6694 (patch)
treed7f5f0cfc3363a9da45f55f1e8ddfeb127e719e3 /src
parentRemoved unused sub-module (diff)
downloadwireguard-rs-e28a9274d089b45f2aec4852cf6de1e0d0ec6694.tar.xz
wireguard-rs-e28a9274d089b45f2aec4852cf6de1e0d0ec6694.zip
Removed unused sub-module
Diffstat (limited to 'src')
-rw-r--r--src/router/inbound.rs52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/router/inbound.rs b/src/router/inbound.rs
deleted file mode 100644
index eba63c4..0000000
--- a/src/router/inbound.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-use std::thread;
-use spin;
-use lifeguard::Recycled;
-use super::anti_replay::AntiReplay;
-use std::sync::mpsc::{Receiver, sync_channel};
-use std::sync::Arc;
-
-struct ParallelJobInner {
- done : bool,
- msg : Vec<u8>,
- key : [u8; 32]
-}
-
-type ParallelJob = spin::Mutex<ParallelJobInner>;
-
-struct InboundInorder {
- job : Arc<ParallelJob>,
- state : Arc<KeyState>,
-}
-
-struct Inorder<'a> (Arc<spin::Mutex<Option<Job<'a>>>>);
-
-struct Job<'a> {
- msg : Recycled<'a, Vec<u8>>,
- arp : Arc<KeyState>, // replay protector and key-pair
- key : Option<(Arc<Peer>, Arc<KeyPair>)> // provided if the key has not been confirmed
-}
-
-fn worker_inorder<'a>(channel : Receiver<Inorder<'a>>) {
- let mut current = 0;
-
- // reads from inorder channel
- for ordered in channel.recv().iter() {
-
- loop {
- // check if job is complete
- match ordered.0.try_lock() {
- None => (),
- Some(guard) => if let Some(job) = *guard {
- if job.arp.lock().update(6) {
- // write to output
-
- break;
- }
- }
- }
-
- // wait for job to complete
- thread::park();
- }
- }
-} \ No newline at end of file