mirror of
https://github.com/espressif/openthread.git
synced 2026-09-16 14:10:09 +00:00
Fix dhcp6 windows build. (#987)
This commit is contained in:
@@ -92,9 +92,8 @@
|
||||
<ClCompile Include="..\..\src\core\meshcop\joiner_router.cpp" />
|
||||
<ClCompile Include="..\..\src\core\meshcop\leader.cpp" />
|
||||
<ClCompile Include="..\..\src\core\meshcop\panid_query_client.cpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6.cpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_client.cpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_server.cpp" />
|
||||
<ClCompile Include="..\..\src\core\net\dhcp6_client.cpp" />
|
||||
<ClCompile Include="..\..\src\core\net\dhcp6_server.cpp" />
|
||||
<ClCompile Include="..\..\src\core\net\icmp6.cpp" />
|
||||
<ClCompile Include="..\..\src\core\net\ip6.cpp" />
|
||||
<ClCompile Include="..\..\src\core\net\ip6_address.cpp" />
|
||||
|
||||
@@ -102,6 +102,12 @@
|
||||
<ClCompile Include="..\..\src\core\mac\mac_whitelist.cpp">
|
||||
<Filter>Source Files\mac</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\net\dhcp6_client.cpp">
|
||||
<Filter>Source Files\net</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\net\dhcp6_server.cpp">
|
||||
<Filter>Source Files\net</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\net\icmp6.cpp">
|
||||
<Filter>Source Files\net</Filter>
|
||||
</ClCompile>
|
||||
@@ -302,6 +308,15 @@
|
||||
<ClInclude Include="..\..\src\core\mac\mac_whitelist.hpp">
|
||||
<Filter>Header Files\mac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6.hpp">
|
||||
<Filter>Header Files\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_client.hpp">
|
||||
<Filter>Header Files\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_server.hpp">
|
||||
<Filter>Header Files\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\core\net\icmp6.hpp">
|
||||
<Filter>Header Files\net</Filter>
|
||||
</ClInclude>
|
||||
@@ -470,11 +485,5 @@
|
||||
<ClInclude Include="..\..\src\core\openthread-instance.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6.cpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_client.cpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_server.cpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6.hpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_client.hpp" />
|
||||
<ClInclude Include="..\..\src\core\net\dhcp6_server.hpp" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -31,6 +31,8 @@
|
||||
* This file implements DHCPv6 Client.
|
||||
*/
|
||||
|
||||
#define WPP_NAME "dhcp6_client.tmh"
|
||||
|
||||
#include <openthread-types.h>
|
||||
#include <common/code_utils.hpp>
|
||||
#include <common/encoding.hpp>
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
* @file
|
||||
* This file implements DHCPv6 Server.
|
||||
*/
|
||||
|
||||
#define WPP_NAME "dhcp6_server.tmh"
|
||||
|
||||
#include <openthread-types.h>
|
||||
#include <common/code_utils.hpp>
|
||||
#include <common/encoding.hpp>
|
||||
@@ -116,6 +119,8 @@ ThreadError Dhcp6Server::UpdateService()
|
||||
|
||||
while (mNetworkDataLeader.GetNextOnMeshPrefix(&iterator, rloc16, &config) == kThreadError_None)
|
||||
{
|
||||
found = false;
|
||||
|
||||
if (!config.mDhcp)
|
||||
{
|
||||
continue;
|
||||
@@ -125,7 +130,6 @@ ThreadError Dhcp6Server::UpdateService()
|
||||
|
||||
for (i = 0; i < OPENTHREAD_CONFIG_NUM_DHCP_PREFIXES; i++)
|
||||
{
|
||||
found = false;
|
||||
address = &(mAgentsAloc[i].GetAddress());
|
||||
|
||||
if ((mAgentsAloc[i].mValidLifetime != 0) && (address->mFields.m8[15] == lowpanContext.mContextId))
|
||||
@@ -485,8 +489,8 @@ ThreadError Dhcp6Server::AppendIaNa(Message &aMessage, IaNa &aIaNa)
|
||||
length += sizeof(IaNa) + sizeof(StatusCode) - sizeof(Dhcp6Option);
|
||||
|
||||
aIaNa.SetLength(length);
|
||||
aIaNa.SetT1(kDefaultIaNaT1);
|
||||
aIaNa.SetT2(kDefaultIaNaT2);
|
||||
aIaNa.SetT1(OT_DHCP6_DEFAULT_IA_NA_T1);
|
||||
aIaNa.SetT2(OT_DHCP6_DEFAULT_IA_NA_T2);
|
||||
SuccessOrExit(error = aMessage.Append(&aIaNa, sizeof(IaNa)));
|
||||
|
||||
exit:
|
||||
@@ -546,8 +550,8 @@ ThreadError Dhcp6Server::AddIaAddress(Message &aMessage, otIp6Prefix &aIp6Prefix
|
||||
option.Init();
|
||||
memcpy((option.GetAddress()->mFields.m8), &(aIp6Prefix.mPrefix), 8);
|
||||
memcpy(&(option.GetAddress()->mFields.m8[8]), aClient.GetDuidLinkLayerAddress(), sizeof(Mac::ExtAddress));
|
||||
option.SetPreferredLifetime(kDefaultIaAddressPreferredLifetime);
|
||||
option.SetValidLifetime(kDefaultIaAddressValidLifetime);
|
||||
option.SetPreferredLifetime(OT_DHCP6_DEFAULT_PREFERRED_LIFETIME);
|
||||
option.SetValidLifetime(OT_DHCP6_DEFAULT_VALID_LIFETIME);
|
||||
SuccessOrExit(error = aMessage.Append(&option, sizeof(option)));
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -63,13 +63,10 @@ namespace Dhcp6 {
|
||||
* DHCPv6 default constant
|
||||
*
|
||||
*/
|
||||
enum
|
||||
{
|
||||
kDefaultIaNaT1 = 0xffffffff,
|
||||
kDefaultIaNaT2 = 0xffffffff,
|
||||
kDefaultIaAddressPreferredLifetime = 0xffffffff,
|
||||
kDefaultIaAddressValidLifetime = 0xffffffff,
|
||||
};
|
||||
#define OT_DHCP6_DEFAULT_IA_NA_T1 0xffffffffU
|
||||
#define OT_DHCP6_DEFAULT_IA_NA_T2 0xffffffffU
|
||||
#define OT_DHCP6_DEFAULT_PREFERRED_LIFETIME 0xffffffffU
|
||||
#define OT_DHCP6_DEFAULT_VALID_LIFETIME 0xffffffffU
|
||||
|
||||
/**
|
||||
* This class implements prefix agent.
|
||||
|
||||
Reference in New Issue
Block a user