Skip to content

Commit

Permalink
[core] define core/instance folder for instance modules (openthre…
Browse files Browse the repository at this point in the history
…ad#9561)

This commit moves the `instance` module to a newly added folder
`core/instance` (from `core/common`.  Header file `extension.hpp`
and its example is also moved to the same folder.
  • Loading branch information
abtink authored Oct 26, 2023
1 parent 4c75b6b commit 1528c88
Show file tree
Hide file tree
Showing 158 changed files with 161 additions and 161 deletions.
4 changes: 2 additions & 2 deletions script/check-simulation-build-cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ build_all_features()
reset_source
"$(dirname "$0")"/cmake-build simulation \
-DOT_THREAD_VERSION=1.1 \
-DOT_VENDOR_EXTENSION=../../src/core/common/extension_example.cpp
-DOT_VENDOR_EXTENSION=../../src/core/instance/extension_example.cpp

# Build Thread 1.3 with no additional features
reset_source
Expand Down Expand Up @@ -249,7 +249,7 @@ build_nest_common()
mkdir build && cd build
CFLAGS="${cppflags[*]} ${CFLAGS}" CXXFLAGS="${cppflags[*]} ${CXXFLAGS}" \
cmake -GNinja -DOT_PLATFORM=simulation \
-DOT_VENDOR_EXTENSION=common/extension_example.cpp \
-DOT_VENDOR_EXTENSION=instance/extension_example.cpp \
-DOT_NCP_VENDOR_HOOK_SOURCE=example_vendor_hook.cpp \
..
ninja
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
#include "common/array.hpp"
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/type_traits.hpp"
#include "instance/instance.hpp"

namespace ot {

Expand Down
8 changes: 4 additions & 4 deletions src/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ openthread_core_files = [
"common/equatable.hpp",
"common/error.cpp",
"common/error.hpp",
"common/extension.hpp",
"common/frame_builder.cpp",
"common/frame_builder.hpp",
"common/frame_data.cpp",
Expand All @@ -409,8 +408,6 @@ openthread_core_files = [
"common/heap_data.hpp",
"common/heap_string.cpp",
"common/heap_string.hpp",
"common/instance.cpp",
"common/instance.hpp",
"common/iterator_utils.hpp",
"common/linked_list.hpp",
"common/locator.hpp",
Expand Down Expand Up @@ -474,6 +471,9 @@ openthread_core_files = [
"crypto/storage.hpp",
"diags/factory_diags.cpp",
"diags/factory_diags.hpp",
"instance/extension.hpp",
"instance/instance.cpp",
"instance/instance.hpp",
"mac/channel_mask.cpp",
"mac/channel_mask.hpp",
"mac/data_poll_handler.cpp",
Expand Down Expand Up @@ -737,7 +737,6 @@ openthread_radio_sources = [
"common/error.hpp",
"common/frame_builder.cpp",
"common/frame_builder.hpp",
"common/instance.cpp",
"common/log.cpp",
"common/random.cpp",
"common/string.cpp",
Expand All @@ -749,6 +748,7 @@ openthread_radio_sources = [
"crypto/crypto_platform.cpp",
"crypto/storage.cpp",
"diags/factory_diags.cpp",
"instance/instance.cpp",
"mac/link_raw.cpp",
"mac/mac_frame.cpp",
"mac/mac_types.cpp",
Expand Down
4 changes: 2 additions & 2 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ set(COMMON_SOURCES
common/heap.cpp
common/heap_data.cpp
common/heap_string.cpp
common/instance.cpp
common/log.cpp
common/message.cpp
common/notifier.cpp
Expand All @@ -129,6 +128,7 @@ set(COMMON_SOURCES
crypto/sha256.cpp
crypto/storage.cpp
diags/factory_diags.cpp
instance/instance.cpp
mac/channel_mask.cpp
mac/data_poll_handler.cpp
mac/data_poll_sender.cpp
Expand Down Expand Up @@ -265,7 +265,6 @@ set(RADIO_COMMON_SOURCES
common/binary_search.cpp
common/error.cpp
common/frame_builder.cpp
common/instance.cpp
common/log.cpp
common/random.cpp
common/string.cpp
Expand All @@ -277,6 +276,7 @@ set(RADIO_COMMON_SOURCES
crypto/crypto_platform.cpp
crypto/storage.cpp
diags/factory_diags.cpp
instance/instance.cpp
mac/link_raw.cpp
mac/mac_frame.cpp
mac/mac_types.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/core/api/border_router_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include "border_router/routing_manager.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "instance/instance.hpp"

using namespace ot;

Expand Down
2 changes: 1 addition & 1 deletion src/core/api/border_routing_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <openthread/platform/border_routing.h>

#include "border_router/routing_manager.hpp"
#include "common/instance.hpp"
#include "instance/instance.hpp"

using namespace ot;

Expand Down
2 changes: 1 addition & 1 deletion src/core/api/dns_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <openthread/dns_client.h>

#include "common/instance.hpp"
#include "instance/instance.hpp"
#include "net/dns_types.hpp"

using namespace ot;
Expand Down
2 changes: 1 addition & 1 deletion src/core/api/dns_server_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "openthread-core-config.h"

#include "common/instance.hpp"
#include "instance/instance.hpp"
#include "net/dns_types.hpp"
#include "net/dnssd_server.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/core/api/logging_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@

#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/string.hpp"
#include "instance/instance.hpp"

using namespace ot;

Expand Down
2 changes: 1 addition & 1 deletion src/core/api/nat64_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include "border_router/routing_manager.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "instance/instance.hpp"
#include "net/ip4_types.hpp"
#include "net/ip6_headers.hpp"
#include "net/nat64_translator.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/core/api/trel_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include "common/as_core_type.hpp"
#include "common/code_utils.hpp"
#include "common/instance.hpp"
#include "instance/instance.hpp"

using namespace ot;

Expand Down
2 changes: 1 addition & 1 deletion src/core/backbone_router/bbr_leader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)

#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "instance/instance.hpp"

namespace ot {
namespace BackboneRouter {
Expand Down
2 changes: 1 addition & 1 deletion src/core/backbone_router/bbr_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE

#include "common/code_utils.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/random.hpp"
#include "instance/instance.hpp"
#include "thread/mle_types.hpp"
#include "thread/thread_netif.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/core/backbone_router/bbr_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

#include "common/as_core_type.hpp"
#include "common/code_utils.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/num_utils.hpp"
#include "common/random.hpp"
#include "instance/instance.hpp"
#include "thread/mle_types.hpp"
#include "thread/thread_netif.hpp"
#include "thread/thread_tlvs.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/core/backbone_router/multicast_listeners_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

#include "common/array.hpp"
#include "common/code_utils.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/random.hpp"
#include "instance/instance.hpp"
#include "thread/mle_types.hpp"
#include "thread/thread_netif.hpp"
#include "thread/uri_paths.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/core/border_router/infra_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

#include "border_router/routing_manager.hpp"
#include "common/as_core_type.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/logging.hpp"
#include "instance/instance.hpp"
#include "net/icmp6.hpp"

namespace ot {
Expand Down
2 changes: 1 addition & 1 deletion src/core/border_router/routing_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@

#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/num_utils.hpp"
#include "common/numeric_limits.hpp"
#include "common/random.hpp"
#include "common/settings.hpp"
#include "instance/instance.hpp"
#include "meshcop/extended_panid.hpp"
#include "net/ip6.hpp"
#include "net/nat64_translator.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/core/coap/coap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#include "common/as_core_type.hpp"
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/random.hpp"
#include "instance/instance.hpp"
#include "net/ip6.hpp"
#include "net/udp6.hpp"
#include "thread/thread_netif.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/core/coap/coap_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/encoding.hpp"
#include "common/instance.hpp"
#include "common/random.hpp"
#include "common/string.hpp"
#include "instance/instance.hpp"

namespace ot {
namespace Coap {
Expand Down
2 changes: 1 addition & 1 deletion src/core/coap/coap_secure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

#if OPENTHREAD_CONFIG_DTLS_ENABLE

#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/new.hpp"
#include "instance/instance.hpp"
#include "meshcop/dtls.hpp"
#include "thread/thread_netif.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/core/common/heap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "heap.hpp"

#include "common/instance.hpp"
#include "instance/instance.hpp"

namespace ot {
namespace Heap {
Expand Down
2 changes: 1 addition & 1 deletion src/core/common/locator_getters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

#include "openthread-core-config.h"

#include "common/instance.hpp"
#include "common/locator.hpp"
#include "common/tasklet.hpp"
#include "instance/instance.hpp"

namespace ot {

Expand Down
2 changes: 1 addition & 1 deletion src/core/common/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
#include <openthread/platform/logging.h>

#include "common/code_utils.hpp"
#include "common/instance.hpp"
#include "common/num_utils.hpp"
#include "common/numeric_limits.hpp"
#include "common/string.hpp"
#include "instance/instance.hpp"

/*
* Verify debug UART dependency.
Expand Down
2 changes: 1 addition & 1 deletion src/core/common/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/heap.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/log.hpp"
#include "common/num_utils.hpp"
#include "common/numeric_limits.hpp"
#include "instance/instance.hpp"
#include "net/checksum.hpp"
#include "net/ip6.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/core/common/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

#include "common/array.hpp"
#include "common/code_utils.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/num_utils.hpp"
#include "instance/instance.hpp"
#include "meshcop/dataset.hpp"
#include "thread/mle.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/core/common/time_ticker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "common/random.hpp"
#include "instance/instance.hpp"
#include "thread/mle_router.hpp"

namespace ot {
Expand Down
2 changes: 1 addition & 1 deletion src/core/common/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include "common/as_core_type.hpp"
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "instance/instance.hpp"

namespace ot {

Expand Down
2 changes: 1 addition & 1 deletion src/core/common/uptime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "instance/instance.hpp"

namespace ot {

Expand Down
2 changes: 1 addition & 1 deletion src/core/crypto/crypto_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@

#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/new.hpp"
#include "config/crypto.h"
#include "crypto/ecdsa.hpp"
#include "crypto/hmac_sha256.hpp"
#include "crypto/storage.hpp"
#include "instance/instance.hpp"

using namespace ot;
using namespace Crypto;
Expand Down
2 changes: 1 addition & 1 deletion src/core/diags/factory_diags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@

#include "common/as_core_type.hpp"
#include "common/code_utils.hpp"
#include "common/instance.hpp"
#include "common/locator_getters.hpp"
#include "instance/instance.hpp"
#include "radio/radio.hpp"
#include "utils/parse_cmdline.hpp"

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#include <stdint.h>

#include "common/code_utils.hpp"
#include "common/extension.hpp"
#include "common/new.hpp"
#include "instance/extension.hpp"

namespace ot {
namespace Extension {
Expand Down
File renamed without changes.
Loading

0 comments on commit 1528c88

Please sign in to comment.