Icmp6 cleanup.

This commit is contained in:
Jonathan Hui
2017-03-02 10:24:55 -08:00
parent a6dac9270c
commit b490f2ef3e
13 changed files with 82 additions and 30 deletions
+1
View File
@@ -58,6 +58,7 @@
<ClCompile Include="..\..\src\core\api\commissioner_api.cpp" />
<ClCompile Include="..\..\src\core\api\dataset_api.cpp" />
<ClCompile Include="..\..\src\core\api\dhcp6_api.cpp" />
<ClCompile Include="..\..\src\core\api\icmp6_api.cpp" />
<ClCompile Include="..\..\src\core\api\ip6_api.cpp" />
<ClCompile Include="..\..\src\core\api\instance_api.cpp" />
<ClCompile Include="..\..\src\core\api\joiner_api.cpp" />
@@ -69,6 +69,9 @@
<ClCompile Include="..\..\src\core\api\dhcp6_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\api\icmp6_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\api\ip6_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
@@ -67,6 +67,7 @@
<ClCompile Include="..\..\src\core\api\commissioner_api.cpp" />
<ClCompile Include="..\..\src\core\api\dataset_api.cpp" />
<ClCompile Include="..\..\src\core\api\dhcp6_api.cpp" />
<ClCompile Include="..\..\src\core\api\icmp6_api.cpp" />
<ClCompile Include="..\..\src\core\api\ip6_api.cpp" />
<ClCompile Include="..\..\src\core\api\instance_api.cpp" />
<ClCompile Include="..\..\src\core\api\joiner_api.cpp" />
@@ -69,6 +69,9 @@
<ClCompile Include="..\..\src\core\api\dhcp6_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\api\icmp6_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\api\ip6_api.cpp">
<Filter>Source Files\api</Filter>
</ClCompile>
+1 -1
View File
@@ -62,7 +62,7 @@ RtlCopyBufferToMdl(
#include <openthread-windows-config.h>
#include <openthread-core-config.h>
#include <openthread/openthread.h>
#include <openthread-icmp6.h>
#include <openthread/icmp6.h>
#include <openthread/ip6.h>
#include <openthread/tasklet.h>
#include <openthread/commissioner.h>
-4
View File
@@ -46,10 +46,6 @@ PRETTY_SUBDIRS = \
openthread \
$(NULL)
include_HEADERS = \
openthread-icmp6.h \
$(NULL)
install-headers: install-includeHEADERS
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
+1
View File
@@ -55,6 +55,7 @@ openthread_headers = \
diag.h \
dhcp6_client.h \
dhcp6_server.h \
icmp6.h \
instance.h \
ip6.h \
jam_detection.h \
+1 -1
View File
@@ -52,7 +52,7 @@
#ifndef OTDLL
#include <openthread-instance.h>
#include "openthread/diag.h"
#include <openthread-icmp6.h>
#include "openthread/icmp6.h"
#include <common/new.hpp>
#include <net/ip6.hpp>
+1
View File
@@ -42,6 +42,7 @@ SOURCES_COMMON = \
openthread.cpp \
api/crypto_api.cpp \
api/dataset_api.cpp \
api/icmp6_api.cpp \
api/instance_api.cpp \
api/ip6_api.cpp \
api/link_api.cpp \
+69
View File
@@ -0,0 +1,69 @@
/*
* 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 UDP API.
*/
#include "openthread/icmp6.h"
#include "openthread-instance.h"
using namespace Thread;
#ifdef __cplusplus
extern "C" {
#endif
bool otIcmp6IsEchoEnabled(otInstance *aInstance)
{
return aInstance->mIp6.mIcmp.IsEchoEnabled();
}
void otIcmp6SetEchoEnabled(otInstance *aInstance, bool aEnabled)
{
aInstance->mIp6.mIcmp.SetEchoEnabled(aEnabled);
}
ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandler)
{
return aInstance->mIp6.mIcmp.RegisterHandler(*static_cast<Ip6::IcmpHandler *>(aHandler));
}
ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage aMessage,
const otMessageInfo *aMessageInfo, uint16_t aIdentifier)
{
return aInstance->mIp6.mIcmp.SendEchoRequest(*static_cast<Message *>(aMessage),
*static_cast<const Ip6::MessageInfo *>(aMessageInfo),
aIdentifier);
}
#ifdef __cplusplus
} // extern "C"
#endif
-23
View File
@@ -66,29 +66,6 @@ using namespace Thread;
extern "C" {
#endif
bool otIcmp6IsEchoEnabled(otInstance *aInstance)
{
return aInstance->mIp6.mIcmp.IsEchoEnabled();
}
void otIcmp6SetEchoEnabled(otInstance *aInstance, bool aEnabled)
{
aInstance->mIp6.mIcmp.SetEchoEnabled(aEnabled);
}
ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandler)
{
return aInstance->mIp6.mIcmp.RegisterHandler(*static_cast<Ip6::IcmpHandler *>(aHandler));
}
ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage aMessage,
const otMessageInfo *aMessageInfo, uint16_t aIdentifier)
{
return aInstance->mIp6.mIcmp.SendEchoRequest(*static_cast<Message *>(aMessage),
*static_cast<const Ip6::MessageInfo *>(aMessageInfo),
aIdentifier);
}
#ifdef __cplusplus
} // extern "C"
#endif
+1 -1
View File
@@ -41,6 +41,7 @@
#include "openthread/openthread.h"
#include "openthread/ncp.h"
#include "openthread/diag.h"
#include "openthread/icmp6.h"
#if OPENTHREAD_ENABLE_JAM_DETECTION
#include "openthread/jam_detection.h"
@@ -53,7 +54,6 @@
#include <common/debug.hpp>
#include <ncp/ncp_base.hpp>
#include <net/ip6.hpp>
#include <openthread-icmp6.h>
#include <openthread-instance.h>
#include <stdarg.h>