Struct nmstate::RouteRuleEntry
source · #[non_exhaustive]pub struct RouteRuleEntry {
pub family: Option<AddressFamily>,
pub state: Option<RouteRuleState>,
pub ip_from: Option<String>,
pub ip_to: Option<String>,
pub priority: Option<i64>,
pub table_id: Option<u32>,
pub fwmark: Option<u32>,
pub fwmask: Option<u32>,
pub action: Option<RouteRuleAction>,
pub iif: Option<String>,
pub suppress_prefix_length: Option<u32>,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.family: Option<AddressFamily>
Indicate the address family of the route rule.
state: Option<RouteRuleState>
Indicate this is normal route rule or absent route rule.
ip_from: Option<String>
Source prefix to match.
Serialize and deserialize to/from ip-from
.
When setting to empty string in absent route rule, it will only delete
route rule without ip-from
.
ip_to: Option<String>
Destination prefix to match.
Serialize and deserialize to/from ip-to
.
When setting to empty string in absent route rule, it will only delete
route rule without ip-to
.
priority: Option<i64>
Priority of this route rule. Bigger number means lower priority.
table_id: Option<u32>
The routing table ID to lookup if the rule selector matches.
Serialize and deserialize to/from route-table
.
fwmark: Option<u32>
Select the fwmark value to match
fwmask: Option<u32>
Select the fwmask value to match
action: Option<RouteRuleAction>
Actions for matching packages.
iif: Option<String>
Incoming interface.
suppress_prefix_length: Option<u32>
Prefix length of suppressor.
Can deserialize from suppress-prefix-length
or
suppress_prefixlength
.
Serialize into suppress-prefix-length
.
Implementations§
source§impl RouteRuleEntry
impl RouteRuleEntry
sourcepub const USE_DEFAULT_PRIORITY: i64 = -1i64
pub const USE_DEFAULT_PRIORITY: i64 = -1i64
Let network backend choose the default priority.
sourcepub const USE_DEFAULT_ROUTE_TABLE: u32 = 0u32
pub const USE_DEFAULT_ROUTE_TABLE: u32 = 0u32
Use main route table 254.
sourcepub const DEFAULR_ROUTE_TABLE_ID: u32 = 254u32
pub const DEFAULR_ROUTE_TABLE_ID: u32 = 254u32
Default route table main(254).
pub fn new() -> Self
Trait Implementations§
source§impl Clone for RouteRuleEntry
impl Clone for RouteRuleEntry
source§fn clone(&self) -> RouteRuleEntry
fn clone(&self) -> RouteRuleEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RouteRuleEntry
impl Debug for RouteRuleEntry
source§impl Default for RouteRuleEntry
impl Default for RouteRuleEntry
source§fn default() -> RouteRuleEntry
fn default() -> RouteRuleEntry
source§impl<'de> Deserialize<'de> for RouteRuleEntry
impl<'de> Deserialize<'de> for RouteRuleEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for RouteRuleEntry
impl Display for RouteRuleEntry
source§impl Hash for RouteRuleEntry
impl Hash for RouteRuleEntry
source§impl Ord for RouteRuleEntry
impl Ord for RouteRuleEntry
source§impl PartialEq for RouteRuleEntry
impl PartialEq for RouteRuleEntry
source§impl PartialOrd for RouteRuleEntry
impl PartialOrd for RouteRuleEntry
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for RouteRuleEntry
impl Serialize for RouteRuleEntry
impl Eq for RouteRuleEntry
Auto Trait Implementations§
impl Freeze for RouteRuleEntry
impl RefUnwindSafe for RouteRuleEntry
impl Send for RouteRuleEntry
impl Sync for RouteRuleEntry
impl Unpin for RouteRuleEntry
impl UnwindSafe for RouteRuleEntry
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.