Struct rtnetlink::LinkSetRequest
source · 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, ctrl_index: u32) -> Self
👎Deprecated since 0.14.0: Please use LinkSetRequest::controller()
instead
pub fn master(self, ctrl_index: u32) -> Self
LinkSetRequest::controller()
insteadAttach 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 controller(self, ctrl_index: u32) -> Self
pub fn controller(self, ctrl_index: u32) -> Self
Attach the link to a bridge (its controller). 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
👎Deprecated since 0.14.0: Please use LinkSetRequest::nocontroller()
instead
pub fn nomaster(self) -> Self
LinkSetRequest::nocontroller()
insteadDetach 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 nocontroller(self) -> Self
pub fn nocontroller(self) -> Self
Detach the link from its controller. 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.