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

Add MAC Address to interface struct #7

Open
tr3ysmith opened this issue Jul 15, 2022 · 7 comments
Open

Add MAC Address to interface struct #7

tr3ysmith opened this issue Jul 15, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@tr3ysmith
Copy link

I know this would require a different lookup in libc, but having the MAC hardware address included would be super helpful.

As I understand it, you have to call ioctl with this flagSIOCGIFHWADDR. I'm not very savvy with Rust and libc yet, but figured I'd ask!

@EstebanBorai
Copy link
Owner

Hi @tr3ysmith! Thanks so much for opening this feature request!

Thanks for pointing out an approach as well, is very appreciated. This crate attempts to provide the same features under the same API for Window, Linux and macOS. This means that the feature should be supported on the three environments.

I will dig into a Windows implementation as well to make sure we have all targets supported. Thanks again!

@EstebanBorai EstebanBorai added the enhancement New feature or request label Jul 15, 2022
@EstebanBorai
Copy link
Owner

Hi @tr3ysmith I replaced the implementation on #8 with a new one in #10.
This time Im using FFI to consume the LLADDR function to retrieve the MAC Address.

If you have any early feedback that would be awesome, thanks in advance!

@tr3ysmith
Copy link
Author

@EstebanBorai Thanks so much! I'll give it a shot this week!! This is awesome!

@EstebanBorai
Copy link
Owner

@tr3ysmith thanks for your patience and time, I have updated the approach and also introduced the field for macOS I still have to work on providing support for Windows and Linux. If you have any input I'm glad to hear!

@EstebanBorai
Copy link
Owner

Hi @tr3ysmith!

Just wanted to share that support for MAC Addresses is now available for Linux and Macintosh!
We still have to work on providing support to Windows anytime soon!

Keep you updated!

@joaoantoniocardoso
Copy link

joaoantoniocardoso commented Sep 11, 2023

Hello!

The available MAC address is (probably, I didn't check) the current, which can easily be changed, right?

Could we also add the permanent one? Here's how ethtool and macchanger get the permanent MAC address.

Thanks!

@EstebanBorai
Copy link
Owner

Hello!

The available MAC address is (probably, I didn't check) the current, which can easily be changed, right?

Could we also add the permanent one? Here's how ethtool and macchanger get the permanent MAC address.

Thanks!

Hi @joaoantoniocardoso!

Makes sense to me! Would you like to work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants