diff --git a/configure.ac b/configure.ac
index 144d32ec0..199767fb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -349,7 +349,7 @@ NL_ENABLE_TESTS([yes])
AM_CONDITIONAL([OPENTHREAD_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"])
-#
+#
# CLI Library
#
AC_ARG_ENABLE(cli-app,
@@ -1128,34 +1128,27 @@ AC_MSG_NOTICE([checking required package dependencies])
# NL_WITH_PACKAGE(...)
-#
-# Checks for missing functions
-#
-
-AC_DEFUN([CHECK_MISSING_FUNC], [
- AC_CHECK_FUNC($1, [], [
- nl_cv_missing_$1=yes
- MISSING_CPPFLAGS="${MISSING_CPPFLAGS} "'-include $(top_srcdir)/src/missing/$1/$1.h'
- MISSING_LIBADD="${MISSING_LIBADD} "'$(top_builddir)/src/missing/$1/lib$1.la'
- ])
- AM_CONDITIONAL(m4_toupper(MISSING_$1), [test "${nl_cv_missing_$1}" = "yes"])
-])
-AC_SUBST(MISSING_CPPFLAGS)
-AC_SUBST(MISSING_LIBADD)
-
-CHECK_MISSING_FUNC([strlcpy])
-CHECK_MISSING_FUNC([strlcat])
-
#
# Check for headers
#
+
+OLD_CFLAGS="${CFLAGS}"
+CFLAGS="${CFLAGS} -Wno-error=address"
AC_HEADER_STDBOOL
+CFLAGS="${OLD_CFLAGS}"
AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([string.h])
+#
+# Missing Functions
+#
+AC_CHECK_FUNC([strlcpy], [AC_DEFINE([HAVE_STRLCPY], [1], [Define if strlcpy exists.])])
+AC_CHECK_FUNC([strlcat], [AC_DEFINE([HAVE_STRLCAT], [1], [Define if strlcpy exists.])])
+AC_CHECK_FUNC([strnlen], [AC_DEFINE([HAVE_STRNLEN], [1], [Define if strlcpy exists.])])
+
#
# Check for types and structures
#
@@ -1204,11 +1197,6 @@ src/cli/Makefile
src/ncp/Makefile
src/core/Makefile
src/diag/Makefile
-src/missing/Makefile
-src/missing/stdbool/Makefile
-src/missing/stdint/Makefile
-src/missing/strlcat/Makefile
-src/missing/strlcpy/Makefile
third_party/Makefile
third_party/mbedtls/Makefile
examples/Makefile
diff --git a/etc/visual-studio/libopenthread-cli-windows.vcxproj b/etc/visual-studio/libopenthread-cli-windows.vcxproj
index e24ef0840..d3cd68dfb 100644
--- a/etc/visual-studio/libopenthread-cli-windows.vcxproj
+++ b/etc/visual-studio/libopenthread-cli-windows.vcxproj
@@ -49,7 +49,6 @@
..\..\include;
..\..\src;
..\..\src\core;
- ..\..\src\missing;
Level3
true
diff --git a/etc/visual-studio/libopenthread-cli.vcxproj b/etc/visual-studio/libopenthread-cli.vcxproj
index 98e8898ad..b62fec851 100644
--- a/etc/visual-studio/libopenthread-cli.vcxproj
+++ b/etc/visual-studio/libopenthread-cli.vcxproj
@@ -49,7 +49,6 @@
..\..\include;
..\..\src;
..\..\src\core;
- ..\..\src\missing;
..\..\third_party\mbedtls;
..\..\third_party\mbedtls\repo\include;
diff --git a/etc/visual-studio/libopenthread-ncp-spi.vcxproj b/etc/visual-studio/libopenthread-ncp-spi.vcxproj
index 495e3f2bb..a03590ad5 100644
--- a/etc/visual-studio/libopenthread-ncp-spi.vcxproj
+++ b/etc/visual-studio/libopenthread-ncp-spi.vcxproj
@@ -51,7 +51,6 @@
..\..\include;
..\..\src;
..\..\src\core;
- ..\..\src\missing;
..\..\third_party\mbedtls;
..\..\third_party\mbedtls\repo\include;
diff --git a/etc/visual-studio/libopenthread-ncp-uart.vcxproj b/etc/visual-studio/libopenthread-ncp-uart.vcxproj
index 4288e9660..641503c07 100644
--- a/etc/visual-studio/libopenthread-ncp-uart.vcxproj
+++ b/etc/visual-studio/libopenthread-ncp-uart.vcxproj
@@ -51,7 +51,6 @@
..\..\include;
..\..\src;
..\..\src\core;
- ..\..\src\missing;
..\..\third_party\mbedtls;
..\..\third_party\mbedtls\repo\include;
diff --git a/etc/visual-studio/libopenthread-windows.vcxproj b/etc/visual-studio/libopenthread-windows.vcxproj
index f3c1a09b7..3d1980a4f 100644
--- a/etc/visual-studio/libopenthread-windows.vcxproj
+++ b/etc/visual-studio/libopenthread-windows.vcxproj
@@ -49,7 +49,6 @@
..\..\include;
..\..\examples\platforms;
..\..\src\core;
- ..\..\src\missing;
true
diff --git a/etc/visual-studio/libopenthread.vcxproj b/etc/visual-studio/libopenthread.vcxproj
index f6fa2f640..ec8140caf 100644
--- a/etc/visual-studio/libopenthread.vcxproj
+++ b/etc/visual-studio/libopenthread.vcxproj
@@ -48,9 +48,6 @@
%(AdditionalIncludeDirectories);
..\..\include;
..\..\src\core;
- ..\..\src\missing;
- ..\..\src\missing\stdint;
- ..\..\src\missing\stdbool;
..\..\third_party\mbedtls;
..\..\third_party\mbedtls\repo\include;
@@ -141,8 +138,9 @@
-
-
+
+
+
@@ -227,8 +225,9 @@
-
-
+
+
+
diff --git a/etc/visual-studio/libopenthread.vcxproj.filters b/etc/visual-studio/libopenthread.vcxproj.filters
index e17ff796e..42c6fd63d 100644
--- a/etc/visual-studio/libopenthread.vcxproj.filters
+++ b/etc/visual-studio/libopenthread.vcxproj.filters
@@ -300,6 +300,15 @@
Source Files\utils
+
+ Source Files\utils
+
+
+ Source Files\utils
+
+
+ Source Files\utils
+
Source Files\meshcop
@@ -312,12 +321,6 @@
Source Files\thread
-
- Source Files\missing
-
-
- Source Files\missing
-
@@ -554,6 +557,15 @@
Header Files\utils
+
+ Header Files\utils
+
+
+ Header Files\utils
+
+
+ Header Files\utils
+
Header Files\common
@@ -566,11 +578,5 @@
Header Files\thread
-
- Header Files\missing
-
-
- Header Files\missing
-
diff --git a/etc/visual-studio/libopenthread_k.vcxproj b/etc/visual-studio/libopenthread_k.vcxproj
index 45f501ca5..5b5a9c7e6 100644
--- a/etc/visual-studio/libopenthread_k.vcxproj
+++ b/etc/visual-studio/libopenthread_k.vcxproj
@@ -44,6 +44,8 @@
WINDOWS_LOGGING;
OPENTHREAD_MULTIPLE_INSTANCE;
OPENTHREAD_FTD=1;
+ HAVE_STDBOOL_H=1;
+ HAVE_STDINT_H=1;
OTBUILD;
@@ -51,11 +53,9 @@
..\..\include;
..\..\examples\drivers\windows\include;
..\..\src\core;
- ..\..\src\missing;
- ..\..\src\missing\stdint;
- ..\..\src\missing\stdbool;
..\..\third_party\mbedtls;
..\..\third_party\mbedtls\repo\include;
+ ..\..\examples\drivers\windows\include_c99;
4100;4706;4748;%(DisableSpecificWarnings)
true
@@ -146,8 +146,9 @@
-
-
+
+
+
@@ -258,8 +259,9 @@
-
-
+
+
+
diff --git a/etc/visual-studio/libopenthread_k.vcxproj.filters b/etc/visual-studio/libopenthread_k.vcxproj.filters
index 6e5adf504..a3dd892d2 100644
--- a/etc/visual-studio/libopenthread_k.vcxproj.filters
+++ b/etc/visual-studio/libopenthread_k.vcxproj.filters
@@ -309,10 +309,13 @@
Source Files\common
-
+
Source Files\missing
-
+
+ Source Files\missing
+
+
Source Files\missing
@@ -641,10 +644,13 @@
Header Files\api
-
+
Header Files\missing
-
+
+ Header Files\missing
+
+
Header Files\missing
diff --git a/etc/visual-studio/mbedtls_k.vcxproj b/etc/visual-studio/mbedtls_k.vcxproj
index 42ced4b07..a685c1268 100644
--- a/etc/visual-studio/mbedtls_k.vcxproj
+++ b/etc/visual-studio/mbedtls_k.vcxproj
@@ -39,15 +39,17 @@
..\..\include;
..\..\src\core;
- ..\..\src\missing\stdint;
- ..\..\src\missing\stdbool;
..\..\third_party\mbedtls;
..\..\third_party\mbedtls\repo\include;
- ..\..\third_party\mbedtls\repo\include\mbedtls
+ ..\..\third_party\mbedtls\repo\include\mbedtls;
+ ..\..\examples\drivers\windows\include_c99;
%(PreprocessorDefinitions);
MBEDTLS_CONFIG_FILE="mbedtls-config.h";
+ OPENTHREAD_CONFIG_FILE="openthread-windows-config.h";
+ HAVE_STDBOOL_H=1;
+ HAVE_STDINT_H=1;
OPENTHREAD_MULTIPLE_INSTANCE;
4132;4242;4245;4603;4627;4986;4987;4996;%(DisableSpecificWarnings)
diff --git a/etc/visual-studio/otLwf.vcxproj b/etc/visual-studio/otLwf.vcxproj
index 83880616a..d4f568d47 100644
--- a/etc/visual-studio/otLwf.vcxproj
+++ b/etc/visual-studio/otLwf.vcxproj
@@ -49,11 +49,10 @@
%(AdditionalIncludeDirectories);
..\..\include;
..\..\examples\drivers\windows\include;
+ ..\..\examples\drivers\windows\include_c99;
..\..\examples\drivers\windows\otLwf;
..\..\src;
..\..\src\core;
- ..\..\src\missing\stdint;
- ..\..\src\missing\stdbool;
Level4
true
diff --git a/etc/visual-studio/spinel_k.vcxproj b/etc/visual-studio/spinel_k.vcxproj
index 8778d122c..897d79779 100644
--- a/etc/visual-studio/spinel_k.vcxproj
+++ b/etc/visual-studio/spinel_k.vcxproj
@@ -40,13 +40,17 @@
%(PreprocessorDefinitions);
HAVE_STRNLEN=1;
OPENTHREAD_FTD=1;
+ HAVE_STDBOOL_H=1;
+ HAVE_STDINT_H=1;
SPINEL_PLATFORM_DOESNT_IMPLEMENT_ERRNO_VAR=1;
+ OPENTHREAD_CONFIG_FILE="openthread-windows-config.h";
+ OPENTHREAD_PROJECT_CORE_CONFIG_FILE="openthread-core-windows-config.h";
%(AdditionalIncludeDirectories);
..\..\include;
- ..\..\src\missing\stdint;
- ..\..\src\missing\stdbool;
+ ..\..\src\core;
+ ..\..\examples\drivers\windows\include_c99;
4100;4706;4748;%(DisableSpecificWarnings)
true
diff --git a/src/missing/stdbool/stdbool.h b/examples/drivers/windows/include_c99/stdbool.h
similarity index 100%
rename from src/missing/stdbool/stdbool.h
rename to examples/drivers/windows/include_c99/stdbool.h
diff --git a/src/missing/stdint/stdint.h b/examples/drivers/windows/include_c99/stdint.h
similarity index 100%
rename from src/missing/stdint/stdint.h
rename to examples/drivers/windows/include_c99/stdint.h
diff --git a/examples/platforms/da15000/alarm.c b/examples/platforms/da15000/alarm.c
index aed477c5c..055618ddd 100644
--- a/examples/platforms/da15000/alarm.c
+++ b/examples/platforms/da15000/alarm.c
@@ -31,6 +31,12 @@
* Platform abstraction for the alarm
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include "openthread/platform/alarm.h"
diff --git a/examples/platforms/da15000/uart.c b/examples/platforms/da15000/uart.c
index e35d6a0f3..f235dcc1a 100644
--- a/examples/platforms/da15000/uart.c
+++ b/examples/platforms/da15000/uart.c
@@ -26,6 +26,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/examples/platforms/nrf52840/radio.c b/examples/platforms/nrf52840/radio.c
index 54495167c..4ef8f24b6 100644
--- a/examples/platforms/nrf52840/radio.c
+++ b/examples/platforms/nrf52840/radio.c
@@ -32,6 +32,16 @@
*
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+// NRF tools use #define PACKAGE - for other purposes
+// ie: the physical package the chip comes in
+// This conflicts with the GNU Autoconf "PACAKGE" define
+#undef PACKAGE
+
#include
#include
#include
diff --git a/examples/platforms/utils/settings.cpp b/examples/platforms/utils/settings.cpp
index dd2df8bdf..8f8743f45 100644
--- a/examples/platforms/utils/settings.cpp
+++ b/examples/platforms/utils/settings.cpp
@@ -34,7 +34,7 @@
#include
#include
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/include/openthread-windows-config.h b/include/openthread-windows-config.h
index bea5d1925..322567776 100644
--- a/include/openthread-windows-config.h
+++ b/include/openthread-windows-config.h
@@ -107,11 +107,6 @@
// Redefine rand to random for test code
#define random rand
-#ifdef OTBUILD
-#include
-#include
-#endif
-
// Disable a few warnings that we don't care about
#pragma warning(disable:4200) // nonstandard extension used: zero-sized array in struct/union
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
diff --git a/src/Makefile.am b/src/Makefile.am
index 2a911e701..dd2b58c5c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,7 +31,6 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
# Always package (e.g. for 'make dist') these subdirectories.
DIST_SUBDIRS = \
- missing \
core \
cli \
ncp \
@@ -41,7 +40,6 @@ DIST_SUBDIRS = \
# Always build (e.g. for 'make all') these subdirectories.
SUBDIRS = \
- missing \
core \
$(NULL)
@@ -62,7 +60,6 @@ endif
PRETTY_SUBDIRS = \
cli \
core \
- missing \
$(NULL)
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am
index 3b9f7b13c..8331e4ce6 100644
--- a/src/cli/Makefile.am
+++ b/src/cli/Makefile.am
@@ -118,7 +118,6 @@ CPPFLAGS_COMMON = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/core \
$(OPENTHREAD_TARGET_DEFINES) \
- $(MISSING_CPPFLAGS) \
$(NULL)
diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp
index aa4c863fe..e5528866f 100644
--- a/src/cli/cli.cpp
+++ b/src/cli/cli.cpp
@@ -39,7 +39,7 @@
#include
#include
-#include
+#include "utils/wrap_string.h"
#ifdef OTDLL
#include
diff --git a/src/cli/cli_coap.cpp b/src/cli/cli_coap.cpp
index 5ef456c6a..a536a3ec7 100644
--- a/src/cli/cli_coap.cpp
+++ b/src/cli/cli_coap.cpp
@@ -31,6 +31,12 @@
* This file implements a simple CLI coap server and client.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
diff --git a/src/cli/cli_console.cpp b/src/cli/cli_console.cpp
index ddf062bb7..5a2785359 100644
--- a/src/cli/cli_console.cpp
+++ b/src/cli/cli_console.cpp
@@ -31,10 +31,16 @@
* This file implements the CLI server on the CONSOLE service.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/cli/cli_dataset.cpp b/src/cli/cli_dataset.cpp
index d4bac0997..44920156b 100644
--- a/src/cli/cli_dataset.cpp
+++ b/src/cli/cli_dataset.cpp
@@ -39,7 +39,7 @@
#include
#include
-#include
+#include "utils/wrap_string.h"
#include "openthread/openthread.h"
diff --git a/src/cli/cli_instance.cpp b/src/cli/cli_instance.cpp
index 9419d89d8..1fb1269d5 100644
--- a/src/cli/cli_instance.cpp
+++ b/src/cli/cli_instance.cpp
@@ -39,7 +39,7 @@
#include
#include
-#include
+#include "utils/wrap_string.h"
#include
#include "openthread/openthread.h"
diff --git a/src/cli/cli_uart.cpp b/src/cli/cli_uart.cpp
index c92591d20..0a7813af9 100644
--- a/src/cli/cli_uart.cpp
+++ b/src/cli/cli_uart.cpp
@@ -31,10 +31,16 @@
* This file implements the CLI server on the UART service.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
-#include
+#include "utils/wrap_string.h"
#include "openthread/cli.h"
#include "openthread/platform/logging.h"
diff --git a/src/cli/cli_udp.cpp b/src/cli/cli_udp.cpp
index f4b7cb915..a591898af 100644
--- a/src/cli/cli_udp.cpp
+++ b/src/cli/cli_udp.cpp
@@ -31,9 +31,15 @@
* This file implements the CLI server on a UDP socket.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index ba0d6923c..ace31f20e 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -37,7 +37,6 @@ CPPFLAGS_COMMON = \
-I$(top_srcdir)/include \
-I${abs_top_srcdir}/third_party/mbedtls/repo/include \
$(MBEDTLS_CPPFLAGS) \
- $(MISSING_CPPFLAGS) \
$(OPENTHREAD_TARGET_DEFINES) \
$(NULL)
@@ -180,57 +179,19 @@ SOURCES_COMMON = \
thread/thread_netif.cpp \
thread/topology.cpp \
utils/jam_detector.cpp \
+ utils/missing_strlcpy.c \
+ utils/missing_strlcat.c \
+ utils/missing_strnlen.c \
utils/slaac_address.cpp \
$(NULL)
-SOURCES_MISSING = \
- $(NULL)
-
-if MISSING_STRLCPY
-###############################################################
-# You'll see something similar to the next four lines in all
-# of these `MISSING_*` blocks. These makefile gynmastics are
-# to work around some unfortunate bugs in automake which
-# prevent a more elegant solution. We can't just pull in the
-# convenience libraries in `$(MISSING_LIBADD)` because that
-# doesn't seem to work on some platforms. Also, we can't
-# just include `$(top_srcdir)/src/missing/X/X.c` directly
-# because a bug in automake causes the `clean` target to
-# break. The following code may look ugly, but it gets the
-# job done. It does this by copying the source file to the
-# local build directory as an intermediate target. We then
-# compile that file. We have to add the path in CPPFLAGS
-# because the file might include headers from that directory.
-# Because the copied source file is explicitly labeled as
-# an intermediate target, it will always get deleted (unless
-# it already existed in the first place). -- RQ 2017-03-22
-strlcpy.c: $(top_srcdir)/src/missing/strlcpy/strlcpy.c
- $(AM_V_GEN)cp $< $@
-.INTERMEDIATE: strlcpy.c
-CPPFLAGS_COMMON += -I$(top_srcdir)/src/missing/strlcpy
-SOURCES_MISSING += strlcpy.c
-endif
-
-if MISSING_STRLCAT
-# See comment above for explanation.
-strlcat.c: $(top_srcdir)/src/missing/strlcat/strlcat.c
- $(AM_V_GEN)cp $< $@
-.INTERMEDIATE: strlcat.c
-CPPFLAGS_COMMON += -I$(top_srcdir)/src/missing/strlcat
-SOURCES_MISSING += strlcat.c
-endif
-
-
-
libopenthread_mtd_a_SOURCES = \
$(SOURCES_COMMON) \
- $(SOURCES_MISSING) \
$(NULL)
libopenthread_ftd_a_SOURCES = \
$(SOURCES_COMMON) \
- $(SOURCES_MISSING) \
$(NULL)
HEADERS_COMMON = \
@@ -336,6 +297,9 @@ HEADERS_COMMON = \
thread/topology.hpp \
utils/slaac_address.hpp \
utils/jam_detector.hpp \
+ utils/wrap_stdbool.h \
+ utils/wrap_stdint.h \
+ utils/wrap_string.h \
$(NULL)
noinst_HEADERS = \
diff --git a/src/core/coap/coap_base.cpp b/src/core/coap/coap_base.cpp
index 472395689..8c67951eb 100644
--- a/src/core/coap/coap_base.cpp
+++ b/src/core/coap/coap_base.cpp
@@ -26,6 +26,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
diff --git a/src/core/coap/coap_client.cpp b/src/core/coap/coap_client.cpp
index 12be70359..77fd49d34 100644
--- a/src/core/coap/coap_client.cpp
+++ b/src/core/coap/coap_client.cpp
@@ -26,7 +26,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
+#include "utils/wrap_string.h"
#include "openthread/platform/random.h"
diff --git a/src/core/coap/coap_header.cpp b/src/core/coap/coap_header.cpp
index ca06a03c2..9f5fb678b 100644
--- a/src/core/coap/coap_header.cpp
+++ b/src/core/coap/coap_header.cpp
@@ -31,6 +31,12 @@
* This file implements the CoAP header generation and parsing.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/platform/random.h"
#include
diff --git a/src/core/coap/coap_header.hpp b/src/core/coap/coap_header.hpp
index 35245eea2..dfab1ad32 100644
--- a/src/core/coap/coap_header.hpp
+++ b/src/core/coap/coap_header.hpp
@@ -34,7 +34,7 @@
#ifndef COAP_HEADER_HPP_
#define COAP_HEADER_HPP_
-#include
+#include "utils/wrap_string.h"
#include "openthread/coap.h"
diff --git a/src/core/coap/coap_server.cpp b/src/core/coap/coap_server.cpp
index f7aa53847..5dc6f4146 100644
--- a/src/core/coap/coap_server.cpp
+++ b/src/core/coap/coap_server.cpp
@@ -31,6 +31,12 @@
* This file implements the CoAP server message dispatch.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/coap/secure_coap_client.cpp b/src/core/coap/secure_coap_client.cpp
index 58b8acc0e..d876072b3 100644
--- a/src/core/coap/secure_coap_client.cpp
+++ b/src/core/coap/secure_coap_client.cpp
@@ -28,6 +28,12 @@
#define WPP_NAME "secure_coap_client.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/coap/secure_coap_server.cpp b/src/core/coap/secure_coap_server.cpp
index f44849ceb..34f724d96 100644
--- a/src/core/coap/secure_coap_server.cpp
+++ b/src/core/coap/secure_coap_server.cpp
@@ -28,6 +28,12 @@
#define WPP_NAME "secure_coap_server.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/common/code_utils.hpp b/src/core/common/code_utils.hpp
index 1b430e449..1fde41f4f 100644
--- a/src/core/common/code_utils.hpp
+++ b/src/core/common/code_utils.hpp
@@ -34,7 +34,7 @@
#ifndef CODE_UTILS_HPP_
#define CODE_UTILS_HPP_
-#include
+#include "utils/wrap_stdbool.h"
// Calculates the aligned variable size.
#define otALIGNED_VAR_SIZE(size, align_type) \
diff --git a/src/core/common/crc16.cpp b/src/core/common/crc16.cpp
index 240524cfa..158e76a3c 100644
--- a/src/core/common/crc16.cpp
+++ b/src/core/common/crc16.cpp
@@ -31,6 +31,12 @@
* This file implements CRC16 computations.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
namespace Thread {
diff --git a/src/core/common/crc16.hpp b/src/core/common/crc16.hpp
index 4d99551ee..21822258c 100644
--- a/src/core/common/crc16.hpp
+++ b/src/core/common/crc16.hpp
@@ -34,7 +34,7 @@
#ifndef CRC16_HPP_
#define CRC16_HPP_
-#include
+#include "utils/wrap_stdint.h"
namespace Thread {
diff --git a/src/core/common/debug.hpp b/src/core/common/debug.hpp
index cd98e2afe..2b0a471ea 100644
--- a/src/core/common/debug.hpp
+++ b/src/core/common/debug.hpp
@@ -37,7 +37,7 @@
#include
#include
#include
-#include
+#include "utils/wrap_string.h"
#if defined(OPENTHREAD_TARGET_DARWIN) || defined(OPENTHREAD_TARGET_LINUX)
diff --git a/src/core/common/encoding.hpp b/src/core/common/encoding.hpp
index 431dd68f9..6ff1469cd 100644
--- a/src/core/common/encoding.hpp
+++ b/src/core/common/encoding.hpp
@@ -35,7 +35,7 @@
#define ENCODING_HPP_
#include
-#include
+#include "utils/wrap_stdint.h"
namespace Thread {
namespace Encoding {
diff --git a/src/core/common/logging.hpp b/src/core/common/logging.hpp
index 2b36cad34..cedd52b0d 100644
--- a/src/core/common/logging.hpp
+++ b/src/core/common/logging.hpp
@@ -36,7 +36,7 @@
#include
#include
-#include
+#include "utils/wrap_string.h"
#include
#include "openthread/types.h"
diff --git a/src/core/common/message.cpp b/src/core/common/message.cpp
index ebd4538a0..067f4e36d 100644
--- a/src/core/common/message.cpp
+++ b/src/core/common/message.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "message.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/common/message.hpp b/src/core/common/message.hpp
index 387d49e57..93ed3a954 100644
--- a/src/core/common/message.hpp
+++ b/src/core/common/message.hpp
@@ -40,8 +40,8 @@
#include
#endif
-#include
-#include
+#include "utils/wrap_stdint.h"
+#include "utils/wrap_string.h"
#include "openthread/message.h"
#include "openthread/platform/messagepool.h"
diff --git a/src/core/common/tasklet.cpp b/src/core/common/tasklet.cpp
index 49605fef4..13934e1bf 100644
--- a/src/core/common/tasklet.cpp
+++ b/src/core/common/tasklet.cpp
@@ -31,6 +31,12 @@
* This file implements the tasklet scheduler.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/openthread.h"
#include
diff --git a/src/core/common/timer.cpp b/src/core/common/timer.cpp
index 0568b7ae2..eeacc67ce 100644
--- a/src/core/common/timer.cpp
+++ b/src/core/common/timer.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "timer.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/platform/alarm.h"
#include
diff --git a/src/core/common/timer.hpp b/src/core/common/timer.hpp
index b9fcc6380..af3ca4a1d 100644
--- a/src/core/common/timer.hpp
+++ b/src/core/common/timer.hpp
@@ -35,7 +35,7 @@
#define TIMER_HPP_
#include
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
#include "openthread/platform/alarm.h"
diff --git a/src/core/common/tlvs.cpp b/src/core/common/tlvs.cpp
index d48734d75..663e82c24 100644
--- a/src/core/common/tlvs.cpp
+++ b/src/core/common/tlvs.cpp
@@ -31,6 +31,12 @@
* This file implements common methods for manipulating MLE TLVs.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/common/tlvs.hpp b/src/core/common/tlvs.hpp
index 30581f260..30fec9ea7 100644
--- a/src/core/common/tlvs.hpp
+++ b/src/core/common/tlvs.hpp
@@ -34,7 +34,7 @@
#ifndef TLVS_HPP_
#define TLVS_HPP_
-#include
+#include "utils/wrap_string.h"
#include "openthread/types.h"
diff --git a/src/core/common/trickle_timer.cpp b/src/core/common/trickle_timer.cpp
index 69187fed7..3ee94d592 100644
--- a/src/core/common/trickle_timer.cpp
+++ b/src/core/common/trickle_timer.cpp
@@ -31,6 +31,12 @@
* This file implements the trickle timer logic.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/platform/random.h"
#include
diff --git a/src/core/crypto/aes_ccm.cpp b/src/core/crypto/aes_ccm.cpp
index e1b1fc269..9231da299 100644
--- a/src/core/crypto/aes_ccm.cpp
+++ b/src/core/crypto/aes_ccm.cpp
@@ -31,6 +31,12 @@
* This file implements AES-CCM.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/crypto/aes_ccm.hpp b/src/core/crypto/aes_ccm.hpp
index de4792afd..cab0b7a24 100644
--- a/src/core/crypto/aes_ccm.hpp
+++ b/src/core/crypto/aes_ccm.hpp
@@ -34,7 +34,7 @@
#ifndef AES_CCM_HPP_
#define AES_CCM_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
diff --git a/src/core/crypto/aes_ecb.cpp b/src/core/crypto/aes_ecb.cpp
index 924256006..a30143353 100644
--- a/src/core/crypto/aes_ecb.cpp
+++ b/src/core/crypto/aes_ecb.cpp
@@ -31,6 +31,12 @@
* This file implements AES-ECB.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
namespace Thread {
diff --git a/src/core/crypto/hmac_sha256.cpp b/src/core/crypto/hmac_sha256.cpp
index 2b5f1379e..485a0d6a1 100644
--- a/src/core/crypto/hmac_sha256.cpp
+++ b/src/core/crypto/hmac_sha256.cpp
@@ -31,6 +31,12 @@
* This file implements HMAC SHA-256.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
namespace Thread {
diff --git a/src/core/crypto/hmac_sha256.hpp b/src/core/crypto/hmac_sha256.hpp
index c0c0947c7..2f3ede208 100644
--- a/src/core/crypto/hmac_sha256.hpp
+++ b/src/core/crypto/hmac_sha256.hpp
@@ -34,7 +34,7 @@
#ifndef HMAC_SHA256_HPP_
#define HMAC_SHA256_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include
diff --git a/src/core/crypto/mbedtls.cpp b/src/core/crypto/mbedtls.cpp
index 539cd68ec..ba0f29022 100644
--- a/src/core/crypto/mbedtls.cpp
+++ b/src/core/crypto/mbedtls.cpp
@@ -31,6 +31,12 @@
* This file implements the use of mbedTLS.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
namespace Thread {
diff --git a/src/core/crypto/pbkdf2_cmac.cpp b/src/core/crypto/pbkdf2_cmac.cpp
index 25b718c97..17f20a97c 100644
--- a/src/core/crypto/pbkdf2_cmac.cpp
+++ b/src/core/crypto/pbkdf2_cmac.cpp
@@ -37,7 +37,7 @@
#include
#endif
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/crypto/pbkdf2_cmac.h b/src/core/crypto/pbkdf2_cmac.h
index a69d07a1b..1d5581bc7 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
-#include
+#include "utils/wrap_stdint.h"
+#include "utils/wrap_stdbool.h"
#ifdef __cplusplus
extern "C" {
diff --git a/src/core/crypto/sha256.cpp b/src/core/crypto/sha256.cpp
index ba7f28ee7..72bdff263 100644
--- a/src/core/crypto/sha256.cpp
+++ b/src/core/crypto/sha256.cpp
@@ -31,6 +31,12 @@
* This file implements SHA-256.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
namespace Thread {
diff --git a/src/core/crypto/sha256.hpp b/src/core/crypto/sha256.hpp
index 732fd8bb2..9b9cc8a32 100644
--- a/src/core/crypto/sha256.hpp
+++ b/src/core/crypto/sha256.hpp
@@ -34,7 +34,7 @@
#ifndef SHA256_HPP_
#define SHA256_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include
diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp
index 330f6bffd..1b5c64c19 100644
--- a/src/core/mac/mac.cpp
+++ b/src/core/mac/mac.cpp
@@ -39,7 +39,7 @@
#include
#endif
-#include
+#include "utils/wrap_string.h"
#include "openthread/platform/random.h"
#include "openthread/platform/usec-alarm.h"
diff --git a/src/core/mac/mac_blacklist.cpp b/src/core/mac/mac_blacklist.cpp
index 5802422e4..9f0198ac0 100644
--- a/src/core/mac/mac_blacklist.cpp
+++ b/src/core/mac/mac_blacklist.cpp
@@ -31,7 +31,13 @@
* This file implements blacklist IEEE 802.15.4 frame filtering based on MAC address.
*/
-#include
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/mac/mac_blacklist_impl.hpp b/src/core/mac/mac_blacklist_impl.hpp
index 2153b5001..dc10c1c4f 100644
--- a/src/core/mac/mac_blacklist_impl.hpp
+++ b/src/core/mac/mac_blacklist_impl.hpp
@@ -34,7 +34,7 @@
#ifndef MAC_BLACKLIST_HPP_
#define MAC_BLACKLIST_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
diff --git a/src/core/mac/mac_blacklist_stub.hpp b/src/core/mac/mac_blacklist_stub.hpp
index e8bc5713f..f79e7f432 100644
--- a/src/core/mac/mac_blacklist_stub.hpp
+++ b/src/core/mac/mac_blacklist_stub.hpp
@@ -34,7 +34,7 @@
#ifndef MAC_BLACKLIST_HPP_
#define MAC_BLACKLIST_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
diff --git a/src/core/mac/mac_frame.cpp b/src/core/mac/mac_frame.cpp
index 16be09412..16bfbe56d 100644
--- a/src/core/mac/mac_frame.cpp
+++ b/src/core/mac/mac_frame.cpp
@@ -38,7 +38,7 @@
#endif
#include
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/mac/mac_frame.hpp b/src/core/mac/mac_frame.hpp
index d4d6671f9..0f8108019 100644
--- a/src/core/mac/mac_frame.hpp
+++ b/src/core/mac/mac_frame.hpp
@@ -37,8 +37,8 @@
#include
#include
-#include
-#include
+#include "utils/wrap_stdint.h"
+#include "utils/wrap_string.h"
#include "openthread/types.h"
#include "openthread/platform/radio.h"
diff --git a/src/core/mac/mac_whitelist.cpp b/src/core/mac/mac_whitelist.cpp
index 4c48d24af..8c3c63027 100644
--- a/src/core/mac/mac_whitelist.cpp
+++ b/src/core/mac/mac_whitelist.cpp
@@ -31,7 +31,13 @@
* This file implements whitelist IEEE 802.15.4 frame filtering based on MAC address.
*/
-#include
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/mac/mac_whitelist_impl.hpp b/src/core/mac/mac_whitelist_impl.hpp
index 0ced1daef..3df37f441 100644
--- a/src/core/mac/mac_whitelist_impl.hpp
+++ b/src/core/mac/mac_whitelist_impl.hpp
@@ -34,7 +34,7 @@
#ifndef MAC_WHITELIST_HPP_
#define MAC_WHITELIST_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
diff --git a/src/core/mac/mac_whitelist_stub.hpp b/src/core/mac/mac_whitelist_stub.hpp
index d4fb6a73f..981bd4814 100644
--- a/src/core/mac/mac_whitelist_stub.hpp
+++ b/src/core/mac/mac_whitelist_stub.hpp
@@ -34,7 +34,7 @@
#ifndef MAC_WHITELIST_HPP_
#define MAC_WHITELIST_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
diff --git a/src/core/meshcop/commissioner.cpp b/src/core/meshcop/commissioner.cpp
index b3db0b53e..268d2cff8 100644
--- a/src/core/meshcop/commissioner.cpp
+++ b/src/core/meshcop/commissioner.cpp
@@ -40,7 +40,7 @@
#endif
#include
-#include
+#include "utils/wrap_string.h"
#include "openthread/platform/random.h"
diff --git a/src/core/meshcop/dataset.cpp b/src/core/meshcop/dataset.cpp
index 49930530e..c45362005 100644
--- a/src/core/meshcop/dataset.cpp
+++ b/src/core/meshcop/dataset.cpp
@@ -32,6 +32,12 @@
*
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include "openthread/platform/settings.h"
diff --git a/src/core/meshcop/dataset_manager.cpp b/src/core/meshcop/dataset_manager.cpp
index 081b40c4a..3b0723c4d 100644
--- a/src/core/meshcop/dataset_manager.cpp
+++ b/src/core/meshcop/dataset_manager.cpp
@@ -34,6 +34,12 @@
#define WPP_NAME "dataset_manager.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include "openthread/platform/random.h"
diff --git a/src/core/meshcop/timestamp.cpp b/src/core/meshcop/timestamp.cpp
index 5ea2af21c..e34992f21 100644
--- a/src/core/meshcop/timestamp.cpp
+++ b/src/core/meshcop/timestamp.cpp
@@ -31,7 +31,13 @@
* This file implements common MeshCoP timestamp processing.
*/
-#include
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
+#include "utils/wrap_string.h"
#include "openthread/types.h"
diff --git a/src/core/meshcop/tlvs.hpp b/src/core/meshcop/tlvs.hpp
index bc0fb9d64..44227abbd 100644
--- a/src/core/meshcop/tlvs.hpp
+++ b/src/core/meshcop/tlvs.hpp
@@ -35,7 +35,7 @@
#ifndef MESHCOP_TLVS_HPP_
#define MESHCOP_TLVS_HPP_
-#include
+#include "utils/wrap_string.h"
#include "openthread/types.h"
diff --git a/src/core/net/dhcp6_client.cpp b/src/core/net/dhcp6_client.cpp
index 05e19bd6f..77bdbeb24 100644
--- a/src/core/net/dhcp6_client.cpp
+++ b/src/core/net/dhcp6_client.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "dhcp6_client.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/types.h"
#include "openthread/platform/random.h"
diff --git a/src/core/net/dns_client.cpp b/src/core/net/dns_client.cpp
index 5154f7c7f..3e11521b6 100644
--- a/src/core/net/dns_client.cpp
+++ b/src/core/net/dns_client.cpp
@@ -32,7 +32,7 @@
#include
#endif
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/net/dns_headers.hpp b/src/core/net/dns_headers.hpp
index 558236367..e72c94592 100644
--- a/src/core/net/dns_headers.hpp
+++ b/src/core/net/dns_headers.hpp
@@ -34,7 +34,7 @@
#ifndef DNS_HEADER_HPP_
#define DNS_HEADER_HPP_
-#include
+#include "utils/wrap_string.h"
#include
diff --git a/src/core/net/icmp6.cpp b/src/core/net/icmp6.cpp
index f4fa58ee1..ded46848e 100644
--- a/src/core/net/icmp6.cpp
+++ b/src/core/net/icmp6.cpp
@@ -39,7 +39,7 @@
#include
#endif
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp
index 8a4cb9e03..094fd78c1 100644
--- a/src/core/net/ip6.cpp
+++ b/src/core/net/ip6.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "ip6.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/net/ip6_address.cpp b/src/core/net/ip6_address.cpp
index dbc4b0b47..bdfd39f34 100644
--- a/src/core/net/ip6_address.cpp
+++ b/src/core/net/ip6_address.cpp
@@ -38,7 +38,7 @@
#endif
#include
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/net/ip6_address.hpp b/src/core/net/ip6_address.hpp
index 99bb7018a..b5ffc5c61 100644
--- a/src/core/net/ip6_address.hpp
+++ b/src/core/net/ip6_address.hpp
@@ -34,7 +34,7 @@
#ifndef IP6_ADDRESS_HPP_
#define IP6_ADDRESS_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
diff --git a/src/core/net/ip6_filter.cpp b/src/core/net/ip6_filter.cpp
index 267c48683..ee5c0031a 100644
--- a/src/core/net/ip6_filter.cpp
+++ b/src/core/net/ip6_filter.cpp
@@ -31,6 +31,12 @@
* This file implements IPv6 datagram filtering.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
diff --git a/src/core/net/ip6_mpl.cpp b/src/core/net/ip6_mpl.cpp
index 87032a1d7..92f494bf6 100644
--- a/src/core/net/ip6_mpl.cpp
+++ b/src/core/net/ip6_mpl.cpp
@@ -31,6 +31,12 @@
* This file implements MPL.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/platform/random.h"
#include
diff --git a/src/core/net/ip6_routes.cpp b/src/core/net/ip6_routes.cpp
index a7572b060..5628a8656 100644
--- a/src/core/net/ip6_routes.cpp
+++ b/src/core/net/ip6_routes.cpp
@@ -31,6 +31,12 @@
* This file implements IPv6 route tables.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/net/netif.cpp b/src/core/net/netif.cpp
index c8a5771de..01295b64c 100644
--- a/src/core/net/netif.cpp
+++ b/src/core/net/netif.cpp
@@ -30,6 +30,11 @@
* @file
* This file implements IPv6 network interfaces.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
#include
#include
diff --git a/src/core/net/udp6.cpp b/src/core/net/udp6.cpp
index bd81517d8..c611a84a8 100644
--- a/src/core/net/udp6.cpp
+++ b/src/core/net/udp6.cpp
@@ -31,6 +31,12 @@
* This file implements UDP/IPv6 sockets.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
diff --git a/src/core/openthread-instance.h b/src/core/openthread-instance.h
index 049f105be..e45eb2b4b 100644
--- a/src/core/openthread-instance.h
+++ b/src/core/openthread-instance.h
@@ -35,8 +35,8 @@
#ifndef OPENTHREADINSTANCE_H_
#define OPENTHREADINSTANCE_H_
-#include
-#include
+#include "utils/wrap_stdint.h"
+#include "utils/wrap_stdbool.h"
#include
diff --git a/src/core/thread/data_poll_manager.cpp b/src/core/thread/data_poll_manager.cpp
index 8192e5f55..5ca385a13 100644
--- a/src/core/thread/data_poll_manager.cpp
+++ b/src/core/thread/data_poll_manager.cpp
@@ -31,6 +31,12 @@
* This file implements data poll (mac data request command) manager class.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#define WPP_NAME "data_poll_manager.tmh"
#include "openthread/platform/random.h"
diff --git a/src/core/thread/energy_scan_server.cpp b/src/core/thread/energy_scan_server.cpp
index 33d2af019..a81e3b289 100644
--- a/src/core/thread/energy_scan_server.cpp
+++ b/src/core/thread/energy_scan_server.cpp
@@ -31,6 +31,12 @@
* This file implements the Energy Scan Server.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#define WPP_NAME "energy_scan_server.tmh"
#include "openthread/platform/random.h"
diff --git a/src/core/thread/key_manager.hpp b/src/core/thread/key_manager.hpp
index 1c0576634..a03779aa7 100644
--- a/src/core/thread/key_manager.hpp
+++ b/src/core/thread/key_manager.hpp
@@ -34,7 +34,7 @@
#ifndef KEY_MANAGER_HPP_
#define KEY_MANAGER_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include "openthread/types.h"
diff --git a/src/core/thread/link_quality.cpp b/src/core/thread/link_quality.cpp
index a6f0cf072..01d2e8205 100644
--- a/src/core/thread/link_quality.cpp
+++ b/src/core/thread/link_quality.cpp
@@ -38,7 +38,7 @@
#endif
#include
-#include
+#include "utils/wrap_string.h"
#include "openthread/types.h"
diff --git a/src/core/thread/lowpan.cpp b/src/core/thread/lowpan.cpp
index ce37fc1fb..1aedb9bf0 100644
--- a/src/core/thread/lowpan.cpp
+++ b/src/core/thread/lowpan.cpp
@@ -31,6 +31,12 @@
* This file implements 6LoWPAN header compression.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/thread/mesh_forwarder.cpp b/src/core/thread/mesh_forwarder.cpp
index 452b9720f..b01d5aae7 100644
--- a/src/core/thread/mesh_forwarder.cpp
+++ b/src/core/thread/mesh_forwarder.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "mesh_forwarder.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/platform/random.h"
#include
diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp
index 476830e10..f41698c1a 100644
--- a/src/core/thread/mle.cpp
+++ b/src/core/thread/mle.cpp
@@ -31,6 +31,12 @@
* This file implements MLE functionality required for the Thread Child, Router and Leader roles.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#define WPP_NAME "mle.tmh"
#include "openthread/platform/radio.h"
diff --git a/src/core/thread/mle_router_ftd.hpp b/src/core/thread/mle_router_ftd.hpp
index 85a3bb34f..3f2bda9a1 100644
--- a/src/core/thread/mle_router_ftd.hpp
+++ b/src/core/thread/mle_router_ftd.hpp
@@ -34,7 +34,7 @@
#ifndef MLE_ROUTER_HPP_
#define MLE_ROUTER_HPP_
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/thread/mle_router_mtd.hpp b/src/core/thread/mle_router_mtd.hpp
index 8837368f7..102eabebf 100644
--- a/src/core/thread/mle_router_mtd.hpp
+++ b/src/core/thread/mle_router_mtd.hpp
@@ -34,7 +34,7 @@
#ifndef MLE_ROUTER_HPP_
#define MLE_ROUTER_HPP_
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/thread/mle_tlvs.hpp b/src/core/thread/mle_tlvs.hpp
index 64976f883..a9dd23e4f 100644
--- a/src/core/thread/mle_tlvs.hpp
+++ b/src/core/thread/mle_tlvs.hpp
@@ -34,7 +34,7 @@
#ifndef MLE_TLVS_HPP_
#define MLE_TLVS_HPP_
-#include
+#include "utils/wrap_string.h"
#include "openthread/types.h"
diff --git a/src/core/thread/network_data.cpp b/src/core/thread/network_data.cpp
index a40f094cd..242f7d7c9 100644
--- a/src/core/thread/network_data.cpp
+++ b/src/core/thread/network_data.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "network_data.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/platform/random.h"
#include
diff --git a/src/core/thread/network_data_leader.hpp b/src/core/thread/network_data_leader.hpp
index 2ace05973..61f6d4656 100644
--- a/src/core/thread/network_data_leader.hpp
+++ b/src/core/thread/network_data_leader.hpp
@@ -34,7 +34,7 @@
#ifndef NETWORK_DATA_LEADER_HPP_
#define NETWORK_DATA_LEADER_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include
#include
diff --git a/src/core/thread/network_data_leader_ftd.hpp b/src/core/thread/network_data_leader_ftd.hpp
index e51ef743d..97c2a07e5 100644
--- a/src/core/thread/network_data_leader_ftd.hpp
+++ b/src/core/thread/network_data_leader_ftd.hpp
@@ -34,7 +34,7 @@
#ifndef NETWORK_DATA_LEADER_FTD_HPP_
#define NETWORK_DATA_LEADER_FTD_HPP_
-#include
+#include "utils/wrap_stdint.h"
#include
#include
diff --git a/src/core/thread/network_data_leader_mtd.hpp b/src/core/thread/network_data_leader_mtd.hpp
index 6eec4594f..33569ee4d 100644
--- a/src/core/thread/network_data_leader_mtd.hpp
+++ b/src/core/thread/network_data_leader_mtd.hpp
@@ -34,7 +34,7 @@
#ifndef NETWORK_DATA_LEADER_MTD_HPP_
#define NETWORK_DATA_LEADER_MTD_HPP_
-#include
+#include "utils/wrap_stdint.h"
namespace Thread {
diff --git a/src/core/thread/network_data_tlvs.hpp b/src/core/thread/network_data_tlvs.hpp
index 3c449adb1..663c40395 100644
--- a/src/core/thread/network_data_tlvs.hpp
+++ b/src/core/thread/network_data_tlvs.hpp
@@ -34,7 +34,7 @@
#ifndef NETWORK_DATA_TLVS_HPP_
#define NETWORK_DATA_TLVS_HPP_
-#include
+#include "utils/wrap_string.h"
#include
#include
diff --git a/src/core/thread/network_diagnostic.cpp b/src/core/thread/network_diagnostic.cpp
index 3a30c2598..db436300c 100644
--- a/src/core/thread/network_diagnostic.cpp
+++ b/src/core/thread/network_diagnostic.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "network_diagnostic.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include "openthread/platform/random.h"
#include
diff --git a/src/core/thread/network_diagnostic_tlvs.hpp b/src/core/thread/network_diagnostic_tlvs.hpp
index 7b438b0e7..66d07a1e0 100644
--- a/src/core/thread/network_diagnostic_tlvs.hpp
+++ b/src/core/thread/network_diagnostic_tlvs.hpp
@@ -34,7 +34,7 @@
#ifndef NETWORK_DIAGNOSTIC_TLVS_HPP_
#define NETWORK_DIAGNOSTIC_TLVS_HPP_
-#include
+#include "utils/wrap_string.h"
#include "openthread/types.h"
diff --git a/src/core/thread/panid_query_server.cpp b/src/core/thread/panid_query_server.cpp
index 5c69c5dc1..658cf17b0 100644
--- a/src/core/thread/panid_query_server.cpp
+++ b/src/core/thread/panid_query_server.cpp
@@ -31,6 +31,12 @@
* This file implements the PAN ID Query Server.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#define WPP_NAME "panid_query_server.tmh"
#include "openthread/platform/random.h"
diff --git a/src/core/thread/src_match_controller.cpp b/src/core/thread/src_match_controller.cpp
index 7446b112d..b32d79e74 100644
--- a/src/core/thread/src_match_controller.cpp
+++ b/src/core/thread/src_match_controller.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "src_match_controller.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/thread/thread_netif.cpp b/src/core/thread/thread_netif.cpp
index 0af877d79..335d58095 100644
--- a/src/core/thread/thread_netif.cpp
+++ b/src/core/thread/thread_netif.cpp
@@ -32,6 +32,12 @@
* This file implements the Thread network interface.
*/
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/thread/topology.cpp b/src/core/thread/topology.cpp
index 25eca19ea..6a966eb3f 100644
--- a/src/core/thread/topology.cpp
+++ b/src/core/thread/topology.cpp
@@ -33,6 +33,12 @@
#define WPP_NAME "topology.tmh"
+#ifdef OPENTHREAD_CONFIG_FILE
+#include OPENTHREAD_CONFIG_FILE
+#else
+#include
+#endif
+
#include
#include
#include
diff --git a/src/core/utils/jam_detector.hpp b/src/core/utils/jam_detector.hpp
index 66e39bf1c..71d080047 100644
--- a/src/core/utils/jam_detector.hpp
+++ b/src/core/utils/jam_detector.hpp
@@ -40,10 +40,9 @@
#include
#endif
-#include
+#include "utils/wrap_stdint.h"
#include
-
namespace Thread {
class ThreadNetif;
diff --git a/src/missing/strlcat/strlcat.c b/src/core/utils/missing_strlcat.c
similarity index 94%
rename from src/missing/strlcat/strlcat.c
rename to src/core/utils/missing_strlcat.c
index 44029c66d..c28997d5c 100644
--- a/src/missing/strlcat/strlcat.c
+++ b/src/core/utils/missing_strlcat.c
@@ -25,10 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "strlcat.h"
-#include "../strlcpy/strlcpy.h"
+#include "utils/wrap_string.h"
-size_t strlcat(char *dest, const char *src, size_t size)
+size_t missing_strlcat(char *dest, const char *src, size_t size)
{
size_t len = strlen(dest);
@@ -39,4 +38,3 @@ size_t strlcat(char *dest, const char *src, size_t size)
return len + strlen(src);
}
-
diff --git a/src/missing/strlcpy/strlcpy.c b/src/core/utils/missing_strlcpy.c
similarity index 95%
rename from src/missing/strlcpy/strlcpy.c
rename to src/core/utils/missing_strlcpy.c
index aaac96eb0..a0a2373e8 100644
--- a/src/missing/strlcpy/strlcpy.c
+++ b/src/core/utils/missing_strlcpy.c
@@ -25,9 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "strlcpy.h"
+#include "utils/wrap_string.h"
-size_t strlcpy(char *dest, const char *src, size_t size)
+size_t missing_strlcpy(char *dest, const char *src, size_t size)
{
const size_t slen = strlen(src);
@@ -50,4 +50,3 @@ size_t strlcpy(char *dest, const char *src, size_t size)
return slen;
}
-
diff --git a/src/missing/strlcat/strlcat.h b/src/core/utils/missing_strnlen.c
similarity index 82%
rename from src/missing/strlcat/strlcat.h
rename to src/core/utils/missing_strnlen.c
index d549c37e2..7245e14c5 100644
--- a/src/missing/strlcat/strlcat.h
+++ b/src/core/utils/missing_strnlen.c
@@ -25,25 +25,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MISSING_STRLCAT_HEADER_INCLUDED
-#define MISSING_STRLCAT_HEADER_INCLUDED 1
+#include "utils/wrap_string.h"
-#include
+size_t missing_strnlen(const char *s, size_t maxlen)
+{
+ size_t ret;
-#ifdef strlcat
-#undef strlcat
-#endif
+ for (ret = 0; (ret < maxlen) && (s[ret] != 0); ret++)
+ {
+ // Empty loop.
+ }
-#define strlcat ___missing_strlcat
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-size_t strlcat(char *dest, const char *src, size_t size);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // MISSING_STRLCPY_HEADER_INCLUDED
+ return ret;
+}
diff --git a/src/core/utils/slaac_address.cpp b/src/core/utils/slaac_address.cpp
index 96e521d81..aac408d44 100644
--- a/src/core/utils/slaac_address.cpp
+++ b/src/core/utils/slaac_address.cpp
@@ -46,7 +46,7 @@
#include
#include
-#include