407 Commits

Author SHA1 Message Date
Jonathan Hui ecd4c92465 [dua] completely remove DUA features and configurations (#13191)
This commit removes the OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE feature
and all associated code, tests, CLI commands, and harness references.

Changes:
- Removed OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE definition and all
  assert/preprocessor checks.
- Completely deleted dua_manager.cpp and dua_manager.hpp.
- Removed DUA registration notifying and request URI paths.
- Cleaned up all references to Domain Unicast Address (DUA) across
  child management, notifier, time ticker, and MLE.
- Removed DUA commands and logic from the CLI and Python cert tests
  (including packet verifier).
- Verified that the entire codebase compiles clean and all tests
  successfully pass using the Nexus test suite.
2026-06-03 12:29:18 -07:00
Jonathan Hui 136bdb6e2a [dua] remove OPENTHREAD_CONFIG_DUA_ENABLE build feature (#13165)
This commit completely removes the local Domain Unicast Address (DUA)
registration feature flag (OPENTHREAD_CONFIG_DUA_ENABLE) and all of
its associated implementation, public APIs, CLI commands, Spinel
property handlers, and certification tests.

Thread 1.2 FTD Border Router/Router DUA proxying features for MTD
children (OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE) are preserved and
updated to only compile/instantiate components when proxy DUA
features are active.

Detailed Changes:
- Remove default definition of OPENTHREAD_CONFIG_DUA_ENABLE from
  misc.h.
- Remove OT_DUA and openthread_config_dua_enable from CMake/GN
  configs.
- Remove otThreadSetFixedDuaInterfaceIdentifier and
  otThreadGetFixedDuaInterfaceIdentifier from
  include/openthread/thread.h
  and implementation src/core/api/thread_api.cpp.
- Remove CLI DUA interpreter from src/cli/cli.cpp.
- Remove SPINEL_CAP_DUA capability and SPINEL_PROP_THREAD_DUA_ID
  Spinel property handlers and dispatchers from NCP.
- Strip local DUA management features (conflict checking, SLAAC DUA
  interface identifiers, and dad info settings) from DuaManager, MLE,
  Address Resolver, and settings.
- Clean up Notifier, TimeTicker, and TMF dispatcher guards.
- Clean up -DOT_DUA=ON compilation flags across build/test scripts.
- Delete obsolete DUA certification tests:
  - v1_2_test_domain_unicast_address
  - v1_2_test_domain_unicast_address_registration
  - v1_2_test_dua_handle_address_error
2026-06-01 15:16:19 -07:00
Abtin Keshavarzian 55b3adbf81 [docs] fix double 'the' typos across the codebase (#13176)
This commit fixes instances of "the the" typos found in various
files across the codebase, including documentation, headers, source
files, and test scripts.
2026-05-29 17:34:54 -07:00
Jonathan Hui 5265a0bf48 [bbr] remove Backbone Router DUA ND Proxying feature (#13136)
This commit removes all code, configurations, APIs, and tests related
to the OPENTHREAD_CONFIG_BACKBONE_ROUTER_DUA_NDPROXYING_ENABLE feature.

Specifically, the following changes were made:
- Removed DUA ND Proxying Backbone Router configuration option and the
  related OPENTHREAD_CONFIG_NDPROXY_TABLE_ENTRY_NUM definition.
- Removed CLI commands: `bbr mgmt dua` and the proactive backbone
  notification fake command `/b/ba`.
- Removed NdProxyTable and bbr_manager DUA ND Proxying implementation.
- Removed public/internal APIs for ND Proxying and proactive backbone
  notifications.
- Deleted ndproxy_table source files and unit tests.
- Simplified CMake and GN build files to remove deleted targets.
2026-05-23 07:57:57 -07:00
Jonathan Hui 4c9791cb9b [ci] clone ot-br-posix submodules recursively in CI/CD (#13130)
When cloning the ot-br-posix repository to run the Docker-in-Docker
integration tests, the clone was shallow and did not recursively
check out nested submodules (such as cJSON and cpp-httplib). This led
to build failures inside the Docker build container since libcjson
is not pre-installed on the base build image.

This commit resolves the issue by:
1. Appending the `--recurse-submodules` flag to the git-tool clone
   calls in `otbr-posix-dind.yml` and `script/test`.
2. Updating `script/git-tool`'s destination directory parsing to
   robustly handle multi-line output from recursive submodule
   checkouts. The new pattern extracts the path exclusively from
   the first line using `sed` to prevent SIGPIPE or parsing errors.
2026-05-21 15:34:05 -07:00
Yakun Xu 87fdaa6946 [simulation] add IPv6 loopback address support (#12828)
This commit adds support for IPv6 loopback address (::1) in the
simulation platform. When the local interface is set to the IPv6
loopback address, it uses the interface-local multicast group
(ff01::116) instead of the link-local group (ff02::116) for
node-to-node communication.

It also ensures that the `sin6_scope_id` is correctly set for the
loopback address in the transmission socket.
2026-05-07 07:37:40 -07:00
Jonathan Hui 8b9d39cdbf [github-actions] remove android-ndk platform and CI job (#12654)
This commit removes the `android-ndk` platform support from the
`script/cmake-build` script and deletes the associated CI job from
the GitHub Actions workflow.

The `android-ndk` build was used to verify OpenThread compatibility
with the Android NDK. However, since OpenThread is now officially
included in the Android platform, maintaining a separate NDK-based
build in this repository is no longer necessary.

Changes:
- Remove `android-ndk` from `OT_PLATFORMS` in `script/cmake-build`.
- Remove NDK-specific configuration logic in `script/cmake-build`.
- Remove the `android-ndk` job from `.github/workflows/build.yml`.
2026-03-09 20:04:35 -05:00
Kevin Zhao 06e2cdbf5c [github-actions] fix pwn-request vulnerability in size.yml workflow (#12625)
The size.yml workflow used pull_request_target with git checkout
FETCH_HEAD, which replaced the entire working directory (including
scripts) with untrusted fork code. Since pull_request_target grants
a read/write GITHUB_TOKEN even from public forks, and the workflow
had no top-level permissions restriction, this allowed arbitrary
code execution with write access to the repository.

Fix by:
1. Adding top-level permissions: contents: read (consistent with
   all other workflows in this repository).
2. Replacing `git checkout FETCH_HEAD` with a fetch-only approach
   that passes the PR merge commit SHA via the OT_SHA_NEW environment
   variable. The check-size script uses git-archive to extract code
   by SHA, so it does not need the working directory to be switched.
   This ensures ./script/check-size always runs from the base branch.
3. Updating check-size to accept OT_SHA_NEW from the environment,
   falling back to git rev-parse HEAD when not set (preserving
   existing behavior for push-triggered and local runs).
2026-03-05 16:27:33 -06:00
Abtin Keshavarzian 968ae74341 [tests] add timeout to cert suite execution (#12379)
Currently, the `run_cert()` function in `run_cert_suite.py` invokes
test scripts using `subprocess.check_call()` without a timeout. This
can cause the test suite to hang indefinitely if a test script fails
to terminate.

This commit updates `run_cert_suite.py` to support a configurable
`--timeout` argument. It passes this timeout to `check_call()` and
handles `subprocess.TimeoutExpired` to log failure and print output
upon timeout.

Additionally, this commit updates `script/test` to pass the
`TEST_TIMEOUT` environment variable to the test runner and updates
GitHub workflow configurations to define specific timeout values for
various test jobs.
2026-02-09 11:38:18 -08:00
Esko Dijk 12c80e8171 [script] fix to make 'run-clang-tidy' findable for 'make-pretty-clang' (#12373)
Required to get `make-pretty clang` working after the `bootstrap`
script, on Ubuntu 24.04.
2026-02-05 17:09:30 -08:00
Abtin Keshavarzian b3d3b5c3c7 [netdiag] require 'RD:' prefix for vendor name on reference devices (#12233)
When `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is active, this
change mandates that the vendor name string MUST begin with the "RD:"
prefix. This ensures that reference devices are clearly and
consistently identifiable through network diagnostic queries.

The enforcement is applied at two levels:

- A compile-time `static_assert` is added to validate the default
  `OPENTHREAD_CONFIG_NET_DIAG_VENDOR_NAME` at build time. This uses a
  new `constexpr` helper utility `CheckConstStringPrefix()`.

- A runtime check is added to `otThreadSetVendorName()`, which will
  now return `OT_ERROR_INVALID_ARGS` if an invalid name is provided
  on a reference device build.

All related test configurations (`scan-build`, `toranj`, `nexus`) and
CLI tests are updated to reflect this new requirement and validate
it.
2026-01-16 10:20:13 -08:00
Yang Song 61e2f2877d [posix] handle infra interface index change (#12059)
This change updates the netlink message handling for the infra link on
the POSIX platform to be more robust and efficient for `RTM_NEWLINK`
and `RTM_DELLINK` messages.

The logic for handling infra index changes is:

1. On `RTM_DELLINK`, the code verifies `ifinfo->ifi_index` is for the
currently infra index `mInfraIfIndex`.

2. On `RTM_NEWLINK`, it identifies the infra by its name
`if_indextoname(ifinfo->ifi_index)` and updates `mInfraIfIndex`.
2026-01-12 12:10:18 -08:00
Yakun Xu 6a9d92545b [gn] fix build with openthread_enable_core_config_args is false (#12265)
This commit fixes building with gn when
openthread_enable_core_config_args is false, which causes
openthread_config_tcp_enable undefined.
2026-01-08 11:19:40 -08:00
Yakun Xu c222f582b4 [gn] no propagating diagnostic flags (#12219)
This commit moves the diagnostic flags into the toolchain itself,
preventing these flags being propagated to OpenThread dependents.
2025-12-22 21:21:37 -08:00
Abtin Keshavarzian b5737b4f2b [script] add script to check, enforce, and update header guards (#12227)
This commit introduces a new script `update-header-guards.py` which
checks for the presence of header guards in `.h` and `.hpp` files and
automatically updates them, standardizing the header guard name format
across the codebase.

The new format for header guards is derived from the full path of the
file. For example, `src/core/common/notifier.hpp` will use
`OT_CORE_COMMON_NOTIFIER_HPP_`. The guard name includes additional
prefixes such as `OT_` or `OPENTHREAD_` to ensure uniqueness.

This new naming format handles cases where the same filename may be used
in different folders, such as the two `heap.hpp` files located in
`src/core/common` and `src/core/utils`.

It also ensures that public and platform OpenThread headers under
`include/openthread` have uniquely distinct header guard names to avoid
conflicts when these headers are included in other projects.

The new script helped identify issues with existing header files that
lacked header guards (e.g., `posix/system.hpp`) or had improper guards
(e.g., `openthread/link_metrics.h`).

This commit also introduces a new check script `check-header-guards` to
validate that all header guards are correctly formatted. This check is
added to the GitHub CI actions to ensure consistency moving forward.

All existing header files have been updated (using the new script)
to apply the new guard name format.
2025-12-22 13:43:41 -08:00
Yakun Xu f38c0a6774 [build] clean intermediates on GitHub actions (#12204)
This commit enhances the build process by introducing a mechanism to
automatically clean intermediate build artifacts. Specifically, it
configures the build script to remove object and archive files, a
process that is conditionally activated, primarily within GitHub
Actions workflows, to optimize build environments and manage disk
space more efficiently.
2025-12-17 08:05:00 -08:00
Yakun Xu a3b8361a19 [simulation] set virtual UART at runtime (#12199)
This commit changes the virtual UART to be configured at runtime, which
eliminates a build variants, which causes code coverage process problem.
2025-12-09 08:48:37 -08:00
Li Cao d7fe525415 [github-actions] disable Discovery Proxy in the otbr Backbone CI (#12195)
This commit disables Discovery Proxy in otbr Backbone CI.

Because in this item, `BORDER_ROUTING` is explicitly disabled and it
is required by OT discovery proxy.

This commit removes `"-DOTBR_DNS_UPSTREAM_QUERY=ON"` in build script
because this option will automatically handled in the cmake options
file and it also depends on BORDER_ROUTING. Force it to be ON will
cause a conflict when BORDER_ROUTING is OFF.
2025-12-04 08:24:35 -08:00
Yakun Xu 0fb573177c [style] upgrade yapf to the latest version (#12169)
This commit upgrades yapf which fixes the issue of deprecated lib2to3.
2025-11-19 08:14:33 -08:00
Yakun Xu 372fe4fbf1 [iwyu] fix IWYU public header checker (#12132)
This commit fixes the issue failing to catch headers would cause
iwyu to exit with errors.
2025-11-12 09:19:43 +01:00
Li Cao 02295b035f [mbedtls] change mbedtls to git submodule (#12107)
This commit changes the mbedtls repo in openthread from source code to
git submodule.

This makes it easier for mbedtls version upgrade. This PR doesn't
upgrade the mbedtls version. v.3.6.0 is stil used to ensure nothing is
broken. The original OT specific build files (BUILD.gn, CMakeLists.txt
and config) are kept and unchanged. I've verified that the headers and
sources in the list of BUILD.gn are correct.
2025-11-12 08:10:56 +01:00
Jonathan Hui 09fc123cd0 [github-actions] remove code spell check (#12027)
Rely on AI-based code review tools instead.
2025-10-11 12:27:19 -07:00
Zhanglong Xia 4cb0de4233 [p2p] add initial peer-to-peer support (#11494)
This commit implements a minimum P2P which only supports
sending/receiving wake-up frames and establishing P2P links between
rx-on-when-idle devices.
2025-09-02 10:12:13 -07:00
Jonathan Hui 19b5bfedbf [script] fix typo in license header (#11811) 2025-08-12 18:19:41 -07:00
Li Cao 318006e4da [format] standardize clang-format to 19.1.7 (#11797)
Since llvm-19, if we use package manager to install it, the minor
versions could be different. This commit standardizes the version on
linux to 19.1.7. This version is the same as the one installed by
homebrew.
2025-08-12 11:20:30 -07:00
Jason Zhang 5e04b4e261 [cmake] fix SRP server fast start mode option typo (#11798)
fix misspelled `OT_SRP_SERVER_FAST_START_MODE` build option
2025-08-08 10:36:55 -07:00
Li Cao 8dadae2ea1 [format] upgrade clang-format to 19 (#11783)
We just updated the version from 14 to 16. But very unfortunately
clang-format-16 was just deprecated recently. So this time we update
the version to the latest available one. There are newer releases than
19 (like 20) but as I tested, sudo apt-get install -y clang-format-19
can work while 20 doesn't work.

misc-include-cleaner in clang-tidy-19 exerts a very strict check which
requires to directly include all headers for every symbols in the
source file. However in our current code we intentionally use some
indirect include. So this commit disables misc-include-cleaner.
2025-08-06 10:49:52 -07:00
Li Cao 34bb0e4ab1 [test] remove the node type rcp-ncp (#11752)
The type `rcp-ncp` was meant to run nodes of NCP on posix. But we
don't have NCP on posix anymore. So this can be removed.
2025-07-28 11:20:43 -07:00
Yakun Xu 2f1183f387 [git-tool] do not use GITHUB_TOKEN (#11730)
This commit stops using GITHUB_TOKEN in git-tool for better security.
2025-07-16 07:11:17 -07:00
Yakun Xu d4734df8bb [size-report] checkout pull request head (#11724) 2025-07-15 10:48:46 -07:00
Yakun Xu f4e239e651 [size-report] migrate to GitHub Actions (#11681) 2025-07-14 16:01:32 -07:00
Li Cao 6c6e99ee7c [style] upgrade clang-format and clang-tidy from 14 to 16 (#11682) 2025-07-10 18:19:26 -07:00
Abtin Keshavarzian a495a2284b [otns] make various enhancements to Otns (#11643)
This commit contains various enhancements to the `Otns` class:

- Makes `Otns` methods non-static. This aligns their use with the
  clang-tidy `readability-static-accessed-through-instance` check,
  which disallows accessing static methods through an instance.
- Updates the `make-pretty` script to enable OTNS and include it in
  `clang-tidy` checks.
- Adds a stub implementation of `otPlatOtnsStatus()` in the simulation
  and fake platforms. This allows the OTNS feature to be enabled in
  `make-pretty` builds and covered by GitHub Action CI checks.
- Simplifies the `EmitStatus` methods to use the `String` class for
  constructing the status string.
- Adds a new helper method to construct the CoAP status string,
  removing duplicated code.
2025-06-30 14:39:30 -07:00
Yakun Xu 6b03321cb2 [style] apply IWYU to public headers (#11580)
It would be easier to use OpenThread public headers if they are
self-contained and follows the IWYU style guide. This commit fixes some
style issues to make the public headers self-contained and IWYU. The
existing pretty check is also extended to verify the OpenThread public
headers are self-contained and follows IWYU.
2025-06-11 06:37:41 +09:00
Yakun Xu 1662ca8001 [simulation] add reliable virtual time transport (#11029)
This commit adds a reliable transport based on SEQPACKET unix socket to
simulation platform and use this for tests on simulation platform.
2025-06-04 23:32:25 -07:00
Jonathan Hui 37b417a3ee [test] update OTBR Dockerfile path (#11390) 2025-04-02 10:14:33 -07:00
xusiyu 036256729c [spinel] add coprocessor reset failure callback (#11284)
Add a coprocessor reset failure callback to handle the coprocessor
reset failure instead of letting the program crash directly.
2025-03-24 08:49:27 -07:00
Yakun Xu 8c23a588ca [script] install gtest and gmock (#11358) 2025-03-24 08:29:53 -07:00
Abtin Keshavarzian babbccd4c6 [srp-server] introduce "fast start mode" feature (#11305)
This commit adds "Fast Start Mode" feature for SRP server. This
feature is designed for scenarios where a device, often a mobile
device, needs to act as a provisional SRP server (e.g., functioning
as a temporary Border Router). The SRP server function is enabled
only if no other Border Routers are already providing the SRP
service within the Thread network. A common use case is a mobile
device joining a Thread network where it may be the first, or only,
BR. Importantly, Fast Start Mode allows the device to quickly start
its SRP server functionality upon joining the network, allowing other
Thread devices to quickly connect and register their services without
the typical delays associated with standard Border Router
initialization and SRP server startup (using NetData Publisher).
2025-02-28 13:49:30 -08:00
Li Cao 33a1f09569 [test] fix socat version to 1.7.4.4 (#11243)
This commit changes the installation of socat from using 'apt' to
manual installation.

We found the latest socat version 1.8.0.3 has an issue when running
with OTBR docker. To avoid the error caused by version and facilitate
local development, the commit provides a script to install socat of
version 1.7.4.4 and replaces the installation in CI and scripts..

We add the install script in openthread and ot-br-posix will use the
script in openthread to install socat.
2025-02-25 07:48:18 -08:00
Yakun Xu 7bd3abd67b [script] allow specify old commit for check-size (#11147) 2025-01-10 09:41:56 -08:00
Yakun Xu b6a7f076c2 [script] enhance check-size for local use (#11116)
This simplifies doing local check by enhancing the script to accept
extra cmake options and specifying the commit to compare.

Example usage:

```bash
OT_SHA_OLD=e4a390f34 ./script/check-size nrf52840 -DOT_FULL_LOGS=ON
```
2025-01-06 16:20:04 -08:00
Jonathan Hui ff19e03afa [scripts] SC2317: command appears to be unreachable (#10821) 2024-10-11 20:45:56 -07:00
Jonathan Hui f3715b4596 [check-size] SC2004: $/${} is unnecessary on arithmetic variables (#10820) 2024-10-11 13:38:40 -07:00
Song GUO 7cd179e23a [routing-manager] stop PD if there is another prefix with higher preference in netdata (#10289)
This commit adds a new IDLE state to PdPrefixManager.

PdPrefixManager enters idle state when PD is enabled and there is
already a BR requesting PD prefix. When there are multiple BRs
publishing PD prefix at the same time, the one with lexcial smaller
prefix wins.
2024-09-29 23:27:30 -07:00
Damian Królik bc50521cfa [mac] multipurpose wake-up frame support (#10728)
1. Add OT_WAKEUP_COORDINATOR and OT_WAKEUP_END_DEVICE build
   options.
2. Add support for parsing and constructing 802.15.4
   Multipurpose frames.
3. Add support for parsing and constructing wake-up
   frames.
2024-09-23 09:02:15 -07:00
Jonathan Hui 2f51cababf [github-actions] migrate version 1.3 checks to 1.4 (#10694) 2024-09-11 07:25:32 -07:00
Yakun Xu c0690e78fc [build] set default Thread version to 1.4 (#10690)
This commit updates the default Thread version to 1.4, so that most
latest features will be enabled by default. This commit also explicitly
enable the epskc feature just like other features in the build script.
2024-09-10 13:39:38 -07:00
Li Cao c36c0ed760 [ncp] add NCP based implementation (empty) of platform InfraIf APIs (#10638)
This implementation will be used on all platforms for NCP nodes
(simulation, any vendor platforms). However the simulation platform
already has a different implementation. To avoid conflicts, the commit
adds a control flag in simulation config so that we can choose whether
to enable the simulation implementation.
2024-09-04 07:48:59 -07:00
Yakun Xu 706013fa7b [git-tool] explicit disable rebase (#10645)
This commit adds `--no-rebase` to `git` command when applying
dependencies because recent git versions doesn't have a default rebase
strategy anymore.
2024-08-27 19:58:17 -07:00