diff --git a/src/core/BUILD.gn b/src/core/BUILD.gn index 284767fbb..d16c51141 100644 --- a/src/core/BUILD.gn +++ b/src/core/BUILD.gn @@ -733,6 +733,12 @@ openthread_core_files = [ "thread/neighbor.hpp", "thread/neighbor_table.cpp", "thread/neighbor_table.hpp", + "thread/net_diag.cpp", + "thread/net_diag.hpp", + "thread/net_diag_tlvs.cpp", + "thread/net_diag_tlvs.hpp", + "thread/net_diag_types.cpp", + "thread/net_diag_types.hpp", "thread/network_data.cpp", "thread/network_data.hpp", "thread/network_data_leader.cpp", @@ -750,12 +756,6 @@ openthread_core_files = [ "thread/network_data_tlvs.hpp", "thread/network_data_types.cpp", "thread/network_data_types.hpp", - "thread/network_diagnostic.cpp", - "thread/network_diagnostic.hpp", - "thread/network_diagnostic_tlvs.cpp", - "thread/network_diagnostic_tlvs.hpp", - "thread/network_diagnostic_types.cpp", - "thread/network_diagnostic_types.hpp", "thread/panid_query_server.cpp", "thread/panid_query_server.hpp", "thread/peer.cpp", @@ -908,8 +908,8 @@ source_set("libopenthread_core_config") { "config/misc.h", "config/mle.h", "config/nat64.h", + "config/net_diag.h", "config/netdata_publisher.h", - "config/network_diagnostic.h", "config/openthread-core-config-check.h", "config/p2p.h", "config/parent_search.h", diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 743c90a84..eb5fe3a72 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -257,6 +257,9 @@ set(COMMON_SOURCES thread/mlr_types.cpp thread/neighbor.cpp thread/neighbor_table.cpp + thread/net_diag.cpp + thread/net_diag_tlvs.cpp + thread/net_diag_types.cpp thread/network_data.cpp thread/network_data_leader.cpp thread/network_data_leader_ftd.cpp @@ -266,9 +269,6 @@ set(COMMON_SOURCES thread/network_data_service.cpp thread/network_data_tlvs.cpp thread/network_data_types.cpp - thread/network_diagnostic.cpp - thread/network_diagnostic_tlvs.cpp - thread/network_diagnostic_types.cpp thread/panid_query_server.cpp thread/peer.cpp thread/peer_table.cpp diff --git a/src/core/api/netdiag_api.cpp b/src/core/api/netdiag_api.cpp index ef2c42f73..df39dd26f 100644 --- a/src/core/api/netdiag_api.cpp +++ b/src/core/api/netdiag_api.cpp @@ -46,7 +46,7 @@ otError otThreadGetNextDiagnosticTlv(const otMessage *aMessage, AssertPointerIsNotNull(aIterator); AssertPointerIsNotNull(aNetworkDiagTlv); - return NetworkDiagnostic::Client::GetNextDiagTlv(AsCoapMessage(aMessage), *aIterator, *aNetworkDiagTlv); + return NetDiag::Client::GetNextDiagTlv(AsCoapMessage(aMessage), *aIterator, *aNetworkDiagTlv); } otError otThreadSendDiagnosticGet(otInstance *aInstance, @@ -56,8 +56,8 @@ otError otThreadSendDiagnosticGet(otInstance *aInstance, otReceiveDiagnosticGetCallback aCallback, void *aCallbackContext) { - return AsCoreType(aInstance).Get().SendDiagnosticGet( - AsCoreType(aDestination), aTlvTypes, aCount, aCallback, aCallbackContext); + return AsCoreType(aInstance).Get().SendDiagnosticGet(AsCoreType(aDestination), aTlvTypes, aCount, + aCallback, aCallbackContext); } otError otThreadSendDiagnosticReset(otInstance *aInstance, @@ -65,8 +65,8 @@ otError otThreadSendDiagnosticReset(otInstance *aInstance, const uint8_t aTlvTypes[], uint8_t aCount) { - return AsCoreType(aInstance).Get().SendDiagnosticReset(AsCoreType(aDestination), - aTlvTypes, aCount); + return AsCoreType(aInstance).Get().SendDiagnosticReset(AsCoreType(aDestination), aTlvTypes, + aCount); } #endif // OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE @@ -118,17 +118,17 @@ otError otThreadSetVendorOui(otInstance *aInstance, uint32_t aVendorOui) void otThreadSetNonPreferredChannels(otInstance *aInstance, otChannelMask aChannelMask) { - return AsCoreType(aInstance).Get().SetNonPreferredChannels(aChannelMask); + return AsCoreType(aInstance).Get().SetNonPreferredChannels(aChannelMask); } otChannelMask otThreadGetNonPreferredChannels(otInstance *aInstance) { - return AsCoreType(aInstance).Get().GetNonPreferredChannels(); + return AsCoreType(aInstance).Get().GetNonPreferredChannels(); } void otThreadSetNonPreferredChannelsResetCallback(otInstance *aInstance, otThreadNonPreferredChannelsResetCallback aCallback, void *aContext) { - AsCoreType(aInstance).Get().SetNonPreferredChannelsResetCallback(aCallback, aContext); + AsCoreType(aInstance).Get().SetNonPreferredChannelsResetCallback(aCallback, aContext); } diff --git a/src/core/config/network_diagnostic.h b/src/core/config/net_diag.h similarity index 97% rename from src/core/config/network_diagnostic.h rename to src/core/config/net_diag.h index ed202398c..824895dae 100644 --- a/src/core/config/network_diagnostic.h +++ b/src/core/config/net_diag.h @@ -31,8 +31,8 @@ * This file includes compile-time configurations for the Network Diagnostics. */ -#ifndef OT_CORE_CONFIG_NETWORK_DIAGNOSTIC_H_ -#define OT_CORE_CONFIG_NETWORK_DIAGNOSTIC_H_ +#ifndef OT_CORE_CONFIG_NET_DIAG_H_ +#define OT_CORE_CONFIG_NET_DIAG_H_ /** * @addtogroup config-network-diagnostic @@ -122,4 +122,4 @@ * @} */ -#endif // OT_CORE_CONFIG_NETWORK_DIAGNOSTIC_H_ +#endif // OT_CORE_CONFIG_NET_DIAG_H_ diff --git a/src/core/instance/instance.cpp b/src/core/instance/instance.cpp index cf706867e..701c74ad6 100644 --- a/src/core/instance/instance.cpp +++ b/src/core/instance/instance.cpp @@ -170,9 +170,9 @@ Instance::Instance(void) #endif , mNetworkDataServiceManager(*this) , mVendorInfo(*this) - , mNetworkDiagnosticServer(*this) + , mNetDiagServer(*this) #if OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE - , mNetworkDiagnosticClient(*this) + , mNetDiagClient(*this) #endif #if OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE , mBorderAgentTxtData(*this) diff --git a/src/core/instance/instance.hpp b/src/core/instance/instance.hpp index aff0b43f4..b2f28baf6 100644 --- a/src/core/instance/instance.hpp +++ b/src/core/instance/instance.hpp @@ -137,11 +137,11 @@ #include "thread/message_framer.hpp" #include "thread/mle.hpp" #include "thread/mlr_manager.hpp" +#include "thread/net_diag.hpp" #include "thread/network_data_local.hpp" #include "thread/network_data_notifier.hpp" #include "thread/network_data_publisher.hpp" #include "thread/network_data_service.hpp" -#include "thread/network_diagnostic.hpp" #include "thread/panid_query_server.hpp" #include "thread/radio_selector.hpp" #include "thread/thread_netif.hpp" @@ -711,9 +711,9 @@ private: VendorInfo mVendorInfo; - NetworkDiagnostic::Server mNetworkDiagnosticServer; + NetDiag::Server mNetDiagServer; #if OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE - NetworkDiagnostic::Client mNetworkDiagnosticClient; + NetDiag::Client mNetDiagClient; #endif #if OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE @@ -1128,10 +1128,10 @@ template <> inline Dns::Multicast::Core &Instance::Get(void) { return mMdnsCore; template <> inline VendorInfo &Instance::Get(void) { return mVendorInfo; } -template <> inline NetworkDiagnostic::Server &Instance::Get(void) { return mNetworkDiagnosticServer; } +template <> inline NetDiag::Server &Instance::Get(void) { return mNetDiagServer; } #if OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE -template <> inline NetworkDiagnostic::Client &Instance::Get(void) { return mNetworkDiagnosticClient; } +template <> inline NetDiag::Client &Instance::Get(void) { return mNetDiagClient; } #endif #if OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE diff --git a/src/core/meshcop/tcat_agent.cpp b/src/core/meshcop/tcat_agent.cpp index 67cafe2cd..8219a0c46 100644 --- a/src/core/meshcop/tcat_agent.cpp +++ b/src/core/meshcop/tcat_agent.cpp @@ -39,7 +39,7 @@ #include "common/error.hpp" #include "crypto/storage.hpp" #include "instance/instance.hpp" -#include "thread/network_diagnostic.hpp" +#include "thread/net_diag.hpp" namespace ot { namespace MeshCoP { @@ -626,8 +626,7 @@ Error TcatAgent::HandleGetDiagnosticTlvs(const Message &aIncomingMessage, extTlv.SetLength(0); SuccessOrExit(error = aOutgoingMessage.Append(extTlv)); - error = - Get().AppendRequestedTlvsForTcat(aIncomingMessage, aOutgoingMessage, aOffsetRange); + error = Get().AppendRequestedTlvsForTcat(aIncomingMessage, aOutgoingMessage, aOffsetRange); // Ensure enough message buffers are left for transmission of the result. Report error otherwise. if (Get().GetFreeBufferCount() < kBufferReserve) diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index 0fe8f0631..576403d79 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -97,8 +97,8 @@ #include "config/misc.h" #include "config/mle.h" #include "config/nat64.h" +#include "config/net_diag.h" #include "config/netdata_publisher.h" -#include "config/network_diagnostic.h" #include "config/p2p.h" #include "config/parent_search.h" #include "config/ping_sender.h" diff --git a/src/core/thread/network_diagnostic.cpp b/src/core/thread/net_diag.cpp similarity index 99% rename from src/core/thread/network_diagnostic.cpp rename to src/core/thread/net_diag.cpp index 6ee9c0a7d..8406ddc35 100644 --- a/src/core/thread/network_diagnostic.cpp +++ b/src/core/thread/net_diag.cpp @@ -31,7 +31,7 @@ * This file implements Thread's Network Diagnostic processing. */ -#include "network_diagnostic.hpp" +#include "net_diag.hpp" #include "instance/instance.hpp" @@ -39,7 +39,7 @@ namespace ot { RegisterLogModule("NetDiag"); -namespace NetworkDiagnostic { +namespace NetDiag { //--------------------------------------------------------------------------------------------------------------------- // Server @@ -1338,6 +1338,6 @@ const char *Client::UriToString(Uri aUri) #endif // OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE -} // namespace NetworkDiagnostic +} // namespace NetDiag } // namespace ot diff --git a/src/core/thread/network_diagnostic.hpp b/src/core/thread/net_diag.hpp similarity index 97% rename from src/core/thread/network_diagnostic.hpp rename to src/core/thread/net_diag.hpp index 38e66307a..6de24f8ed 100644 --- a/src/core/thread/network_diagnostic.hpp +++ b/src/core/thread/net_diag.hpp @@ -31,8 +31,8 @@ * This file includes definitions for handle network diagnostic. */ -#ifndef OT_CORE_THREAD_NETWORK_DIAGNOSTIC_HPP_ -#define OT_CORE_THREAD_NETWORK_DIAGNOSTIC_HPP_ +#ifndef OT_CORE_THREAD_NET_DIAG_HPP_ +#define OT_CORE_THREAD_NET_DIAG_HPP_ #include "openthread-core-config.h" @@ -44,8 +44,8 @@ #include "common/non_copyable.hpp" #include "common/numeric_limits.hpp" #include "net/udp6.hpp" -#include "thread/network_diagnostic_tlvs.hpp" -#include "thread/network_diagnostic_types.hpp" +#include "thread/net_diag_tlvs.hpp" +#include "thread/net_diag_types.hpp" #include "thread/tmf.hpp" #include "thread/uri_paths.hpp" @@ -59,7 +59,7 @@ namespace MeshCoP { class TcatAgent; } -namespace NetworkDiagnostic { +namespace NetDiag { /** * @addtogroup core-netdiag @@ -303,8 +303,8 @@ DeclareTmfHandler(Client, kUriDiagnosticReset); /** * @} */ -} // namespace NetworkDiagnostic +} // namespace NetDiag } // namespace ot -#endif // OT_CORE_THREAD_NETWORK_DIAGNOSTIC_HPP_ +#endif // OT_CORE_THREAD_NET_DIAG_HPP_ diff --git a/src/core/thread/network_diagnostic_tlvs.cpp b/src/core/thread/net_diag_tlvs.cpp similarity index 99% rename from src/core/thread/network_diagnostic_tlvs.cpp rename to src/core/thread/net_diag_tlvs.cpp index 8a3104078..6956cdcf0 100644 --- a/src/core/thread/network_diagnostic_tlvs.cpp +++ b/src/core/thread/net_diag_tlvs.cpp @@ -31,12 +31,12 @@ * This file implements methods for generating and processing Network Diagnostics TLVs. */ -#include "network_diagnostic_tlvs.hpp" +#include "net_diag_tlvs.hpp" #include "common/time.hpp" namespace ot { -namespace NetworkDiagnostic { +namespace NetDiag { //--------------------------------------------------------------------------------------------------------------------- // ChildTableTlvEntry @@ -292,5 +292,5 @@ void MleCountersTlv::Read(MleCounters &aDiagMleCounters) const aDiagMleCounters.mLeaderTime = BigEndian::HostSwap64(mLeaderTime); } -} // namespace NetworkDiagnostic +} // namespace NetDiag } // namespace ot diff --git a/src/core/thread/network_diagnostic_tlvs.hpp b/src/core/thread/net_diag_tlvs.hpp similarity index 98% rename from src/core/thread/network_diagnostic_tlvs.hpp rename to src/core/thread/net_diag_tlvs.hpp index 4affd0aa8..1efa1a50b 100644 --- a/src/core/thread/network_diagnostic_tlvs.hpp +++ b/src/core/thread/net_diag_tlvs.hpp @@ -31,8 +31,8 @@ * This file includes definitions for generating and processing Network Diagnostics TLVs. */ -#ifndef OT_CORE_THREAD_NETWORK_DIAGNOSTIC_TLVS_HPP_ -#define OT_CORE_THREAD_NETWORK_DIAGNOSTIC_TLVS_HPP_ +#ifndef OT_CORE_THREAD_NET_DIAG_TLVS_HPP_ +#define OT_CORE_THREAD_NET_DIAG_TLVS_HPP_ #include "openthread-core-config.h" @@ -54,7 +54,7 @@ #include "thread/router.hpp" namespace ot { -namespace NetworkDiagnostic { +namespace NetDiag { /** * Implements Network Diagnostic TLV generation and parsing. @@ -299,7 +299,7 @@ typedef TlvInfo ConnectivityTlv; class RouteTlv : public Mle::RouteTlv { public: - static constexpr uint8_t kType = ot::NetworkDiagnostic::Tlv::kRoute; ///< The TLV Type value. + static constexpr uint8_t kType = ot::NetDiag::Tlv::kRoute; ///< The TLV Type value. /** * Finds and parses a Route TLV in a given message. @@ -354,7 +354,7 @@ public: /** * Reads the counters from TLV. * - * @param[out] aDiagMacCounters A reference to `NetworkDiagnostic::MacCounters` to populate. + * @param[out] aDiagMacCounters A reference to `NetDiag::MacCounters` to populate. */ void Read(MacCounters &aDiagMacCounters) const; @@ -895,7 +895,7 @@ public: * * Reads the counters from TLV. * - * @param[out] aDiagMleCounters A reference to `NetworkDiagnostic::MleCounters` to populate. + * @param[out] aDiagMleCounters A reference to `NetDiag::MleCounters` to populate. */ void Read(MleCounters &aDiagMleCounters) const; @@ -917,10 +917,10 @@ private: uint64_t mLeaderTime; // Milliseconds device has been in leader role. } OT_TOOL_PACKED_END; -} // namespace NetworkDiagnostic +} // namespace NetDiag -DefineCoreType(otNetworkDiagConnectivity, NetworkDiagnostic::Connectivity); +DefineCoreType(otNetworkDiagConnectivity, NetDiag::Connectivity); } // namespace ot -#endif // OT_CORE_THREAD_NETWORK_DIAGNOSTIC_TLVS_HPP_ +#endif // OT_CORE_THREAD_NET_DIAG_TLVS_HPP_ diff --git a/src/core/thread/network_diagnostic_types.cpp b/src/core/thread/net_diag_types.cpp similarity index 96% rename from src/core/thread/network_diagnostic_types.cpp rename to src/core/thread/net_diag_types.cpp index 56267730f..cbdecfcbe 100644 --- a/src/core/thread/network_diagnostic_types.cpp +++ b/src/core/thread/net_diag_types.cpp @@ -31,12 +31,12 @@ * This file implements methods for Network Diagnostics helper types and classes. */ -#include "network_diagnostic_types.hpp" +#include "net_diag_types.hpp" #include "instance/instance.hpp" namespace ot { -namespace NetworkDiagnostic { +namespace NetDiag { AnswerBuilder::AnswerBuilder(Instance &aInstance) : InstanceLocator(aInstance) @@ -104,5 +104,5 @@ exit: return error; } -} // namespace NetworkDiagnostic +} // namespace NetDiag } // namespace ot diff --git a/src/core/thread/network_diagnostic_types.hpp b/src/core/thread/net_diag_types.hpp similarity index 95% rename from src/core/thread/network_diagnostic_types.hpp rename to src/core/thread/net_diag_types.hpp index 2038b9e01..e56b0932d 100644 --- a/src/core/thread/network_diagnostic_types.hpp +++ b/src/core/thread/net_diag_types.hpp @@ -31,12 +31,12 @@ * This file includes definitions for Network Diagnostics helper types and classes. */ -#ifndef OT_CORE_THREAD_NETWORK_DIAGNOSTIC_TYPES_HPP_ -#define OT_CORE_THREAD_NETWORK_DIAGNOSTIC_TYPES_HPP_ +#ifndef OT_CORE_THREAD_NET_DIAG_TYPES_HPP_ +#define OT_CORE_THREAD_NET_DIAG_TYPES_HPP_ #include "openthread-core-config.h" -#include "network_diagnostic_tlvs.hpp" +#include "net_diag_tlvs.hpp" #include "coap/coap_message.hpp" #include "common/error.hpp" #include "common/locator.hpp" @@ -44,7 +44,7 @@ #include "thread/uri_paths.hpp" namespace ot { -namespace NetworkDiagnostic { +namespace NetDiag { /** * Represents an object for tracking and managing Network Diagnostic answer messages. @@ -133,7 +133,7 @@ private: Message::Priority mPriority; }; -} // namespace NetworkDiagnostic +} // namespace NetDiag } // namespace ot -#endif // OT_CORE_THREAD_NETWORK_DIAGNOSTIC_TYPES_HPP_ +#endif // OT_CORE_THREAD_NET_DIAG_TYPES_HPP_ diff --git a/src/core/thread/tmf.cpp b/src/core/thread/tmf.cpp index bdc36eae8..ea13f63c7 100644 --- a/src/core/thread/tmf.cpp +++ b/src/core/thread/tmf.cpp @@ -131,12 +131,12 @@ bool Agent::HandleResource(const char *aUriPath, Msg &aMsg) Case(kUriAnycastLocate, AnycastLocator); #endif - Case(kUriDiagnosticGetRequest, NetworkDiagnostic::Server); - Case(kUriDiagnosticGetQuery, NetworkDiagnostic::Server); - Case(kUriDiagnosticReset, NetworkDiagnostic::Server); + Case(kUriDiagnosticGetRequest, NetDiag::Server); + Case(kUriDiagnosticGetQuery, NetDiag::Server); + Case(kUriDiagnosticReset, NetDiag::Server); #if OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE - Case(kUriDiagnosticGetAnswer, NetworkDiagnostic::Client); + Case(kUriDiagnosticGetAnswer, NetDiag::Client); #endif #if OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE && OPENTHREAD_CONFIG_HISTORY_TRACKER_SERVER_ENABLE diff --git a/src/core/thread/vendor_info.hpp b/src/core/thread/vendor_info.hpp index 98547be27..39c2db736 100644 --- a/src/core/thread/vendor_info.hpp +++ b/src/core/thread/vendor_info.hpp @@ -41,7 +41,7 @@ #include "common/error.hpp" #include "common/locator.hpp" #include "common/non_copyable.hpp" -#include "thread/network_diagnostic_tlvs.hpp" +#include "thread/net_diag_tlvs.hpp" namespace ot { @@ -177,10 +177,10 @@ private: static constexpr uint32_t kOuiMask = 0xffffff; // String buffer types (max size specified by corresponding TLV) - typedef NetworkDiagnostic::VendorNameTlv::StringType NameStringType; - typedef NetworkDiagnostic::VendorModelTlv::StringType ModelStringType; - typedef NetworkDiagnostic::VendorSwVersionTlv::StringType SwVersionStringType; - typedef NetworkDiagnostic::VendorAppUrlTlv::StringType AppUrlStringType; + typedef NetDiag::VendorNameTlv::StringType NameStringType; + typedef NetDiag::VendorModelTlv::StringType ModelStringType; + typedef NetDiag::VendorSwVersionTlv::StringType SwVersionStringType; + typedef NetDiag::VendorAppUrlTlv::StringType AppUrlStringType; static const char kName[]; static const char kModel[]; diff --git a/src/core/utils/history_tracker_tlvs.hpp b/src/core/utils/history_tracker_tlvs.hpp index c0bdd96d6..c5d86cb2f 100644 --- a/src/core/utils/history_tracker_tlvs.hpp +++ b/src/core/utils/history_tracker_tlvs.hpp @@ -42,7 +42,7 @@ #include "common/encoding.hpp" #include "common/tlvs.hpp" -#include "thread/network_diagnostic_tlvs.hpp" +#include "thread/net_diag_tlvs.hpp" #include "utils/history_tracker.hpp" namespace ot { @@ -75,7 +75,7 @@ typedef UintTlvInfo QueryIdTlv; /** * Represents an Answer TLV value. */ -typedef NetworkDiagnostic::AnswerTlvValue AnswerTlvValue; +typedef NetDiag::AnswerTlvValue AnswerTlvValue; /** * Defines Answer TLV constants and types. diff --git a/src/core/utils/mesh_diag.cpp b/src/core/utils/mesh_diag.cpp index 3904b4086..ed2a2f6c1 100644 --- a/src/core/utils/mesh_diag.cpp +++ b/src/core/utils/mesh_diag.cpp @@ -40,7 +40,7 @@ namespace ot { namespace Utils { -using namespace NetworkDiagnostic; +using namespace NetDiag; RegisterLogModule("MeshDiag"); diff --git a/src/core/utils/mesh_diag.hpp b/src/core/utils/mesh_diag.hpp index d71796309..e2508f3c9 100644 --- a/src/core/utils/mesh_diag.hpp +++ b/src/core/utils/mesh_diag.hpp @@ -49,8 +49,8 @@ #include "common/message.hpp" #include "common/timer.hpp" #include "net/ip6_address.hpp" -#include "thread/network_diagnostic.hpp" -#include "thread/network_diagnostic_tlvs.hpp" +#include "thread/net_diag.hpp" +#include "thread/net_diag_tlvs.hpp" #include "thread/tmf.hpp" struct otMeshDiagIp6AddrIterator @@ -69,7 +69,7 @@ namespace Utils { */ class MeshDiag : public InstanceLocator { - friend class ot::NetworkDiagnostic::Client; + friend class ot::NetDiag::Client; public: static constexpr uint16_t kVersionUnknown = OT_MESH_DIAG_VERSION_UNKNOWN; ///< Unknown version. @@ -242,7 +242,7 @@ public: void Cancel(void); private: - typedef ot::NetworkDiagnostic::Tlv Tlv; + typedef ot::NetDiag::Tlv Tlv; static constexpr uint32_t kResponseTimeout = OPENTHREAD_CONFIG_MESH_DIAG_RESPONSE_TIMEOUT; static constexpr uint32_t kMinResponseTimeout = 50; @@ -286,7 +286,7 @@ private: friend class MeshDiag; private: - void SetFrom(const NetworkDiagnostic::ChildTlvValue &aChildTlvValue); + void SetFrom(const NetDiag::ChildTlvValue &aChildTlvValue); }; class RouterNeighborEntry : public otMeshDiagRouterNeighborEntry @@ -294,7 +294,7 @@ private: friend class MeshDiag; private: - void SetFrom(const NetworkDiagnostic::RouterNeighborTlvValue &aTlvValue); + void SetFrom(const NetDiag::RouterNeighborTlvValue &aTlvValue); }; Error SendQuery(uint16_t aRloc16, const uint8_t *aTlvs, uint8_t aTlvsLength); diff --git a/tests/nexus/test_1_1_5_7_1.cpp b/tests/nexus/test_1_1_5_7_1.cpp index 14ad04f39..74dba3a5a 100644 --- a/tests/nexus/test_1_1_5_7_1.cpp +++ b/tests/nexus/test_1_1_5_7_1.cpp @@ -30,7 +30,7 @@ #include "platform/nexus_core.hpp" #include "platform/nexus_node.hpp" -#include "thread/network_diagnostic.hpp" +#include "thread/net_diag.hpp" namespace ot { namespace Nexus { @@ -155,15 +155,13 @@ void Test5_7_1(void) Log("Step 2: Leader"); uint8_t tlvTypes2[] = { - NetworkDiagnostic::Tlv::kExtMacAddress, NetworkDiagnostic::Tlv::kAddress16, - NetworkDiagnostic::Tlv::kMode, NetworkDiagnostic::Tlv::kConnectivity, - NetworkDiagnostic::Tlv::kRoute, NetworkDiagnostic::Tlv::kLeaderData, - NetworkDiagnostic::Tlv::kNetworkData, NetworkDiagnostic::Tlv::kIp6AddressList, - NetworkDiagnostic::Tlv::kChannelPages, + NetDiag::Tlv::kExtMacAddress, NetDiag::Tlv::kAddress16, NetDiag::Tlv::kMode, + NetDiag::Tlv::kConnectivity, NetDiag::Tlv::kRoute, NetDiag::Tlv::kLeaderData, + NetDiag::Tlv::kNetworkData, NetDiag::Tlv::kIp6AddressList, NetDiag::Tlv::kChannelPages, }; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypes2, sizeof(tlvTypes2), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(dutRloc, tlvTypes2, sizeof(tlvTypes2), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); /** @@ -180,10 +178,10 @@ void Test5_7_1(void) */ Log("Step 3: Leader"); - uint8_t tlvTypes3[] = {NetworkDiagnostic::Tlv::kMacCounters}; + uint8_t tlvTypes3[] = {NetDiag::Tlv::kMacCounters}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypes3, sizeof(tlvTypes3), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(dutRloc, tlvTypes3, sizeof(tlvTypes3), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); /** @@ -199,10 +197,10 @@ void Test5_7_1(void) */ Log("Step 4: Leader"); - uint8_t tlvTypes4[] = {NetworkDiagnostic::Tlv::kTimeout}; + uint8_t tlvTypes4[] = {NetDiag::Tlv::kTimeout}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypes4, sizeof(tlvTypes4), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(dutRloc, tlvTypes4, sizeof(tlvTypes4), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); /** @@ -220,10 +218,10 @@ void Test5_7_1(void) */ Log("Step 5: Leader"); - uint8_t tlvTypes5[] = {NetworkDiagnostic::Tlv::kBatteryLevel, NetworkDiagnostic::Tlv::kSupplyVoltage}; + uint8_t tlvTypes5[] = {NetDiag::Tlv::kBatteryLevel, NetDiag::Tlv::kSupplyVoltage}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypes5, sizeof(tlvTypes5), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(dutRloc, tlvTypes5, sizeof(tlvTypes5), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); /** @@ -241,10 +239,10 @@ void Test5_7_1(void) */ Log("Step 6: Leader"); - uint8_t tlvTypes6[] = {NetworkDiagnostic::Tlv::kChildTable}; + uint8_t tlvTypes6[] = {NetDiag::Tlv::kChildTable}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypes6, sizeof(tlvTypes6), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(dutRloc, tlvTypes6, sizeof(tlvTypes6), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); /** @@ -258,9 +256,9 @@ void Test5_7_1(void) */ Log("Step 7: Leader"); - uint8_t tlvTypes7[] = {NetworkDiagnostic::Tlv::kMacCounters}; + uint8_t tlvTypes7[] = {NetDiag::Tlv::kMacCounters}; - SuccessOrQuit(leader.Get().SendDiagnosticReset(dutRloc, tlvTypes7, sizeof(tlvTypes7))); + SuccessOrQuit(leader.Get().SendDiagnosticReset(dutRloc, tlvTypes7, sizeof(tlvTypes7))); nexus.AdvanceTime(kDiagResponseTime); /** @@ -278,10 +276,10 @@ void Test5_7_1(void) */ Log("Step 8: Leader"); - uint8_t tlvTypes8[] = {NetworkDiagnostic::Tlv::kMacCounters}; + uint8_t tlvTypes8[] = {NetDiag::Tlv::kMacCounters}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypes8, sizeof(tlvTypes8), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(dutRloc, tlvTypes8, sizeof(tlvTypes8), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); nexus.SaveTestInfo("test_1_1_5_7_1.json"); diff --git a/tests/nexus/test_1_1_5_7_2.cpp b/tests/nexus/test_1_1_5_7_2.cpp index f07458607..4910ffb03 100644 --- a/tests/nexus/test_1_1_5_7_2.cpp +++ b/tests/nexus/test_1_1_5_7_2.cpp @@ -30,7 +30,7 @@ #include "platform/nexus_core.hpp" #include "platform/nexus_node.hpp" -#include "thread/network_diagnostic.hpp" +#include "thread/net_diag.hpp" namespace ot { namespace Nexus { @@ -74,17 +74,15 @@ static constexpr uint8_t kNumRouters = 15; * Base diagnostic TLV types used in Steps 2 and 8. */ static constexpr uint8_t kBaseDiagGetTlvs[] = { - NetworkDiagnostic::Tlv::kExtMacAddress, NetworkDiagnostic::Tlv::kAddress16, - NetworkDiagnostic::Tlv::kMode, NetworkDiagnostic::Tlv::kConnectivity, - NetworkDiagnostic::Tlv::kRoute, NetworkDiagnostic::Tlv::kLeaderData, - NetworkDiagnostic::Tlv::kNetworkData, NetworkDiagnostic::Tlv::kIp6AddressList, - NetworkDiagnostic::Tlv::kChannelPages, + NetDiag::Tlv::kExtMacAddress, NetDiag::Tlv::kAddress16, NetDiag::Tlv::kMode, + NetDiag::Tlv::kConnectivity, NetDiag::Tlv::kRoute, NetDiag::Tlv::kLeaderData, + NetDiag::Tlv::kNetworkData, NetDiag::Tlv::kIp6AddressList, NetDiag::Tlv::kChannelPages, }; /** * MAC Counters diagnostic TLV type used in Steps 3, 6, and 7. */ -static constexpr uint8_t kMacCountersTlv[] = {NetworkDiagnostic::Tlv::kMacCounters}; +static constexpr uint8_t kMacCountersTlv[] = {NetDiag::Tlv::kMacCounters}; void Test5_7_2(void) { @@ -196,8 +194,8 @@ void Test5_7_2(void) * - The presence of each TLV MUST be validated. Where possible, the value of the TLVs MUST be validated. */ - SuccessOrQuit(leader.Get().SendDiagnosticGet( - reedRloc, kBaseDiagGetTlvs, sizeof(kBaseDiagGetTlvs), nullptr, nullptr)); + SuccessOrQuit(leader.Get().SendDiagnosticGet(reedRloc, kBaseDiagGetTlvs, sizeof(kBaseDiagGetTlvs), + nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); Log("---------------------------------------------------------------------------------------"); @@ -216,8 +214,8 @@ void Test5_7_2(void) * - TLV Type 9 - MAC Counters MUST contain a list of MAC Counters. */ - SuccessOrQuit(leader.Get().SendDiagnosticGet(reedRloc, kMacCountersTlv, - sizeof(kMacCountersTlv), nullptr, nullptr)); + SuccessOrQuit(leader.Get().SendDiagnosticGet(reedRloc, kMacCountersTlv, sizeof(kMacCountersTlv), + nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); Log("---------------------------------------------------------------------------------------"); @@ -236,10 +234,10 @@ void Test5_7_2(void) * - The Timeout TLV MUST NOT be present. */ - uint8_t tlvTypes4[] = {NetworkDiagnostic::Tlv::kTimeout, NetworkDiagnostic::Tlv::kChildTable}; + uint8_t tlvTypes4[] = {NetDiag::Tlv::kTimeout, NetDiag::Tlv::kChildTable}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(reedRloc, tlvTypes4, sizeof(tlvTypes4), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(reedRloc, tlvTypes4, sizeof(tlvTypes4), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); Log("---------------------------------------------------------------------------------------"); @@ -259,10 +257,10 @@ void Test5_7_2(void) * - TLV Type 15 – Supply Voltage (optional) */ - uint8_t tlvTypes5[] = {NetworkDiagnostic::Tlv::kBatteryLevel, NetworkDiagnostic::Tlv::kSupplyVoltage}; + uint8_t tlvTypes5[] = {NetDiag::Tlv::kBatteryLevel, NetDiag::Tlv::kSupplyVoltage}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(reedRloc, tlvTypes5, sizeof(tlvTypes5), - nullptr, nullptr)); + SuccessOrQuit( + leader.Get().SendDiagnosticGet(reedRloc, tlvTypes5, sizeof(tlvTypes5), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); Log("---------------------------------------------------------------------------------------"); @@ -289,8 +287,8 @@ void Test5_7_2(void) * - CoAP Response Code: 2.04 Changed */ - SuccessOrQuit(leader.Get().SendDiagnosticReset(reedRloc, kMacCountersTlv, - sizeof(kMacCountersTlv))); + SuccessOrQuit( + leader.Get().SendDiagnosticReset(reedRloc, kMacCountersTlv, sizeof(kMacCountersTlv))); nexus.AdvanceTime(kDiagResponseTime); Log("---------------------------------------------------------------------------------------"); @@ -321,8 +319,8 @@ void Test5_7_2(void) * step 3. */ - SuccessOrQuit(leader.Get().SendDiagnosticGet(reedRloc, kMacCountersTlv, - sizeof(kMacCountersTlv), nullptr, nullptr)); + SuccessOrQuit(leader.Get().SendDiagnosticGet(reedRloc, kMacCountersTlv, sizeof(kMacCountersTlv), + nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); Log("---------------------------------------------------------------------------------------"); @@ -356,7 +354,7 @@ void Test5_7_2(void) * - The presence of each TLV MUST be validated. Where possible, the value of the TLVs MUST be validated. */ - SuccessOrQuit(leader.Get().SendDiagnosticGet( + SuccessOrQuit(leader.Get().SendDiagnosticGet( Ip6::Address::GetRealmLocalAllNodesMulticast(), kBaseDiagGetTlvs, sizeof(kBaseDiagGetTlvs), nullptr, nullptr)); nexus.AdvanceTime(kDiagResponseTime); diff --git a/tests/nexus/test_1_1_5_7_3.cpp b/tests/nexus/test_1_1_5_7_3.cpp index 11c904ba3..5bd944bb3 100644 --- a/tests/nexus/test_1_1_5_7_3.cpp +++ b/tests/nexus/test_1_1_5_7_3.cpp @@ -31,7 +31,7 @@ #include "mac/data_poll_sender.hpp" #include "platform/nexus_core.hpp" #include "platform/nexus_node.hpp" -#include "thread/network_diagnostic.hpp" +#include "thread/net_diag.hpp" namespace ot { namespace Nexus { @@ -65,11 +65,10 @@ static constexpr uint32_t kPollPeriod = 500; * Diagnostic TLV types used in the query. */ static constexpr uint8_t kDiagGetTlvs[] = { - NetworkDiagnostic::Tlv::kExtMacAddress, NetworkDiagnostic::Tlv::kAddress16, - NetworkDiagnostic::Tlv::kMode, NetworkDiagnostic::Tlv::kConnectivity, - NetworkDiagnostic::Tlv::kRoute, NetworkDiagnostic::Tlv::kLeaderData, - NetworkDiagnostic::Tlv::kNetworkData, NetworkDiagnostic::Tlv::kIp6AddressList, - NetworkDiagnostic::Tlv::kChildTable, NetworkDiagnostic::Tlv::kChannelPages, + NetDiag::Tlv::kExtMacAddress, NetDiag::Tlv::kAddress16, NetDiag::Tlv::kMode, + NetDiag::Tlv::kConnectivity, NetDiag::Tlv::kRoute, NetDiag::Tlv::kLeaderData, + NetDiag::Tlv::kNetworkData, NetDiag::Tlv::kIp6AddressList, NetDiag::Tlv::kChildTable, + NetDiag::Tlv::kChannelPages, }; struct DiagGetContext @@ -100,9 +99,9 @@ static void HandleDiagnosticGetAnswer(otError aError, Log("Diagnostic Answer from %s", AsCoreType(&aMessageInfo->mPeerAddr).ToString().AsCString()); - SuccessOrQuit(Tlv::Find(*message, extAddress)); - SuccessOrQuit(Tlv::Find(*message, shortAddress)); - SuccessOrQuit(Tlv::Find(*message, mode)); + SuccessOrQuit(Tlv::Find(*message, extAddress)); + SuccessOrQuit(Tlv::Find(*message, shortAddress)); + SuccessOrQuit(Tlv::Find(*message, mode)); } void Test5_7_3(void) @@ -205,7 +204,7 @@ void Test5_7_3(void) * - Pass Criteria: N/A. */ - SuccessOrQuit(leader.Get().SendDiagnosticGet( + SuccessOrQuit(leader.Get().SendDiagnosticGet( leader.Get().GetRealmLocalAllThreadNodesAddress(), kDiagGetTlvs, sizeof(kDiagGetTlvs), HandleDiagnosticGetAnswer, &context)); diff --git a/tests/nexus/test_1_3_DIAG_TC_1.cpp b/tests/nexus/test_1_3_DIAG_TC_1.cpp index 39532bc4a..c4943c938 100644 --- a/tests/nexus/test_1_3_DIAG_TC_1.cpp +++ b/tests/nexus/test_1_3_DIAG_TC_1.cpp @@ -30,7 +30,7 @@ #include "platform/nexus_core.hpp" #include "platform/nexus_node.hpp" -#include "thread/network_diagnostic.hpp" +#include "thread/net_diag.hpp" #include "utils/mesh_diag.hpp" namespace ot { @@ -165,16 +165,12 @@ void TestDiagTc1(const char *aJsonFileName) dutRloc.SetToRoutingLocator(leader.Get().GetMeshLocalPrefix(), router1.Get().GetRloc16()); uint8_t tlvTypesStep2[] = { - NetworkDiagnostic::Tlv::kMaxChildTimeout, - NetworkDiagnostic::Tlv::kEui64, - NetworkDiagnostic::Tlv::kVersion, - NetworkDiagnostic::Tlv::kVendorName, - NetworkDiagnostic::Tlv::kVendorModel, - NetworkDiagnostic::Tlv::kVendorSwVersion, - NetworkDiagnostic::Tlv::kThreadStackVersion, + NetDiag::Tlv::kMaxChildTimeout, NetDiag::Tlv::kEui64, NetDiag::Tlv::kVersion, + NetDiag::Tlv::kVendorName, NetDiag::Tlv::kVendorModel, NetDiag::Tlv::kVendorSwVersion, + NetDiag::Tlv::kThreadStackVersion, }; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypesStep2, - sizeof(tlvTypesStep2), nullptr, nullptr)); + SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypesStep2, sizeof(tlvTypesStep2), + nullptr, nullptr)); /** * Step 3 @@ -242,9 +238,9 @@ void TestDiagTc1(const char *aJsonFileName) * - Pass Criteria: * - N/A */ - uint8_t tlvTypesStep5[] = {NetworkDiagnostic::Tlv::kMaxChildTimeout, NetworkDiagnostic::Tlv::kMleCounters}; - SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypesStep5, - sizeof(tlvTypesStep5), nullptr, nullptr)); + uint8_t tlvTypesStep5[] = {NetDiag::Tlv::kMaxChildTimeout, NetDiag::Tlv::kMleCounters}; + SuccessOrQuit(leader.Get().SendDiagnosticGet(dutRloc, tlvTypesStep5, sizeof(tlvTypesStep5), + nullptr, nullptr)); /** * Step 6 diff --git a/tests/nexus/test_1_3_DIAG_TC_2.cpp b/tests/nexus/test_1_3_DIAG_TC_2.cpp index 6888978dd..e2c4d49b7 100644 --- a/tests/nexus/test_1_3_DIAG_TC_2.cpp +++ b/tests/nexus/test_1_3_DIAG_TC_2.cpp @@ -31,7 +31,7 @@ #include "platform/nexus_core.hpp" #include "platform/nexus_node.hpp" -#include "thread/network_diagnostic.hpp" +#include "thread/net_diag.hpp" namespace ot { namespace Nexus { @@ -153,16 +153,12 @@ void TestDiagTc2(const char *aJsonFile) td1Rloc.SetToRoutingLocator(leader1.Get().GetMeshLocalPrefix(), td1.Get().GetRloc16()); uint8_t tlvTypesStep2[] = { - NetworkDiagnostic::Tlv::kMaxChildTimeout, - NetworkDiagnostic::Tlv::kEui64, - NetworkDiagnostic::Tlv::kVersion, - NetworkDiagnostic::Tlv::kVendorName, - NetworkDiagnostic::Tlv::kVendorModel, - NetworkDiagnostic::Tlv::kVendorSwVersion, - NetworkDiagnostic::Tlv::kThreadStackVersion, + NetDiag::Tlv::kMaxChildTimeout, NetDiag::Tlv::kEui64, NetDiag::Tlv::kVersion, + NetDiag::Tlv::kVendorName, NetDiag::Tlv::kVendorModel, NetDiag::Tlv::kVendorSwVersion, + NetDiag::Tlv::kThreadStackVersion, }; - SuccessOrQuit(leader1.Get().SendDiagnosticGet(td1Rloc, tlvTypesStep2, - sizeof(tlvTypesStep2), nullptr, nullptr)); + SuccessOrQuit(leader1.Get().SendDiagnosticGet(td1Rloc, tlvTypesStep2, sizeof(tlvTypesStep2), + nullptr, nullptr)); Log("---------------------------------------------------------------------------------------"); Log("Step 3: TD_1 (DUT) Automatically responds either with 1. DIAG_GET.rsp or 2. CoAP response 4.04."); @@ -213,9 +209,9 @@ void TestDiagTc2(const char *aJsonFile) * - Pass Criteria: * - N/A */ - uint8_t tlvTypesStep4[] = {NetworkDiagnostic::Tlv::kMleCounters}; - SuccessOrQuit(leader1.Get().SendDiagnosticGet(td1Rloc, tlvTypesStep4, - sizeof(tlvTypesStep4), nullptr, nullptr)); + uint8_t tlvTypesStep4[] = {NetDiag::Tlv::kMleCounters}; + SuccessOrQuit(leader1.Get().SendDiagnosticGet(td1Rloc, tlvTypesStep4, sizeof(tlvTypesStep4), + nullptr, nullptr)); Log("---------------------------------------------------------------------------------------"); Log("Step 5: TD_1 (DUT) Automatically responds with DIAG_GET.rsp containing the requested Diagnostic TLVs."); diff --git a/tests/nexus/test_1_3_GEN_TC_1.cpp b/tests/nexus/test_1_3_GEN_TC_1.cpp index a8dce5def..3a045b670 100644 --- a/tests/nexus/test_1_3_GEN_TC_1.cpp +++ b/tests/nexus/test_1_3_GEN_TC_1.cpp @@ -281,9 +281,9 @@ void Test_1_3_GEN_TC_1(Topology aTopology, const char *aJsonFileName) */ Ip6::Address br1Rloc; br1Rloc.SetToRoutingLocator(router1.Get().GetMeshLocalPrefix(), br1.Get().GetRloc16()); - uint8_t tlvTypes[] = {NetworkDiagnostic::Tlv::kVersion}; - SuccessOrQuit(router1.Get().SendDiagnosticGet(br1Rloc, tlvTypes, sizeof(tlvTypes), - nullptr, nullptr)); + uint8_t tlvTypes[] = {NetDiag::Tlv::kVersion}; + SuccessOrQuit( + router1.Get().SendDiagnosticGet(br1Rloc, tlvTypes, sizeof(tlvTypes), nullptr, nullptr)); Log("---------------------------------------------------------------------------------------"); Log("Step 14: BR_1 Automatically responds with Get Diagnostic Response unicast to Router_1."); @@ -313,8 +313,8 @@ void Test_1_3_GEN_TC_1(Topology aTopology, const char *aJsonFileName) */ Ip6::Address router1Rloc; router1Rloc.SetToRoutingLocator(br1.Get().GetMeshLocalPrefix(), router1.Get().GetRloc16()); - SuccessOrQuit(br1.Get().SendDiagnosticGet(router1Rloc, tlvTypes, sizeof(tlvTypes), - nullptr, nullptr)); + SuccessOrQuit( + br1.Get().SendDiagnosticGet(router1Rloc, tlvTypes, sizeof(tlvTypes), nullptr, nullptr)); Log("---------------------------------------------------------------------------------------"); Log("Step 16: Router_1 Automatically responds with Get Diagnostic Response unicast to the DUT."); @@ -344,8 +344,8 @@ void Test_1_3_GEN_TC_1(Topology aTopology, const char *aJsonFileName) */ Ip6::Address ed1Rloc; ed1Rloc.SetToRoutingLocator(router1.Get().GetMeshLocalPrefix(), ed1.Get().GetRloc16()); - SuccessOrQuit(router1.Get().SendDiagnosticGet(ed1Rloc, tlvTypes, sizeof(tlvTypes), - nullptr, nullptr)); + SuccessOrQuit( + router1.Get().SendDiagnosticGet(ed1Rloc, tlvTypes, sizeof(tlvTypes), nullptr, nullptr)); Log("---------------------------------------------------------------------------------------"); Log("Step 18: ED_1 Optionally responds with Get Diagnostic Response unicast to Router_1."); diff --git a/tests/nexus/test_border_admitter.cpp b/tests/nexus/test_border_admitter.cpp index 659f841a9..d5f3a9dee 100644 --- a/tests/nexus/test_border_admitter.cpp +++ b/tests/nexus/test_border_admitter.cpp @@ -3175,7 +3175,7 @@ void TestBorderAdmitterForwardingUdpProxy(void) static const char *kEnrollerIds[kNumEnrollers] = {"1", "2", "3", "4"}; - static const uint8_t kDiagTlvs[] = {NetworkDiagnostic::Tlv::kExtMacAddress, NetworkDiagnostic::Tlv::kVersion}; + static const uint8_t kDiagTlvs[] = {NetDiag::Tlv::kExtMacAddress, NetDiag::Tlv::kVersion}; Core nexus; Node &admitter = nexus.CreateNode(); @@ -3347,7 +3347,7 @@ void TestBorderAdmitterForwardingUdpProxy(void) diagMessage = enrollers[0]->Get().AllocateAndInitNonConfirmablePostMessage(kUriDiagnosticGetQuery); VerifyOrQuit(diagMessage != nullptr); - SuccessOrQuit(Tlv::Append(*diagMessage, kDiagTlvs, sizeof(kDiagTlvs))); + SuccessOrQuit(Tlv::Append(*diagMessage, kDiagTlvs, sizeof(kDiagTlvs))); diagMessage->WriteMessageId(0); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -