-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Adding uv_interfaces
to retrieve the complete list of interfaces.
#158
Comments
The functionality of both looks too close not to try to unify them. How about this:
Now, as @bnoordhuis pointed out in nodejs/node#498 the patch will be tedious because it has to be implemented for every Unix system we support, ideally without a ton of code duplication. It shouldn't be too hard though. |
Some thoughts about the interface for this:
|
Is libuv becomming a custom glibc implementation? |
@txdv, it's basically the same as it is now, minus some filtering and plus a few fields. |
I was just kidding ;) |
It would be a valid concern, though. I'm trying to avoid just stuffing all of |
I think I'm in favor of the suggested API. |
Yeah.
We currently have the physical address for all interfaces. It would be nice to keep that. Currently we don't have a phys_addr_len field, is it needed? Is there any physical address which has embedded nulls?
But tun interfaces do have an IP address, can't we get that? Either way, if there is no AF_INET/6 address we can just set the family to AF_UNSPEC.
Yeah, looks good! (look at my comments from above). Now, what libuv version should we be targetting? |
I'm fine with that, even though it kinda feels redundant.
Firewire devices would end up included in the output now (as regular ip devices), and they have 8 bytes of physical address. This is how
We can, it's just that they have a NULL Anyway, I'll draft a pull request with an initial implementation, and some tests, and we'll see where that takes us. |
Yeah. My point is that we don't really nee dthe length if we null terminate the buffer properly, do we?
That's fine.
Sure! |
How would we store an address like |
Gotcha, go ahead with the length :-) |
Well, to be honest I don't like this solution very much too. I'd rather use a standard |
Adding async.h to the README.
@zenoamaro I agree with @saghul that just because |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
BTW, IPsec, IP-in-IP and GRE tunnels would only ever have a layer 3 address, since they are software abstractions at the IP layer. |
Can we get this reopened? It looked like we had consensus on the API. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
almost 8 year passed, any progress? |
Yes, actually. #2033 (broadcast address) was merged to the master branch two weeks ago. Everything else is still up for grabs. |
Currently libuv provides a list of all addresses assigned to network interfaces on
uv_interface_addresses
, but this is limited to up and running interfaces having inet addresses, and as such there's no way to recover a full list of interfaces from it. This would benefit users like node, and in fact follows from nodejs/node#498.I'm proposing the addition of
uv_interfaces
(anduv_free_interfaces
), implemented similarly touv_interface_addresses
, returning a list of all visible interfaces, with or without link-level details depending on the platform, but without the addresses. I'd submit a PR for this myself, but as this would be an API change I'm waiting to hear what's the opinion on this change.Also, implementing this on linux and bsds should be quite straightforward, but I'm not equally accustomed to the other platforms, so it would be great if someone could chime in with possible cross-platform concerns.
The text was updated successfully, but these errors were encountered: