Struct nmstate::BaseInterface
source · #[non_exhaustive]pub struct BaseInterface {Show 26 fields
pub name: String,
pub profile_name: Option<String>,
pub description: Option<String>,
pub iface_type: InterfaceType,
pub driver: Option<String>,
pub state: InterfaceState,
pub identifier: Option<InterfaceIdentifier>,
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 dispatch: Option<DispatchConfig>,
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: StringInterface name, when applying with InterfaceIdentifier::MacAddress,
if profile_name not defined, this will be used as profile name.
profile_name: Option<String>§description: Option<String>Interface description stored in network backend. Not available for kernel only mode.
iface_type: InterfaceTypeInterface type. Serialize and deserialize to/from type
driver: Option<String>The driver of the specified network device.
state: InterfaceStateInterface state. Default to InterfaceState::Up when applying.
identifier: Option<InterfaceIdentifier>Define network backend matching method on choosing network interface. Default to InterfaceIdentifier::Name.
mac_address: Option<String>When applying with [InterfaceIdentifier::MacAddress],
nmstate will store original desired interface name as profile_name
here and store the real interface name as name property.
For InterfaceIdentifier::Name (default), this property will change
the interface MAC address to desired one when applying.
For InterfaceIdentifier::MacAddress, this property will be used
for searching interface on desired MAC address when applying.
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.
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
dispatch: Option<DispatchConfig>Dispatch script configurations
controller_type: Option<InterfaceType>§_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 for BaseInterface
impl PartialEq 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 StructuralPartialEq for BaseInterface
Auto Trait Implementations§
impl Freeze for BaseInterface
impl RefUnwindSafe for BaseInterface
impl Send for BaseInterface
impl Sync for BaseInterface
impl Unpin for BaseInterface
impl UnwindSafe for BaseInterface
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> 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.