You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, NetworkInterface's mac_addr member is a Option<String>. It would be nice to have a simple MacAddr type, like:
pubstructMacAddr([u8;6]);
with a From<[u8; 6]> impl and an octets method that returns [u8; 6].
Since mac_addr currently uses a String, it's unclear if it's uppercase, lowercase, in xx:xx:xx:xx:xx:xx format, or in xx-xx-xx-xx-xx-xx format. This will make comparisons easier. I can attempt a pull request if you agree with the idea. Thanks
The text was updated successfully, but these errors were encountered:
Yeah I agree, I think we could have a dedicated type which also allow us to work with MAC addresses with ease.
Would you like to work on this? As a first iteration I think we could:
Introduce a type MacAddr just as the one you shared in your comment: MacAddr([u8; 6]).
Replace instances of Option<String> with Option<MacAddr>
Make sure we can serialize it into its string representation
I think now its a good time to introduce such a change due to the improvement suggested on #37, a single major release could introduce both changes!
Looking into this. It seems winapi defines PhysicalAddress as [u8; 8] (8, instead of 6). The current linux code in your crate can also handle mac addresses of any size. The proposed type might be too restrictive to support all your currently supported platforms.
Looking into this. It seems winapi defines PhysicalAddress as [u8; 8] (8, instead of 6). The current linux code in your crate can also handle mac addresses of any size. The proposed type might be too restrictive to support all your currently supported platforms.
Yeah theres two main schemes for Mac Addresses, one being the EUI-48 and the second is the EUI-64 scheme.
Hi,
Currently, NetworkInterface's
mac_addr
member is aOption<String>
. It would be nice to have a simpleMacAddr
type, like:with a From<[u8; 6]> impl and an octets method that returns [u8; 6].
Since
mac_addr
currently uses a String, it's unclear if it's uppercase, lowercase, inxx:xx:xx:xx:xx:xx
format, or inxx-xx-xx-xx-xx-xx
format. This will make comparisons easier. I can attempt a pull request if you agree with the idea. ThanksThe text was updated successfully, but these errors were encountered: