-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Darwin][Network.framework] Update the interface monitor such that it… #38983
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
[Darwin][Network.framework] Update the interface monitor such that it… #38983
Conversation
… returns a nw_interface_t instead of the interface index
PR #38983: Size comparison from 9189b28 to 19d2150 Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
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.
Pull Request Overview
This PR updates the InterfacesMonitor API to return nw_interface_t objects instead of numeric interface indices so that callers can access properties directly from the nw_interface_t.
- Replaced numeric interface IDs with nw_interface_t across InterfacesMonitor and DnssdHostNameRegistrar.
- Updated logging and address retrieval functions to use nw_interface_get_index() for consistency.
- Adjusted type definitions in the header files to support the new nw_interface_t based API.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/platform/Darwin/inet/InterfacesMonitor.mm | Updated LogDetails, GetInterfaceAddresses, and monitor creation to use nw_interface_t. |
src/platform/Darwin/inet/InterfacesMonitor.h | Changed InetInterface and Inet6Interface typedefs and declared new utility functions. |
src/platform/Darwin/DnssdHostNameRegistrar.h | Updated interface registration to extract the index from nw_interface_t. |
Comments suppressed due to low confidence (1)
src/platform/Darwin/inet/InterfacesMonitor.h:51
- The parameter name 'searchLoopBackOnly' in the header differs in casing from its implementation ('searchLoopbackOnly'). Standardizing the naming will improve clarity and consistency.
void EnumeratePathInterfaces(nw_path_t path, InetInterfacesVector & out4, Inet6InterfacesVector & out6, bool searchLoopBackOnly);
fast track: platform-specific changes made by platform maintainer. |
… returns a nw_interface_t instead of the interface index (project-chip#38983)
… returns a nw_interface_t instead of the interface index
The
Network.framework
only usesnw_interface_t
objects—you can’t round-trip back to anw_interface_t
from a numeric index. This change updates ourInterfacesMonitor
API so that it hands callers the actualnw_interface_t
(and lets them extract name, index, type, etc.) rather than a bare index.Testing
Our CI pipeline verifies that this change works as intended.