I'm trying to fetch the stats of a NIC device in Rust, which is basically the equivalent of running ethtool -S eth0
.
I have been looking at the netlink interface for ethtool documentation and the existing libraries: neli and ethtool.
However, neither of them provide an out-of-box solution. This was my attempt as using the neli
library: ethtool.rs. However, I keep getting device not found
or operation not supported
error. While for the ethtool
library, I need to add the functionality in the library itself which I am currently trying to do.
Any help would be really appreciated as to what is the most straightforward way to do so without obviously running the system commands and reading the stdout.