aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/handshake/ratelimiter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wireguard/handshake/ratelimiter.rs')
-rw-r--r--src/wireguard/handshake/ratelimiter.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wireguard/handshake/ratelimiter.rs b/src/wireguard/handshake/ratelimiter.rs
index 63d728c..89109e9 100644
--- a/src/wireguard/handshake/ratelimiter.rs
+++ b/src/wireguard/handshake/ratelimiter.rs
@@ -1,4 +1,3 @@
-use spin;
use std::collections::HashMap;
use std::net::IpAddr;
use std::sync::atomic::{AtomicBool, Ordering};
@@ -6,6 +5,8 @@ use std::sync::{Arc, Condvar, Mutex};
use std::thread;
use std::time::{Duration, Instant};
+use spin;
+
const PACKETS_PER_SECOND: u64 = 20;
const PACKETS_BURSTABLE: u64 = 5;
const PACKET_COST: u64 = 1_000_000_000 / PACKETS_PER_SECOND;