pub struct PushOpSetDeviceDoRequest<Prev: Rec> { /* private fields */ }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.
Implementations§
Source§impl<Prev: Rec> PushOpSetDeviceDoRequest<Prev>
impl<Prev: Rec> PushOpSetDeviceDoRequest<Prev>
pub fn new(prev: Prev) -> Self
pub fn end_nested(self) -> Prev
pub fn push_ifindex(self, value: u32) -> Self
pub fn push_ifname(self, value: &CStr) -> Self
pub fn push_ifname_bytes(self, value: &[u8]) -> Self
Sourcepub fn push_private_key(self, value: &[u8]) -> Self
pub fn push_private_key(self, value: &[u8]) -> Self
Set to all zeros to remove.
pub fn push_public_key(self, value: &[u8]) -> Self
Sourcepub fn push_flags(self, value: u32) -> Self
pub fn push_flags(self, value: u32) -> Self
0 or WGDEVICE_F_REPLACE_PEERS if all current peers should be removed prior to adding the list below.
Associated type: “WgdeviceFlags” (enum)
Sourcepub fn push_listen_port(self, value: u16) -> Self
pub fn push_listen_port(self, value: u16) -> Self
Set as 0 to choose randomly.
Sourcepub fn push_fwmark(self, value: u32) -> Self
pub fn push_fwmark(self, value: u32) -> Self
Set as 0 to disable.