Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface speed for windows, linux, darwin and freebsd #1473

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

a-pichler
Copy link

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)

@shirou
Copy link
Owner

shirou commented Jun 18, 2023

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?

  1. Could you survey any other way to get interface speed other than ifconfig ?
  2. Update regex to match Ethernet 10Gbase-T.
  3. return error if nothing match.

I will check your PR on Windows later. Thank you for your patience.

@Hipska
Copy link

Hipska commented Jan 30, 2024

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants