pub struct LinkSetRequest { /* private fields */ }Implementations§
Source§impl LinkSetRequest
impl LinkSetRequest
Sourcepub fn message_mut(&mut self) -> &mut LinkMessage
pub fn message_mut(&mut self) -> &mut LinkMessage
Return a mutable reference to the request
Sourcepub fn master(self, master_index: u32) -> Self
pub fn master(self, master_index: u32) -> Self
Attach the link to a bridge (its master). This is equivalent to ip link set LINK master BRIDGE. To succeed, both the bridge and the link that is being attached must be UP.
To Remove a link from a bridge, set its master to zero.
This is equvalent to ip link set LINK nomaster
Sourcepub fn nomaster(self) -> Self
pub fn nomaster(self) -> Self
Detach the link from its master. This is equivalent to ip link set LINK nomaster.
To succeed, the link that is being detached must be UP.
Sourcepub fn up(self) -> Self
pub fn up(self) -> Self
Set the link with the given index up (equivalent to ip link set dev DEV up)
Sourcepub fn down(self) -> Self
pub fn down(self) -> Self
Set the link with the given index down (equivalent to ip link set dev DEV down)
Sourcepub fn promiscuous(self, enable: bool) -> Self
pub fn promiscuous(self, enable: bool) -> Self
Enable or disable promiscious mode of the link with the given index (equivalent to ip link set dev DEV promisc on/off)
Sourcepub fn arp(self, enable: bool) -> Self
pub fn arp(self, enable: bool) -> Self
Enable or disable the ARP protocol of the link with the given index (equivalent to ip link set dev DEV arp on/off)
Sourcepub fn name(self, name: String) -> Self
pub fn name(self, name: String) -> Self
Set the name of the link with the given index (equivalent to ip link set DEV name NAME)
Sourcepub fn mtu(self, mtu: u32) -> Self
pub fn mtu(self, mtu: u32) -> Self
Set the mtu of the link with the given index (equivalent to ip link set DEV mtu MTU)
Sourcepub fn address(self, address: Vec<u8>) -> Self
pub fn address(self, address: Vec<u8>) -> Self
Set the hardware address of the link with the given index (equivalent to ip link set DEV address ADDRESS)
Sourcepub fn setns_by_pid(self, pid: u32) -> Self
pub fn setns_by_pid(self, pid: u32) -> Self
Move this network device into the network namespace of the process with the given pid.
Sourcepub fn setns_by_fd(self, fd: RawFd) -> Self
pub fn setns_by_fd(self, fd: RawFd) -> Self
Move this network device into the network namespace corresponding to the given file descriptor.