Skip to content

[net] move slaac module from utils to net - #11955

Merged
jwhui merged 1 commit into
openthread:mainfrom
abtink:ip6/slaac-move-file
Sep 23, 2025
Merged

[net] move slaac module from utils to net#11955
jwhui merged 1 commit into
openthread:mainfrom
abtink:ip6/slaac-move-file

Conversation

@abtink

@abtink abtink commented Sep 22, 2025

Copy link
Copy Markdown
Member

This commit moves the SlaacAddress module from src/core/utils to src/core/net.

This change also updates the namespace from ot::Utils to ot::Ip6 and updates all includes and usages throughout the codebase.

The SlaacAddress module was originally placed in core/utils as SLAAC management was historically handled by the platform. Now that the OpenThread stack manages SLAAC directly, this logic is better placed under core/net.

This commit moves the `SlaacAddress` module from `src/core/utils`
to `src/core/net`.

This change also updates the namespace from `ot::Utils` to
`ot::Ip6` and updates all includes and usages throughout the
codebase.

The `SlaacAddress` module was originally placed in `core/utils`
as SLAAC management was historically handled by the platform.
Now that the OpenThread stack manages SLAAC directly, this logic
is better placed under `core/net`.
@github-actions

Copy link
Copy Markdown

Merging #11955 into main

name branch text data bss total
ot-cli-ftd 466fdb8 479704 860 66580 547144
d4ae270 479688 860 66580 547128
+/- -16 +0 +0 -16
ot-ncp-ftd 466fdb8 446236 764 61824 508824
d4ae270 446236 764 61824 508824
+/- +0 +0 +0 +0
ot-cli-mtd 466fdb8 372432 764 51052 424248
d4ae270 372432 764 51052 424248
+/- +0 +0 +0 +0
ot-ncp-mtd 466fdb8 353580 764 46320 400664
d4ae270 353580 764 46320 400664
+/- +0 +0 +0 +0
ot-cli-ftd-br 466fdb8 582080 868 136404 719352
d4ae270 582080 868 136404 719352
+/- +0 +0 +0 +0
ot-rcp 466fdb8 63136 568 20804 84508
d4ae270 63136 568 20804 84508
+/- +0 +0 +0 +0
Library files
name branch text data bss total
libopenthread-ftd.a 466fdb8 246914 95 40358 287367
d4ae270 246914 95 40358 287367
+/- +0 +0 +0 +0
libopenthread-cli-ftd.a 466fdb8 60843 0 8083 68926
d4ae270 60843 0 8083 68926
+/- +0 +0 +0 +0
libopenthread-ncp-ftd.a 466fdb8 33561 0 5948 39509
d4ae270 33561 0 5948 39509
+/- +0 +0 +0 +0
libopenthread-mtd.a 466fdb8 165279 0 24854 190133
d4ae270 165279 0 24854 190133
+/- +0 +0 +0 +0
libopenthread-cli-mtd.a 466fdb8 41134 0 8059 49193
d4ae270 41134 0 8059 49193
+/- +0 +0 +0 +0
libopenthread-ncp-mtd.a 466fdb8 25805 0 5948 31753
d4ae270 25805 0 5948 31753
+/- +0 +0 +0 +0
libopenthread-ftd-br.a 466fdb8 350843 100 110150 461093
d4ae270 350843 100 110150 461093
+/- +0 +0 +0 +0
libopenthread-cli-ftd-br.a 466fdb8 78523 0 8115 86638
d4ae270 78523 0 8115 86638
+/- +0 +0 +0 +0
libopenthread-rcp.a 466fdb8 9944 0 5060 15004
d4ae270 9944 0 5060 15004
+/- +0 +0 +0 +0
libopenthread-radio.a 466fdb8 19407 0 238 19645
d4ae270 19407 0 238 19645
+/- +0 +0 +0 +0

@abtink

abtink commented Sep 22, 2025

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly moves the SlaacAddress module from src/core/utils to src/core/net, which is a more logical location for this functionality given its direct relation to networking. The namespace is also appropriately updated from ot::Utils to ot::Ip6. All changes, including updates to build files and usages throughout the codebase, have been applied consistently. The refactoring is clean and well-executed, and I have no further comments.

@codecov

codecov Bot commented Sep 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.78%. Comparing base (466fdb8) to head (6146922).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/core/api/ip6_api.cpp 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11955      +/-   ##
==========================================
- Coverage   75.37%   73.78%   -1.59%     
==========================================
  Files         653      656       +3     
  Lines       93494   104026   +10532     
==========================================
+ Hits        70467    76759    +6292     
- Misses      23027    27267    +4240     
Files with missing lines Coverage Δ
src/core/common/notifier.cpp 92.30% <100.00%> (+0.50%) ⬆️
src/core/common/settings.hpp 98.19% <ø> (+0.06%) ⬆️
src/core/instance/instance.hpp 65.36% <100.00%> (+31.64%) ⬆️
src/core/net/ip6.hpp 69.56% <ø> (ø)
src/core/net/slaac_address.cpp 77.77% <100.00%> (ø)
src/core/net/slaac_address.hpp 81.25% <ø> (ø)
src/core/thread/dua_manager.cpp 70.35% <100.00%> (-10.53%) ⬇️
src/core/thread/network_data_leader.cpp 92.28% <100.00%> (-2.79%) ⬇️
src/core/api/ip6_api.cpp 74.28% <0.00%> (+9.52%) ⬆️

... and 292 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@abtink
abtink marked this pull request as ready for review September 22, 2025 17:34
@jwhui
jwhui requested a review from Copilot September 22, 2025 18:21

Copilot AI left a comment

Copy link
Copy Markdown

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 moves the SlaacAddress module from src/core/utils to src/core/net to better reflect its purpose within the OpenThread stack's network layer, updating the namespace from ot::Utils to ot::Ip6.

  • Updates namespace from ot::Utils::Slaac to ot::Ip6::Slaac throughout codebase
  • Moves SLAAC module files from utils directory to net directory
  • Updates all include statements and references to use the new location and namespace

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/core/thread/network_data_leader.cpp Updates namespace reference from Utils::Slaac to Ip6::Slaac
src/core/thread/dua_manager.cpp Updates namespace reference from Utils::Slaac to Ip6::Slaac
src/core/net/slaac_address.hpp Changes namespace from Utils to Ip6, removes Ip6:: prefixes from types now in same namespace
src/core/net/slaac_address.cpp Changes namespace from Utils to Ip6, removes Ip6:: prefixes for local types
src/core/net/ip6.hpp Adds core-ip6-slaac to documentation groups
src/core/instance/instance.hpp Updates include path and type references for moved SLAAC module
src/core/common/settings.hpp Updates include path and type reference for SLAAC secret key
src/core/common/notifier.cpp Updates namespace reference from Utils::Slaac to Ip6::Slaac
src/core/api/ip6_api.cpp Updates namespace references from Utils::Slaac to Ip6::Slaac
src/core/CMakeLists.txt Moves slaac_address.cpp from utils to net directory in build
src/core/BUILD.gn Moves slaac_address source files from utils to net directory

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jwhui
jwhui merged commit 27932f2 into openthread:main Sep 23, 2025
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants