pub enum OpSetDeviceDoRequest<'a> {
Ifindex(u32),
Ifname(&'a CStr),
PrivateKey(&'a [u8]),
PublicKey(&'a [u8]),
Flags(u32),
ListenPort(u16),
Fwmark(u32),
Peers(IterableArrayWgpeer<'a>),
}wireguard only.Expand description
Set WireGuard device.
This command should be called with a wgdevice set, containing one but not both of WGDEVICE_A_IFINDEX and WGDEVICE_A_IFNAME.
It is possible that the amount of configuration data exceeds that of the maximum message length accepted by the kernel. In that case, several messages should be sent one after another, with each successive one filling in information not contained in the prior. Note that if WGDEVICE_F_REPLACE_PEERS is specified in the first message, it probably should not be specified in fragments that come after, so that the list of peers is only cleared the first time but appended after. Likewise for peers, if WGPEER_F_REPLACE_ALLOWEDIPS is specified in the first message of a peer, it likely should not be specified in subsequent fragments.
If an error occurs, NLMSG_ERROR will reply containing an errno.
Variants§
Ifindex(u32)
Ifname(&'a CStr)
PrivateKey(&'a [u8])
Set to all zeros to remove.
PublicKey(&'a [u8])
Flags(u32)
0 or WGDEVICE_F_REPLACE_PEERS if all current peers should be removed prior to adding the list below.
Associated type: “WgdeviceFlags” (enum)
ListenPort(u16)
Set as 0 to choose randomly.
Fwmark(u32)
Set as 0 to disable.
Peers(IterableArrayWgpeer<'a>)
Implementations§
Source§impl<'a> OpSetDeviceDoRequest<'a>
impl<'a> OpSetDeviceDoRequest<'a>
pub fn new(buf: &'a [u8]) -> IterableOpSetDeviceDoRequest<'a> ⓘ
Trait Implementations§
Source§impl<'a> Clone for OpSetDeviceDoRequest<'a>
impl<'a> Clone for OpSetDeviceDoRequest<'a>
Source§fn clone(&self) -> OpSetDeviceDoRequest<'a>
fn clone(&self) -> OpSetDeviceDoRequest<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more