aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/peer.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2020-06-19 23:45:56 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2020-06-19 23:45:56 +0200
commit6e307fc70e19093869311a04060cddf120b3c31e (patch)
tree6d05942edc626b722a0574369eff7107994e59ef /src/wireguard/peer.rs
parentAdded architecture illustration. (diff)
downloadwireguard-rs-6e307fc70e19093869311a04060cddf120b3c31e.tar.xz
wireguard-rs-6e307fc70e19093869311a04060cddf120b3c31e.zip
Replace RwLock<HashMap> with DashMap in handshake
Diffstat (limited to 'src/wireguard/peer.rs')
-rw-r--r--src/wireguard/peer.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wireguard/peer.rs b/src/wireguard/peer.rs
index 27d39bd..37b4684 100644
--- a/src/wireguard/peer.rs
+++ b/src/wireguard/peer.rs
@@ -22,13 +22,15 @@ pub struct PeerInner<T: Tun, B: UDP> {
// wireguard device state
pub wg: WireGuard<T, B>,
+ // TODO: eliminate
+ pub pk: PublicKey,
+
// handshake state
pub walltime_last_handshake: Mutex<Option<SystemTime>>, // walltime for last handshake (for UAPI status)
pub last_handshake_sent: Mutex<Instant>, // instant for last handshake
- pub handshake_queued: AtomicBool, // is a handshake job currently queued for the peer?
+ pub handshake_queued: AtomicBool, // is a handshake job currently queued?
// stats and configuration
- pub pk: PublicKey, // public key (TODO: there has to be a way to remove this)
pub rx_bytes: AtomicU64, // received bytes
pub tx_bytes: AtomicU64, // transmitted bytes