407 Commits

Author SHA1 Message Date
Jonathan Hui 6aac6708a7 [script] update scan-build to use cmake/ninja (#6982) 2021-09-09 15:48:53 -07:00
Abtin Keshavarzian ca3830fac2 [uptime] new feature to track OT instance uptime (in msec) (#6968)
This commit adds a new module `Uptime` which tracks the number of
milliseconds since OpenThread stack initialization as an `uint64_t`
value. It also adds public OT APIs to get the current uptime value
(either as the number of milliseconds or in human-readable string
format like "2 days 12:45:12.762"). A CLI `uptime` command is also
added. This feature can be enabled using the newly added config
option `OPENTHREAD_CONFIG_UPTIME_ENABLE` (or the related CMake
`OT_UPTIME` option).
2021-09-02 13:44:40 -07:00
Abtin Keshavarzian 2798cc9c05 [utils] adding HistoryTracker module (#6807)
This commit adds History Tracker feature and its CLI support. This
feature records history of different events as the Thread network
operates (e.g., history of RX and TX IPv6 messages or network info
changes).

Recorded entries are timestamped. When the history list is read, the
timestamps are given as the entry age relative to the time the list
is being read. For example in CLI a timestamp can be shown as
`02:31:50.628 ago` indicating the entry was recorded 2 hours, 31 min,
50 sec, and 628 msec ago. Number of days is added for events that are
older than 24 hours, e.g., `31 days 03:00:23.931 ago`. Timestamps use
millisecond accuracy and are tacked up to 49 days. If an event is
older than 49 days, the entry is still tracked in the list but the
timestamp is shown as old or `more than 49 days ago`.

The `HistoryTracker` currently maintains 3 lists. The Network Info
history tracks changes to Device Role, Mode, RLOC16 and Partition ID.
The RX/TX history list records information about the received/sent
IPv6 messages:
- Message type (UDP, TCP, ICMP6 (and its subtype), etc.)
- Source and destination IPv6 addresses and port numbers
- IPv6 payload length
- The message checksum (for UDP, TCP, or ICMP6).
- Whether or not the link-layer security was used
- Message priority: low, norm, high, net (for control messages)
- Short address (RLOC16) of neighbor who send/received the msg
- Received Signal Strength (in dBm) for RX only
- Radio link info (15.4/TREL) on which msg was sent/received
  (useful when `OPENTHREAD_CONFIG_MULTI_RADIO` is enabled)

Config `HISTORY_TRACKER_EXCLUDE_THREAD_CONTROL_MESSAGES` can be used
to configure `HistoryTracker` to exclude Thread Control message
(e.g., MLE, TMF) from TX and RX history.

The number of entries recorded for each history list is configurable
through a set of OpenThread config options, e.g., number of entries
in Network Info history list is specified by OpenThread config option
`OPENTHREAD_CONFIG_HISTORY_TRACKER_NET_INFO_LIST_SIZE`. The
`HistoryTracker` will keep the most recent entries overwriting oldest
ones when the list gets full.

This commit also adds support for `HistoryTracker` in CLI. The CLI
commands provide two style for printing the history information: A
table format (more human-readable) and list style (better suited for
parsing by machine/code). `README_HISTORY.md` is added to document
the commands and the info provided by each history list entry.

This commit also adds `test_history_tracker.py` test-case which
covers the behavior of `HistoryTracker`.
2021-08-12 15:47:26 -07:00
Abtin Keshavarzian 2e625bfe39 [netdata] adding NetworkData::Publisher (#6768)
This commit implements a new feature "Network Data Publisher" which
provides mechanisms to limit the number of similar entries (service
and/or prefix) in the Thread Network Data by monitoring the Network
Data and managing if or when to add or remove entries. This feature is
enabled using `OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE` config, or
`NETDATA_PUBLISHER` in autoconf, or `OT_NETDATA_PUBLISHER` cmake
option.

This commit adds support for publishing DNS/SRP anycast/unicast
service, on-mesh prefix, and external route prefix entries.

When there is a request to publish an entry, the `Publisher` monitors
the Network Data and counts the number of similar entries. If there
are fewer entries than a desired target number, the entry is added
after a short random delay.

If there are too many similar entries, `Publisher` starts the process
of removing its own entry (again after some random wait time). When
removing entries, certain entries are preferred over others (e.g., an
entry from a router over one from an end-device or if they are from
the same type of node, the one with smaller RLOC16). If `Publisher`
determines that its own entry is a preferred one, it adds an extra
wait time before removing its entry. This gives higher chance for a
non-preferred entry from another device to be removed before removing
a preferred entry which helps towards quicker convergence of the
process to the desired number of entries.

On-mesh prefix and external route entries have a "preference" field.
When publishing such an entry, a matching entry in the network data is
counted only if its preference is same or higher than the entry's
preference. This ensures that a device with a higher preference entry
publishes its entry even when there are many lower preference similar
entries in the network data (potentially causing a lower preference
entry to be removed).

This commit also adds `test_netdata_publisher.py` to verify the
behavior of the `Publisher`.
2021-08-10 22:32:33 -07:00
Simon Lin d8ad60ff6d [dns-sd] add DNS-SD server network interface binding configuration(#6838)
This commit allows DNS-SD server to configure the network interface to
bind the UDP socket.
2021-08-05 22:34:31 -07:00
Yakun Xu 354387c931 [test] fix reporting expect failure (#6869)
This commit fixes reporting expect failures by adding fail on error
flag to the ot_exec_expect_script function in script/test script.

This commit also fixes failing expect tests and removes expect tests
on macOS for unstable issues.
2021-08-02 20:26:32 -07:00
Yakun Xu e40c01d355 [build] allow specify build date time (#6856)
This commit adds a macro for specifying OpenThread build date time,
which can be empty so that this field can be omitted.
2021-07-27 18:18:57 -07:00
Jonathan Hui 5f39ba055b [srp-server] fix clang-tidy warnings (#6822)
- enable SRP server in clang-tidy check
- remove static member access through instance
2021-07-16 09:49:18 -07:00
Jonathan Hui d89f9222f0 [multi-radio] fix clang-tidy warnings (#6821)
- enable TREL in clang-tidy check
- add explicit keyword to constructors
- fix inconsistent parameter names
- remove redundant initializer
- use nullptr
2021-07-16 09:48:56 -07:00
Li Cao 3d45d0a58b [script] fix Thread version for check-simulation-build (#6781)
The default Thread version has been set to 1.2 when building. Our test
script which checks building hasn't been updated accordingly. This
commit fixes this error.
2021-07-07 12:31:31 -07:00
canisLupus1313 126e232ad5 [link-metrics] split OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE macro (#6716)
This commit splits OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE macro
into two subsequent ones:
- OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
- OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
2021-06-22 10:49:53 -07:00
Abtin Keshavarzian ec1ae4c0ef [dnssd-server] remove unused using for HostSwap16() (#6758)
This addresses `clang-tidy` warning for unused `using` statement. This
commit also ensures `OT_DNSSD_SERVER` is enabled in `make-pretty`
script and therefore covered by github action `build pretty`
workflow.
2021-06-22 10:19:48 -07:00
Jonathan Hui aaabf25ff2 [network-key] change name from master to network (#6721) 2021-06-16 23:07:23 -07:00
whd df4423e14c [github-actions] enable Avahi in OTBR CI tests (#6710) 2021-06-08 07:35:44 -07:00
Łukasz Duda 8b63efe2ae [bootstrap] add support for Ubuntu on RaspberryPi (#6647)
Summary of changes:
- Enable building OpenThread RCP image on the Raspberry Pi (aarch64)
  directly (using Ubuntu)
- Fix problem with not having access to the /opt folder as a user
2021-05-19 19:35:14 -07:00
Simon Lin e0a1987336 [ip6] set Mesh Local IID for Reference Devices (#6599) 2021-05-11 21:38:14 -07:00
Jonathan Hui 550c2056de [nrf528xx] move to openthread/ot-nrf528xx (#6585) 2021-05-11 16:53:13 -07:00
Yakun Xu 7721a5119f [posix] avoid CLI buffer overflow (#6578) 2021-05-10 21:19:12 -07:00
Yakun Xu 0f65243d63 [ot-ctl] support no separator -- (#6606)
With this change, both the following command should work:

ot-ctl -I wpan0 pskc -p 123456
ot-ctl -I wpan0 -- pskc -p 123456
2021-05-10 21:14:05 -07:00
Łukasz Duda 5078dfcc64 [mbedtls] update to 2.25 (#6555)
List of changes:
- modified Autotools, CMake and Android build systems
- increased heap size as new version requires additional 64B
- replaced deprecated API (mbedtls_ecdsa_sign_det)
- removed workaround with defining mbedtls_ecp_restart_ctx
2021-05-10 09:48:58 -07:00
Yakun Xu f766d8047d [posix] support interface name in ot-ctl (#6552)
This commit adds the Thread interface name to unix socket of
OpenThread daemon, so that ot-ctl can specify which daemon to connect
to.
2021-05-08 18:21:13 -07:00
Jonathan Hui 5078323d35 [efr32] move to openthread/ot-efr32 (#6403) 2021-05-06 14:28:28 -07:00
Yakun Xu 394739f3d8 [cli] move netif command to posix platform (#6557) 2021-05-06 10:47:14 -07:00
Yakun Xu d3bc1acf74 [script] add package (#6540) 2021-05-05 10:41:17 -07:00
Abtin Keshavarzian 91aaa34d9b [build] update build scripts and add multi-radio (TREL) CI build checks (#6518)
This commit updates `toranj/build.sh` script for posix based builds to
generate CLI executable. It also updates the posix platform to provide
log functionality when `LOG_OUTPUT` is set to `LOG_OUTPUT_APP`.

This commit also adds CI build checks for multi-radio and TREL build
configurations under posix platform.
2021-04-29 09:28:07 -07:00
Yakun Xu a78888579b [test] wait factoryreset in check-posix-pty (#6529) 2021-04-28 08:43:40 -07:00
Yakun Xu b928f148f4 [github-actions] fix unstable issue of pty-macos (#6506) 2021-04-22 21:50:24 -07:00
Simon Lin 01186d6610 [thread-cert] use OT_TREL=OFF for OTBR docker build (#6497)
Since OT_TREL is going to be set to ON in OTBR, this commit makes sure
we test OTBR with TREL off.

Also removed -DOTBR_DNSSD_DISCOVERY_PROXY=ON since it's now ON by
default.
2021-04-21 22:07:11 -07:00
Yakun Xu 33012716ee [github-actions] download size reporter in workflow file (#6475) 2021-04-20 07:30:37 -07:00
jinran-google 0c5053d0ae [codecov] use Codecov GitHub Action to upload coverage (#6467) 2021-04-19 07:32:58 -07:00
Yakun Xu f81c0b50f0 [posix] remove NCP app (#6428)
The POSIX NCP app(ot-ncp) is simulating of NCP with an RCP. With the
latest otbr-agent, this is not needed any more. It is only used in CI
tests. This commit removes the app to save maintenance efforts.
2021-04-16 07:42:14 -07:00
Jonathan Hui a913784cc0 [codecov] remove use of bash uploader (#6459)
See https://about.codecov.io/security-update/
2021-04-15 21:01:21 -07:00
Yakun Xu 3fa6fd7b52 [cmake] export compile commands (#6451)
This commit adds the option CMAKE_EXPORT_COMPILE_COMMANDS=ON to export
compile commands which is helpful for editors/IDEs.
2021-04-15 13:36:08 -07:00
Jonathan Hui fa99680f02 [mesh-forwarder] add support for Neighbor Discovery Agent Anycast (#6423) 2021-04-13 21:12:41 -07:00
Simon Lin d5855ab74b [style] bump yapf version to 0.31.0 (#6434) 2021-04-12 07:30:27 -07:00
Jonathan Hui 193d7d3ba1 [k32w] move to openthread/ot-nxp (#6425) 2021-04-10 10:14:51 -07:00
Simon Lin 5a39566f81 [dnssd] implement DNS-SD Discovery Proxy (#6191)
This commit implements DNS-SD Discovery Proxy.
- Implemented DNS-SD Discovery Proxy functionalities - OT part
- Fixed an memory issue of NameCompressInfo (introduced in #6155 , but
  somehow revealed by this commit)

Some implementation details:
- Discovery Proxy subscribes to services/service instances/hosts
  through callbacks set by a public OT API. It is up to the platform
  mDNS implementation to collect service instance/host information and
  notify OT via a public OT API.
- Discovery Proxy can handle DNS browsing of one service or DNS
  resolving of one service instance/host. We leave browsing multiple
  services or resolving multiple service instances/hosts for future
  enhancements if necessary.
2021-04-08 18:21:23 -07:00
Jonathan Hui b7751460e0 [cc2650] remove example platform (#6398) 2021-04-02 18:50:37 -07:00
Jonathan Hui e360c63779 [cc13x2-cc26x2] move to openthread/ot-cc13x2-cc26x2 (#6389) 2021-04-02 08:37:37 -07:00
Jonathan Hui 5b5a3f6d9e [kw41z] move to openthread/ot-kw41z (#6386) 2021-04-01 08:12:12 -07:00
Yakun Xu 6f382a4ac5 [macos] fix binding interface and build (#6362)
This commit fixes binding interface on macOS and also build errors on
macOS. The pty check is also added on macOS.
2021-04-01 08:10:22 -07:00
Jonathan Hui 71097eeb0f [qorvo] move to openthread/ot-qorvo (#6382) 2021-03-31 16:30:07 -07:00
Jonathan Hui f81eebeb48 [samr21] move to openthread/ot-samr21 (#6369) 2021-03-30 21:59:21 -07:00
Yakun Xu ffc550bf15 [test] package with Thread version (#6325) 2021-03-22 08:41:02 -07:00
Mason Tran 7b3c2ae66b [efr32] add CMake support (#6302)
This commit adds CMake support for the efr32 platforms and Silicon
Labs gecko_sdk_suite. It also adds the option to build the efr32
sleepy-demo apps.

Other changes:
- jlinkrtt: remove NordicSemi specific options/definitions/includes
  from default build
- Remove old include dirs that don't exist anymore from efr32 automake
  files
2021-03-19 16:06:54 -07:00
Abtin Keshavarzian 06ca5d855c [utils] add 'Utils::PingSender' (#6284)
This commit adds a new module `Utils::PingSender`. This module
is then used by CLI to support ping command.
2021-03-19 16:04:55 -07:00
Yakun Xu ae88a2c677 [test] print size diff symbol by symbol (#6305)
This commit enhances the size check by printing size diff symbol by
symbol, which can help us better analyze size changes.
2021-03-19 13:20:38 -07:00
Yakun Xu db1b980e57 [api] remove UART from in cli/ncp API (#6243)
This commit removes application library CLI/NCP dependency on platform
layer UART APIs. Instead, application layer provides callbacks sending
CLI/NCP data.

With this change, platforms with native support for formatted output
can simply implement the CLI output callback with something like
`vprintf()`.
2021-03-18 22:13:05 -07:00
Jonathan Hui 16ebac8a17 [build] set Thread 1.2 as default version (#6281) 2021-03-16 11:38:57 -07:00
kangping 48b09e3130 [tests] update OTBR CI test script (#6215)
To support new OTBR border routing feature.
2021-03-12 07:25:20 -08:00