8000 [Darwin][Network.framework] Update the interface monitor such that it… by vivien-apple · Pull Request #38983 · project-chip/connectedhomeip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Conversation

vivien-apple
Copy link
Contributor

… returns a nw_interface_t instead of the interface index

The Network.framework only uses nw_interface_t objects—you can’t round-trip back to a nw_interface_t from a numeric index. This change updates our InterfacesMonitor API so that it hands callers the actual nw_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.

… returns a nw_interface_t instead of the interface index
Copy link
github-actions bot commented May 15, 2025

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)
platform target config section 9189b28 19d2150 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1102160 1102160 0 0.0
RAM 179010 179010 0 0.0
bl702 lighting-app bl702+eth FLASH 655410 655410 0 0.0
RAM 134977 134977 0 0.0
bl702+wifi FLASH 832916 832916 0 0.0
RAM 124525 124525 0 0.0
bl706+mfd+rpc+littlefs FLASH 1065448 1065448 0 0.0
RAM 117365 117365 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 894630 894630 0 0.0
RAM 105660 105660 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 978728 978728 0 0.0
RAM 109860 109860 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 820724 820724 0 0.0
RAM 120232 120232 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 830768 830768 0 0.0
RAM 125376 125376 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 778472 778472 0 0.0
RAM 113780 113780 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 762780 762780 0 0.0
RAM 113988 113988 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 549050 549050 0 0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 580306 580306 0 0.0
RAM 205392 205392 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 661845 661845 0 0.0
RAM 77236 77236 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 681697 681697 0 0.0
RAM 79876 79876 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 681697 681697 0 0.0
RAM 79876 79876 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 638629 638629 0 0.0
RAM 72304 72304 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 623141 623141 0 0.0
RAM 73540 73540 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 642769 642769 0 0.0
RAM 76092 76092 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 642769 642769 0 0.0
RAM 76092 76092 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 642541 642541 0 0.0
RAM 76540 76540 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 662257 662257 0 0.0
RAM 79092 79092 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 662257 662257 0 0.0
RAM 79092 79092 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618777 618777 0 0.0
RAM 70644 70644 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 638629 638629 0 0.0
RAM 73276 73276 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 638629 638629 0 0.0
RAM 73276 73276 0 0.0
efr32 lock-app BRD4187C FLASH 945268 945268 0 0.0
RAM 132028 132028 0 0.0
BRD4338a FLASH 771384 771376 -8 -0.0
RAM 173256 173256 0 0.0
window-app BRD4187C FLASH 1037344 1037344 0 0.0
RAM 128164 128164 0 0.0
esp32 all-clusters-app c3devkit DRAM 103336 103336 0 0.0
FLASH 1805970 1805970 0 0.0
IRAM 83846 83846 0 0.0
m5stack DRAM 121948 121948 0 0.0
FLASH 1771134 1771134 0 0.0
IRAM 117043 117043 0 0.0
linux air-purifier-app debug unknown 4848 4848 0 0.0
FLASH 2787158 2787158 0 0.0
RAM 115048 115048 0 0.0
all-clusters-app debug unknown 5656 5656 0 0.0
FLASH 6341228 6341228 0 0.0
RAM 533192 533192 0 0.0
all-clusters-minimal-app debug unknown 5528 5528 0 0.0
FLASH 5447098 5447098 0 0.0
RAM 225128 225128 0 0.0
bridge-app debug unknown 5560 5560 0 0.0
FLASH 4763536 4763536 0 0.0
RAM 204768 204768 0 0.0
camera-app debug unknown 8856 8856 0 0.0
FLASH 6885611 6885611 0 0.0
RAM 226296 226296 0 0.0
camera-controller debug unknown 9240 9240 0 0.0
FLASH 14310059 14310059 0 0.0
RAM 658448 658448 0 0.0
chip-tool debug unknown 6256 6256 0 0.0
FLASH 14591745 14591745 0 0.0
RAM 645184 645184 0 0.0
chip-tool-ipv6only arm64 unknown 40328 40328 0 0.0
FLASH 12572768 12572768 0 0.0
RAM 691472 691472 0 0.0
fabric-admin debug unknown 5936 5936 0 0.0
FLASH 12669131 12669131 0 0.0
RAM 644544 644544 0 0.0
fabric-bridge-app debug unknown 4808 4808 0 0.0
FLASH 4580470 4580470 0 0.0
RAM 190800 190800 0 0.0
fabric-sync debug unknown 5064 5064 0 0.0
FLASH 5720949 5720949 0 0.0
RAM 486672 486672 0 0.0
lighting-app debug+rpc+ui unknown 6264 6264 0 0.0
FLASH 5642321 5642321 0 0.0
RAM 207256 207256 0 0.0
lock-app debug unknown 5496 5496 0 0.0
FLASH 4815838 4815838 0 0.0
RAM 194568 194568 0 0.0
ota-provider-app debug unknown 4848 4848 0 0.0
FLASH 4439486 4439486 0 0.0
RAM 183888 183888 0 0.0
ota-requestor-app debug unknown 4800 4800 0 0.0
FLASH 4567218 4567218 0 0.0
RAM 187760 187760 0 0.0
shell debug unknown 4272 4272 0 0.0
FLASH 3080444 3080444 0 0.0
RAM 148216 148216 0 0.0
thermostat-no-ble arm64 unknown 9624 9624 0 0.0
FLASH 4226640 4226640 0 0.0
RAM 230968 230968 0 0.0
tv-app debug unknown 5832 5832 0 0.0
FLASH 6076869 6076869 0 0.0
RAM 611112 611112 0 0.0
tv-casting-app debug unknown 5416 5416 0 0.0
FLASH 12783501 12783501 0 0.0
RAM 765680 765680 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 919716 919716 0 0.0
RAM 167334 167334 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 911584 911584 0 0.0
RAM 145578 145578 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 856944 856944 0 0.0
RAM 141097 141097 0 0.0
nxp contact k32w0+release FLASH 592312 592312 0 0.0
RAM 72856 72856 0 0.0
mcxw71+release FLASH 625144 625144 0 0.0
RAM 63196 63196 0 0.0
light k32w0+release FLASH 618260 618260 0 0.0
RAM 72152 72152 0 0.0
k32w1+release FLASH 709696 709696 0 0.0
RAM 72044 72044 0 0.0
lock mcxw71+release FLASH 774744 774744 0 0.0
RAM 67628 67628 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1665996 1665996 0 0.0
RAM 212336 212336 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1570508 1570508 0 0.0
RAM 208520 208520 0 0.0
light cy8ckit_062s2_43012 FLASH 1445972 1445972 0 0.0
RAM 197232 197232 0 0.0
lock cy8ckit_062s2_43012 FLASH 1475980 1475980 0 0.0
RAM 224952 224952 0 0.0
qpg lighting-app qpg6105+debug FLASH 667292 667292 0 0.0
RAM 105172 105172 0 0.0
lock-app qpg6105+debug FLASH 625672 625672 0 0.0
RAM 99808 99808 0 0.0
stm32 light STM32WB5MM-DK FLASH 465020 465020 0 0.0
RAM 141424 141424 0 0.0
telink bridge-app tl7218x FLASH 693920 693920 0 0.0
RAM 101844 101844 0 0.0
light-app-ota-compress-lzma-factory-data tl3218x FLASH 773306 773306 0 0.0
RAM 49996 49996 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 780412 780412 0 0.0
RAM 109168 109168 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 702680 702680 0 0.0
RAM 62560 62560 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 740634 740634 0 0.0
RAM 85732 85732 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606734 606734 0 0.0
RAM 119384 119384 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 815722 815726 4 0.0
RAM 107436 107436 0 0.0
tizen all-clusters-app arm unknown 5224 5224 0 0.0
FLASH 1813648 1813648 0 0.0
RAM 94908 94908 0 0.0
chip-tool-ubsan arm unknown 20600 20600 0 0.0
FLASH 20823774 20823774 0 0.0
RAM 9060300 9060300 0 0.0

@woody-apple woody-apple requested a review from Copilot May 16, 2025 00:54
Copy link
Contributor
@Copilot Copilot AI left a 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);

@vivien-apple
Copy link
Contributor Author

fast track: platform-specific changes made by platform maintainer.

@vivien-apple vivien-apple merged commit d4d9df6 into project-chip:master May 16, 2025
71 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in [Platform] Darwin May 16, 2025
heinsaar pushed a commit to heinsaar/connectedhomeip that referenced this pull request May 19, 2025
… returns a nw_interface_t instead of the interface index (project-chip#38983)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0