Struct rtnetlink::RouteAddRequest
source · pub struct RouteAddRequest<T = ()> { /* private fields */ }
Expand description
A request to create a new route. This is equivalent to the ip route add
commands.
Implementations§
source§impl<T> RouteAddRequest<T>
impl<T> RouteAddRequest<T>
sourcepub fn input_interface(self, index: u32) -> Self
pub fn input_interface(self, index: u32) -> Self
Sets the input interface index.
sourcepub fn output_interface(self, index: u32) -> Self
pub fn output_interface(self, index: u32) -> Self
Sets the output interface index.
sourcepub fn protocol(self, protocol: u8) -> Self
pub fn protocol(self, protocol: u8) -> Self
Sets the route protocol.
Default is static route protocol.
sourcepub fn v4(self) -> RouteAddRequest<Ipv4Addr>
pub fn v4(self) -> RouteAddRequest<Ipv4Addr>
Build an IP v4 route request
sourcepub fn v6(self) -> RouteAddRequest<Ipv6Addr>
pub fn v6(self) -> RouteAddRequest<Ipv6Addr>
Build an IP v6 route request
sourcepub fn message_mut(&mut self) -> &mut RouteMessage
pub fn message_mut(&mut self) -> &mut RouteMessage
Return a mutable reference to the request message.
source§impl RouteAddRequest<Ipv4Addr>
impl RouteAddRequest<Ipv4Addr>
sourcepub fn source_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
pub fn source_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
Sets the source address prefix.
sourcepub fn pref_source(self, addr: Ipv4Addr) -> Self
pub fn pref_source(self, addr: Ipv4Addr) -> Self
Sets the preferred source address.
sourcepub fn destination_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
pub fn destination_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
Sets the destination address prefix.
source§impl RouteAddRequest<Ipv6Addr>
impl RouteAddRequest<Ipv6Addr>
sourcepub fn source_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
pub fn source_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
Sets the source address prefix.
sourcepub fn pref_source(self, addr: Ipv6Addr) -> Self
pub fn pref_source(self, addr: Ipv6Addr) -> Self
Sets the preferred source address.
sourcepub fn destination_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
pub fn destination_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
Sets the destination address prefix.