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

Regular OpenThread upmerge to 2aeb8b8 #176

Merged
merged 160 commits into from
Sep 30, 2024

Conversation

maciejbaczmanski
Copy link
Member

No description provided.

abtink and others added 30 commits June 27, 2024 12:54
This commit introduces new helper methods in the `Mle` class:

- `HasRloc16()`: Checks if the device is using a given RLOC16.
- `MatchesRouterId()`: Checks if this device's RLOC16 matches a given
  Router ID.
- `HasMatchingRouterIdWith()`: Checks if this device's RLOC16 shares
  the same Router ID with a given RLOC16. This implies that the two
  devices are either directly related as parent and child or are
  children of the same parent within the Thread network.
- `ParentRloc16ForRloc16()` derives the router RLOC16 corresponding to
  the parent of a given (child) RLOC16.

These methods act as syntactic sugar, simplifying code and enhancing
readability.
…455)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.3 to 3.25.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@d39d31e...b611370)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit adds the `OnLinkPrefix::IsFavoredOver()` method to
determine if an on-link prefix is eligible to be considered as a
favored prefix, and if so, is favored over another prefix. A
numerically smaller prefix is considered favored.

Additionally, a new test case is added to `test_routing_manager` to
validate the selection of favored on-link prefixes, including the
the requirement of a minimum preferred lifetime of 1800 seconds
for a prefix to be considered eligible.
…451)

This commit introduces a new private struct `RxInfo` in the
`MeshForwarder` class, encapsulating information related to a
received frame during processing. The `RxInfo` struct contains
`FrameData` to track the received frame data bytes, `ThreadLinkInfo`,
and `Mac::Addresses`. This simplifies the code by allowing the
`RxInfo` to be passed to different methods instead of passing the
same information as separate parameters.
Commits adds handling of TCAT TLV 0x60 `kTlvDecommission`.
This commit introduces the `OffsetRange` class, which represents a
range of offsets within a `Message` or data buffer (i.e., a starting
offset and a length indicating the number of bytes in the range).

The class provides methods for common operations:

- Getting the start or end offset, or the remaining length.
- Checking if the range is empty or contains a certain number of
  bytes.
- Advancing the start offset by a given amount, ensuring it never goes
  beyond the end offset.
- Shrinking the range's length.

The new `OffsetRange` class simplifies methods that previously used
separate `aOffset` and `aLength` input parameters, improving code
readability and maintainability. It also facilitates reading and
processing content within a specified range.

For example, `Tlv::FindTlvValueOffsetRange()` now directly returns an
`OffsetRange` indicating the location of the TLV value. The `Message`
class is also updated with new `Read()` and `Append()` method variants
that accept `OffsetRange` arguments. These methods ensure that read
content is contained within the specified `OffsetRange`.
…#10459)

This commit updates `GetForwardFramePriority()` to save the original
`aRxInfo.mFrameData` before parsing the fragment header. The header
parsing may modify `mFrameData` to skip over the parsed portion. The
original `FrameData` is restored before returning, ensuring that
forwarded frames include the fragment header and eliminating the need
to create a copy of `aRxInfo`.
…#10357)

This commit improves the `Srp::Client` mechanism for applying random
jitter delays before sending update messages to the server. It now
supports different jitter ranges based on specific triggers. Since
trigger events are often network-wide, potentially causing
simultaneous SRP re-registration from many nodes, longer jitter
intervals are used to distribute the resulting SRP update
transmissions and avoid congestion.

The following triggers are covered:

- Server switch: Client switching to a new server while already
  connected to a discovered server. This occurs when a new server
  entry appears in Network Data which is preferred over the current
  selection.

- Server restart: Client was previously connected to a server that
  disappeared from Network Data. Later, the same or a new server is
  discovered in Network Data.

- SLAAC address add or remove: This is generally triggered by updates
  to SLAAC prefixes in Network Data (e.g., OMR prefix changes).

- First registration after attach:

  - If the device is attaching to an established Thread mesh
    (e.g., after a reboot or initial pairing), the Network Data it
    receives should already include a server entry, leading to a
    quick server selection after attach. If server selection occurs
    within a short window, a shorter TX jitter is used, allowing the
    device to register quickly and become discoverable.

  - If server discovery takes longer, a longer TX jitter is used. This
    situation can indicate a server/BR starting up or a network-wide
    restart of many nodes (e.g., due to a power outage).

This commit introduces `TxJitter` class to manage the requested TX
jitter based on a trigger reason. It tracks the time of the event
that triggered a longer jitter request. If the update message is sent
immediately after the trigger event, the requested maximum jitter is
applied. However, if the update message is sent later, the maximum
jitter is adjusted proportionally to the time elapsed since the
trigger event. If the elapsed time exceeds the requested maximum
jitter interval, the default short jitter is applied to avoid
unnecessary registration delay.
CMake by default enables c extensions. As a result, gnu99 is used
instead of c99. This commit explicitly disables c extensions.
This commit updates `Tlv` helper methods to use `OffsetRange` in their
implementation. It also makes the `Tlv::ParsedInfo` type public. This
struct represents information about a parsed TLV in a message,
including the TLV type, the `OffsetRange` for the full TLV, and the
`OffsetRange` where the TLV's value resides in the message. This
replaces and enhances the `ParseAndSkipTlv()` method.

The `ParsedInfo` provides two methods:

- `ParseFrom()`: Parses a TLV at a given offset or offset range.
- `FindIn()`: Searches for a given TLV type in a message.

These methods handle both extended and regular TLV formats, validating
that the parsed TLV is well-formed and fully contained within the
message and the given `OffsetRange`.

Modules that iterate over a sequence of TLVs in a message are updated
to use `ParsedInfo` and its methods, simplifying the code.
This commit adds `RxInfo::ToString()`, which generates a common log
string about an `RxInfo` using the "len:%d, src:%s, dst:%s, sec:%s"
format, providing frame length, source and destination addresses, and
whether link security is used. This is then used in different logging
methods, simplifying the code.
…466)

This commit updates `Ip6` and `Lowpan` to use `OffsetRange` when
iterating and parsing options in an HBH extension header. It also
simplifies the `RemoveMplOption()` method by adding an `Action` enum,
which determines how to remove the MPL option: whether to shrink the
HBH header, fully remove the HBH header (if it contains no other
options), or replace MPL option with padding.
This commit adds a new feature to the `RoutingManager` to enable
tracking information about peer Thread Border Routers that are
connected to the same Thread network.

When enabled, the `RoutingManager` will maintain a record of
advertised RIO/PIO prefixes discovered from received Router
Advertisement (RA) messages of peer BRs. When disabled (the existing
behavior), such entries are not tracked.

When tracked, these entries are marked to be disregarded and are not
considered in any decision-making processes, such as selecting
favored on-link prefixes or determining routes to publish in the
Thread Network Data. They are primarily intended for debugging and
telemetry (information gathering) purposes.
This commit removes `spinel-config.h` and moves the configs to
`openthread-spinel-config.h` so that the definitions can also be
overridden by definitions in customized lib config file.
…s (#10471)

This commit updates `PrepareNextDirectTransmission()` to use
`RemoveMessageIfNoPendingTx()` if a message cannot be prepared for
direct transmission. This ensures the message is not dequeued and
freed if it is also queued for indirect transmission.
This method was refactored in 25fe46d (#8963) but its declaration
was not removed.
This commit updates `ChannelMaskTlv` to use `OffsetRange` when
iterating over and parsing the list of entries contained in the TLV.
This commit makes two changes in `test_advertising_proxy`:

- In the test step where the server is restarted, a longer wait time
  is used to account for the longer jitter interval used by SRP
  client in such a case.
- Due to the use of short lease time (10 seconds) in this test, the
  client will refresh the registered services quickly. Therefore, in
  `check_host_and_service()`, any of `Registered`, `ToRefresh`, or
  `Refreshing` states are accepted as indicating successful
  registration.
This commit moves csl receiver related functions to
sub_mac_csl_receiver.cpp to simply the sub_mac.cpp to improve the code
readability.

This commit is a pure refactoring and doesn't contain any logic or
code changes.
This commit implements a test script tools/cp-caps/rcp_caps_test.py to
test which diag commands RCP supports using the DUT and reference
device.
This commit updates `Srp::Client` to apply a short random jitter
(15 seconds) when calculating the lease renew time. The lease is
renewed close to its expiration, using a guard interval of 120
seconds (renewing 120 seconds before expiration). The jitter is added
to distribute client refreshes, in case many clients registered their
services around the same time.
This commit adds high level Thread network management API
'create_dataset()', 'join()', 'leave()' and 'wait_for()' to otci.
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@0c52d54...cdcb360)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit adds an `Ip6::Header` field to `RxInfo`, along with the
`ParseIp6Headers()` method to decompress and parse the IPv6 headers
from the received frame. `RxInfo` now tracks whether the headers have
been parsed before.

The IPv6 headers may be parsed from different code paths as the
received frame is processed. For example, `UpdateRoutes()`,
`GetFramePriority()`, and `CheckReachability()` may parse the IPv6
headers. By having `RxInfo` cache the parsed IPv6 headers,
duplicate parsing is avoided.
This commit adds the `ParseTlvs()` helper method in the `Cli::Dataset`
class, which parses TLVs (as hex strings) from an input argument.
This is used in multiple methods to simplify the code.

The `Process<Cmd("set")>()` method is updated to avoid extra
conversion and use of core-internal types.
suveshpratapa and others added 24 commits August 28, 2024 11:38
…and RTS on init when flow control is disabled (#10644)

This lets us preserve legacy behavior where `uart-flow-control` was
not required even with hardware flow control enabled.
…#10652)

This commit doesn't forward the MGMT*GET/SET commands directly to leader
any more, and enforces the use of UDP Proxy for Thread Management
Commands.
This commit applies new pskc into secure transport when it's changed
via active/pending dataset, without impacting existing secure session
if any or ephemeralkey mode if it's activated
Done by `script/code-spell` with some manual fixes.
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@39cd149...f677139)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit provides unified methods for checking whether the CSL IE
is present and getting the CSL IE.
This commit soften enabling log uptime in simulation and posix platform
so that it won't be enabled when multiple instance is also enabled.
This commit introduces `platformResolver*` APIs so that `system.cpp`
can treat resolver as an independent module.

Reasons for this refactor:
- Simplify the integration on Android platform.
- The functionality of resolver is not related to the functionality of
  netif.
…#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.
Commit fixes propagation of certificate path from `cert-path` option
to `scan` command.
Adding timeout while handling ble connection establishement in TCAT.
This commit adds 2 system APIs for resolver for integration on Android
platform.
- `otSysUpstreamDnsServerSetResolvConfEnabled` is for
  enabling/disabling retrieving the DNS servers from `resolve.conf`.
- `otSysUpstreamDnsSetServerList` for specifying the DNS servers on
  the infra link.
- Fixes to connection state management and handling of Disconnect
  command TLV
  - specifically, this now ensures that TCAT remains on (started)
    after a commissioner disconnects. Earlier, there was the problem
    that the 2nd commissioner couldn't connect anymore.
  - specifically, in ble_secure.cpp the check for if
    (mTcatAgent.IsEnabled()) is removed, since the err =
    mTcatAgent.Connected(mTls) will already check this and raise an
    error if not enabled. If not enabled, the Device is in a wrong
    state to handle TCAT Commissioner commands so now it closes the
    connection right away. That's better than to leave the
    Commissioner in limbo on the TLS connection. The Commissioner can
    now retry again and all will be well again.
- timeout of at most 10 seconds on UDP write operation in simulation
  mode (if longer, the TCAT device isn't reachable and the
  Commissioner now shows the error to the user.) Earlier, it got stuck
  forever.
- Corrects some copy/paste errors in API definitions in comments; adds
  comments where needed to explain.
  - adds whitespace at some places to align format with rest of code
- improved some of the --debug output for the UDP simulation mode of
  the TCAT Commissioner.
This commit fixes the pcap callback for TX frames:

* Report the tx frame on each tx started callback, so that
  retransmissions can be captured.
* Set the RSSI to be invalid for TX frames.
This commit corrects the description of STREAM_RAW.

- timestamp should be type `X`.
- channel can be both RX and TX channel.
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@0d4c9c5...9780b0c)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit moves all `HeaderIe` related definitions from
`mac_frame.hpp/cpp` into newly added `mac_header_ie.hpp/cpp` source
files. This commit does not make any changes to the code.
Currently the OPENTHREAD_CONFIG_STORE_FRAME_COUNTER_AHEAD
is hard-coded in the OT core, yet sometimes it is
desired to modify this value which requires
re-building of the OT libraries and forces
re-certification of the end product.

Implement `otThreadSetStoreFrameCounterAhead`
and `otThreadGetStoreFrameCounterAhead` to allow
API clients to configure the store frame counter
ahead parameter at run-time. This extension offloads
product makers from the need of re-certification
in case the store frame counter ahead must be tuned.

Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no>
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.
…(#10631)

Avoid processing announce messages with equivalent data that is stored
in a pending dataset update.
@rlubos rlubos merged commit 2aeb8b8 into zephyrproject-rtos:main Sep 30, 2024
@maciejbaczmanski maciejbaczmanski deleted the main_zephyr branch September 30, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.