From 8cced06a2dff66300a46e2962cd462f58096b15c Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 3 Nov 2016 10:04:50 -0700 Subject: upgraded vcxprojs to VS2015. got the tap driver building. --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index ed022134..93da4b1b 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -184,26 +184,26 @@ Application true - v110 + v140 MultiByte Application true - v110 + v140 MultiByte Application false - v110 + v140 true MultiByte Application false - v110 + v140 true MultiByte -- cgit v1.2.3 From 8ffae313fd5042bb4330afd98019e4ee907714cb Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 3 Nov 2016 12:10:50 -0700 Subject: add new files & remove old ones from VS project. Now builds & runs on Windows again --- .gitignore | 2 +- controller/EmbeddedNetworkController.cpp | 3 +++ node/Membership.cpp | 28 ++++++++++++++++--------- node/Multicaster.cpp | 2 +- one.cpp | 6 +----- windows/ZeroTierOne.sln | 12 +++++++++-- windows/ZeroTierOne/ZeroTierOne.vcxproj | 11 ++++++++-- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 27 ++++++++++++++++-------- 8 files changed, 61 insertions(+), 30 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/.gitignore b/.gitignore index b01abc35..d3ef1581 100755 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ Thumbs.db /windows/TapDriver6/win7Release /windows/*.db /windows/*.opendb - +enc_temp_folder # *nix/Mac build droppings /build-* diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index d9ec76de..8f5cefd1 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -21,7 +21,10 @@ #include #include #include + +#ifndef _WIN32 #include +#endif #include #include diff --git a/node/Membership.cpp b/node/Membership.cpp index c8fb8e4e..d7c7c0e6 100644 --- a/node/Membership.cpp +++ b/node/Membership.cpp @@ -232,7 +232,7 @@ Membership::AddCredentialResult Membership::addCredential(const RuntimeEnvironme Membership::_RemoteTag *Membership::_newTag(const uint64_t id) { - _RemoteTag *t; + _RemoteTag *t = NULL; uint64_t minlr = 0xffffffffffffffffULL; for(unsigned int i=0;iid == ZT_MEMBERSHIP_CRED_ID_UNUSED) { @@ -243,17 +243,21 @@ Membership::_RemoteTag *Membership::_newTag(const uint64_t id) minlr = _remoteTags[i]->lastReceived; } } - t->id = id; - t->lastReceived = 0; - t->revocationThreshold = 0; - t->tag = Tag(); + + if (t) { + t->id = id; + t->lastReceived = 0; + t->revocationThreshold = 0; + t->tag = Tag(); + } + std::sort(&(_remoteTags[0]),&(_remoteTags[ZT_MAX_NETWORK_TAGS]),_RemoteCredentialSorter<_RemoteTag>()); return t; } Membership::_RemoteCapability *Membership::_newCapability(const uint64_t id) { - _RemoteCapability *c; + _RemoteCapability *c = NULL; uint64_t minlr = 0xffffffffffffffffULL; for(unsigned int i=0;iid == ZT_MEMBERSHIP_CRED_ID_UNUSED) { @@ -264,10 +268,14 @@ Membership::_RemoteCapability *Membership::_newCapability(const uint64_t id) minlr = _remoteCaps[i]->lastReceived; } } - c->id = id; - c->lastReceived = 0; - c->revocationThreshold = 0; - c->cap = Capability(); + + if (c) { + c->id = id; + c->lastReceived = 0; + c->revocationThreshold = 0; + c->cap = Capability(); + } + std::sort(&(_remoteCaps[0]),&(_remoteCaps[ZT_MAX_NETWORK_CAPABILITIES]),_RemoteCredentialSorter<_RemoteCapability>()); return c; } diff --git a/node/Multicaster.cpp b/node/Multicaster.cpp index 8743e8f8..17649c7b 100644 --- a/node/Multicaster.cpp +++ b/node/Multicaster.cpp @@ -343,7 +343,7 @@ void Multicaster::clean(uint64_t now) { Mutex::Lock _l(_gatherAuth_m); _GatherAuthKey *k = (_GatherAuthKey *)0; - uint64_t *ts = (uint64_t *)ts; + uint64_t *ts = NULL; Hashtable<_GatherAuthKey,uint64_t>::Iterator i(_gatherAuth); while (i.next(k,ts)) { if ((now - *ts) >= ZT_MULTICAST_CREDENTIAL_EXPIRATON) diff --git a/one.cpp b/one.cpp index 79e8caf8..55cc2e19 100644 --- a/one.cpp +++ b/one.cpp @@ -402,7 +402,7 @@ static int cli(int argc,char **argv) auto &addr = assignedAddresses[j]; if (addr.is_string()) { if (aa.length() > 0) aa.push_back(','); - aa.append(addr); + aa.append(addr.get()); } } } @@ -1194,9 +1194,5 @@ int main(int argc,char **argv) delete zt1Service; zt1Service = (OneService *)0; -#ifdef __UNIX_LIKE__ - OSUtils::rm(pidPath.c_str()); -#endif - return returnValue; } diff --git a/windows/ZeroTierOne.sln b/windows/ZeroTierOne.sln index 68596187..e9a1dfd2 100644 --- a/windows/ZeroTierOne.sln +++ b/windows/ZeroTierOne.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZeroTierOne", "ZeroTierOne\ZeroTierOne.vcxproj", "{B00A4957-5977-4AC1-9EF4-571DC27EADA2}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TapDriver6", "TapDriver6\TapDriver6.vcxproj", "{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}" @@ -157,7 +159,8 @@ Global {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|Win32.ActiveCfg = Debug|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|Win32.Build.0 = Debug|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|Win32.Deploy.0 = Debug|Win32 - {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|x64.ActiveCfg = Debug|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|x64.ActiveCfg = Debug|x64 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|x64.Build.0 = Debug|x64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|x86.ActiveCfg = Debug|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|x86.Build.0 = Debug|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|x86.Deploy.0 = Debug|Win32 @@ -169,6 +172,7 @@ Global {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|Win32.Build.0 = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|Win32.Deploy.0 = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|x64.ActiveCfg = Release|x64 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|x64.Build.0 = Release|x64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|x86.ActiveCfg = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|x86.Build.0 = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|x86.Deploy.0 = Release|Win32 @@ -392,14 +396,18 @@ Global {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|Mixed Platforms.Build.0 = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|Win32.ActiveCfg = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|x64.ActiveCfg = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|x64.Build.0 = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|x86.ActiveCfg = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|x86.Build.0 = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|Any CPU.ActiveCfg = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|Any CPU.Build.0 = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|Mixed Platforms.ActiveCfg = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|Mixed Platforms.Build.0 = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|Win32.ActiveCfg = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|x64.ActiveCfg = Release|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|x64.Build.0 = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|x86.ActiveCfg = Release|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Release|x86.Build.0 = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Debug|Any CPU.ActiveCfg = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Debug|Any CPU.Build.0 = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 93da4b1b..b4bf308c 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -19,8 +19,8 @@ + - @@ -39,12 +39,13 @@ + - + @@ -54,10 +55,12 @@ + + @@ -251,6 +254,7 @@ NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) + 4996 true @@ -267,6 +271,7 @@ NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) false + 4996 true @@ -290,6 +295,7 @@ AnySuitable Speed true + 4996 true @@ -315,6 +321,7 @@ AnySuitable Speed true + 4996 true diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index eeeb8d2f..337b8cbb 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -55,9 +55,6 @@ {f8a1c208-15b8-4d85-a4cb-11d2b82f2d1e} - - {da28e961-1761-41d8-9a59-65b00dfb1302} - {43f75f84-c70d-4d44-a0ef-28a7a399abd4} @@ -91,6 +88,9 @@ {409ec37e-ff36-4c13-b18d-52d6052e0ca2} + + {3cad34c8-c436-43ae-8323-57803637c832} + @@ -171,9 +171,6 @@ Source Files\ext\http-parser - - Source Files\ext\json-parser - Source Files @@ -192,9 +189,6 @@ Source Files\node - - Source Files\node - Source Files\node @@ -252,6 +246,21 @@ Source Files\osdep + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\controller + -- cgit v1.2.3 From a7718bae398c8e910142568d7116c8adedce9d71 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 3 Nov 2016 12:25:09 -0700 Subject: link in notelemetry.obj even though Microsoft said CRT telemetry would be disabled in VS2015 Update 3. Just in case. --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 1 + 1 file changed, 1 insertion(+) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index b4bf308c..e5ea25bf 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -277,6 +277,7 @@ true wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) false + "notelemetry.obj" %(AdditionalOptions) -- cgit v1.2.3 From dc549b7f3c4852ed59c25af7b4d9a9fe494f4e7f Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 16 Nov 2016 14:50:03 -0800 Subject: add JSONDB.cpp --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 3 ++- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index e5ea25bf..d19eee6c 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -20,6 +20,7 @@ + @@ -269,7 +270,7 @@ true - NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) + NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) false 4996 diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 337b8cbb..1fa39abd 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -261,6 +261,9 @@ Source Files\controller + + Source Files\controller + -- cgit v1.2.3 From af5a3376f3b02cdc164a1e0d59073a5578779533 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 11 Jan 2017 16:56:16 -0800 Subject: Should fix Windows build. --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index d19eee6c..fc259ebf 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -75,6 +75,7 @@ + @@ -169,8 +170,8 @@ - + -- cgit v1.2.3 From 1346e31a8ee962c40b1f18cb8ff1d5fe866744e3 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 13 Jan 2017 14:22:36 -0800 Subject: Windows build fixes, Software update fix, warning removal. --- node/Multicaster.hpp | 2 +- one.cpp | 4 ++-- service/SoftwareUpdater.cpp | 8 ++++---- windows/ZeroTierOne/ZeroTierOne.vcxproj | 8 ++++---- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 9 ++++++--- 5 files changed, 17 insertions(+), 14 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/node/Multicaster.hpp b/node/Multicaster.hpp index 5c94cd3a..32dec9cf 100644 --- a/node/Multicaster.hpp +++ b/node/Multicaster.hpp @@ -220,7 +220,7 @@ private: { _GatherAuthKey() : member(0),networkId(0) {} _GatherAuthKey(const uint64_t nwid,const Address &a) : member(a.toInt()),networkId(nwid) {} - inline unsigned long hashCode() const { return (member ^ networkId); } + inline unsigned long hashCode() const { return (unsigned long)(member ^ networkId); } inline bool operator==(const _GatherAuthKey &k) const { return ((member == k.member)&&(networkId == k.networkId)); } uint64_t member; uint64_t networkId; diff --git a/one.cpp b/one.cpp index 1cda3fb1..3ebaa8fa 100644 --- a/one.cpp +++ b/one.cpp @@ -495,7 +495,7 @@ static int cli(int argc,char **argv) (std::string("/network/") + arg1).c_str(), requestHeaders, jsons, - strlen(jsons), + (unsigned long)strlen(jsons), responseHeaders, responseBody); if (scode == 200) { @@ -572,7 +572,7 @@ static int idtool(int argc,char **argv) int vanityBits = 0; if (argc >= 5) { vanity = Utils::hexStrToU64(argv[4]) & 0xffffffffffULL; - vanityBits = 4 * strlen(argv[4]); + vanityBits = 4 * (int)strlen(argv[4]); if (vanityBits > 40) vanityBits = 40; } diff --git a/service/SoftwareUpdater.cpp b/service/SoftwareUpdater.cpp index 299c0d97..f6572cfc 100644 --- a/service/SoftwareUpdater.cpp +++ b/service/SoftwareUpdater.cpp @@ -21,6 +21,9 @@ #include #include +#include "../node/Constants.hpp" +#include "../version.h" + #ifdef __WINDOWS__ #include #include @@ -37,9 +40,6 @@ #include "SoftwareUpdater.hpp" -#include "../version.h" - -#include "../node/Constants.hpp" #include "../node/Utils.hpp" #include "../node/SHA512.hpp" #include "../node/Buffer.hpp" @@ -369,7 +369,7 @@ void SoftwareUpdater::apply() PROCESS_INFORMATION pi; memset(&si,0,sizeof(si)); memset(&pi,0,sizeof(pi)); - CreateProcessA(NULL,updatePath.c_str(),NULL,NULL,FALSE,CREATE_NO_WINDOW|CREATE_NEW_PROCESS_GROUP,NULL,NULL,&si,&pi); + CreateProcessA(NULL,const_cast(updatePath.c_str()),NULL,NULL,FALSE,CREATE_NO_WINDOW|CREATE_NEW_PROCESS_GROUP,NULL,NULL,&si,&pi); #else char *argv[256]; unsigned long ac = 0; diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index fc259ebf..2a6545eb 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -255,7 +255,7 @@ true - NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) + NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) 4996 @@ -271,7 +271,7 @@ true - NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) + NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) false 4996 @@ -291,7 +291,7 @@ true - STATICLIB;ZT_OFFICIAL_RELEASE;ZT_AUTO_UPDATE;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;%(PreprocessorDefinitions) + STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";%(PreprocessorDefinitions) MultiThreaded NoExtensions true @@ -317,7 +317,7 @@ true - STATICLIB;ZT_OFFICIAL_RELEASE;ZT_AUTO_UPDATE;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;%(PreprocessorDefinitions) + STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;%(PreprocessorDefinitions) MultiThreaded NotSet true diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 1fa39abd..8a426d4b 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -264,6 +264,9 @@ Source Files\controller + + Source Files\service + @@ -293,9 +296,6 @@ Header Files\service - - Header Files\service - Header Files\service @@ -554,6 +554,9 @@ Header Files\osdep + + Header Files\service + -- cgit v1.2.3 From 9a475eeff90a181af0661b87b09af7337e39167a Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 20 Jan 2017 12:00:18 -0800 Subject: Windows build fix, warning removal. --- node/Node.hpp | 6 ++ windows/ZeroTierOne/ZeroTierOne.vcxproj | 20 +----- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 81 ++----------------------- 3 files changed, 13 insertions(+), 94 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/node/Node.hpp b/node/Node.hpp index 64c9fcb4..d7b039b8 100644 --- a/node/Node.hpp +++ b/node/Node.hpp @@ -65,6 +65,12 @@ public: Node(void *uptr,const struct ZT_Node_Callbacks *callbacks,uint64_t now); virtual ~Node(); + // Get rid of alignment warnings on 32-bit Windows and possibly improve performance +#ifdef __WINDOWS__ + void * operator new(size_t i) { return _mm_malloc(i,16); } + void operator delete(void* p) { _mm_free(p); } +#endif + // Public API Functions ---------------------------------------------------- ZT_ResultCode processWirePacket( diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 2a6545eb..6a2ca520 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -25,7 +25,6 @@ - @@ -81,28 +80,11 @@ - - - - - - - - - - - - - - - - - + - diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 8a426d4b..ff3d4821 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -40,18 +40,9 @@ {17ae9a01-d39f-4c6d-a800-8f2cd0804c96} - - {736aad7f-8d95-4602-88df-3bb970869c6f} - - - {3636527c-bc03-4852-bd3c-20ee25e56d82} - {7784af31-5b60-4300-b07e-44cf864c54db} - - {29164186-10fc-45f5-b253-6d03f0ddd4db} - {f8a1c208-15b8-4d85-a4cb-11d2b82f2d1e} @@ -67,15 +58,6 @@ {bf604491-14c4-4a74-81a6-6105d07c5c7c} - - {5939db69-ab17-47c6-97fb-185e2c678737} - - - {3666f510-b6da-47cb-8039-56441f2dac3e} - - - {1a47071e-e51b-4535-89ae-858946f03118} - {5423fb64-896b-432e-a19d-88d4467f89f9} @@ -91,6 +73,9 @@ {3cad34c8-c436-43ae-8323-57803637c832} + + {ff20532b-d9a2-440d-a7b4-b49e26a9b2f8} + @@ -165,9 +150,6 @@ Source Files\node - - Source Files\ext\lz4 - Source Files\ext\http-parser @@ -404,12 +386,6 @@ Header Files\node - - Header Files\ext\lz4 - - - Header Files\ext\json-parser - Header Files\ext\http-parser @@ -425,54 +401,6 @@ Header Files\osdep - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - - - Header Files\ext\bin\miniupnpc\include - Header Files\node @@ -557,6 +485,9 @@ Header Files\service + + Header Files\ext\json + -- cgit v1.2.3 From e11f42a089c4d7685d7942785452b7f35f2102d5 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 26 Jan 2017 14:29:39 -0800 Subject: remove reference to BackgroundResolver.cpp/.hpp on Windows --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 2 -- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 6 ------ 2 files changed, 8 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 6a2ca520..7afdfb17 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -66,7 +66,6 @@ false - @@ -142,7 +141,6 @@ - diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index ff3d4821..da673f61 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -165,9 +165,6 @@ Source Files\windows\ZeroTierOne - - Source Files\osdep - Source Files\node @@ -398,9 +395,6 @@ Header Files\windows\ZeroTierOne - - Header Files\osdep - Header Files\node -- cgit v1.2.3 From fe19ad328cf247a9d1114d7692deb4a368a91bb7 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 23 Feb 2017 12:40:21 -0800 Subject: Windows build fix. --- service/ControlPlane.cpp | 4 ++-- windows/ZeroTierOne/ZeroTierOne.vcxproj | 2 ++ windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/service/ControlPlane.cpp b/service/ControlPlane.cpp index 8f59b0d2..9ba001ea 100644 --- a/service/ControlPlane.cpp +++ b/service/ControlPlane.cpp @@ -142,8 +142,8 @@ static void _moonToJson(nlohmann::json &mj,const World &world) Utils::snprintf(tmp,sizeof(tmp),"%.16llx",world.id()); mj["id"] = tmp; mj["timestamp"] = world.timestamp(); - mj["signature"] = Utils::hex(world.signature().data,world.signature().size()); - mj["updatesMustBeSignedBy"] = Utils::hex(world.updatesMustBeSignedBy().data,world.updatesMustBeSignedBy().size()); + mj["signature"] = Utils::hex(world.signature().data,(unsigned int)world.signature().size()); + mj["updatesMustBeSignedBy"] = Utils::hex(world.updatesMustBeSignedBy().data,(unsigned int)world.updatesMustBeSignedBy().size()); nlohmann::json ra = nlohmann::json::array(); for(std::vector::const_iterator r(world.roots().begin());r!=world.roots().end();++r) { nlohmann::json rj; diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 7afdfb17..d0b027fa 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -41,6 +41,7 @@ + @@ -109,6 +110,7 @@ + diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index da673f61..1b7b469d 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -246,6 +246,9 @@ Source Files\service + + Source Files\node + @@ -482,6 +485,9 @@ Header Files\ext\json + + Header Files\node + -- cgit v1.2.3 From a97918f81253c0dbb08766271c6ab6111120bf0d Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 7 Mar 2017 13:57:31 -0800 Subject: Windows build fixes. --- ext/installfiles/windows/ZeroTier One.aip | 43 ++++++++++++++++++++++--- node/Path.hpp | 2 +- windows/ZeroTierOne/ZeroTierOne.vcxproj | 2 -- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 6 ---- 4 files changed, 39 insertions(+), 14 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip index 3fb6d5c6..18cc0ab7 100644 --- a/ext/installfiles/windows/ZeroTier One.aip +++ b/ext/installfiles/windows/ZeroTier One.aip @@ -47,6 +47,7 @@ + @@ -69,20 +70,25 @@ + - + - + + + + + @@ -92,6 +98,12 @@ + + + + + + @@ -133,6 +145,10 @@ + + + + @@ -161,6 +177,7 @@ + @@ -200,12 +217,19 @@ + + + + + + + @@ -267,13 +291,19 @@ + + + + + + - + @@ -281,7 +311,7 @@ - + @@ -300,12 +330,15 @@ - + + + + diff --git a/node/Path.hpp b/node/Path.hpp index dd6455d1..62f29c22 100644 --- a/node/Path.hpp +++ b/node/Path.hpp @@ -156,7 +156,7 @@ public: const uint64_t fl = (_incomingLinkQualityFastLog = ((_incomingLinkQualityFastLog << 1) | (uint64_t)(prev == ((counter - 1) & 0x7)))); if (++_incomingLinkQualitySlowLogCounter >= 64) { _incomingLinkQualitySlowLogCounter = 0; - _incomingLinkQualitySlowLog[_incomingLinkQualitySlowLogPtr++ % sizeof(_incomingLinkQualitySlowLog)] = Utils::countBits(fl); + _incomingLinkQualitySlowLog[_incomingLinkQualitySlowLogPtr++ % sizeof(_incomingLinkQualitySlowLog)] = (uint8_t)Utils::countBits(fl); } } diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index d0b027fa..5092a655 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -72,7 +72,6 @@ - @@ -151,7 +150,6 @@ - diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 1b7b469d..ca1640e9 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -78,9 +78,6 @@ - - Source Files\service - Source Files\service @@ -275,9 +272,6 @@ Header Files\osdep - - Header Files\service - Header Files\service -- cgit v1.2.3 From 533baf921fcb6dee8268faa2f09f77baaf9f4ad0 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 14 Mar 2017 14:40:17 -0700 Subject: Software update cleanup, and a fix for updates on Windows. --- ext/installfiles/windows/ZeroTier One.aip | 13 ++++++---- one.cpp | 7 +++--- service/SoftwareUpdater.cpp | 42 +++---------------------------- service/SoftwareUpdater.hpp | 5 ---- version.h | 7 ++++++ windows/ZeroTierOne/ZeroTierOne.vcxproj | 4 +-- 6 files changed, 24 insertions(+), 54 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip index e799ffc9..c8b4ead2 100644 --- a/ext/installfiles/windows/ZeroTier One.aip +++ b/ext/installfiles/windows/ZeroTier One.aip @@ -27,10 +27,10 @@ - + - + @@ -60,7 +60,7 @@ - + @@ -104,6 +104,9 @@ + + + @@ -429,10 +432,10 @@ - + - + diff --git a/one.cpp b/one.cpp index f704f7ef..95230bf1 100644 --- a/one.cpp +++ b/one.cpp @@ -84,7 +84,7 @@ using namespace ZeroTier; static OneService *volatile zt1Service = (OneService *)0; #define PROGRAM_NAME "ZeroTier One" -#define COPYRIGHT_NOTICE "Copyright © 2011–2016 ZeroTier, Inc." +#define COPYRIGHT_NOTICE "Copyright (c) 2011-2017 ZeroTier, Inc." #define LICENSE_GRANT \ "This is free software: you may copy, modify, and/or distribute this" ZT_EOL_S \ "work under the terms of the GNU General Public License, version 3 or" ZT_EOL_S \ @@ -100,9 +100,10 @@ static OneService *volatile zt1Service = (OneService *)0; static void cliPrintHelp(const char *pn,FILE *out) { fprintf(out, - "%s version %d.%d.%d" ZT_EOL_S, + "%s version %d.%d.%d build %d (platform %d arch %d)" ZT_EOL_S, PROGRAM_NAME, - ZEROTIER_ONE_VERSION_MAJOR, ZEROTIER_ONE_VERSION_MINOR, ZEROTIER_ONE_VERSION_REVISION); + ZEROTIER_ONE_VERSION_MAJOR, ZEROTIER_ONE_VERSION_MINOR, ZEROTIER_ONE_VERSION_REVISION, ZEROTIER_ONE_VERSION_BUILD, + ZT_BUILD_PLATFORM, ZT_BUILD_ARCHITECTURE); fprintf(out, COPYRIGHT_NOTICE ZT_EOL_S LICENSE_GRANT ZT_EOL_S); diff --git a/service/SoftwareUpdater.cpp b/service/SoftwareUpdater.cpp index c1d77f98..fa7216ce 100644 --- a/service/SoftwareUpdater.cpp +++ b/service/SoftwareUpdater.cpp @@ -47,13 +47,6 @@ #include "../osdep/OSUtils.hpp" -#ifndef ZT_BUILD_ARCHITECTURE -#define ZT_BUILD_ARCHITECTURE 0 -#endif -#ifndef ZT_BUILD_PLATFORM -#define ZT_BUILD_PLATFORM 0 -#endif - namespace ZeroTier { SoftwareUpdater::SoftwareUpdater(Node &node,const std::string &homePath) : @@ -65,30 +58,7 @@ SoftwareUpdater::SoftwareUpdater(Node &node,const std::string &homePath) : _latestValid(false), _downloadLength(0) { - // Check for a cached newer update. If there's a cached update that is not newer or looks bad, delete. - try { - std::string buf; - if (OSUtils::readFile((_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_META_FILENAME).c_str(),buf)) { - nlohmann::json meta = OSUtils::jsonParse(buf); - buf = std::string(); - const unsigned int rvMaj = (unsigned int)OSUtils::jsonInt(meta[ZT_SOFTWARE_UPDATE_JSON_VERSION_MAJOR],0); - const unsigned int rvMin = (unsigned int)OSUtils::jsonInt(meta[ZT_SOFTWARE_UPDATE_JSON_VERSION_MINOR],0); - const unsigned int rvRev = (unsigned int)OSUtils::jsonInt(meta[ZT_SOFTWARE_UPDATE_JSON_VERSION_REVISION],0); - const unsigned int rvBld = (unsigned int)OSUtils::jsonInt(meta[ZT_SOFTWARE_UPDATE_JSON_VERSION_BUILD],0); - if ((Utils::compareVersion(rvMaj,rvMin,rvRev,rvBld,ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION,ZEROTIER_ONE_VERSION_BUILD) > 0)&& - (OSUtils::readFile((_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_BIN_FILENAME).c_str(),buf))) { - if ((uint64_t)buf.length() == OSUtils::jsonInt(meta[ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIZE],0)) { - _latestMeta = meta; - _latestValid = true; - //printf("CACHED UPDATE IS NEWER AND LOOKS GOOD\n"); - } - } - } - } catch ( ... ) {} // exceptions indicate invalid cached update - if (!_latestValid) { - OSUtils::rm((_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_META_FILENAME).c_str()); - OSUtils::rm((_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_BIN_FILENAME).c_str()); - } + OSUtils::rm((_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_BIN_FILENAME).c_str()); } SoftwareUpdater::~SoftwareUpdater() @@ -214,10 +184,7 @@ void SoftwareUpdater::handleSoftwareUpdateUserMessage(uint64_t origin,const void if (_latestMeta != req) { _latestMeta = req; _latestValid = false; - - OSUtils::rm((_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_META_FILENAME).c_str()); OSUtils::rm((_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_BIN_FILENAME).c_str()); - _download = std::string(); memcpy(_downloadHashPrefix.data,hash.data(),16); _downloadLength = len; @@ -331,9 +298,7 @@ bool SoftwareUpdater::check(const uint64_t now) // This is the very important security validation part that makes sure // this software update doesn't have cooties. - const std::string metaPath(_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_META_FILENAME); const std::string binPath(_homePath + ZT_PATH_SEPARATOR_S ZT_SOFTWARE_UPDATE_BIN_FILENAME); - try { // (1) Check the hash itself to make sure the image is basically okay uint8_t sha512[ZT_SHA512_DIGEST_LEN]; @@ -343,8 +308,8 @@ bool SoftwareUpdater::check(const uint64_t now) const std::string sig(OSUtils::jsonBinFromHex(_latestMeta[ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIGNATURE])); if (Identity(ZT_SOFTWARE_UPDATE_SIGNING_AUTHORITY).verify(_download.data(),(unsigned int)_download.length(),sig.data(),(unsigned int)sig.length())) { // (3) Try to save file, and if so we are good. - if (OSUtils::writeFile(metaPath.c_str(),OSUtils::jsonDump(_latestMeta)) && OSUtils::writeFile(binPath.c_str(),_download)) { - OSUtils::lockDownFile(metaPath.c_str(),false); + OSUtils::rm(binPath.c_str()); + if (OSUtils::writeFile(binPath.c_str(),_download)) { OSUtils::lockDownFile(binPath.c_str(),false); _latestValid = true; //printf("VALID UPDATE\n%s\n",OSUtils::jsonDump(_latestMeta).c_str()); @@ -358,7 +323,6 @@ bool SoftwareUpdater::check(const uint64_t now) // If we get here, checks failed. //printf("INVALID UPDATE (!!!)\n%s\n",OSUtils::jsonDump(_latestMeta).c_str()); - OSUtils::rm(metaPath.c_str()); OSUtils::rm(binPath.c_str()); _latestMeta = nlohmann::json(); _latestValid = false; diff --git a/service/SoftwareUpdater.hpp b/service/SoftwareUpdater.hpp index 8950782a..4bb0ef51 100644 --- a/service/SoftwareUpdater.hpp +++ b/service/SoftwareUpdater.hpp @@ -71,11 +71,6 @@ */ #define ZT_SOFTWARE_UPDATE_DEFAULT_CHANNEL "release" -/** - * Filename for latest update's meta JSON - */ -#define ZT_SOFTWARE_UPDATE_META_FILENAME "latest-update.json" - /** * Filename for latest update's binary image */ diff --git a/version.h b/version.h index b83cab03..4ddcd66a 100644 --- a/version.h +++ b/version.h @@ -43,4 +43,11 @@ */ #define ZEROTIER_ONE_VERSION_BUILD 0 +#ifndef ZT_BUILD_ARCHITECTURE +#define ZT_BUILD_ARCHITECTURE 0 +#endif +#ifndef ZT_BUILD_PLATFORM +#define ZT_BUILD_PLATFORM 0 +#endif + #endif diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 5092a655..32d7fa4a 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -271,7 +271,7 @@ true - STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";%(PreprocessorDefinitions) + STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=1;%(PreprocessorDefinitions) MultiThreaded NoExtensions true @@ -297,7 +297,7 @@ true - STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;%(PreprocessorDefinitions) + STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=2;%(PreprocessorDefinitions) MultiThreaded NotSet true -- cgit v1.2.3 From d8f5cfdee4665451960505d375bd7a20fb0d6f04 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 17 Apr 2017 15:45:49 -0700 Subject: Windows profile build target (CPU profiling), and a little bit of optimization revealed by such. --- node/Poly1305.cpp | 21 ++++--- windows/ZeroTierOne.sln | 31 +++++++++++ windows/ZeroTierOne/ZeroTierOne.vcxproj | 74 ++++++++++++++++++++++++- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 3 + 4 files changed, 121 insertions(+), 8 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/node/Poly1305.cpp b/node/Poly1305.cpp index b78071f6..13d4712d 100644 --- a/node/Poly1305.cpp +++ b/node/Poly1305.cpp @@ -135,11 +135,12 @@ typedef struct poly1305_context { unsigned char opaque[136]; } poly1305_context; -#if (defined(_MSC_VER) || defined(__GNUC__)) && (defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(__AMD64) || defined(__AMD64__)) +#if (defined(_MSC_VER) || defined(__GNUC__)) && (defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(__AMD64) || defined(__AMD64__) || defined(_M_X64)) ////////////////////////////////////////////////////////////////////////////// // 128-bit implementation for MSC and GCC from Poly1305-donna + #if defined(_MSC_VER) #include @@ -183,9 +184,9 @@ typedef struct poly1305_state_internal_t { unsigned char final; } poly1305_state_internal_t; -/* interpret eight 8 bit unsigned integers as a 64 bit unsigned integer in little endian */ -static inline unsigned long long -U8TO64(const unsigned char *p) { +#if defined(ZT_NO_TYPE_PUNNING) || (__BYTE_ORDER != __LITTLE_ENDIAN) +static inline unsigned long long U8TO64(const unsigned char *p) +{ return (((unsigned long long)(p[0] & 0xff) ) | ((unsigned long long)(p[1] & 0xff) << 8) | @@ -196,10 +197,13 @@ U8TO64(const unsigned char *p) { ((unsigned long long)(p[6] & 0xff) << 48) | ((unsigned long long)(p[7] & 0xff) << 56)); } +#else +#define U8TO64(p) (*reinterpret_cast(p)) +#endif -/* store a 64 bit unsigned integer as eight 8 bit unsigned integers in little endian */ -static inline void -U64TO8(unsigned char *p, unsigned long long v) { +#if defined(ZT_NO_TYPE_PUNNING) || (__BYTE_ORDER != __LITTLE_ENDIAN) +static inline void U64TO8(unsigned char *p, unsigned long long v) +{ p[0] = (v ) & 0xff; p[1] = (v >> 8) & 0xff; p[2] = (v >> 16) & 0xff; @@ -209,6 +213,9 @@ U64TO8(unsigned char *p, unsigned long long v) { p[6] = (v >> 48) & 0xff; p[7] = (v >> 56) & 0xff; } +#else +#define U64TO8(p,v) ((*reinterpret_cast(p)) = (v)) +#endif static inline void poly1305_init(poly1305_context *ctx, const unsigned char key[32]) { diff --git a/windows/ZeroTierOne.sln b/windows/ZeroTierOne.sln index 9baadd81..05f498fb 100644 --- a/windows/ZeroTierOne.sln +++ b/windows/ZeroTierOne.sln @@ -28,6 +28,10 @@ Global DVD-5|Mixed Platforms = DVD-5|Mixed Platforms DVD-5|Win32 = DVD-5|Win32 DVD-5|x64 = DVD-5|x64 + Profile|Any CPU = Profile|Any CPU + Profile|Mixed Platforms = Profile|Mixed Platforms + Profile|Win32 = Profile|Win32 + Profile|x64 = Profile|x64 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 @@ -91,6 +95,13 @@ Global {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|x64.ActiveCfg = Debug|x64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|x64.Build.0 = Debug|x64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|x64.Deploy.0 = Debug|x64 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Any CPU.ActiveCfg = Profile|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Mixed Platforms.ActiveCfg = Profile|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Mixed Platforms.Build.0 = Profile|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Win32.ActiveCfg = Profile|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Win32.Build.0 = Profile|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|x64.ActiveCfg = Profile|x64 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|x64.Build.0 = Profile|x64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Any CPU.ActiveCfg = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Mixed Platforms.Build.0 = Release|Win32 @@ -189,6 +200,10 @@ Global {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|x64.ActiveCfg = Win8 Release|x64 {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|x64.Build.0 = Win8 Release|x64 {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|x64.Deploy.0 = Win8 Release|x64 + {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Profile|Any CPU.ActiveCfg = Win8 Debug|x64 + {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Profile|Mixed Platforms.ActiveCfg = Win8 Debug|Win32 + {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Profile|Win32.ActiveCfg = Win8 Debug|Win32 + {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Profile|x64.ActiveCfg = Win8 Debug|x64 {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|Any CPU.ActiveCfg = Win8 Release|Win32 {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|Mixed Platforms.ActiveCfg = Win8 Release|Win32 {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|Mixed Platforms.Build.0 = Win8 Release|Win32 @@ -287,6 +302,14 @@ Global {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.DVD-5|Mixed Platforms.Build.0 = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.DVD-5|Win32.ActiveCfg = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.DVD-5|x64.ActiveCfg = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|Any CPU.ActiveCfg = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|Any CPU.Build.0 = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|Mixed Platforms.Build.0 = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|Win32.ActiveCfg = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|Win32.Build.0 = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|x64.ActiveCfg = Debug|Any CPU + {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Profile|x64.Build.0 = Debug|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Release|Any CPU.ActiveCfg = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Release|Any CPU.Build.0 = Release|Any CPU {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -361,6 +384,14 @@ Global {6D27214A-087B-4484-B898-AD2A13FA3B9E}.DVD-5|Win32.Build.0 = Debug|Any CPU {6D27214A-087B-4484-B898-AD2A13FA3B9E}.DVD-5|x64.ActiveCfg = Debug|Any CPU {6D27214A-087B-4484-B898-AD2A13FA3B9E}.DVD-5|x64.Build.0 = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|Any CPU.ActiveCfg = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|Any CPU.Build.0 = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|Mixed Platforms.Build.0 = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|Win32.ActiveCfg = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|Win32.Build.0 = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|x64.ActiveCfg = Debug|Any CPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Profile|x64.Build.0 = Debug|Any CPU {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|Any CPU.ActiveCfg = Release|Any CPU {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|Any CPU.Build.0 = Release|Any CPU {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 32d7fa4a..84a44198 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -9,6 +9,14 @@ Debug x64 + + Profile + Win32 + + + Profile + x64 + Release Win32 @@ -66,6 +74,7 @@ false + false @@ -113,6 +122,7 @@ + @@ -172,12 +182,24 @@ v140 MultiByte + + Application + true + v140 + MultiByte + Application true v140 MultiByte + + Application + true + v140 + MultiByte + Application false @@ -198,9 +220,15 @@ + + + + + + @@ -213,6 +241,11 @@ $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x86 + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x86 + .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ @@ -223,6 +256,11 @@ $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x64 + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x64 + .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ @@ -244,6 +282,22 @@ false + + + Level3 + Disabled + true + + + NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + 4996 + + + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + + Level3 @@ -262,6 +316,24 @@ "notelemetry.obj" %(AdditionalOptions) + + + Level3 + Disabled + true + + + NOMINMAX;STATICLIB;WIN32;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + false + 4996 + + + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + "notelemetry.obj" %(AdditionalOptions) + + Level3 @@ -291,7 +363,7 @@ Level3 - MaxSpeed + Full true true true diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index ca1640e9..b051b4f7 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -482,6 +482,9 @@ Header Files\node + + Header Files\node + -- cgit v1.2.3 From 72bd3064a20aec9b1fcbc86bb590aca87f4eca71 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 18 Apr 2017 11:00:29 -0700 Subject: Windows build fixes, self test cleanup. --- node/Dictionary.hpp | 40 ---------- selftest.cpp | 99 ++++++------------------- windows/ZeroTierOne/ZeroTierOne.vcxproj | 8 +- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 21 +++++- 4 files changed, 43 insertions(+), 125 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/node/Dictionary.hpp b/node/Dictionary.hpp index fa9e2883..440dae7f 100644 --- a/node/Dictionary.hpp +++ b/node/Dictionary.hpp @@ -416,46 +416,6 @@ public: return (this->get(key,tmp,2) >= 0); } - /** - * Erase a key from this dictionary - * - * Use this before add() to ensure that a key is replaced if it might - * already be present. - * - * @param key Key to erase - * @return True if key was found and erased - */ - inline bool erase(const char *key) - { - char d2[C]; - char *saveptr = (char *)0; - unsigned int d2ptr = 0; - bool found = false; - for(char *f=Utils::stok(_d,"\r\n",&saveptr);(f);f=Utils::stok((char *)0,"\r\n",&saveptr)) { - if (*f) { - const char *p = f; - const char *k = key; - while ((*k)&&(*p)) { - if (*k != *p) - break; - ++k; - ++p; - } - if (*k) { - p = f; - while (*p) - d2[d2ptr++] = *(p++); - d2[d2ptr++] = '\n'; - } else { - found = true; - } - } - } - d2[d2ptr++] = (char)0; - memcpy(_d,d2,d2ptr); - return found; - } - /** * @return Value of C template parameter */ diff --git a/selftest.cpp b/selftest.cpp index b7a1cc4d..55a469e1 100644 --- a/selftest.cpp +++ b/selftest.cpp @@ -196,7 +196,7 @@ static int testCrypto() for(unsigned int i=0;i<1234567;++i) bb[i] = (unsigned char)i; Salsa20 s20(s20TV0Key,s20TV0Iv); - double bytes = 0.0; + long double bytes = 0.0; uint64_t start = OSUtils::now(); for(unsigned int i=0;i<200;++i) { s20.crypt12(bb,bb,1234567); @@ -204,7 +204,7 @@ static int testCrypto() } uint64_t end = OSUtils::now(); SHA512::hash(buf1,bb,1234567); - std::cout << ((bytes / 1048576.0) / ((double)(end - start) / 1000.0)) << " MiB/second (" << Utils::hex(buf1,16) << ')' << std::endl; + std::cout << ((bytes / 1048576.0) / ((long double)(end - start) / 1024.0)) << " MiB/second (" << Utils::hex(buf1,16) << ')' << std::endl; ::free((void *)bb); } @@ -221,7 +221,7 @@ static int testCrypto() bytes += 1234567.0; } uint64_t end = OSUtils::now(); - std::cout << ((bytes / 1048576.0) / ((double)(end - start) / 1000.0)) << " MiB/second" << std::endl; + std::cout << ((bytes / 1048576.0) / ((double)(end - start) / 1024.0)) << " MiB/second" << std::endl; ::free((void *)bb); } #endif @@ -232,7 +232,7 @@ static int testCrypto() for(unsigned int i=0;i<1234567;++i) bb[i] = (unsigned char)i; Salsa20 s20(s20TV0Key,s20TV0Iv); - double bytes = 0.0; + long double bytes = 0.0; uint64_t start = OSUtils::now(); for(unsigned int i=0;i<200;++i) { s20.crypt20(bb,bb,1234567); @@ -240,7 +240,7 @@ static int testCrypto() } uint64_t end = OSUtils::now(); SHA512::hash(buf1,bb,1234567); - std::cout << ((bytes / 1048576.0) / ((double)(end - start) / 1000.0)) << " MiB/second (" << Utils::hex(buf1,16) << ')' << std::endl; + std::cout << ((bytes / 1048576.0) / ((long double)(end - start) / 1024.0)) << " MiB/second (" << Utils::hex(buf1,16) << ')' << std::endl; ::free((void *)bb); } @@ -270,14 +270,14 @@ static int testCrypto() unsigned char *bb = (unsigned char *)::malloc(1234567); for(unsigned int i=0;i<1234567;++i) bb[i] = (unsigned char)i; - double bytes = 0.0; + long double bytes = 0.0; uint64_t start = OSUtils::now(); for(unsigned int i=0;i<200;++i) { Poly1305::compute(buf1,bb,1234567,poly1305TV0Key); bytes += 1234567.0; } uint64_t end = OSUtils::now(); - std::cout << ((bytes / 1048576.0) / ((double)(end - start) / 1000.0)) << " MiB/second" << std::endl; + std::cout << ((bytes / 1048576.0) / ((long double)(end - start) / 1000.0)) << " MiB/second" << std::endl; ::free((void *)bb); } @@ -632,6 +632,7 @@ static int testOther() return -1; } +#if 0 std::cout << "[other] Testing Hashtable... "; std::cout.flush(); { Hashtable ht; @@ -795,40 +796,28 @@ static int testOther() } } std::cout << "PASS" << std::endl; - - std::cout << "[other] Testing hex encode/decode... "; std::cout.flush(); - for(unsigned int k=0;k<1000;++k) { - unsigned int flen = (rand() % 8194) + 1; - for(unsigned int i=0;i test; + Dictionary<8194> *test = new Dictionary<8194>(); char key[32][16]; char value[32][128]; + memset(key, 0, sizeof(key)); + memset(value, 0, sizeof(value)); for(unsigned int q=0;q<32;++q) { Utils::snprintf(key[q],16,"%.8lx",(unsigned long)rand()); - int r = rand() % 128; + int r = (rand() % 127) + 1; for(int x=0;xadd(key[q],value[q],r); } for(unsigned int q=0;q<1024;++q) { //int r = rand() % 128; int r = 31; char tmp[128]; - if (test.get(key[r],tmp,sizeof(tmp)) >= 0) { + if (test->get(key[r],tmp,sizeof(tmp)) >= 0) { if (strcmp(value[r],tmp)) { std::cout << "FAILED (invalid value)!" << std::endl; return -1; @@ -838,76 +827,30 @@ static int testOther() return -1; } } - for(unsigned int q=0;q<31;++q) { - char tmp[128]; - test.erase(key[q]); - if (test.get(key[q],tmp,sizeof(tmp)) >= 0) { - std::cout << "FAILED (key should have been erased)!" << std::endl; - return -1; - } - if (test.get(key[q+1],tmp,sizeof(tmp)) < 0) { - std::cout << "FAILED (key should NOT have been erased)!" << std::endl; - return -1; - } - } + delete test; } int foo = 0; volatile int *volatile bar = &foo; // force compiler not to optimize out test.get() below for(int k=0;k<200;++k) { int r = rand() % 8194; - unsigned char tmp[8194]; + unsigned char *tmp = new unsigned char[8194]; for(int q=0;q test((const char *)tmp); + Dictionary<8194> *test = new Dictionary<8194>((const char *)tmp); for(unsigned int q=0;q<100;++q) { char tmp[128]; for(unsigned int x=0;x<128;++x) tmp[x] = (char)(rand() & 0xff); tmp[127] = (char)0; char value[8194]; - *bar += test.get(tmp,value,sizeof(value)); + *bar += test->get(tmp,value,sizeof(value)); } + delete test; + delete[] tmp; } std::cout << "PASS (junk value to prevent optimization-out of test: " << foo << ")" << std::endl; - /* - std::cout << "[other] Testing controller/JSONDB..."; std::cout.flush(); - { - std::map db1data; - JSONDB db1("jsondb-test"); - for(unsigned int i=0;i<256;++i) { - std::string n; - for(unsigned int j=0,k=rand() % 4;j<=k;++j) { - if (j > 0) n.push_back('/'); - char foo[24]; - Utils::snprintf(foo,sizeof(foo),"%lx",rand()); - n.append(foo); - } - db1data[n] = {{"i",i}}; - db1.put(n,db1data[n]); - } - for(std::map::iterator i(db1data.begin());i!=db1data.end();++i) { - i->second["foo"] = "bar"; - db1.put(i->first,i->second); - } - JSONDB db2("jsondb-test"); - if (db1 != db2) { - std::cout << " FAILED (db1!=db2 #1)" << std::endl; - return -1; - } - for(std::map::iterator i(db1data.begin());i!=db1data.end();++i) { - db1.erase(i->first); - } - db2.reload(); - if (db1 != db2) { - std::cout << " FAILED (db1!=db2 #2)" << std::endl; - return -1; - } - } - std::cout << " PASS" << std::endl; - */ - return 0; } diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 84a44198..6ed95010 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -72,10 +72,7 @@ - - false - false - + @@ -88,6 +85,8 @@ + + @@ -109,6 +108,7 @@ + diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index b051b4f7..01637801 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -76,6 +76,12 @@ {ff20532b-d9a2-440d-a7b4-b49e26a9b2f8} + + {05d9cde8-03ae-4e37-b9f7-7417de98cbe9} + + + {7dc22e9c-f869-41e7-b43d-f07f5b94f6fb} + @@ -150,9 +156,6 @@ Source Files\ext\http-parser - - Source Files - Source Files\windows\ZeroTierOne @@ -246,6 +249,9 @@ Source Files\node + + Source Files + @@ -485,6 +491,15 @@ Header Files\node + + Header Files\ext\x64-salsa2012-asm + + + Header Files\controller + + + Header Files\controller + -- cgit v1.2.3 From aaf597f0205b79c0f1d8523f15c8d8aaecb63f43 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 18 Apr 2017 12:22:44 -0700 Subject: Cleanup, Windows fixes, Self test fix --- ext/x64-salsa2012-asm/salsa2012.h | 6 ++---- node/Dictionary.hpp | 18 +++++++++--------- one.cpp | 2 +- selftest.cpp | 15 ++++++--------- windows/ZeroTierOne/ZeroTierOne.vcxproj | 22 ++++++++++++++++++++-- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 3 +++ 6 files changed, 41 insertions(+), 25 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/ext/x64-salsa2012-asm/salsa2012.h b/ext/x64-salsa2012-asm/salsa2012.h index d47059b4..d8c2e48c 100644 --- a/ext/x64-salsa2012-asm/salsa2012.h +++ b/ext/x64-salsa2012-asm/salsa2012.h @@ -2,11 +2,9 @@ extern "C" { #endif +// Generates Salsa20/12 key stream // output, outlen, nonce, key (256-bit / 32-byte) -extern int zt_salsa2012_amd64_xmm6(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); - -// ciphertext, message, mlen, nonce, key -extern int zt_salsa2012_amd64_xmm6_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); +extern int zt_salsa2012_amd64_xmm6(unsigned char *, unsigned long long, const unsigned char *, const unsigned char *); #ifdef __cplusplus } diff --git a/node/Dictionary.hpp b/node/Dictionary.hpp index 440dae7f..0db13b63 100644 --- a/node/Dictionary.hpp +++ b/node/Dictionary.hpp @@ -176,12 +176,12 @@ public: j = 0; esc = false; ++p; - while ((*p != 0)&&(*p != '\r')&&(*p != '\n')) { + while ((*p != 0)&&(*p != 13)&&(*p != 10)) { if (esc) { esc = false; switch(*p) { - case 'r': dest[j++] = '\r'; break; - case 'n': dest[j++] = '\n'; break; + case 'r': dest[j++] = 13; break; + case 'n': dest[j++] = 10; break; case '0': dest[j++] = (char)0; break; case 'e': dest[j++] = '='; break; default: dest[j++] = *p; break; @@ -207,7 +207,7 @@ public: dest[j] = (char)0; return j; } else { - while ((*p)&&(*p != '\r')&&(*p != '\n')) { + while ((*p)&&(*p != 13)&&(*p != 10)) { if (++p == eof) { dest[0] = (char)0; return -1; @@ -299,7 +299,7 @@ public: unsigned int j = i; if (j > 0) { - _d[j++] = '\n'; + _d[j++] = (char)10; if (j == C) { _d[i] = (char)0; return false; @@ -326,8 +326,8 @@ public: while ( ((vlen < 0)&&(*p)) || (k < vlen) ) { switch(*p) { case 0: - case '\r': - case '\n': + case 13: + case 10: case '\\': case '=': _d[j++] = '\\'; @@ -337,8 +337,8 @@ public: } switch(*p) { case 0: _d[j++] = '0'; break; - case '\r': _d[j++] = 'r'; break; - case '\n': _d[j++] = 'n'; break; + case 13: _d[j++] = 'r'; break; + case 10: _d[j++] = 'n'; break; case '\\': _d[j++] = '\\'; break; case '=': _d[j++] = 'e'; break; } diff --git a/one.cpp b/one.cpp index edefe82e..b40e28fc 100644 --- a/one.cpp +++ b/one.cpp @@ -1257,7 +1257,7 @@ public: }; #ifdef __WINDOWS__ -int _tmain(int argc, _TCHAR* argv[]) +int __cdecl _tmain(int argc, _TCHAR* argv[]) #else int main(int argc,char **argv) #endif diff --git a/selftest.cpp b/selftest.cpp index 55a469e1..e68cf047 100644 --- a/selftest.cpp +++ b/selftest.cpp @@ -212,12 +212,10 @@ static int testCrypto() std::cout << "[crypto] Benchmarking Salsa20/12 fast x64 ASM... "; std::cout.flush(); { unsigned char *bb = (unsigned char *)::malloc(1234567); - for(unsigned int i=0;i<1234567;++i) - bb[i] = (unsigned char)i; double bytes = 0.0; uint64_t start = OSUtils::now(); for(unsigned int i=0;i<200;++i) { - zt_salsa2012_amd64_xmm6_xor(bb,bb,1234567,s20TV0Iv,s20TV0Key); + zt_salsa2012_amd64_xmm6(bb, 1234567, s20TV0Iv, s20TV0Key); bytes += 1234567.0; } uint64_t end = OSUtils::now(); @@ -806,20 +804,19 @@ static int testOther() memset(key, 0, sizeof(key)); memset(value, 0, sizeof(value)); for(unsigned int q=0;q<32;++q) { - Utils::snprintf(key[q],16,"%.8lx",(unsigned long)rand()); - int r = (rand() % 127) + 1; + Utils::snprintf(key[q],16,"%.8lx",(unsigned long)(rand() % 1000) + (q * 1000)); + int r = rand() % 128; for(int x=0;xadd(key[q],value[q],r); } for(unsigned int q=0;q<1024;++q) { - //int r = rand() % 128; - int r = 31; + int r = rand() % 32; char tmp[128]; if (test->get(key[r],tmp,sizeof(tmp)) >= 0) { if (strcmp(value[r],tmp)) { - std::cout << "FAILED (invalid value)!" << std::endl; + std::cout << "FAILED (invalid value '" << value[r] << "' != '" << tmp << "')!" << std::endl; return -1; } } else { @@ -1048,7 +1045,7 @@ static int testHttp() */ #ifdef __WINDOWS__ -int _tmain(int argc, _TCHAR* argv[]) +int __cdecl _tmain(int argc, _TCHAR* argv[]) #else int main(int argc,char **argv) #endif diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 6ed95010..96de5d2b 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -72,12 +72,27 @@ - + + false + false + false + false + false + false + + + true + true + true + true + true + true + @@ -363,7 +378,7 @@ Level3 - Full + MaxSpeed true true true @@ -377,6 +392,9 @@ Speed true 4996 + Guard + false + VectorCall true diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 01637801..cca10f97 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -252,6 +252,9 @@ Source Files + + Source Files + -- cgit v1.2.3 From ba0d73d102e09b6d60f1d677b1e5472a25c08d42 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 20 Apr 2017 10:21:40 -0700 Subject: Windows build fixes. --- controller/JSONDB.cpp | 2 +- service/OneService.cpp | 3 ++- windows/ZeroTierOne/ZeroTierOne.vcxproj | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/controller/JSONDB.cpp b/controller/JSONDB.cpp index afc0631d..007e0fec 100644 --- a/controller/JSONDB.cpp +++ b/controller/JSONDB.cpp @@ -64,7 +64,7 @@ bool JSONDB::writeRaw(const std::string &n,const std::string &obj) Utils::snprintf(tmp,sizeof(tmp),"%lu",(unsigned long)obj.length()); reqHeaders["Content-Length"] = tmp; reqHeaders["Content-Type"] = "application/json"; - const unsigned int sc = Http::PUT(1048576,ZT_JSONDB_HTTP_TIMEOUT,reinterpret_cast(&_httpAddr),(_basePath+"/"+n).c_str(),reqHeaders,obj.data(),obj.length(),headers,body); + const unsigned int sc = Http::PUT(1048576,ZT_JSONDB_HTTP_TIMEOUT,reinterpret_cast(&_httpAddr),(_basePath+"/"+n).c_str(),reqHeaders,obj.data(),(unsigned long)obj.length(),headers,body); return (sc == 200); } else { const std::string path(_genPath(n,true)); diff --git a/service/OneService.cpp b/service/OneService.cpp index 5f2adfe3..a9185eea 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1530,7 +1530,8 @@ public: json &controllerDbHttpPath = settings["controllerDbHttpPath"]; if ((controllerDbHttpHost.is_string())&&(controllerDbHttpPort.is_number())) { _controllerDbPath = "http://"; - _controllerDbPath.append(controllerDbHttpHost); + std::string h = controllerDbHttpHost; + _controllerDbPath.append(h); char dbp[128]; Utils::snprintf(dbp,sizeof(dbp),"%d",(int)controllerDbHttpPort); _controllerDbPath.push_back(':'); diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 96de5d2b..9715f3d9 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -360,12 +360,13 @@ STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=1;%(PreprocessorDefinitions) MultiThreaded - NoExtensions + StreamingSIMDExtensions2 true AnySuitable Speed true 4996 + Guard true -- cgit v1.2.3 From 6b130e8311e53f35399a314338d50ccadd30e7d3 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Jun 2017 14:58:39 -0700 Subject: fix for windows compilation (related to SDK implementation) --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 9715f3d9..8f01393b 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -1,4 +1,4 @@ - + @@ -288,7 +288,7 @@ true - NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) 4996 @@ -304,7 +304,7 @@ true - NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) 4996 @@ -320,7 +320,7 @@ true - NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) false 4996 @@ -338,7 +338,7 @@ true - NOMINMAX;STATICLIB;WIN32;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) false 4996 @@ -358,7 +358,7 @@ true - STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=1;%(PreprocessorDefinitions) + ZT_EXPORT;STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=1;%(PreprocessorDefinitions) MultiThreaded StreamingSIMDExtensions2 true @@ -385,7 +385,7 @@ true - STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=2;%(PreprocessorDefinitions) + ZT_EXPORT;STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=2;%(PreprocessorDefinitions) MultiThreaded NotSet true -- cgit v1.2.3 From d258a75cd389155580fc2d599ed7eeeee0f8c9d1 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 3 Jul 2017 13:03:28 -0700 Subject: remove Cluster.cpp from build list as it's been removed --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 1 - windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 3 --- 2 files changed, 4 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 9715f3d9..21df1f34 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -50,7 +50,6 @@ - diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index cca10f97..b65590dd 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -168,9 +168,6 @@ Source Files\node - - Source Files\node - Source Files\ext\miniupnpc -- cgit v1.2.3 From 1730f8f5b770fb3c637620515852b5c6d90d698d Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 3 Jul 2017 13:04:11 -0700 Subject: also cluster.hpp --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 1 - windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 3 --- 2 files changed, 4 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 21df1f34..c966d64b 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -133,7 +133,6 @@ - diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index b65590dd..086c1043 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -401,9 +401,6 @@ Header Files\node - - Header Files\node - Header Files\node -- cgit v1.2.3 From 4cc773ec1bd768e8bc318135c548f94ae270e959 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 12 Jul 2017 13:52:45 -0700 Subject: fix Windows build --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 4 +++- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index f5102e11..af05be04 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -1,4 +1,4 @@ - + @@ -70,6 +70,7 @@ + false @@ -163,6 +164,7 @@ + diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 086c1043..504baa92 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -252,6 +252,9 @@ Source Files + + Source Files\node + @@ -497,6 +500,9 @@ Header Files\controller + + Header Files\node + -- cgit v1.2.3 From 1db547d607c8aca6dc206b5bdd9a1b630becfb14 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 25 Oct 2017 16:25:57 -0700 Subject: Windows build fixes, AIP file update. --- ext/installfiles/windows/ZeroTier One.aip | 90 ++++++++++++++----------- windows/ZeroTierOne/ZeroTierOne.vcxproj | 4 -- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 12 ---- 3 files changed, 52 insertions(+), 54 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip index a63fa2b2..142e1704 100644 --- a/ext/installfiles/windows/ZeroTier One.aip +++ b/ext/installfiles/windows/ZeroTier One.aip @@ -1,7 +1,7 @@ - + - + @@ -27,22 +27,26 @@ - + - + - + - - - + + + + + + + @@ -60,7 +64,7 @@ - + @@ -105,12 +109,14 @@ - + + + + - @@ -148,28 +154,29 @@ - - - - + + + + + - + - - + + - - + + - - - + + + - - + + @@ -232,6 +239,7 @@ + @@ -249,6 +257,7 @@ + @@ -308,14 +317,14 @@ - + - + @@ -333,29 +342,34 @@ - + - + - + + + - - + + + - - - + + + + + @@ -382,8 +396,8 @@ - - + + @@ -432,7 +446,7 @@ - + diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index af05be04..200f172a 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -128,16 +128,12 @@ - - - - diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 504baa92..2d91a627 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -293,9 +293,6 @@ Header Files\node - - Header Files\node - Header Files\node @@ -305,9 +302,6 @@ Header Files\node - - Header Files\node - Header Files\node @@ -401,15 +395,9 @@ Header Files\windows\ZeroTierOne - - Header Files\node - Header Files\node - - Header Files\node - Header Files\node -- cgit v1.2.3 From 53e7e950f187008939dd5021f9d5f635f995f022 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 7 Nov 2017 16:39:12 -0800 Subject: Windows build fixes. --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 8 ++++++-- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 200f172a..c4bb3ced 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -27,8 +27,10 @@ + - + + @@ -100,8 +102,10 @@ + - + + diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 2d91a627..9e2ee83c 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -237,9 +237,6 @@ Source Files\controller - - Source Files\controller - Source Files\service @@ -255,6 +252,15 @@ Source Files\node + + Source Files\controller + + + Source Files\controller + + + Source Files\controller + @@ -485,12 +491,18 @@ Header Files\controller - - Header Files\controller - Header Files\node + + Header Files\controller + + + Header Files\controller + + + Header Files\controller + -- cgit v1.2.3 From d6e8a5f3ca2ecc78c5c8542356099912cbffb552 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 30 Jan 2018 16:07:41 -0800 Subject: Fix Windows compile error. --- osdep/WindowsEthernetTap.cpp | 7 +- osdep/WindowsEthernetTap.hpp | 8 +- windows/ZeroTierOne/ZeroTierOne.vcxproj | 818 +++++++++--------- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 1016 +++++++++++------------ 4 files changed, 923 insertions(+), 926 deletions(-) (limited to 'windows/ZeroTierOne/ZeroTierOne.vcxproj') diff --git a/osdep/WindowsEthernetTap.cpp b/osdep/WindowsEthernetTap.cpp index 22b81454..64ab3943 100644 --- a/osdep/WindowsEthernetTap.cpp +++ b/osdep/WindowsEthernetTap.cpp @@ -795,8 +795,9 @@ void WindowsEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherTyp return; Mutex::Lock _l(_injectPending_m); - _injectPending.push( std::pair,unsigned int>(Array(),len + 14) ); - char *d = _injectPending.back().first.data; + _injectPending.emplace(); + _injectPending.back().len = len + 14; + char *const d = _injectPending.back().data; to.copyTo(d,6); from.copyTo(d + 6,6); d[12] = (char)((etherType >> 8) & 0xff); @@ -1100,7 +1101,7 @@ void WindowsEthernetTap::threadMain() } else _injectPending_m.lock(); if (!_injectPending.empty()) { - WriteFile(_tap,_injectPending.front().first.data,_injectPending.front().second,NULL,&tapOvlWrite); + WriteFile(_tap,_injectPending.front().data,_injectPending.front().len,NULL,&tapOvlWrite); writeInProgress = true; } diff --git a/osdep/WindowsEthernetTap.hpp b/osdep/WindowsEthernetTap.hpp index 856c3be7..1e36bdd8 100644 --- a/osdep/WindowsEthernetTap.hpp +++ b/osdep/WindowsEthernetTap.hpp @@ -38,7 +38,6 @@ #include "../node/Constants.hpp" #include "../node/Mutex.hpp" -#include "../node/Array.hpp" #include "../node/MulticastGroup.hpp" #include "../node/InetAddress.hpp" #include "../osdep/Thread.hpp" @@ -150,7 +149,12 @@ private: std::vector _multicastGroups; - std::queue< std::pair< Array,unsigned int > > _injectPending; + struct _InjectPending + { + unsigned int len; + char data[ZT_MAX_MTU + 32]; + }; + std::queue<_InjectPending> _injectPending; Mutex _injectPending_m; std::string _pathToHelpers; diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index c4bb3ced..105ea127 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -1,411 +1,409 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Profile - Win32 - - - Profile - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - false - false - false - false - - - - - - - - true - true - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {B00A4957-5977-4AC1-9EF4-571DC27EADA2} - ZeroTierOne - - - - Application - true - v140 - MultiByte - - - Application - true - v140 - MultiByte - - - Application - true - v140 - MultiByte - - - Application - true - v140 - MultiByte - - - Application - false - v140 - true - MultiByte - - - Application - false - v140 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - .exe - $(SolutionDir)\Build\$(Platform)\$(Configuration)\ - zerotier-one_x86 - - - .exe - $(SolutionDir)\Build\$(Platform)\$(Configuration)\ - zerotier-one_x86 - - - .exe - $(SolutionDir)\Build\$(Platform)\$(Configuration)\ - zerotier-one_x86 - - - .exe - $(SolutionDir)\Build\$(Platform)\$(Configuration)\ - zerotier-one_x64 - - - .exe - $(SolutionDir)\Build\$(Platform)\$(Configuration)\ - zerotier-one_x64 - - - .exe - $(SolutionDir)\Build\$(Platform)\$(Configuration)\ - zerotier-one_x64 - - - - Level3 - Disabled - true - - - ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) - 4996 - - - true - wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) - false - - - - - Level3 - Disabled - true - - - ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) - 4996 - - - true - wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) - false - - - - - Level3 - Disabled - true - - - ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) - false - 4996 - - - true - wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) - false - "notelemetry.obj" %(AdditionalOptions) - - - - - Level3 - Disabled - true - - - ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) - false - 4996 - - - true - wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) - false - "notelemetry.obj" %(AdditionalOptions) - - - - - Level3 - MaxSpeed - true - true - true - - - ZT_EXPORT;STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=1;%(PreprocessorDefinitions) - MultiThreaded - StreamingSIMDExtensions2 - true - AnySuitable - Speed - true - 4996 - Guard - - - true - true - true - wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) - false - - - - - Level3 - MaxSpeed - true - true - true - - - ZT_EXPORT;STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=2;%(PreprocessorDefinitions) - MultiThreaded - NotSet - true - AnySuitable - Speed - true - 4996 - Guard - false - VectorCall - - - true - true - true - wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) - false - - - - - + + + + + Debug + Win32 + + + Debug + x64 + + + Profile + Win32 + + + Profile + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + + + + + + + + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {B00A4957-5977-4AC1-9EF4-571DC27EADA2} + ZeroTierOne + + + + Application + true + v140 + MultiByte + + + Application + true + v140 + MultiByte + + + Application + true + v140 + MultiByte + + + Application + true + v140 + MultiByte + + + Application + false + v140 + true + MultiByte + + + Application + false + v140 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x86 + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x86 + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x86 + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x64 + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x64 + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_x64 + + + + Level3 + Disabled + true + + + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + 4996 + + + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + + + + + Level3 + Disabled + true + + + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + 4996 + + + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + + + + + Level3 + Disabled + true + + + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + false + 4996 + + + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + "notelemetry.obj" %(AdditionalOptions) + + + + + Level3 + Disabled + true + + + ZT_EXPORT;NOMINMAX;STATICLIB;WIN32;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + false + 4996 + + + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + "notelemetry.obj" %(AdditionalOptions) + + + + + Level3 + MaxSpeed + true + true + true + + + ZT_EXPORT;STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=1;%(PreprocessorDefinitions) + MultiThreaded + StreamingSIMDExtensions2 + true + AnySuitable + Speed + true + 4996 + Guard + + + true + true + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + + + + + Level3 + MaxSpeed + true + true + true + + + ZT_EXPORT;STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=2;%(PreprocessorDefinitions) + MultiThreaded + NotSet + true + AnySuitable + Speed + true + 4996 + Guard + false + VectorCall + + + true + true + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + + + + + \ No newline at end of file diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 9e2ee83c..d07c0638 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -1,512 +1,506 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {67b1c0f8-b018-4169-9c14-7032ed12c786} - - - {40761a4c-e8db-4a91-9cab-7afef332f4a8} - - - {da3b8126-840c-45db-8abe-9d7e7976f8be} - - - {6054dfae-4ed2-4d69-8cf5-d6f27646f2d7} - - - {9944293a-4a1a-40e9-b92a-eff31fe87e2c} - - - {ca21bd6b-ff4e-4f9e-bedd-c9f603d2d0d6} - - - {e1743b3c-1d18-47f1-ab5a-f5703c19f1df} - - - {71865460-d693-4c73-84f6-dbff42f49df6} - - - {17ae9a01-d39f-4c6d-a800-8f2cd0804c96} - - - {7784af31-5b60-4300-b07e-44cf864c54db} - - - {f8a1c208-15b8-4d85-a4cb-11d2b82f2d1e} - - - {43f75f84-c70d-4d44-a0ef-28a7a399abd4} - - - {0da07a2f-8922-4827-ac51-29ca3f30f881} - - - {b74916eb-bb6c-4449-a2a2-fa0b17f60121} - - - {bf604491-14c4-4a74-81a6-6105d07c5c7c} - - - {5423fb64-896b-432e-a19d-88d4467f89f9} - - - {56cc3ab8-3336-4a22-9471-c267ee46cd54} - - - {d7292d0d-72a0-4ed6-b717-21debb120737} - - - {409ec37e-ff36-4c13-b18d-52d6052e0ca2} - - - {3cad34c8-c436-43ae-8323-57803637c832} - - - {ff20532b-d9a2-440d-a7b4-b49e26a9b2f8} - - - {05d9cde8-03ae-4e37-b9f7-7417de98cbe9} - - - {7dc22e9c-f869-41e7-b43d-f07f5b94f6fb} - - - - - Source Files\service - - - Source Files\osdep - - - Source Files\osdep - - - Source Files\osdep - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\ext\http-parser - - - Source Files\windows\ZeroTierOne - - - Source Files\windows\ZeroTierOne - - - Source Files\windows\ZeroTierOne - - - Source Files\node - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\ext\miniupnpc - - - Source Files\osdep - - - Source Files\ext\libnatpmp - - - Source Files\ext\libnatpmp - - - Source Files\ext\libnatpmp - - - Source Files\osdep - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\node - - - Source Files\controller - - - Source Files\service - - - Source Files\node - - - Source Files - - - Source Files - - - Source Files\node - - - Source Files\controller - - - Source Files\controller - - - Source Files\controller - - - - - Header Files - - - Header Files - - - Header Files\include - - - Header Files\osdep - - - Header Files\osdep - - - Header Files\osdep - - - Header Files\osdep - - - Header Files\osdep - - - Header Files\service - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\node - - - Header Files\ext\http-parser - - - Header Files\windows\ZeroTierOne - - - Header Files\windows\ZeroTierOne - - - Header Files\windows\ZeroTierOne - - - Header Files\node - - - Header Files\node - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\ext\miniupnpc - - - Header Files\osdep - - - Header Files\ext\libnatpmp - - - Header Files\ext\libnatpmp - - - Header Files\ext\libnatpmp - - - Header Files\osdep - - - Header Files\osdep - - - Header Files\service - - - Header Files\ext\json - - - Header Files\node - - - Header Files\node - - - Header Files\ext\x64-salsa2012-asm - - - Header Files\controller - - - Header Files\node - - - Header Files\controller - - - Header Files\controller - - - Header Files\controller - - - - - Resource Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {67b1c0f8-b018-4169-9c14-7032ed12c786} + + + {40761a4c-e8db-4a91-9cab-7afef332f4a8} + + + {da3b8126-840c-45db-8abe-9d7e7976f8be} + + + {6054dfae-4ed2-4d69-8cf5-d6f27646f2d7} + + + {9944293a-4a1a-40e9-b92a-eff31fe87e2c} + + + {ca21bd6b-ff4e-4f9e-bedd-c9f603d2d0d6} + + + {e1743b3c-1d18-47f1-ab5a-f5703c19f1df} + + + {71865460-d693-4c73-84f6-dbff42f49df6} + + + {17ae9a01-d39f-4c6d-a800-8f2cd0804c96} + + + {7784af31-5b60-4300-b07e-44cf864c54db} + + + {f8a1c208-15b8-4d85-a4cb-11d2b82f2d1e} + + + {43f75f84-c70d-4d44-a0ef-28a7a399abd4} + + + {0da07a2f-8922-4827-ac51-29ca3f30f881} + + + {b74916eb-bb6c-4449-a2a2-fa0b17f60121} + + + {bf604491-14c4-4a74-81a6-6105d07c5c7c} + + + {5423fb64-896b-432e-a19d-88d4467f89f9} + + + {56cc3ab8-3336-4a22-9471-c267ee46cd54} + + + {d7292d0d-72a0-4ed6-b717-21debb120737} + + + {409ec37e-ff36-4c13-b18d-52d6052e0ca2} + + + {3cad34c8-c436-43ae-8323-57803637c832} + + + {ff20532b-d9a2-440d-a7b4-b49e26a9b2f8} + + + {05d9cde8-03ae-4e37-b9f7-7417de98cbe9} + + + {7dc22e9c-f869-41e7-b43d-f07f5b94f6fb} + + + + + Source Files\service + + + Source Files\osdep + + + Source Files\osdep + + + Source Files\osdep + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\ext\http-parser + + + Source Files\windows\ZeroTierOne + + + Source Files\windows\ZeroTierOne + + + Source Files\windows\ZeroTierOne + + + Source Files\node + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\ext\miniupnpc + + + Source Files\osdep + + + Source Files\ext\libnatpmp + + + Source Files\ext\libnatpmp + + + Source Files\ext\libnatpmp + + + Source Files\osdep + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\node + + + Source Files\controller + + + Source Files\service + + + Source Files\node + + + Source Files + + + Source Files + + + Source Files\node + + + Source Files\controller + + + Source Files\controller + + + Source Files\controller + + + + + Header Files + + + Header Files + + + Header Files\include + + + Header Files\osdep + + + Header Files\osdep + + + Header Files\osdep + + + Header Files\osdep + + + Header Files\osdep + + + Header Files\service + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\node + + + Header Files\ext\http-parser + + + Header Files\windows\ZeroTierOne + + + Header Files\windows\ZeroTierOne + + + Header Files\windows\ZeroTierOne + + + Header Files\node + + + Header Files\node + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\ext\miniupnpc + + + Header Files\osdep + + + Header Files\ext\libnatpmp + + + Header Files\ext\libnatpmp + + + Header Files\ext\libnatpmp + + + Header Files\osdep + + + Header Files\osdep + + + Header Files\service + + + Header Files\ext\json + + + Header Files\node + + + Header Files\node + + + Header Files\ext\x64-salsa2012-asm + + + Header Files\controller + + + Header Files\node + + + Header Files\controller + + + Header Files\controller + + + Header Files\controller + + + + + Resource Files + + \ No newline at end of file -- cgit v1.2.3