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 func (v *VirtioNetworkDeviceConfiguration) GetMACAddress() string? #136

Open
cfergeau opened this issue Aug 22, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@cfergeau
Copy link
Contributor

Is your feature request related to a problem? Please describe.

https://developer.apple.com/documentation/virtualization/vznetworkdeviceconfiguration/3656653-macaddress?language=objc

The default value of this property is a random, locally administered, unicast address.

(I assume this is the same behaviour as calling NewRandomLocallyAdministeredMACAddress() explicitly)

I could not find a way to get the value of this default address

Describe the solution you'd like

This address is useful to know on the host as "/var/db/dhcpd_leases" can be parsed to do MAC address -> IP address look ups.
And the property is readwrite ( https://developer.apple.com/documentation/virtualization/vznetworkdeviceconfiguration/3656653-macaddress?language=objc ) so a getter in the go API would be nice to have

Describe alternatives you've considered

I'm suggesting this to make the API nicer, but it's easy to workaround with NewRandomLocallyAdministeredMACAddress()

@cfergeau cfergeau added the enhancement New feature or request label Aug 22, 2023
@Code-Hex
Copy link
Owner

Code-Hex commented Oct 9, 2023

@cfergeau I support APIs at the same level.

https://pkg.go.dev/github.com/Code-Hex/vz/v3#MACAddress.String

However, VirtioNetworkDeviceConfiguration not return MACAddress struct, So I think it better to support GetMACAddress() *MACAddress

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

2 participants