Struct wireguard_uapi::xplatform::set::Peer[][src]

pub struct Peer {
    pub public_key: [u8; 32],
    pub remove: Option<bool>,
    pub update_only: Option<bool>,
    pub preshared_key: Option<[u8; 32]>,
    pub endpoint: Option<SocketAddr>,
    pub persistent_keepalive_interval: Option<u16>,
    pub replace_allowed_ips: Option<bool>,
    pub allowed_ips: Vec<AllowedIp>,
}

Documentation of each field comes from: https://www.wireguard.com/xplatform/#configuration-protocol

Fields

public_key: [u8; 32]

The value for this key should be a lowercase hex-encoded public key of a new peer entry, which this command adds. The same public key value may not repeat during a single message.

remove: Option<bool>

This key/value combo is only valid in a set operation, in which case it indicates that the previously added peer entry should be removed from the interface.

update_only: Option<bool>

This key/value combo is only valid in a set operation, in which case it causes the operation only occurs if the peer already exists as part of the interface.

preshared_key: Option<[u8; 32]>

The value for this key should be a lowercase hex-encoded preshared-key of the previously added peer entry. The value may be an all zero string in the case of a set operation, in which case it indicates that the preshared-key should be removed.

endpoint: Option<SocketAddr>

The value for this key is either IP:port for IPv4 or [IP]:port for IPv6, indicating the endpoint of the previously added peer entry.

persistent_keepalive_interval: Option<u16>

The value for this is a decimal-string integer corresponding to the persistent keepalive interval of the previously added peer entry. The value 0 disables it.

replace_allowed_ips: Option<bool>

This key/value combo is only valid in a set operation, in which case it indicates that the subsequent allowed IPs (perhaps an empty list) should replace any existing ones of the previously added peer entry, rather than append to the existing allowed IPs list.

allowed_ips: Vec<AllowedIp>

The value for this is IP/cidr, indicating a new added allowed IP entry for the previously added peer entry. If an identical value already exists as part of a prior peer, the allowed IP entry will be removed from that peer and added to this peer.

Implementations

impl Peer[src]

pub fn from_public_key(public_key: [u8; 32]) -> Self[src]

Trait Implementations

impl Clone for Peer[src]

impl Debug for Peer[src]

impl Display for Peer[src]

impl PartialEq<Peer> for Peer[src]

impl StructuralPartialEq for Peer[src]

Auto Trait Implementations

impl RefUnwindSafe for Peer

impl Send for Peer

impl Sync for Peer

impl Unpin for Peer

impl UnwindSafe for Peer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.