-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
include, misc: Add net interface API. #1371
Conversation
@bnoordhuis Should anyone else be pulled in on this? Or is it okay to move forward with this and start opening up PRs for the individual platform support? |
I am ok with this. In retrospect, it should have been this way from the beginning 👍 |
I think I'd rather have it for v2, that is, targeted at master. If this is to replace the old API we can remove it there. WDYT? |
It's useful enough IMO that I'd be okay with targeting v1. I'll review the code. |
@apaprocki @zenoamaro Are you still interested in pursuing this? |
@bnoordhuis Yes, just haven't had the time to loopback (ha ha) to this. |
If the plan is still to eventually implement |
@apaprocki what's the status of this, do you plan to continue this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know if this PR is still in play or not (after 18 months), but here are some suggestions...
|
||
|
||
void uv_free_network_interfaces(uv_network_interface_t* interfaces, int count) { | ||
int i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the domain of i
is positive numbers, I'd make this an unsigned
here and elsewhere below.
I'd do the same for count
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pprindeville I preserved the same API semantics as the other existing platform APIs. This also allows the new functions to plug right into the existing test driver without declaring a new variable. I'm open to changing this, but not sure why this one API should differ from the others.
Closing the PR because it seems to be stalled. Feel free to reopen if anyone wants to continue working on this. |
Oops, this is libuv, and I'm not a collaborator 😅 Weird how we take things for granted. @cjihrig help? |
98643ca
to
b4313a5
Compare
@bnoordhuis I had time to revisit this and I changed a lot of it...
A lot of this is still opinionated, so please re-review and let me know what direction it should take. I test implemented the BSD version of this on my Mac and verified it works as expected: e.g.
|
b4313a5
to
abf1a7c
Compare
Adds `uv_network_interface_t` structure and a new API for retrieving network interfaces, `uv_network_interfaces`. This new API intends to eventually replace `uv_interface_addresses`, adding new capabilities, such as: * Not filtering out interfaces without addresses; * Marking missing addresses as `AF_UNSPEC`; * Including all common cross-platform flags; * Including link-layer addresses for interfaces; * Supporting 8-byte Firewire link-layer addresses; * Including broadcast/point-to-point addresses The interface is added and documented, and returns `UV_ENOTSUP` on all platforms. Once the individual platform support is merged, the test driver will no longer accept the `UV_ENOTSUP` return and the existing `uv_interface_addresses` function will be changed to be implemented on top of this new API.
abf1a7c
to
f8f55c8
Compare
@bnoordhuis I rebased this again. I think if there's actually a v2 in the works, it would be good to include the new API if this is desired. |
Any opinion on including the |
Is there any progress on this? |
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. |
1 similar comment
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. |
Hello! In Node.js we'd like to have this in order to close nodejs/node#498. |
How can we get this move forward? This has been blocked on Node.js since more than 5 years ago... |
Building on the work done by @zenoamaro, per +1'd approach laid out in #219, this PR lands the new interface without modifying any existing code to depend on it. All platforms return
-ENOTSUP
initially and the test driver skips the test if-ENOTSUP
is returned. Once all platforms have been implemented in subsequent PRs, the test will change to be required and the documentation note will be removed and existing code such asuv_interface_addresses
can then change to rely on the new API.CC: @bnoordhuis @saghul