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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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§

Whether this interface can hold IP information or not.

Create empty BaseInterface with state set to InterfaceState::Up

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The none-equivalent value.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.