interface speed for windows, linux, darwin and freebsd
Implemented interface speed for windows, linux, darwin, and freebsd as discussed here #465
Windows is self-explanatory since the speed data was already in mibIfRow2
Linux reads the speed directly out of the /sys/class/net files for each interface
Darwin and Freebsd call ifconfig and parse the output (since the other data is also obtained by calling netstat and parsing it i figured that would be the best way)
Thank you for your contribution and updating PR.
However, when I run on my FreeBSD 12.4, ifconfig returns this value
vtnet1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=6c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
ether fo:ba:12:34:56
media: Ethernet 10Gbase-T <full-duplex>
status: active
Ethernet 10Gbase-T is not match the regex, therefore, the test is failed.
Could you update the PR?
- Could you survey any other way to get interface speed other than
ifconfig? - Update regex to match
Ethernet 10Gbase-T. - return error if nothing match.
I will check your PR on Windows later. Thank you for your patience.
Any update on this?