pub struct Peer {
pub public_key: Key,
pub preshared_key: Option<Key>,
pub endpoint: SocketAddr,
pub persistent_keepalive_interval: Option<Duration>,
pub last_handshake_time: Option<SystemTime>,
pub rx_bytes: i64,
pub tx_bytes: i64,
pub allowed_ips: Vec<IpNet>,
pub protocol_version: Option<u16>,
}
Expand description
Peer
is a WireGuard peer to a Device.
Fields§
§public_key: Key
public_key
is the public key of a peer, computed from its private key.
It is always present in a Peer.
preshared_key
is an optional preshared key which may be used
as an additional layer of security for peer communications.
endpoint: SocketAddr
endpoint
is the most recent source address used for communication by this Peer.
persistent_keepalive_interval: Option<Duration>
persistent_keepalive_interval
specifies how often an “empty” packet is
sent to a peer to keep a connection alive.
last_handshake_time: Option<SystemTime>
last_handshake_time
indicates the most recent time a handshake was performed with this peer.
rx_bytes: i64
rx_bytes
indicates the number of bytes received from this peer.
tx_bytes: i64
tx_bytes
indicates the number of bytes transmitted to this peer.
allowed_ips: Vec<IpNet>
allowed_ips
specifies which IPv4 and IPv6 addresses this peer is allowed to communicate on.
protocol_version: Option<u16>
protocol_version
specifies which version of the WireGuard protocol is used for this Peer.