mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 03:07:47 +00:00
[net-diag] introduce Server and Client classes (#8936)
This commit introduces `Server` and `Client` classes breaking the `NetworkDiagnostic` module into two components. The `Server` responds to queries and requests (handling Net Diag TMF commands), while `Client` issues queries/requests and processes responses. The `Server` is available under both FTD and MTD (which follows the requirement of Thread spec). The client is enabled using newly added `OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE` config option which is also available as `OT_NETDIAG_CLIENT` CMake option or the autoconf build switch `NETDIAG_CLIENT`. The client functionality is by default enabled on Border Routers (tied to `CONFIG_BORDER_ROUTING_ENABLE` config). The previous `TMF_NETWORK_DIAG_MTD_ENABLE` config is now removed along with its CMake `OT_MTD_NETDIAG` and autoconf switch. This commit adds checks to trigger build error if the previous config and/or its related CMake option are used.
This commit is contained in:
@@ -165,11 +165,12 @@ bool Agent::HandleResource(const char *aUriPath, Message &aMessage, const Ip6::M
|
||||
Case(kUriAnycastLocate, AnycastLocator);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE
|
||||
Case(kUriDiagnosticGetRequest, NetworkDiagnostic::NetworkDiagnostic);
|
||||
Case(kUriDiagnosticGetQuery, NetworkDiagnostic::NetworkDiagnostic);
|
||||
Case(kUriDiagnosticGetAnswer, NetworkDiagnostic::NetworkDiagnostic);
|
||||
Case(kUriDiagnosticReset, NetworkDiagnostic::NetworkDiagnostic);
|
||||
Case(kUriDiagnosticGetRequest, NetworkDiagnostic::Server);
|
||||
Case(kUriDiagnosticGetQuery, NetworkDiagnostic::Server);
|
||||
Case(kUriDiagnosticReset, NetworkDiagnostic::Server);
|
||||
|
||||
#if OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE
|
||||
Case(kUriDiagnosticGetAnswer, NetworkDiagnostic::Client);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user