aboutsummaryrefslogtreecommitdiffstats
path: root/src/router/peer.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-11 16:28:32 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-11 16:28:32 +0200
commitde48bec95870a057594212d7d0a2679f13034797 (patch)
treec9d9bffcfe79248f4e2ed3aee356faa344abe8c5 /src/router/peer.rs
parentFull inbound/outbound router test (diff)
downloadwireguard-rs-de48bec95870a057594212d7d0a2679f13034797.tar.xz
wireguard-rs-de48bec95870a057594212d7d0a2679f13034797.zip
Simplified router tests
Diffstat (limited to '')
-rw-r--r--src/router/peer.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/router/peer.rs b/src/router/peer.rs
index 9ad5d2f..43317cc 100644
--- a/src/router/peer.rs
+++ b/src/router/peer.rs
@@ -331,6 +331,10 @@ impl<C: Callbacks, T: Tun, B: Bind> Peer<C, T, B> {
*self.state.endpoint.lock() = Some(endpoint.into());
}
+ pub fn get_endpoint(&self) -> Option<SocketAddr> {
+ self.state.endpoint.lock().as_ref().map(|e| (*e).into())
+ }
+
/// Add a new keypair
///
/// # Arguments