diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-11-21 11:43:16 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-11-21 11:43:16 +0100 |
commit | 92dbb4c46a5651afb8f92375e0ed154673929eeb (patch) | |
tree | f274dbaa58256e1fb412ae3934e02e2b19cb47f5 /src/configuration/config.rs | |
parent | Better compartmentalization of cryptokey router (diff) | |
download | wireguard-rs-92dbb4c46a5651afb8f92375e0ed154673929eeb.tar.xz wireguard-rs-92dbb4c46a5651afb8f92375e0ed154673929eeb.zip |
Clean dependencies and imports
Diffstat (limited to '')
-rw-r--r-- | src/configuration/config.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/configuration/config.rs b/src/configuration/config.rs index e50aeb6..f11d90d 100644 --- a/src/configuration/config.rs +++ b/src/configuration/config.rs @@ -22,6 +22,8 @@ pub struct PeerState { pub last_handshake_time_nsec: u64, pub public_key: PublicKey, pub allowed_ips: Vec<(IpAddr, u32)>, + pub endpoint: Option<SocketAddr>, + pub persistent_keepalive_interval: u64, pub preshared_key: [u8; 32], // 0^32 is the "default value" } @@ -295,8 +297,10 @@ impl<T: tun::Tun, B: bind::PlatformBind> Configuration for WireguardConfig<T, B> // extract state into PeerState state.push(PeerState { preshared_key: psk, + endpoint: p.router.get_endpoint(), rx_bytes: p.rx_bytes.load(Ordering::Relaxed), tx_bytes: p.tx_bytes.load(Ordering::Relaxed), + persistent_keepalive_interval: p.get_keepalive_interval(), allowed_ips: p.router.list_allowed_ips(), last_handshake_time_nsec: last_handshake.subsec_nanos() as u64, last_handshake_time_sec: last_handshake.as_secs(), |