This crate provides methods to query and configure the Linux network interface settings via the ethtool generic netlink protocol.
The examples are built with the crate and need root (CAP_NET_ADMIN) to run:
cargo build --examples
sudo ./target/debug/examples/get_pause_conf- get or dump pause configuration
- query features
- query link modes
- query rings
- query coalesce
- query timestamping information
- query FEC
- query channels
- query module EEPROM
EthtoolHandle::get_pause()takes a mandatory interface name and returns a singleEthtoolPauseParsed,EthtoolHandle::dump_pause()takes no interface name and returns aVec<EthtoolPauseParsed>.EthtoolHandle::apply_pause()applies anEthtoolPauseParsed, usually one returned byget_pause()ordump_pause()after modifying it. The sub-handle request builders (handle.pause().get(...),handle.pause().set(...)) stay available as well.EthtoolPauseParsedis#[non_exhaustive], so it can not be built with a struct literal outside of this crate. UseDefault::default()and assign the properties instead.- A parsed configuration holds only the properties the kernel reported, a
field holding
Noneis not sent in a set request and the kernel keeps its current value. - The statistics properties of
EthtoolPauseParsedare read-only, the kernel rejects them in a set request, therefore they are not sent. apply_pause_confshows how a queried configuration is modified and applied back,set_channel_countuses the builder of the channel set request.