diff --git a/examples/apps/cli/main.c b/examples/apps/cli/main.c index d8245a3c8..b98129ea4 100644 --- a/examples/apps/cli/main.c +++ b/examples/apps/cli/main.c @@ -32,14 +32,13 @@ #include #endif -#include "openthread/openthread.h" -#include "openthread/cli.h" -#include "openthread/diag.h" -#include "openthread/platform/platform.h" - -#include #include +#include +#include +#include +#include + #ifdef OPENTHREAD_MULTIPLE_INSTANCE void *otPlatCAlloc(size_t aNum, size_t aSize) { diff --git a/examples/apps/ncp/main.c b/examples/apps/ncp/main.c index 9f9540067..a3d434c5d 100644 --- a/examples/apps/ncp/main.c +++ b/examples/apps/ncp/main.c @@ -32,13 +32,12 @@ #include #endif -#include "openthread/openthread.h" -#include "openthread/diag.h" -#include "openthread/ncp.h" -#include "openthread/platform/platform.h" +#include -#include -#include +#include +#include +#include +#include #ifdef OPENTHREAD_MULTIPLE_INSTANCE void *otPlatCAlloc(size_t aNum, size_t aSize) diff --git a/examples/platforms/cc2538/alarm.c b/examples/platforms/cc2538/alarm.c index e0a3a5716..c5e729124 100644 --- a/examples/platforms/cc2538/alarm.c +++ b/examples/platforms/cc2538/alarm.c @@ -36,10 +36,11 @@ #include #include -#include "openthread/openthread.h" -#include "openthread/platform/platform.h" -#include "openthread/platform/alarm.h" -#include "openthread/platform/diag.h" +#include +#include +#include +#include + #include "platform-cc2538.h" enum diff --git a/examples/platforms/cc2538/diag.c b/examples/platforms/cc2538/diag.c index 4bb787c0e..c872912f7 100644 --- a/examples/platforms/cc2538/diag.c +++ b/examples/platforms/cc2538/diag.c @@ -32,10 +32,10 @@ #include #include -#include "openthread/openthread.h" +#include +#include +#include -#include "openthread/platform/alarm.h" -#include "openthread/platform/radio.h" #include "platform-cc2538.h" /** diff --git a/examples/platforms/cc2538/flash.c b/examples/platforms/cc2538/flash.c index 0dfd120dc..1837b41c2 100644 --- a/examples/platforms/cc2538/flash.c +++ b/examples/platforms/cc2538/flash.c @@ -26,18 +26,18 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include -#include #include -#include "openthread/platform/alarm.h" -#include +#include -#include #include "platform-cc2538.h" #include "rom-utility.h" +#include "utils/code_utils.h" +#include "utils/flash.h" #define FLASH_CTRL_FCTL_BUSY 0x00000080 diff --git a/examples/platforms/cc2538/misc.c b/examples/platforms/cc2538/misc.c index e957e10e5..528c23376 100644 --- a/examples/platforms/cc2538/misc.c +++ b/examples/platforms/cc2538/misc.c @@ -26,8 +26,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "openthread/types.h" -#include "openthread/platform/misc.h" +#include +#include + #include "platform-cc2538.h" void otPlatReset(otInstance *aInstance) diff --git a/examples/platforms/cc2538/platform-cc2538.h b/examples/platforms/cc2538/platform-cc2538.h index 9f6db2daa..f23ad1a9a 100644 --- a/examples/platforms/cc2538/platform-cc2538.h +++ b/examples/platforms/cc2538/platform-cc2538.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #include "cc2538-reg.h" diff --git a/examples/platforms/cc2538/radio.c b/examples/platforms/cc2538/radio.c index b2419db37..96dedb295 100644 --- a/examples/platforms/cc2538/radio.c +++ b/examples/platforms/cc2538/radio.c @@ -33,15 +33,14 @@ */ #include +#include +#include +#include +#include -#include "openthread/openthread.h" -#include "openthread/platform/platform.h" -#include "openthread/platform/radio.h" -#include "openthread/platform/diag.h" - -#include -#include #include "platform-cc2538.h" +#include "common/logging.hpp" +#include "utils/code_utils.h" enum { diff --git a/examples/platforms/cc2538/random.c b/examples/platforms/cc2538/random.c index b88ea32ff..41261d92e 100644 --- a/examples/platforms/cc2538/random.c +++ b/examples/platforms/cc2538/random.c @@ -32,12 +32,12 @@ * */ -#include "openthread/types.h" -#include "openthread/platform/radio.h" -#include "openthread/platform/random.h" +#include +#include +#include -#include #include "platform-cc2538.h" +#include "utils/code_utils.h" static void generateRandom(uint8_t *aOutput, uint16_t aOutputLength) { diff --git a/examples/platforms/cc2538/uart.c b/examples/platforms/cc2538/uart.c index c0d14658f..503e0b472 100644 --- a/examples/platforms/cc2538/uart.c +++ b/examples/platforms/cc2538/uart.c @@ -34,11 +34,11 @@ #include -#include "openthread/types.h" -#include "openthread/platform/uart.h" +#include +#include -#include #include "platform-cc2538.h" +#include "utils/code_utils.h" enum { diff --git a/examples/platforms/da15000/alarm.c b/examples/platforms/da15000/alarm.c index 055618ddd..e651f065f 100644 --- a/examples/platforms/da15000/alarm.c +++ b/examples/platforms/da15000/alarm.c @@ -39,7 +39,9 @@ #include #include -#include "openthread/platform/alarm.h" + +#include + #include "hw_timer0.h" #include "hw_gpio.h" #include "platform-da15000.h" diff --git a/examples/platforms/da15000/flash.c b/examples/platforms/da15000/flash.c index 45563a214..592f335c3 100644 --- a/examples/platforms/da15000/flash.c +++ b/examples/platforms/da15000/flash.c @@ -26,12 +26,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "openthread/types.h" -#include "openthread/platform/alarm.h" +#include +#include +#include #include "hw_qspi.h" #include "qspi_automode.h" -#include "openthread-config.h" #define FLASH_SECTOR_SIZE 0x1000 #define FLASH_BUFFER_SIZE 0x2000 diff --git a/examples/platforms/da15000/logging.c b/examples/platforms/da15000/logging.c index 8d3bddcdd..2e400d6b9 100644 --- a/examples/platforms/da15000/logging.c +++ b/examples/platforms/da15000/logging.c @@ -31,7 +31,7 @@ * Platform abstraction for the logging * */ -#include "openthread/platform/logging.h" +#include void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...) { diff --git a/examples/platforms/da15000/misc.c b/examples/platforms/da15000/misc.c index 8859fbf47..270667ea1 100755 --- a/examples/platforms/da15000/misc.c +++ b/examples/platforms/da15000/misc.c @@ -26,9 +26,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "openthread/types.h" +#include + +#include -#include "openthread/platform/misc.h" #include "sdk_defs.h" void otPlatReset(otInstance *aInstance) diff --git a/examples/platforms/da15000/platform-da15000.h b/examples/platforms/da15000/platform-da15000.h index 2d9bf5eaf..b95afa601 100755 --- a/examples/platforms/da15000/platform-da15000.h +++ b/examples/platforms/da15000/platform-da15000.h @@ -29,7 +29,7 @@ #ifndef PLATFORM_DA15000_H_ #define PLATFORM_DA15000_H_ -#include "openthread/types.h" +#include /** * This function initializes the radio service used by OpenThread. diff --git a/examples/platforms/da15000/platform.c b/examples/platforms/da15000/platform.c index 3323eb08b..f29d43ec5 100644 --- a/examples/platforms/da15000/platform.c +++ b/examples/platforms/da15000/platform.c @@ -34,15 +34,17 @@ #include #include -#include "openthread/openthread.h" -#include "openthread/platform/alarm.h" -#include "openthread/platform/uart.h" +#include +#include +#include + #include "platform-da15000.h" + #include "sdk_defs.h" -#include "hw_cpm.h" -#include "hw_watchdog.h" #include "ftdf.h" +#include "hw_cpm.h" #include "hw_gpio.h" +#include "hw_watchdog.h" static bool sBlink = false; static int sMsCounterInit; diff --git a/examples/platforms/da15000/radio.c b/examples/platforms/da15000/radio.c index 9b92b4a96..0122916a7 100644 --- a/examples/platforms/da15000/radio.c +++ b/examples/platforms/da15000/radio.c @@ -31,17 +31,19 @@ * Platform abstraction for radio communication. */ -#include -#include "openthread/openthread.h" -#include "openthread/platform/alarm.h" -#include "openthread/platform/radio.h" +#include +#include +#include + +#include "utils/code_utils.h" + #include "platform-da15000.h" -#include -#include -#include -#include -#include +#include "ad_ftdf.h" +#include "ad_ftdf_phy_api.h" +#include "hw_rf.h" +#include "internal.h" +#include "regmap.h" #define FACTORY_TEST_TIMESTAMP (0x7F8EA08) // Register holds a timestamp of facotry test of a chip #define FACTORY_TESTER_ID (0x7F8EA0C) // Register holds test machine ID used for factory test diff --git a/examples/platforms/da15000/random.c b/examples/platforms/da15000/random.c index 63c65929a..e9ea7eb3d 100644 --- a/examples/platforms/da15000/random.c +++ b/examples/platforms/da15000/random.c @@ -34,13 +34,13 @@ * This implementation is not a true random number generator and does @em satisfy the Thread requirements. */ -#include "openthread/platform/random.h" -#include "platform-da15000.h" -#include "sdk_defs.h" -#include "hw_trng.h" #include +#include +#include "platform-da15000.h" +#include "hw_trng.h" +#include "sdk_defs.h" #define HW_TRNG_RAM (0x40040000) diff --git a/examples/platforms/da15000/uart.c b/examples/platforms/da15000/uart.c index f235dcc1a..2e6c3bdbc 100644 --- a/examples/platforms/da15000/uart.c +++ b/examples/platforms/da15000/uart.c @@ -36,12 +36,13 @@ #include #include #include -#include -#include "openthread/platform/uart.h" +#include + +#include "common/code_utils.hpp" -#include #include "hw_gpio.h" +#include "hw_uart.h" #include "platform-da15000.h" static int sInFd; diff --git a/examples/platforms/efr32/alarm.c b/examples/platforms/efr32/alarm.c index fc1bbe8bd..3aceb9be5 100644 --- a/examples/platforms/efr32/alarm.c +++ b/examples/platforms/efr32/alarm.c @@ -36,10 +36,11 @@ #include #include -#include -#include #include #include +#include + +#include "utils/code_utils.h" #include "rail.h" diff --git a/examples/platforms/efr32/diag.c b/examples/platforms/efr32/diag.c index 6b28d5785..53ea95b48 100644 --- a/examples/platforms/efr32/diag.c +++ b/examples/platforms/efr32/diag.c @@ -40,6 +40,7 @@ #include #include #include + #include "platform-efr32.h" /** diff --git a/examples/platforms/efr32/flash.c b/examples/platforms/efr32/flash.c index 625ee5ff7..15df34e91 100644 --- a/examples/platforms/efr32/flash.c +++ b/examples/platforms/efr32/flash.c @@ -33,8 +33,9 @@ #include #include -#include -#include + +#include "utils/code_utils.h" +#include "utils/flash.h" #include "em_msc.h" diff --git a/examples/platforms/efr32/logging.c b/examples/platforms/efr32/logging.c index 64ba71222..2a0f1c265 100644 --- a/examples/platforms/efr32/logging.c +++ b/examples/platforms/efr32/logging.c @@ -38,19 +38,10 @@ #include #endif - +#include #include -#if OPENTHREAD_ENABLE_CLI_LOGGING -#include -#include -#include -#include -#include -#include -#include -#include -#endif +#include "utils/code_utils.h" void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...) { diff --git a/examples/platforms/efr32/platform.c b/examples/platforms/efr32/platform.c index 1eca397a1..e2fb363a3 100644 --- a/examples/platforms/efr32/platform.c +++ b/examples/platforms/efr32/platform.c @@ -35,7 +35,8 @@ #include #include -#include + +#include "common/logging.hpp" #include "pa.h" #include "pti.h" diff --git a/examples/platforms/efr32/radio.c b/examples/platforms/efr32/radio.c index ea1bd757d..b5e5e88c2 100644 --- a/examples/platforms/efr32/radio.c +++ b/examples/platforms/efr32/radio.c @@ -33,15 +33,16 @@ */ #include + #include #include - -#include -#include #include #include #include +#include "common/logging.hpp" +#include "utils/code_utils.h" + #include "em_core.h" #include "em_system.h" #include "rail.h" diff --git a/examples/platforms/efr32/random.c b/examples/platforms/efr32/random.c index c17a0a93d..2ce692635 100644 --- a/examples/platforms/efr32/random.c +++ b/examples/platforms/efr32/random.c @@ -32,10 +32,11 @@ * */ -#include #include #include +#include "utils/code_utils.h" + #include "em_adc.h" #include "em_cmu.h" diff --git a/examples/platforms/efr32/uart.c b/examples/platforms/efr32/uart.c index 17066671e..6b10a5e7b 100644 --- a/examples/platforms/efr32/uart.c +++ b/examples/platforms/efr32/uart.c @@ -34,10 +34,11 @@ #include -#include #include #include +#include "utils/code_utils.h" + #include "bspconfig.h" #include "em_cmu.h" #include "em_gpio.h" diff --git a/examples/platforms/posix/alarm.c b/examples/platforms/posix/alarm.c index d936925d4..778d45126 100644 --- a/examples/platforms/posix/alarm.c +++ b/examples/platforms/posix/alarm.c @@ -32,8 +32,8 @@ #include #include -#include "openthread/platform/alarm.h" -#include "openthread/platform/diag.h" +#include +#include static bool s_is_running = false; static uint32_t s_alarm = 0; diff --git a/examples/platforms/posix/diag.c b/examples/platforms/posix/diag.c index e7d1a47dd..a9c777b1d 100644 --- a/examples/platforms/posix/diag.c +++ b/examples/platforms/posix/diag.c @@ -34,10 +34,9 @@ #include #include -#include "openthread/openthread.h" - -#include "openthread/platform/alarm.h" -#include "openthread/platform/radio.h" +#include +#include +#include /** * Diagnostics mode variables. diff --git a/examples/platforms/posix/flash.c b/examples/platforms/posix/flash.c index eb23fa4e7..7b3202d39 100644 --- a/examples/platforms/posix/flash.c +++ b/examples/platforms/posix/flash.c @@ -28,16 +28,17 @@ #include "platform-posix.h" +#include #include #include -#include -#include -#include #include +#include +#include #include -#include -#include + +#include "utils/code_utils.h" +#include "utils/flash.h" static int sFlashFd; uint32_t sEraseAddress; @@ -82,7 +83,8 @@ ThreadError utilsFlashInit(void) { for (uint16_t index = 0; index < FLASH_PAGE_NUM; index++) { - SuccessOrExit(error = utilsFlashErasePage(index * FLASH_PAGE_SIZE)); + error = utilsFlashErasePage(index * FLASH_PAGE_SIZE); + otEXPECT(error == kThreadError_None); } } @@ -113,7 +115,7 @@ ThreadError utilsFlashErasePage(uint32_t aAddress) // Write the page ssize_t r; r = pwrite(sFlashFd, &(dummyPage[0]), FLASH_PAGE_SIZE, address); - VerifyOrExit(((int)r) == ((int)(FLASH_PAGE_SIZE)), error = kThreadError_Failed); + otEXPECT_ACTION(((int)r) == ((int)(FLASH_PAGE_SIZE)), error = kThreadError_Failed); exit: diff --git a/examples/platforms/posix/logging.c b/examples/platforms/posix/logging.c index ac8c0c659..531c1d450 100644 --- a/examples/platforms/posix/logging.c +++ b/examples/platforms/posix/logging.c @@ -39,7 +39,8 @@ #include #endif -#include "openthread/platform/logging.h" +#include + #include "utils/code_utils.h" // Macro to append content to end of the log string. diff --git a/examples/platforms/posix/misc.c b/examples/platforms/posix/misc.c index 4201f1357..8e14f744c 100644 --- a/examples/platforms/posix/misc.c +++ b/examples/platforms/posix/misc.c @@ -28,8 +28,8 @@ #include "platform-posix.h" -#include "openthread/types.h" -#include "openthread/platform/misc.h" +#include +#include void otPlatReset(otInstance *aInstance) { diff --git a/examples/platforms/posix/platform-posix.h b/examples/platforms/posix/platform-posix.h index 91e281f14..4ab5c4de1 100644 --- a/examples/platforms/posix/platform-posix.h +++ b/examples/platforms/posix/platform-posix.h @@ -41,6 +41,12 @@ #include #endif +#include +#include +#include +#include +#include + #if _WIN32 #include #include @@ -75,14 +81,7 @@ __forceinline void timersub(struct timeval *a, struct timeval *b, struct timeval #define POLL poll #endif -#include "openthread/openthread.h" -#include - -#include -#include -#include -#include -#include +#include /** * Unique node ID. diff --git a/examples/platforms/posix/platform.c b/examples/platforms/posix/platform.c index f79f0b166..3bb6d42d5 100644 --- a/examples/platforms/posix/platform.c +++ b/examples/platforms/posix/platform.c @@ -46,9 +46,9 @@ #include #endif -#include "openthread/openthread.h" -#include "openthread/tasklet.h" -#include "openthread/platform/alarm.h" +#include +#include +#include uint32_t NODE_ID = 1; uint32_t WELLKNOWN_NODE_ID = 34; diff --git a/examples/platforms/posix/radio.c b/examples/platforms/posix/radio.c index 0ca1ed529..40b500eef 100644 --- a/examples/platforms/posix/radio.c +++ b/examples/platforms/posix/radio.c @@ -28,8 +28,8 @@ #include "platform-posix.h" -#include "openthread/platform/diag.h" -#include "openthread/platform/radio.h" +#include +#include #include "utils/code_utils.h" diff --git a/examples/platforms/posix/random.c b/examples/platforms/posix/random.c index 13b27d64a..98ae069c6 100644 --- a/examples/platforms/posix/random.c +++ b/examples/platforms/posix/random.c @@ -37,10 +37,10 @@ #include "platform-posix.h" -#include "openthread/types.h" -#include "openthread/platform/random.h" +#include +#include -#include +#include "utils/code_utils.h" static uint32_t sState = 1; diff --git a/examples/platforms/posix/spi-stubs.c b/examples/platforms/posix/spi-stubs.c index 4f3fe2763..653f08272 100644 --- a/examples/platforms/posix/spi-stubs.c +++ b/examples/platforms/posix/spi-stubs.c @@ -31,8 +31,8 @@ #include #include -#include "openthread/platform/uart.h" -#include "openthread/platform/spi-slave.h" +#include +#include // Spi-slave stubs diff --git a/examples/platforms/posix/uart-posix.c b/examples/platforms/posix/uart-posix.c index 48130067f..4d44f595a 100644 --- a/examples/platforms/posix/uart-posix.c +++ b/examples/platforms/posix/uart-posix.c @@ -29,18 +29,18 @@ #include "platform-posix.h" #include +#include #include #include +#include #include #include #include #include -#include -#include -#include "openthread/platform/uart.h" +#include -#include +#include "utils/code_utils.h" #ifdef OPENTHREAD_TARGET_LINUX #include diff --git a/examples/platforms/utils/flash.h b/examples/platforms/utils/flash.h index 6fcafeca1..035cdb628 100644 --- a/examples/platforms/utils/flash.h +++ b/examples/platforms/utils/flash.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/border_agent_proxy.h b/include/openthread/border_agent_proxy.h index b71fbcf66..29a46e532 100644 --- a/include/openthread/border_agent_proxy.h +++ b/include/openthread/border_agent_proxy.h @@ -41,7 +41,7 @@ #include #endif -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/cli.h b/include/openthread/cli.h index 6915b6868..b22388d75 100644 --- a/include/openthread/cli.h +++ b/include/openthread/cli.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/coap.h b/include/openthread/coap.h index 6de747285..252294749 100644 --- a/include/openthread/coap.h +++ b/include/openthread/coap.h @@ -43,8 +43,8 @@ #include -#include "openthread/types.h" -#include "openthread/message.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/commissioner.h b/include/openthread/commissioner.h index b5b2c4f59..28a02c527 100644 --- a/include/openthread/commissioner.h +++ b/include/openthread/commissioner.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_COMMISSIONER_H_ #define OPENTHREAD_COMMISSIONER_H_ -#include "openthread/types.h" -#include "openthread/platform/toolchain.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/crypto.h b/include/openthread/crypto.h index 466d0cdeb..9f9f5a776 100644 --- a/include/openthread/crypto.h +++ b/include/openthread/crypto.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_CRYPTO_H_ #define OPENTHREAD_CRYPTO_H_ -#include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/dataset.h b/include/openthread/dataset.h index f2b42005b..849639178 100644 --- a/include/openthread/dataset.h +++ b/include/openthread/dataset.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_DATASET_H_ #define OPENTHREAD_DATASET_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/dataset_ftd.h b/include/openthread/dataset_ftd.h index 15e4391de..71426e845 100644 --- a/include/openthread/dataset_ftd.h +++ b/include/openthread/dataset_ftd.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_DATASET_FTD_H_ #define OPENTHREAD_DATASET_FTD_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/dhcp6_client.h b/include/openthread/dhcp6_client.h index 7b7c4ab53..dd26a86c3 100644 --- a/include/openthread/dhcp6_client.h +++ b/include/openthread/dhcp6_client.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_DHCP6_CLIENT_H_ #define OPENTHREAD_DHCP6_CLIENT_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/dhcp6_server.h b/include/openthread/dhcp6_server.h index cdf34935e..c8c019bd8 100644 --- a/include/openthread/dhcp6_server.h +++ b/include/openthread/dhcp6_server.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_DHCP6_SERVER_H_ #define OPENTHREAD_DHCP6_SERVER_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/diag.h b/include/openthread/diag.h index 82b3ed8ec..68aaedb46 100644 --- a/include/openthread/diag.h +++ b/include/openthread/diag.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_DIAG_H_ #define OPENTHREAD_DIAG_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/dns.h b/include/openthread/dns.h index 4aa990cbb..978d19158 100644 --- a/include/openthread/dns.h +++ b/include/openthread/dns.h @@ -41,8 +41,8 @@ #include #endif -#include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/icmp6.h b/include/openthread/icmp6.h index 0517cfc26..ef3c6b300 100644 --- a/include/openthread/icmp6.h +++ b/include/openthread/icmp6.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_ICMP6_H_ #define OPENTHREAD_ICMP6_H_ -#include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/instance.h b/include/openthread/instance.h index 2d3247c32..930de9a22 100644 --- a/include/openthread/instance.h +++ b/include/openthread/instance.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_INSTANCE_H_ #define OPENTHREAD_INSTANCE_H_ -#include "openthread/types.h" -#include "openthread/platform/logging.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/ip6.h b/include/openthread/ip6.h index 97d8fe0f3..ddd3bb17b 100644 --- a/include/openthread/ip6.h +++ b/include/openthread/ip6.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_IP6_H_ #define OPENTHREAD_IP6_H_ -#include "openthread/message.h" -#include "platform/radio.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/jam_detection.h b/include/openthread/jam_detection.h index 186119937..5934c9f1b 100644 --- a/include/openthread/jam_detection.h +++ b/include/openthread/jam_detection.h @@ -41,7 +41,7 @@ #include #endif -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/joiner.h b/include/openthread/joiner.h index 746be1686..92c746cfc 100644 --- a/include/openthread/joiner.h +++ b/include/openthread/joiner.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_JOINER_H_ #define OPENTHREAD_JOINER_H_ -#include "openthread/types.h" -#include "openthread/platform/toolchain.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/link.h b/include/openthread/link.h index 7eff0e497..a176b0e0d 100644 --- a/include/openthread/link.h +++ b/include/openthread/link.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_LINK_H_ #define OPENTHREAD_LINK_H_ -#include "openthread/types.h" -#include "platform/radio.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/link_raw.h b/include/openthread/link_raw.h index ff398a070..09748bec6 100644 --- a/include/openthread/link_raw.h +++ b/include/openthread/link_raw.h @@ -35,8 +35,8 @@ #ifndef LINK_RAW_H_ #define LINK_RAW_H_ -#include "openthread/types.h" -#include "platform/radio.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/message.h b/include/openthread/message.h index 367f4b379..463a5c19f 100644 --- a/include/openthread/message.h +++ b/include/openthread/message.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_MESSAGE_H_ #define OPENTHREAD_MESSAGE_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/ncp.h b/include/openthread/ncp.h index 599047c82..f77907a5d 100644 --- a/include/openthread/ncp.h +++ b/include/openthread/ncp.h @@ -35,7 +35,7 @@ #ifndef NCP_H_ #define NCP_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/netdata.h b/include/openthread/netdata.h index 7f5d058ed..9bf1d8926 100644 --- a/include/openthread/netdata.h +++ b/include/openthread/netdata.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_NETDATA_H_ #define OPENTHREAD_NETDATA_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/openthread.h b/include/openthread/openthread.h index e55ed572e..144b995b6 100644 --- a/include/openthread/openthread.h +++ b/include/openthread/openthread.h @@ -35,17 +35,16 @@ #ifndef OPENTHREAD_H_ #define OPENTHREAD_H_ -#include "openthread/types.h" - -#include "openthread/crypto.h" -#include "openthread/dataset.h" -#include "openthread/instance.h" -#include "openthread/ip6.h" -#include "openthread/link.h" -#include "openthread/message.h" -#include "openthread/netdata.h" -#include "openthread/tasklet.h" -#include "openthread/thread.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/alarm.h b/include/openthread/platform/alarm.h index 14ab16e7d..7df8d258a 100644 --- a/include/openthread/platform/alarm.h +++ b/include/openthread/platform/alarm.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/diag.h b/include/openthread/platform/diag.h index 051dadd50..2062301f3 100644 --- a/include/openthread/platform/diag.h +++ b/include/openthread/platform/diag.h @@ -39,9 +39,8 @@ #include #include -#include - #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/messagepool.h b/include/openthread/platform/messagepool.h index 3900962f6..c464465d8 100644 --- a/include/openthread/platform/messagepool.h +++ b/include/openthread/platform/messagepool.h @@ -37,9 +37,8 @@ #include -#include "openthread/types.h" - -#include "openthread/message.h" +#include +#include /** * @defgroup messagepool MessagePool diff --git a/include/openthread/platform/misc.h b/include/openthread/platform/misc.h index 4c77662fb..5e5f4ebda 100644 --- a/include/openthread/platform/misc.h +++ b/include/openthread/platform/misc.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/platform.h b/include/openthread/platform/platform.h index d51c408fe..1e51140bb 100644 --- a/include/openthread/platform/platform.h +++ b/include/openthread/platform/platform.h @@ -35,7 +35,7 @@ #ifndef PLATFORM_H_ #define PLATFORM_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/radio.h b/include/openthread/platform/radio.h index 6ca3e2458..230e6d8e4 100644 --- a/include/openthread/platform/radio.h +++ b/include/openthread/platform/radio.h @@ -38,7 +38,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/random.h b/include/openthread/platform/random.h index cc8cba4a5..c0c91576e 100644 --- a/include/openthread/platform/random.h +++ b/include/openthread/platform/random.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/settings.h b/include/openthread/platform/settings.h index 1eb27f9dd..306956eb0 100644 --- a/include/openthread/platform/settings.h +++ b/include/openthread/platform/settings.h @@ -35,7 +35,7 @@ #ifndef OT_PLATFORM_SETTINGS_H #define OT_PLATFORM_SETTINGS_H 1 -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/spi-slave.h b/include/openthread/platform/spi-slave.h index d83c43940..014599130 100644 --- a/include/openthread/platform/spi-slave.h +++ b/include/openthread/platform/spi-slave.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/uart.h b/include/openthread/platform/uart.h index ec549ef02..566a2c9ad 100644 --- a/include/openthread/platform/uart.h +++ b/include/openthread/platform/uart.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/platform/usec-alarm.h b/include/openthread/platform/usec-alarm.h index 139cc80c2..f367e461e 100644 --- a/include/openthread/platform/usec-alarm.h +++ b/include/openthread/platform/usec-alarm.h @@ -37,7 +37,7 @@ #include -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/tasklet.h b/include/openthread/tasklet.h index 8cb2452be..f074e2c8d 100644 --- a/include/openthread/tasklet.h +++ b/include/openthread/tasklet.h @@ -35,7 +35,7 @@ #ifndef OPENTHREAD_TASKLET_H_ #define OPENTHREAD_TASKLET_H_ -#include "openthread/types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/thread.h b/include/openthread/thread.h index 735e6733b..e5af9a589 100644 --- a/include/openthread/thread.h +++ b/include/openthread/thread.h @@ -35,9 +35,9 @@ #ifndef OPENTHREAD_THREAD_H_ #define OPENTHREAD_THREAD_H_ -#include "openthread/types.h" -#include "openthread/link.h" -#include "openthread/message.h" +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/thread_ftd.h b/include/openthread/thread_ftd.h index 7340b90af..4d5a1c6d3 100644 --- a/include/openthread/thread_ftd.h +++ b/include/openthread/thread_ftd.h @@ -35,9 +35,9 @@ #ifndef OPENTHREAD_THREAD_FTD_H_ #define OPENTHREAD_THREAD_FTD_H_ -#include "openthread/types.h" -#include "openthread/link.h" -#include "openthread/message.h" +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/types.h b/include/openthread/types.h index f689c01a6..8e0e80c8f 100644 --- a/include/openthread/types.h +++ b/include/openthread/types.h @@ -41,7 +41,7 @@ #include #endif -#include "openthread/platform/toolchain.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/openthread/udp.h b/include/openthread/udp.h index 489dd865f..491e6cf69 100644 --- a/include/openthread/udp.h +++ b/include/openthread/udp.h @@ -35,8 +35,8 @@ #ifndef OPENTHREAD_UDP_H_ #define OPENTHREAD_UDP_H_ -#include "openthread/types.h" -#include "openthread/message.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 67a7b8e46..cc1cb3f14 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -37,44 +37,46 @@ #include #endif -#include -#include -#include "utils/wrap_string.h" +#include "cli.hpp" #ifdef OTDLL #include #endif -#include "openthread/openthread.h" -#include "openthread/commissioner.h" -#include "openthread/joiner.h" +#include +#include +#include "utils/wrap_string.h" + +#include +#include +#include #if OPENTHREAD_FTD -#include "openthread/dataset_ftd.h" -#include "openthread/thread_ftd.h" +#include +#include #endif #ifndef OTDLL -#include -#include "openthread/diag.h" -#include "openthread/icmp6.h" +#include +#include +#include +#include +#include -#include -#include -#include "openthread/dhcp6_client.h" -#include "openthread/dhcp6_server.h" -#include "openthread/platform/uart.h" +#include "openthread-instance.h" +#include "common/new.hpp" +#include "net/ip6.hpp" #endif -#include - -#include "cli.hpp" #include "cli_dataset.hpp" #include "cli_uart.hpp" + #if OPENTHREAD_ENABLE_APPLICATION_COAP #include "cli_coap.hpp" #endif +#include "common/encoding.hpp" + using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/cli/cli.hpp b/src/cli/cli.hpp index 454cd71ec..e2bc62a4b 100644 --- a/src/cli/cli.hpp +++ b/src/cli/cli.hpp @@ -42,22 +42,23 @@ #include -#include "openthread/openthread.h" -#include "openthread/ip6.h" -#include "openthread/udp.h" +#include +#include +#include -#include -#include +#include "cli/cli_server.hpp" #if OPENTHREAD_ENABLE_APPLICATION_COAP #include #endif +#include "common/code_utils.hpp" + #ifndef OTDLL -#include -#include -#include "openthread/dhcp6_client.h" -#include "openthread/dns.h" +#include +#include +#include "common/timer.hpp" +#include "net/icmp6.hpp" #endif #ifdef OTDLL diff --git a/src/cli/cli_coap.cpp b/src/cli/cli_coap.cpp index 219439161..128955920 100644 --- a/src/cli/cli_coap.cpp +++ b/src/cli/cli_coap.cpp @@ -37,13 +37,14 @@ #include #endif -#include -#include - #if OPENTHREAD_ENABLE_APPLICATION_COAP -#include -#include +#include "cli_coap.hpp" + +#include + +#include "cli/cli.hpp" +#include "coap/coap_header.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_coap.hpp b/src/cli/cli_coap.hpp index 437c99126..641be25f9 100644 --- a/src/cli/cli_coap.hpp +++ b/src/cli/cli_coap.hpp @@ -34,6 +34,11 @@ #ifndef CLI_COAP_HPP_ #define CLI_COAP_HPP_ +#include + +#include "cli/cli.hpp" +#include "coap/coap_header.hpp" + namespace ot { namespace Cli { diff --git a/src/cli/cli_console.cpp b/src/cli/cli_console.cpp index f25b873dc..d9d8698b9 100644 --- a/src/cli/cli_console.cpp +++ b/src/cli/cli_console.cpp @@ -37,14 +37,15 @@ #include #endif +#include "cli_console.hpp" + #include #include #include #include "utils/wrap_string.h" -#include -#include -#include +#include "cli/cli.hpp" +#include "common/new.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_console.hpp b/src/cli/cli_console.hpp index c7ba728d6..0f151efb2 100644 --- a/src/cli/cli_console.hpp +++ b/src/cli/cli_console.hpp @@ -34,9 +34,10 @@ #ifndef CLI_CONSOLE_HPP_ #define CLI_CONSOLE_HPP_ -#include "openthread/cli.h" +#include -#include +#include "cli/cli.hpp" +#include "cli/cli_server.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_dataset.cpp b/src/cli/cli_dataset.cpp index 4eccd5ce6..c80053799 100644 --- a/src/cli/cli_dataset.cpp +++ b/src/cli/cli_dataset.cpp @@ -37,18 +37,19 @@ #include #endif +#include "cli_dataset.hpp" + #include #include #include "utils/wrap_string.h" -#include "openthread/openthread.h" +#include #if OPENTHREAD_FTD -#include "openthread/dataset_ftd.h" +#include #endif -#include "cli.hpp" -#include "cli_dataset.hpp" +#include "cli/cli.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_dataset.hpp b/src/cli/cli_dataset.hpp index c519545c5..d2ad452c3 100644 --- a/src/cli/cli_dataset.hpp +++ b/src/cli/cli_dataset.hpp @@ -36,7 +36,7 @@ #include -#include +#include "cli/cli_server.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_instance.cpp b/src/cli/cli_instance.cpp index 8b3adf8b4..85e338aaf 100644 --- a/src/cli/cli_instance.cpp +++ b/src/cli/cli_instance.cpp @@ -37,12 +37,13 @@ #include #endif +#include #include #include #include "utils/wrap_string.h" -#include -#include "openthread/openthread.h" +#include + #include "cli.hpp" namespace ot { diff --git a/src/cli/cli_server.hpp b/src/cli/cli_server.hpp index 49b91dd9f..efe4b9c40 100644 --- a/src/cli/cli_server.hpp +++ b/src/cli/cli_server.hpp @@ -34,7 +34,7 @@ #ifndef CLI_SERVER_HPP_ #define CLI_SERVER_HPP_ -#include "openthread/types.h" +#include namespace ot { namespace Cli { diff --git a/src/cli/cli_uart.cpp b/src/cli/cli_uart.cpp index 906fb4f6d..78351ce39 100644 --- a/src/cli/cli_uart.cpp +++ b/src/cli/cli_uart.cpp @@ -37,21 +37,22 @@ #include #endif +#include "cli_uart.hpp" + #include #include #include #include "utils/wrap_string.h" -#include "openthread/cli.h" -#include "openthread/platform/logging.h" -#include "openthread/platform/uart.h" +#include +#include +#include -#include -#include -#include -#include -#include -#include +#include "cli/cli.hpp" +#include "common/code_utils.hpp" +#include "common/encoding.hpp" +#include "common/new.hpp" +#include "common/tasklet.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_uart.hpp b/src/cli/cli_uart.hpp index f24af516c..a6d807d10 100644 --- a/src/cli/cli_uart.hpp +++ b/src/cli/cli_uart.hpp @@ -34,10 +34,11 @@ #ifndef CLI_UART_HPP_ #define CLI_UART_HPP_ -#include "openthread/types.h" +#include -#include -#include +#include "cli/cli.hpp" +#include "cli/cli_server.hpp" +#include "common/tasklet.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_udp.cpp b/src/cli/cli_udp.cpp index 7666a3944..9a5186e03 100644 --- a/src/cli/cli_udp.cpp +++ b/src/cli/cli_udp.cpp @@ -37,13 +37,14 @@ #include #endif +#include "cli_udp.hpp" + #include #include #include "utils/wrap_string.h" -#include -#include -#include +#include "cli/cli.hpp" +#include "common/code_utils.hpp" namespace ot { namespace Cli { diff --git a/src/cli/cli_udp.hpp b/src/cli/cli_udp.hpp index 3cfd48f60..454ff3a77 100644 --- a/src/cli/cli_udp.hpp +++ b/src/cli/cli_udp.hpp @@ -34,9 +34,10 @@ #ifndef CLI_UDP_HPP_ #define CLI_UDP_HPP_ -#include "openthread/types.h" +#include -#include +#include "cli/cli.hpp" +#include "cli/cli_server.hpp" namespace ot { namespace Cli { diff --git a/src/core/api/border_agent_proxy_api.cpp b/src/core/api/border_agent_proxy_api.cpp index a7a0318e1..fee846ce1 100644 --- a/src/core/api/border_agent_proxy_api.cpp +++ b/src/core/api/border_agent_proxy_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Border Agent Proxy API. */ -#include "openthread/border_agent_proxy.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/coap_api.cpp b/src/core/api/coap_api.cpp index 3b75c1d1d..69e625c9f 100644 --- a/src/core/api/coap_api.cpp +++ b/src/core/api/coap_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread CoAP API. */ -#include "openthread/coap.h" +#include #include "openthread-instance.h" #include "coap/coap_header.hpp" diff --git a/src/core/api/commissioner_api.cpp b/src/core/api/commissioner_api.cpp index c7b669cab..e2913c1de 100644 --- a/src/core/api/commissioner_api.cpp +++ b/src/core/api/commissioner_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Commissioner API. */ -#include "openthread/commissioner.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/crypto_api.cpp b/src/core/api/crypto_api.cpp index f342eafad..ac4a7790c 100644 --- a/src/core/api/crypto_api.cpp +++ b/src/core/api/crypto_api.cpp @@ -31,12 +31,12 @@ * This file implements the OpenThread Crypto API. */ -#include "openthread/crypto.h" +#include -#include "common/debug.hpp" #include "common/code_utils.hpp" -#include "crypto/hmac_sha256.hpp" +#include "common/debug.hpp" #include "crypto/aes_ccm.hpp" +#include "crypto/hmac_sha256.hpp" using namespace ot::Crypto; diff --git a/src/core/api/dataset_api.cpp b/src/core/api/dataset_api.cpp index 837c7d2be..590c9280a 100644 --- a/src/core/api/dataset_api.cpp +++ b/src/core/api/dataset_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Operational Dataset API (for both FTD and MTD). */ -#include "openthread/dataset.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/dataset_ftd_api.cpp b/src/core/api/dataset_ftd_api.cpp index 477254559..3b0f328db 100644 --- a/src/core/api/dataset_ftd_api.cpp +++ b/src/core/api/dataset_ftd_api.cpp @@ -33,7 +33,7 @@ #if OPENTHREAD_FTD -#include "openthread/dataset_ftd.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/dhcp6_api.cpp b/src/core/api/dhcp6_api.cpp index de0ea40aa..504a90e21 100644 --- a/src/core/api/dhcp6_api.cpp +++ b/src/core/api/dhcp6_api.cpp @@ -31,8 +31,8 @@ * This file implements the OpenThread DHCPv6 API. */ -#include "openthread/dhcp6_client.h" -#include "openthread/dhcp6_server.h" +#include +#include #include "openthread-instance.h" diff --git a/src/core/api/dns_api.cpp b/src/core/api/dns_api.cpp index 31342d75f..027157046 100644 --- a/src/core/api/dns_api.cpp +++ b/src/core/api/dns_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread UDP API. */ -#include "openthread/dns.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/icmp6_api.cpp b/src/core/api/icmp6_api.cpp index 38d60c76a..4400399f4 100644 --- a/src/core/api/icmp6_api.cpp +++ b/src/core/api/icmp6_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread ICMPv6 API. */ -#include "openthread/icmp6.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/instance_api.cpp b/src/core/api/instance_api.cpp index c2b2b77ad..aabfa4a8f 100644 --- a/src/core/api/instance_api.cpp +++ b/src/core/api/instance_api.cpp @@ -39,12 +39,11 @@ #include #endif -#include "openthread/instance.h" -#include "openthread/platform/misc.h" -#include "openthread/platform/settings.h" +#include +#include +#include #include "openthread-instance.h" - #include "common/logging.hpp" #include "common/new.hpp" diff --git a/src/core/api/ip6_api.cpp b/src/core/api/ip6_api.cpp index 188397013..13f9a6d1e 100644 --- a/src/core/api/ip6_api.cpp +++ b/src/core/api/ip6_api.cpp @@ -33,7 +33,7 @@ #define WPP_NAME "ip6_api.tmh" -#include "openthread/ip6.h" +#include #include "openthread-instance.h" #include "common/logging.hpp" diff --git a/src/core/api/jam_detection_api.cpp b/src/core/api/jam_detection_api.cpp index b60d4c3a2..1f9f64355 100644 --- a/src/core/api/jam_detection_api.cpp +++ b/src/core/api/jam_detection_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Jam Detection API. */ -#include "openthread/jam_detection.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/joiner_api.cpp b/src/core/api/joiner_api.cpp index 3df669b5c..488d3f114 100644 --- a/src/core/api/joiner_api.cpp +++ b/src/core/api/joiner_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Joiner API. */ -#include "openthread/joiner.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/link_api.cpp b/src/core/api/link_api.cpp index ced4993e7..cc2e6fb93 100644 --- a/src/core/api/link_api.cpp +++ b/src/core/api/link_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Link API. */ -#include "openthread/link.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/link_raw.hpp b/src/core/api/link_raw.hpp index 8b11dd1a7..3b9198b71 100644 --- a/src/core/api/link_raw.hpp +++ b/src/core/api/link_raw.hpp @@ -34,8 +34,10 @@ #ifndef LINK_RAW_HPP_ #define LINK_RAW_HPP_ -#include -#include "openthread/link_raw.h" +#include + +#include "openthread-core-config.h" +#include "common/timer.hpp" #if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT || OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT || OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN #define OPENTHREAD_LINKRAW_TIMER_REQUIRED 1 diff --git a/src/core/api/link_raw_api.cpp b/src/core/api/link_raw_api.cpp index 51238ef95..a8c59fa08 100644 --- a/src/core/api/link_raw_api.cpp +++ b/src/core/api/link_raw_api.cpp @@ -31,11 +31,12 @@ * This file implements the OpenThread Link Raw API. */ -#include -#include -#include "openthread/platform/random.h" -#include "openthread/platform/usec-alarm.h" +#include +#include + #include "openthread-instance.h" +#include "common/debug.hpp" +#include "common/logging.hpp" #if OPENTHREAD_ENABLE_RAW_LINK_API diff --git a/src/core/api/message_api.cpp b/src/core/api/message_api.cpp index bfab732bb..a00450a1f 100644 --- a/src/core/api/message_api.cpp +++ b/src/core/api/message_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Message API. */ -#include "openthread/message.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/netdata_api.cpp b/src/core/api/netdata_api.cpp index a5b752179..03c305d10 100644 --- a/src/core/api/netdata_api.cpp +++ b/src/core/api/netdata_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread Network Data API. */ -#include "openthread/netdata.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/tasklet_api.cpp b/src/core/api/tasklet_api.cpp index b4cc56fb7..787aaedb5 100644 --- a/src/core/api/tasklet_api.cpp +++ b/src/core/api/tasklet_api.cpp @@ -33,7 +33,7 @@ #define WPP_NAME "tasklet_api.tmh" -#include "openthread/tasklet.h" +#include #include "openthread-instance.h" #include "common/logging.hpp" diff --git a/src/core/api/thread_api.cpp b/src/core/api/thread_api.cpp index add185a80..6049b7d7b 100644 --- a/src/core/api/thread_api.cpp +++ b/src/core/api/thread_api.cpp @@ -33,12 +33,12 @@ #define WPP_NAME "thread_api.tmh" -#include "openthread/thread.h" +#include +#include #include "openthread-instance.h" #include "common/logging.hpp" #include "common/settings.hpp" -#include "openthread/platform/settings.h" using namespace ot; diff --git a/src/core/api/thread_ftd_api.cpp b/src/core/api/thread_ftd_api.cpp index 7c500e802..ae40cd41b 100644 --- a/src/core/api/thread_ftd_api.cpp +++ b/src/core/api/thread_ftd_api.cpp @@ -35,7 +35,7 @@ #define WPP_NAME "thread_ftd_api.tmh" -#include "openthread/thread_ftd.h" +#include #include "openthread-instance.h" diff --git a/src/core/api/udp_api.cpp b/src/core/api/udp_api.cpp index 6548a64a9..9507ea034 100644 --- a/src/core/api/udp_api.cpp +++ b/src/core/api/udp_api.cpp @@ -31,7 +31,7 @@ * This file implements the OpenThread UDP API. */ -#include "openthread/udp.h" +#include #include "openthread-instance.h" diff --git a/src/core/coap/coap_base.cpp b/src/core/coap/coap_base.cpp index 51c0a0a92..48242f942 100644 --- a/src/core/coap/coap_base.cpp +++ b/src/core/coap/coap_base.cpp @@ -32,8 +32,9 @@ #include #endif -#include -#include +#include "coap_base.hpp" + +#include "common/code_utils.hpp" /** * @file diff --git a/src/core/coap/coap_base.hpp b/src/core/coap/coap_base.hpp index 0422061da..28897708b 100644 --- a/src/core/coap/coap_base.hpp +++ b/src/core/coap/coap_base.hpp @@ -29,12 +29,12 @@ #ifndef COAP_BASE_HPP_ #define COAP_BASE_HPP_ -#include "openthread/coap.h" +#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "common/message.hpp" +#include "net/netif.hpp" +#include "net/udp6.hpp" /** * @file diff --git a/src/core/coap/coap_client.cpp b/src/core/coap/coap_client.cpp index 51f5b5299..fc11aec38 100644 --- a/src/core/coap/coap_client.cpp +++ b/src/core/coap/coap_client.cpp @@ -32,16 +32,16 @@ #include #endif +#include "coap_client.hpp" + +#include + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "net/ip6.hpp" +#include "net/udp6.hpp" #include "utils/wrap_string.h" -#include "openthread/platform/random.h" - -#include -#include -#include -#include -#include - /** * @file * This file implements the CoAP client. diff --git a/src/core/coap/coap_client.hpp b/src/core/coap/coap_client.hpp index 0e1d1f67d..2600200ee 100644 --- a/src/core/coap/coap_client.hpp +++ b/src/core/coap/coap_client.hpp @@ -29,14 +29,14 @@ #ifndef COAP_CLIENT_HPP_ #define COAP_CLIENT_HPP_ -#include "openthread/coap.h" +#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_base.hpp" +#include "coap/coap_header.hpp" +#include "common/message.hpp" +#include "common/timer.hpp" +#include "net/netif.hpp" +#include "net/udp6.hpp" /** * @file diff --git a/src/core/coap/coap_header.cpp b/src/core/coap/coap_header.cpp index a0d7bff93..d09f91a90 100644 --- a/src/core/coap/coap_header.cpp +++ b/src/core/coap/coap_header.cpp @@ -37,13 +37,14 @@ #include #endif -#include "openthread/platform/random.h" +#include "coap_header.hpp" -#include -#include -#include -#include -#include +#include + +#include "coap/coap_client.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" namespace ot { namespace Coap { diff --git a/src/core/coap/coap_header.hpp b/src/core/coap/coap_header.hpp index e1e5a6077..5748cdbe8 100644 --- a/src/core/coap/coap_header.hpp +++ b/src/core/coap/coap_header.hpp @@ -36,10 +36,10 @@ #include "utils/wrap_string.h" -#include "openthread/coap.h" +#include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/coap/coap_server.cpp b/src/core/coap/coap_server.cpp index ede57e841..f551b6d67 100644 --- a/src/core/coap/coap_server.cpp +++ b/src/core/coap/coap_server.cpp @@ -37,9 +37,10 @@ #include #endif -#include -#include -#include +#include "coap_server.hpp" + +#include "common/code_utils.hpp" +#include "net/ip6.hpp" namespace ot { namespace Coap { diff --git a/src/core/coap/coap_server.hpp b/src/core/coap/coap_server.hpp index 9542b6c9e..7ae0770fe 100644 --- a/src/core/coap/coap_server.hpp +++ b/src/core/coap/coap_server.hpp @@ -34,15 +34,15 @@ #ifndef COAP_SERVER_HPP_ #define COAP_SERVER_HPP_ -#include "openthread/coap.h" +#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_base.hpp" +#include "coap/coap_header.hpp" +#include "common/debug.hpp" +#include "common/message.hpp" +#include "common/timer.hpp" +#include "net/ip6.hpp" +#include "net/udp6.hpp" namespace ot { namespace Coap { diff --git a/src/core/coap/secure_coap_client.cpp b/src/core/coap/secure_coap_client.cpp index bc0b4a25a..d6e70eaae 100644 --- a/src/core/coap/secure_coap_client.cpp +++ b/src/core/coap/secure_coap_client.cpp @@ -34,10 +34,11 @@ #include #endif -#include -#include -#include -#include +#include "secure_coap_client.hpp" + +#include "common/logging.hpp" +#include "meshcop/dtls.hpp" +#include "thread/thread_netif.hpp" #if OPENTHREAD_ENABLE_JOINER diff --git a/src/core/coap/secure_coap_client.hpp b/src/core/coap/secure_coap_client.hpp index 8960bae93..1f3c85c12 100644 --- a/src/core/coap/secure_coap_client.hpp +++ b/src/core/coap/secure_coap_client.hpp @@ -29,8 +29,8 @@ #ifndef SECURE_COAP_CLIENT_HPP_ #define SECURE_COAP_CLIENT_HPP_ -#include -#include +#include "coap/coap_client.hpp" +#include "meshcop/dtls.hpp" /** * @file diff --git a/src/core/coap/secure_coap_server.cpp b/src/core/coap/secure_coap_server.cpp index 9242e961c..dd48add90 100644 --- a/src/core/coap/secure_coap_server.cpp +++ b/src/core/coap/secure_coap_server.cpp @@ -34,10 +34,11 @@ #include #endif -#include -#include -#include -#include +#include "secure_coap_server.hpp" + +#include "common/logging.hpp" +#include "meshcop/dtls.hpp" +#include "thread/thread_netif.hpp" #if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD diff --git a/src/core/common/crc16.cpp b/src/core/common/crc16.cpp index 61cdaacc8..a2877bf99 100644 --- a/src/core/common/crc16.cpp +++ b/src/core/common/crc16.cpp @@ -37,7 +37,7 @@ #include #endif -#include +#include "crc16.hpp" namespace ot { diff --git a/src/core/common/debug.hpp b/src/core/common/debug.hpp index 2b0a471ea..b6dfbbe07 100644 --- a/src/core/common/debug.hpp +++ b/src/core/common/debug.hpp @@ -34,11 +34,12 @@ #ifndef DEBUG_HPP_ #define DEBUG_HPP_ -#include #include #include #include "utils/wrap_string.h" +#include "openthread-core-config.h" + #if defined(OPENTHREAD_TARGET_DARWIN) || defined(OPENTHREAD_TARGET_LINUX) #include diff --git a/src/core/common/logging.cpp b/src/core/common/logging.cpp index 75c63f1b6..d72849ebc 100644 --- a/src/core/common/logging.cpp +++ b/src/core/common/logging.cpp @@ -39,9 +39,9 @@ #include #endif -#include "openthread/openthread.h" +#include "logging.hpp" -#include +#include #ifndef WINDOWS_LOGGING #define otLogDump(aFormat, ...) \ diff --git a/src/core/common/logging.hpp b/src/core/common/logging.hpp index cedd52b0d..ea6f99aea 100644 --- a/src/core/common/logging.hpp +++ b/src/core/common/logging.hpp @@ -38,10 +38,11 @@ #include #include "utils/wrap_string.h" -#include -#include "openthread/types.h" -#include "openthread/instance.h" -#include "openthread/platform/logging.h" +#include +#include +#include + +#include "openthread-core-config.h" #ifdef WINDOWS_LOGGING #ifdef _KERNEL_MODE diff --git a/src/core/common/message.cpp b/src/core/common/message.cpp index 1d6c35855..924690518 100644 --- a/src/core/common/message.cpp +++ b/src/core/common/message.cpp @@ -39,11 +39,12 @@ #include #endif -#include -#include -#include -#include -#include +#include "message.hpp" + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "net/ip6.hpp" namespace ot { diff --git a/src/core/common/message.hpp b/src/core/common/message.hpp index af4f82e36..2b4bfe590 100644 --- a/src/core/common/message.hpp +++ b/src/core/common/message.hpp @@ -43,12 +43,12 @@ #include "utils/wrap_stdint.h" #include "utils/wrap_string.h" -#include "openthread/message.h" -#include "openthread/platform/messagepool.h" +#include +#include -#include -#include -#include +#include "openthread-core-config.h" +#include "common/code_utils.hpp" +#include "mac/mac_frame.hpp" namespace ot { diff --git a/src/core/common/new.hpp b/src/core/common/new.hpp index 80e45439d..a59538393 100644 --- a/src/core/common/new.hpp +++ b/src/core/common/new.hpp @@ -36,7 +36,7 @@ #include -#include "openthread/platform/toolchain.h" +#include inline void *operator new(size_t, void *p) throw() { return p; } diff --git a/src/core/common/tasklet.cpp b/src/core/common/tasklet.cpp index 07042f966..7d9465d0f 100644 --- a/src/core/common/tasklet.cpp +++ b/src/core/common/tasklet.cpp @@ -37,12 +37,13 @@ #include #endif -#include "openthread/openthread.h" +#include "tasklet.hpp" -#include -#include -#include -#include +#include + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "net/ip6.hpp" namespace ot { diff --git a/src/core/common/tasklet.hpp b/src/core/common/tasklet.hpp index b6a9669cf..e5bebd7c5 100644 --- a/src/core/common/tasklet.hpp +++ b/src/core/common/tasklet.hpp @@ -34,7 +34,9 @@ #ifndef TASKLET_HPP_ #define TASKLET_HPP_ -#include "openthread/tasklet.h" +#include + +#include namespace ot { diff --git a/src/core/common/timer.cpp b/src/core/common/timer.cpp index 1b31cc778..6f34c2e0a 100644 --- a/src/core/common/timer.cpp +++ b/src/core/common/timer.cpp @@ -39,14 +39,15 @@ #include #endif -#include "openthread/platform/alarm.h" +#include "timer.hpp" -#include -#include -#include -#include -#include -#include +#include + +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "net/ip6.hpp" namespace ot { diff --git a/src/core/common/timer.hpp b/src/core/common/timer.hpp index cb6c72f95..ba5886d3f 100644 --- a/src/core/common/timer.hpp +++ b/src/core/common/timer.hpp @@ -37,10 +37,10 @@ #include #include "utils/wrap_stdint.h" -#include "openthread/types.h" -#include "openthread/platform/alarm.h" +#include +#include -#include +#include "common/tasklet.hpp" namespace ot { diff --git a/src/core/common/tlvs.cpp b/src/core/common/tlvs.cpp index ec0cc107a..d820e94e8 100644 --- a/src/core/common/tlvs.cpp +++ b/src/core/common/tlvs.cpp @@ -37,9 +37,10 @@ #include #endif -#include -#include -#include +#include "tlvs.hpp" + +#include "common/code_utils.hpp" +#include "common/message.hpp" namespace ot { diff --git a/src/core/common/tlvs.hpp b/src/core/common/tlvs.hpp index 738da1fca..bbcc5f547 100644 --- a/src/core/common/tlvs.hpp +++ b/src/core/common/tlvs.hpp @@ -36,10 +36,10 @@ #include "utils/wrap_string.h" -#include "openthread/types.h" +#include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/common/trickle_timer.cpp b/src/core/common/trickle_timer.cpp index 0be22798c..658008112 100644 --- a/src/core/common/trickle_timer.cpp +++ b/src/core/common/trickle_timer.cpp @@ -37,11 +37,12 @@ #include #endif -#include "openthread/platform/random.h" +#include "trickle_timer.hpp" -#include -#include -#include +#include + +#include "common/code_utils.hpp" +#include "common/debug.hpp" namespace ot { diff --git a/src/core/common/trickle_timer.hpp b/src/core/common/trickle_timer.hpp index 7812c4990..90e10b1dc 100644 --- a/src/core/common/trickle_timer.hpp +++ b/src/core/common/trickle_timer.hpp @@ -34,7 +34,7 @@ #ifndef TRICKLE_TIMER_HPP_ #define TRICKLE_TIMER_HPP_ -#include +#include "common/timer.hpp" namespace ot { diff --git a/src/core/crypto/aes_ccm.cpp b/src/core/crypto/aes_ccm.cpp index e85eb95e5..77df0572d 100644 --- a/src/core/crypto/aes_ccm.cpp +++ b/src/core/crypto/aes_ccm.cpp @@ -37,9 +37,10 @@ #include #endif -#include -#include -#include +#include "aes_ccm.hpp" + +#include "common/code_utils.hpp" +#include "common/debug.hpp" namespace ot { namespace Crypto { diff --git a/src/core/crypto/aes_ccm.hpp b/src/core/crypto/aes_ccm.hpp index 2d9479102..d7ec9be2b 100644 --- a/src/core/crypto/aes_ccm.hpp +++ b/src/core/crypto/aes_ccm.hpp @@ -36,9 +36,9 @@ #include "utils/wrap_stdint.h" -#include "openthread/types.h" +#include -#include +#include "crypto/aes_ecb.hpp" namespace ot { namespace Crypto { diff --git a/src/core/crypto/aes_ecb.cpp b/src/core/crypto/aes_ecb.cpp index ea4f2df53..95e3d84af 100644 --- a/src/core/crypto/aes_ecb.cpp +++ b/src/core/crypto/aes_ecb.cpp @@ -37,7 +37,7 @@ #include #endif -#include +#include "aes_ecb.hpp" namespace ot { namespace Crypto { diff --git a/src/core/crypto/hmac_sha256.cpp b/src/core/crypto/hmac_sha256.cpp index 127584e80..fa68f3d8d 100644 --- a/src/core/crypto/hmac_sha256.cpp +++ b/src/core/crypto/hmac_sha256.cpp @@ -37,7 +37,7 @@ #include #endif -#include +#include "hmac_sha256.hpp" namespace ot { namespace Crypto { diff --git a/src/core/crypto/mbedtls.cpp b/src/core/crypto/mbedtls.cpp index f127fadf4..137bd65eb 100644 --- a/src/core/crypto/mbedtls.cpp +++ b/src/core/crypto/mbedtls.cpp @@ -37,7 +37,7 @@ #include #endif -#include +#include "mbedtls.hpp" namespace ot { namespace Crypto { diff --git a/src/core/crypto/mbedtls.hpp b/src/core/crypto/mbedtls.hpp index 3d3c72608..67f999132 100644 --- a/src/core/crypto/mbedtls.hpp +++ b/src/core/crypto/mbedtls.hpp @@ -40,10 +40,10 @@ #include #endif -#include - #include +#include "openthread-core-config.h" + namespace ot { namespace Crypto { diff --git a/src/core/crypto/pbkdf2_cmac.cpp b/src/core/crypto/pbkdf2_cmac.cpp index 17f20a97c..4b0de3fa4 100644 --- a/src/core/crypto/pbkdf2_cmac.cpp +++ b/src/core/crypto/pbkdf2_cmac.cpp @@ -37,8 +37,10 @@ #include #endif +#include "pbkdf2_cmac.h" + #include "utils/wrap_string.h" -#include + #include #if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD diff --git a/src/core/crypto/pbkdf2_cmac.h b/src/core/crypto/pbkdf2_cmac.h index 8e64c6e6c..5791b0430 100644 --- a/src/core/crypto/pbkdf2_cmac.h +++ b/src/core/crypto/pbkdf2_cmac.h @@ -35,8 +35,8 @@ #ifndef PBKDF2_CMAC_H_ #define PBKDF2_CMAC_H_ -#include "utils/wrap_stdint.h" #include "utils/wrap_stdbool.h" +#include "utils/wrap_stdint.h" #ifdef __cplusplus extern "C" { diff --git a/src/core/crypto/sha256.cpp b/src/core/crypto/sha256.cpp index 4f22b73e6..ff497ba81 100644 --- a/src/core/crypto/sha256.cpp +++ b/src/core/crypto/sha256.cpp @@ -37,7 +37,7 @@ #include #endif -#include +#include "sha256.hpp" namespace ot { namespace Crypto { diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 9ef4ac793..1127df868 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -39,23 +39,24 @@ #include #endif +#include "mac.hpp" + #include "utils/wrap_string.h" -#include "openthread/platform/random.h" -#include "openthread/platform/usec-alarm.h" +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "crypto/aes_ccm.hpp" +#include "crypto/sha256.hpp" +#include "mac/mac_frame.hpp" +#include "thread/link_quality.hpp" +#include "thread/mle_router.hpp" +#include "thread/thread_netif.hpp" using ot::Encoding::BigEndian::HostSwap64; diff --git a/src/core/mac/mac.hpp b/src/core/mac/mac.hpp index c1fab318c..6c518c354 100644 --- a/src/core/mac/mac.hpp +++ b/src/core/mac/mac.hpp @@ -34,18 +34,17 @@ #ifndef MAC_HPP_ #define MAC_HPP_ -#include "openthread/platform/radio.h" +#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "common/tasklet.hpp" +#include "common/timer.hpp" +#include "mac/mac_blacklist.hpp" +#include "mac/mac_frame.hpp" +#include "mac/mac_whitelist.hpp" +#include "thread/key_manager.hpp" +#include "thread/network_diagnostic_tlvs.hpp" +#include "thread/topology.hpp" namespace ot { diff --git a/src/core/mac/mac_blacklist.cpp b/src/core/mac/mac_blacklist.cpp index 184bf8892..adb44a579 100644 --- a/src/core/mac/mac_blacklist.cpp +++ b/src/core/mac/mac_blacklist.cpp @@ -37,10 +37,11 @@ #include #endif +#include "mac_blacklist.hpp" + #include "utils/wrap_string.h" -#include -#include +#include "common/code_utils.hpp" #if OPENTHREAD_ENABLE_MAC_WHITELIST diff --git a/src/core/mac/mac_blacklist_impl.hpp b/src/core/mac/mac_blacklist_impl.hpp index 583ec0cfc..74d17454e 100644 --- a/src/core/mac/mac_blacklist_impl.hpp +++ b/src/core/mac/mac_blacklist_impl.hpp @@ -36,9 +36,9 @@ #include "utils/wrap_stdint.h" -#include "openthread/types.h" +#include -#include +#include "mac/mac_frame.hpp" namespace ot { namespace Mac { diff --git a/src/core/mac/mac_blacklist_stub.hpp b/src/core/mac/mac_blacklist_stub.hpp index 53890ae76..3e8356eec 100644 --- a/src/core/mac/mac_blacklist_stub.hpp +++ b/src/core/mac/mac_blacklist_stub.hpp @@ -36,9 +36,9 @@ #include "utils/wrap_stdint.h" -#include "openthread/types.h" +#include -#include +#include "mac/mac_frame.hpp" namespace ot { namespace Mac { diff --git a/src/core/mac/mac_frame.cpp b/src/core/mac/mac_frame.cpp index 5db381557..c022567b4 100644 --- a/src/core/mac/mac_frame.cpp +++ b/src/core/mac/mac_frame.cpp @@ -37,13 +37,14 @@ #include #endif +#include "mac_frame.hpp" + #include #include "utils/wrap_string.h" -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "net/ip6_address.hpp" namespace ot { namespace Mac { diff --git a/src/core/mac/mac_frame.hpp b/src/core/mac/mac_frame.hpp index 1523760d0..269962cea 100644 --- a/src/core/mac/mac_frame.hpp +++ b/src/core/mac/mac_frame.hpp @@ -34,16 +34,15 @@ #ifndef MAC_FRAME_HPP_ #define MAC_FRAME_HPP_ -#include - #include #include "utils/wrap_stdint.h" #include "utils/wrap_string.h" -#include "openthread/types.h" -#include "openthread/platform/radio.h" +#include +#include -#include +#include "openthread-core-config.h" +#include "common/encoding.hpp" namespace ot { diff --git a/src/core/mac/mac_whitelist.cpp b/src/core/mac/mac_whitelist.cpp index e56833d4e..ec09ab90d 100644 --- a/src/core/mac/mac_whitelist.cpp +++ b/src/core/mac/mac_whitelist.cpp @@ -37,10 +37,11 @@ #include #endif +#include "mac_whitelist.hpp" + #include "utils/wrap_string.h" -#include -#include +#include "common/code_utils.hpp" #if OPENTHREAD_ENABLE_MAC_WHITELIST diff --git a/src/core/mac/mac_whitelist_impl.hpp b/src/core/mac/mac_whitelist_impl.hpp index 78f377dc0..c5cb0886e 100644 --- a/src/core/mac/mac_whitelist_impl.hpp +++ b/src/core/mac/mac_whitelist_impl.hpp @@ -36,9 +36,9 @@ #include "utils/wrap_stdint.h" -#include "openthread/types.h" +#include -#include +#include "mac/mac_frame.hpp" namespace ot { namespace Mac { diff --git a/src/core/mac/mac_whitelist_stub.hpp b/src/core/mac/mac_whitelist_stub.hpp index 01a1050fd..ceab3165c 100644 --- a/src/core/mac/mac_whitelist_stub.hpp +++ b/src/core/mac/mac_whitelist_stub.hpp @@ -36,9 +36,9 @@ #include "utils/wrap_stdint.h" -#include "openthread/types.h" +#include -#include +#include "mac/mac_frame.hpp" namespace ot { namespace Mac { diff --git a/src/core/meshcop/announce_begin_client.cpp b/src/core/meshcop/announce_begin_client.cpp index 813161fb0..f9dc66b8d 100644 --- a/src/core/meshcop/announce_begin_client.cpp +++ b/src/core/meshcop/announce_begin_client.cpp @@ -39,17 +39,18 @@ #include #endif -#include "openthread/platform/random.h" +#include "announce_begin_client.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" #if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD diff --git a/src/core/meshcop/announce_begin_client.hpp b/src/core/meshcop/announce_begin_client.hpp index b2c00f678..0349716b5 100644 --- a/src/core/meshcop/announce_begin_client.hpp +++ b/src/core/meshcop/announce_begin_client.hpp @@ -34,13 +34,10 @@ #ifndef ANNOUNCE_BEGIN_CLIENT_HPP_ #define ANNOUNCE_BEGIN_CLIENT_HPP_ -#include - -#include "openthread/commissioner.h" - -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "net/ip6_address.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/meshcop/border_agent_proxy.cpp b/src/core/meshcop/border_agent_proxy.cpp index 2198ec8ff..576256390 100644 --- a/src/core/meshcop/border_agent_proxy.cpp +++ b/src/core/meshcop/border_agent_proxy.cpp @@ -39,14 +39,15 @@ #include #endif -#include -#include -#include -#include -#include - #include "border_agent_proxy.hpp" +#include + +#include "coap/coap_header.hpp" +#include "net/ip6_address.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" + #if OPENTHREAD_FTD && OPENTHREAD_ENABLE_BORDER_AGENT_PROXY namespace ot { diff --git a/src/core/meshcop/border_agent_proxy.hpp b/src/core/meshcop/border_agent_proxy.hpp index a5f05bb0a..ebcfcc5d3 100644 --- a/src/core/meshcop/border_agent_proxy.hpp +++ b/src/core/meshcop/border_agent_proxy.hpp @@ -34,11 +34,11 @@ #ifndef BORDER_AGENT_PROXY_HPP_ #define BORDER_AGENT_PROXY_HPP_ -#include #include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/commissioner.cpp b/src/core/meshcop/commissioner.cpp index a40f8a9b4..f937aad4a 100644 --- a/src/core/meshcop/commissioner.cpp +++ b/src/core/meshcop/commissioner.cpp @@ -39,23 +39,24 @@ #include #endif +#include "commissioner.hpp" + #include #include "utils/wrap_string.h" -#include "openthread/platform/random.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include + +#include "coap/coap_header.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "crypto/pbkdf2_cmac.h" +#include "meshcop/joiner_router.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" #if OPENTHREAD_FTD && OPENTHREAD_ENABLE_COMMISSIONER diff --git a/src/core/meshcop/commissioner.hpp b/src/core/meshcop/commissioner.hpp index 2b35922b7..88eaedb16 100644 --- a/src/core/meshcop/commissioner.hpp +++ b/src/core/meshcop/commissioner.hpp @@ -34,20 +34,20 @@ #ifndef COMMISSIONER_HPP_ #define COMMISSIONER_HPP_ -#include -#include "openthread/commissioner.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "coap/secure_coap_server.hpp" +#include "common/timer.hpp" +#include "mac/mac_frame.hpp" +#include "meshcop/announce_begin_client.hpp" +#include "meshcop/dtls.hpp" +#include "meshcop/energy_scan_client.hpp" +#include "meshcop/panid_query_client.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" namespace ot { diff --git a/src/core/meshcop/dataset.cpp b/src/core/meshcop/dataset.cpp index 45acf87e7..1b759ada9 100644 --- a/src/core/meshcop/dataset.cpp +++ b/src/core/meshcop/dataset.cpp @@ -38,15 +38,16 @@ #include #endif +#include "dataset.hpp" + #include -#include "openthread/platform/settings.h" +#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/settings.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/mle_tlvs.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/dataset.hpp b/src/core/meshcop/dataset.hpp index a41e20e61..c84b415c9 100644 --- a/src/core/meshcop/dataset.hpp +++ b/src/core/meshcop/dataset.hpp @@ -35,8 +35,8 @@ #ifndef MESHCOP_DATASET_HPP_ #define MESHCOP_DATASET_HPP_ -#include -#include +#include "common/message.hpp" +#include "meshcop/meshcop_tlvs.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/dataset_manager.cpp b/src/core/meshcop/dataset_manager.cpp index 5333ec9dc..57e49c7e6 100644 --- a/src/core/meshcop/dataset_manager.cpp +++ b/src/core/meshcop/dataset_manager.cpp @@ -40,27 +40,27 @@ #include #endif +#include "dataset_manager.hpp" + #include -#include "openthread/platform/random.h" -#include "openthread/platform/radio.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include + +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "common/timer.hpp" +#include "meshcop/dataset.hpp" +#include "meshcop/leader.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/dataset_manager.hpp b/src/core/meshcop/dataset_manager.hpp index 6acc763a1..252758b0f 100644 --- a/src/core/meshcop/dataset_manager.hpp +++ b/src/core/meshcop/dataset_manager.hpp @@ -35,14 +35,14 @@ #ifndef MESHCOP_DATASET_MANAGER_HPP_ #define MESHCOP_DATASET_MANAGER_HPP_ -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "meshcop/dataset.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" +#include "thread/network_data_leader.hpp" namespace ot { diff --git a/src/core/meshcop/dataset_manager_ftd.cpp b/src/core/meshcop/dataset_manager_ftd.cpp index 44920efa5..4ffebfeb5 100644 --- a/src/core/meshcop/dataset_manager_ftd.cpp +++ b/src/core/meshcop/dataset_manager_ftd.cpp @@ -44,23 +44,23 @@ #include -#include "openthread/platform/random.h" -#include "openthread/platform/radio.h" +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "coap/coap_header.hpp" +#include "common/debug.hpp" +#include "common/code_utils.hpp" +#include "common/logging.hpp" +#include "common/timer.hpp" +#include "meshcop/dataset.hpp" +#include "meshcop/dataset_manager.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "meshcop/leader.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/dataset_manager_ftd.hpp b/src/core/meshcop/dataset_manager_ftd.hpp index e7f5527bc..f5316fa71 100644 --- a/src/core/meshcop/dataset_manager_ftd.hpp +++ b/src/core/meshcop/dataset_manager_ftd.hpp @@ -35,9 +35,9 @@ #ifndef MESHCOP_DATASET_MANAGER_FTD_HPP_ #define MESHCOP_DATASET_MANAGER_FTD_HPP_ -#include "openthread/types.h" +#include -#include +#include "coap/coap_server.hpp" namespace ot { diff --git a/src/core/meshcop/dataset_manager_mtd.hpp b/src/core/meshcop/dataset_manager_mtd.hpp index f9c91c95e..a5861f92b 100644 --- a/src/core/meshcop/dataset_manager_mtd.hpp +++ b/src/core/meshcop/dataset_manager_mtd.hpp @@ -35,7 +35,7 @@ #ifndef MESHCOP_DATASET_MANAGER_MTD_HPP_ #define MESHCOP_DATASET_MANAGER_MTD_HPP_ -#include "openthread/types.h" +#include namespace ot { diff --git a/src/core/meshcop/dtls.cpp b/src/core/meshcop/dtls.cpp index ae4ba39e9..bb5ab96d7 100644 --- a/src/core/meshcop/dtls.cpp +++ b/src/core/meshcop/dtls.cpp @@ -31,25 +31,26 @@ * This file implements the necessary hooks for mbedTLS. */ +#define WPP_NAME "dtls.tmh" + #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE #else #include #endif -#define WPP_NAME "dtls.tmh" - -#include -#include -#include -#include -#include -#include -#include -#include +#include "dtls.hpp" #include +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "common/timer.hpp" +#include "crypto/sha256.hpp" +#include "thread/thread_netif.hpp" + #if OPENTHREAD_ENABLE_DTLS namespace ot { diff --git a/src/core/meshcop/dtls.hpp b/src/core/meshcop/dtls.hpp index e5a742b42..790945503 100644 --- a/src/core/meshcop/dtls.hpp +++ b/src/core/meshcop/dtls.hpp @@ -34,12 +34,7 @@ #ifndef DTLS_HPP_ #define DTLS_HPP_ -#include "openthread/types.h" - -#include -#include -#include -#include +#include #include #include @@ -48,6 +43,11 @@ #include #include +#include "common/message.hpp" +#include "common/timer.hpp" +#include "crypto/sha256.hpp" +#include "meshcop/meshcop_tlvs.hpp" + namespace ot { class ThreadNetif; diff --git a/src/core/meshcop/energy_scan_client.cpp b/src/core/meshcop/energy_scan_client.cpp index bb1099b7b..af6f9dc5e 100644 --- a/src/core/meshcop/energy_scan_client.cpp +++ b/src/core/meshcop/energy_scan_client.cpp @@ -31,26 +31,27 @@ * This file implements the Energy Scan Client. */ +#define WPP_NAME "energy_scan_client.tmh" + #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE #else #include #endif -#define WPP_NAME "energy_scan_client.tmh" +#include "energy_scan_client.hpp" -#include "openthread/platform/random.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" #if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD diff --git a/src/core/meshcop/energy_scan_client.hpp b/src/core/meshcop/energy_scan_client.hpp index 63fcd662a..46af62d5f 100644 --- a/src/core/meshcop/energy_scan_client.hpp +++ b/src/core/meshcop/energy_scan_client.hpp @@ -34,14 +34,13 @@ #ifndef ENERGY_SCAN_CLIENT_HPP_ #define ENERGY_SCAN_CLIENT_HPP_ -#include +#include -#include "openthread/commissioner.h" - -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "net/ip6_address.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/meshcop/joiner.cpp b/src/core/meshcop/joiner.cpp index fb23f6fe4..bcd35b6e4 100644 --- a/src/core/meshcop/joiner.cpp +++ b/src/core/meshcop/joiner.cpp @@ -39,21 +39,22 @@ #include #endif +#include "joiner.hpp" + #include -#include "openthread/platform/radio.h" -#include "openthread/platform/random.h" +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/crc16.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "mac/mac_frame.hpp" +#include "meshcop/meshcop.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" #if OPENTHREAD_ENABLE_JOINER diff --git a/src/core/meshcop/joiner.hpp b/src/core/meshcop/joiner.hpp index be57f61c5..752f76172 100644 --- a/src/core/meshcop/joiner.hpp +++ b/src/core/meshcop/joiner.hpp @@ -34,16 +34,16 @@ #ifndef JOINER_HPP_ #define JOINER_HPP_ -#include "openthread/joiner.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "coap/coap_server.hpp" +#include "coap/secure_coap_client.hpp" +#include "common/crc16.hpp" +#include "common/message.hpp" +#include "meshcop/dtls.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/meshcop/joiner_router.cpp b/src/core/meshcop/joiner_router.cpp index ce835fb36..30a394c58 100644 --- a/src/core/meshcop/joiner_router.cpp +++ b/src/core/meshcop/joiner_router.cpp @@ -41,17 +41,18 @@ #include #endif +#include "joiner_router.hpp" + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/mle.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap64; diff --git a/src/core/meshcop/joiner_router.hpp b/src/core/meshcop/joiner_router.hpp index 386411069..9da044be8 100644 --- a/src/core/meshcop/joiner_router.hpp +++ b/src/core/meshcop/joiner_router.hpp @@ -34,18 +34,18 @@ #ifndef JOINER_ROUTER_HPP_ #define JOINER_ROUTER_HPP_ -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_base.hpp" +#include "coap/coap_client.hpp" +#include "coap/coap_header.hpp" +#include "coap/coap_server.hpp" +#include "common/message.hpp" +#include "common/timer.hpp" +#include "mac/mac_frame.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "net/udp6.hpp" +#include "thread/key_manager.hpp" namespace ot { diff --git a/src/core/meshcop/leader.cpp b/src/core/meshcop/leader.cpp index 3e455ac9e..7ddc6fa6f 100644 --- a/src/core/meshcop/leader.cpp +++ b/src/core/meshcop/leader.cpp @@ -41,19 +41,20 @@ #include #endif +#include "leader.hpp" + #include -#include "openthread/platform/random.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/leader.hpp b/src/core/meshcop/leader.hpp index f4a8ba628..1b54909dd 100644 --- a/src/core/meshcop/leader.hpp +++ b/src/core/meshcop/leader.hpp @@ -34,12 +34,12 @@ #ifndef MESHCOP_LEADER_HPP_ #define MESHCOP_LEADER_HPP_ -#include -#include -#include -#include -#include -#include +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/meshcop.hpp b/src/core/meshcop/meshcop.hpp index 2f1952b44..999f80c54 100644 --- a/src/core/meshcop/meshcop.hpp +++ b/src/core/meshcop/meshcop.hpp @@ -35,8 +35,8 @@ #ifndef MESHCOP_HPP_ #define MESHCOP_HPP_ -#include -#include +#include "coap/coap_base.hpp" +#include "common/message.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/meshcop_tlvs.cpp b/src/core/meshcop/meshcop_tlvs.cpp index 14ebabad7..74191db4d 100644 --- a/src/core/meshcop/meshcop_tlvs.cpp +++ b/src/core/meshcop/meshcop_tlvs.cpp @@ -31,7 +31,7 @@ * This file implements MechCop TLV helper functions. */ -#include +#include "meshcop_tlvs.hpp" namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/meshcop_tlvs.hpp b/src/core/meshcop/meshcop_tlvs.hpp index ce55710cd..0de2b25a2 100644 --- a/src/core/meshcop/meshcop_tlvs.hpp +++ b/src/core/meshcop/meshcop_tlvs.hpp @@ -37,13 +37,13 @@ #include "utils/wrap_string.h" -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include +#include "common/crc16.hpp" +#include "common/encoding.hpp" +#include "common/message.hpp" +#include "common/tlvs.hpp" +#include "meshcop/timestamp.hpp" using ot::Encoding::Reverse32; using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/meshcop/panid_query_client.cpp b/src/core/meshcop/panid_query_client.cpp index 3f196ad6a..8ad9edbe8 100644 --- a/src/core/meshcop/panid_query_client.cpp +++ b/src/core/meshcop/panid_query_client.cpp @@ -31,6 +31,7 @@ * This file implements the PAN ID Query Client. */ +#define WPP_NAME "panid_query_client.tmh" #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE @@ -38,19 +39,18 @@ #include #endif -#define WPP_NAME "panid_query_client.tmh" +#include "panid_query_client.hpp" -#include "openthread/platform/random.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" #if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD diff --git a/src/core/meshcop/panid_query_client.hpp b/src/core/meshcop/panid_query_client.hpp index c4407f796..62cf16420 100644 --- a/src/core/meshcop/panid_query_client.hpp +++ b/src/core/meshcop/panid_query_client.hpp @@ -34,14 +34,13 @@ #ifndef PANID_QUERY_CLIENT_HPP_ #define PANID_QUERY_CLIENT_HPP_ -#include +#include -#include "openthread/commissioner.h" - -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "net/ip6_address.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/meshcop/timestamp.cpp b/src/core/meshcop/timestamp.cpp index e4f99eca7..e72cb49a2 100644 --- a/src/core/meshcop/timestamp.cpp +++ b/src/core/meshcop/timestamp.cpp @@ -37,11 +37,11 @@ #include #endif +#include "timestamp.hpp" + #include "utils/wrap_string.h" -#include "openthread/types.h" - -#include +#include namespace ot { namespace MeshCoP { diff --git a/src/core/meshcop/timestamp.hpp b/src/core/meshcop/timestamp.hpp index 356d3bfc6..d65a7baf5 100644 --- a/src/core/meshcop/timestamp.hpp +++ b/src/core/meshcop/timestamp.hpp @@ -35,7 +35,11 @@ #ifndef MESHCOP_TIMESTAMP_HPP_ #define MESHCOP_TIMESTAMP_HPP_ -#include +#include + +#include + +#include "common/encoding.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/net/dhcp6.hpp b/src/core/net/dhcp6.hpp index 8f4d9b77d..a32a0ccc5 100644 --- a/src/core/net/dhcp6.hpp +++ b/src/core/net/dhcp6.hpp @@ -34,8 +34,8 @@ #ifndef DHCP6_HPP_ #define DHCP6_HPP_ -#include -#include +#include "common/message.hpp" +#include "net/udp6.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/net/dhcp6_client.cpp b/src/core/net/dhcp6_client.cpp index d4948074b..d7741c214 100644 --- a/src/core/net/dhcp6_client.cpp +++ b/src/core/net/dhcp6_client.cpp @@ -39,16 +39,17 @@ #include #endif -#include "openthread/types.h" -#include "openthread/platform/random.h" +#include "dhcp6_client.hpp" -#include -#include -#include -#include -#include -#include -#include +#include +#include + +#include "common/code_utils.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "mac/mac.hpp" +#include "net/dhcp6.hpp" +#include "thread/thread_netif.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/net/dhcp6_client.hpp b/src/core/net/dhcp6_client.hpp index b94eb9faa..9e46ffb64 100644 --- a/src/core/net/dhcp6_client.hpp +++ b/src/core/net/dhcp6_client.hpp @@ -34,15 +34,15 @@ #ifndef DHCP6_CLIENT_HPP_ #define DHCP6_CLIENT_HPP_ -#include "openthread/dhcp6_client.h" +#include -#include -#include -#include -#include -#include -#include -#include +#include "common/message.hpp" +#include "common/timer.hpp" +#include "common/trickle_timer.hpp" +#include "mac/mac.hpp" +#include "mac/mac_frame.hpp" +#include "net/dhcp6.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/net/dhcp6_server.cpp b/src/core/net/dhcp6_server.cpp index 8ae7c168d..f09f44dae 100644 --- a/src/core/net/dhcp6_server.cpp +++ b/src/core/net/dhcp6_server.cpp @@ -39,14 +39,15 @@ #include #endif -#include "openthread/types.h" +#include "dhcp6_server.hpp" -#include -#include -#include -#include -#include -#include +#include + +#include "common/code_utils.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "thread/mle.hpp" +#include "thread/thread_netif.hpp" #if OPENTHREAD_ENABLE_DHCP6_SERVER diff --git a/src/core/net/dhcp6_server.hpp b/src/core/net/dhcp6_server.hpp index 0f0c0d9ba..0db557191 100644 --- a/src/core/net/dhcp6_server.hpp +++ b/src/core/net/dhcp6_server.hpp @@ -34,13 +34,13 @@ #ifndef DHCP6_SERVER_HPP_ #define DHCP6_SERVER_HPP_ -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include +#include "mac/mac_frame.hpp" +#include "mac/mac.hpp" +#include "net/dhcp6.hpp" +#include "net/udp6.hpp" +#include "thread/network_data_leader.hpp" namespace ot { diff --git a/src/core/net/dns_client.cpp b/src/core/net/dns_client.cpp index 65c5fc66e..48adccc97 100644 --- a/src/core/net/dns_client.cpp +++ b/src/core/net/dns_client.cpp @@ -32,12 +32,13 @@ #include #endif +#include "dns_client.hpp" + #include "utils/wrap_string.h" -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "net/udp6.hpp" #if OPENTHREAD_ENABLE_DNS_CLIENT diff --git a/src/core/net/dns_client.hpp b/src/core/net/dns_client.hpp index 426da4018..476a78b79 100644 --- a/src/core/net/dns_client.hpp +++ b/src/core/net/dns_client.hpp @@ -32,11 +32,11 @@ #include #include -#include -#include -#include -#include -#include +#include "common/message.hpp" +#include "common/timer.hpp" +#include "net/dns_headers.hpp" +#include "net/ip6.hpp" +#include "net/netif.hpp" /** * @file diff --git a/src/core/net/dns_headers.hpp b/src/core/net/dns_headers.hpp index 3cec8fdd8..87489240e 100644 --- a/src/core/net/dns_headers.hpp +++ b/src/core/net/dns_headers.hpp @@ -38,8 +38,8 @@ #include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/net/icmp6.cpp b/src/core/net/icmp6.cpp index adaae661a..f4014bf32 100644 --- a/src/core/net/icmp6.cpp +++ b/src/core/net/icmp6.cpp @@ -39,14 +39,15 @@ #include #endif +#include "icmp6.hpp" + #include "utils/wrap_string.h" -#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "common/message.hpp" +#include "net/ip6.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/net/icmp6.hpp b/src/core/net/icmp6.hpp index 26904d109..d7f4b3b40 100644 --- a/src/core/net/icmp6.hpp +++ b/src/core/net/icmp6.hpp @@ -35,8 +35,9 @@ #define ICMP6_HPP_ #include -#include -#include + +#include "common/encoding.hpp" +#include "net/ip6_headers.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index aa2f81578..5b66ee69b 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -39,18 +39,19 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ip6.hpp" + +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "common/message.hpp" +#include "net/icmp6.hpp" +#include "net/ip6_address.hpp" +#include "net/ip6_routes.hpp" +#include "net/netif.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/ip6.hpp b/src/core/net/ip6.hpp index 7ce48ff07..17c416a92 100644 --- a/src/core/net/ip6.hpp +++ b/src/core/net/ip6.hpp @@ -36,19 +36,19 @@ #include -#include "openthread/ip6.h" -#include "openthread/udp.h" +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" +#include "net/icmp6.hpp" +#include "net/ip6_address.hpp" +#include "net/ip6_headers.hpp" +#include "net/ip6_mpl.hpp" +#include "net/ip6_routes.hpp" +#include "net/netif.hpp" +#include "net/socket.hpp" +#include "net/udp6.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/net/ip6_address.cpp b/src/core/net/ip6_address.cpp index b0062bf0d..d48011d6b 100644 --- a/src/core/net/ip6_address.cpp +++ b/src/core/net/ip6_address.cpp @@ -37,13 +37,14 @@ #include #endif +#include "ip6_address.hpp" + #include #include "utils/wrap_string.h" -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/encoding.hpp" +#include "mac/mac_frame.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/net/ip6_address.hpp b/src/core/net/ip6_address.hpp index cc94e221d..234440d4a 100644 --- a/src/core/net/ip6_address.hpp +++ b/src/core/net/ip6_address.hpp @@ -36,7 +36,9 @@ #include "utils/wrap_stdint.h" -#include "openthread/types.h" +#include + +#include "mac/mac_frame.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/ip6_filter.cpp b/src/core/net/ip6_filter.cpp index b751bf5f7..7909fdb06 100644 --- a/src/core/net/ip6_filter.cpp +++ b/src/core/net/ip6_filter.cpp @@ -37,14 +37,15 @@ #include #endif +#include "ip6_filter.hpp" + #include -#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "net/ip6.hpp" +#include "net/tcp.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/ip6_filter.hpp b/src/core/net/ip6_filter.hpp index 5fea18d78..87a31a13f 100644 --- a/src/core/net/ip6_filter.hpp +++ b/src/core/net/ip6_filter.hpp @@ -34,7 +34,9 @@ #ifndef IP6_FILTER_HPP_ #define IP6_FILTER_HPP_ -#include "openthread/openthread.h" +#include + +#include "common/message.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/ip6_headers.hpp b/src/core/net/ip6_headers.hpp index 7e549d255..57dc41983 100644 --- a/src/core/net/ip6_headers.hpp +++ b/src/core/net/ip6_headers.hpp @@ -36,13 +36,13 @@ #include -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" +#include "net/ip6_address.hpp" +#include "net/netif.hpp" +#include "net/socket.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/net/ip6_mpl.cpp b/src/core/net/ip6_mpl.cpp index ac7f77574..a215edc65 100644 --- a/src/core/net/ip6_mpl.cpp +++ b/src/core/net/ip6_mpl.cpp @@ -37,12 +37,13 @@ #include #endif -#include "openthread/platform/random.h" +#include "ip6_mpl.hpp" -#include -#include -#include -#include +#include + +#include "common/code_utils.hpp" +#include "common/message.hpp" +#include "net/ip6.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/ip6_mpl.hpp b/src/core/net/ip6_mpl.hpp index 384d11303..035e7d301 100644 --- a/src/core/net/ip6_mpl.hpp +++ b/src/core/net/ip6_mpl.hpp @@ -34,11 +34,11 @@ * This file includes definitions for MPL. */ -#include "openthread/types.h" +#include -#include -#include -#include +#include "common/message.hpp" +#include "common/timer.hpp" +#include "net/ip6_headers.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/ip6_routes.cpp b/src/core/net/ip6_routes.cpp index 6dd14985a..973ad486b 100644 --- a/src/core/net/ip6_routes.cpp +++ b/src/core/net/ip6_routes.cpp @@ -37,11 +37,12 @@ #include #endif -#include -#include -#include -#include -#include +#include "ip6_routes.hpp" + +#include "common/code_utils.hpp" +#include "common/message.hpp" +#include "net/ip6.hpp" +#include "net/netif.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/ip6_routes.hpp b/src/core/net/ip6_routes.hpp index ae0bb34c0..bff9379cd 100644 --- a/src/core/net/ip6_routes.hpp +++ b/src/core/net/ip6_routes.hpp @@ -34,14 +34,17 @@ * This file includes definitions for manipulating IPv6 routing tables. */ -#include "openthread/types.h" +#include -#include -#include +#include "common/message.hpp" +#include "net/ip6_address.hpp" +#include "net/ip6_routes.hpp" namespace ot { namespace Ip6 { +class Ip6; + /** * @addtogroup core-ip6-ip6 * diff --git a/src/core/net/netif.cpp b/src/core/net/netif.cpp index 4dd31b5bb..a9f409d3f 100644 --- a/src/core/net/netif.cpp +++ b/src/core/net/netif.cpp @@ -36,11 +36,12 @@ #include #endif -#include -#include -#include -#include -#include +#include "netif.hpp" + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/message.hpp" +#include "net/ip6.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/netif.hpp b/src/core/net/netif.hpp index 77965774b..adf0de974 100644 --- a/src/core/net/netif.hpp +++ b/src/core/net/netif.hpp @@ -34,11 +34,11 @@ #ifndef NET_NETIF_HPP_ #define NET_NETIF_HPP_ -#include -#include -#include -#include -#include +#include "common/message.hpp" +#include "common/tasklet.hpp" +#include "mac/mac_frame.hpp" +#include "net/ip6_address.hpp" +#include "net/socket.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/socket.hpp b/src/core/net/socket.hpp index 448565d38..eaa8cac7e 100644 --- a/src/core/net/socket.hpp +++ b/src/core/net/socket.hpp @@ -34,9 +34,9 @@ #ifndef NET_SOCKET_HPP_ #define NET_SOCKET_HPP_ -#include "openthread/openthread.h" +#include -#include +#include "net/ip6_address.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/tcp.hpp b/src/core/net/tcp.hpp index 17f06ee88..a2bbd92e6 100644 --- a/src/core/net/tcp.hpp +++ b/src/core/net/tcp.hpp @@ -34,9 +34,9 @@ #ifndef TCP_HPP_ #define TCP_HPP_ -#include "openthread/openthread.h" +#include -#include +#include "net/ip6_headers.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/net/udp6.cpp b/src/core/net/udp6.cpp index 4dedb92c3..df5dd736f 100644 --- a/src/core/net/udp6.cpp +++ b/src/core/net/udp6.cpp @@ -37,12 +37,13 @@ #include #endif +#include "udp6.hpp" + #include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/encoding.hpp" +#include "net/ip6.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/net/udp6.hpp b/src/core/net/udp6.hpp index 7b60ba8f3..32b211584 100644 --- a/src/core/net/udp6.hpp +++ b/src/core/net/udp6.hpp @@ -34,9 +34,9 @@ #ifndef UDP6_HPP_ #define UDP6_HPP_ -#include "openthread/udp.h" +#include -#include +#include "net/ip6_headers.hpp" namespace ot { namespace Ip6 { diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index 587f55bf7..228108852 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -40,7 +40,7 @@ #include OPENTHREAD_PROJECT_CORE_CONFIG_FILE #endif -#include +#include "openthread-core-default-config.h" #undef OPENTHREAD_CORE_CONFIG_H_IN diff --git a/src/core/openthread-instance.h b/src/core/openthread-instance.h index 4375e3e7d..aaf928b79 100644 --- a/src/core/openthread-instance.h +++ b/src/core/openthread-instance.h @@ -35,22 +35,29 @@ #ifndef OPENTHREADINSTANCE_H_ #define OPENTHREADINSTANCE_H_ +#ifdef OPENTHREAD_CONFIG_FILE +#include OPENTHREAD_CONFIG_FILE +#else +#include +#endif + #include "utils/wrap_stdint.h" #include "utils/wrap_stdbool.h" -#include +#include +#include -#include "openthread/types.h" -#include "openthread/platform/logging.h" +#include "openthread-core-config.h" -#include -#include -#include -#include #if OPENTHREAD_ENABLE_RAW_LINK_API -#include +#include "api/link_raw.hpp" #endif +#include "coap/coap_server.hpp" +#include "crypto/mbedtls.hpp" +#include "net/ip6.hpp" +#include "thread/thread_netif.hpp" + /** * This type represents all the static / global variables used by OpenThread allocated in one place. */ diff --git a/src/core/thread/address_resolver.cpp b/src/core/thread/address_resolver.cpp index 4f684bf64..858e1054a 100644 --- a/src/core/thread/address_resolver.cpp +++ b/src/core/thread/address_resolver.cpp @@ -41,20 +41,21 @@ #include #endif -#include "openthread/platform/random.h" +#include "address_resolver.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "mac/mac_frame.hpp" +#include "thread/mesh_forwarder.hpp" +#include "thread/mle_router.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/address_resolver.hpp b/src/core/thread/address_resolver.hpp index e7623290f..170bfbb48 100644 --- a/src/core/thread/address_resolver.hpp +++ b/src/core/thread/address_resolver.hpp @@ -34,16 +34,15 @@ #ifndef ADDRESS_RESOLVER_HPP_ #define ADDRESS_RESOLVER_HPP_ -#include +#include -#include "openthread/types.h" - -#include -#include -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "mac/mac.hpp" +#include "net/icmp6.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/thread/announce_begin_server.cpp b/src/core/thread/announce_begin_server.cpp index a38a6adcb..b768129b1 100644 --- a/src/core/thread/announce_begin_server.cpp +++ b/src/core/thread/announce_begin_server.cpp @@ -39,16 +39,17 @@ #include #endif -#include "openthread/platform/radio.h" +#include "announce_begin_server.hpp" -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/thread/announce_begin_server.hpp b/src/core/thread/announce_begin_server.hpp index 6e43d5ce8..71c213aa7 100644 --- a/src/core/thread/announce_begin_server.hpp +++ b/src/core/thread/announce_begin_server.hpp @@ -34,14 +34,13 @@ #ifndef ANNOUNCE_BEGIN_SERVER_HPP_ #define ANNOUNCE_BEGIN_SERVER_HPP_ -#include +#include -#include "openthread/types.h" - -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "net/ip6_address.hpp" namespace ot { diff --git a/src/core/thread/data_poll_manager.cpp b/src/core/thread/data_poll_manager.cpp index 5223cdc30..de7d7bafa 100644 --- a/src/core/thread/data_poll_manager.cpp +++ b/src/core/thread/data_poll_manager.cpp @@ -31,25 +31,26 @@ * This file implements data poll (mac data request command) manager class. */ +#define WPP_NAME "data_poll_manager.tmh" + #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE #else #include #endif -#define WPP_NAME "data_poll_manager.tmh" +#include "data_poll_manager.hpp" -#include "openthread/platform/random.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/logging.hpp" +#include "common/message.hpp" +#include "net/ip6.hpp" +#include "net/netif.hpp" +#include "thread/mesh_forwarder.hpp" +#include "thread/mle.hpp" +#include "thread/thread_netif.hpp" namespace ot { diff --git a/src/core/thread/data_poll_manager.hpp b/src/core/thread/data_poll_manager.hpp index e5c57ed0b..b77022a66 100644 --- a/src/core/thread/data_poll_manager.hpp +++ b/src/core/thread/data_poll_manager.hpp @@ -34,10 +34,12 @@ #ifndef DATA_POLL_MANAGER_HPP_ #define DATA_POLL_MANAGER_HPP_ -#include +#include -#include "openthread/types.h" -#include +#include "openthread-core-config.h" +#include "common/code_utils.hpp" +#include "common/timer.hpp" +#include "mac/mac_frame.hpp" namespace ot { diff --git a/src/core/thread/energy_scan_server.cpp b/src/core/thread/energy_scan_server.cpp index 21149e411..50b078531 100644 --- a/src/core/thread/energy_scan_server.cpp +++ b/src/core/thread/energy_scan_server.cpp @@ -31,25 +31,26 @@ * This file implements the Energy Scan Server. */ +#define WPP_NAME "energy_scan_server.tmh" + #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE #else #include #endif -#define WPP_NAME "energy_scan_server.tmh" +#include "energy_scan_server.hpp" -#include "openthread/platform/random.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" namespace ot { diff --git a/src/core/thread/energy_scan_server.hpp b/src/core/thread/energy_scan_server.hpp index 00272666b..a1bfe94cc 100644 --- a/src/core/thread/energy_scan_server.hpp +++ b/src/core/thread/energy_scan_server.hpp @@ -34,15 +34,14 @@ #ifndef ENERGY_SCAN_SERVER_HPP_ #define ENERGY_SCAN_SERVER_HPP_ -#include +#include -#include "openthread/types.h" - -#include -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "net/ip6_address.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/thread/key_manager.cpp b/src/core/thread/key_manager.cpp index 445659461..1103f3504 100644 --- a/src/core/thread/key_manager.cpp +++ b/src/core/thread/key_manager.cpp @@ -38,12 +38,13 @@ #include #endif -#include -#include -#include -#include -#include -#include +#include "key_manager.hpp" + +#include "common/code_utils.hpp" +#include "common/timer.hpp" +#include "crypto/hmac_sha256.hpp" +#include "thread/mle_router.hpp" +#include "thread/thread_netif.hpp" namespace ot { diff --git a/src/core/thread/key_manager.hpp b/src/core/thread/key_manager.hpp index 6b6e38994..681972e19 100644 --- a/src/core/thread/key_manager.hpp +++ b/src/core/thread/key_manager.hpp @@ -36,10 +36,10 @@ #include "utils/wrap_stdint.h" -#include "openthread/types.h" +#include -#include -#include +#include "common/timer.hpp" +#include "crypto/hmac_sha256.hpp" namespace ot { diff --git a/src/core/thread/link_quality.cpp b/src/core/thread/link_quality.cpp index f13997cb5..92279dd93 100644 --- a/src/core/thread/link_quality.cpp +++ b/src/core/thread/link_quality.cpp @@ -37,13 +37,14 @@ #include #endif +#include "link_quality.hpp" + #include #include "utils/wrap_string.h" -#include "openthread/types.h" +#include -#include -#include +#include "common/code_utils.hpp" namespace ot { diff --git a/src/core/thread/link_quality.hpp b/src/core/thread/link_quality.hpp index 4507f0146..cefae1385 100644 --- a/src/core/thread/link_quality.hpp +++ b/src/core/thread/link_quality.hpp @@ -34,7 +34,9 @@ #ifndef LINK_QUALITY_HPP_ #define LINK_QUALITY_HPP_ -#include "openthread/types.h" +#include + +#include namespace ot { diff --git a/src/core/thread/lowpan.cpp b/src/core/thread/lowpan.cpp index 41232b523..d66840679 100644 --- a/src/core/thread/lowpan.cpp +++ b/src/core/thread/lowpan.cpp @@ -37,14 +37,15 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include +#include "lowpan.hpp" + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "net/ip6.hpp" +#include "net/udp6.hpp" +#include "thread/network_data_leader.hpp" +#include "thread/thread_netif.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/lowpan.hpp b/src/core/thread/lowpan.hpp index 736800b0b..009c8ca42 100644 --- a/src/core/thread/lowpan.hpp +++ b/src/core/thread/lowpan.hpp @@ -34,10 +34,10 @@ #ifndef LOWPAN_HPP_ #define LOWPAN_HPP_ -#include -#include -#include -#include +#include "common/message.hpp" +#include "mac/mac_frame.hpp" +#include "net/ip6.hpp" +#include "net/ip6_address.hpp" namespace ot { diff --git a/src/core/thread/mesh_forwarder.cpp b/src/core/thread/mesh_forwarder.cpp index 0f5f4ac40..67a14cee0 100644 --- a/src/core/thread/mesh_forwarder.cpp +++ b/src/core/thread/mesh_forwarder.cpp @@ -39,22 +39,23 @@ #include #endif -#include "openthread/platform/random.h" +#include "mesh_forwarder.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "common/message.hpp" +#include "net/ip6.hpp" +#include "net/ip6_filter.hpp" +#include "net/netif.hpp" +#include "net/tcp.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" +#include "thread/mle_router.hpp" +#include "thread/thread_netif.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/mesh_forwarder.hpp b/src/core/thread/mesh_forwarder.hpp index 19904818a..ac28f13d5 100644 --- a/src/core/thread/mesh_forwarder.hpp +++ b/src/core/thread/mesh_forwarder.hpp @@ -34,19 +34,18 @@ #ifndef MESH_FORWARDER_HPP_ #define MESH_FORWARDER_HPP_ -#include +#include -#include "openthread/types.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "common/tasklet.hpp" +#include "mac/mac.hpp" +#include "net/ip6.hpp" +#include "thread/address_resolver.hpp" +#include "thread/data_poll_manager.hpp" +#include "thread/lowpan.hpp" +#include "thread/network_data_leader.hpp" +#include "thread/src_match_controller.hpp" +#include "thread/topology.hpp" namespace ot { diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 0bf31f1e8..d53b5390f 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -31,33 +31,34 @@ * This file implements MLE functionality required for the Thread Child, Router and Leader roles. */ +#define WPP_NAME "mle.tmh" + #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE #else #include #endif -#define WPP_NAME "mle.tmh" +#include "mle.hpp" -#include "openthread/platform/radio.h" -#include "openthread/platform/random.h" -#include "openthread/platform/settings.h" +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "common/settings.hpp" +#include "crypto/aes_ccm.hpp" +#include "mac/mac_frame.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "net/netif.hpp" +#include "net/udp6.hpp" +#include "thread/address_resolver.hpp" +#include "thread/key_manager.hpp" +#include "thread/mle_router.hpp" +#include "thread/thread_netif.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp index ad845b080..703e5b58d 100644 --- a/src/core/thread/mle.hpp +++ b/src/core/thread/mle.hpp @@ -34,16 +34,16 @@ #ifndef MLE_HPP_ #define MLE_HPP_ -#include "openthread/openthread.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/encoding.hpp" +#include "common/timer.hpp" +#include "mac/mac.hpp" +#include "meshcop/joiner_router.hpp" +#include "net/udp6.hpp" +#include "thread/mle_constants.hpp" +#include "thread/mle_tlvs.hpp" +#include "thread/topology.hpp" namespace ot { diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 84331f042..306867e0e 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -40,20 +40,21 @@ #include #endif -#include "openthread/platform/random.h" -#include "openthread/platform/settings.h" +#include "mle_router.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "common/settings.hpp" +#include "mac/mac_frame.hpp" +#include "net/icmp6.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/mle_router_ftd.hpp b/src/core/thread/mle_router_ftd.hpp index ac4a455a9..091081a52 100644 --- a/src/core/thread/mle_router_ftd.hpp +++ b/src/core/thread/mle_router_ftd.hpp @@ -36,19 +36,19 @@ #include "utils/wrap_string.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_client.hpp" +#include "coap/coap_header.hpp" +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "common/trickle_timer.hpp" +#include "mac/mac_frame.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "net/icmp6.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" +#include "thread/mle_tlvs.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/topology.hpp" namespace ot { namespace Mle { diff --git a/src/core/thread/mle_router_mtd.hpp b/src/core/thread/mle_router_mtd.hpp index 6e67681f1..d313a49c8 100644 --- a/src/core/thread/mle_router_mtd.hpp +++ b/src/core/thread/mle_router_mtd.hpp @@ -36,9 +36,9 @@ #include "utils/wrap_string.h" -#include -#include -#include +#include "thread/mle.hpp" +#include "thread/mle_tlvs.hpp" +#include "thread/thread_tlvs.hpp" namespace ot { namespace Mle { diff --git a/src/core/thread/mle_tlvs.hpp b/src/core/thread/mle_tlvs.hpp index 7d9757790..88a336784 100644 --- a/src/core/thread/mle_tlvs.hpp +++ b/src/core/thread/mle_tlvs.hpp @@ -36,14 +36,14 @@ #include "utils/wrap_string.h" -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" +#include "common/tlvs.hpp" +#include "meshcop/timestamp.hpp" +#include "net/ip6_address.hpp" +#include "thread/mle_constants.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/thread/network_data.cpp b/src/core/thread/network_data.cpp index 4c61e80da..7cac26c60 100644 --- a/src/core/thread/network_data.cpp +++ b/src/core/thread/network_data.cpp @@ -39,17 +39,18 @@ #include #endif -#include "openthread/platform/random.h" +#include "network_data.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "mac/mac_frame.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" namespace ot { namespace NetworkData { diff --git a/src/core/thread/network_data.hpp b/src/core/thread/network_data.hpp index 6983fa6d2..6777e3819 100644 --- a/src/core/thread/network_data.hpp +++ b/src/core/thread/network_data.hpp @@ -34,13 +34,13 @@ #ifndef NETWORK_DATA_HPP_ #define NETWORK_DATA_HPP_ -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include +#include "coap/coap_client.hpp" +#include "net/udp6.hpp" +#include "thread/lowpan.hpp" +#include "thread/mle_router.hpp" +#include "thread/network_data_tlvs.hpp" namespace ot { diff --git a/src/core/thread/network_data_leader.cpp b/src/core/thread/network_data_leader.cpp index ad0d43bcf..b62ae3d24 100644 --- a/src/core/thread/network_data_leader.cpp +++ b/src/core/thread/network_data_leader.cpp @@ -39,22 +39,23 @@ #include #endif -#include "openthread/platform/random.h" +#include "network_data_leader.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "common/message.hpp" +#include "common/timer.hpp" +#include "mac/mac_frame.hpp" +#include "thread/mle_router.hpp" +#include "thread/lowpan.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/network_data_leader.hpp b/src/core/thread/network_data_leader.hpp index cb8187e48..e09f18d78 100644 --- a/src/core/thread/network_data_leader.hpp +++ b/src/core/thread/network_data_leader.hpp @@ -36,11 +36,11 @@ #include "utils/wrap_stdint.h" -#include -#include -#include -#include -#include +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "net/ip6_address.hpp" +#include "thread/mle_router.hpp" +#include "thread/network_data.hpp" namespace ot { diff --git a/src/core/thread/network_data_leader_ftd.cpp b/src/core/thread/network_data_leader_ftd.cpp index 4e07d71f4..d7f8d9059 100644 --- a/src/core/thread/network_data_leader_ftd.cpp +++ b/src/core/thread/network_data_leader_ftd.cpp @@ -33,31 +33,32 @@ #if OPENTHREAD_FTD +#define WPP_NAME "network_data_leader_ftd.tmh" + #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE #else #include #endif -#define WPP_NAME "network_data_leader_ftd.tmh" +#include "network_data_leader.hpp" -#include "openthread/platform/random.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/encoding.hpp" +#include "common/logging.hpp" +#include "common/message.hpp" +#include "common/timer.hpp" +#include "mac/mac_frame.hpp" +#include "meshcop/meshcop.hpp" +#include "thread/lowpan.hpp" +#include "thread/mle_router.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/network_data_leader_ftd.hpp b/src/core/thread/network_data_leader_ftd.hpp index 96b5bb974..ff1de7282 100644 --- a/src/core/thread/network_data_leader_ftd.hpp +++ b/src/core/thread/network_data_leader_ftd.hpp @@ -36,11 +36,11 @@ #include "utils/wrap_stdint.h" -#include -#include -#include -#include -#include +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "net/ip6_address.hpp" +#include "thread/mle_router.hpp" +#include "thread/network_data.hpp" namespace ot { diff --git a/src/core/thread/network_data_local.cpp b/src/core/thread/network_data_local.cpp index c1c1eda5a..54adb12fe 100644 --- a/src/core/thread/network_data_local.cpp +++ b/src/core/thread/network_data_local.cpp @@ -39,12 +39,13 @@ #include #endif -#include -#include -#include -#include -#include -#include +#include "network_data_local.hpp" + +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "common/code_utils.hpp" +#include "mac/mac_frame.hpp" +#include "thread/thread_netif.hpp" namespace ot { namespace NetworkData { diff --git a/src/core/thread/network_data_local_ftd.hpp b/src/core/thread/network_data_local_ftd.hpp index 2be23413c..80ba18fb1 100644 --- a/src/core/thread/network_data_local_ftd.hpp +++ b/src/core/thread/network_data_local_ftd.hpp @@ -34,7 +34,7 @@ #ifndef NETWORK_DATA_LOCAL_HPP_ #define NETWORK_DATA_LOCAL_HPP_ -#include +#include "thread/network_data.hpp" namespace ot { diff --git a/src/core/thread/network_data_local_mtd.hpp b/src/core/thread/network_data_local_mtd.hpp index 3d8f50cd9..b302f378c 100644 --- a/src/core/thread/network_data_local_mtd.hpp +++ b/src/core/thread/network_data_local_mtd.hpp @@ -34,7 +34,7 @@ #ifndef NETWORK_DATA_LOCAL_HPP_ #define NETWORK_DATA_LOCAL_HPP_ -#include +#include "thread/network_data.hpp" namespace ot { diff --git a/src/core/thread/network_data_tlvs.hpp b/src/core/thread/network_data_tlvs.hpp index 219131786..8639e0577 100644 --- a/src/core/thread/network_data_tlvs.hpp +++ b/src/core/thread/network_data_tlvs.hpp @@ -36,8 +36,8 @@ #include "utils/wrap_string.h" -#include -#include +#include "common/encoding.hpp" +#include "net/ip6_address.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/network_diagnostic.cpp b/src/core/thread/network_diagnostic.cpp index 707c56259..867bc75ab 100644 --- a/src/core/thread/network_diagnostic.cpp +++ b/src/core/thread/network_diagnostic.cpp @@ -39,22 +39,23 @@ #include #endif -#include "openthread/platform/random.h" +#include "network_diagnostic.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "common/encoding.hpp" +#include "mac/mac_frame.hpp" +#include "net/netif.hpp" +#include "thread/mesh_forwarder.hpp" +#include "thread/mle_router.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" +#include "thread/network_diagnostic_tlvs.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/network_diagnostic.hpp b/src/core/thread/network_diagnostic.hpp index 9a99a697e..b87a54318 100644 --- a/src/core/thread/network_diagnostic.hpp +++ b/src/core/thread/network_diagnostic.hpp @@ -34,13 +34,12 @@ #ifndef NETWORK_DIAGNOSTIC_HPP_ #define NETWORK_DIAGNOSTIC_HPP_ -#include +#include -#include "openthread/types.h" - -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/thread/network_diagnostic_tlvs.hpp b/src/core/thread/network_diagnostic_tlvs.hpp index 4e5ac29ac..21d9b4d95 100644 --- a/src/core/thread/network_diagnostic_tlvs.hpp +++ b/src/core/thread/network_diagnostic_tlvs.hpp @@ -36,14 +36,14 @@ #include "utils/wrap_string.h" -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" +#include "common/tlvs.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "net/ip6_address.hpp" +#include "thread/mle_constants.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/thread/panid_query_server.cpp b/src/core/thread/panid_query_server.cpp index 15abc4bf9..871be5058 100644 --- a/src/core/thread/panid_query_server.cpp +++ b/src/core/thread/panid_query_server.cpp @@ -31,25 +31,26 @@ * This file implements the PAN ID Query Server. */ +#define WPP_NAME "panid_query_server.tmh" + #ifdef OPENTHREAD_CONFIG_FILE #include OPENTHREAD_CONFIG_FILE #else #include #endif -#define WPP_NAME "panid_query_server.tmh" +#include "panid_query_server.hpp" -#include "openthread/platform/random.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "coap/coap_header.hpp" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "meshcop/meshcop.hpp" +#include "meshcop/meshcop_tlvs.hpp" +#include "thread/thread_netif.hpp" +#include "thread/thread_uris.hpp" namespace ot { diff --git a/src/core/thread/panid_query_server.hpp b/src/core/thread/panid_query_server.hpp index 20d62d43a..0ea11a1ac 100644 --- a/src/core/thread/panid_query_server.hpp +++ b/src/core/thread/panid_query_server.hpp @@ -34,15 +34,14 @@ #ifndef PANID_QUERY_SERVER_HPP_ #define PANID_QUERY_SERVER_HPP_ -#include +#include -#include "openthread/types.h" - -#include -#include -#include -#include -#include +#include "openthread-core-config.h" +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "common/timer.hpp" +#include "net/ip6_address.hpp" +#include "net/udp6.hpp" namespace ot { diff --git a/src/core/thread/src_match_controller.cpp b/src/core/thread/src_match_controller.cpp index 97de32511..0f19ee5c8 100644 --- a/src/core/thread/src_match_controller.cpp +++ b/src/core/thread/src_match_controller.cpp @@ -39,12 +39,13 @@ #include #endif -#include -#include -#include -#include -#include -#include +#include "src_match_controller.hpp" + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" +#include "thread/mesh_forwarder.hpp" +#include "thread/thread_netif.hpp" namespace ot { diff --git a/src/core/thread/src_match_controller.hpp b/src/core/thread/src_match_controller.hpp index ed55cd05a..7273645c6 100644 --- a/src/core/thread/src_match_controller.hpp +++ b/src/core/thread/src_match_controller.hpp @@ -34,10 +34,10 @@ #ifndef SOURCE_MATCH_CONTROLLER_HPP_ #define SOURCE_MATCH_CONTROLLER_HPP_ -#include +#include -#include "openthread/types.h" -#include +#include "openthread-core-config.h" +#include "thread/topology.hpp" namespace ot { diff --git a/src/core/thread/thread_netif.cpp b/src/core/thread/thread_netif.cpp index abb6a0217..081384f1e 100644 --- a/src/core/thread/thread_netif.cpp +++ b/src/core/thread/thread_netif.cpp @@ -38,17 +38,18 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "thread_netif.hpp" + +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/encoding.hpp" +#include "common/message.hpp" +#include "net/ip6.hpp" +#include "net/netif.hpp" +#include "net/udp6.hpp" +#include "thread/mle.hpp" +#include "thread/thread_tlvs.hpp" +#include "thread/thread_uris.hpp" using ot::Encoding::BigEndian::HostSwap16; diff --git a/src/core/thread/thread_netif.hpp b/src/core/thread/thread_netif.hpp index 0a2bba6a1..44f2ed0b0 100644 --- a/src/core/thread/thread_netif.hpp +++ b/src/core/thread/thread_netif.hpp @@ -40,54 +40,56 @@ #include #endif -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if OPENTHREAD_ENABLE_JAM_DETECTION -#include -#endif // OPENTHREAD_ENABLE_JAM_DETECTION +#include "coap/coap_client.hpp" +#include "coap/coap_server.hpp" +#include "coap/secure_coap_client.hpp" +#include "coap/secure_coap_server.hpp" +#include "mac/mac.hpp" #if OPENTHREAD_ENABLE_BORDER_AGENT_PROXY && OPENTHREAD_FTD -#include +#include "meshcop/border_agent_proxy.hpp" #endif // OPENTHREAD_ENABLE_BORDER_AGENT_PROXY && OPENTHREAD_FTD #if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD -#include +#include "meshcop/commissioner.hpp" #endif // OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD +#include "meshcop/dataset_manager.hpp" + #if OPENTHREAD_ENABLE_DTLS -#include +#include "meshcop/dtls.hpp" #endif // OPENTHREAD_ENABLE_DTLS #if OPENTHREAD_ENABLE_JOINER -#include +#include "meshcop/joiner.hpp" #endif // OPENTHREAD_ENABLE_JOINER +#include "meshcop/joiner_router.hpp" +#include "meshcop/leader.hpp" +#include "net/dhcp6.hpp" +#include "net/dhcp6_client.hpp" +#include "net/dhcp6_server.hpp" +#include "net/dns_client.hpp" +#include "net/ip6_filter.hpp" +#include "net/netif.hpp" +#include "thread/address_resolver.hpp" +#include "thread/announce_begin_server.hpp" +#include "thread/energy_scan_server.hpp" +#include "thread/network_diagnostic.hpp" +#include "thread/key_manager.hpp" +#include "thread/mesh_forwarder.hpp" +#include "thread/mle.hpp" +#include "thread/mle_router.hpp" +#include "thread/network_data_local.hpp" +#include "thread/panid_query_server.hpp" +#include "utils/child_supervision.hpp" + +#if OPENTHREAD_ENABLE_JAM_DETECTION +#include "utils/jam_detector.hpp" +#endif // OPENTHREAD_ENABLE_JAM_DETECTION + namespace ot { /** diff --git a/src/core/thread/thread_tlvs.hpp b/src/core/thread/thread_tlvs.hpp index 5e49a4ee5..bbbc2723f 100644 --- a/src/core/thread/thread_tlvs.hpp +++ b/src/core/thread/thread_tlvs.hpp @@ -34,13 +34,13 @@ #ifndef THREAD_TLVS_HPP_ #define THREAD_TLVS_HPP_ -#include "openthread/types.h" +#include -#include -#include -#include -#include -#include +#include "common/encoding.hpp" +#include "common/message.hpp" +#include "common/tlvs.hpp" +#include "net/ip6_address.hpp" +#include "thread/mle.hpp" using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; diff --git a/src/core/thread/topology.cpp b/src/core/thread/topology.cpp index 4c6d45f2c..adefd05b4 100644 --- a/src/core/thread/topology.cpp +++ b/src/core/thread/topology.cpp @@ -39,10 +39,11 @@ #include #endif -#include -#include -#include -#include +#include "topology.hpp" + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/logging.hpp" namespace ot { diff --git a/src/core/thread/topology.hpp b/src/core/thread/topology.hpp index 4cb9b8890..a9276b541 100644 --- a/src/core/thread/topology.hpp +++ b/src/core/thread/topology.hpp @@ -34,13 +34,14 @@ #ifndef TOPOLOGY_HPP_ #define TOPOLOGY_HPP_ -#include #include -#include -#include -#include -#include -#include + +#include "openthread-core-config.h" +#include "common/message.hpp" +#include "mac/mac_frame.hpp" +#include "net/ip6.hpp" +#include "thread/link_quality.hpp" +#include "thread/mle_tlvs.hpp" namespace ot { diff --git a/src/core/utils/jam_detector.cpp b/src/core/utils/jam_detector.cpp index ae83aab84..303a30906 100644 --- a/src/core/utils/jam_detector.cpp +++ b/src/core/utils/jam_detector.cpp @@ -37,12 +37,13 @@ #include #endif -#include "openthread/openthread.h" -#include "openthread/platform/random.h" +#include "jam_detector.hpp" -#include -#include -#include +#include +#include + +#include "common/code_utils.hpp" +#include "thread/thread_netif.hpp" #if OPENTHREAD_ENABLE_JAM_DETECTION diff --git a/src/core/utils/jam_detector.hpp b/src/core/utils/jam_detector.hpp index a306bb35f..eb73733b3 100644 --- a/src/core/utils/jam_detector.hpp +++ b/src/core/utils/jam_detector.hpp @@ -41,7 +41,8 @@ #endif #include "utils/wrap_stdint.h" -#include + +#include "common/timer.hpp" namespace ot { diff --git a/src/core/utils/slaac_address.cpp b/src/core/utils/slaac_address.cpp index 682062139..b2308d693 100644 --- a/src/core/utils/slaac_address.cpp +++ b/src/core/utils/slaac_address.cpp @@ -37,17 +37,18 @@ #include #endif -#include "openthread/openthread.h" - -#include -#include -#include -#include -#include -#include +#include "slaac_address.hpp" #include "utils/wrap_string.h" +#include + +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "crypto/sha256.hpp" +#include "mac/mac.hpp" +#include "net/ip6_address.hpp" + namespace ot { namespace Utils { diff --git a/src/core/utils/slaac_address.hpp b/src/core/utils/slaac_address.hpp index d835256e8..3a362f675 100644 --- a/src/core/utils/slaac_address.hpp +++ b/src/core/utils/slaac_address.hpp @@ -34,8 +34,8 @@ #ifndef SLAAC_ADDRESS_HPP_ #define SLAAC_ADDRESS_HPP_ -#include "openthread/types.h" -#include "openthread/platform/random.h" +#include +#include namespace ot { namespace Utils { diff --git a/src/diag/diag_process.cpp b/src/diag/diag_process.cpp index eb3a815d6..2b211f180 100644 --- a/src/diag/diag_process.cpp +++ b/src/diag/diag_process.cpp @@ -40,9 +40,9 @@ #include #include #include "utils/wrap_string.h" -#include #include "diag_process.hpp" +#include "common/code_utils.hpp" namespace ot { namespace Diagnostics { diff --git a/src/diag/diag_process.hpp b/src/diag/diag_process.hpp index 3f5d5a3cd..381e5a85c 100644 --- a/src/diag/diag_process.hpp +++ b/src/diag/diag_process.hpp @@ -36,10 +36,10 @@ #include -#include "openthread/types.h" -#include "openthread/platform/radio.h" -#include "openthread/platform/alarm.h" -#include "openthread/platform/diag.h" +#include +#include +#include +#include namespace ot { diff --git a/src/diag/openthread-diag.cpp b/src/diag/openthread-diag.cpp index 3c9dd5ba2..3ae9f27cb 100644 --- a/src/diag/openthread-diag.cpp +++ b/src/diag/openthread-diag.cpp @@ -35,8 +35,9 @@ #include #include "utils/wrap_string.h" -#include "openthread/diag.h" -#include +#include + +#include "diag_process.hpp" using namespace ot::Diagnostics; diff --git a/src/ncp/hdlc.cpp b/src/ncp/hdlc.cpp index bfb81c117..ea92730ca 100644 --- a/src/ncp/hdlc.cpp +++ b/src/ncp/hdlc.cpp @@ -36,9 +36,11 @@ #include #endif +#include "hdlc.hpp" + #include -#include -#include + +#include "common/code_utils.hpp" #if OPENTHREAD_ENABLE_NCP_UART diff --git a/src/ncp/hdlc.hpp b/src/ncp/hdlc.hpp index dc75e31c1..371bec66a 100644 --- a/src/ncp/hdlc.hpp +++ b/src/ncp/hdlc.hpp @@ -33,7 +33,7 @@ #ifndef HDLC_HPP_ #define HDLC_HPP_ -#include "openthread/types.h" +#include namespace ot { diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 406d73896..40a0b9082 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -36,38 +36,40 @@ #include #endif +#include "ncp_base.hpp" + +#include #include -#include "openthread/openthread.h" -#include "openthread/ncp.h" -#include "openthread/diag.h" -#include "openthread/icmp6.h" - #if OPENTHREAD_ENABLE_BORDER_AGENT_PROXY && OPENTHREAD_FTD -#include "openthread/border_agent_proxy.h" -#endif - -#if OPENTHREAD_FTD -#include "openthread/thread_ftd.h" -#endif - -#if OPENTHREAD_ENABLE_JAM_DETECTION -#include "openthread/jam_detection.h" +#include #endif #if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD -#include "meshcop/commissioner.hpp" +#include #endif -#include "openthread/platform/radio.h" -#include "openthread/platform/misc.h" +#include +#include -#include -#include -#include -#include -#include -#include +#if OPENTHREAD_ENABLE_JAM_DETECTION +#include +#endif + +#include +#include + +#if OPENTHREAD_FTD +#include +#endif + +#include +#include + +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "net/ip6.hpp" namespace ot { diff --git a/src/ncp/ncp_base.hpp b/src/ncp/ncp_base.hpp index 838816eb3..cf142b8e6 100644 --- a/src/ncp/ncp_base.hpp +++ b/src/ncp/ncp_base.hpp @@ -39,15 +39,15 @@ #include #endif -#include "openthread/types.h" -#include "openthread/message.h" -#include "openthread/ip6.h" -#include "openthread/ncp.h" - -#include -#include +#include +#include +#include +#include +#include "openthread-core-config.h" #include "spinel.h" +#include "common/tasklet.hpp" +#include "ncp/ncp_buffer.hpp" namespace ot { diff --git a/src/ncp/ncp_buffer.cpp b/src/ncp/ncp_buffer.cpp index 715812953..b17376b57 100644 --- a/src/ncp/ncp_buffer.cpp +++ b/src/ncp/ncp_buffer.cpp @@ -36,9 +36,11 @@ #include #endif +#include "ncp_buffer.hpp" + #include "utils/wrap_string.h" -#include -#include + +#include "common/code_utils.hpp" namespace ot { diff --git a/src/ncp/ncp_buffer.hpp b/src/ncp/ncp_buffer.hpp index 800e6ac8c..340456380 100644 --- a/src/ncp/ncp_buffer.hpp +++ b/src/ncp/ncp_buffer.hpp @@ -33,8 +33,8 @@ #ifndef NCP_FRAME_BUFFER_HPP_ #define NCP_FRAME_BUFFER_HPP_ -#include "openthread/types.h" -#include "openthread/message.h" +#include +#include namespace ot { diff --git a/src/ncp/ncp_spi.cpp b/src/ncp/ncp_spi.cpp index 8cd3389d6..d331f2e4a 100644 --- a/src/ncp/ncp_spi.cpp +++ b/src/ncp/ncp_spi.cpp @@ -36,16 +36,17 @@ #include #endif -#include "openthread/ncp.h" -#include "openthread/platform/spi-slave.h" +#include "ncp_spi.hpp" -#include -#include -#include -#include -#include -#include -#include +#include +#include + +#include "openthread-core-config.h" +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/debug.hpp" +#include "common/new.hpp" +#include "net/ip6.hpp" #define SPI_RESET_FLAG 0x80 #define SPI_CRC_FLAG 0x40 diff --git a/src/ncp/ncp_spi.hpp b/src/ncp/ncp_spi.hpp index 43bc6e38c..d78b0c5a9 100644 --- a/src/ncp/ncp_spi.hpp +++ b/src/ncp/ncp_spi.hpp @@ -39,7 +39,7 @@ #include #endif -#include +#include "ncp/ncp_base.hpp" namespace ot { diff --git a/src/ncp/ncp_uart.cpp b/src/ncp/ncp_uart.cpp index d419af0c7..7ddfdd91a 100644 --- a/src/ncp/ncp_uart.cpp +++ b/src/ncp/ncp_uart.cpp @@ -36,18 +36,20 @@ #include #endif -#include "openthread/ncp.h" -#include "openthread/platform/logging.h" -#include "openthread/platform/uart.h" +#include "ncp_uart.hpp" #include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include + +#include "openthread-core-config.h" +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/new.hpp" +#include "common/debug.hpp" +#include "net/ip6.hpp" #if OPENTHREAD_ENABLE_NCP_UART diff --git a/src/ncp/ncp_uart.hpp b/src/ncp/ncp_uart.hpp index 848222260..cb0e12f56 100644 --- a/src/ncp/ncp_uart.hpp +++ b/src/ncp/ncp_uart.hpp @@ -39,8 +39,8 @@ #include #endif -#include -#include +#include "ncp/hdlc.hpp" +#include "ncp/ncp_base.hpp" namespace ot { diff --git a/tests/unit/test_aes.cpp b/tests/unit/test_aes.cpp index 7be9b5b17..8bb8b723b 100644 --- a/tests/unit/test_aes.cpp +++ b/tests/unit/test_aes.cpp @@ -26,13 +26,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" -#include "openthread/openthread.h" -#include -#include -#include #include "utils/wrap_string.h" +#include + +#include "common/debug.hpp" +#include "crypto/aes_ccm.hpp" +#include "crypto/mbedtls.hpp" + +#include "test_util.h" + #ifndef OPENTHREAD_MULTIPLE_INSTANCE static ot::Crypto::MbedTls mbedtls; #endif diff --git a/tests/unit/test_diag.cpp b/tests/unit/test_diag.cpp index 01b1f1e21..b06f5821d 100644 --- a/tests/unit/test_diag.cpp +++ b/tests/unit/test_diag.cpp @@ -26,12 +26,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" #include "utils/wrap_string.h" -#include "openthread/diag.h" -#include "openthread/platform/platform.h" -#include "openthread/platform/radio.h" +#include +#include +#include + +#include "test_util.h" extern "C" void otTaskletsSignalPending(otInstance *) { diff --git a/tests/unit/test_hmac_sha256.cpp b/tests/unit/test_hmac_sha256.cpp index c7bba51f1..dd2f41c30 100644 --- a/tests/unit/test_hmac_sha256.cpp +++ b/tests/unit/test_hmac_sha256.cpp @@ -26,13 +26,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" -#include "openthread/openthread.h" -#include #include "utils/wrap_string.h" -#include -#include +#include + +#include "common/debug.hpp" +#include "crypto/hmac_sha256.hpp" +#include "crypto/mbedtls.hpp" + +#include "test_util.h" #ifndef OPENTHREAD_MULTIPLE_INSTANCE static ot::Crypto::MbedTls mMbedTls; diff --git a/tests/unit/test_link_quality.cpp b/tests/unit/test_link_quality.cpp index e47b6768d..7e94404ba 100644 --- a/tests/unit/test_link_quality.cpp +++ b/tests/unit/test_link_quality.cpp @@ -26,12 +26,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" -#include "openthread/openthread.h" -#include - #include "utils/wrap_string.h" +#include + +#include "thread/link_quality.hpp" + +#include "test_util.h" + namespace ot { enum diff --git a/tests/unit/test_lowpan.cpp b/tests/unit/test_lowpan.cpp index c63067f72..347f72260 100644 --- a/tests/unit/test_lowpan.cpp +++ b/tests/unit/test_lowpan.cpp @@ -26,8 +26,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.hpp" #include "test_lowpan.hpp" +#include "test_util.hpp" using namespace ot; using ot::Encoding::BigEndian::HostSwap16; diff --git a/tests/unit/test_lowpan.hpp b/tests/unit/test_lowpan.hpp index 524cd1e92..5ac031073 100644 --- a/tests/unit/test_lowpan.hpp +++ b/tests/unit/test_lowpan.hpp @@ -31,12 +31,12 @@ #include "utils/wrap_stdint.h" -#include "openthread/openthread.h" +#include -#include -#include -#include -#include +#include "mac/mac.hpp" +#include "net/ip6_headers.hpp" +#include "thread/lowpan.hpp" +#include "thread/thread_netif.hpp" namespace ot { diff --git a/tests/unit/test_mac_frame.cpp b/tests/unit/test_mac_frame.cpp index ef15a2b3d..caec0edfa 100644 --- a/tests/unit/test_mac_frame.cpp +++ b/tests/unit/test_mac_frame.cpp @@ -26,12 +26,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" -#include "openthread/openthread.h" -#include -#include #include "utils/wrap_string.h" +#include + +#include "common/debug.hpp" +#include "mac/mac_frame.hpp" + +#include "test_util.h" + namespace ot { void TestMacHeader(void) diff --git a/tests/unit/test_message.cpp b/tests/unit/test_message.cpp index 4cdbd2ebd..4a26d4342 100644 --- a/tests/unit/test_message.cpp +++ b/tests/unit/test_message.cpp @@ -26,13 +26,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" -#include "openthread/openthread.h" -#include -#include -#include #include "utils/wrap_string.h" +#include + +#include "openthread-instance.h" +#include "common/debug.hpp" +#include "common/message.hpp" + +#include "test_util.h" + void TestMessage(void) { otInstance instance; diff --git a/tests/unit/test_message_queue.cpp b/tests/unit/test_message_queue.cpp index 7a8abd49b..ddbb1bd52 100644 --- a/tests/unit/test_message_queue.cpp +++ b/tests/unit/test_message_queue.cpp @@ -26,16 +26,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" - -#include "openthread/openthread.h" - -#include -#include -#include - -#include "utils/wrap_string.h" #include +#include "utils/wrap_string.h" + +#include + +#include "openthread-instance.h" +#include "common/debug.hpp" +#include "common/message.hpp" + +#include "test_util.h" #define kNumTestMessages 5 diff --git a/tests/unit/test_ncp_buffer.cpp b/tests/unit/test_ncp_buffer.cpp index 2add30037..a4c57d556 100644 --- a/tests/unit/test_ncp_buffer.cpp +++ b/tests/unit/test_ncp_buffer.cpp @@ -27,12 +27,15 @@ */ #include + +#include + +#include "openthread-instance.h" +#include "common/code_utils.hpp" +#include "common/message.hpp" +#include "ncp/ncp_buffer.hpp" + #include "test_util.h" -#include "openthread/openthread.h" -#include -#include -#include -#include namespace ot { diff --git a/tests/unit/test_platform.h b/tests/unit/test_platform.h index 754aa2236..1b69d3f82 100644 --- a/tests/unit/test_platform.h +++ b/tests/unit/test_platform.h @@ -37,14 +37,14 @@ #include -#include "openthread/openthread.h" -#include "openthread/platform/alarm.h" -#include "openthread/platform/logging.h" -#include "openthread/platform/misc.h" -#include "openthread/platform/radio.h" -#include "openthread/platform/random.h" +#include +#include +#include +#include +#include +#include -#include +#include "common/code_utils.hpp" #include "test_util.h" diff --git a/tests/unit/test_priority_queue.cpp b/tests/unit/test_priority_queue.cpp index bda0aabcc..bb7a739fd 100644 --- a/tests/unit/test_priority_queue.cpp +++ b/tests/unit/test_priority_queue.cpp @@ -26,13 +26,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "test_util.h" -#include "openthread/openthread.h" -#include -#include -#include -#include "utils/wrap_string.h" #include +#include "utils/wrap_string.h" + +#include +#include + +#include "common/debug.hpp" +#include "common/message.hpp" + +#include "test_util.h" #define kNumTestMessages 3 diff --git a/tests/unit/test_timer.cpp b/tests/unit/test_timer.cpp index 4aee8ec46..b917f5e02 100644 --- a/tests/unit/test_timer.cpp +++ b/tests/unit/test_timer.cpp @@ -27,9 +27,10 @@ */ #include "test_platform.h" -#include -#include -#include + +#include "openthread-instance.h" +#include "common/debug.hpp" +#include "common/timer.hpp" enum { diff --git a/tests/unit/test_toolchain.cpp b/tests/unit/test_toolchain.cpp index 6fc05e1a2..937b45f53 100644 --- a/tests/unit/test_toolchain.cpp +++ b/tests/unit/test_toolchain.cpp @@ -29,9 +29,9 @@ #include #include "utils/wrap_stdint.h" -#include "openthread/platform/toolchain.h" +#include -#include +#include "thread/topology.hpp" #include "test_util.h" extern "C" { diff --git a/tests/unit/test_toolchain_c.c b/tests/unit/test_toolchain_c.c index dc1ae4076..fa465a22e 100644 --- a/tests/unit/test_toolchain_c.c +++ b/tests/unit/test_toolchain_c.c @@ -26,12 +26,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include +#include #include -#include "openthread/platform/toolchain.h" +#include #include "test_util.h" diff --git a/tests/unit/test_util.cpp b/tests/unit/test_util.cpp index 3956b0738..6f9d427ef 100644 --- a/tests/unit/test_util.cpp +++ b/tests/unit/test_util.cpp @@ -28,10 +28,10 @@ #include "test_util.h" -#include -#include -#include #include +#include +#include +#include void otTestHexToVector(std::string &aHex, std::vector &aOutBytes) { diff --git a/tests/unit/test_util.h b/tests/unit/test_util.h index f16c1f4ee..69e7f37cb 100644 --- a/tests/unit/test_util.h +++ b/tests/unit/test_util.h @@ -32,7 +32,7 @@ #include #include -#include "openthread/types.h" +#include #ifndef _WIN32