Skip to content
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

[pull] main from openthread:main #15

Open
wants to merge 1,879 commits into
base: main
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Jul 20, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Jul 20, 2022
@jwhui jwhui force-pushed the main branch 2 times, most recently from f847bfb to 3d5cb36 Compare July 1, 2023 14:40
Irving-cl and others added 27 commits September 23, 2024 08:38
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.
)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@834a144...5076954)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit adds a version command to cp-caps to get the current version.
And we release the current version of cp-caps as 0.1.0.
This commit enhances how ephemeral key timeout is used. If the timeout
expires while a commissioner or commissioner candidate is connected,
the session will be terminated. The Border Agent (BA) will then stop
using the ephemeral key and revert to using PSKc.

The ephemeral key timeout timer starts when the ephemeral key is set
on the BA. During this timeout interval, the ephemeral key can be
used only once by an external commissioner to establish a secure
connection.
…10749)

The commit extends `SPINEL_PROP_INFRA_IF_SETUP` to
`SPINEL_PROP_INFRA_IF_STATE` so that it can be used to either do infra
if setup (trigger border routing starting on NCP) or synchronize infra
if state to the NCP (ON/OFF state, IP addresses).

The current implementation on NCP will compare the `InfraIfIndex`. If
the index is different the value on NCP, it will be regarded as an
initialization or change of InfraIf. Thus the border routing module
will be re-initialized.
This commit adds the Thread Domain Name TLV (59) to the MLE Discovery
Response message. The TLV is only included if not equal to
'DefaultDomain', as per Thread 1.4 spec Section 8.4.4.1.1.2.  Also,
the TLV is only included for Thread 1.4 or higher builds.  This is
because for Thread < 1.4 the inclusion of this TLV was only specified
for CCM devices. Thread 1.4 changed this: the TLV is now included if
the domain name is not equal to the default name "DefaultDomain"
specified in Section 5.22.

The purpose of including the domain name is to allow discovery of
Thread Networks that belong to the same domain that the Joiner is part
of. This is used by any commissioning methods where the Thread device
can roam e.g. CCM/CCM-light or other (future) methods.
This commit improves how MTD children register their IPv6 addresses
with their parent. The `Slaac` class now tracks the Lowpan Context
ID (from Network Data) for each SLAAC address. If the Context ID
associated with an existing SLAAC address changes (due to Network
Data updates), the `Slaac` module notifies the `Mle` to schedule
a "Child Update Request" transmission (if the device is an MTD
child). This ensures that the MTD child re-registers its addresses,
resolving any previous registration failures caused by incorrect or
outdated context ID compression.

This commit also adds `test-035-context-id-change-addr-reg.py`
to validate the newly added behavior.
This commit introduces the `DelayedSender` nested class within `Mle`
to handle delayed MLE message transmissions, such as delayed
responses. Existing methods related to delayed message handling have
been refactored into this new class.
- Add Wake-up Channel TLV to the dataset.
- Add CLI support to handle the wake-up channel.
- Add MAC support for wake-up channel (to be used for sending
  and receiving wake-up frames).
This commit applies the RxChannelAfterTxDone in the tx done callbacks,
so that vendors doesn't have to implement in platform layer.
…erence 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.
In this commit, a new spinel property
`SPINEL_PROP_INFRA_IF_RECV_ICMP6_ND` is added for the host to pass the
ICMP6 ND messages to the NCP.
This commit fixes an issue in `Client::ReplaceWithIp4Query()` where an
IPv6 address resolution query failure could lead to an incorrect IPv4
query being sent. The incorrect query type was being checked in this
method, causing `ResolveIp4Address()` to keep sending queries.
…0766)

This commit updates `test_dns_client` to validate independent address
resolution queries (in addition to the existing service resolution
tests). Specifically, it adds test cases for `ResolveIp4Address()`
and scenarios where the server responds with an error RCODE.
…er (#10750)

This commit updates how Keep Alive messages are handled by the Border
Agent. After establishing a secure session, a device has
`TIMEOUT_COMM_PET` (50 seconds) to take any action, including sending
a petition to become an Active Commissioner. This change ensures that
Keep Alive messages are ignored before a device becomes an Active
Commissioner, preventing candidates from extending their sessions.
Keep Alive messages are now processed only for Active Commissioners
(BA in `kStateAccepted` state), aligning the implementation with the
Thread specification.
This commit adds `CONFIG_BORDER_ROUTING_ENABLE` guard checks to
`nd6.hpp` and `nd6.cpp` source files, as the definitions in these
files are only used when the `BORDER_ROUTING` feature is enabled.
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.2 to 3.26.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@429e197...461ef6c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit adds the `Message::FooterData<>` template class, which
represents data (typically metadata) associated with a `Message` that
is appended to the end of the message. It can be read later from the
message, updated (re-written) in the message, or fully removed from
it.

The `FooterData` class provides common helper methods such as
`AppendTo()`, `ReadFrom()`, `UpdateIn()`, and `RemoveFrom()` in a
generic way. This helps simplify the various `Metadata` types defined
within the OT core modules, removing repeated definitions of similar
methods for each type.
…10689)

This commit simplifies the preparation of MAC and security frames. It
introduces a `TxFrame::Info` structure that provides information
about the frame, such as its type, version, source and destination
addresses, PAN IDs, security level, and key ID mode. A new method
`PrepareHeadersIn()` is added, which uses the `Info` structure to
construct the MAC address and security headers in a given `TxFrame`.

This approach replaces the earlier `Mac::Frame::InitMacHeader()` where
all the information was passed as a list of input arguments. The
`TxFrame::Info` approach simplifies the code and allows for future
extension to accommodate other parameters (e.g., Header IE entries).
)

This commit explicitly enables the `OPENTHREAD_CONFIG_TLS_ENABLE`
macro in `core-toranj-config.h`. This configuration is used to
generate a custom `openthread-mbedtls-config.h` using the `unifdef`
command in `mbedtls/CMakeLists.txt`. Some versions of `unifdef` do
not expand macros first and expect the macro to be defined as a
simple number. This change ensures the build is successful.
Commit introduces implementation of missing general class commands:
- PresentPskdHash
- PresentPskcHash
- PresentInstallCodeHash
- RequestRandomNumChallenge
- RequestPskdHash

Also include minor fixes in Tcat python client and refactoring of expect
tests for tcat.
)

This commit updates `TxFrame::GenerateWakeupFrame()` to utilize the
`FrameBuilder` class for constructing frame header fields.

It also updates the `TestMacWakeupFrameGeneration()` unit test in
`test_mac_frame.cpp`:
- Uses source and destination address constants that are not reversible
  to validate that extended addresses are appended in the correct byte
  order.
- Includes minor style changes (renames constants and uses lowercase
  hexadecimal digits for consistency).
jwhui and others added 30 commits December 19, 2024 10:00
This commit rearranges the method definitions in the `BorderAgent`
class so that related methods are next to each other. This improves
code readability and organization. This commit contains no logic
changes.
The current diag module will count any packets received. This commit
adds the command `diag radio receive filter` to allow the diag module
receives only frames with the specified destination mac address.
This commit adds `LogCertMessage()` to generate a message dump log for
certification test. This function is used by both `Joiner` and
`Commissioner`, removing duplicate code.
…11068)

This commit adds guard checks for Border Agent, Commissioner, Joiner,
and CoAP Secure API features that use Secure Transport (DTLS/TLS) to
ensure `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE` is enabled. It
also moves the deprecation check for the earlier DTLS configuration
to `openthread-core-config-check.h` to be consistent with other
removed/deprecated configurations.
This commit simplifies the `BorderAgent::HandleUdpReceive()` method:

- All local variables are defined at the top of the method.
- Tracks whether the UDP message was handled in the new local
  `didHandle` variable (avoiding the reuse of a specific error code
  to track this).
- Simplifies log messages.
…nts (#11065)

This commit updates `LinkedList` and `OwningList` to enhance
`FindMatching()`, `RemoveMatching()`, and related methods to use
`Matches()` with a variable number of arguments. The implementation
uses a variadic template function and forwarding references.
This commit adds a version field (`uint8_t`) to DNS/SRP Anycast and
Unicast Service entries in `NetworkData::Service::Manager`.

For Unicast entries, the version the version field is placed after
the existing fields, specifically after the IPv6 address and port number fields.
For Anycast entries it is added as the in server data as part of the
Server TLV.

When processing Network Data service entries, the version field is
optional and if absent, version number zero is assumed.

The `NetworkData::Publisher` now considers entries with the same or
higher version number when deciding whether to add or remove its own
entry, preferring those with a higher version.

In SRP client, when `AutoStart` mode is used and if there are multiple
Unicast, Service entries, the client prefers the one with larger
version number.

When selecting an anycast entry, the existing rules regarding sequence
numbers are still used. If multiple entries with the same sequence
number exist, the client will assume the minimum version number among
all such entries.

This commit also updates the `test_network_data` unit test, validating
the new format and related methods.

`test_netdata_publisher.py` is also updated to check service entries
with different version numbers.
…11056)

This commit introduces the `Dtls::Transport` and `Dtls::Session`
classes, separating session-related functions from transport-related
behaviors. It also introduces the `Coap::SecureSession` class, which
handles CoAP processing over a DTLS session. This simplifies the code
by allowing `Coap::SecureSession` to inherit many of its methods from
`Dtls::Session`, avoiding repetition. It also separates CoAP-specific
message processing from transport-related functionality.

`Tmf::SecureAgent` and `ApplicationCoapSecure` are updated to act as
both a `Dtls::Transport` and a single `Coap::SecureSession`.
This commit removes the unused `GetUdpProxyPort()` method and the
related code tracking the proxy port in `BorderAgent`.
)

This commit updates the `Dataset::IsTlvValid()` method to also
validate the Active/Pending Timestamp and Delay Timer TLVs, ensuring
they have the minimum required length. This ensures that a dataset
with invalid TLVs is correctly rejected when set on a device.
This commit improves the organization of `secure_transport.cpp` by
grouping method definitions for `SecureSession` and `SecureTransport`
into separate sections.

The recent PR #11046 introduced `SecureSession`, separating the
session and transport functionality. To keep the `git diff` smaller
and easier to review, the methods were left in the same order as
previously defined. This resulted in methods of `SecureSession` and
`SecureTransport` being mixed and interleaved. This PR rearranges the
methods and defines separate sections for each class. This commit
does not contain any code logic changes.
…11085)

This commit updates `BorderAgent` to utilize its own DTLS `Transport`
and CoAP `SecureSession`, separating it from the shared
`Tmf::SecureAgent` used by `Commissioner` and `Joiner` modules. This
change enables future support for multiple sessions within
`BorderAgent`.
This commit updates the interaction between `BorderAgent` and the
native `Commissioner`, removing the unnecessary mechanism to stop and
restart the Border Agent when the commissioner is enabled and
disabled.

This was previously required because both modules shared the same
underlying `Tmf::SecureAgent` and DTLS transport. This has been
changed recently so that `BorderAgent` uses its own DTLS transport
and sessions.
This commit clarifies the expected behavior with CSMA/CA parameters in
TxInfo.
* non-zero mTxDelay or non-zero mTxDelayBaseTime or falsy
  mCsmaCaEnabled disables CSMA backoffs, thus ignores the
  mMaxCsmaBackoffs field.
* Zero mMaxCsmaBackoffs disables CSMA backoffs.
* CCA is solely controlled by mCsmaCaEnabled.
The MleRouter::BecomeRouter already checks the device role and the API
claims only return OT_ERROR_INVALID_STATE when the role is disabled.

This commit consolidates the device role check in
MleRouter::BecomeRouter.
…11108)

When using the `diag frame -c xxxx` command to enable the CSMA-CA when
transmitting the frame, the command `diag send` won't output any message
the CCA failure happens. It is difficult for users to know whether
the CSMA-CA is actually effective via diag commands.

This commit counts the number of packets that are sent succeed and failed,
outputs the transmision failure reason and do not re-transmit the frame
after it fails to send.
This commit updates the code so that `Tmf::SecureAgent` is not closed
when the Thread network interface is brought down. The `SecureAgent`
is directly controlled and used by either the `BorderAgent` or
`Commissioner` during network operation, which should continue to
function even if the Thread network interface is offline. It may also
be used by the `Joiner`, but in that case, it will be closed by the
`Joiner` itself upon finishing the join attempt.
This commit fixes the potential issue that mTxDelay becomes 0 around the
32-bit time wrapping.
When configuration file defined in build parameter(command line argument),
ot-fct is wound't take into an account and accessed default path.

This commit fixes to access configuration file from path which is
defined from build command line parameter. Also, it fixes some
compilation issues while building from ot-br-posix.

Signed-off-by: ashish <[email protected]>
This commit adds a new variable, `mDidConnectWithEphemeralKey`, which
tracks whether a successful secure session is established using the
ephemeral key. This variable is used in `HandleConnected()` to
determine whether to stop using the ephemeral key when the Border
Agent is notified that the secure session is disconnected.

This change ensures that ephemeral key use is not stopped after a
failed connection attempt, while still guaranteeing that an ephemeral
key can only be used once.

Without this fix, a failed connection attempt would immediately stop
the use of the ephemeral key. With this change, the intended
`kMaxEphemeralKeyConnectionAttempts` will be applied.
This commit adds `test_border_agent`, using the nexus framework, to
cover the functionality of `BorderAgent`. The test cases include:

- Border Agent initial state.
- Establishing a secure session to the Border Agent and
  disconnecting.
- Handling "Commissioner Petition" to accept a full commissioner.
- Handling "Commissioner Keep Alive" and timeouts.
- Ephemeral key use and its initial state.
- Establishing a connection with an ephemeral key and disconnecting.
- Ephemeral key timeout mechanism (with or without a session).
- Ephemeral key use stopping after the maximum number of failed
  connection attempts.
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
```
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.