mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Merge branch 'feat/update_ot_upstream_v53' into 'release/v5.3'
feat(openthread): update openthread upstream submodule to support BR DNS resolution (v5.3) See merge request espressif/esp-idf!38187
This commit is contained in:
@ -17,6 +17,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
|
|||||||
"openthread/examples/platforms"
|
"openthread/examples/platforms"
|
||||||
"openthread/src"
|
"openthread/src"
|
||||||
"openthread/src/core"
|
"openthread/src/core"
|
||||||
|
"openthread/src/include"
|
||||||
"openthread/src/lib"
|
"openthread/src/lib"
|
||||||
"openthread/src/lib/hdlc"
|
"openthread/src/lib/hdlc"
|
||||||
"openthread/src/lib/spinel"
|
"openthread/src/lib/spinel"
|
||||||
@ -102,8 +103,10 @@ if(CONFIG_OPENTHREAD_ENABLED)
|
|||||||
"openthread/src/core/thread/announce_sender.cpp"
|
"openthread/src/core/thread/announce_sender.cpp"
|
||||||
"openthread/src/core/thread/address_resolver.cpp"
|
"openthread/src/core/thread/address_resolver.cpp"
|
||||||
"openthread/src/core/thread/child_supervision.cpp"
|
"openthread/src/core/thread/child_supervision.cpp"
|
||||||
|
"openthread/src/core/thread/csl_tx_scheduler.cpp"
|
||||||
"openthread/src/core/thread/discover_scanner.cpp"
|
"openthread/src/core/thread/discover_scanner.cpp"
|
||||||
"openthread/src/core/thread/energy_scan_server.cpp"
|
"openthread/src/core/thread/energy_scan_server.cpp"
|
||||||
|
"openthread/src/core/thread/indirect_sender.cpp"
|
||||||
"openthread/src/core/thread/key_manager.cpp"
|
"openthread/src/core/thread/key_manager.cpp"
|
||||||
"openthread/src/core/thread/link_metrics.cpp"
|
"openthread/src/core/thread/link_metrics.cpp"
|
||||||
"openthread/src/core/thread/lowpan.cpp"
|
"openthread/src/core/thread/lowpan.cpp"
|
||||||
@ -215,6 +218,7 @@ elseif(CONFIG_OPENTHREAD_SPINEL_ONLY)
|
|||||||
"private_include"
|
"private_include"
|
||||||
"openthread/src"
|
"openthread/src"
|
||||||
"openthread/src/core"
|
"openthread/src/core"
|
||||||
|
"openthread/src/include"
|
||||||
"openthread/src/lib"
|
"openthread/src/lib"
|
||||||
"openthread/src/lib/hdlc"
|
"openthread/src/lib/hdlc"
|
||||||
"openthread/src/lib/spinel")
|
"openthread/src/lib/spinel")
|
||||||
|
Submodule components/openthread/lib updated: 6f8e03592e...5e45cc792c
Submodule components/openthread/openthread updated: 005c5cefc2...8c30b93fee
@ -440,6 +440,16 @@
|
|||||||
#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 1
|
#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE
|
||||||
|
*
|
||||||
|
* Define to 1 to enable upstream forwarding support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE
|
||||||
|
#define OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
* @def OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||||
*
|
*
|
||||||
|
@ -5,4 +5,4 @@ supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
|
|||||||
originator: 'Organization: Google LLC'
|
originator: 'Organization: Google LLC'
|
||||||
description: OpenThread released by Google is an open-source implementation of the Thread networking
|
description: OpenThread released by Google is an open-source implementation of the Thread networking
|
||||||
url: https://github.com/espressif/openthread
|
url: https://github.com/espressif/openthread
|
||||||
hash: 005c5cefc22aaf0396e4327ee7f2e0ad32a7733b
|
hash: 8c30b93feed13f2da38f8592b3ed94f4d0a077a4
|
||||||
|
@ -93,6 +93,7 @@ esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *conf
|
|||||||
iidList[0] = 0;
|
iidList[0] = 0;
|
||||||
|
|
||||||
ot::Spinel::RadioSpinelCallbacks callbacks;
|
ot::Spinel::RadioSpinelCallbacks callbacks;
|
||||||
|
memset(&callbacks, 0, sizeof(callbacks));
|
||||||
#if CONFIG_OPENTHREAD_DIAG
|
#if CONFIG_OPENTHREAD_DIAG
|
||||||
callbacks.mDiagReceiveDone = otPlatDiagRadioReceiveDone;
|
callbacks.mDiagReceiveDone = otPlatDiagRadioReceiveDone;
|
||||||
callbacks.mDiagTransmitDone = otPlatDiagRadioTransmitDone;
|
callbacks.mDiagTransmitDone = otPlatDiagRadioTransmitDone;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -41,6 +41,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct pbuf *p;
|
struct pbuf *p;
|
||||||
|
otSockAddr *source_addr;
|
||||||
} ot_trel_recv_task_t;
|
} ot_trel_recv_task_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -90,7 +91,8 @@ static void trel_browse_notifier(mdns_result_t *result)
|
|||||||
|
|
||||||
static void trel_recv_task(void *ctx)
|
static void trel_recv_task(void *ctx)
|
||||||
{
|
{
|
||||||
struct pbuf *recv_buf = (struct pbuf *)ctx;
|
ot_trel_recv_task_t *task_ctx = (ot_trel_recv_task_t *)ctx;
|
||||||
|
struct pbuf *recv_buf = task_ctx->p;
|
||||||
uint8_t *data_buf = (uint8_t *)recv_buf->payload;
|
uint8_t *data_buf = (uint8_t *)recv_buf->payload;
|
||||||
uint8_t *data_buf_to_free = NULL;
|
uint8_t *data_buf_to_free = NULL;
|
||||||
uint16_t length = recv_buf->len;
|
uint16_t length = recv_buf->len;
|
||||||
@ -106,21 +108,49 @@ static void trel_recv_task(void *ctx)
|
|||||||
ExitNow();
|
ExitNow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
otPlatTrelHandleReceived(esp_openthread_get_instance(), data_buf, length);
|
otPlatTrelHandleReceived(esp_openthread_get_instance(), data_buf, length, task_ctx->source_addr);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (data_buf_to_free) {
|
if (data_buf_to_free) {
|
||||||
free(data_buf_to_free);
|
free(data_buf_to_free);
|
||||||
}
|
}
|
||||||
pbuf_free(recv_buf);
|
pbuf_free(recv_buf);
|
||||||
|
if(task_ctx) {
|
||||||
|
free(task_ctx->source_addr);
|
||||||
|
}
|
||||||
|
free(task_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_trel_udp_recv(void *ctx, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, uint16_t port)
|
static void handle_trel_udp_recv(void *ctx, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, uint16_t port)
|
||||||
{
|
{
|
||||||
ESP_LOGD(OT_PLAT_LOG_TAG, "Receive from %s:%d", ip6addr_ntoa(&(addr->u_addr.ip6)), port);
|
ESP_LOGD(OT_PLAT_LOG_TAG, "Receive from %s:%d", ip6addr_ntoa(&(addr->u_addr.ip6)), port);
|
||||||
if (esp_openthread_task_queue_post(trel_recv_task, p) != ESP_OK) {
|
|
||||||
ESP_LOGE(OT_PLAT_LOG_TAG, "Failed to receive OpenThread TREL message");
|
ot_trel_recv_task_t *task_ctx = (ot_trel_recv_task_t *)malloc(sizeof(ot_trel_recv_task_t));
|
||||||
|
if (task_ctx == NULL) {
|
||||||
|
ESP_LOGE(OT_PLAT_LOG_TAG, "Failed to allocate buf for Thread TREL");
|
||||||
|
ExitNow();
|
||||||
}
|
}
|
||||||
|
task_ctx->p = p;
|
||||||
|
task_ctx->source_addr = (otSockAddr *)malloc(sizeof(otSockAddr));
|
||||||
|
if (task_ctx->source_addr == NULL) {
|
||||||
|
ESP_LOGE(OT_PLAT_LOG_TAG, "Failed to allocate buf for Thread TREL");
|
||||||
|
ExitNow();
|
||||||
|
}
|
||||||
|
memset(task_ctx->source_addr, 0, sizeof(otSockAddr));
|
||||||
|
task_ctx->source_addr->mPort = port;
|
||||||
|
memcpy(&task_ctx->source_addr->mAddress.mFields.m32, addr->u_addr.ip6.addr, sizeof(addr->u_addr.ip6.addr));
|
||||||
|
|
||||||
|
if (esp_openthread_task_queue_post(trel_recv_task, task_ctx) != ESP_OK) {
|
||||||
|
ESP_LOGE(OT_PLAT_LOG_TAG, "Failed to receive OpenThread TREL message");
|
||||||
|
ExitNow();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
exit:
|
||||||
|
if(task_ctx) {
|
||||||
|
free(task_ctx->source_addr);
|
||||||
|
}
|
||||||
|
free(task_ctx);
|
||||||
|
pbuf_free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static esp_err_t ot_new_trel(void *ctx)
|
static esp_err_t ot_new_trel(void *ctx)
|
||||||
@ -198,6 +228,20 @@ void otPlatTrelSend(otInstance *aInstance,
|
|||||||
esp_openthread_task_switching_lock_acquire(portMAX_DELAY);
|
esp_openthread_task_switching_lock_acquire(portMAX_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void otPlatTrelNotifyPeerSocketAddressDifference(otInstance *aInstance,
|
||||||
|
const otSockAddr *aPeerSockAddr,
|
||||||
|
const otSockAddr *aRxSockAddr)
|
||||||
|
{
|
||||||
|
OT_UNUSED_VARIABLE(aInstance);
|
||||||
|
|
||||||
|
char peer_string[OT_IP6_SOCK_ADDR_STRING_SIZE];
|
||||||
|
char rx_string[OT_IP6_SOCK_ADDR_STRING_SIZE];
|
||||||
|
otIp6SockAddrToString(aPeerSockAddr, peer_string, sizeof(peer_string));
|
||||||
|
otIp6SockAddrToString(aRxSockAddr, rx_string, sizeof(rx_string));
|
||||||
|
|
||||||
|
ESP_LOGW(OT_PLAT_LOG_TAG, "TREL packet is received from a peer (%s) using a different socket address (%s)", peer_string, rx_string);
|
||||||
|
}
|
||||||
|
|
||||||
void otPlatTrelRegisterService(otInstance *aInstance, uint16_t aPort, const uint8_t *aTxtData, uint8_t aTxtLength)
|
void otPlatTrelRegisterService(otInstance *aInstance, uint16_t aPort, const uint8_t *aTxtData, uint8_t aTxtLength)
|
||||||
{
|
{
|
||||||
esp_err_t ret = ESP_OK;
|
esp_err_t ret = ESP_OK;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -258,7 +258,7 @@ static uint8_t get_netif_index(otNetifIdentifier netif_identifier)
|
|||||||
switch (netif_identifier) {
|
switch (netif_identifier) {
|
||||||
case OT_NETIF_UNSPECIFIED:
|
case OT_NETIF_UNSPECIFIED:
|
||||||
return NETIF_NO_INDEX;
|
return NETIF_NO_INDEX;
|
||||||
case OT_NETIF_THREAD:
|
case OT_NETIF_THREAD_HOST:
|
||||||
return esp_netif_get_netif_impl_index(esp_openthread_get_netif());
|
return esp_netif_get_netif_impl_index(esp_openthread_get_netif());
|
||||||
case OT_NETIF_BACKBONE:
|
case OT_NETIF_BACKBONE:
|
||||||
return esp_netif_get_netif_impl_index(esp_openthread_get_backbone_netif());
|
return esp_netif_get_netif_impl_index(esp_openthread_get_backbone_netif());
|
||||||
@ -351,7 +351,7 @@ static void udp_send_task(void *ctx)
|
|||||||
VerifyOrExit(send_buf != NULL);
|
VerifyOrExit(send_buf != NULL);
|
||||||
otMessageRead(task->message, 0, send_buf->payload, len);
|
otMessageRead(task->message, 0, send_buf->payload, len);
|
||||||
|
|
||||||
if (task->netif_index == get_netif_index(OT_NETIF_THREAD)) {
|
if (task->netif_index == get_netif_index(OT_NETIF_THREAD_HOST)) {
|
||||||
// If the input arguments indicated the netif is OT, directly send the message.
|
// If the input arguments indicated the netif is OT, directly send the message.
|
||||||
err = udp_sendto_if_src(task->pcb, send_buf, &task->peer_addr, task->peer_port, netif_get_by_index(task->netif_index), &task->source_addr);
|
err = udp_sendto_if_src(task->pcb, send_buf, &task->peer_addr, task->peer_port, netif_get_by_index(task->netif_index), &task->source_addr);
|
||||||
} else {
|
} else {
|
||||||
@ -402,12 +402,12 @@ otError otPlatUdpSend(otUdpSocket *udp_socket, otMessage *message, const otMessa
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (is_link_local(&message_info->mPeerAddr) || is_multicast(&message_info->mPeerAddr)) {
|
if (is_link_local(&message_info->mPeerAddr) || is_multicast(&message_info->mPeerAddr)) {
|
||||||
task->netif_index = get_netif_index(message_info->mIsHostInterface ? OT_NETIF_BACKBONE : OT_NETIF_THREAD);
|
task->netif_index = get_netif_index(message_info->mIsHostInterface ? OT_NETIF_BACKBONE : OT_NETIF_THREAD_HOST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_openthread_internal_mesh_local_addr(&message_info->mPeerAddr)) {
|
if (is_openthread_internal_mesh_local_addr(&message_info->mPeerAddr)) {
|
||||||
// If the destination address is a openthread mesh local address, set the netif OT.
|
// If the destination address is a openthread mesh local address, set the netif OT.
|
||||||
task->netif_index = get_netif_index(OT_NETIF_THREAD);
|
task->netif_index = get_netif_index(OT_NETIF_THREAD_HOST);
|
||||||
}
|
}
|
||||||
esp_openthread_task_switching_lock_release();
|
esp_openthread_task_switching_lock_release();
|
||||||
tcpip_callback(udp_send_task, task);
|
tcpip_callback(udp_send_task, task);
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
#include "esp_openthread_types.h"
|
#include "esp_openthread_types.h"
|
||||||
#include "esp_openthread_uart.h"
|
#include "esp_openthread_uart.h"
|
||||||
#include "driver/uart_vfs.h"
|
#include "driver/uart_vfs.h"
|
||||||
#include "core/common/code_utils.hpp"
|
#include "common/code_utils.hpp"
|
||||||
#include "core/common/logging.hpp"
|
#include "common/logging.hpp"
|
||||||
#include "driver/uart.h"
|
#include "driver/uart.h"
|
||||||
#include "lib/platform/exit_code.h"
|
#include "lib/platform/exit_code.h"
|
||||||
#include "openthread/platform/time.h"
|
#include "openthread/platform/time.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "esp_openthread_common_macro.h"
|
#include "esp_openthread_common_macro.h"
|
||||||
#include "openthread/platform/time.h"
|
#include "openthread/platform/time.h"
|
||||||
#include "hdlc.hpp"
|
#include "hdlc.hpp"
|
||||||
#include "core/common/code_utils.hpp"
|
#include "common/code_utils.hpp"
|
||||||
|
|
||||||
namespace esp {
|
namespace esp {
|
||||||
namespace radio_spinel {
|
namespace radio_spinel {
|
||||||
|
@ -448,7 +448,7 @@ def test_service_discovery_of_WiFi_device(Init_interface:bool, Init_avahi:bool,
|
|||||||
cli.expect('Done', timeout=10)
|
cli.expect('Done', timeout=10)
|
||||||
|
|
||||||
command = 'dns browse _testxxx._udp.default.service.arpa'
|
command = 'dns browse _testxxx._udp.default.service.arpa'
|
||||||
tmp = ocf.get_ouput_string(cli, command, 5)
|
tmp = ocf.get_ouput_string(cli, command, 10)
|
||||||
assert 'Port:12347' not in str(tmp)
|
assert 'Port:12347' not in str(tmp)
|
||||||
ocf.restart_avahi()
|
ocf.restart_avahi()
|
||||||
command = 'avahi-publish-service testxxx _testxxx._udp 12347 test=1235 dn="for_ci_br_test"'
|
command = 'avahi-publish-service testxxx _testxxx._udp 12347 test=1235 dn="for_ci_br_test"'
|
||||||
@ -457,12 +457,12 @@ def test_service_discovery_of_WiFi_device(Init_interface:bool, Init_avahi:bool,
|
|||||||
ocf.wait(cli, 5)
|
ocf.wait(cli, 5)
|
||||||
|
|
||||||
command = 'dns browse _testxxx._udp.default.service.arpa'
|
command = 'dns browse _testxxx._udp.default.service.arpa'
|
||||||
tmp = ocf.get_ouput_string(cli, command, 5)
|
tmp = ocf.get_ouput_string(cli, command, 10)
|
||||||
assert 'response for _testxxx' in str(tmp)
|
assert 'response for _testxxx' in str(tmp)
|
||||||
assert 'Port:12347' in str(tmp)
|
assert 'Port:12347' in str(tmp)
|
||||||
|
|
||||||
command = 'dns service testxxx _testxxx._udp.default.service.arpa.'
|
command = 'dns service testxxx _testxxx._udp.default.service.arpa.'
|
||||||
tmp = ocf.get_ouput_string(cli, command, 5)
|
tmp = ocf.get_ouput_string(cli, command, 10)
|
||||||
assert 'response for testxxx' in str(tmp)
|
assert 'response for testxxx' in str(tmp)
|
||||||
assert 'Port:12347' in str(tmp)
|
assert 'Port:12347' in str(tmp)
|
||||||
finally:
|
finally:
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
.zigbee_dependencies: &zigbee_dependencies
|
.zigbee_dependencies: &zigbee_dependencies
|
||||||
depends_components:
|
depends_components:
|
||||||
- ieee802154
|
- ieee802154
|
||||||
|
- openthread
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/zigbee/light_sample/**/*
|
- examples/zigbee/light_sample/**/*
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user