Struct nmstate::BaseInterface
source · #[non_exhaustive]pub struct BaseInterface {Show 23 fields
pub name: String,
pub description: Option<String>,
pub prop_list: Vec<&'static str>,
pub iface_type: InterfaceType,
pub state: InterfaceState,
pub mac_address: Option<String>,
pub permanent_mac_address: Option<String>,
pub mtu: Option<u64>,
pub min_mtu: Option<u64>,
pub max_mtu: Option<u64>,
pub wait_ip: Option<WaitIp>,
pub ipv4: Option<InterfaceIpv4>,
pub ipv6: Option<InterfaceIpv6>,
pub mptcp: Option<MptcpConfig>,
pub controller: Option<String>,
pub accept_all_mac_addresses: Option<bool>,
pub copy_mac_from: Option<String>,
pub ovsdb: Option<OvsDbIfaceConfig>,
pub ieee8021x: Option<Ieee8021XConfig>,
pub lldp: Option<LldpConfig>,
pub ethtool: Option<EthtoolConfig>,
pub controller_type: Option<InterfaceType>,
pub _other: Map<String, Value>,
/* private fields */
}
Expand description
Information shared among all interface types
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.name: String
Interface name
description: Option<String>
Interface description stored in network backend. Not available for kernel only mode.
prop_list: Vec<&'static str>
TODO: internal use only. Hide this.
iface_type: InterfaceType
Interface type. Serialize and deserialize to/from type
state: InterfaceState
Interface state. Default to InterfaceState::Up when applying.
mac_address: Option<String>
MAC address in the format: upper case hex string separated by :
on
every two characters. Case insensitive when applying.
Serialize and deserialize to/from mac-address
.
permanent_mac_address: Option<String>
MAC address never change after reboots(normally stored in firmware of
network interface). Using the same format as mac_address
property.
Ignored during apply.
TODO: expose it and we do not special merge for this.
mtu: Option<u64>
Maximum transmission unit.
min_mtu: Option<u64>
Minimum MTU allowed. Ignored during apply.
Serialize and deserialize to/from min-mtu
.
max_mtu: Option<u64>
Maximum MTU allowed. Ignored during apply.
Serialize and deserialize to/from max-mtu
.
wait_ip: Option<WaitIp>
Whether system should wait certain IP stack before considering
network interface activated.
Serialize and deserialize to/from wait-ip
.
ipv4: Option<InterfaceIpv4>
IPv4 information. Hided if interface is not allowed to hold IP information(e.g. port of bond is not allowed to hold IP information).
ipv6: Option<InterfaceIpv6>
IPv4 information. Hided if interface is not allowed to hold IP information(e.g. port of bond is not allowed to hold IP information).
mptcp: Option<MptcpConfig>
Interface wide MPTCP flags. Nmstate will apply these flags to all valid IP addresses(both static and dynamic).
controller: Option<String>
Controller of the specified interface.
Only valid for applying, None
means no change, empty string means
detach from current controller, please be advise, an error will trigger
if this property conflict with ports list of bridge/bond/etc.
Been always set to None
by crate::NetworkState::retrieve().
accept_all_mac_addresses: Option<bool>
Whether kernel should skip check on package targeting MAC address and
accept all packages, also known as promiscuous mode.
Serialize and deserialize to/from accpet-all-mac-addresses
.
copy_mac_from: Option<String>
Copy the MAC address from specified interface.
Ignored during serializing.
Deserialize from copy-mac-from
.
ovsdb: Option<OvsDbIfaceConfig>
Interface specific OpenvSwitch database configurations.
ieee8021x: Option<Ieee8021XConfig>
IEEE 802.1X authentication configurations.
Serialize and deserialize to/from 802.1x
.
lldp: Option<LldpConfig>
Link Layer Discovery Protocol configurations.
ethtool: Option<EthtoolConfig>
Ethtool configurations
controller_type: Option<InterfaceType>
TODO: internal use, hide it.
_other: Map<String, Value>
Implementations§
source§impl BaseInterface
impl BaseInterface
sourcepub fn can_have_ip(&self) -> bool
pub fn can_have_ip(&self) -> bool
Whether this interface can hold IP information or not.
sourcepub fn new() -> Self
pub fn new() -> Self
Create empty BaseInterface with state set to InterfaceState::Up
Trait Implementations§
source§impl Clone for BaseInterface
impl Clone for BaseInterface
source§fn clone(&self) -> BaseInterface
fn clone(&self) -> BaseInterface
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BaseInterface
impl Debug for BaseInterface
source§impl Default for BaseInterface
impl Default for BaseInterface
source§fn default() -> BaseInterface
fn default() -> BaseInterface
source§impl<'de> Deserialize<'de> for BaseInterface
impl<'de> Deserialize<'de> for BaseInterface
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 PartialEq<BaseInterface> for BaseInterface
impl PartialEq<BaseInterface> for BaseInterface
source§fn eq(&self, other: &BaseInterface) -> bool
fn eq(&self, other: &BaseInterface) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for BaseInterface
impl Serialize for BaseInterface
impl Eq for BaseInterface
impl StructuralEq for BaseInterface
impl StructuralPartialEq for BaseInterface
Auto Trait Implementations§
impl RefUnwindSafe for BaseInterface
impl Send for BaseInterface
impl Sync for BaseInterface
impl Unpin for BaseInterface
impl UnwindSafe for BaseInterface
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.