diff --git a/Android.mk b/Android.mk
index a83f6a862..f5e3baf2b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -91,7 +91,6 @@ LOCAL_SRC_FILES := \
src/core/api/crypto_api.cpp \
src/core/api/dataset_api.cpp \
src/core/api/dataset_ftd_api.cpp \
- src/core/api/dhcp6_api.cpp \
src/core/api/dns_api.cpp \
src/core/api/icmp6_api.cpp \
src/core/api/instance_api.cpp \
diff --git a/etc/visual-studio/libopenthread.vcxproj b/etc/visual-studio/libopenthread.vcxproj
index 03c08a266..3e1363b62 100644
--- a/etc/visual-studio/libopenthread.vcxproj
+++ b/etc/visual-studio/libopenthread.vcxproj
@@ -60,7 +60,6 @@
-
diff --git a/etc/visual-studio/libopenthread.vcxproj.filters b/etc/visual-studio/libopenthread.vcxproj.filters
index 85352d9f6..3540772b7 100644
--- a/etc/visual-studio/libopenthread.vcxproj.filters
+++ b/etc/visual-studio/libopenthread.vcxproj.filters
@@ -81,9 +81,6 @@
Source Files\api
-
- Source Files\api
-
Source Files\api
diff --git a/etc/visual-studio/libopenthread_k.vcxproj b/etc/visual-studio/libopenthread_k.vcxproj
index 3581df3a0..a8a018ba7 100644
--- a/etc/visual-studio/libopenthread_k.vcxproj
+++ b/etc/visual-studio/libopenthread_k.vcxproj
@@ -71,7 +71,6 @@
-
@@ -175,8 +174,6 @@
-
-
diff --git a/etc/visual-studio/libopenthread_k.vcxproj.filters b/etc/visual-studio/libopenthread_k.vcxproj.filters
index 442501cb6..cc8afe2bd 100644
--- a/etc/visual-studio/libopenthread_k.vcxproj.filters
+++ b/etc/visual-studio/libopenthread_k.vcxproj.filters
@@ -84,9 +84,6 @@
Source Files\api
-
- Source Files\api
-
Source Files\api
@@ -333,7 +330,7 @@
Source Files\crypto
-
+
Source Files\utils
@@ -656,12 +653,6 @@
Header Files\openthread
-
- Header Files\openthread
-
-
- Header Files\openthread
-
Header Files\openthread
diff --git a/examples/drivers/windows/otLwf/precomp.h b/examples/drivers/windows/otLwf/precomp.h
index d7b879803..c85e4a2c1 100644
--- a/examples/drivers/windows/otLwf/precomp.h
+++ b/examples/drivers/windows/otLwf/precomp.h
@@ -69,7 +69,6 @@ RtlCopyBufferToMdl(
#include
#include
#include
-#include
#include
#include
#include
diff --git a/examples/drivers/windows/otLwf/thread.c b/examples/drivers/windows/otLwf/thread.c
index 0415157f5..adc95cb6c 100644
--- a/examples/drivers/windows/otLwf/thread.c
+++ b/examples/drivers/windows/otLwf/thread.c
@@ -543,10 +543,6 @@ void otLwfStateChangedCallback(uint32_t aFlags, _In_ void *aContext)
{
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_NETDATA", pFilter);
otIp6SlaacUpdate(pFilter->otCtx, pFilter->otAutoAddresses, ARRAYSIZE(pFilter->otAutoAddresses), otIp6CreateRandomIid, NULL);
-
-#if OPENTHREAD_ENABLE_DHCP6_SERVER
- otDhcp6ServerUpdate(pFilter->otCtx);
-#endif // OPENTHREAD_ENABLE_DHCP6_SERVER
}
if ((aFlags & OT_CHANGED_THREAD_ML_ADDR) != 0)
diff --git a/include/openthread/Makefile.am b/include/openthread/Makefile.am
index 05ff28d0f..40288791a 100644
--- a/include/openthread/Makefile.am
+++ b/include/openthread/Makefile.am
@@ -61,7 +61,6 @@ openthread_headers = \
dataset.h \
dataset_ftd.h \
diag.h \
- dhcp6_server.h \
dns.h \
error.h \
icmp6.h \
diff --git a/include/openthread/dhcp6_server.h b/include/openthread/dhcp6_server.h
deleted file mode 100644
index 074b062ce..000000000
--- a/include/openthread/dhcp6_server.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2016, The OpenThread Authors.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holder nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @file
- * @brief
- * This file includes the platform abstraction for the Thread DHCPv6 server.
- */
-
-#ifndef OPENTHREAD_DHCP6_SERVER_H_
-#define OPENTHREAD_DHCP6_SERVER_H_
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup api-dhcp6
- *
- * @{
- *
- */
-
-/**
- * Updates DHCP Agents and DHCP Alocs.
- *
- * @param[in] aInstance A pointer to an OpenThread instance.
- *
- */
-void otDhcp6ServerUpdate(otInstance *aInstance);
-
-/**
- * @}
- *
- */
-
-#ifdef __cplusplus
-} // end of extern "C"
-#endif
-
-#endif // OPENTHREAD_DHCP6_SERVER_H_
diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp
index a69004849..ee5904a03 100644
--- a/src/cli/cli.cpp
+++ b/src/cli/cli.cpp
@@ -64,7 +64,6 @@
#endif
#ifndef OTDLL
-#include
#include
#include
#include
@@ -3821,10 +3820,6 @@ void Interpreter::HandleNetifStateChanged(otChangedFlags aFlags)
#ifndef OTDLL
otIp6SlaacUpdate(mInstance, mSlaacAddresses, OT_ARRAY_LENGTH(mSlaacAddresses), otIp6CreateRandomIid, NULL);
-#if OPENTHREAD_ENABLE_DHCP6_SERVER
- otDhcp6ServerUpdate(mInstance);
-#endif // OPENTHREAD_ENABLE_DHCP6_SERVER
-
#endif
exit:
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index 9115ec49e..edf2d82e3 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -112,7 +112,6 @@ SOURCES_COMMON = \
api/crypto_api.cpp \
api/dataset_api.cpp \
api/dataset_ftd_api.cpp \
- api/dhcp6_api.cpp \
api/dns_api.cpp \
api/icmp6_api.cpp \
api/instance_api.cpp \
diff --git a/src/core/api/dhcp6_api.cpp b/src/core/api/dhcp6_api.cpp
deleted file mode 100644
index a7c01672d..000000000
--- a/src/core/api/dhcp6_api.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2016, The OpenThread Authors.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holder nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @file
- * This file implements the OpenThread DHCPv6 API.
- */
-
-#include "openthread-core-config.h"
-
-#include
-
-#include "common/instance.hpp"
-
-using namespace ot;
-
-#if OPENTHREAD_ENABLE_DHCP6_SERVER
-void otDhcp6ServerUpdate(otInstance *aInstance)
-{
- Instance &instance = *static_cast(aInstance);
-
- instance.GetThreadNetif().GetDhcp6Server().UpdateService();
-}
-#endif
diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp
index dde99b6ad..b1244c23b 100644
--- a/src/core/thread/mle.cpp
+++ b/src/core/thread/mle.cpp
@@ -1510,6 +1510,10 @@ void Mle::HandleStateChanged(otChangedFlags aFlags)
#endif
#endif
+#if OPENTHREAD_ENABLE_DHCP6_SERVER
+ GetNetif().GetDhcp6Server().UpdateService();
+#endif // OPENTHREAD_ENABLE_DHCP6_SERVER
+
#if OPENTHREAD_ENABLE_DHCP6_CLIENT
GetNetif().GetDhcp6Client().UpdateAddresses();
#endif // OPENTHREAD_ENABLE_DHCP6_CLIENT
diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp
index b42268de2..a53d19bab 100644
--- a/src/ncp/ncp_base_mtd.cpp
+++ b/src/ncp/ncp_base_mtd.cpp
@@ -43,9 +43,6 @@
#if OPENTHREAD_ENABLE_CHILD_SUPERVISION
#include
#endif
-#if OPENTHREAD_ENABLE_DHCP6_SERVER
-#include
-#endif
#include
#include
#if OPENTHREAD_ENABLE_JAM_DETECTION
@@ -3428,10 +3425,6 @@ void NcpBase::ProcessThreadChangedFlags(void)
{
mChangedPropsSet.AddProperty(SPINEL_PROP_THREAD_ON_MESH_NETS);
mChangedPropsSet.AddProperty(SPINEL_PROP_THREAD_OFF_MESH_ROUTES);
-
-#if OPENTHREAD_ENABLE_DHCP6_SERVER
- otDhcp6ServerUpdate(mInstance);
-#endif
}
mThreadChangedFlags &= ~threadFlag;