[network-data] always support service registration at Leader (#4360)

A Leader should always be able to process service registration.

This commit:

- removes the OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE feature
  flag around code for handling service registrations by the leader.

- support service ALOC forwarding by all router-capable devices.

- adds ability for any device to read service information from the
  network data.
This commit is contained in:
Rongli Sun
2019-12-03 00:42:46 +08:00
committed by Jonathan Hui
parent 2089716959
commit e860009914
19 changed files with 178 additions and 230 deletions
+2 -3
View File
@@ -42,6 +42,7 @@
#include <openthread/icmp6.h>
#include <openthread/link.h>
#include <openthread/ncp.h>
#include <openthread/netdata.h>
#include <openthread/thread.h>
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
#include <openthread/network_time.h>
@@ -167,9 +168,7 @@ const struct Command Interpreter::sCommands[] = {
#if OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE || OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
{"netdataregister", &Interpreter::ProcessNetworkDataRegister},
#endif
#if OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
{"netdatashow", &Interpreter::ProcessNetworkDataShow},
#endif
#if OPENTHREAD_FTD || OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE
{"networkdiagnostic", &Interpreter::ProcessNetworkDiagnostic},
#endif // OPENTHREAD_FTD || OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE
@@ -1723,7 +1722,6 @@ exit:
}
#endif
#if OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
void Interpreter::ProcessNetworkDataShow(int argc, char *argv[])
{
OT_UNUSED_VARIABLE(argc);
@@ -1742,6 +1740,7 @@ exit:
AppendResult(error);
}
#if OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
void Interpreter::ProcessService(int argc, char *argv[])
{
otError error = OT_ERROR_NONE;