Skip to content

Add BSD and macOS link speed implementation#159

Merged
shellrow merged 1 commit into
shellrow:mainfrom
alladin-IT:bsd-and-macos-link-speed
Apr 29, 2026
Merged

Add BSD and macOS link speed implementation#159
shellrow merged 1 commit into
shellrow:mainfrom
alladin-IT:bsd-and-macos-link-speed

Conversation

@bpucher
Copy link
Copy Markdown
Contributor

@bpucher bpucher commented Apr 27, 2026

This commit adds code to get the freebsd, openbsd, netbsd and macOS transmit and receive speed using ioctl. Furthermore, it also add the Wi-Fi transmit rate on macOS.

Additionally, the auto_negotiate field of Interface shows if the interface link speed has been auto-negotiated. If false, the interface link speed is either configured manually or not available.

Unfortunately, this is a rather large commit because every BSD variant uses different constants for their if_media sub types. I didn't find a better way to include all different values while still reusing the ones that are equal across the various operating systems.

Implements #158

(edit: latest changes resolve compile issues on Windows, Linux and Android)

@shellrow
Copy link
Copy Markdown
Owner

Thanks!

I also saw the latest update fixing the non-BSD compile issues - looks like all CI checks are passing except for rustfmt right now.

I'll take a closer look at the implementation soon and review everything in detail.

This commit adds code to get the freebsd, openbsd, netbsd and macOS
transmit and receive speed using `ioctl`. Furthermore, it also add the
Wi-Fi transmit rate on macOS.

Additionally, the auto_negotiate field of `Interface` shows if the
interface link speed has been auto-negotiated. If `false`, the interface
link speed is either configured manually or not available.

Unfortunately, this is a rather large commit because every BSD variant
uses different constants for their if_media sub types. I didn't find a
better way to include all different values while still reusing the ones
that are equal across the various operating systems.

Implements shellrow#158
@bpucher bpucher force-pushed the bsd-and-macos-link-speed branch from 678ec07 to 37b4d74 Compare April 28, 2026 19:45
@bpucher
Copy link
Copy Markdown
Contributor Author

bpucher commented Apr 28, 2026

I forgot to run fustfmt again after some changes. Should now be fixed!

@shellrow shellrow linked an issue Apr 29, 2026 that may be closed by this pull request
@shellrow shellrow merged commit bdbd4b8 into shellrow:main Apr 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a link speed implementation for macOS and BSD derivates

2 participants