Skip to content

Commit

Permalink
Pull request openthread#242: Update openthread stack 6f909a1->1203ea642
Browse files Browse the repository at this point in the history
Merge in WMN_STACKS/openthread from task/openthread/update-openthread-commit to develop/23q2

* commit 'fccf0f635e494e2d6249bbc49dcd64438163306d':
  Define posix radio RadioSpinel accessor (openthread#9018)
  [network-name] consolidate default network name definition (openthread#9036)
  [topology] track connection time of neighbors (openthread#9007)
  [string] add `StringParseUint8()` helper function (openthread#9026)
  [link-metrics] fix compilation errors (openthread#9033)
  [build] add CMake Android NDK support (openthread#9010)
  [tcp] remove EXCLUDE_TCPLP_LIB option (openthread#8883)
  [netdata] add `otNetDataReplacePublishedExternalRoute()` API (openthread#9013)
  [border-agent] fix BorderAgentId compile and enable it in CI tests (openthread#9030)
  github-actions: bump codecov/codecov-action from 3.1.1 to 3.1.3 (openthread#9031)
  [settings] define new Settings key for Border Router ID (openthread#8971)
  [posix] update upstream DNS addresses after a few minutes  (openthread#8972)
  [link-metrics] refactor link metrics module (openthread#8966)
  [cli] refactor br command prefix type (openthread#9022)
  [test] migrate tests to cmake (openthread#8929)
  [ip6] add `otIp6PrefixFromString()` (openthread#9016)
  [netdata] prefer BR acting as router over ED (when all other checks are same) (openthread#9012)
  [net-diag] vendor name, model, and sw version TLVs (openthread#8898)
  • Loading branch information
suveshpratapa committed May 10, 2023
2 parents faafd74 + fccf0f6 commit 202bd57
Show file tree
Hide file tree
Showing 161 changed files with 2,529 additions and 1,850 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/otbr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ jobs:
script/test combine_coverage
- name: Upload Coverage
continue-on-error: true
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3
with:
files: final.info
fail_ci_if_error: true
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/otci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
matrix:
virtual_time: [0, 1]
env:
REFERENCE_DEVICE: 1
VIRTUAL_TIME: ${{ matrix.virtual_time }}
REAL_DEVICE: 0
steps:
Expand All @@ -66,21 +65,21 @@ jobs:
- name: Bootstrap
run: |
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel
sudo apt-get --no-install-recommends install -y g++-multilib ninja-build python3-setuptools python3-wheel
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
python3 -m pip install pytype adb-shell
- name: Style check
run: |
PYTHONPATH=./tests/scripts/thread-cert pytype tools/otci
- name: Build
run: |
./bootstrap
make -f examples/Makefile-simulation THREAD_VERSION=1.3 DUA=1 MLR=1 BACKBONE_ROUTER=1 CSL_RECEIVER=1
./script/cmake-build simulation -DOT_THREAD_VERSION=1.3 -DOT_DUA=ON -DOT_MLR=ON -DOT_BACKBONE_ROUTER=ON \
-DOT_CSL_RECEIVER=ON -DOT_SIMULATION_VIRTUAL_TIME=${VIRTUAL_TIME}
- name: Install OTCI Python Library
run: |
(cd tools/otci && python3 setup.py install --user)
(cd tools/otci && python3 -m pip install .)
- name: Run
run: |
export PYTHONPATH=./tests/scripts/thread-cert/
export OT_CLI=./output/simulation/bin/ot-cli-ftd
export OT_CLI=./build/simulation/examples/apps/cli/ot-cli-ftd
python3 tools/otci/tests/test_otci.py
15 changes: 5 additions & 10 deletions .github/workflows/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,8 @@ jobs:
env:
COVERAGE: 1
PYTHONUNBUFFERED: 1
READLINE: readline
REFERENCE_DEVICE: 1
THREAD_VERSION: 1.1
VIRTUAL_TIME: 1
VIRTUAL_TIME_UART: 1
steps:
- name: Harden Runner
uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1
Expand All @@ -148,21 +145,19 @@ jobs:
- name: Bootstrap
run: |
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get --no-install-recommends install -y libreadline6-dev python3-setuptools python3-wheel lcov
sudo apt-get --no-install-recommends install -y lcov ninja-build python3-setuptools python3-wheel
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
- name: Build
run: |
./bootstrap
make -f examples/Makefile-simulation
make -f src/posix/Makefile-posix
OT_NODE_TYPE=rcp ./script/test build
- name: Run
run: |
VERBOSE=1 OT_CLI_PATH="$PWD/output/posix/bin/ot-cli -v" RADIO_DEVICE="$PWD/output/simulation/bin/ot-rcp" make -f src/posix/Makefile-posix check
MAX_JOBS=$(getconf _NPROCESSORS_ONLN) ./script/test cert_suite ./tests/scripts/thread-cert/Cert_*.py ./tests/scripts/thread-cert/test_*.py
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ failure() }}
with:
name: thread-cert
path: build/posix/tests/scripts/thread-cert
path: ot_testing
- name: Generate Coverage
run: |
./script/test generate_coverage gcc
Expand Down Expand Up @@ -346,7 +341,7 @@ jobs:
run: |
script/test combine_coverage
- name: Upload Coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3
with:
files: final.info
fail_ci_if_error: true
Expand Down
41 changes: 17 additions & 24 deletions .github/workflows/simulation-1.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,19 @@ jobs:
- name: Bootstrap
run: |
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel lcov
sudo apt-get --no-install-recommends install -y lcov ninja-build g++-multilib python3-setuptools python3-wheel
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
- name: Build
run: |
./bootstrap
make -f examples/Makefile-simulation
./script/test build
- name: Run
run: |
VERBOSE=1 make -f examples/Makefile-simulation check
./script/test cert_suite ./tests/scripts/thread-cert/Cert_*.py ./tests/scripts/thread-cert/test_*.py
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ failure() }}
with:
name: cli-ftd-thread-cert
path: build/simulation/tests/scripts/thread-cert
path: ot_testing
- name: Generate Coverage
run: |
./script/test generate_coverage gcc
Expand Down Expand Up @@ -195,20 +194,19 @@ jobs:
- name: Bootstrap
run: |
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel lcov
sudo apt-get --no-install-recommends install -y lcov ninja-build g++-multilib python3-setuptools python3-wheel
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
- name: Build
run: |
./bootstrap
make -f examples/Makefile-simulation
./script/test build
- name: Run
run: |
VERBOSE=1 make -f examples/Makefile-simulation check
./script/test cert_suite ./tests/scripts/thread-cert/Cert_*.py ./tests/scripts/thread-cert/test_*.py
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ failure() }}
with:
name: cli-mtd-thread-cert
path: build/simulation/tests/scripts/thread-cert
path: ot_testing
- name: Generate Coverage
run: |
./script/test generate_coverage gcc
Expand All @@ -226,7 +224,6 @@ jobs:
COVERAGE: 1
REFERENCE_DEVICE: 1
THREAD_VERSION: 1.1
TIME_SYNC: 1
VIRTUAL_TIME: 1
steps:
- name: Harden Runner
Expand All @@ -240,20 +237,19 @@ jobs:
- name: Bootstrap
run: |
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel lcov
sudo apt-get --no-install-recommends install -y g++-multilib lcov ninja-build python3-setuptools python3-wheel
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
- name: Build
run: |
./bootstrap
make -f examples/Makefile-simulation
OT_OPTIONS="-DOT_TIME_SYNC=ON" ./script/test build
- name: Run
run: |
VERBOSE=1 make -f examples/Makefile-simulation check
./script/test cert_suite ./tests/scripts/thread-cert/Cert_*.py ./tests/scripts/thread-cert/test_*.py
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ failure() }}
with:
name: cli-time-sync-thread-cert
path: build/simulation/tests/scripts/thread-cert
path: ot_testing
- name: Generate Coverage
run: |
./script/test generate_coverage gcc
Expand Down Expand Up @@ -355,8 +351,6 @@ jobs:
runs-on: ubuntu-20.04
env:
COVERAGE: 1
MULTIPLE_INSTANCE: 1
REFERENCE_DEVICE: 1
THREAD_VERSION: 1.1
VIRTUAL_TIME: 1
CXXFLAGS: "-DOPENTHREAD_CONFIG_LOG_PREPEND_UPTIME=0"
Expand All @@ -371,19 +365,18 @@ jobs:
submodules: true
- name: Bootstrap
run: |
sudo apt-get --no-install-recommends install -y python3-setuptools python3-wheel lcov
sudo apt-get --no-install-recommends install -y lcov ninja-build python3-setuptools python3-wheel
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
- name: Build
run: |
./bootstrap
make -f examples/Makefile-simulation
OT_OPTIONS="-DOT_MULTIPLE_INSTANCE=ON" ./script/test build
- name: Run
run: |
VERBOSE=1 make -f examples/Makefile-simulation check
./script/test cert_suite ./tests/scripts/thread-cert/Cert_*.py ./tests/scripts/thread-cert/test_*.py
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ failure() }}
with:
name: multiple-instance-thread-cert
name: ot_testing
path: build/simulation/tests/scripts/thread-cert
- name: Generate Coverage
run: |
Expand Down Expand Up @@ -422,7 +415,7 @@ jobs:
run: |
script/test combine_coverage
- name: Upload Coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3
with:
files: final.info
fail_ci_if_error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/simulation-1.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ jobs:
run: |
script/test combine_coverage
- name: Upload Coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3
with:
files: final.info
fail_ci_if_error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toranj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
run: |
script/test combine_coverage
- name: Upload Coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3
with:
files: final.info
fail_ci_if_error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
run: |
script/test combine_coverage
- name: Upload Coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3
with:
files: final.info
fail_ci_if_error: true
Expand Down
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,6 @@ tools/harness-thci/Makefile
tools/spi-hdlc-adapter/Makefile
tests/Makefile
tests/fuzz/Makefile
tests/scripts/Makefile
tests/scripts/thread-cert/Makefile
doc/Makefile
])

Expand Down
32 changes: 32 additions & 0 deletions etc/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ ot_option(OT_BACKBONE_ROUTER OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE "backbone
ot_option(OT_BACKBONE_ROUTER_DUA_NDPROXYING OPENTHREAD_CONFIG_BACKBONE_ROUTER_DUA_NDPROXYING_ENABLE "BBR DUA ND Proxy")
ot_option(OT_BACKBONE_ROUTER_MULTICAST_ROUTING OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE "BBR MR")
ot_option(OT_BORDER_AGENT OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE "border agent")
ot_option(OT_BORDER_AGENT_ID OPENTHREAD_CONFIG_BORDER_AGENT_ID_ENABLE "create and save border agent ID")
ot_option(OT_BORDER_ROUTER OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE "border router")
ot_option(OT_BORDER_ROUTING OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE "border routing")
ot_option(OT_BORDER_ROUTING_COUNTERS OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE "border routing counters")
Expand Down Expand Up @@ -162,6 +163,36 @@ if(OT_FULL_LOGS)
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=1")
endif()

set(OT_VENDOR_NAME "" CACHE STRING "set the vendor name config")
set_property(CACHE OT_VENDOR_NAME PROPERTY STRINGS ${OT_VENDOR_NAME_VALUES})
string(COMPARE EQUAL "${OT_VENDOR_NAME}" "" is_empty)
if (is_empty)
message(STATUS "OT_VENDOR_NAME=\"\"")
else()
message(STATUS "OT_VENDOR_NAME=\"${OT_VENDOR_NAME}\" --> OPENTHREAD_CONFIG_NET_DIAG_VENDOR_NAME=\"${OT_VENDOR_NAME}\"")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_NET_DIAG_VENDOR_NAME=\"${OT_VENDOR_NAME}\"")
endif()

set(OT_VENDOR_MODEL "" CACHE STRING "set the vendor model config")
set_property(CACHE OT_VENDOR_MODEL PROPERTY STRINGS ${OT_VENDOR_MODEL_VALUES})
string(COMPARE EQUAL "${OT_VENDOR_MODEL}" "" is_empty)
if (is_empty)
message(STATUS "OT_VENDOR_MODEL=\"\"")
else()
message(STATUS "OT_VENDOR_MODEL=\"${OT_VENDOR_MODEL}\" --> OPENTHREAD_CONFIG_NET_DIAG_VENDOR_MODEL=\"${OT_VENDOR_MODEL}\"")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_NET_DIAG_VENDOR_MODEL=\"${OT_VENDOR_MODEL}\"")
endif()

set(OT_VENDOR_SW_VERSION "" CACHE STRING "set the vendor sw version config")
set_property(CACHE OT_VENDOR_SW_VERSION PROPERTY STRINGS ${OT_VENDOR_SW_VERSION_VALUES})
string(COMPARE EQUAL "${OT_VENDOR_SW_VERSION}" "" is_empty)
if (is_empty)
message(STATUS "OT_VENDOR_SW_VERSION=\"\"")
else()
message(STATUS "OT_VENDOR_SW_VERSION=\"${OT_VENDOR_SW_VERSION}\" --> OPENTHREAD_CONFIG_NET_DIAG_VENDOR_SW_VERSION=\"${OT_VENDOR_SW_VERSION}\"")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_NET_DIAG_VENDOR_SW_VERSION=\"${OT_VENDOR_SW_VERSION}\"")
endif()

set(OT_POWER_SUPPLY "" CACHE STRING "set the device power supply config")
set(OT_POWER_SUPPLY_VALUES
""
Expand Down Expand Up @@ -236,3 +267,4 @@ macro(ot_removed_option name error)
endmacro()

ot_removed_option(OT_MTD_NETDIAG "- Use OT_NETDIAG_CLIENT instead - note that server function is always supported")
ot_removed_option(OT_EXCLUDE_TCPLP_LIB "- Use OT_TCP instead, OT_EXCLUDE_TCPLP_LIB is deprecated")
3 changes: 3 additions & 0 deletions etc/gn/openthread.gni
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ if (openthread_enable_core_config_args) {
# Enable border agent support
openthread_config_border_agent_enable = false

# Enable border agent ID
openthread_config_border_agent_id_enable = false

# Enable border router support
openthread_config_border_router_enable = false

Expand Down
1 change: 0 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ This page lists the available common switches with description. Unless stated ot
| DUA | OT_DUA | Enables the Domain Unicast Address feature for Thread 1.2. |
| DYNAMIC_LOG_LEVEL | not implemented | Enables the dynamic log level feature. Enable this switch if OpenThread log level is required to be set at runtime. See [Logging guide](https://openthread.io/guides/build/logs) to learn more. |
| ECDSA | OT_ECDSA | Enables support for Elliptic Curve Digital Signature Algorithm. Enable this switch if ECDSA digital signature is used by application. |
| EXCLUDE_TCPLP_LIB | OT_EXCLUDE_TCPLP_LIB | Exclude TCPlp library from the build. |
| EXTERNAL_HEAP | OT_EXTERNAL_HEAP | Enables support for external heap. Enable this switch if the platform uses its own heap. Make sure to specify the external heap Calloc and Free functions to be used by the OpenThread stack. |
| FULL_LOGS | OT_FULL_LOGS | Enables all log levels and regions. This switch sets the log level to OT_LOG_LEVEL_DEBG and turns on all region flags. See [Logging guide](https://openthread.io/guides/build/logs) to learn more. |
| HISTORY_TRACKER | OT_HISTORY_TRACKER | Enables support for History Tracker. |
Expand Down
24 changes: 24 additions & 0 deletions include/openthread/border_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ extern "C" {
*
*/

/**
* The length of Border Agent/Router ID in bytes.
*
*/
#define OT_BORDER_AGENT_ID_LENGTH (16)

/**
* This enumeration defines the Border Agent state.
*
Expand Down Expand Up @@ -82,6 +88,24 @@ otBorderAgentState otBorderAgentGetState(otInstance *aInstance);
*/
uint16_t otBorderAgentGetUdpPort(otInstance *aInstance);

/**
* Gets the randomly generated Border Agent ID.
*
* The ID is saved in persistent storage and survives reboots. The typical use case of the ID is to
* be published in the MeshCoP mDNS service as the `id` TXT value for the client to identify this
* Border Router/Agent device.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[out] aId A pointer to buffer to receive the ID.
* @param[inout] aLength Specifies the length of `aId` when used as input and receives the length
* actual ID data copied to `aId` when used as output.
*
* @retval OT_ERROR_INVALID_ARGS If value of `aLength` if smaller than `OT_BORDER_AGENT_ID_LENGTH`.
* @retval OT_ERROR_NONE If successfully retrieved the Border Agent ID.
*
*/
otError otBorderAgentGetId(otInstance *aInstance, uint8_t *aId, uint16_t *aLength);

/**
* @}
*
Expand Down
2 changes: 1 addition & 1 deletion include/openthread/instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (315)
#define OPENTHREAD_API_VERSION (320)

/**
* @addtogroup api-instance
Expand Down
19 changes: 17 additions & 2 deletions include/openthread/ip6.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,27 @@ bool otIp6ArePrefixesEqual(const otIp6Prefix *aFirst, const otIp6Prefix *aSecond
* @param[in] aString A pointer to a NULL-terminated string.
* @param[out] aAddress A pointer to an IPv6 address.
*
* @retval OT_ERROR_NONE Successfully parsed the string.
* @retval OT_ERROR_INVALID_ARGS Failed to parse the string.
* @retval OT_ERROR_NONE Successfully parsed @p aString and updated @p aAddress.
* @retval OT_ERROR_PARSE Failed to parse @p aString as an IPv6 address.
*
*/
otError otIp6AddressFromString(const char *aString, otIp6Address *aAddress);

/**
* This function converts a human-readable IPv6 prefix string into a binary representation.
*
* The @p aString parameter should be a string in the format "<address>/<plen>", where `<address>` is an IPv6
* address and `<plen>` is a prefix length.
*
* @param[in] aString A pointer to a NULL-terminated string.
* @param[out] aPrefix A pointer to an IPv6 prefix.
*
* @retval OT_ERROR_NONE Successfully parsed the string as an IPv6 prefix and updated @p aPrefix.
* @retval OT_ERROR_PARSE Failed to parse @p aString as an IPv6 prefix.
*
*/
otError otIp6PrefixFromString(const char *aString, otIp6Prefix *aPrefix);

#define OT_IP6_ADDRESS_STRING_SIZE 40 ///< Recommended size for string representation of an IPv6 address.

/**
Expand Down
Loading

0 comments on commit 202bd57

Please sign in to comment.