summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Henry <[email protected]>2017-03-14 13:21:54 -0700
committerJoseph Henry <[email protected]>2017-03-14 13:21:54 -0700
commit695b8ecc55a4b54aa47df181c1cdb674fd4b512c (patch)
tree8b7815a5c2f4094d72cff5552d73dc7340277e3c
parente800e47a6333a0b4fe7df2a6093716cb2b44d308 (diff)
upgraded core to 1.2.00.8.0
-rw-r--r--zerotierone/java/CMakeLists.txt91
-rw-r--r--zerotierone/java/README.md17
-rw-r--r--zerotierone/java/build.xml118
-rw-r--r--zerotierone/java/jni/Android.mk46
-rw-r--r--zerotierone/java/jni/Application.mk5
-rw-r--r--zerotierone/java/jni/ZT_jnilookup.cpp158
-rw-r--r--zerotierone/java/jni/ZT_jnilookup.h54
-rw-r--r--zerotierone/java/jni/ZT_jniutils.cpp941
-rw-r--r--zerotierone/java/jni/ZT_jniutils.h69
-rw-r--r--zerotierone/java/jni/com_zerotierone_sdk_Node.cpp1381
-rw-r--r--zerotierone/java/jni/com_zerotierone_sdk_Node.h133
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/DataStoreGetListener.java58
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/DataStorePutListener.java59
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/Event.java98
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/EventListener.java52
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/NativeUtils.java93
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/Node.java434
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/NodeException.java36
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/NodeStatus.java69
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/PacketSender.java50
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/Peer.java94
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/PeerPhysicalPath.java78
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/PeerRole.java45
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/ResultCode.java74
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/Version.java36
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfig.java210
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigListener.java60
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigOperation.java49
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java48
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/VirtualNetworkRoute.java102
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/VirtualNetworkStatus.java59
-rw-r--r--zerotierone/java/src/com/zerotier/sdk/VirtualNetworkType.java39
-rw-r--r--zerotierone/service/ControlPlane.cpp553
-rw-r--r--zerotierone/service/ControlPlane.hpp96
-rw-r--r--zerotierone/windows/ZeroTierOne/ServiceBase.cpp563
-rw-r--r--zerotierone/windows/ZeroTierOne/ServiceBase.h122
-rw-r--r--zerotierone/windows/ZeroTierOne/ServiceInstaller.cpp186
-rw-r--r--zerotierone/windows/ZeroTierOne/ServiceInstaller.h64
-rw-r--r--zerotierone/windows/ZeroTierOne/ZeroTierOne.apsbin19308 -> 0 bytes
-rw-r--r--zerotierone/windows/ZeroTierOne/ZeroTierOne.rcbin2664 -> 0 bytes
-rw-r--r--zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj322
-rw-r--r--zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters497
-rw-r--r--zerotierone/windows/ZeroTierOne/ZeroTierOneService.cpp157
-rw-r--r--zerotierone/windows/ZeroTierOne/ZeroTierOneService.h71
-rw-r--r--zerotierone/windows/ZeroTierOne/resource.h14
-rw-r--r--zto/AUTHORS.md (renamed from zerotierone/AUTHORS.md)0
-rw-r--r--zto/COPYING (renamed from zerotierone/COPYING)0
-rw-r--r--zto/LICENSE.GPL-2 (renamed from zerotierone/LICENSE.GPL-2)0
-rw-r--r--zto/LICENSE.GPL-3 (renamed from zerotierone/LICENSE.GPL-3)0
-rw-r--r--zto/Makefile (renamed from zerotierone/Makefile)0
-rw-r--r--zto/README.md (renamed from zerotierone/README.md)4
-rw-r--r--zto/RELEASE-NOTES.md92
-rw-r--r--zto/controller/EmbeddedNetworkController.cpp (renamed from zerotierone/controller/EmbeddedNetworkController.cpp)25
-rw-r--r--zto/controller/EmbeddedNetworkController.hpp (renamed from zerotierone/controller/EmbeddedNetworkController.hpp)2
-rw-r--r--zto/controller/JSONDB.cpp (renamed from zerotierone/controller/JSONDB.cpp)0
-rw-r--r--zto/controller/JSONDB.hpp (renamed from zerotierone/controller/JSONDB.hpp)0
-rw-r--r--zto/controller/README.md (renamed from zerotierone/controller/README.md)0
-rw-r--r--zto/controller/migrate-sqlite/migrate.js (renamed from zerotierone/controller/migrate-sqlite/migrate.js)0
-rw-r--r--zto/controller/migrate-sqlite/package.json (renamed from zerotierone/controller/migrate-sqlite/package.json)0
-rw-r--r--zto/ext/README.md (renamed from zerotierone/ext/README.md)0
-rw-r--r--zto/ext/bin/tap-mac/tap.kext/Contents/Info.plist (renamed from zerotierone/ext/bin/tap-mac/tap.kext/Contents/Info.plist)0
-rwxr-xr-xzto/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap (renamed from zerotierone/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap)bin50496 -> 50496 bytes
-rw-r--r--zto/ext/bin/tap-mac/tap.kext/Contents/_CodeSignature/CodeResources (renamed from zerotierone/ext/bin/tap-mac/tap.kext/Contents/_CodeSignature/CodeResources)0
-rw-r--r--zto/ext/bin/tap-windows-ndis6/x64/zttap300.cat (renamed from zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.cat)bin10017 -> 10017 bytes
-rw-r--r--zto/ext/bin/tap-windows-ndis6/x64/zttap300.inf (renamed from zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.inf)0
-rw-r--r--zto/ext/bin/tap-windows-ndis6/x64/zttap300.sys (renamed from zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.sys)bin30488 -> 30488 bytes
-rw-r--r--zto/ext/bin/tap-windows-ndis6/x86/zttap300.cat (renamed from zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.cat)bin10017 -> 10017 bytes
-rw-r--r--zto/ext/bin/tap-windows-ndis6/x86/zttap300.inf (renamed from zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.inf)0
-rw-r--r--zto/ext/bin/tap-windows-ndis6/x86/zttap300.sys (renamed from zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.sys)bin27928 -> 27928 bytes
-rw-r--r--zto/ext/http-parser/AUTHORS (renamed from zerotierone/ext/http-parser/AUTHORS)0
-rw-r--r--zto/ext/http-parser/LICENSE-MIT (renamed from zerotierone/ext/http-parser/LICENSE-MIT)0
-rw-r--r--zto/ext/http-parser/README.md (renamed from zerotierone/ext/http-parser/README.md)0
-rw-r--r--zto/ext/http-parser/http_parser.c (renamed from zerotierone/ext/http-parser/http_parser.c)0
-rw-r--r--zto/ext/http-parser/http_parser.h (renamed from zerotierone/ext/http-parser/http_parser.h)0
-rw-r--r--zto/ext/json/LICENSE.MIT (renamed from zerotierone/ext/json/LICENSE.MIT)0
-rw-r--r--zto/ext/json/README.md (renamed from zerotierone/ext/json/README.md)0
-rw-r--r--zto/ext/json/json.hpp (renamed from zerotierone/ext/json/json.hpp)0
-rw-r--r--zto/ext/libnatpmp/Changelog.txt (renamed from zerotierone/ext/libnatpmp/Changelog.txt)0
-rw-r--r--zto/ext/libnatpmp/JavaTest.java (renamed from zerotierone/ext/libnatpmp/JavaTest.java)0
-rw-r--r--zto/ext/libnatpmp/LICENSE (renamed from zerotierone/ext/libnatpmp/LICENSE)0
-rw-r--r--zto/ext/libnatpmp/Makefile (renamed from zerotierone/ext/libnatpmp/Makefile)0
-rw-r--r--zto/ext/libnatpmp/README (renamed from zerotierone/ext/libnatpmp/README)0
-rw-r--r--zto/ext/libnatpmp/build.bat (renamed from zerotierone/ext/libnatpmp/build.bat)0
-rw-r--r--zto/ext/libnatpmp/declspec.h (renamed from zerotierone/ext/libnatpmp/declspec.h)0
-rw-r--r--zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/LibraryExtractor.java (renamed from zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/LibraryExtractor.java)0
-rw-r--r--zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmp.java (renamed from zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmp.java)0
-rw-r--r--zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmpResponse.java (renamed from zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmpResponse.java)0
-rw-r--r--zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/URLUtils.java (renamed from zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/URLUtils.java)0
-rw-r--r--zto/ext/libnatpmp/getgateway.c (renamed from zerotierone/ext/libnatpmp/getgateway.c)0
-rw-r--r--zto/ext/libnatpmp/getgateway.h (renamed from zerotierone/ext/libnatpmp/getgateway.h)0
-rw-r--r--zto/ext/libnatpmp/libnatpmpmodule.c (renamed from zerotierone/ext/libnatpmp/libnatpmpmodule.c)0
-rw-r--r--zto/ext/libnatpmp/msvc/libnatpmp.sln (renamed from zerotierone/ext/libnatpmp/msvc/libnatpmp.sln)0
-rw-r--r--zto/ext/libnatpmp/msvc/libnatpmp.vcproj (renamed from zerotierone/ext/libnatpmp/msvc/libnatpmp.vcproj)0
-rw-r--r--zto/ext/libnatpmp/msvc/natpmpc-static.vcproj (renamed from zerotierone/ext/libnatpmp/msvc/natpmpc-static.vcproj)0
-rw-r--r--zto/ext/libnatpmp/natpmp-jni.c (renamed from zerotierone/ext/libnatpmp/natpmp-jni.c)0
-rw-r--r--zto/ext/libnatpmp/natpmp.c (renamed from zerotierone/ext/libnatpmp/natpmp.c)0
-rw-r--r--zto/ext/libnatpmp/natpmp.def (renamed from zerotierone/ext/libnatpmp/natpmp.def)0
-rw-r--r--zto/ext/libnatpmp/natpmp.h (renamed from zerotierone/ext/libnatpmp/natpmp.h)0
-rw-r--r--zto/ext/libnatpmp/natpmpc.1 (renamed from zerotierone/ext/libnatpmp/natpmpc.1)0
-rw-r--r--zto/ext/libnatpmp/natpmpc.c (renamed from zerotierone/ext/libnatpmp/natpmpc.c)0
-rw-r--r--zto/ext/libnatpmp/setup.py (renamed from zerotierone/ext/libnatpmp/setup.py)0
-rw-r--r--zto/ext/libnatpmp/setupmingw32.py (renamed from zerotierone/ext/libnatpmp/setupmingw32.py)0
-rw-r--r--zto/ext/libnatpmp/testgetgateway.c (renamed from zerotierone/ext/libnatpmp/testgetgateway.c)0
-rw-r--r--zto/ext/libnatpmp/wingettimeofday.c (renamed from zerotierone/ext/libnatpmp/wingettimeofday.c)0
-rw-r--r--zto/ext/libnatpmp/wingettimeofday.h (renamed from zerotierone/ext/libnatpmp/wingettimeofday.h)0
-rw-r--r--zto/ext/miniupnpc/Changelog.txt (renamed from zerotierone/ext/miniupnpc/Changelog.txt)0
-rw-r--r--zto/ext/miniupnpc/LICENSE (renamed from zerotierone/ext/miniupnpc/LICENSE)0
-rw-r--r--zto/ext/miniupnpc/MANIFEST.in (renamed from zerotierone/ext/miniupnpc/MANIFEST.in)0
-rw-r--r--zto/ext/miniupnpc/README (renamed from zerotierone/ext/miniupnpc/README)0
-rw-r--r--zto/ext/miniupnpc/VERSION (renamed from zerotierone/ext/miniupnpc/VERSION)0
-rw-r--r--zto/ext/miniupnpc/apiversions.txt (renamed from zerotierone/ext/miniupnpc/apiversions.txt)0
-rw-r--r--zto/ext/miniupnpc/codelength.h (renamed from zerotierone/ext/miniupnpc/codelength.h)0
-rw-r--r--zto/ext/miniupnpc/connecthostport.c (renamed from zerotierone/ext/miniupnpc/connecthostport.c)0
-rw-r--r--zto/ext/miniupnpc/connecthostport.h (renamed from zerotierone/ext/miniupnpc/connecthostport.h)0
-rwxr-xr-xzto/ext/miniupnpc/external-ip.sh (renamed from zerotierone/ext/miniupnpc/external-ip.sh)0
-rw-r--r--zto/ext/miniupnpc/igd_desc_parse.c (renamed from zerotierone/ext/miniupnpc/igd_desc_parse.c)0
-rw-r--r--zto/ext/miniupnpc/igd_desc_parse.h (renamed from zerotierone/ext/miniupnpc/igd_desc_parse.h)0
-rw-r--r--zto/ext/miniupnpc/listdevices.c (renamed from zerotierone/ext/miniupnpc/listdevices.c)0
-rw-r--r--zto/ext/miniupnpc/mingw32make.bat (renamed from zerotierone/ext/miniupnpc/mingw32make.bat)0
-rw-r--r--zto/ext/miniupnpc/minihttptestserver.c (renamed from zerotierone/ext/miniupnpc/minihttptestserver.c)0
-rw-r--r--zto/ext/miniupnpc/minisoap.c (renamed from zerotierone/ext/miniupnpc/minisoap.c)0
-rw-r--r--zto/ext/miniupnpc/minisoap.h (renamed from zerotierone/ext/miniupnpc/minisoap.h)0
-rw-r--r--zto/ext/miniupnpc/minissdpc.c (renamed from zerotierone/ext/miniupnpc/minissdpc.c)0
-rw-r--r--zto/ext/miniupnpc/minissdpc.h (renamed from zerotierone/ext/miniupnpc/minissdpc.h)0
-rw-r--r--zto/ext/miniupnpc/miniupnpc.c (renamed from zerotierone/ext/miniupnpc/miniupnpc.c)0
-rw-r--r--zto/ext/miniupnpc/miniupnpc.def (renamed from zerotierone/ext/miniupnpc/miniupnpc.def)0
-rw-r--r--zto/ext/miniupnpc/miniupnpc.h (renamed from zerotierone/ext/miniupnpc/miniupnpc.h)0
-rw-r--r--zto/ext/miniupnpc/miniupnpc_declspec.h (renamed from zerotierone/ext/miniupnpc/miniupnpc_declspec.h)0
-rw-r--r--zto/ext/miniupnpc/miniupnpcmodule.c (renamed from zerotierone/ext/miniupnpc/miniupnpcmodule.c)0
-rw-r--r--zto/ext/miniupnpc/miniupnpcstrings.h.in (renamed from zerotierone/ext/miniupnpc/miniupnpcstrings.h.in)0
-rw-r--r--zto/ext/miniupnpc/miniupnpctypes.h (renamed from zerotierone/ext/miniupnpc/miniupnpctypes.h)0
-rw-r--r--zto/ext/miniupnpc/miniwget.c (renamed from zerotierone/ext/miniupnpc/miniwget.c)0
-rw-r--r--zto/ext/miniupnpc/miniwget.h (renamed from zerotierone/ext/miniupnpc/miniwget.h)0
-rw-r--r--zto/ext/miniupnpc/minixml.c (renamed from zerotierone/ext/miniupnpc/minixml.c)0
-rw-r--r--zto/ext/miniupnpc/minixml.h (renamed from zerotierone/ext/miniupnpc/minixml.h)0
-rw-r--r--zto/ext/miniupnpc/minixmlvalid.c (renamed from zerotierone/ext/miniupnpc/minixmlvalid.c)0
-rw-r--r--zto/ext/miniupnpc/portlistingparse.c (renamed from zerotierone/ext/miniupnpc/portlistingparse.c)0
-rw-r--r--zto/ext/miniupnpc/portlistingparse.h (renamed from zerotierone/ext/miniupnpc/portlistingparse.h)0
-rw-r--r--zto/ext/miniupnpc/pymoduletest.py (renamed from zerotierone/ext/miniupnpc/pymoduletest.py)0
-rw-r--r--zto/ext/miniupnpc/receivedata.c (renamed from zerotierone/ext/miniupnpc/receivedata.c)0
-rw-r--r--zto/ext/miniupnpc/receivedata.h (renamed from zerotierone/ext/miniupnpc/receivedata.h)0
-rw-r--r--zto/ext/miniupnpc/setup.py (renamed from zerotierone/ext/miniupnpc/setup.py)0
-rw-r--r--zto/ext/miniupnpc/setupmingw32.py (renamed from zerotierone/ext/miniupnpc/setupmingw32.py)0
-rw-r--r--zto/ext/miniupnpc/testdesc/linksys_WAG200G_desc.values (renamed from zerotierone/ext/miniupnpc/testdesc/linksys_WAG200G_desc.values)0
-rw-r--r--zto/ext/miniupnpc/testdesc/linksys_WAG200G_desc.xml (renamed from zerotierone/ext/miniupnpc/testdesc/linksys_WAG200G_desc.xml)0
-rw-r--r--zto/ext/miniupnpc/testdesc/new_LiveBox_desc.values (renamed from zerotierone/ext/miniupnpc/testdesc/new_LiveBox_desc.values)0
-rw-r--r--zto/ext/miniupnpc/testdesc/new_LiveBox_desc.xml (renamed from zerotierone/ext/miniupnpc/testdesc/new_LiveBox_desc.xml)0
-rw-r--r--zto/ext/miniupnpc/testigddescparse.c (renamed from zerotierone/ext/miniupnpc/testigddescparse.c)0
-rw-r--r--zto/ext/miniupnpc/testminiwget.c (renamed from zerotierone/ext/miniupnpc/testminiwget.c)0
-rwxr-xr-xzto/ext/miniupnpc/testminiwget.sh (renamed from zerotierone/ext/miniupnpc/testminiwget.sh)0
-rw-r--r--zto/ext/miniupnpc/testminixml.c (renamed from zerotierone/ext/miniupnpc/testminixml.c)0
-rw-r--r--zto/ext/miniupnpc/testportlistingparse.c (renamed from zerotierone/ext/miniupnpc/testportlistingparse.c)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/DeletePortMapping.namevalue (renamed from zerotierone/ext/miniupnpc/testreplyparse/DeletePortMapping.namevalue)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/DeletePortMapping.xml (renamed from zerotierone/ext/miniupnpc/testreplyparse/DeletePortMapping.xml)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue (renamed from zerotierone/ext/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/GetExternalIPAddress.xml (renamed from zerotierone/ext/miniupnpc/testreplyparse/GetExternalIPAddress.xml)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue (renamed from zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml (renamed from zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue (renamed from zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml (renamed from zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue (renamed from zerotierone/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.xml (renamed from zerotierone/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.xml)0
-rw-r--r--zto/ext/miniupnpc/testreplyparse/readme.txt (renamed from zerotierone/ext/miniupnpc/testreplyparse/readme.txt)0
-rwxr-xr-xzto/ext/miniupnpc/testupnpigd.py (renamed from zerotierone/ext/miniupnpc/testupnpigd.py)0
-rw-r--r--zto/ext/miniupnpc/testupnpreplyparse.c (renamed from zerotierone/ext/miniupnpc/testupnpreplyparse.c)0
-rwxr-xr-xzto/ext/miniupnpc/testupnpreplyparse.sh (renamed from zerotierone/ext/miniupnpc/testupnpreplyparse.sh)0
-rwxr-xr-xzto/ext/miniupnpc/updateminiupnpcstrings.sh (renamed from zerotierone/ext/miniupnpc/updateminiupnpcstrings.sh)0
-rw-r--r--zto/ext/miniupnpc/upnpc.c (renamed from zerotierone/ext/miniupnpc/upnpc.c)0
-rw-r--r--zto/ext/miniupnpc/upnpcommands.c (renamed from zerotierone/ext/miniupnpc/upnpcommands.c)0
-rw-r--r--zto/ext/miniupnpc/upnpcommands.h (renamed from zerotierone/ext/miniupnpc/upnpcommands.h)0
-rw-r--r--zto/ext/miniupnpc/upnpdev.c (renamed from zerotierone/ext/miniupnpc/upnpdev.c)0
-rw-r--r--zto/ext/miniupnpc/upnpdev.h (renamed from zerotierone/ext/miniupnpc/upnpdev.h)0
-rw-r--r--zto/ext/miniupnpc/upnperrors.c (renamed from zerotierone/ext/miniupnpc/upnperrors.c)0
-rw-r--r--zto/ext/miniupnpc/upnperrors.h (renamed from zerotierone/ext/miniupnpc/upnperrors.h)0
-rw-r--r--zto/ext/miniupnpc/upnpreplyparse.c (renamed from zerotierone/ext/miniupnpc/upnpreplyparse.c)0
-rw-r--r--zto/ext/miniupnpc/upnpreplyparse.h (renamed from zerotierone/ext/miniupnpc/upnpreplyparse.h)0
-rw-r--r--zto/ext/miniupnpc/wingenminiupnpcstrings.c (renamed from zerotierone/ext/miniupnpc/wingenminiupnpcstrings.c)0
-rw-r--r--zto/ext/tap-mac/README.txt (renamed from zerotierone/ext/tap-mac/README.txt)0
-rw-r--r--zto/ext/tap-mac/tuntap/Makefile (renamed from zerotierone/ext/tap-mac/tuntap/Makefile)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/lock.cc (renamed from zerotierone/ext/tap-mac/tuntap/src/lock.cc)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/lock.h (renamed from zerotierone/ext/tap-mac/tuntap/src/lock.h)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/mem.cc (renamed from zerotierone/ext/tap-mac/tuntap/src/mem.cc)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/mem.h (renamed from zerotierone/ext/tap-mac/tuntap/src/mem.h)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tap/Info.plist (renamed from zerotierone/ext/tap-mac/tuntap/src/tap/Info.plist)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tap/Makefile (renamed from zerotierone/ext/tap-mac/tuntap/src/tap/Makefile)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tap/kmod.cc (renamed from zerotierone/ext/tap-mac/tuntap/src/tap/kmod.cc)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tap/tap.cc (renamed from zerotierone/ext/tap-mac/tuntap/src/tap/tap.cc)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tap/tap.h (renamed from zerotierone/ext/tap-mac/tuntap/src/tap/tap.h)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tuntap.cc (renamed from zerotierone/ext/tap-mac/tuntap/src/tuntap.cc)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tuntap.h (renamed from zerotierone/ext/tap-mac/tuntap/src/tuntap.h)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/tuntap_mgr.cc (renamed from zerotierone/ext/tap-mac/tuntap/src/tuntap_mgr.cc)0
-rw-r--r--zto/ext/tap-mac/tuntap/src/util.h (renamed from zerotierone/ext/tap-mac/tuntap/src/util.h)0
-rw-r--r--zto/include/README.md (renamed from zerotierone/include/README.md)0
-rw-r--r--zto/include/ZeroTierOne.h (renamed from zerotierone/include/ZeroTierOne.h)2
-rw-r--r--zto/make-bsd.mk (renamed from zerotierone/make-bsd.mk)0
-rw-r--r--zto/make-linux.mk (renamed from zerotierone/make-linux.mk)6
-rw-r--r--zto/make-mac.mk (renamed from zerotierone/make-mac.mk)2
-rw-r--r--zto/node/Address.hpp (renamed from zerotierone/node/Address.hpp)0
-rw-r--r--zto/node/Array.hpp (renamed from zerotierone/node/Array.hpp)0
-rw-r--r--zto/node/AtomicCounter.hpp (renamed from zerotierone/node/AtomicCounter.hpp)0
-rw-r--r--zto/node/Buffer.hpp (renamed from zerotierone/node/Buffer.hpp)0
-rw-r--r--zto/node/C25519.cpp (renamed from zerotierone/node/C25519.cpp)0
-rw-r--r--zto/node/C25519.hpp (renamed from zerotierone/node/C25519.hpp)0
-rw-r--r--zto/node/Capability.cpp (renamed from zerotierone/node/Capability.cpp)0
-rw-r--r--zto/node/Capability.hpp (renamed from zerotierone/node/Capability.hpp)5
-rw-r--r--zto/node/CertificateOfMembership.cpp (renamed from zerotierone/node/CertificateOfMembership.cpp)0
-rw-r--r--zto/node/CertificateOfMembership.hpp (renamed from zerotierone/node/CertificateOfMembership.hpp)0
-rw-r--r--zto/node/CertificateOfOwnership.cpp (renamed from zerotierone/node/CertificateOfOwnership.cpp)0
-rw-r--r--zto/node/CertificateOfOwnership.hpp (renamed from zerotierone/node/CertificateOfOwnership.hpp)0
-rw-r--r--zto/node/CertificateOfRepresentation.hpp (renamed from zerotierone/node/CertificateOfRepresentation.hpp)15
-rw-r--r--zto/node/Cluster.cpp (renamed from zerotierone/node/Cluster.cpp)0
-rw-r--r--zto/node/Cluster.hpp (renamed from zerotierone/node/Cluster.hpp)0
-rw-r--r--zto/node/Constants.hpp (renamed from zerotierone/node/Constants.hpp)7
-rw-r--r--zto/node/Dictionary.hpp (renamed from zerotierone/node/Dictionary.hpp)0
-rw-r--r--zto/node/Hashtable.hpp (renamed from zerotierone/node/Hashtable.hpp)0
-rw-r--r--zto/node/Identity.cpp (renamed from zerotierone/node/Identity.cpp)0
-rw-r--r--zto/node/Identity.hpp (renamed from zerotierone/node/Identity.hpp)0
-rw-r--r--zto/node/IncomingPacket.cpp (renamed from zerotierone/node/IncomingPacket.cpp)4
-rw-r--r--zto/node/IncomingPacket.hpp (renamed from zerotierone/node/IncomingPacket.hpp)0
-rw-r--r--zto/node/InetAddress.cpp (renamed from zerotierone/node/InetAddress.cpp)0
-rw-r--r--zto/node/InetAddress.hpp (renamed from zerotierone/node/InetAddress.hpp)0
-rw-r--r--zto/node/MAC.hpp (renamed from zerotierone/node/MAC.hpp)0
-rw-r--r--zto/node/Membership.cpp (renamed from zerotierone/node/Membership.cpp)3
-rw-r--r--zto/node/Membership.hpp (renamed from zerotierone/node/Membership.hpp)0
-rw-r--r--zto/node/MulticastGroup.hpp (renamed from zerotierone/node/MulticastGroup.hpp)0
-rw-r--r--zto/node/Multicaster.cpp (renamed from zerotierone/node/Multicaster.cpp)0
-rw-r--r--zto/node/Multicaster.hpp (renamed from zerotierone/node/Multicaster.hpp)0
-rw-r--r--zto/node/Mutex.hpp (renamed from zerotierone/node/Mutex.hpp)0
-rw-r--r--zto/node/Network.cpp (renamed from zerotierone/node/Network.cpp)0
-rw-r--r--zto/node/Network.hpp (renamed from zerotierone/node/Network.hpp)0
-rw-r--r--zto/node/NetworkConfig.cpp (renamed from zerotierone/node/NetworkConfig.cpp)0
-rw-r--r--zto/node/NetworkConfig.hpp (renamed from zerotierone/node/NetworkConfig.hpp)0
-rw-r--r--zto/node/NetworkController.hpp (renamed from zerotierone/node/NetworkController.hpp)0
-rw-r--r--zto/node/Node.cpp (renamed from zerotierone/node/Node.cpp)0
-rw-r--r--zto/node/Node.hpp (renamed from zerotierone/node/Node.hpp)0
-rw-r--r--zto/node/NonCopyable.hpp (renamed from zerotierone/node/NonCopyable.hpp)0
-rw-r--r--zto/node/OutboundMulticast.cpp (renamed from zerotierone/node/OutboundMulticast.cpp)0
-rw-r--r--zto/node/OutboundMulticast.hpp (renamed from zerotierone/node/OutboundMulticast.hpp)0
-rw-r--r--zto/node/Packet.cpp (renamed from zerotierone/node/Packet.cpp)16
-rw-r--r--zto/node/Packet.hpp (renamed from zerotierone/node/Packet.hpp)0
-rw-r--r--zto/node/Path.cpp (renamed from zerotierone/node/Path.cpp)0
-rw-r--r--zto/node/Path.hpp (renamed from zerotierone/node/Path.hpp)2
-rw-r--r--zto/node/Peer.cpp (renamed from zerotierone/node/Peer.cpp)0
-rw-r--r--zto/node/Peer.hpp (renamed from zerotierone/node/Peer.hpp)2
-rw-r--r--zto/node/Poly1305.cpp (renamed from zerotierone/node/Poly1305.cpp)0
-rw-r--r--zto/node/Poly1305.hpp (renamed from zerotierone/node/Poly1305.hpp)0
-rw-r--r--zto/node/README.md (renamed from zerotierone/node/README.md)0
-rw-r--r--zto/node/Revocation.cpp (renamed from zerotierone/node/Revocation.cpp)0
-rw-r--r--zto/node/Revocation.hpp (renamed from zerotierone/node/Revocation.hpp)14
-rw-r--r--zto/node/RuntimeEnvironment.hpp (renamed from zerotierone/node/RuntimeEnvironment.hpp)0
-rw-r--r--zto/node/SHA512.cpp (renamed from zerotierone/node/SHA512.cpp)0
-rw-r--r--zto/node/SHA512.hpp (renamed from zerotierone/node/SHA512.hpp)0
-rw-r--r--zto/node/Salsa20.cpp (renamed from zerotierone/node/Salsa20.cpp)0
-rw-r--r--zto/node/Salsa20.hpp (renamed from zerotierone/node/Salsa20.hpp)0
-rw-r--r--zto/node/SelfAwareness.cpp (renamed from zerotierone/node/SelfAwareness.cpp)0
-rw-r--r--zto/node/SelfAwareness.hpp (renamed from zerotierone/node/SelfAwareness.hpp)0
-rw-r--r--zto/node/SharedPtr.hpp (renamed from zerotierone/node/SharedPtr.hpp)0
-rw-r--r--zto/node/Switch.cpp (renamed from zerotierone/node/Switch.cpp)4
-rw-r--r--zto/node/Switch.hpp (renamed from zerotierone/node/Switch.hpp)0
-rw-r--r--zto/node/Tag.cpp (renamed from zerotierone/node/Tag.cpp)0
-rw-r--r--zto/node/Tag.hpp (renamed from zerotierone/node/Tag.hpp)0
-rw-r--r--zto/node/Topology.cpp (renamed from zerotierone/node/Topology.cpp)73
-rw-r--r--zto/node/Topology.hpp (renamed from zerotierone/node/Topology.hpp)0
-rw-r--r--zto/node/Utils.cpp (renamed from zerotierone/node/Utils.cpp)0
-rw-r--r--zto/node/Utils.hpp (renamed from zerotierone/node/Utils.hpp)0
-rw-r--r--zto/node/World.hpp (renamed from zerotierone/node/World.hpp)0
-rw-r--r--zto/objects.mk (renamed from zerotierone/objects.mk)1
-rw-r--r--zto/one.cpp (renamed from zerotierone/one.cpp)12
-rw-r--r--zto/osdep/Arp.cpp (renamed from zerotierone/osdep/Arp.cpp)0
-rw-r--r--zto/osdep/Arp.hpp (renamed from zerotierone/osdep/Arp.hpp)0
-rw-r--r--zto/osdep/BSDEthernetTap.cpp (renamed from zerotierone/osdep/BSDEthernetTap.cpp)0
-rw-r--r--zto/osdep/BSDEthernetTap.hpp (renamed from zerotierone/osdep/BSDEthernetTap.hpp)0
-rw-r--r--zto/osdep/Binder.hpp (renamed from zerotierone/osdep/Binder.hpp)0
-rw-r--r--zto/osdep/BlockingQueue.hpp (renamed from zerotierone/osdep/BlockingQueue.hpp)0
-rw-r--r--zto/osdep/Http.cpp (renamed from zerotierone/osdep/Http.cpp)0
-rw-r--r--zto/osdep/Http.hpp (renamed from zerotierone/osdep/Http.hpp)0
-rw-r--r--zto/osdep/LinuxEthernetTap.cpp (renamed from zerotierone/osdep/LinuxEthernetTap.cpp)8
-rw-r--r--zto/osdep/LinuxEthernetTap.hpp (renamed from zerotierone/osdep/LinuxEthernetTap.hpp)2
-rw-r--r--zto/osdep/ManagedRoute.cpp (renamed from zerotierone/osdep/ManagedRoute.cpp)0
-rw-r--r--zto/osdep/ManagedRoute.hpp (renamed from zerotierone/osdep/ManagedRoute.hpp)0
-rw-r--r--zto/osdep/NeighborDiscovery.cpp (renamed from zerotierone/osdep/NeighborDiscovery.cpp)0
-rw-r--r--zto/osdep/NeighborDiscovery.hpp (renamed from zerotierone/osdep/NeighborDiscovery.hpp)0
-rw-r--r--zto/osdep/OSUtils.cpp (renamed from zerotierone/osdep/OSUtils.cpp)60
-rw-r--r--zto/osdep/OSUtils.hpp (renamed from zerotierone/osdep/OSUtils.hpp)10
-rw-r--r--zto/osdep/OSXEthernetTap.cpp (renamed from zerotierone/osdep/OSXEthernetTap.cpp)0
-rw-r--r--zto/osdep/OSXEthernetTap.hpp (renamed from zerotierone/osdep/OSXEthernetTap.hpp)0
-rw-r--r--zto/osdep/Phy.hpp (renamed from zerotierone/osdep/Phy.hpp)2
-rw-r--r--zto/osdep/PortMapper.cpp (renamed from zerotierone/osdep/PortMapper.cpp)0
-rw-r--r--zto/osdep/PortMapper.hpp (renamed from zerotierone/osdep/PortMapper.hpp)0
-rw-r--r--zto/osdep/README.md (renamed from zerotierone/osdep/README.md)0
-rw-r--r--zto/osdep/Thread.hpp (renamed from zerotierone/osdep/Thread.hpp)0
-rw-r--r--zto/osdep/WindowsEthernetTap.cpp (renamed from zerotierone/osdep/WindowsEthernetTap.cpp)0
-rw-r--r--zto/osdep/WindowsEthernetTap.hpp (renamed from zerotierone/osdep/WindowsEthernetTap.hpp)0
-rw-r--r--zto/selftest.cpp (renamed from zerotierone/selftest.cpp)0
-rw-r--r--zto/service/ClusterDefinition.hpp (renamed from zerotierone/service/ClusterDefinition.hpp)0
-rw-r--r--zto/service/ClusterGeoIpService.cpp (renamed from zerotierone/service/ClusterGeoIpService.cpp)0
-rw-r--r--zto/service/ClusterGeoIpService.hpp (renamed from zerotierone/service/ClusterGeoIpService.hpp)0
-rw-r--r--zto/service/OneService.cpp (renamed from zerotierone/service/OneService.cpp)655
-rw-r--r--zto/service/OneService.hpp (renamed from zerotierone/service/OneService.hpp)8
-rw-r--r--zto/service/README.md (renamed from zerotierone/service/README.md)0
-rw-r--r--zto/service/SoftwareUpdater.cpp (renamed from zerotierone/service/SoftwareUpdater.cpp)0
-rw-r--r--zto/service/SoftwareUpdater.hpp (renamed from zerotierone/service/SoftwareUpdater.hpp)23
-rw-r--r--zto/tcp-proxy/Makefile (renamed from zerotierone/tcp-proxy/Makefile)0
-rw-r--r--zto/tcp-proxy/README.md (renamed from zerotierone/tcp-proxy/README.md)0
-rw-r--r--zto/tcp-proxy/tcp-proxy.cpp (renamed from zerotierone/tcp-proxy/tcp-proxy.cpp)0
-rw-r--r--zto/version.h (renamed from zerotierone/version.h)4
-rw-r--r--zto/windows/README.md (renamed from zerotierone/windows/README.md)0
-rw-r--r--zto/windows/TapDriver6/TapDriver6.vcxproj (renamed from zerotierone/windows/TapDriver6/TapDriver6.vcxproj)0
-rw-r--r--zto/windows/TapDriver6/TapDriver6.vcxproj.filters (renamed from zerotierone/windows/TapDriver6/TapDriver6.vcxproj.filters)0
-rw-r--r--zto/windows/TapDriver6/adapter.c (renamed from zerotierone/windows/TapDriver6/adapter.c)0
-rw-r--r--zto/windows/TapDriver6/adapter.h (renamed from zerotierone/windows/TapDriver6/adapter.h)0
-rw-r--r--zto/windows/TapDriver6/config.h (renamed from zerotierone/windows/TapDriver6/config.h)0
-rw-r--r--zto/windows/TapDriver6/constants.h (renamed from zerotierone/windows/TapDriver6/constants.h)0
-rw-r--r--zto/windows/TapDriver6/device.c (renamed from zerotierone/windows/TapDriver6/device.c)0
-rw-r--r--zto/windows/TapDriver6/device.h (renamed from zerotierone/windows/TapDriver6/device.h)0
-rw-r--r--zto/windows/TapDriver6/endian.h (renamed from zerotierone/windows/TapDriver6/endian.h)0
-rw-r--r--zto/windows/TapDriver6/error.c (renamed from zerotierone/windows/TapDriver6/error.c)0
-rw-r--r--zto/windows/TapDriver6/error.h (renamed from zerotierone/windows/TapDriver6/error.h)0
-rw-r--r--zto/windows/TapDriver6/hexdump.h (renamed from zerotierone/windows/TapDriver6/hexdump.h)0
-rw-r--r--zto/windows/TapDriver6/lock.h (renamed from zerotierone/windows/TapDriver6/lock.h)0
-rw-r--r--zto/windows/TapDriver6/macinfo.c (renamed from zerotierone/windows/TapDriver6/macinfo.c)0
-rw-r--r--zto/windows/TapDriver6/macinfo.h (renamed from zerotierone/windows/TapDriver6/macinfo.h)0
-rw-r--r--zto/windows/TapDriver6/mem.c (renamed from zerotierone/windows/TapDriver6/mem.c)0
-rw-r--r--zto/windows/TapDriver6/mem.h (renamed from zerotierone/windows/TapDriver6/mem.h)0
-rw-r--r--zto/windows/TapDriver6/oidrequest.c (renamed from zerotierone/windows/TapDriver6/oidrequest.c)0
-rw-r--r--zto/windows/TapDriver6/proto.h (renamed from zerotierone/windows/TapDriver6/proto.h)0
-rw-r--r--zto/windows/TapDriver6/prototypes.h (renamed from zerotierone/windows/TapDriver6/prototypes.h)0
-rw-r--r--zto/windows/TapDriver6/resource.h (renamed from zerotierone/windows/TapDriver6/resource.h)0
-rw-r--r--zto/windows/TapDriver6/resource.rc (renamed from zerotierone/windows/TapDriver6/resource.rc)0
-rw-r--r--zto/windows/TapDriver6/rxpath.c (renamed from zerotierone/windows/TapDriver6/rxpath.c)0
-rw-r--r--zto/windows/TapDriver6/tap-windows.h (renamed from zerotierone/windows/TapDriver6/tap-windows.h)0
-rw-r--r--zto/windows/TapDriver6/tap.h (renamed from zerotierone/windows/TapDriver6/tap.h)0
-rw-r--r--zto/windows/TapDriver6/tapdrvr.c (renamed from zerotierone/windows/TapDriver6/tapdrvr.c)0
-rw-r--r--zto/windows/TapDriver6/txpath.c (renamed from zerotierone/windows/TapDriver6/txpath.c)0
-rw-r--r--zto/windows/TapDriver6/types.h (renamed from zerotierone/windows/TapDriver6/types.h)0
-rw-r--r--zto/windows/TapDriver6/zttap300.inf (renamed from zerotierone/windows/TapDriver6/zttap300.inf)0
-rw-r--r--zto/windows/WinUI/APIHandler.cs (renamed from zerotierone/windows/WinUI/APIHandler.cs)27
-rw-r--r--zto/windows/WinUI/AboutView.xaml (renamed from zerotierone/windows/WinUI/AboutView.xaml)0
-rw-r--r--zto/windows/WinUI/AboutView.xaml.cs (renamed from zerotierone/windows/WinUI/AboutView.xaml.cs)0
-rw-r--r--zto/windows/WinUI/App.config (renamed from zerotierone/windows/WinUI/App.config)0
-rw-r--r--zto/windows/WinUI/App.xaml (renamed from zerotierone/windows/WinUI/App.xaml)0
-rw-r--r--zto/windows/WinUI/App.xaml.cs (renamed from zerotierone/windows/WinUI/App.xaml.cs)0
-rw-r--r--zto/windows/WinUI/JoinNetworkView.xaml (renamed from zerotierone/windows/WinUI/JoinNetworkView.xaml)0
-rw-r--r--zto/windows/WinUI/JoinNetworkView.xaml.cs (renamed from zerotierone/windows/WinUI/JoinNetworkView.xaml.cs)0
-rw-r--r--zto/windows/WinUI/MainWindow.xaml.cs (renamed from zerotierone/windows/WinUI/MainWindow.xaml.cs)0
-rw-r--r--zto/windows/WinUI/NetworkInfoView.xaml (renamed from zerotierone/windows/WinUI/NetworkInfoView.xaml)0
-rw-r--r--zto/windows/WinUI/NetworkInfoView.xaml.cs (renamed from zerotierone/windows/WinUI/NetworkInfoView.xaml.cs)0
-rw-r--r--zto/windows/WinUI/NetworkListView.xaml (renamed from zerotierone/windows/WinUI/NetworkListView.xaml)0
-rw-r--r--zto/windows/WinUI/NetworkListView.xaml.cs (renamed from zerotierone/windows/WinUI/NetworkListView.xaml.cs)0
-rw-r--r--zto/windows/WinUI/NetworkMonitor.cs (renamed from zerotierone/windows/WinUI/NetworkMonitor.cs)5
-rw-r--r--zto/windows/WinUI/NetworkRoute.cs (renamed from zerotierone/windows/WinUI/NetworkRoute.cs)0
-rw-r--r--zto/windows/WinUI/NetworksPage.xaml (renamed from zerotierone/windows/WinUI/NetworksPage.xaml)0
-rw-r--r--zto/windows/WinUI/NetworksPage.xaml.cs (renamed from zerotierone/windows/WinUI/NetworksPage.xaml.cs)0
-rw-r--r--zto/windows/WinUI/PeersPage.xaml (renamed from zerotierone/windows/WinUI/PeersPage.xaml)0
-rw-r--r--zto/windows/WinUI/PeersPage.xaml.cs (renamed from zerotierone/windows/WinUI/PeersPage.xaml.cs)0
-rw-r--r--zto/windows/WinUI/PreferencesView.xaml (renamed from zerotierone/windows/WinUI/PreferencesView.xaml)0
-rw-r--r--zto/windows/WinUI/PreferencesView.xaml.cs (renamed from zerotierone/windows/WinUI/PreferencesView.xaml.cs)0
-rw-r--r--zto/windows/WinUI/Properties/AssemblyInfo.cs (renamed from zerotierone/windows/WinUI/Properties/AssemblyInfo.cs)0
-rw-r--r--zto/windows/WinUI/Properties/Resources.Designer.cs (renamed from zerotierone/windows/WinUI/Properties/Resources.Designer.cs)0
-rw-r--r--zto/windows/WinUI/Properties/Resources.resx (renamed from zerotierone/windows/WinUI/Properties/Resources.resx)0
-rw-r--r--zto/windows/WinUI/Properties/Settings.Designer.cs (renamed from zerotierone/windows/WinUI/Properties/Settings.Designer.cs)0
-rw-r--r--zto/windows/WinUI/Properties/Settings.settings (renamed from zerotierone/windows/WinUI/Properties/Settings.settings)0
-rw-r--r--zto/windows/WinUI/Resources/ZeroTierIcon.ico (renamed from zerotierone/windows/WinUI/Resources/ZeroTierIcon.ico)bin45451 -> 45451 bytes
-rw-r--r--zto/windows/WinUI/Simple Styles.xaml (renamed from zerotierone/windows/WinUI/Simple Styles.xaml)0
-rw-r--r--zto/windows/WinUI/Themes/Generic.xaml (renamed from zerotierone/windows/WinUI/Themes/Generic.xaml)0
-rw-r--r--zto/windows/WinUI/ToolbarItem.xaml (renamed from zerotierone/windows/WinUI/ToolbarItem.xaml)0
-rw-r--r--zto/windows/WinUI/ToolbarItem.xaml.cs (renamed from zerotierone/windows/WinUI/ToolbarItem.xaml.cs)0
-rw-r--r--zto/windows/WinUI/WinUI.csproj (renamed from zerotierone/windows/WinUI/WinUI.csproj)0
-rw-r--r--zto/windows/WinUI/ZeroTierIcon.ico (renamed from zerotierone/windows/WinUI/ZeroTierIcon.ico)bin370070 -> 370070 bytes
-rw-r--r--zto/windows/WinUI/ZeroTierNetwork.cs (renamed from zerotierone/windows/WinUI/ZeroTierNetwork.cs)0
-rw-r--r--zto/windows/WinUI/ZeroTierPeer.cs (renamed from zerotierone/windows/WinUI/ZeroTierPeer.cs)0
-rw-r--r--zto/windows/WinUI/ZeroTierPeerPhysicalPath.cs (renamed from zerotierone/windows/WinUI/ZeroTierPeerPhysicalPath.cs)0
-rw-r--r--zto/windows/WinUI/ZeroTierStatus.cs (renamed from zerotierone/windows/WinUI/ZeroTierStatus.cs)0
-rw-r--r--zto/windows/WinUI/app.manifest (renamed from zerotierone/windows/WinUI/app.manifest)0
-rw-r--r--zto/windows/WinUI/packages.config (renamed from zerotierone/windows/WinUI/packages.config)0
-rw-r--r--zto/windows/ZeroTierOne.sln (renamed from zerotierone/windows/ZeroTierOne.sln)112
-rw-r--r--zto/windows/copyutil/App.config (renamed from zerotierone/windows/copyutil/App.config)0
-rw-r--r--zto/windows/copyutil/Program.cs (renamed from zerotierone/windows/copyutil/Program.cs)0
-rw-r--r--zto/windows/copyutil/Properties/AssemblyInfo.cs (renamed from zerotierone/windows/copyutil/Properties/AssemblyInfo.cs)0
-rw-r--r--zto/windows/copyutil/copyutil.csproj (renamed from zerotierone/windows/copyutil/copyutil.csproj)0
-rw-r--r--zto/windows/packages/.gitignore (renamed from zerotierone/windows/packages/.gitignore)0
-rw-r--r--zto/windows/packages/repositories.config (renamed from zerotierone/windows/packages/repositories.config)0
-rw-r--r--zto/zerotier-one.spec (renamed from zerotierone/zerotier-one.spec)50
383 files changed, 919 insertions, 7839 deletions
diff --git a/zerotierone/java/CMakeLists.txt b/zerotierone/java/CMakeLists.txt
deleted file mode 100644
index 008b747..0000000
--- a/zerotierone/java/CMakeLists.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-cmake_minimum_required(VERSION 3.2)
-
-project(ZeroTierOneJNI)
-
-find_package(Java COMPONENTS Development)
-message("JAVA_HOME: $ENV{JAVA_HOME}")
-
-if(WIN32)
-set(Java_INCLUDE_DIRS $ENV{JAVA_HOME}/include)
-endif()
-
-if(APPLE)
-set(Java_INCLUDE_DIRS "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/JavaVM.framework/Headers")
-endif()
-
-message("Java Include Dirs: ${Java_INCLUDE_DIRS}")
-
-if(WIN32)
- add_definitions(-DNOMINMAX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /MP")
-endif()
-
-if(APPLE)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386 -arch x86_64 -Wall -O3 -flto -fPIE -fvectorize -fstack-protector -mmacosx-version-min=10.7 -Wno-unused-private-field")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -fno-rtti")
-endif()
-
-set(src_files
- ../ext/lz4/lz4.c
- ../ext/json-parser/json.c
- ../ext/http-parser/http_parser.c
- ../node/C25519.cpp
- ../node/CertificateOfMembership.cpp
- ../node/Defaults.cpp
- ../node/Dictionary.cpp
- ../node/Identity.cpp
- ../node/IncomingPacket.cpp
- ../node/InetAddress.cpp
- ../node/Multicaster.cpp
- ../node/Network.cpp
- ../node/NetworkConfig.cpp
- ../node/Node.cpp
- ../node/OutboundMulticast.cpp
- ../node/Packet.cpp
- ../node/Peer.cpp
- ../node/Poly1305.cpp
- ../node/Salsa20.cpp
- ../node/SelfAwareness.cpp
- ../node/SHA512.cpp
- ../node/Switch.cpp
- ../node/Topology.cpp
- ../node/Utils.cpp
- ../osdep/Http.cpp
- ../osdep/OSUtils.cpp
- jni/com_zerotierone_sdk_Node.cpp
- jni/ZT_jniutils.cpp
- jni/ZT_jnicache.cpp
- )
-
-set(include_dirs
- ${CMAKE_CURRENT_SOURCE_DIR}/../include/
- ${CMAKE_CURRENT_SOURCE_DIR}/../node/
- ${Java_INCLUDE_DIRS})
-
-if(WIN32)
- set(include_dirs
- ${include_dirs}
- ${Java_INCLUDE_DIRS}/win32)
-endif()
-
-include_directories(
- ${include_dirs}
- )
-
-add_library(${PROJECT_NAME} SHARED ${src_files})
-
-if(APPLE)
- set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".jnilib")
-endif()
-
-set(link_libs )
-
-if(WIN32)
- set(link_libs
- wsock32
- ws2_32
-
- )
-endif()
-
-target_link_libraries(${PROJECT_NAME} ${link_libs}) \ No newline at end of file
diff --git a/zerotierone/java/README.md b/zerotierone/java/README.md
deleted file mode 100644
index 2650ec3..0000000
--- a/zerotierone/java/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-ZeroTier One SDK - Android JNI Wrapper
-=====
-
-
-Building
------
-
-Reqires:
-
-* JDK
-* ANT
-* Android NDK
-
-Required Environment Variables:
-
-* NDK\_BUILD\_LOC - Path do the ndk-build script in the Android NDK
-* ANDROID\_PLATFORM - path to the directory android.jar lives (on Windows: C:\Users\<username>\AppData\Local\Android\sdk\platforms\android-21)
diff --git a/zerotierone/java/build.xml b/zerotierone/java/build.xml
deleted file mode 100644
index 4604ad6..0000000
--- a/zerotierone/java/build.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<project default="build_jar" name="ZeroTierOneSDK" basedir=".">
- <property environment="env"/>
-
- <condition property="isWindows">
- <os family="windows"/>
- </condition>
-
- <condition property="isMac">
- <os family="mac"/>
- </condition>
-
- <target name="clean_ant">
- <delete dir="bin" failonerror="false"/>
- <delete dir="classes" failonerror="false"/>
- <delete dir="build_win32" failonerror="false"/>
- <delete dir="build_win64" failonerror="false"/>
- <delete dir="mac32_64" failonerror="false"/>
- <delete dir="libs" failonerror="false"/>
- <delete dir="obj" failonerror="false"/>
- </target>
-
- <target name="build_java">
- <echo message="os.name = ${os.name}"/>
- <echo message="os.arch = ${os.arch}"/>
- <echo message="ant.java.version = ${ant.java.version}"/>
- <echo message="java.version = ${java.version}"/>
- <echo message="ndk.loc = ${env.NDK_BUILD_LOC}"/>
- <echo message="sdk.loc = ${env.ANDROID_PLATFORM}"/>
- <echo message="user.dir = ${user.dir}"/>
- <echo message="zt1.dir = ${env.ZT}"/>
- <mkdir dir="bin"/>
- <mkdir dir="classes"/>
- <javac srcdir="src"
- destdir="classes"
- source="1.7"
- target="1.7"
- classpath="${env.ANDROID_PLATFORM}/android.jar"
- includeantruntime="false"/>
- </target>
-
- <target name="build_android">
- <exec dir="jni" executable="${env.NDK_BUILD_LOC}" failonerror="true">
- <arg value="ZT1=${env.ZT}"/>
- <arg value="V=1"/>
- <!-- <arg value="NDK_DEBUG=1"/> -->
- </exec>
- <copy file="libs/arm64-v8a/libZeroTierOneJNI.so"
- tofile="classes/lib/arm64-v8a/libZeroTierOneJNI.so"
- overwrite="true"/>
- <copy file="libs/armeabi/libZeroTierOneJNI.so"
- tofile="classes/lib/armeabi/libZeroTierOneJNI.so"
- overwrite="true"/>
- <copy file="libs/armeabi-v7a/libZeroTierOneJNI.so"
- tofile="classes/lib/armeabi-v7a/libZeroTierOneJNI.so"
- overwrite="true"/>
- <copy file="libs/mips/libZeroTierOneJNI.so"
- tofile="classes/lib/mips/libZeroTierOneJNI.so"
- overwrite="true"/>
- <copy file="libs/mips64/libZeroTierOneJNI.so"
- tofile="classes/lib/mips64/libZeroTierOne.so"
- overwrite="true"/>
- <copy file="libs/x86/libZeroTierOneJNI.so"
- tofile="classes/lib/x86/libZeroTierOneJNI.so"
- overwrite="true"/>
- <copy file="libs/x86_64/libZeroTierOneJNI.so"
- tofile="classes/lib/x86_64/libZeroTierOneJNI.so"
- overwrite="true"/>
- </target>
-
-
- <target name="windows" if="isWindows">
- <mkdir dir="build_win32"/>
- <exec dir="build_win32/" executable="cmake" failonerror="true">
- <arg line=".. -G&quot;Visual Studio 11 2012&quot; -DCMAKE_BUILD_TYPE=Release"/>
- </exec>
- <exec dir="build_win32/" executable="cmake" failonerror="true">
- <arg line="--build . --config Release"/>
- </exec>
- <copy file="build_win32/Release/ZeroTierOneJNI.dll"
- tofile="classes/lib/ZeroTierOneJNI_win32.dll"
- overwrite="true"/>
-
- <mkdir dir="build_win64"/>
- <exec dir="build_win64/" executable="cmake" failonerror="true">
- <arg line=".. -G&quot;Visual Studio 11 2012 Win64&quot; -DCMAKE_BUILD_TYPE=Release"/>
- </exec>
- <exec dir="build_win64/" executable="cmake" failonerror="true">
- <arg line="--build . --config Release"/>
- </exec>
- <copy file="build_win64/Release/ZeroTierOneJNI.dll"
- tofile="classes/lib/ZeroTierOneJNI_win64.dll"
- overwrite="true"/>
- </target>
-
- <target name="mac" if="isMac">
- <mkdir dir="mac32_64"/>
- <exec dir="mac32_64/" executable="cmake" failonerror="true">
- <arg line=".. -DCMAKE_BUILD_TYPE=Release"/>
- </exec>
- <exec dir="mac32_64/" executable="cmake" failonerror="true">
- <arg line="--build . --config Release"/>
- </exec>
- <copy file="mac32_64/libZeroTierOneJNI.jnilib"
- tofile="classes/lib/libZeroTierOneJNI.jnilib"
- overwrite="true"/>
- </target>
-
- <target name="build_jar" depends="build_java,build_android,windows,mac">
- <jar destfile="bin/ZeroTierOneSDK.jar" basedir="classes"/>
- </target>
-
- <target name="docs">
- <echo message="Generating Javadocs"/>
- <mkdir dir="doc/"/>
- <javadoc sourcepath="src/"
- destdir="doc/"/>
- </target>
-</project> \ No newline at end of file
diff --git a/zerotierone/java/jni/Android.mk b/zerotierone/java/jni/Android.mk
deleted file mode 100644
index ebd8937..0000000
--- a/zerotierone/java/jni/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := ZeroTierOneJNI
-LOCAL_C_INCLUDES := $(ZT1)/include
-LOCAL_C_INCLUDES += $(ZT1)/node
-LOCAL_LDLIBS := -llog -latomic
-# LOCAL_CFLAGS := -g
-
-# ZeroTierOne SDK source files
-LOCAL_SRC_FILES := \
- $(ZT1)/node/C25519.cpp \
- $(ZT1)/node/Capability.cpp \
- $(ZT1)/node/CertificateOfMembership.cpp \
- $(ZT1)/node/CertificateOfOwnership.cpp \
- $(ZT1)/node/Identity.cpp \
- $(ZT1)/node/IncomingPacket.cpp \
- $(ZT1)/node/InetAddress.cpp \
- $(ZT1)/node/Membership.cpp \
- $(ZT1)/node/Multicaster.cpp \
- $(ZT1)/node/Network.cpp \
- $(ZT1)/node/NetworkConfig.cpp \
- $(ZT1)/node/Node.cpp \
- $(ZT1)/node/OutboundMulticast.cpp \
- $(ZT1)/node/Packet.cpp \
- $(ZT1)/node/Path.cpp \
- $(ZT1)/node/Peer.cpp \
- $(ZT1)/node/Poly1305.cpp \
- $(ZT1)/node/Revocation.cpp \
- $(ZT1)/node/Salsa20.cpp \
- $(ZT1)/node/SelfAwareness.cpp \
- $(ZT1)/node/SHA512.cpp \
- $(ZT1)/node/Switch.cpp \
- $(ZT1)/node/Tag.cpp \
- $(ZT1)/node/Topology.cpp \
- $(ZT1)/node/Utils.cpp
-
-
-# JNI Files
-LOCAL_SRC_FILES += \
- com_zerotierone_sdk_Node.cpp \
- ZT_jniutils.cpp \
- ZT_jnilookup.cpp
-
-include $(BUILD_SHARED_LIBRARY) \ No newline at end of file
diff --git a/zerotierone/java/jni/Application.mk b/zerotierone/java/jni/Application.mk
deleted file mode 100644
index 6950c0e..0000000
--- a/zerotierone/java/jni/Application.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# NDK_TOOLCHAIN_VERSION := clang3.5
-APP_STL := gnustl_static
-APP_CPPFLAGS := -O3 -fPIC -fPIE -Wall -fstack-protector -fexceptions -fno-strict-aliasing -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
-APP_PLATFORM := android-14
-APP_ABI := all
diff --git a/zerotierone/java/jni/ZT_jnilookup.cpp b/zerotierone/java/jni/ZT_jnilookup.cpp
deleted file mode 100644
index be52a36..0000000
--- a/zerotierone/java/jni/ZT_jnilookup.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-#include "ZT_jnilookup.h"
-#include "ZT_jniutils.h"
-
-JniLookup::JniLookup()
- : m_jvm(NULL)
-{
- LOGV("JNI Cache Created");
-}
-
-JniLookup::JniLookup(JavaVM *jvm)
- : m_jvm(jvm)
-{
- LOGV("JNI Cache Created");
-}
-
-JniLookup::~JniLookup()
-{
- LOGV("JNI Cache Destroyed");
-}
-
-
-void JniLookup::setJavaVM(JavaVM *jvm)
-{
- LOGV("Assigned JVM to object");
- m_jvm = jvm;
-}
-
-
-jclass JniLookup::findClass(const std::string &name)
-{
- if(!m_jvm)
- return NULL;
-
- // get the class from the JVM
- JNIEnv *env = NULL;
- if(m_jvm->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK)
- {
- LOGE("Error retreiving JNI Environment");
- return NULL;
- }
-
- jclass cls = env->FindClass(name.c_str());
- if(env->ExceptionCheck())
- {
- LOGE("Error finding class: %s", name.c_str());
- return NULL;
- }
-
- return cls;
-}
-
-
-jmethodID JniLookup::findMethod(jclass cls, const std::string &methodName, const std::string &methodSig)
-{
- if(!m_jvm)
- return NULL;
-
- JNIEnv *env = NULL;
- if(m_jvm->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK)
- {
- return NULL;
- }
-
- jmethodID mid = env->GetMethodID(cls, methodName.c_str(), methodSig.c_str());
- if(env->ExceptionCheck())
- {
- return NULL;
- }
-
- return mid;
-}
-
-jmethodID JniLookup::findStaticMethod(jclass cls, const std::string &methodName, const std::string &methodSig)
-{
- if(!m_jvm)
- return NULL;
-
- JNIEnv *env = NULL;
- if(m_jvm->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK)
- {
- return NULL;
- }
-
- jmethodID mid = env->GetStaticMethodID(cls, methodName.c_str(), methodSig.c_str());
- if(env->ExceptionCheck())
- {
- return NULL;
- }
-
- return mid;
-}
-
-jfieldID JniLookup::findField(jclass cls, const std::string &fieldName, const std::string &typeStr)
-{
- if(!m_jvm)
- return NULL;
-
- JNIEnv *env = NULL;
- if(m_jvm->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK)
- {
- return NULL;
- }
-
- jfieldID fid = env->GetFieldID(cls, fieldName.c_str(), typeStr.c_str());
- if(env->ExceptionCheck())
- {
- return NULL;
- }
-
- return fid;
-}
-
-jfieldID JniLookup::findStaticField(jclass cls, const std::string &fieldName, const std::string &typeStr)
-{
- if(!m_jvm)
- return NULL;
-
- JNIEnv *env = NULL;
- if(m_jvm->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK)
- {
- return NULL;
- }
-
- jfieldID fid = env->GetStaticFieldID(cls, fieldName.c_str(), typeStr.c_str());
- if(env->ExceptionCheck())
- {
- return NULL;
- }
-
- return fid;
-} \ No newline at end of file
diff --git a/zerotierone/java/jni/ZT_jnilookup.h b/zerotierone/java/jni/ZT_jnilookup.h
deleted file mode 100644
index f5bd97d..0000000
--- a/zerotierone/java/jni/ZT_jnilookup.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-#ifndef ZT_JNILOOKUP_H_
-#define ZT_JNILOOKUP_H_
-
-#include <jni.h>
-#include <map>
-#include <string>
-
-
-
-class JniLookup {
-public:
- JniLookup();
- JniLookup(JavaVM *jvm);
- ~JniLookup();
-
- void setJavaVM(JavaVM *jvm);
-
- jclass findClass(const std::string &name);
- jmethodID findMethod(jclass cls, const std::string &methodName, const std::string &methodSig);
- jmethodID findStaticMethod(jclass cls, const std::string &methodName, const std::string &methodSig);
- jfieldID findField(jclass cls, const std::string &fieldName, const std::string &typeStr);
- jfieldID findStaticField(jclass cls, const std::string &fieldName, const std::string &typeStr);
-private:
- JavaVM *m_jvm;
-};
-
-#endif \ No newline at end of file
diff --git a/zerotierone/java/jni/ZT_jniutils.cpp b/zerotierone/java/jni/ZT_jniutils.cpp
deleted file mode 100644
index 7bdc761..0000000
--- a/zerotierone/java/jni/ZT_jniutils.cpp
+++ /dev/null
@@ -1,941 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ZT_jniutils.h"
-#include "ZT_jnilookup.h"
-#include <string>
-#include <assert.h>
-
-extern JniLookup lookup;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-jobject createResultObject(JNIEnv *env, ZT_ResultCode code)
-{
- jclass resultClass = NULL;
-
- jobject resultObject = NULL;
-
- resultClass = lookup.findClass("com/zerotier/sdk/ResultCode");
- if(resultClass == NULL)
- {
- LOGE("Couldnt find ResultCode class");
- return NULL; // exception thrown
- }
-
- std::string fieldName;
- switch(code)
- {
- case ZT_RESULT_OK:
- LOGV("ZT_RESULT_OK");
- fieldName = "RESULT_OK";
- break;
- case ZT_RESULT_FATAL_ERROR_OUT_OF_MEMORY:
- LOGV("ZT_RESULT_FATAL_ERROR_OUT_OF_MEMORY");
- fieldName = "RESULT_FATAL_ERROR_OUT_OF_MEMORY";
- break;
- case ZT_RESULT_FATAL_ERROR_DATA_STORE_FAILED:
- LOGV("RESULT_FATAL_ERROR_DATA_STORE_FAILED");
- fieldName = "RESULT_FATAL_ERROR_DATA_STORE_FAILED";
- break;
- case ZT_RESULT_ERROR_NETWORK_NOT_FOUND:
- LOGV("RESULT_FATAL_ERROR_DATA_STORE_FAILED");
- fieldName = "RESULT_ERROR_NETWORK_NOT_FOUND";
- break;
- case ZT_RESULT_FATAL_ERROR_INTERNAL:
- default:
- LOGV("RESULT_FATAL_ERROR_DATA_STORE_FAILED");
- fieldName = "RESULT_FATAL_ERROR_INTERNAL";
- break;
- }
-
- jfieldID enumField = lookup.findStaticField(resultClass, fieldName.c_str(), "Lcom/zerotier/sdk/ResultCode;");
- if(env->ExceptionCheck() || enumField == NULL)
- {
- LOGE("Error on FindStaticField");
- return NULL;
- }
-
- resultObject = env->GetStaticObjectField(resultClass, enumField);
- if(env->ExceptionCheck() || resultObject == NULL)
- {
- LOGE("Error on GetStaticObjectField");
- }
- return resultObject;
-}
-
-
-jobject createVirtualNetworkStatus(JNIEnv *env, ZT_VirtualNetworkStatus status)
-{
- jobject statusObject = NULL;
-
- jclass statusClass = lookup.findClass("com/zerotier/sdk/VirtualNetworkStatus");
- if(statusClass == NULL)
- {
- return NULL; // exception thrown
- }
-
- std::string fieldName;
- switch(status)
- {
- case ZT_NETWORK_STATUS_REQUESTING_CONFIGURATION:
- fieldName = "NETWORK_STATUS_REQUESTING_CONFIGURATION";
- break;
- case ZT_NETWORK_STATUS_OK:
- fieldName = "NETWORK_STATUS_OK";
- break;
- case ZT_NETWORK_STATUS_ACCESS_DENIED:
- fieldName = "NETWORK_STATUS_ACCESS_DENIED";
- break;
- case ZT_NETWORK_STATUS_NOT_FOUND:
- fieldName = "NETWORK_STATUS_NOT_FOUND";
- break;
- case ZT_NETWORK_STATUS_PORT_ERROR:
- fieldName = "NETWORK_STATUS_PORT_ERROR";
- break;
- case ZT_NETWORK_STATUS_CLIENT_TOO_OLD:
- fieldName = "NETWORK_STATUS_CLIENT_TOO_OLD";
- break;
- }
-
- jfieldID enumField = lookup.findStaticField(statusClass, fieldName.c_str(), "Lcom/zerotier/sdk/VirtualNetworkStatus;");
-
- statusObject = env->GetStaticObjectField(statusClass, enumField);
-
- return statusObject;
-}
-
-jobject createEvent(JNIEnv *env, ZT_Event event)
-{
- jclass eventClass = NULL;
- jobject eventObject = NULL;
-
- eventClass = lookup.findClass("com/zerotier/sdk/Event");
- if(eventClass == NULL)
- {
- return NULL;
- }
-
- std::string fieldName;
- switch(event)
- {
- case ZT_EVENT_UP:
- fieldName = "EVENT_UP";
- break;
- case ZT_EVENT_OFFLINE:
- fieldName = "EVENT_OFFLINE";
- break;
- case ZT_EVENT_ONLINE:
- fieldName = "EVENT_ONLINE";
- break;
- case ZT_EVENT_DOWN:
- fieldName = "EVENT_DOWN";
- break;
- case ZT_EVENT_FATAL_ERROR_IDENTITY_COLLISION:
- fieldName = "EVENT_FATAL_ERROR_IDENTITY_COLLISION";
- break;
- case ZT_EVENT_TRACE:
- fieldName = "EVENT_TRACE";
- break;
- case ZT_EVENT_USER_MESSAGE:
- break;
- }
-
- jfieldID enumField = lookup.findStaticField(eventClass, fieldName.c_str(), "Lcom/zerotier/sdk/Event;");
-
- eventObject = env->GetStaticObjectField(eventClass, enumField);
-
- return eventObject;
-}
-
-jobject createPeerRole(JNIEnv *env, ZT_PeerRole role)
-{
- jclass peerRoleClass = NULL;
- jobject peerRoleObject = NULL;
-
- peerRoleClass = lookup.findClass("com/zerotier/sdk/PeerRole");
- if(peerRoleClass == NULL)
- {
- return NULL;
- }
-
- std::string fieldName;
- switch(role)
- {
- case ZT_PEER_ROLE_LEAF:
- fieldName = "PEER_ROLE_LEAF";
- break;
- case ZT_PEER_ROLE_MOON:
- fieldName = "PEER_ROLE_MOON";
- break;
- case ZT_PEER_ROLE_PLANET:
- fieldName = "PEER_ROLE_PLANET";
- break;
- }
-
- jfieldID enumField = lookup.findStaticField(peerRoleClass, fieldName.c_str(), "Lcom/zerotier/sdk/PeerRole;");
-
- peerRoleObject = env->GetStaticObjectField(peerRoleClass, enumField);
-
- return peerRoleObject;
-}
-
-jobject createVirtualNetworkType(JNIEnv *env, ZT_VirtualNetworkType type)
-{
- jclass vntypeClass = NULL;
- jobject vntypeObject = NULL;
-
- vntypeClass = lookup.findClass("com/zerotier/sdk/VirtualNetworkType");
- if(env->ExceptionCheck() || vntypeClass == NULL)
- {
- return NULL;
- }
-
- std::string fieldName;
- switch(type)
- {
- case ZT_NETWORK_TYPE_PRIVATE:
- fieldName = "NETWORK_TYPE_PRIVATE";
- break;
- case ZT_NETWORK_TYPE_PUBLIC:
- fieldName = "NETWORK_TYPE_PUBLIC";
- break;
- }
-
- jfieldID enumField = lookup.findStaticField(vntypeClass, fieldName.c_str(), "Lcom/zerotier/sdk/VirtualNetworkType;");
- vntypeObject = env->GetStaticObjectField(vntypeClass, enumField);
- return vntypeObject;
-}
-
-jobject createVirtualNetworkConfigOperation(JNIEnv *env, ZT_VirtualNetworkConfigOperation op)
-{
- jclass vnetConfigOpClass = NULL;
- jobject vnetConfigOpObject = NULL;
-
- vnetConfigOpClass = lookup.findClass("com/zerotier/sdk/VirtualNetworkConfigOperation");
- if(env->ExceptionCheck() || vnetConfigOpClass == NULL)
- {
- return NULL;
- }
-
- std::string fieldName;
- switch(op)
- {
- case ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_UP:
- fieldName = "VIRTUAL_NETWORK_CONFIG_OPERATION_UP";
- break;
- case ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE:
- fieldName = "VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE";
- break;
- case ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DOWN:
- fieldName = "VIRTUAL_NETWORK_CONFIG_OPERATION_DOWN";
- break;
- case ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY:
- fieldName = "VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY";
- break;
- }
-
- jfieldID enumField = lookup.findStaticField(vnetConfigOpClass, fieldName.c_str(), "Lcom/zerotier/sdk/VirtualNetworkConfigOperation;");
- vnetConfigOpObject = env->GetStaticObjectField(vnetConfigOpClass, enumField);
- return vnetConfigOpObject;
-}
-
-jobject newInetAddress(JNIEnv *env, const sockaddr_storage &addr)
-{
- LOGV("newInetAddress");
- jclass inetAddressClass = NULL;
- jmethodID inetAddress_getByAddress = NULL;
-
- inetAddressClass = lookup.findClass("java/net/InetAddress");
- if(env->ExceptionCheck() || inetAddressClass == NULL)
- {
- LOGE("Error finding InetAddress class");
- return NULL;
- }
-
- inetAddress_getByAddress = lookup.findStaticMethod(
- inetAddressClass, "getByAddress", "([B)Ljava/net/InetAddress;");
- if(env->ExceptionCheck() || inetAddress_getByAddress == NULL)
- {
- LOGE("Erorr finding getByAddress() static method");
- return NULL;
- }
-
- jobject inetAddressObj = NULL;
- switch(addr.ss_family)
- {
- case AF_INET6:
- {
- sockaddr_in6 *ipv6 = (sockaddr_in6*)&addr;
- jbyteArray buff = env->NewByteArray(16);
- if(buff == NULL)
- {
- LOGE("Error creating IPV6 byte array");
- return NULL;
- }
-
- env->SetByteArrayRegion(buff, 0, 16, (jbyte*)ipv6->sin6_addr.s6_addr);
- inetAddressObj = env->CallStaticObjectMethod(
- inetAddressClass, inetAddress_getByAddress, buff);
- }
- break;
- case AF_INET:
- {
- sockaddr_in *ipv4 = (sockaddr_in*)&addr;
- jbyteArray buff = env->NewByteArray(4);
- if(buff == NULL)
- {
- LOGE("Error creating IPV4 byte array");
- return NULL;
- }
-
- env->SetByteArrayRegion(buff, 0, 4, (jbyte*)&ipv4->sin_addr);
- inetAddressObj = env->CallStaticObjectMethod(
- inetAddressClass, inetAddress_getByAddress, buff);
- }
- break;
- }
- if(env->ExceptionCheck() || inetAddressObj == NULL) {
- LOGE("Error creating InetAddress object");
- return NULL;
- }
-
- return inetAddressObj;
-}
-
-jobject newInetSocketAddress(JNIEnv *env, const sockaddr_storage &addr)
-{
- LOGV("newInetSocketAddress Called");
- jclass inetSocketAddressClass = NULL;
- jmethodID inetSocketAddress_constructor = NULL;
-
- inetSocketAddressClass = lookup.findClass("java/net/InetSocketAddress");
- if(env->ExceptionCheck() || inetSocketAddressClass == NULL)
- {
- LOGE("Error finding InetSocketAddress Class");
- return NULL;
- }
-
- jobject inetAddressObject = NULL;
-
- if(addr.ss_family != 0)
- {
- inetAddressObject = newInetAddress(env, addr);
-
- if(env->ExceptionCheck() || inetAddressObject == NULL)
- {
- LOGE("Error creating new inet address");
- return NULL;
- }
- }
- else
- {
- return NULL;
- }
-
- inetSocketAddress_constructor = lookup.findMethod(
- inetSocketAddressClass, "<init>", "(Ljava/net/InetAddress;I)V");
- if(env->ExceptionCheck() || inetSocketAddress_constructor == NULL)
- {
- LOGE("Error finding InetSocketAddress constructor");
- return NULL;
- }
-
- int port = 0;
- switch(addr.ss_family)
- {
- case AF_INET6:
- {
- LOGV("IPV6 Address");
- sockaddr_in6 *ipv6 = (sockaddr_in6*)&addr;
- port = ntohs(ipv6->sin6_port);
- LOGV("Port %d", port);
- }
- break;
- case AF_INET:
- {
- LOGV("IPV4 Address");
- sockaddr_in *ipv4 = (sockaddr_in*)&addr;
- port = ntohs(ipv4->sin_port);
- LOGV("Port: %d", port);
- }
- break;
- default:
- {
- break;
- }
- }
-
-
- jobject inetSocketAddressObject = env->NewObject(inetSocketAddressClass, inetSocketAddress_constructor, inetAddressObject, port);
- if(env->ExceptionCheck() || inetSocketAddressObject == NULL) {
- LOGE("Error creating InetSocketAddress object");
- }
- return inetSocketAddressObject;
-}
-
-jobject newPeerPhysicalPath(JNIEnv *env, const ZT_PeerPhysicalPath &ppp)
-{
- LOGV("newPeerPhysicalPath Called");
- jclass pppClass = NULL;
-
- jfieldID addressField = NULL;
- jfieldID lastSendField = NULL;
- jfieldID lastReceiveField = NULL;
- jfieldID preferredField = NULL;
-
- jmethodID ppp_constructor = NULL;
-
- pppClass = lookup.findClass("com/zerotier/sdk/PeerPhysicalPath");
- if(env->ExceptionCheck() || pppClass == NULL)
- {
- LOGE("Error finding PeerPhysicalPath class");
- return NULL;
- }
-
- addressField = lookup.findField(pppClass, "address", "Ljava/net/InetSocketAddress;");
- if(env->ExceptionCheck() || addressField == NULL)
- {
- LOGE("Error finding address field");
- return NULL;
- }
-
- lastSendField = lookup.findField(pppClass, "lastSend", "J");
- if(env->ExceptionCheck() || lastSendField == NULL)
- {
- LOGE("Error finding lastSend field");
- return NULL;
- }
-
- lastReceiveField = lookup.findField(pppClass, "lastReceive", "J");
- if(env->ExceptionCheck() || lastReceiveField == NULL)
- {
- LOGE("Error finding lastReceive field");
- return NULL;
- }
-
- preferredField = lookup.findField(pppClass, "preferred", "Z");
- if(env->ExceptionCheck() || preferredField == NULL)
- {
- LOGE("Error finding preferred field");
- return NULL;
- }
-
- ppp_constructor = lookup.findMethod(pppClass, "<init>", "()V");
- if(env->ExceptionCheck() || ppp_constructor == NULL)
- {
- LOGE("Error finding PeerPhysicalPath constructor");
- return NULL;
- }
-
- jobject pppObject = env->NewObject(pppClass, ppp_constructor);
- if(env->ExceptionCheck() || pppObject == NULL)
- {
- LOGE("Error creating PPP object");
- return NULL; // out of memory
- }
-
- jobject addressObject = newInetSocketAddress(env, ppp.address);
- if(env->ExceptionCheck() || addressObject == NULL) {
- LOGE("Error creating InetSocketAddress object");
- return NULL;
- }
-
- env->SetObjectField(pppObject, addressField, addressObject);
- env->SetLongField(pppObject, lastSendField, ppp.lastSend);
- env->SetLongField(pppObject, lastReceiveField, ppp.lastReceive);
- env->SetBooleanField(pppObject, preferredField, ppp.preferred);
-
- if(env->ExceptionCheck()) {
- LOGE("Exception assigning fields to PeerPhysicalPath object");
- }
-
- return pppObject;
-}
-
-jobject newPeer(JNIEnv *env, const ZT_Peer &peer)
-{
- LOGV("newPeer called");
-
- jclass peerClass = NULL;
-
- jfieldID addressField = NULL;
- jfieldID versionMajorField = NULL;
- jfieldID versionMinorField = NULL;
- jfieldID versionRevField = NULL;
- jfieldID latencyField = NULL;
- jfieldID roleField = NULL;
- jfieldID pathsField = NULL;
-
- jmethodID peer_constructor = NULL;
-
- peerClass = lookup.findClass("com/zerotier/sdk/Peer");
- if(env->ExceptionCheck() || peerClass == NULL)
- {
- LOGE("Error finding Peer class");
- return NULL;
- }
-
- addressField = lookup.findField(peerClass, "address", "J");
- if(env->ExceptionCheck() || addressField == NULL)
- {
- LOGE("Error finding address field of Peer object");
- return NULL;
- }
-
- versionMajorField = lookup.findField(peerClass, "versionMajor", "I");
- if(env->ExceptionCheck() || versionMajorField == NULL)
- {
- LOGE("Error finding versionMajor field of Peer object");
- return NULL;
- }
-
- versionMinorField = lookup.findField(peerClass, "versionMinor", "I");
- if(env->ExceptionCheck() || versionMinorField == NULL)
- {
- LOGE("Error finding versionMinor field of Peer object");
- return NULL;
- }
-
- versionRevField = lookup.findField(peerClass, "versionRev", "I");
- if(env->ExceptionCheck() || versionRevField == NULL)
- {
- LOGE("Error finding versionRev field of Peer object");
- return NULL;
- }
-
- latencyField = lookup.findField(peerClass, "latency", "I");
- if(env->ExceptionCheck() || latencyField == NULL)
- {
- LOGE("Error finding latency field of Peer object");
- return NULL;
- }
-
- roleField = lookup.findField(peerClass, "role", "Lcom/zerotier/sdk/PeerRole;");
- if(env->ExceptionCheck() || roleField == NULL)
- {
- LOGE("Error finding role field of Peer object");
- return NULL;
- }
-
- pathsField = lookup.findField(peerClass, "paths", "[Lcom/zerotier/sdk/PeerPhysicalPath;");
- if(env->ExceptionCheck() || pathsField == NULL)
- {
- LOGE("Error finding paths field of Peer object");
- return NULL;
- }
-
- peer_constructor = lookup.findMethod(peerClass, "<init>", "()V");
- if(env->ExceptionCheck() || peer_constructor == NULL)
- {
- LOGE("Error finding Peer constructor");
- return NULL;
- }
-
- jobject peerObject = env->NewObject(peerClass, peer_constructor);
- if(env->ExceptionCheck() || peerObject == NULL)
- {
- LOGE("Error creating Peer object");
- return NULL; // out of memory
- }
-
- env->SetLongField(peerObject, addressField, (jlong)peer.address);
- env->SetIntField(peerObject, versionMajorField, peer.versionMajor);
- env->SetIntField(peerObject, versionMinorField, peer.versionMinor);
- env->SetIntField(peerObject, versionRevField, peer.versionRev);
- env->SetIntField(peerObject, latencyField, peer.latency);
- env->SetObjectField(peerObject, roleField, createPeerRole(env, peer.role));
-
- jclass peerPhysicalPathClass = lookup.findClass("com/zerotier/sdk/PeerPhysicalPath");
- if(env->ExceptionCheck() || peerPhysicalPathClass == NULL)
- {
- LOGE("Error finding PeerPhysicalPath class");
- return NULL;
- }
-
- jobjectArray arrayObject = env->NewObjectArray(
- peer.pathCount, peerPhysicalPathClass, NULL);
- if(env->ExceptionCheck() || arrayObject == NULL)
- {
- LOGE("Error creating PeerPhysicalPath[] array");
- return NULL;
- }
-
- for(unsigned int i = 0; i < peer.pathCount; ++i)
- {
- jobject path = newPeerPhysicalPath(env, peer.paths[i]);
-
- env->SetObjectArrayElement(arrayObject, i, path);
- if(env->ExceptionCheck()) {
- LOGE("exception assigning PeerPhysicalPath to array");
- break;
- }
- }
-
- env->SetObjectField(peerObject, pathsField, arrayObject);
-
- return peerObject;
-}
-
-jobject newNetworkConfig(JNIEnv *env, const ZT_VirtualNetworkConfig &vnetConfig)
-{
- jclass vnetConfigClass = NULL;
- jmethodID vnetConfig_constructor = NULL;
- jfieldID nwidField = NULL;
- jfieldID macField = NULL;
- jfieldID nameField = NULL;
- jfieldID statusField = NULL;
- jfieldID typeField = NULL;
- jfieldID mtuField = NULL;
- jfieldID dhcpField = NULL;
- jfieldID bridgeField = NULL;
- jfieldID broadcastEnabledField = NULL;
- jfieldID portErrorField = NULL;
- jfieldID netconfRevisionField = NULL;
- jfieldID assignedAddressesField = NULL;
- jfieldID routesField = NULL;
-
- vnetConfigClass = lookup.findClass("com/zerotier/sdk/VirtualNetworkConfig");
- if(vnetConfigClass == NULL)
- {
- LOGE("Couldn't find com.zerotier.sdk.VirtualNetworkConfig");
- return NULL;
- }
-
- vnetConfig_constructor = lookup.findMethod(
- vnetConfigClass, "<init>", "()V");
- if(env->ExceptionCheck() || vnetConfig_constructor == NULL)
- {
- LOGE("Couldn't find VirtualNetworkConfig Constructor");
- return NULL;
- }
-
- jobject vnetConfigObj = env->NewObject(vnetConfigClass, vnetConfig_constructor);
- if(env->ExceptionCheck() || vnetConfigObj == NULL)
- {
- LOGE("Error creating new VirtualNetworkConfig object");
- return NULL;
- }
-
- nwidField = lookup.findField(vnetConfigClass, "nwid", "J");
- if(env->ExceptionCheck() || nwidField == NULL)
- {
- LOGE("Error getting nwid field");
- return NULL;
- }
-
- macField = lookup.findField(vnetConfigClass, "mac", "J");
- if(env->ExceptionCheck() || macField == NULL)
- {
- LOGE("Error getting mac field");
- return NULL;
- }
-
- nameField = lookup.findField(vnetConfigClass, "name", "Ljava/lang/String;");
- if(env->ExceptionCheck() || nameField == NULL)
- {
- LOGE("Error getting name field");
- return NULL;
- }
-
- statusField = lookup.findField(vnetConfigClass, "status", "Lcom/zerotier/sdk/VirtualNetworkStatus;");
- if(env->ExceptionCheck() || statusField == NULL)
- {
- LOGE("Error getting status field");
- return NULL;
- }
-
- typeField = lookup.findField(vnetConfigClass, "type", "Lcom/zerotier/sdk/VirtualNetworkType;");
- if(env->ExceptionCheck() || typeField == NULL)
- {
- LOGE("Error getting type field");
- return NULL;
- }
-
- mtuField = lookup.findField(vnetConfigClass, "mtu", "I");
- if(env->ExceptionCheck() || mtuField == NULL)
- {
- LOGE("Error getting mtu field");
- return NULL;
- }
-
- dhcpField = lookup.findField(vnetConfigClass, "dhcp", "Z");
- if(env->ExceptionCheck() || dhcpField == NULL)
- {
- LOGE("Error getting dhcp field");
- return NULL;
- }
-
- bridgeField = lookup.findField(vnetConfigClass, "bridge", "Z");
- if(env->ExceptionCheck() || bridgeField == NULL)
- {
- LOGE("Error getting bridge field");
- return NULL;
- }
-
- broadcastEnabledField = lookup.findField(vnetConfigClass, "broadcastEnabled", "Z");
- if(env->ExceptionCheck() || broadcastEnabledField == NULL)
- {
- LOGE("Error getting broadcastEnabled field");
- return NULL;
- }
-
- portErrorField = lookup.findField(vnetConfigClass, "portError", "I");
- if(env->ExceptionCheck() || portErrorField == NULL)
- {
- LOGE("Error getting portError field");
- return NULL;
- }
-
- netconfRevisionField = lookup.findField(vnetConfigClass, "netconfRevision", "J");
- if(env->ExceptionCheck() || netconfRevisionField == NULL)
- {
- LOGE("Error getting netconfRevision field");
- return NULL;
- }
-
- assignedAddressesField = lookup.findField(vnetConfigClass, "assignedAddresses",
- "[Ljava/net/InetSocketAddress;");
- if(env->ExceptionCheck() || assignedAddressesField == NULL)
- {
- LOGE("Error getting assignedAddresses field");
- return NULL;
- }
-
- routesField = lookup.findField(vnetConfigClass, "routes",
- "[Lcom/zerotier/sdk/VirtualNetworkRoute;");
- if(env->ExceptionCheck() || routesField == NULL)
- {
- LOGE("Error getting routes field");
- return NULL;
- }
-
- env->SetLongField(vnetConfigObj, nwidField, vnetConfig.nwid);
- env->SetLongField(vnetConfigObj, macField, vnetConfig.mac);
- jstring nameStr = env->NewStringUTF(vnetConfig.name);
- if(env->ExceptionCheck() || nameStr == NULL)
- {
- return NULL; // out of memory
- }
- env->SetObjectField(vnetConfigObj, nameField, nameStr);
-
- jobject statusObject = createVirtualNetworkStatus(env, vnetConfig.status);
- if(env->ExceptionCheck() || statusObject == NULL)
- {
- return NULL;
- }
- env->SetObjectField(vnetConfigObj, statusField, statusObject);
-
- jobject typeObject = createVirtualNetworkType(env, vnetConfig.type);
- if(env->ExceptionCheck() || typeObject == NULL)
- {
- return NULL;
- }
- env->SetObjectField(vnetConfigObj, typeField, typeObject);
-
- env->SetIntField(vnetConfigObj, mtuField, (int)vnetConfig.mtu);
- env->SetBooleanField(vnetConfigObj, dhcpField, vnetConfig.dhcp);
- env->SetBooleanField(vnetConfigObj, bridgeField, vnetConfig.bridge);
- env->SetBooleanField(vnetConfigObj, broadcastEnabledField, vnetConfig.broadcastEnabled);
- env->SetIntField(vnetConfigObj, portErrorField, vnetConfig.portError);
-
- jclass inetSocketAddressClass = lookup.findClass("java/net/InetSocketAddress");
- if(env->ExceptionCheck() || inetSocketAddressClass == NULL)
- {
- LOGE("Error finding InetSocketAddress class");
- return NULL;
- }
-
- jobjectArray assignedAddrArrayObj = env->NewObjectArray(
- vnetConfig.assignedAddressCount, inetSocketAddressClass, NULL);
- if(env->ExceptionCheck() || assignedAddrArrayObj == NULL)
- {
- LOGE("Error creating InetSocketAddress[] array");
- return NULL;
- }
-
- for(unsigned int i = 0; i < vnetConfig.assignedAddressCount; ++i)
- {
- jobject inetAddrObj = newInetSocketAddress(env, vnetConfig.assignedAddresses[i]);
- env->SetObjectArrayElement(assignedAddrArrayObj, i, inetAddrObj);
- if(env->ExceptionCheck())
- {
- LOGE("Error assigning InetSocketAddress to array");
- return NULL;
- }
- }
-
- env->SetObjectField(vnetConfigObj, assignedAddressesField, assignedAddrArrayObj);
-
- jclass virtualNetworkRouteClass = lookup.findClass("com/zerotier/sdk/VirtualNetworkRoute");
- if(env->ExceptionCheck() || virtualNetworkRouteClass == NULL)
- {
- LOGE("Error finding VirtualNetworkRoute class");
- return NULL;
- }
-
- jobjectArray routesArrayObj = env->NewObjectArray(
- vnetConfig.routeCount, virtualNetworkRouteClass, NULL);
- if(env->ExceptionCheck() || routesArrayObj == NULL)
- {
- LOGE("Error creating VirtualNetworkRoute[] array");
- return NULL;
- }
-
- for(unsigned int i = 0; i < vnetConfig.routeCount; ++i)
- {
- jobject routeObj = newVirtualNetworkRoute(env, vnetConfig.routes[i]);
- env->SetObjectArrayElement(routesArrayObj, i, routeObj);
- if(env->ExceptionCheck())
- {
- LOGE("Error assigning VirtualNetworkRoute to array");
- return NULL;
- }
- }
-
- env->SetObjectField(vnetConfigObj, routesField, routesArrayObj);
-
- return vnetConfigObj;
-}
-
-jobject newVersion(JNIEnv *env, int major, int minor, int rev)
-{
- // create a com.zerotier.sdk.Version object
- jclass versionClass = NULL;
- jmethodID versionConstructor = NULL;
-
- versionClass = lookup.findClass("com/zerotier/sdk/Version");
- if(env->ExceptionCheck() || versionClass == NULL)
- {
- return NULL;
- }
-
- versionConstructor = lookup.findMethod(
- versionClass, "<init>", "()V");
- if(env->ExceptionCheck() || versionConstructor == NULL)
- {
- return NULL;
- }
-
- jobject versionObj = env->NewObject(versionClass, versionConstructor);
- if(env->ExceptionCheck() || versionObj == NULL)
- {
- return NULL;
- }
-
- // copy data to Version object
- jfieldID majorField = NULL;
- jfieldID minorField = NULL;
- jfieldID revisionField = NULL;
-
- majorField = lookup.findField(versionClass, "major", "I");
- if(env->ExceptionCheck() || majorField == NULL)
- {
- return NULL;
- }
-
- minorField = lookup.findField(versionClass, "minor", "I");
- if(env->ExceptionCheck() || minorField == NULL)
- {
- return NULL;
- }
-
- revisionField = lookup.findField(versionClass, "revision", "I");
- if(env->ExceptionCheck() || revisionField == NULL)
- {
- return NULL;
- }
-
- env->SetIntField(versionObj, majorField, (jint)major);
- env->SetIntField(versionObj, minorField, (jint)minor);
- env->SetIntField(versionObj, revisionField, (jint)rev);
-
- return versionObj;
-}
-
-jobject newVirtualNetworkRoute(JNIEnv *env, const ZT_VirtualNetworkRoute &route)
-{
- jclass virtualNetworkRouteClass = NULL;
- jmethodID routeConstructor = NULL;
-
- virtualNetworkRouteClass = lookup.findClass("com/zerotier/sdk/VirtualNetworkRoute");
- if(env->ExceptionCheck() || virtualNetworkRouteClass == NULL)
- {
- return NULL;
- }
-
- routeConstructor = lookup.findMethod(virtualNetworkRouteClass, "<init>", "()V");
- if(env->ExceptionCheck() || routeConstructor == NULL)
- {
- return NULL;
- }
-
- jobject routeObj = env->NewObject(virtualNetworkRouteClass, routeConstructor);
- if(env->ExceptionCheck() || routeObj == NULL)
- {
- return NULL;
- }
-
- jfieldID targetField = NULL;
- jfieldID viaField = NULL;
- jfieldID flagsField = NULL;
- jfieldID metricField = NULL;
-
- targetField = lookup.findField(virtualNetworkRouteClass, "target",
- "Ljava/net/InetSocketAddress;");
- if(env->ExceptionCheck() || targetField == NULL)
- {
- return NULL;
- }
-
- viaField = lookup.findField(virtualNetworkRouteClass, "via",
- "Ljava/net/InetSocketAddress;");
- if(env->ExceptionCheck() || targetField == NULL)
- {
- return NULL;
- }
-
- flagsField = lookup.findField(virtualNetworkRouteClass, "flags", "I");
- if(env->ExceptionCheck() || flagsField == NULL)
- {
- return NULL;
- }
-
- metricField = lookup.findField(virtualNetworkRouteClass, "metric", "I");
- if(env->ExceptionCheck() || metricField == NULL)
- {
- return NULL;
- }
-
- jobject targetObj = newInetSocketAddress(env, route.target);
- jobject viaObj = newInetSocketAddress(env, route.via);
-
- env->SetObjectField(routeObj, targetField, targetObj);
- env->SetObjectField(routeObj, viaField, viaObj);
- env->SetIntField(routeObj, flagsField, (jint)route.flags);
- env->SetIntField(routeObj, metricField, (jint)route.metric);
-
- return routeObj;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/zerotierone/java/jni/ZT_jniutils.h b/zerotierone/java/jni/ZT_jniutils.h
deleted file mode 100644
index e35d4f4..0000000
--- a/zerotierone/java/jni/ZT_jniutils.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef ZT_jniutils_h_
-#define ZT_jniutils_h_
-#include <stdio.h>
-#include <jni.h>
-#include <ZeroTierOne.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LOG_TAG "ZeroTierOneJNI"
-
-#if __ANDROID__
-#include <android/log.h>
-#define LOGV(...) ((void)__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
-#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
-#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
-#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
-#else
-#define LOGV(...) fprintf(stdout, __VA_ARGS__)
-#define LOGI(...) fprintf(stdout, __VA_ARGS__)
-#define LOGD(...) fprintf(stdout, __VA_ARGS__)
-#define LOGE(...) fprintf(stdout, __VA_ARGS__)
-#endif
-
-jobject createResultObject(JNIEnv *env, ZT_ResultCode code);
-jobject createVirtualNetworkStatus(JNIEnv *env, ZT_VirtualNetworkStatus status);
-jobject createVirtualNetworkType(JNIEnv *env, ZT_VirtualNetworkType type);
-jobject createEvent(JNIEnv *env, ZT_Event event);
-jobject createPeerRole(JNIEnv *env, ZT_PeerRole role);
-jobject createVirtualNetworkConfigOperation(JNIEnv *env, ZT_VirtualNetworkConfigOperation op);
-
-jobject newInetSocketAddress(JNIEnv *env, const sockaddr_storage &addr);
-jobject newInetAddress(JNIEnv *env, const sockaddr_storage &addr);
-
-jobject newMulticastGroup(JNIEnv *env, const ZT_MulticastGroup &mc);
-
-jobject newPeer(JNIEnv *env, const ZT_Peer &peer);
-jobject newPeerPhysicalPath(JNIEnv *env, const ZT_PeerPhysicalPath &ppp);
-
-jobject newNetworkConfig(JNIEnv *env, const ZT_VirtualNetworkConfig &config);
-
-jobject newVersion(JNIEnv *env, int major, int minor, int rev);
-
-jobject newVirtualNetworkRoute(JNIEnv *env, const ZT_VirtualNetworkRoute &route);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif \ No newline at end of file
diff --git a/zerotierone/java/jni/com_zerotierone_sdk_Node.cpp b/zerotierone/java/jni/com_zerotierone_sdk_Node.cpp
deleted file mode 100644
index eb62d98..0000000
--- a/zerotierone/java/jni/com_zerotierone_sdk_Node.cpp
+++ /dev/null
@@ -1,1381 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-#include "com_zerotierone_sdk_Node.h"
-#include "ZT_jniutils.h"
-#include "ZT_jnilookup.h"
-
-#include <ZeroTierOne.h>
-#include "Mutex.hpp"
-
-#include <map>
-#include <string>
-#include <assert.h>
-#include <string.h>
-
-// global static JNI Lookup Object
-JniLookup lookup;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-namespace {
- struct JniRef
- {
- JniRef()
- : jvm(NULL)
- , node(NULL)
- , dataStoreGetListener(NULL)
- , dataStorePutListener(NULL)
- , packetSender(NULL)
- , eventListener(NULL)
- , frameListener(NULL)
- , configListener(NULL)
- , callbacks(NULL)
- {
- callbacks = (ZT_Node_Callbacks*)malloc(sizeof(ZT_Node_Callbacks));
- memset(callbacks, 0, sizeof(ZT_Node_Callbacks));
- }
-
- ~JniRef()
- {
- JNIEnv *env = NULL;
- jvm->GetEnv((void**)&env, JNI_VERSION_1_6);
-
- env->DeleteGlobalRef(dataStoreGetListener);
- env->DeleteGlobalRef(dataStorePutListener);
- env->DeleteGlobalRef(packetSender);
- env->DeleteGlobalRef(eventListener);
- env->DeleteGlobalRef(frameListener);
- env->DeleteGlobalRef(configListener);
-
- free(callbacks);
- callbacks = NULL;
- }
-
- uint64_t id;
-
- JavaVM *jvm;
-
- ZT_Node *node;
-
- jobject dataStoreGetListener;
- jobject dataStorePutListener;
- jobject packetSender;
- jobject eventListener;
- jobject frameListener;
- jobject configListener;
-
- ZT_Node_Callbacks *callbacks;
- };
-
-
- int VirtualNetworkConfigFunctionCallback(
- ZT_Node *node,
- void *userData,
- uint64_t nwid,
- void **,
- enum ZT_VirtualNetworkConfigOperation operation,
- const ZT_VirtualNetworkConfig *config)
- {
- LOGV("VritualNetworkConfigFunctionCallback");
- JniRef *ref = (JniRef*)userData;
- JNIEnv *env = NULL;
- ref->jvm->GetEnv((void**)&env, JNI_VERSION_1_6);
-
- jclass configListenerClass = env->GetObjectClass(ref->configListener);
- if(configListenerClass == NULL)
- {
- LOGE("Couldn't find class for VirtualNetworkConfigListener instance");
- return -1;
- }
-
- jmethodID configListenerCallbackMethod = lookup.findMethod(configListenerClass,
- "onNetworkConfigurationUpdated",
- "(JLcom/zerotier/sdk/VirtualNetworkConfigOperation;Lcom/zerotier/sdk/VirtualNetworkConfig;)I");
- if(configListenerCallbackMethod == NULL)
- {
- LOGE("Couldn't find onVirtualNetworkFrame() method");
- return -2;
- }
-
- jobject operationObject = createVirtualNetworkConfigOperation(env, operation);
- if(operationObject == NULL)
- {
- LOGE("Error creating VirtualNetworkConfigOperation object");
- return -3;
- }
-
- jobject networkConfigObject = newNetworkConfig(env, *config);
- if(networkConfigObject == NULL)
- {
- LOGE("Error creating VirtualNetworkConfig object");
- return -4;
- }
-
- return env->CallIntMethod(
- ref->configListener,
- configListenerCallbackMethod,
- (jlong)nwid, operationObject, networkConfigObject);
- }
-
- void VirtualNetworkFrameFunctionCallback(ZT_Node *node,
- void *userData,
- uint64_t nwid,
- void**,
- uint64_t sourceMac,
- uint64_t destMac,
- unsigned int etherType,
- unsigned int vlanid,
- const void *frameData,
- unsigned int frameLength)
- {
- LOGV("VirtualNetworkFrameFunctionCallback");
- unsigned char* local = (unsigned char*)frameData;
- LOGV("Type Bytes: 0x%02x%02x", local[12], local[13]);
- JniRef *ref = (JniRef*)userData;
- assert(ref->node == node);
- JNIEnv *env = NULL;
- ref->jvm->GetEnv((void**)&env, JNI_VERSION_1_6);
-
-
- jclass frameListenerClass = env->GetObjectClass(ref->frameListener);
- if(env->ExceptionCheck() || frameListenerClass == NULL)
- {
- LOGE("Couldn't find class for VirtualNetworkFrameListener instance");
- return;
- }
-
- jmethodID frameListenerCallbackMethod = lookup.findMethod(
- frameListenerClass,
- "onVirtualNetworkFrame", "(JJJJJ[B)V");
- if(env->ExceptionCheck() || frameListenerCallbackMethod == NULL)
- {
- LOGE("Couldn't find onVirtualNetworkFrame() method");
- return;
- }
-
- jbyteArray dataArray = env->NewByteArray(frameLength);
- if(env->ExceptionCheck() || dataArray == NULL)
- {
- LOGE("Couldn't create frame data array");
- return;
- }
-
- void *data = env->GetPrimitiveArrayCritical(dataArray, NULL);
- memcpy(data, frameData, frameLength);
- env->ReleasePrimitiveArrayCritical(dataArray, data, 0);
-
- if(env->ExceptionCheck())
- {
- LOGE("Error setting frame data to array");
- return;
- }
-
- env->CallVoidMethod(ref->frameListener, frameListenerCallbackMethod, (jlong)nwid, (jlong)sourceMac, (jlong)destMac, (jlong)etherType, (jlong)vlanid, dataArray);
- }
-
-
- void EventCallback(ZT_Node *node,
- void *userData,
- enum ZT_Event event,
- const void *data)
- {
- LOGV("EventCallback");
- JniRef *ref = (JniRef*)userData;
- if(ref->node != node && event != ZT_EVENT_UP)
- {
- LOGE("Nodes not equal. ref->node %p, node %p. Event: %d", ref->node, node, event);
- return;
- }
- JNIEnv *env = NULL;
- ref->jvm->GetEnv((void**)&env, JNI_VERSION_1_6);
-
-
- jclass eventListenerClass = env->GetObjectClass(ref->eventListener);
- if(eventListenerClass == NULL)
- {
- LOGE("Couldn't class for EventListener instance");
- return;
- }
-
- jmethodID onEventMethod = lookup.findMethod(eventListenerClass,
- "onEvent", "(Lcom/zerotier/sdk/Event;)V");
- if(onEventMethod == NULL)
- {
- LOGE("Couldn't find onEvent method");
- return;
- }
-
- jmethodID onTraceMethod = lookup.findMethod(eventListenerClass,
- "onTrace", "(Ljava/lang/String;)V");
- if(onTraceMethod == NULL)
- {
- LOGE("Couldn't find onTrace method");
- return;
- }
-
- jobject eventObject = createEvent(env, event);
- if(eventObject == NULL)
- {
- return;
- }
-
- switch(event)
- {
- case ZT_EVENT_UP:
- {
- LOGD("Event Up");
- env->CallVoidMethod(ref->eventListener, onEventMethod, eventObject);
- break;
- }
- case ZT_EVENT_OFFLINE:
- {
- LOGD("Event Offline");
- env->CallVoidMethod(ref->eventListener, onEventMethod, eventObject);
- break;
- }
- case ZT_EVENT_ONLINE:
- {
- LOGD("Event Online");
- env->CallVoidMethod(ref->eventListener, onEventMethod, eventObject);
- break;
- }
- case ZT_EVENT_DOWN:
- {
- LOGD("Event Down");
- env->CallVoidMethod(ref->eventListener, onEventMethod, eventObject);
- break;
- }
- case ZT_EVENT_FATAL_ERROR_IDENTITY_COLLISION:
- {
- LOGV("Identity Collision");
- // call onEvent()
- env->CallVoidMethod(ref->eventListener, onEventMethod, eventObject);
- }
- break;
- case ZT_EVENT_TRACE:
- {
- LOGV("Trace Event");
- // call onTrace()
- if(data != NULL)
- {
- const char* message = (const char*)data;
- jstring messageStr = env->NewStringUTF(message);
- env->CallVoidMethod(ref->eventListener, onTraceMethod, messageStr);
- }
- }
- break;
- case ZT_EVENT_USER_MESSAGE:
- break;
- }
- }
-
- long DataStoreGetFunction(ZT_Node *node,
- void *userData,
- const char *objectName,
- void *buffer,
- unsigned long bufferSize,
- unsigned long bufferIndex,
- unsigned long *out_objectSize)
- {
- JniRef *ref = (JniRef*)userData;
- JNIEnv *env = NULL;
- ref->jvm->GetEnv((void**)&env, JNI_VERSION_1_6);
-
- jclass dataStoreGetClass = env->GetObjectClass(ref->dataStoreGetListener);
- if(dataStoreGetClass == NULL)
- {
- LOGE("Couldn't find class for DataStoreGetListener instance");
- return -2;
- }
-
- jmethodID dataStoreGetCallbackMethod = lookup.findMethod(
- dataStoreGetClass,
- "onDataStoreGet",
- "(Ljava/lang/String;[BJ[J)J");
- if(dataStoreGetCallbackMethod == NULL)
- {
- LOGE("Couldn't find onDataStoreGet method");
- return -2;
- }
-
- jstring nameStr = env->NewStringUTF(objectName);
- if(nameStr == NULL)
- {
- LOGE("Error creating name string object");
- return -2; // out of memory
- }
-
- jbyteArray bufferObj = env->NewByteArray(bufferSize);
- if(bufferObj == NULL)
- {
- LOGE("Error creating byte[] buffer of size: %lu", bufferSize);
- return -2;
- }
-
- jlongArray objectSizeObj = env->NewLongArray(1);
- if(objectSizeObj == NULL)
- {
- LOGE("Error creating long[1] array for actual object size");
- return -2; // couldn't create long[1] array
- }
-
- LOGV("Calling onDataStoreGet(%s, %p, %lu, %p)",
- objectName, buffer, bufferIndex, objectSizeObj);
-
- long retval = (long)env->CallLongMethod(
- ref->dataStoreGetListener, dataStoreGetCallbackMethod,
- nameStr, bufferObj, (jlong)bufferIndex, objectSizeObj);
-
- if(retval > 0)
- {
- void *data = env->GetPrimitiveArrayCritical(bufferObj, NULL);
- memcpy(buffer, data, retval);
- env->ReleasePrimitiveArrayCritical(bufferObj, data, 0);
-
- jlong *objSize = (jlong*)env->GetPrimitiveArrayCritical(objectSizeObj, NULL);
- *out_objectSize = (unsigned long)objSize[0];
- env->ReleasePrimitiveArrayCritical(objectSizeObj, objSize, 0);
- }
-
- LOGV("Out Object Size: %lu", *out_objectSize);
-
- return retval;
- }
-
- int DataStorePutFunction(ZT_Node *node,
- void *userData,
- const char *objectName,
- const void *buffer,
- unsigned long bufferSize,
- int secure)
- {
- JniRef *ref = (JniRef*)userData;
- JNIEnv *env = NULL;
- ref->jvm->GetEnv((void**)&env, JNI_VERSION_1_6);
-
-
- jclass dataStorePutClass = env->GetObjectClass(ref->dataStorePutListener);
- if(dataStorePutClass == NULL)
- {
- LOGE("Couldn't find class for DataStorePutListener instance");
- return -1;
- }
-
- jmethodID dataStorePutCallbackMethod = lookup.findMethod(
- dataStorePutClass,
- "onDataStorePut",
- "(Ljava/lang/String;[BZ)I");
- if(dataStorePutCallbackMethod == NULL)
- {
- LOGE("Couldn't find onDataStorePut method");
- return -2;
- }
-
- jmethodID deleteMethod = lookup.findMethod(dataStorePutClass,
- "onDelete", "(Ljava/lang/String;)I");
- if(deleteMethod == NULL)
- {
- LOGE("Couldn't find onDelete method");
- return -3;
- }
-
- jstring nameStr = env->NewStringUTF(objectName);
-
- if(buffer == NULL)
- {
- LOGD("JNI: Delete file: %s", objectName);
- // delete operation
- return env->CallIntMethod(
- ref->dataStorePutListener, deleteMethod, nameStr);
- }
- else
- {
- LOGD("JNI: Write file: %s", objectName);
- // set operation
- jbyteArray bufferObj = env->NewByteArray(bufferSize);
- if(env->ExceptionCheck() || bufferObj == NULL)
- {
- LOGE("Error creating byte array buffer!");
- return -4;
- }
-
- env->SetByteArrayRegion(bufferObj, 0, bufferSize, (jbyte*)buffer);
- bool bsecure = secure != 0;
-
- return env->CallIntMethod(ref->dataStorePutListener,
- dataStorePutCallbackMethod,
- nameStr, bufferObj, bsecure);
- }
- }
-
- int WirePacketSendFunction(ZT_Node *node,
- void *userData,
- const struct sockaddr_storage *localAddress,
- const struct sockaddr_storage *remoteAddress,
- const void *buffer,
- unsigned int bufferSize,
- unsigned int ttl)
- {
- LOGV("WirePacketSendFunction(%p, %p, %p, %d)", localAddress, remoteAddress, buffer, bufferSize);
- JniRef *ref = (JniRef*)userData;
- assert(ref->node == node);
-
- JNIEnv *env = NULL;
- ref->jvm->GetEnv((void**)&env, JNI_VERSION_1_6);
-
-
- jclass packetSenderClass = env->GetObjectClass(ref->packetSender);
- if(packetSenderClass == NULL)
- {
- LOGE("Couldn't find class for PacketSender instance");
- return -1;
- }
-
- jmethodID packetSenderCallbackMethod = lookup.findMethod(packetSenderClass,
- "onSendPacketRequested", "(Ljava/net/InetSocketAddress;Ljava/net/InetSocketAddress;[BI)I");
- if(packetSenderCallbackMethod == NULL)
- {
- LOGE("Couldn't find onSendPacketRequested method");
- return -2;
- }
-
- jobject localAddressObj = NULL;
- if(memcmp(localAddress, &ZT_SOCKADDR_NULL, sizeof(sockaddr_storage)) != 0)
- {
- localAddressObj = newInetSocketAddress(env, *localAddress);
- }
-
- jobject remoteAddressObj = newInetSocketAddress(env, *remoteAddress);
- jbyteArray bufferObj = env->NewByteArray(bufferSize);
- env->SetByteArrayRegion(bufferObj, 0, bufferSize, (jbyte*)buffer);
- int retval = env->CallIntMethod(ref->packetSender, packetSenderCallbackMethod, localAddressObj, remoteAddressObj, bufferObj);
-
- LOGV("JNI Packet Sender returned: %d", retval);
- return retval;
- }
-
- typedef std::map<uint64_t, JniRef*> NodeMap;
- static NodeMap nodeMap;
- ZeroTier::Mutex nodeMapMutex;
-
- ZT_Node* findNode(uint64_t nodeId)
- {
- ZeroTier::Mutex::Lock lock(nodeMapMutex);
- NodeMap::iterator found = nodeMap.find(nodeId);
- if(found != nodeMap.end())
- {
- JniRef *ref = found->second;
- return ref->node;
- }
- return NULL;
- }
-}
-
-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
-{
- lookup.setJavaVM(vm);
- return JNI_VERSION_1_6;
-}
-
-JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
-{
-
-}
-
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: node_init
- * Signature: (J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_node_1init(
- JNIEnv *env, jobject obj, jlong now)
-{
- LOGV("Creating ZT_Node struct");
- jobject resultObject = createResultObject(env, ZT_RESULT_OK);
-
- ZT_Node *node;
- JniRef *ref = new JniRef;
- ref->id = (uint64_t)now;
- env->GetJavaVM(&ref->jvm);
-
- jclass cls = env->GetObjectClass(obj);
- jfieldID fid = lookup.findField(
- cls, "getListener", "Lcom/zerotier/sdk/DataStoreGetListener;");
-
- if(fid == NULL)
- {
- return NULL; // exception already thrown
- }
-
- jobject tmp = env->GetObjectField(obj, fid);
- if(tmp == NULL)
- {
- return NULL;
- }
- ref->dataStoreGetListener = env->NewGlobalRef(tmp);
-
- fid = lookup.findField(
- cls, "putListener", "Lcom/zerotier/sdk/DataStorePutListener;");
-
- if(fid == NULL)
- {
- return NULL; // exception already thrown
- }
-
- tmp = env->GetObjectField(obj, fid);
- if(tmp == NULL)
- {
- return NULL;
- }
- ref->dataStorePutListener = env->NewGlobalRef(tmp);
-
- fid = lookup.findField(
- cls, "sender", "Lcom/zerotier/sdk/PacketSender;");
- if(fid == NULL)
- {
- return NULL; // exception already thrown
- }
-
- tmp = env->GetObjectField(obj, fid);
- if(tmp == NULL)
- {
- return NULL;
- }
- ref->packetSender = env->NewGlobalRef(tmp);
-
- fid = lookup.findField(
- cls, "frameListener", "Lcom/zerotier/sdk/VirtualNetworkFrameListener;");
- if(fid == NULL)
- {
- return NULL; // exception already thrown
- }
-
- tmp = env->GetObjectField(obj, fid);
- if(tmp == NULL)
- {
- return NULL;
- }
- ref->frameListener = env->NewGlobalRef(tmp);
-
- fid = lookup.findField(
- cls, "configListener", "Lcom/zerotier/sdk/VirtualNetworkConfigListener;");
- if(fid == NULL)
- {
- return NULL; // exception already thrown
- }
-
- tmp = env->GetObjectField(obj, fid);
- if(tmp == NULL)
- {
- return NULL;
- }
- ref->configListener = env->NewGlobalRef(tmp);
-
- fid = lookup.findField(
- cls, "eventListener", "Lcom/zerotier/sdk/EventListener;");
- if(fid == NULL)
- {
- return NULL;
- }
-
- tmp = env->GetObjectField(obj, fid);
- if(tmp == NULL)
- {
- return NULL;
- }
- ref->eventListener = env->NewGlobalRef(tmp);
-
- ref->callbacks->dataStoreGetFunction = &DataStoreGetFunction;
- ref->callbacks->dataStorePutFunction = &DataStorePutFunction;
- ref->callbacks->wirePacketSendFunction = &WirePacketSendFunction;
- ref->callbacks->virtualNetworkFrameFunction = &VirtualNetworkFrameFunctionCallback;
- ref->callbacks->virtualNetworkConfigFunction = &VirtualNetworkConfigFunctionCallback;
- ref->callbacks->eventCallback = &EventCallback;
-
- ZT_ResultCode rc = ZT_Node_new(
- &node,
- ref,
- ref->callbacks,
- (uint64_t)now);
-
- if(rc != ZT_RESULT_OK)
- {
- LOGE("Error creating Node: %d", rc);
- resultObject = createResultObject(env, rc);
- if(node)
- {
- ZT_Node_delete(node);
- node = NULL;
- }
- delete ref;
- ref = NULL;
- return resultObject;
- }
-
- ZeroTier::Mutex::Lock lock(nodeMapMutex);
- ref->node = node;
- nodeMap.insert(std::make_pair(ref->id, ref));
-
-
- return resultObject;
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: node_delete
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_zerotier_sdk_Node_node_1delete(
- JNIEnv *env, jobject obj, jlong id)
-{
- LOGV("Destroying ZT_Node struct");
- uint64_t nodeId = (uint64_t)id;
-
- NodeMap::iterator found;
- {
- ZeroTier::Mutex::Lock lock(nodeMapMutex);
- found = nodeMap.find(nodeId);
- }
-
- if(found != nodeMap.end())
- {
- JniRef *ref = found->second;
- nodeMap.erase(found);
-
- ZT_Node_delete(ref->node);
-
- delete ref;
- ref = NULL;
- }
- else
- {
- LOGE("Attempted to delete a node that doesn't exist!");
- }
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: processVirtualNetworkFrame
- * Signature: (JJJJJII[B[J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_processVirtualNetworkFrame(
- JNIEnv *env, jobject obj,
- jlong id,
- jlong in_now,
- jlong in_nwid,
- jlong in_sourceMac,
- jlong in_destMac,
- jint in_etherType,
- jint in_vlanId,
- jbyteArray in_frameData,
- jlongArray out_nextBackgroundTaskDeadline)
-{
- uint64_t nodeId = (uint64_t) id;
-
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- unsigned int nbtd_len = env->GetArrayLength(out_nextBackgroundTaskDeadline);
- if(nbtd_len < 1)
- {
- // array for next background task length has 0 elements!
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- uint64_t now = (uint64_t)in_now;
- uint64_t nwid = (uint64_t)in_nwid;
- uint64_t sourceMac = (uint64_t)in_sourceMac;
- uint64_t destMac = (uint64_t)in_destMac;
- unsigned int etherType = (unsigned int)in_etherType;
- unsigned int vlanId = (unsigned int)in_vlanId;
-
- unsigned int frameLength = env->GetArrayLength(in_frameData);
- void *frameData = env->GetPrimitiveArrayCritical(in_frameData, NULL);
- void *localData = malloc(frameLength);
- memcpy(localData, frameData, frameLength);
- env->ReleasePrimitiveArrayCritical(in_frameData, frameData, 0);
-
- uint64_t nextBackgroundTaskDeadline = 0;
-
- ZT_ResultCode rc = ZT_Node_processVirtualNetworkFrame(
- node,
- now,
- nwid,
- sourceMac,
- destMac,
- etherType,
- vlanId,
- (const void*)localData,
- frameLength,
- &nextBackgroundTaskDeadline);
-
- jlong *outDeadline = (jlong*)env->GetPrimitiveArrayCritical(out_nextBackgroundTaskDeadline, NULL);
- outDeadline[0] = (jlong)nextBackgroundTaskDeadline;
- env->ReleasePrimitiveArrayCritical(out_nextBackgroundTaskDeadline, outDeadline, 0);
-
- return createResultObject(env, rc);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: processWirePacket
- * Signature: (JJLjava/net/InetSocketAddress;I[B[J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_processWirePacket(
- JNIEnv *env, jobject obj,
- jlong id,
- jlong in_now,
- jobject in_localAddress,
- jobject in_remoteAddress,
- jbyteArray in_packetData,
- jlongArray out_nextBackgroundTaskDeadline)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- LOGE("Couldn't find a valid node!");
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- unsigned int nbtd_len = env->GetArrayLength(out_nextBackgroundTaskDeadline);
- if(nbtd_len < 1)
- {
- LOGE("nbtd_len < 1");
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- uint64_t now = (uint64_t)in_now;
-
- // get the java.net.InetSocketAddress class and getAddress() method
- jclass inetAddressClass = lookup.findClass("java/net/InetAddress");
- if(inetAddressClass == NULL)
- {
- LOGE("Can't find InetAddress class");
- // can't find java.net.InetAddress
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- jmethodID getAddressMethod = lookup.findMethod(
- inetAddressClass, "getAddress", "()[B");
- if(getAddressMethod == NULL)
- {
- // cant find InetAddress.getAddres()
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- jclass InetSocketAddressClass = lookup.findClass("java/net/InetSocketAddress");
- if(InetSocketAddressClass == NULL)
- {
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- jmethodID inetSockGetAddressMethod = lookup.findMethod(
- InetSocketAddressClass, "getAddress", "()Ljava/net/InetAddress;");
-
- jobject localAddrObj = NULL;
- if(in_localAddress != NULL)
- {
- localAddrObj = env->CallObjectMethod(in_localAddress, inetSockGetAddressMethod);
- }
-
- jobject remoteAddrObject = env->CallObjectMethod(in_remoteAddress, inetSockGetAddressMethod);
-
- if(remoteAddrObject == NULL)
- {
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- jmethodID inetSock_getPort = lookup.findMethod(
- InetSocketAddressClass, "getPort", "()I");
-
- if(env->ExceptionCheck() || inetSock_getPort == NULL)
- {
- LOGE("Couldn't find getPort method on InetSocketAddress");
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- // call InetSocketAddress.getPort()
- int remotePort = env->CallIntMethod(in_remoteAddress, inetSock_getPort);
- if(env->ExceptionCheck())
- {
- LOGE("Exception calling InetSocketAddress.getPort()");
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- // Call InetAddress.getAddress()
- jbyteArray remoteAddressArray = (jbyteArray)env->CallObjectMethod(remoteAddrObject, getAddressMethod);
- if(remoteAddressArray == NULL)
- {
- LOGE("Unable to call getAddress()");
- // unable to call getAddress()
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- unsigned int addrSize = env->GetArrayLength(remoteAddressArray);
-
-
- sockaddr_storage localAddress = {};
-
- if(localAddrObj == NULL)
- {
- localAddress = ZT_SOCKADDR_NULL;
- }
- else
- {
- int localPort = env->CallIntMethod(in_localAddress, inetSock_getPort);
- jbyteArray localAddressArray = (jbyteArray)env->CallObjectMethod(localAddrObj, getAddressMethod);
- if(localAddressArray != NULL)
- {
-
- unsigned int localAddrSize = env->GetArrayLength(localAddressArray);
- jbyte *addr = (jbyte*)env->GetPrimitiveArrayCritical(localAddressArray, NULL);
-
- if(localAddrSize == 16)
- {
- sockaddr_in6 ipv6 = {};
- ipv6.sin6_family = AF_INET6;
- ipv6.sin6_port = htons(localPort);
- memcpy(ipv6.sin6_addr.s6_addr, addr, 16);
- memcpy(&localAddress, &ipv6, sizeof(sockaddr_in6));
- }
- else if(localAddrSize)
- {
- // IPV4 address
- sockaddr_in ipv4 = {};
- ipv4.sin_family = AF_INET;
- ipv4.sin_port = htons(localPort);
- memcpy(&ipv4.sin_addr, addr, 4);
- memcpy(&localAddress, &ipv4, sizeof(sockaddr_in));
- }
- else
- {
- localAddress = ZT_SOCKADDR_NULL;
- }
- env->ReleasePrimitiveArrayCritical(localAddressArray, addr, 0);
- }
- }
-
- // get the address bytes
- jbyte *addr = (jbyte*)env->GetPrimitiveArrayCritical(remoteAddressArray, NULL);
- sockaddr_storage remoteAddress = {};
-
- if(addrSize == 16)
- {
- // IPV6 address
- sockaddr_in6 ipv6 = {};
- ipv6.sin6_family = AF_INET6;
- ipv6.sin6_port = htons(remotePort);
- memcpy(ipv6.sin6_addr.s6_addr, addr, 16);
- memcpy(&remoteAddress, &ipv6, sizeof(sockaddr_in6));
- }
- else if(addrSize == 4)
- {
- // IPV4 address
- sockaddr_in ipv4 = {};
- ipv4.sin_family = AF_INET;
- ipv4.sin_port = htons(remotePort);
- memcpy(&ipv4.sin_addr, addr, 4);
- memcpy(&remoteAddress, &ipv4, sizeof(sockaddr_in));
- }
- else
- {
- LOGE("Unknown IP version");
- // unknown address type
- env->ReleasePrimitiveArrayCritical(remoteAddressArray, addr, 0);
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
- env->ReleasePrimitiveArrayCritical(remoteAddressArray, addr, 0);
-
- unsigned int packetLength = env->GetArrayLength(in_packetData);
- if(packetLength == 0)
- {
- LOGE("Empty packet?!?");
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
- void *packetData = env->GetPrimitiveArrayCritical(in_packetData, NULL);
- void *localData = malloc(packetLength);
- memcpy(localData, packetData, packetLength);
- env->ReleasePrimitiveArrayCritical(in_packetData, packetData, 0);
-
- uint64_t nextBackgroundTaskDeadline = 0;
-
- ZT_ResultCode rc = ZT_Node_processWirePacket(
- node,
- now,
- &localAddress,
- &remoteAddress,
- localData,
- packetLength,
- &nextBackgroundTaskDeadline);
- if(rc != ZT_RESULT_OK)
- {
- LOGE("ZT_Node_processWirePacket returned: %d", rc);
- }
-
- free(localData);
-
- jlong *outDeadline = (jlong*)env->GetPrimitiveArrayCritical(out_nextBackgroundTaskDeadline, NULL);
- outDeadline[0] = (jlong)nextBackgroundTaskDeadline;
- env->ReleasePrimitiveArrayCritical(out_nextBackgroundTaskDeadline, outDeadline, 0);
-
- return createResultObject(env, rc);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: processBackgroundTasks
- * Signature: (JJ[J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_processBackgroundTasks(
- JNIEnv *env, jobject obj,
- jlong id,
- jlong in_now,
- jlongArray out_nextBackgroundTaskDeadline)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- unsigned int nbtd_len = env->GetArrayLength(out_nextBackgroundTaskDeadline);
- if(nbtd_len < 1)
- {
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- uint64_t now = (uint64_t)in_now;
- uint64_t nextBackgroundTaskDeadline = 0;
-
- ZT_ResultCode rc = ZT_Node_processBackgroundTasks(node, now, &nextBackgroundTaskDeadline);
-
- jlong *outDeadline = (jlong*)env->GetPrimitiveArrayCritical(out_nextBackgroundTaskDeadline, NULL);
- outDeadline[0] = (jlong)nextBackgroundTaskDeadline;
- env->ReleasePrimitiveArrayCritical(out_nextBackgroundTaskDeadline, outDeadline, 0);
-
- return createResultObject(env, rc);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: join
- * Signature: (JJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_join(
- JNIEnv *env, jobject obj, jlong id, jlong in_nwid)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- uint64_t nwid = (uint64_t)in_nwid;
-
- ZT_ResultCode rc = ZT_Node_join(node, nwid, NULL);
-
- return createResultObject(env, rc);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: leave
- * Signature: (JJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_leave(
- JNIEnv *env, jobject obj, jlong id, jlong in_nwid)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- uint64_t nwid = (uint64_t)in_nwid;
-
- ZT_ResultCode rc = ZT_Node_leave(node, nwid, NULL);
-
- return createResultObject(env, rc);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: multicastSubscribe
- * Signature: (JJJJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_multicastSubscribe(
- JNIEnv *env, jobject obj,
- jlong id,
- jlong in_nwid,
- jlong in_multicastGroup,
- jlong in_multicastAdi)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- uint64_t nwid = (uint64_t)in_nwid;
- uint64_t multicastGroup = (uint64_t)in_multicastGroup;
- unsigned long multicastAdi = (unsigned long)in_multicastAdi;
-
- ZT_ResultCode rc = ZT_Node_multicastSubscribe(
- node, nwid, multicastGroup, multicastAdi);
-
- return createResultObject(env, rc);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: multicastUnsubscribe
- * Signature: (JJJJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_multicastUnsubscribe(
- JNIEnv *env, jobject obj,
- jlong id,
- jlong in_nwid,
- jlong in_multicastGroup,
- jlong in_multicastAdi)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return createResultObject(env, ZT_RESULT_FATAL_ERROR_INTERNAL);
- }
-
- uint64_t nwid = (uint64_t)in_nwid;
- uint64_t multicastGroup = (uint64_t)in_multicastGroup;
- unsigned long multicastAdi = (unsigned long)in_multicastAdi;
-
- ZT_ResultCode rc = ZT_Node_multicastUnsubscribe(
- node, nwid, multicastGroup, multicastAdi);
-
- return createResultObject(env, rc);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: address
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_com_zerotier_sdk_Node_address(
- JNIEnv *env , jobject obj, jlong id)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return 0;
- }
-
- uint64_t address = ZT_Node_address(node);
- return (jlong)address;
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: status
- * Signature: (J)Lcom/zerotier/sdk/NodeStatus;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_status
- (JNIEnv *env, jobject obj, jlong id)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return 0;
- }
-
- jclass nodeStatusClass = NULL;
- jmethodID nodeStatusConstructor = NULL;
-
- // create a com.zerotier.sdk.NodeStatus object
- nodeStatusClass = lookup.findClass("com/zerotier/sdk/NodeStatus");
- if(nodeStatusClass == NULL)
- {
- return NULL;
- }
-
- nodeStatusConstructor = lookup.findMethod(
- nodeStatusClass, "<init>", "()V");
- if(nodeStatusConstructor == NULL)
- {
- return NULL;
- }
-
- jobject nodeStatusObj = env->NewObject(nodeStatusClass, nodeStatusConstructor);
- if(nodeStatusObj == NULL)
- {
- return NULL;
- }
-
- ZT_NodeStatus nodeStatus;
- ZT_Node_status(node, &nodeStatus);
-
- jfieldID addressField = NULL;
- jfieldID publicIdentityField = NULL;
- jfieldID secretIdentityField = NULL;
- jfieldID onlineField = NULL;
-
- addressField = lookup.findField(nodeStatusClass, "address", "J");
- if(addressField == NULL)
- {
- return NULL;
- }
-
- publicIdentityField = lookup.findField(nodeStatusClass, "publicIdentity", "Ljava/lang/String;");
- if(publicIdentityField == NULL)
- {
- return NULL;
- }
-
- secretIdentityField = lookup.findField(nodeStatusClass, "secretIdentity", "Ljava/lang/String;");
- if(secretIdentityField == NULL)
- {
- return NULL;
- }
-
- onlineField = lookup.findField(nodeStatusClass, "online", "Z");
- if(onlineField == NULL)
- {
- return NULL;
- }
-
- env->SetLongField(nodeStatusObj, addressField, nodeStatus.address);
-
- jstring pubIdentStr = env->NewStringUTF(nodeStatus.publicIdentity);
- if(pubIdentStr == NULL)
- {
- return NULL; // out of memory
- }
- env->SetObjectField(nodeStatusObj, publicIdentityField, pubIdentStr);
-
- jstring secIdentStr = env->NewStringUTF(nodeStatus.secretIdentity);
- if(secIdentStr == NULL)
- {
- return NULL; // out of memory
- }
- env->SetObjectField(nodeStatusObj, secretIdentityField, secIdentStr);
-
- env->SetBooleanField(nodeStatusObj, onlineField, nodeStatus.online);
-
- return nodeStatusObj;
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: networkConfig
- * Signature: (J)Lcom/zerotier/sdk/VirtualNetworkConfig;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_networkConfig(
- JNIEnv *env, jobject obj, jlong id, jlong nwid)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return 0;
- }
-
- ZT_VirtualNetworkConfig *vnetConfig = ZT_Node_networkConfig(node, nwid);
-
- jobject vnetConfigObject = newNetworkConfig(env, *vnetConfig);
-
- ZT_Node_freeQueryResult(node, vnetConfig);
-
- return vnetConfigObject;
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: version
- * Signature: (J)Lcom/zerotier/sdk/Version;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_version(
- JNIEnv *env, jobject obj)
-{
- int major = 0;
- int minor = 0;
- int revision = 0;
-
- ZT_version(&major, &minor, &revision);
-
- return newVersion(env, major, minor, revision);
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: peers
- * Signature: (J)[Lcom/zerotier/sdk/Peer;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_zerotier_sdk_Node_peers(
- JNIEnv *env, jobject obj, jlong id)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return 0;
- }
-
- ZT_PeerList *peerList = ZT_Node_peers(node);
-
- if(peerList == NULL)
- {
- LOGE("ZT_Node_peers returned NULL");
- return NULL;
- }
-
- int peerCount = peerList->peerCount * 100;
- LOGV("Ensure Local Capacity: %d", peerCount);
- if(env->EnsureLocalCapacity(peerCount))
- {
- LOGE("EnsureLocalCapacity failed!!");
- ZT_Node_freeQueryResult(node, peerList);
- return NULL;
- }
-
- jclass peerClass = lookup.findClass("com/zerotier/sdk/Peer");
- if(env->ExceptionCheck() || peerClass == NULL)
- {
- LOGE("Error finding Peer class");
- ZT_Node_freeQueryResult(node, peerList);
- return NULL;
- }
-
- jobjectArray peerArrayObj = env->NewObjectArray(
- peerList->peerCount, peerClass, NULL);
-
- if(env->ExceptionCheck() || peerArrayObj == NULL)
- {
- LOGE("Error creating Peer[] array");
- ZT_Node_freeQueryResult(node, peerList);
- return NULL;
- }
-
-
- for(unsigned int i = 0; i < peerList->peerCount; ++i)
- {
- jobject peerObj = newPeer(env, peerList->peers[i]);
- env->SetObjectArrayElement(peerArrayObj, i, peerObj);
- if(env->ExceptionCheck())
- {
- LOGE("Error assigning Peer object to array");
- break;
- }
- }
-
- ZT_Node_freeQueryResult(node, peerList);
- peerList = NULL;
-
- return peerArrayObj;
-}
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: networks
- * Signature: (J)[Lcom/zerotier/sdk/VirtualNetworkConfig;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_zerotier_sdk_Node_networks(
- JNIEnv *env, jobject obj, jlong id)
-{
- uint64_t nodeId = (uint64_t) id;
- ZT_Node *node = findNode(nodeId);
- if(node == NULL)
- {
- // cannot find valid node. We should never get here.
- return 0;
- }
-
- ZT_VirtualNetworkList *networkList = ZT_Node_networks(node);
- if(networkList == NULL)
- {
- return NULL;
- }
-
- jclass vnetConfigClass = lookup.findClass("com/zerotier/sdk/VirtualNetworkConfig");
- if(env->ExceptionCheck() || vnetConfigClass == NULL)
- {
- LOGE("Error finding VirtualNetworkConfig class");
- ZT_Node_freeQueryResult(node, networkList);
- return NULL;
- }
-
- jobjectArray networkListObject = env->NewObjectArray(
- networkList->networkCount, vnetConfigClass, NULL);
- if(env->ExceptionCheck() || networkListObject == NULL)
- {
- LOGE("Error creating VirtualNetworkConfig[] array");
- ZT_Node_freeQueryResult(node, networkList);
- return NULL;
- }
-
- for(unsigned int i = 0; i < networkList->networkCount; ++i)
- {
- jobject networkObject = newNetworkConfig(env, networkList->networks[i]);
- env->SetObjectArrayElement(networkListObject, i, networkObject);
- if(env->ExceptionCheck())
- {
- LOGE("Error assigning VirtualNetworkConfig object to array");
- break;
- }
- }
-
- ZT_Node_freeQueryResult(node, networkList);
-
- return networkListObject;
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif \ No newline at end of file
diff --git a/zerotierone/java/jni/com_zerotierone_sdk_Node.h b/zerotierone/java/jni/com_zerotierone_sdk_Node.h
deleted file mode 100644
index 7c1011a..0000000
--- a/zerotierone/java/jni/com_zerotierone_sdk_Node.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_zerotier_sdk_Node */
-
-#ifndef _Included_com_zerotierone_sdk_Node
-#define _Included_com_zerotierone_sdk_Node
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: com_zerotier_sdk_Node
- * Method: node_init
- * Signature: (J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_node_1init
- (JNIEnv *, jobject, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: node_delete
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_zerotier_sdk_Node_node_1delete
- (JNIEnv *, jobject, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: processVirtualNetworkFrame
- * Signature: (JJJJJII[B[J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_processVirtualNetworkFrame
- (JNIEnv *, jobject, jlong, jlong, jlong, jlong, jlong, jint, jint, jbyteArray, jlongArray);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: processWirePacket
- * Signature: (JJLjava/net/InetSockAddress;Ljava/net/InetSockAddress;[B[J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_processWirePacket
- (JNIEnv *, jobject, jlong, jlong, jobject, jobject, jbyteArray, jlongArray);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: processBackgroundTasks
- * Signature: (JJ[J)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_processBackgroundTasks
- (JNIEnv *, jobject, jlong, jlong, jlongArray);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: join
- * Signature: (JJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_join
- (JNIEnv *, jobject, jlong, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: leave
- * Signature: (JJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_leave
- (JNIEnv *, jobject, jlong, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: multicastSubscribe
- * Signature: (JJJJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_multicastSubscribe
- (JNIEnv *, jobject, jlong, jlong, jlong, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: multicastUnsubscribe
- * Signature: (JJJJ)Lcom/zerotier/sdk/ResultCode;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_multicastUnsubscribe
- (JNIEnv *, jobject, jlong, jlong, jlong, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: address
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_com_zerotier_sdk_Node_address
- (JNIEnv *, jobject, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: status
- * Signature: (J)Lcom/zerotier/sdk/NodeStatus;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_status
- (JNIEnv *, jobject, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: networkConfig
- * Signature: (JJ)Lcom/zerotier/sdk/VirtualNetworkConfig;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_networkConfig
- (JNIEnv *, jobject, jlong, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: version
- * Signature: ()Lcom/zerotier/sdk/Version;
- */
-JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_version
- (JNIEnv *, jobject);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: peers
- * Signature: (J)[Lcom/zerotier/sdk/Peer;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_zerotier_sdk_Node_peers
- (JNIEnv *, jobject, jlong);
-
-/*
- * Class: com_zerotier_sdk_Node
- * Method: networks
- * Signature: (J)[Lcom/zerotier/sdk/VirtualNetworkConfig;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_zerotier_sdk_Node_networks
- (JNIEnv *, jobject, jlong);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/zerotierone/java/src/com/zerotier/sdk/DataStoreGetListener.java b/zerotierone/java/src/com/zerotier/sdk/DataStoreGetListener.java
deleted file mode 100644
index b525be6..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/DataStoreGetListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-package com.zerotier.sdk;
-
-public interface DataStoreGetListener {
-
- /**
- * Function to get an object from the data store
- *
- * <p>Object names can contain forward slash (/) path separators. They will
- * never contain .. or backslash (\), so this is safe to map as a Unix-style
- * path if the underlying storage permits. For security reasons we recommend
- * returning errors if .. or \ are used.</p>
- *
- * <p>The function must return the actual number of bytes read. If the object
- * doesn't exist, it should return -1. -2 should be returned on other errors
- * such as errors accessing underlying storage.</p>
- *
- * <p>If the read doesn't fit in the buffer, the max number of bytes should be
- * read. The caller may call the function multiple times to read the whole
- * object.</p>
- *
- * @param name Name of the object in the data store
- * @param out_buffer buffer to put the object in
- * @param bufferIndex index in the object to start reading
- * @param out_objectSize long[1] to be set to the actual size of the object if it exists.
- * @return the actual number of bytes read.
- */
- public long onDataStoreGet(
- String name,
- byte[] out_buffer,
- long bufferIndex,
- long[] out_objectSize);
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/DataStorePutListener.java b/zerotierone/java/src/com/zerotier/sdk/DataStorePutListener.java
deleted file mode 100644
index 77e5502..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/DataStorePutListener.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-package com.zerotier.sdk;
-
-public interface DataStorePutListener {
-
- /**
- * Function to store an object in the data store
- *
- * <p>If secure is true, the file should be set readable and writable only
- * to the user running ZeroTier One. What this means is platform-specific.</p>
- *
- * <p>Name semantics are the same as {@link DataStoreGetListener}. This must return
- * zero on success. You can return any OS-specific error code on failure, as these
- * may be visible in logs or error messages and might aid in debugging.</p>
- *
- * @param name Object name
- * @param buffer data to store
- * @param secure set to user read/write only.
- * @return 0 on success.
- */
- public int onDataStorePut(
- String name,
- byte[] buffer,
- boolean secure);
-
- /**
- * Function to delete an object from the data store
- *
- * @param name Object name
- * @return 0 on success.
- */
- public int onDelete(
- String name);
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/Event.java b/zerotierone/java/src/com/zerotier/sdk/Event.java
deleted file mode 100644
index 22d350e..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/Event.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-public enum Event {
- /**
- * Node has been initialized
- *
- * This is the first event generated, and is always sent. It may occur
- * before Node's constructor returns.
- */
- EVENT_UP,
-
- /**
- * Node is offline -- network does not seem to be reachable by any available strategy
- */
- EVENT_OFFLINE,
-
- /**
- * Node is online -- at least one upstream node appears reachable
- *
- * Meta-data: none
- */
- EVENT_ONLINE,
-
- /**
- * Node is shutting down
- *
- * <p>This is generated within Node's destructor when it is being shut down.
- * It's done for convenience, since cleaning up other state in the event
- * handler may appear more idiomatic.</p>
- */
- EVENT_DOWN,
-
- /**
- * Your identity has collided with another node's ZeroTier address
- *
- * <p>This happens if two different public keys both hash (via the algorithm
- * in Identity::generate()) to the same 40-bit ZeroTier address.</p>
- *
- * <p>This is something you should "never" see, where "never" is defined as
- * once per 2^39 new node initializations / identity creations. If you do
- * see it, you're going to see it very soon after a node is first
- * initialized.</p>
- *
- * <p>This is reported as an event rather than a return code since it's
- * detected asynchronously via error messages from authoritative nodes.</p>
- *
- * <p>If this occurs, you must shut down and delete the node, delete the
- * identity.secret record/file from the data store, and restart to generate
- * a new identity. If you don't do this, you will not be able to communicate
- * with other nodes.</p>
- *
- * <p>We'd automate this process, but we don't think silently deleting
- * private keys or changing our address without telling the calling code
- * is good form. It violates the principle of least surprise.</p>
- *
- * <p>You can technically get away with not handling this, but we recommend
- * doing so in a mature reliable application. Besides, handling this
- * condition is a good way to make sure it never arises. It's like how
- * umbrellas prevent rain and smoke detectors prevent fires. They do, right?</p>
- */
- EVENT_FATAL_ERROR_IDENTITY_COLLISION,
-
- /**
- * Trace (debugging) message
- *
- * <p>These events are only generated if this is a TRACE-enabled build.</p>
- *
- * <p>Meta-data: {@link String}, TRACE message</p>
- */
- EVENT_TRACE
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/EventListener.java b/zerotierone/java/src/com/zerotier/sdk/EventListener.java
deleted file mode 100644
index 91050aa..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/EventListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-import java.net.InetSocketAddress;
-import java.lang.String;
-
-/**
- * Interface to handle callbacks for ZeroTier One events.
- */
-public interface EventListener {
- /**
- * Callback for events with no other associated metadata
- *
- * @param event {@link Event} enum
- */
- public void onEvent(Event event);
-
- /**
- * Trace messages
- *
- * <p>These events are only generated if the underlying ZeroTierOne SDK is a TRACE-enabled build.</p>
- *
- * @param message the trace message
- */
- public void onTrace(String message);
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/NativeUtils.java b/zerotierone/java/src/com/zerotier/sdk/NativeUtils.java
deleted file mode 100644
index 07e1ef5..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/NativeUtils.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.zerotier.sdk;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * Simple library class for working with JNI (Java Native Interface)
- *
- * @see http://adamheinrich.com/2012/how-to-load-native-jni-library-from-jar
- *
- * @author Adam Heirnich <[email protected]>, http://www.adamh.cz
- */
-public class NativeUtils {
-
- /**
- * Private constructor - this class will never be instanced
- */
- private NativeUtils() {
- }
-
- /**
- * Loads library from current JAR archive
- *
- * The file from JAR is copied into system temporary directory and then loaded. The temporary file is deleted after exiting.
- * Method uses String as filename because the pathname is "abstract", not system-dependent.
- *
- * @param filename The filename inside JAR as absolute path (beginning with '/'), e.g. /package/File.ext
- * @throws IOException If temporary file creation or read/write operation fails
- * @throws IllegalArgumentException If source file (param path) does not exist
- * @throws IllegalArgumentException If the path is not absolute or if the filename is shorter than three characters (restriction of {@see File#createTempFile(java.lang.String, java.lang.String)}).
- */
- public static void loadLibraryFromJar(String path) throws IOException {
-
- if (!path.startsWith("/")) {
- throw new IllegalArgumentException("The path has to be absolute (start with '/').");
- }
-
- // Obtain filename from path
- String[] parts = path.split("/");
- String filename = (parts.length > 1) ? parts[parts.length - 1] : null;
-
- // Split filename to prexif and suffix (extension)
- String prefix = "";
- String suffix = null;
- if (filename != null) {
- parts = filename.split("\\.", 2);
- prefix = parts[0];
- suffix = (parts.length > 1) ? "."+parts[parts.length - 1] : null; // Thanks, davs! :-)
- }
-
- // Check if the filename is okay
- if (filename == null || prefix.length() < 3) {
- throw new IllegalArgumentException("The filename has to be at least 3 characters long.");
- }
-
- // Prepare temporary file
- File temp = File.createTempFile(prefix, suffix);
- temp.deleteOnExit();
-
- if (!temp.exists()) {
- throw new FileNotFoundException("File " + temp.getAbsolutePath() + " does not exist.");
- }
-
- // Prepare buffer for data copying
- byte[] buffer = new byte[1024];
- int readBytes;
-
- // Open and check input stream
- InputStream is = NativeUtils.class.getResourceAsStream(path);
- if (is == null) {
- throw new FileNotFoundException("File " + path + " was not found inside JAR.");
- }
-
- // Open output stream and copy data between source file in JAR and the temporary file
- OutputStream os = new FileOutputStream(temp);
- try {
- while ((readBytes = is.read(buffer)) != -1) {
- os.write(buffer, 0, readBytes);
- }
- } finally {
- // If read/write fails, close streams safely before throwing an exception
- os.close();
- is.close();
- }
-
- // Finally, load the library
- System.load(temp.getAbsolutePath());
- }
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/Node.java b/zerotierone/java/src/com/zerotier/sdk/Node.java
deleted file mode 100644
index 4bc6e18..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/Node.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-import java.net.InetSocketAddress;
-import java.util.ArrayList;
-import java.io.IOException;
-
-/**
- * A ZeroTier One node
- */
-public class Node {
- static {
- try {
- System.loadLibrary("ZeroTierOneJNI");
- } catch (UnsatisfiedLinkError e) {
- try {
- if(System.getProperty("os.name").startsWith("Windows")) {
- System.out.println("Arch: " + System.getProperty("sun.arch.data.model"));
- if(System.getProperty("sun.arch.data.model").equals("64")) {
- NativeUtils.loadLibraryFromJar("/lib/ZeroTierOneJNI_win64.dll");
- } else {
- NativeUtils.loadLibraryFromJar("/lib/ZeroTierOneJNI_win32.dll");
- }
- } else if(System.getProperty("os.name").startsWith("Mac")) {
- NativeUtils.loadLibraryFromJar("/lib/libZeroTierOneJNI.jnilib");
- } else {
- // TODO: Linux
- }
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
- }
-
- private static final String TAG = "NODE";
-
- /**
- * Node ID for JNI purposes.
- * Currently set to the now value passed in at the constructor
- *
- * -1 if the node has already been closed
- */
- private long nodeId;
-
- private final DataStoreGetListener getListener;
- private final DataStorePutListener putListener;
- private final PacketSender sender;
- private final EventListener eventListener;
- private final VirtualNetworkFrameListener frameListener;
- private final VirtualNetworkConfigListener configListener;
-
- /**
- * Create a new ZeroTier One node
- *
- * <p>Note that this can take a few seconds the first time it's called, as it
- * will generate an identity.</p>
- *
- * @param now Current clock in milliseconds
- * @param getListener User written instance of the {@link DataStoreGetListener} interface called to get objects from persistent storage. This instance must be unique per Node object.
- * @param putListener User written intstance of the {@link DataStorePutListener} interface called to put objects in persistent storage. This instance must be unique per Node object.
- * @param sender
- * @param eventListener User written instance of the {@link EventListener} interface to receive status updates and non-fatal error notices. This instance must be unique per Node object.
- * @param frameListener
- * @param configListener User written instance of the {@link VirtualNetworkConfigListener} interface to be called when virtual LANs are created, deleted, or their config parameters change. This instance must be unique per Node object.
- */
- public Node(long now,
- DataStoreGetListener getListener,
- DataStorePutListener putListener,
- PacketSender sender,
- EventListener eventListener,
- VirtualNetworkFrameListener frameListener,
- VirtualNetworkConfigListener configListener) throws NodeException
- {
- this.nodeId = now;
-
- this.getListener = getListener;
- this.putListener = putListener;
- this.sender = sender;
- this.eventListener = eventListener;
- this.frameListener = frameListener;
- this.configListener = configListener;
-
- ResultCode rc = node_init(now);
- if(rc != ResultCode.RESULT_OK)
- {
- // TODO: Throw Exception
- throw new NodeException(rc.toString());
- }
- }
-
- /**
- * Close this Node.
- *
- * <p>The Node object can no longer be used once this method is called.</p>
- */
- public void close() {
- if(nodeId != -1) {
- node_delete(nodeId);
- nodeId = -1;
- }
- }
-
- @Override
- protected void finalize() {
- close();
- }
-
- /**
- * Process a frame from a virtual network port
- *
- * @param now Current clock in milliseconds
- * @param nwid ZeroTier 64-bit virtual network ID
- * @param sourceMac Source MAC address (least significant 48 bits)
- * @param destMac Destination MAC address (least significant 48 bits)
- * @param etherType 16-bit Ethernet frame type
- * @param vlanId 10-bit VLAN ID or 0 if none
- * @param frameData Frame payload data
- * @param nextBackgroundTaskDeadline Value/result: set to deadline for next call to processBackgroundTasks()
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode processVirtualNetworkFrame(
- long now,
- long nwid,
- long sourceMac,
- long destMac,
- int etherType,
- int vlanId,
- byte[] frameData,
- long[] nextBackgroundTaskDeadline) {
- return processVirtualNetworkFrame(
- nodeId, now, nwid, sourceMac, destMac, etherType, vlanId,
- frameData, nextBackgroundTaskDeadline);
- }
-
- /**
- * Process a packet received from the physical wire
- *
- * @param now Current clock in milliseconds
- * @param remoteAddress Origin of packet
- * @param packetData Packet data
- * @param nextBackgroundTaskDeadline Value/result: set to deadline for next call to processBackgroundTasks()
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode processWirePacket(
- long now,
- InetSocketAddress localAddress,
- InetSocketAddress remoteAddress,
- byte[] packetData,
- long[] nextBackgroundTaskDeadline) {
- return processWirePacket(
- nodeId, now, localAddress, remoteAddress, packetData,
- nextBackgroundTaskDeadline);
- }
-
- /**
- * Perform periodic background operations
- *
- * @param now Current clock in milliseconds
- * @param nextBackgroundTaskDeadline Value/result: set to deadline for next call to processBackgroundTasks()
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode processBackgroundTasks(long now, long[] nextBackgroundTaskDeadline) {
- return processBackgroundTasks(nodeId, now, nextBackgroundTaskDeadline);
- }
-
- /**
- * Join a network
- *
- * <p>This may generate calls to the port config callback before it returns,
- * or these may be deffered if a netconf is not available yet.</p>
- *
- * <p>If we are already a member of the network, nothing is done and OK is
- * returned.</p>
- *
- * @param nwid 64-bit ZeroTier network ID
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode join(long nwid) {
- return join(nodeId, nwid);
- }
-
- /**
- * Leave a network
- *
- * <p>If a port has been configured for this network this will generate a call
- * to the port config callback with a NULL second parameter to indicate that
- * the port is now deleted.</p>
- *
- * @param nwid 64-bit network ID
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode leave(long nwid) {
- return leave(nodeId, nwid);
- }
-
- /**
- * Subscribe to an Ethernet multicast group
- *
- * <p>For IPv4 ARP, the implementation must subscribe to 0xffffffffffff (the
- * broadcast address) but with an ADI equal to each IPv4 address in host
- * byte order. This converts ARP from a non-scalable broadcast protocol to
- * a scalable multicast protocol with perfect address specificity.</p>
- *
- * <p>If this is not done, ARP will not work reliably.</p>
- *
- * <p>Multiple calls to subscribe to the same multicast address will have no
- * effect. It is perfectly safe to do this.</p>
- *
- * <p>This does not generate an update call to the {@link VirtualNetworkConfigListener#onNetworkConfigurationUpdated} method.</p>
- *
- * @param nwid 64-bit network ID
- * @param multicastGroup Ethernet multicast or broadcast MAC (least significant 48 bits)
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode multicastSubscribe(
- long nwid,
- long multicastGroup) {
- return multicastSubscribe(nodeId, nwid, multicastGroup, 0);
- }
-
- /**
- * Subscribe to an Ethernet multicast group
- *
- * <p>ADI stands for additional distinguishing information. This defaults to zero
- * and is rarely used. Right now its only use is to enable IPv4 ARP to scale,
- * and this must be done.</p>
- *
- * <p>For IPv4 ARP, the implementation must subscribe to 0xffffffffffff (the
- * broadcast address) but with an ADI equal to each IPv4 address in host
- * byte order. This converts ARP from a non-scalable broadcast protocol to
- * a scalable multicast protocol with perfect address specificity.</p>
- *
- * <p>If this is not done, ARP will not work reliably.</p>
- *
- * <p>Multiple calls to subscribe to the same multicast address will have no
- * effect. It is perfectly safe to do this.</p>
- *
- * <p>This does not generate an update call to the {@link VirtualNetworkConfigListener#onNetworkConfigurationUpdated} method.</p>
- *
- * @param nwid 64-bit network ID
- * @param multicastGroup Ethernet multicast or broadcast MAC (least significant 48 bits)
- * @param multicastAdi Multicast ADI (least significant 32 bits only, default: 0)
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode multicastSubscribe(
- long nwid,
- long multicastGroup,
- long multicastAdi) {
- return multicastSubscribe(nodeId, nwid, multicastGroup, multicastAdi);
- }
-
-
- /**
- * Unsubscribe from an Ethernet multicast group (or all groups)
- *
- * <p>If multicastGroup is zero (0), this will unsubscribe from all groups. If
- * you are not subscribed to a group this has no effect.</p>
- *
- * <p>This does not generate an update call to the {@link VirtualNetworkConfigListener#onNetworkConfigurationUpdated} method.</p>
- *
- * @param nwid 64-bit network ID
- * @param multicastGroup Ethernet multicast or broadcast MAC (least significant 48 bits)
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode multicastUnsubscribe(
- long nwid,
- long multicastGroup) {
- return multicastUnsubscribe(nodeId, nwid, multicastGroup, 0);
- }
-
- /**
- * Unsubscribe from an Ethernet multicast group (or all groups)
- *
- * <p>If multicastGroup is zero (0), this will unsubscribe from all groups. If
- * you are not subscribed to a group this has no effect.</p>
- *
- * <p>This does not generate an update call to the {@link VirtualNetworkConfigListener#onNetworkConfigurationUpdated} method.</p>
- *
- * <p>ADI stands for additional distinguishing information. This defaults to zero
- * and is rarely used. Right now its only use is to enable IPv4 ARP to scale,
- * and this must be done.</p>
- *
- * @param nwid 64-bit network ID
- * @param multicastGroup Ethernet multicast or broadcast MAC (least significant 48 bits)
- * @param multicastAdi Multicast ADI (least significant 32 bits only, default: 0)
- * @return OK (0) or error code if a fatal error condition has occurred
- */
- public ResultCode multicastUnsubscribe(
- long nwid,
- long multicastGroup,
- long multicastAdi) {
- return multicastUnsubscribe(nodeId, nwid, multicastGroup, multicastAdi);
- }
-
- /**
- * Get this node's 40-bit ZeroTier address
- *
- * @return ZeroTier address (least significant 40 bits of 64-bit int)
- */
- public long address() {
- return address(nodeId);
- }
-
- /**
- * Get the status of this node
- *
- * @return @{link NodeStatus} struct with the current node status.
- */
- public NodeStatus status() {
- return status(nodeId);
- }
-
- /**
- * Get a list of known peer nodes
- *
- * @return List of known peers or NULL on failure
- */
- public Peer[] peers() {
- return peers(nodeId);
- }
-
- /**
- * Get the status of a virtual network
- *
- * @param nwid 64-bit network ID
- * @return {@link VirtualNetworkConfig} or NULL if we are not a member of this network
- */
- public VirtualNetworkConfig networkConfig(long nwid) {
- return networkConfig(nodeId, nwid);
- }
-
- /**
- * Enumerate and get status of all networks
- *
- * @return List of networks or NULL on failure
- */
- public VirtualNetworkConfig[] networks() {
- return networks(nodeId);
- }
-
- /**
- * Get ZeroTier One version
- *
- * @return {@link Version} object with ZeroTierOne version information.
- */
- public Version getVersion() {
- return version();
- }
-
- //
- // function declarations for JNI
- //
- private native ResultCode node_init(long now);
-
- private native void node_delete(long nodeId);
-
- private native ResultCode processVirtualNetworkFrame(
- long nodeId,
- long now,
- long nwid,
- long sourceMac,
- long destMac,
- int etherType,
- int vlanId,
- byte[] frameData,
- long[] nextBackgroundTaskDeadline);
-
- private native ResultCode processWirePacket(
- long nodeId,
- long now,
- InetSocketAddress localAddress,
- InetSocketAddress remoteAddress,
- byte[] packetData,
- long[] nextBackgroundTaskDeadline);
-
- private native ResultCode processBackgroundTasks(
- long nodeId,
- long now,
- long[] nextBackgroundTaskDeadline);
-
- private native ResultCode join(long nodeId, long nwid);
-
- private native ResultCode leave(long nodeId, long nwid);
-
- private native ResultCode multicastSubscribe(
- long nodeId,
- long nwid,
- long multicastGroup,
- long multicastAdi);
-
- private native ResultCode multicastUnsubscribe(
- long nodeId,
- long nwid,
- long multicastGroup,
- long multicastAdi);
-
- private native long address(long nodeId);
-
- private native NodeStatus status(long nodeId);
-
- private native VirtualNetworkConfig networkConfig(long nodeId, long nwid);
-
- private native Version version();
-
- private native Peer[] peers(long nodeId);
-
- private native VirtualNetworkConfig[] networks(long nodeId);
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/NodeException.java b/zerotierone/java/src/com/zerotier/sdk/NodeException.java
deleted file mode 100644
index 1fdef72..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/NodeException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-import java.lang.RuntimeException;
-
-public class NodeException extends RuntimeException {
- public NodeException(String message) {
- super(message);
- }
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/NodeStatus.java b/zerotierone/java/src/com/zerotier/sdk/NodeStatus.java
deleted file mode 100644
index 94376d8..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/NodeStatus.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-public final class NodeStatus {
- private long address;
- private String publicIdentity;
- private String secretIdentity;
- private boolean online;
-
- private NodeStatus() {}
-
- /**
- * 40-bit ZeroTier address of this node
- */
- public final long getAddres() {
- return address;
- }
-
- /**
- * Public identity in string-serialized form (safe to send to others)
- *
- * <p>This identity will remain valid as long as the node exists.</p>
- */
- public final String getPublicIdentity() {
- return publicIdentity;
- }
-
- /**
- * Full identity including secret key in string-serialized form
- *
- * <p>This identity will remain valid as long as the node exists.</p>
- */
- public final String getSecretIdentity() {
- return secretIdentity;
- }
-
- /**
- * True if some kind of connectivity appears available
- */
- public final boolean isOnline() {
- return online;
- }
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/PacketSender.java b/zerotierone/java/src/com/zerotier/sdk/PacketSender.java
deleted file mode 100644
index 22893ec..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/PacketSender.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-package com.zerotier.sdk;
-
-import java.net.InetSocketAddress;
-
-
-public interface PacketSender {
- /**
- * Function to send a ZeroTier packet out over the wire
- *
- * <p>The function must return zero on success and may return any error code
- * on failure. Note that success does not (of course) guarantee packet
- * delivery. It only means that the packet appears to have been sent.</p>
- *
- * @param localAddr {@link InetSocketAddress} to send from. Set to null if not specified.
- * @param remoteAddr {@link InetSocketAddress} to send to
- * @param packetData data to send
- * @return 0 on success, any error code on failure.
- */
- public int onSendPacketRequested(
- InetSocketAddress localAddr,
- InetSocketAddress remoteAddr,
- byte[] packetData,
- int ttl);
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/Peer.java b/zerotierone/java/src/com/zerotier/sdk/Peer.java
deleted file mode 100644
index eb3d713..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/Peer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-import java.util.ArrayList;
-
-/**
- * Peer status result
- */
-public final class Peer {
- private long address;
- private int versionMajor;
- private int versionMinor;
- private int versionRev;
- private int latency;
- private PeerRole role;
- private PeerPhysicalPath[] paths;
-
- private Peer() {}
-
- /**
- * ZeroTier address (40 bits)
- */
- public final long address() {
- return address;
- }
-
- /**
- * Remote major version or -1 if not known
- */
- public final int versionMajor() {
- return versionMajor;
- }
-
- /**
- * Remote minor version or -1 if not known
- */
- public final int versionMinor() {
- return versionMinor;
- }
-
- /**
- * Remote revision or -1 if not known
- */
- public final int versionRev() {
- return versionRev;
- }
-
- /**
- * Last measured latency in milliseconds or zero if unknown
- */
- public final int latency() {
- return latency;
- }
-
- /**
- * What trust hierarchy role does this device have?
- */
- public final PeerRole role() {
- return role;
- }
-
- /**
- * Known network paths to peer
- */
- public final PeerPhysicalPath[] paths() {
- return paths;
- }
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/PeerPhysicalPath.java b/zerotierone/java/src/com/zerotier/sdk/PeerPhysicalPath.java
deleted file mode 100644
index 3f9a861..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/PeerPhysicalPath.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-import java.net.InetSocketAddress;
-
-/**
- * Physical network path to a peer
- */
-public final class PeerPhysicalPath {
- private InetSocketAddress address;
- private long lastSend;
- private long lastReceive;
- private boolean fixed;
- private boolean preferred;
-
- private PeerPhysicalPath() {}
-
- /**
- * Address of endpoint
- */
- public final InetSocketAddress address() {
- return address;
- }
-
- /**
- * Time of last send in milliseconds or 0 for never
- */
- public final long lastSend() {
- return lastSend;
- }
-
- /**
- * Time of last receive in milliseconds or 0 for never
- */
- public final long lastReceive() {
- return lastReceive;
- }
-
- /**
- * Is path fixed? (i.e. not learned, static)
- */
- public final boolean isFixed() {
- return fixed;
- }
-
- /**
- * Is path preferred?
- */
- public final boolean isPreferred() {
- return preferred;
- }
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/PeerRole.java b/zerotierone/java/src/com/zerotier/sdk/PeerRole.java
deleted file mode 100644
index fce183d..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/PeerRole.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-public enum PeerRole {
- /**
- * An ordinary node
- */
- PEER_ROLE_LEAF,
-
- /**
- * moon root
- */
- PEER_ROLE_MOON,
-
- /**
- * planetary root
- */
- PEER_ROLE_PLANET
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/ResultCode.java b/zerotierone/java/src/com/zerotier/sdk/ResultCode.java
deleted file mode 100644
index 5da82b3..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/ResultCode.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-/**
- * Function return code: OK (0) or error results
- *
- * <p>Use {@link ResultCode#isFatal) to check for a fatal error. If a fatal error
- * occurs, the node should be considered to not be working correctly. These
- * indicate serious problems like an inaccessible data store or a compile
- * problem.</p>
- */
-public enum ResultCode {
- /**
- * Operation completed normally
- */
- RESULT_OK(0),
-
- // Fatal errors (> 0, < 1000)
- /**
- * Ran out of memory
- */
- RESULT_FATAL_ERROR_OUT_OF_MEMORY(1),
-
- /**
- * Data store is not writable or has failed
- */
- RESULT_FATAL_ERROR_DATA_STORE_FAILED(2),
-
- /**
- * Internal error (e.g. unexpected exception indicating bug or build problem)
- */
- RESULT_FATAL_ERROR_INTERNAL(3),
-
- // non-fatal errors
-
- /**
- * Network ID not valid
- */
- RESULT_ERROR_NETWORK_NOT_FOUND(1000);
-
- private final int id;
- ResultCode(int id) { this.id = id; }
- public int getValue() { return id; }
-
- public boolean isFatal(int id) {
- return (id > 0 && id < 1000);
- }
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/Version.java b/zerotierone/java/src/com/zerotier/sdk/Version.java
deleted file mode 100644
index c93c259..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/Version.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-public final class Version {
- private Version() {}
-
- public int major = 0;
- public int minor = 0;
- public int revision = 0;
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfig.java b/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfig.java
deleted file mode 100644
index 64512da..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfig.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-import java.lang.Comparable;
-import java.lang.Override;
-import java.lang.String;
-import java.util.ArrayList;
-import java.net.InetSocketAddress;
-
-public final class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
- public static final int MAX_MULTICAST_SUBSCRIPTIONS = 4096;
- public static final int ZT_MAX_ZT_ASSIGNED_ADDRESSES = 16;
-
- private long nwid;
- private long mac;
- private String name;
- private VirtualNetworkStatus status;
- private VirtualNetworkType type;
- private int mtu;
- private boolean dhcp;
- private boolean bridge;
- private boolean broadcastEnabled;
- private int portError;
- private boolean enabled;
- private long netconfRevision;
- private InetSocketAddress[] assignedAddresses;
- private VirtualNetworkRoute[] routes;
-
- private VirtualNetworkConfig() {
-
- }
-
- public boolean equals(VirtualNetworkConfig cfg) {
- boolean aaEqual = true;
- if(assignedAddresses.length == cfg.assignedAddresses.length) {
- for(int i = 0; i < assignedAddresses.length; ++i) {
- if(!assignedAddresses[i].equals(cfg.assignedAddresses[i])) {
- aaEqual = false;
- }
- }
- } else {
- aaEqual = false;
- }
-
- boolean routesEqual = true;
- if(routes.length == cfg.routes.length) {
- for (int i = 0; i < routes.length; ++i) {
- if (!routes[i].equals(cfg.routes[i])) {
- routesEqual = false;
- }
- }
- } else {
- routesEqual = false;
- }
-
- return nwid == cfg.nwid &&
- mac == cfg.mac &&
- name.equals(cfg.name) &&
- status.equals(cfg.status) &&
- type.equals(cfg.type) &&
- mtu == cfg.mtu &&
- dhcp == cfg.dhcp &&
- bridge == cfg.bridge &&
- broadcastEnabled == cfg.broadcastEnabled &&
- portError == cfg.portError &&
- enabled == cfg.enabled &&
- aaEqual && routesEqual;
- }
-
- public int compareTo(VirtualNetworkConfig cfg) {
- if(cfg.nwid == this.nwid) {
- return 0;
- } else {
- return this.nwid > cfg.nwid ? 1 : -1;
- }
- }
-
- /**
- * 64-bit ZeroTier network ID
- */
- public final long networkId() {
- return nwid;
- }
-
- /**
- * Ethernet MAC (40 bits) that should be assigned to port
- */
- public final long macAddress() {
- return mac;
- }
-
- /**
- * Network name (from network configuration master)
- */
- public final String name() {
- return name;
- }
-
- /**
- * Network configuration request status
- */
- public final VirtualNetworkStatus networkStatus() {
- return status;
- }
-
- /**
- * Network type
- */
- public final VirtualNetworkType networkType() {
- return type;
- }
-
- /**
- * Maximum interface MTU
- */
- public final int mtu() {
- return mtu;
- }
-
- /**
- * If the network this port belongs to indicates DHCP availability
- *
- * <p>This is a suggestion. The underlying implementation is free to ignore it
- * for security or other reasons. This is simply a netconf parameter that
- * means 'DHCP is available on this network.'</p>
- */
- public final boolean isDhcpAvailable() {
- return dhcp;
- }
-
- /**
- * If this port is allowed to bridge to other networks
- *
- * <p>This is informational. If this is false, bridged packets will simply
- * be dropped and bridging won't work.</p>
- */
- public final boolean isBridgeEnabled() {
- return bridge;
- }
-
- /**
- * If true, this network supports and allows broadcast (ff:ff:ff:ff:ff:ff) traffic
- */
- public final boolean broadcastEnabled() {
- return broadcastEnabled;
- }
-
- /**
- * If the network is in PORT_ERROR state, this is the error most recently returned by the port config callback
- */
- public final int portError() {
- return portError;
- }
-
- /**
- * Network config revision as reported by netconf master
- *
- * <p>If this is zero, it means we're still waiting for our netconf.</p>
- */
- public final long netconfRevision() {
- return netconfRevision;
- }
-
- /**
- * ZeroTier-assigned addresses (in {@link java.net.InetSocketAddress} objects)
- *
- * For IP, the port number of the sockaddr_XX structure contains the number
- * of bits in the address netmask. Only the IP address and port are used.
- * Other fields like interface number can be ignored.
- *
- * This is only used for ZeroTier-managed address assignments sent by the
- * virtual network's configuration master.
- */
- public final InetSocketAddress[] assignedAddresses() {
- return assignedAddresses;
- }
-
- /**
- * ZeroTier-assigned routes (in {@link com.zerotier.sdk.VirtualNetworkRoute} objects)
- *
- * @return
- */
- public final VirtualNetworkRoute[] routes() { return routes; }
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigListener.java b/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigListener.java
deleted file mode 100644
index 15ae301..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-
-package com.zerotier.sdk;
-
-
-public interface VirtualNetworkConfigListener {
- /**
- * Callback called to update virtual network port configuration
- *
- * <p>This can be called at any time to update the configuration of a virtual
- * network port. The parameter after the network ID specifies whether this
- * port is being brought up, updated, brought down, or permanently deleted.
- *
- * This in turn should be used by the underlying implementation to create
- * and configure tap devices at the OS (or virtual network stack) layer.</P>
- *
- * This should not call {@link Node#multicastSubscribe} or other network-modifying
- * methods, as this could cause a deadlock in multithreaded or interrupt
- * driven environments.
- *
- * This must return 0 on success. It can return any OS-dependent error code
- * on failure, and this results in the network being placed into the
- * PORT_ERROR state.
- *
- * @param nwid network id
- * @param op {@link VirtualNetworkConfigOperation} enum describing the configuration operation
- * @param config {@link VirtualNetworkConfig} object with the new configuration
- * @return 0 on success
- */
- public int onNetworkConfigurationUpdated(
- long nwid,
- VirtualNetworkConfigOperation op,
- VirtualNetworkConfig config);
-} \ No newline at end of file
diff --git a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigOperation.java b/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigOperation.java
deleted file mode 100644
index b70eb47..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkConfigOperation.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-package com.zerotier.sdk;
-
-public enum VirtualNetworkConfigOperation {
- /**
- * Network is coming up (either for the first time or after service restart)
- */
- VIRTUAL_NETWORK_CONFIG_OPERATION_UP,
-
- /**
- * Network configuration has been updated
- */
- VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE,
-
- /**
- * Network is going down (not permanently)
- */
- VIRTUAL_NETWORK_CONFIG_OPERATION_DOWN,
-
- /**
- * Network is going down permanently (leave/delete)
- */
- VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java b/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java
deleted file mode 100644
index 9ad3228..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-public interface VirtualNetworkFrameListener {
- /**
- * Function to send a frame out to a virtual network port
- *
- * @param nwid ZeroTier One network ID
- * @param srcMac source MAC address
- * @param destMac destination MAC address
- * @param ethertype
- * @param vlanId
- * @param frameData data to send
- */
- public void onVirtualNetworkFrame(
- long nwid,
- long srcMac,
- long destMac,
- long etherType,
- long vlanId,
- byte[] frameData);
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkRoute.java b/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkRoute.java
deleted file mode 100644
index b89dce7..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkRoute.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-package com.zerotier.sdk;
-
-import java.net.InetSocketAddress;
-
-public final class VirtualNetworkRoute implements Comparable<VirtualNetworkRoute>
-{
- private VirtualNetworkRoute() {
- target = null;
- via = null;
- flags = 0;
- metric = 0;
- }
-
- /**
- * Target network / netmask bits (in port field) or NULL or 0.0.0.0/0 for default
- */
- public InetSocketAddress target;
-
- /**
- * Gateway IP address (port ignored) or NULL (family == 0) for LAN-local (no gateway)
- */
- public InetSocketAddress via;
-
- /**
- * Route flags
- */
- public int flags;
-
- /**
- * Route metric (not currently used)
- */
- public int metric;
-
-
- @Override
- public int compareTo(VirtualNetworkRoute other) {
- return target.toString().compareTo(other.target.toString());
- }
-
- public boolean equals(VirtualNetworkRoute other) {
- boolean targetEquals;
- if (target == null && other.target == null) {
- targetEquals = true;
- }
- else if (target == null && other.target != null) {
- targetEquals = false;
- }
- else if (target != null && other.target == null) {
- targetEquals = false;
- }
- else {
- targetEquals = target.equals(other.target);
- }
-
-
- boolean viaEquals;
- if (via == null && other.via == null) {
- viaEquals = true;
- }
- else if (via == null && other.via != null) {
- viaEquals = false;
- }
- else if (via != null && other.via == null) {
- viaEquals = false;
- }
- else {
- viaEquals = via.equals(other.via);
- }
-
- return viaEquals &&
- viaEquals &&
- flags == other.flags &&
- metric == other.metric;
- }
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkStatus.java b/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkStatus.java
deleted file mode 100644
index 2d00561..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkStatus.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-package com.zerotier.sdk;
-
-public enum VirtualNetworkStatus {
- /**
- * Waiting for network configuration (also means revision == 0)
- */
- NETWORK_STATUS_REQUESTING_CONFIGURATION,
-
- /**
- * Configuration received and we are authorized
- */
- NETWORK_STATUS_OK,
-
- /**
- * Netconf master told us 'nope'
- */
- NETWORK_STATUS_ACCESS_DENIED,
-
- /**
- * Netconf master exists, but this virtual network does not
- */
- NETWORK_STATUS_NOT_FOUND,
-
- /**
- * Initialization of network failed or other internal error
- */
- NETWORK_STATUS_PORT_ERROR,
-
- /**
- * ZeroTier One version too old
- */
- NETWORK_STATUS_CLIENT_TOO_OLD
-}
diff --git a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkType.java b/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkType.java
deleted file mode 100644
index ab1f4e0..0000000
--- a/zerotierone/java/src/com/zerotier/sdk/VirtualNetworkType.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-package com.zerotier.sdk;
-
-public enum VirtualNetworkType {
- /**
- * Private networks are authorized via certificates of membership
- */
- NETWORK_TYPE_PRIVATE,
-
- /**
- * Public networks have no access control -- they'll always be AUTHORIZED
- */
- NETWORK_TYPE_PUBLIC
-}
diff --git a/zerotierone/service/ControlPlane.cpp b/zerotierone/service/ControlPlane.cpp
deleted file mode 100644
index e0be5f7..0000000
--- a/zerotierone/service/ControlPlane.cpp
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ControlPlane.hpp"
-#include "OneService.hpp"
-
-#include "../version.h"
-#include "../include/ZeroTierOne.h"
-
-#ifdef ZT_USE_SYSTEM_HTTP_PARSER
-#include <http_parser.h>
-#else
-#include "../ext/http-parser/http_parser.h"
-#endif
-
-#include "../ext/json/json.hpp"
-
-#include "../controller/EmbeddedNetworkController.hpp"
-
-#include "../node/InetAddress.hpp"
-#include "../node/Node.hpp"
-#include "../node/Utils.hpp"
-#include "../node/World.hpp"
-
-#include "../osdep/OSUtils.hpp"
-
-namespace ZeroTier {
-
-namespace {
-
-static void _networkToJson(nlohmann::json &nj,const ZT_VirtualNetworkConfig *nc,const std::string &portDeviceName,const OneService::NetworkSettings &localSettings)
-{
- char tmp[256];
-
- const char *nstatus = "",*ntype = "";
- switch(nc->status) {
- case ZT_NETWORK_STATUS_REQUESTING_CONFIGURATION: nstatus = "REQUESTING_CONFIGURATION"; break;
- case ZT_NETWORK_STATUS_OK: nstatus = "OK"; break;
- case ZT_NETWORK_STATUS_ACCESS_DENIED: nstatus = "ACCESS_DENIED"; break;
- case ZT_NETWORK_STATUS_NOT_FOUND: nstatus = "NOT_FOUND"; break;
- case ZT_NETWORK_STATUS_PORT_ERROR: nstatus = "PORT_ERROR"; break;
- case ZT_NETWORK_STATUS_CLIENT_TOO_OLD: nstatus = "CLIENT_TOO_OLD"; break;
- }
- switch(nc->type) {
- case ZT_NETWORK_TYPE_PRIVATE: ntype = "PRIVATE"; break;
- case ZT_NETWORK_TYPE_PUBLIC: ntype = "PUBLIC"; break;
- }
-
- Utils::snprintf(tmp,sizeof(tmp),"%.16llx",nc->nwid);
- nj["id"] = tmp;
- nj["nwid"] = tmp;
- Utils::snprintf(tmp,sizeof(tmp),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(unsigned int)((nc->mac >> 40) & 0xff),(unsigned int)((nc->mac >> 32) & 0xff),(unsigned int)((nc->mac >> 24) & 0xff),(unsigned int)((nc->mac >> 16) & 0xff),(unsigned int)((nc->mac >> 8) & 0xff),(unsigned int)(nc->mac & 0xff));
- nj["mac"] = tmp;
- nj["name"] = nc->name;
- nj["status"] = nstatus;
- nj["type"] = ntype;
- nj["mtu"] = nc->mtu;
- nj["dhcp"] = (bool)(nc->dhcp != 0);
- nj["bridge"] = (bool)(nc->bridge != 0);
- nj["broadcastEnabled"] = (bool)(nc->broadcastEnabled != 0);
- nj["portError"] = nc->portError;
- nj["netconfRevision"] = nc->netconfRevision;
- nj["portDeviceName"] = portDeviceName;
- nj["allowManaged"] = localSettings.allowManaged;
- nj["allowGlobal"] = localSettings.allowGlobal;
- nj["allowDefault"] = localSettings.allowDefault;
-
- nlohmann::json aa = nlohmann::json::array();
- for(unsigned int i=0;i<nc->assignedAddressCount;++i) {
- aa.push_back(reinterpret_cast<const InetAddress *>(&(nc->assignedAddresses[i]))->toString());
- }
- nj["assignedAddresses"] = aa;
-
- nlohmann::json ra = nlohmann::json::array();
- for(unsigned int i=0;i<nc->routeCount;++i) {
- nlohmann::json rj;
- rj["target"] = reinterpret_cast<const InetAddress *>(&(nc->routes[i].target))->toString();
- if (nc->routes[i].via.ss_family == nc->routes[i].target.ss_family)
- rj["via"] = reinterpret_cast<const InetAddress *>(&(nc->routes[i].via))->toIpString();
- else rj["via"] = nlohmann::json();
- rj["flags"] = (int)nc->routes[i].flags;
- rj["metric"] = (int)nc->routes[i].metric;
- ra.push_back(rj);
- }
- nj["routes"] = ra;
-}
-
-static void _peerToJson(nlohmann::json &pj,const ZT_Peer *peer)
-{
- char tmp[256];
-
- const char *prole = "";
- switch(peer->role) {
- case ZT_PEER_ROLE_LEAF: prole = "LEAF"; break;
- case ZT_PEER_ROLE_MOON: prole = "MOON"; break;
- case ZT_PEER_ROLE_PLANET: prole = "PLANET"; break;
- }
-
- Utils::snprintf(tmp,sizeof(tmp),"%.10llx",peer->address);
- pj["address"] = tmp;
- pj["versionMajor"] = peer->versionMajor;
- pj["versionMinor"] = peer->versionMinor;
- pj["versionRev"] = peer->versionRev;
- Utils::snprintf(tmp,sizeof(tmp),"%d.%d.%d",peer->versionMajor,peer->versionMinor,peer->versionRev);
- pj["version"] = tmp;
- pj["latency"] = peer->latency;
- pj["role"] = prole;
-
- nlohmann::json pa = nlohmann::json::array();
- for(unsigned int i=0;i<peer->pathCount;++i) {
- nlohmann::json j;
- j["address"] = reinterpret_cast<const InetAddress *>(&(peer->paths[i].address))->toString();
- j["lastSend"] = peer->paths[i].lastSend;
- j["lastReceive"] = peer->paths[i].lastReceive;
- j["trustedPathId"] = peer->paths[i].trustedPathId;
- j["linkQuality"] = (double)peer->paths[i].linkQuality / (double)ZT_PATH_LINK_QUALITY_MAX;
- j["active"] = (bool)(peer->paths[i].expired == 0);
- j["expired"] = (bool)(peer->paths[i].expired != 0);
- j["preferred"] = (bool)(peer->paths[i].preferred != 0);
- pa.push_back(j);
- }
- pj["paths"] = pa;
-}
-
-static void _moonToJson(nlohmann::json &mj,const World &world)
-{
- char tmp[64];
- Utils::snprintf(tmp,sizeof(tmp),"%.16llx",world.id());
- mj["id"] = tmp;
- mj["timestamp"] = world.timestamp();
- 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<World::Root>::const_iterator r(world.roots().begin());r!=world.roots().end();++r) {
- nlohmann::json rj;
- rj["identity"] = r->identity.toString(false);
- nlohmann::json eps = nlohmann::json::array();
- for(std::vector<InetAddress>::const_iterator a(r->stableEndpoints.begin());a!=r->stableEndpoints.end();++a)
- eps.push_back(a->toString());
- rj["stableEndpoints"] = eps;
- ra.push_back(rj);
- }
- mj["roots"] = ra;
- mj["waiting"] = false;
-}
-
-} // anonymous namespace
-
-ControlPlane::ControlPlane(OneService *svc,Node *n) :
- _svc(svc),
- _node(n),
- _controller((EmbeddedNetworkController *)0)
-{
-}
-
-unsigned int ControlPlane::handleRequest(
- const InetAddress &fromAddress,
- unsigned int httpMethod,
- const std::string &path,
- const std::map<std::string,std::string> &headers,
- const std::string &body,
- std::string &responseBody,
- std::string &responseContentType)
-{
- char tmp[256];
- unsigned int scode = 404;
- nlohmann::json res;
- std::vector<std::string> ps(OSUtils::split(path.c_str(),"/","",""));
- std::map<std::string,std::string> urlArgs;
-
- Mutex::Lock _l(_lock);
-
- /* Note: this is kind of restricted in what it'll take. It does not support
- * URL encoding, and /'s in URL args will screw it up. But the only URL args
- * it really uses in ?jsonp=funcionName, and otherwise it just takes simple
- * paths to simply-named resources. */
- if (ps.size() > 0) {
- std::size_t qpos = ps[ps.size() - 1].find('?');
- if (qpos != std::string::npos) {
- std::string args(ps[ps.size() - 1].substr(qpos + 1));
- ps[ps.size() - 1] = ps[ps.size() - 1].substr(0,qpos);
- std::vector<std::string> asplit(OSUtils::split(args.c_str(),"&","",""));
- for(std::vector<std::string>::iterator a(asplit.begin());a!=asplit.end();++a) {
- std::size_t eqpos = a->find('=');
- if (eqpos == std::string::npos)
- urlArgs[*a] = "";
- else urlArgs[a->substr(0,eqpos)] = a->substr(eqpos + 1);
- }
- }
- }
-
- bool isAuth = false;
- {
- std::map<std::string,std::string>::const_iterator ah(headers.find("x-zt1-auth"));
- if ((ah != headers.end())&&(_authTokens.count(ah->second) > 0)) {
- isAuth = true;
- } else {
- ah = urlArgs.find("auth");
- if ((ah != urlArgs.end())&&(_authTokens.count(ah->second) > 0))
- isAuth = true;
- }
- }
-
-#ifdef __SYNOLOGY__
- #include <stdlib.h>
- // Authenticate via Synology's built-in cgi script
- if (!isAuth) {
- /*
- fprintf(stderr, "path = %s\n", path.c_str());
- fprintf(stderr, "headers.size=%d\n", headers.size());
- std::map<std::string, std::string>::const_iterator it(headers.begin());
- while(it != headers.end()) {
- fprintf(stderr,"header[%s] = %s\n", (it->first).c_str(), (it->second).c_str());
- it++;
- }
- */
- // parse out url args
- int synotoken_pos = path.find("SynoToken");
- int argpos = path.find("?");
- if(synotoken_pos != std::string::npos && argpos != std::string::npos) {
- std::string cookie = path.substr(argpos+1, synotoken_pos-(argpos+1));
- std::string synotoken = path.substr(synotoken_pos);
- std::string cookie_val = cookie.substr(cookie.find("=")+1);
- std::string synotoken_val = synotoken.substr(synotoken.find("=")+1);
- // Set necessary env for auth script
- std::map<std::string,std::string>::const_iterator ah2(headers.find("x-forwarded-for"));
- setenv("HTTP_COOKIE", cookie_val.c_str(), true);
- setenv("HTTP_X_SYNO_TOKEN", synotoken_val.c_str(), true);
- setenv("REMOTE_ADDR", ah2->second.c_str(),true);
- //fprintf(stderr, "HTTP_COOKIE: %s\n",std::getenv ("HTTP_COOKIE"));
- //fprintf(stderr, "HTTP_X_SYNO_TOKEN: %s\n",std::getenv ("HTTP_X_SYNO_TOKEN"));
- //fprintf(stderr, "REMOTE_ADDR: %s\n",std::getenv ("REMOTE_ADDR"));
- // check synology web auth
- char user[256], buf[1024];
- FILE *fp = NULL;
- bzero(user, 256);
- fp = popen("/usr/syno/synoman/webman/modules/authenticate.cgi", "r");
- if(!fp)
- isAuth = false;
- else {
- bzero(buf, sizeof(buf));
- fread(buf, 1024, 1, fp);
- if(strlen(buf) > 0) {
- snprintf(user, 256, "%s", buf);
- isAuth = true;
- }
- }
- pclose(fp);
- }
- }
-#endif
-
- if (httpMethod == HTTP_GET) {
- if (isAuth) {
- if (ps[0] == "status") {
- ZT_NodeStatus status;
- _node->status(&status);
-
- Utils::snprintf(tmp,sizeof(tmp),"%.10llx",status.address);
- res["address"] = tmp;
- res["publicIdentity"] = status.publicIdentity;
- res["online"] = (bool)(status.online != 0);
- res["tcpFallbackActive"] = _svc->tcpFallbackActive();
- res["versionMajor"] = ZEROTIER_ONE_VERSION_MAJOR;
- res["versionMinor"] = ZEROTIER_ONE_VERSION_MINOR;
- res["versionRev"] = ZEROTIER_ONE_VERSION_REVISION;
- res["versionBuild"] = ZEROTIER_ONE_VERSION_BUILD;
- Utils::snprintf(tmp,sizeof(tmp),"%d.%d.%d",ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION);
- res["version"] = tmp;
- res["clock"] = OSUtils::now();
-
- World planet(_node->planet());
- res["planetWorldId"] = planet.id();
- res["planetWorldTimestamp"] = planet.timestamp();
-
-#ifdef ZT_ENABLE_CLUSTER
- nlohmann::json cj;
- ZT_ClusterStatus cs;
- _node->clusterStatus(&cs);
- if (cs.clusterSize >= 1) {
- nlohmann::json cja = nlohmann::json::array();
- for(unsigned int i=0;i<cs.clusterSize;++i) {
- nlohmann::json cjm;
- cjm["id"] = (int)cs.members[i].id;
- cjm["msSinceLastHeartbeat"] = cs.members[i].msSinceLastHeartbeat;
- cjm["alive"] = (bool)(cs.members[i].alive != 0);
- cjm["x"] = cs.members[i].x;
- cjm["y"] = cs.members[i].y;
- cjm["z"] = cs.members[i].z;
- cjm["load"] = cs.members[i].load;
- cjm["peers"] = cs.members[i].peers;
- cja.push_back(cjm);
- }
- cj["members"] = cja;
- cj["myId"] = (int)cs.myId;
- cj["clusterSize"] = cs.clusterSize;
- }
- res["cluster"] = cj;
-#else
- res["cluster"] = nlohmann::json();
-#endif
-
- scode = 200;
- } else if (ps[0] == "moon") {
- std::vector<World> moons(_node->moons());
- if (ps.size() == 1) {
- // Return [array] of all moons
-
- res = nlohmann::json::array();
- for(std::vector<World>::const_iterator m(moons.begin());m!=moons.end();++m) {
- nlohmann::json mj;
- _moonToJson(mj,*m);
- res.push_back(mj);
- }
-
- scode = 200;
- } else {
- // Return a single moon by ID
-
- const uint64_t id = Utils::hexStrToU64(ps[1].c_str());
- for(std::vector<World>::const_iterator m(moons.begin());m!=moons.end();++m) {
- if (m->id() == id) {
- _moonToJson(res,*m);
- scode = 200;
- break;
- }
- }
-
- }
- } else if (ps[0] == "network") {
- ZT_VirtualNetworkList *nws = _node->networks();
- if (nws) {
- if (ps.size() == 1) {
- // Return [array] of all networks
-
- res = nlohmann::json::array();
- for(unsigned long i=0;i<nws->networkCount;++i) {
- OneService::NetworkSettings localSettings;
- _svc->getNetworkSettings(nws->networks[i].nwid,localSettings);
- nlohmann::json nj;
- _networkToJson(nj,&(nws->networks[i]),_svc->portDeviceName(nws->networks[i].nwid),localSettings);
- res.push_back(nj);
- }
-
- scode = 200;
- } else if (ps.size() == 2) {
- // Return a single network by ID or 404 if not found
-
- const uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str());
- for(unsigned long i=0;i<nws->networkCount;++i) {
- if (nws->networks[i].nwid == wantnw) {
- OneService::NetworkSettings localSettings;
- _svc->getNetworkSettings(nws->networks[i].nwid,localSettings);
- _networkToJson(res,&(nws->networks[i]),_svc->portDeviceName(nws->networks[i].nwid),localSettings);
- scode = 200;
- break;
- }
- }
-
- } else scode = 404;
- _node->freeQueryResult((void *)nws);
- } else scode = 500;
- } else if (ps[0] == "peer") {
- ZT_PeerList *pl = _node->peers();
- if (pl) {
- if (ps.size() == 1) {
- // Return [array] of all peers
-
- res = nlohmann::json::array();
- for(unsigned long i=0;i<pl->peerCount;++i) {
- nlohmann::json pj;
- _peerToJson(pj,&(pl->peers[i]));
- res.push_back(pj);
- }
-
- scode = 200;
- } else if (ps.size() == 2) {
- // Return a single peer by ID or 404 if not found
-
- uint64_t wantp = Utils::hexStrToU64(ps[1].c_str());
- for(unsigned long i=0;i<pl->peerCount;++i) {
- if (pl->peers[i].address == wantp) {
- _peerToJson(res,&(pl->peers[i]));
- scode = 200;
- break;
- }
- }
-
- } else scode = 404;
- _node->freeQueryResult((void *)pl);
- } else scode = 500;
- } else {
- if (_controller) {
- scode = _controller->handleControlPlaneHttpGET(std::vector<std::string>(ps.begin()+1,ps.end()),urlArgs,headers,body,responseBody,responseContentType);
- } else scode = 404;
- }
-
- } else scode = 401; // isAuth == false
- } else if ((httpMethod == HTTP_POST)||(httpMethod == HTTP_PUT)) {
- if (isAuth) {
-
- if (ps[0] == "moon") {
- if (ps.size() == 2) {
-
- uint64_t seed = 0;
- try {
- nlohmann::json j(OSUtils::jsonParse(body));
- if (j.is_object()) {
- seed = Utils::hexStrToU64(OSUtils::jsonString(j["seed"],"0").c_str());
- }
- } catch ( ... ) {
- // discard invalid JSON
- }
-
- std::vector<World> moons(_node->moons());
- const uint64_t id = Utils::hexStrToU64(ps[1].c_str());
- for(std::vector<World>::const_iterator m(moons.begin());m!=moons.end();++m) {
- if (m->id() == id) {
- _moonToJson(res,*m);
- scode = 200;
- break;
- }
- }
-
- if ((scode != 200)&&(seed != 0)) {
- char tmp[64];
- Utils::snprintf(tmp,sizeof(tmp),"%.16llx",id);
- res["id"] = tmp;
- res["roots"] = nlohmann::json::array();
- res["timestamp"] = 0;
- res["signature"] = nlohmann::json();
- res["updatesMustBeSignedBy"] = nlohmann::json();
- res["waiting"] = true;
- _node->orbit(id,seed);
- }
-
- } else scode = 404;
- } else if (ps[0] == "network") {
- if (ps.size() == 2) {
-
- uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str());
- _node->join(wantnw,(void *)0); // does nothing if we are a member
- ZT_VirtualNetworkList *nws = _node->networks();
- if (nws) {
- for(unsigned long i=0;i<nws->networkCount;++i) {
- if (nws->networks[i].nwid == wantnw) {
- OneService::NetworkSettings localSettings;
- _svc->getNetworkSettings(nws->networks[i].nwid,localSettings);
-
- try {
- nlohmann::json j(OSUtils::jsonParse(body));
- if (j.is_object()) {
- nlohmann::json &allowManaged = j["allowManaged"];
- if (allowManaged.is_boolean()) localSettings.allowManaged = (bool)allowManaged;
- nlohmann::json &allowGlobal = j["allowGlobal"];
- if (allowGlobal.is_boolean()) localSettings.allowGlobal = (bool)allowGlobal;
- nlohmann::json &allowDefault = j["allowDefault"];
- if (allowDefault.is_boolean()) localSettings.allowDefault = (bool)allowDefault;
- }
- } catch ( ... ) {
- // discard invalid JSON
- }
-
- _svc->setNetworkSettings(nws->networks[i].nwid,localSettings);
- _networkToJson(res,&(nws->networks[i]),_svc->portDeviceName(nws->networks[i].nwid),localSettings);
-
- scode = 200;
- break;
- }
- }
- _node->freeQueryResult((void *)nws);
- } else scode = 500;
-
- } else scode = 404;
- } else {
- if (_controller)
- scode = _controller->handleControlPlaneHttpPOST(std::vector<std::string>(ps.begin()+1,ps.end()),urlArgs,headers,body,responseBody,responseContentType);
- else scode = 404;
- }
-
- } else scode = 401; // isAuth == false
- } else if (httpMethod == HTTP_DELETE) {
- if (isAuth) {
-
- if (ps[0] == "moon") {
- if (ps.size() == 2) {
- _node->deorbit(Utils::hexStrToU64(ps[1].c_str()));
- res["result"] = true;
- scode = 200;
- } // else 404
- } else if (ps[0] == "network") {
- ZT_VirtualNetworkList *nws = _node->networks();
- if (nws) {
- if (ps.size() == 2) {
- uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str());
- for(unsigned long i=0;i<nws->networkCount;++i) {
- if (nws->networks[i].nwid == wantnw) {
- _node->leave(wantnw,(void **)0);
- res["result"] = true;
- scode = 200;
- break;
- }
- }
- } // else 404
- _node->freeQueryResult((void *)nws);
- } else scode = 500;
- } else {
- if (_controller)
- scode = _controller->handleControlPlaneHttpDELETE(std::vector<std::string>(ps.begin()+1,ps.end()),urlArgs,headers,body,responseBody,responseContentType);
- else scode = 404;
- }
-
- } else scode = 401; // isAuth = false
- } else {
- scode = 400;
- }
-
- if (responseBody.length() == 0) {
- if ((res.is_object())||(res.is_array()))
- responseBody = OSUtils::jsonDump(res);
- else responseBody = "{}";
- responseContentType = "application/json";
- }
-
- // Wrap result in jsonp function call if the user included a jsonp= url argument.
- // Also double-check isAuth since forbidding this without auth feels safer.
- std::map<std::string,std::string>::const_iterator jsonp(urlArgs.find("jsonp"));
- if ((isAuth)&&(jsonp != urlArgs.end())&&(responseContentType == "application/json")) {
- if (responseBody.length() > 0)
- responseBody = jsonp->second + "(" + responseBody + ");";
- else responseBody = jsonp->second + "(null);";
- responseContentType = "application/javascript";
- }
-
- return scode;
-}
-
-} // namespace ZeroTier
diff --git a/zerotierone/service/ControlPlane.hpp b/zerotierone/service/ControlPlane.hpp
deleted file mode 100644
index a1f743c..0000000
--- a/zerotierone/service/ControlPlane.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef ZT_ONE_CONTROLPLANE_HPP
-#define ZT_ONE_CONTROLPLANE_HPP
-
-#include <string>
-#include <map>
-#include <set>
-
-#include "../include/ZeroTierOne.h"
-
-#include "../node/Mutex.hpp"
-
-namespace ZeroTier {
-
-class OneService;
-class Node;
-class EmbeddedNetworkController;
-struct InetAddress;
-
-/**
- * HTTP control plane and static web server
- */
-class ControlPlane
-{
-public:
- ControlPlane(OneService *svc,Node *n);
-
- /**
- * Set controller, which will be available under /controller
- *
- * @param c Network controller instance
- */
- inline void setController(EmbeddedNetworkController *c)
- {
- Mutex::Lock _l(_lock);
- _controller = c;
- }
-
- /**
- * Add an authentication token for API access
- */
- inline void addAuthToken(const char *tok)
- {
- Mutex::Lock _l(_lock);
- _authTokens.insert(std::string(tok));
- }
-
- /**
- * Handle HTTP request
- *
- * @param fromAddress Originating IP address of request
- * @param httpMethod HTTP method (as defined in ext/http-parser/http_parser.h)
- * @param path Request path
- * @param headers Request headers
- * @param body Request body
- * @param responseBody Result parameter: fill with response data
- * @param responseContentType Result parameter: fill with content type
- * @return HTTP response code
- */
- unsigned int handleRequest(
- const InetAddress &fromAddress,
- unsigned int httpMethod,
- const std::string &path,
- const std::map<std::string,std::string> &headers,
- const std::string &body,
- std::string &responseBody,
- std::string &responseContentType);
-
-private:
- OneService *const _svc;
- Node *const _node;
- EmbeddedNetworkController *_controller;
- std::set<std::string> _authTokens;
- Mutex _lock;
-};
-
-} // namespace ZeroTier
-
-#endif
diff --git a/zerotierone/windows/ZeroTierOne/ServiceBase.cpp b/zerotierone/windows/ZeroTierOne/ServiceBase.cpp
deleted file mode 100644
index 59d384c..0000000
--- a/zerotierone/windows/ZeroTierOne/ServiceBase.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-/****************************** Module Header ******************************\
-* Module Name: ServiceBase.cpp
-* Project: CppWindowsService
-* Copyright (c) Microsoft Corporation.
-*
-* Provides a base class for a service that will exist as part of a service
-* application. CServiceBase must be derived from when creating a new service
-* class.
-*
-* This source is subject to the Microsoft Public License.
-* See http://www.microsoft.com/en-us/openness/resources/licenses.aspx#MPL.
-* All other rights reserved.
-*
-* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
-* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
-\***************************************************************************/
-
-#pragma region Includes
-#include "ServiceBase.h"
-#include <assert.h>
-#include <strsafe.h>
-#include <string>
-#pragma endregion
-
-
-#pragma region Static Members
-
-// Initialize the singleton service instance.
-CServiceBase *CServiceBase::s_service = NULL;
-
-
-//
-// FUNCTION: CServiceBase::Run(CServiceBase &)
-//
-// PURPOSE: Register the executable for a service with the Service Control
-// Manager (SCM). After you call Run(ServiceBase), the SCM issues a Start
-// command, which results in a call to the OnStart method in the service.
-// This method blocks until the service has stopped.
-//
-// PARAMETERS:
-// * service - the reference to a CServiceBase object. It will become the
-// singleton service instance of this service application.
-//
-// RETURN VALUE: If the function succeeds, the return value is TRUE. If the
-// function fails, the return value is FALSE. To get extended error
-// information, call GetLastError.
-//
-BOOL CServiceBase::Run(CServiceBase &service)
-{
- s_service = &service;
-
- SERVICE_TABLE_ENTRYA serviceTable[] =
- {
- { service.m_name, ServiceMain },
- { NULL, NULL }
- };
-
- // Connects the main thread of a service process to the service control
- // manager, which causes the thread to be the service control dispatcher
- // thread for the calling process. This call returns when the service has
- // stopped. The process should simply terminate when the call returns.
- return StartServiceCtrlDispatcher(serviceTable);
-}
-
-
-//
-// FUNCTION: CServiceBase::ServiceMain(DWORD, PWSTR *)
-//
-// PURPOSE: Entry point for the service. It registers the handler function
-// for the service and starts the service.
-//
-// PARAMETERS:
-// * dwArgc - number of command line arguments
-// * lpszArgv - array of command line arguments
-//
-void WINAPI CServiceBase::ServiceMain(DWORD dwArgc, PSTR *pszArgv)
-{
- assert(s_service != NULL);
-
- // Register the handler function for the service
- s_service->m_statusHandle = RegisterServiceCtrlHandler(
- s_service->m_name, ServiceCtrlHandler);
- if (s_service->m_statusHandle == NULL)
- {
- throw GetLastError();
- }
-
- // Start the service.
- s_service->Start(dwArgc, pszArgv);
-}
-
-
-//
-// FUNCTION: CServiceBase::ServiceCtrlHandler(DWORD)
-//
-// PURPOSE: The function is called by the SCM whenever a control code is
-// sent to the service.
-//
-// PARAMETERS:
-// * dwCtrlCode - the control code. This parameter can be one of the
-// following values:
-//
-// SERVICE_CONTROL_CONTINUE
-// SERVICE_CONTROL_INTERROGATE
-// SERVICE_CONTROL_NETBINDADD
-// SERVICE_CONTROL_NETBINDDISABLE
-// SERVICE_CONTROL_NETBINDREMOVE
-// SERVICE_CONTROL_PARAMCHANGE
-// SERVICE_CONTROL_PAUSE
-// SERVICE_CONTROL_SHUTDOWN
-// SERVICE_CONTROL_STOP
-//
-// This parameter can also be a user-defined control code ranges from 128
-// to 255.
-//
-void WINAPI CServiceBase::ServiceCtrlHandler(DWORD dwCtrl)
-{
- switch (dwCtrl)
- {
- case SERVICE_CONTROL_STOP: s_service->Stop(); break;
- case SERVICE_CONTROL_PAUSE: s_service->Pause(); break;
- case SERVICE_CONTROL_CONTINUE: s_service->Continue(); break;
- case SERVICE_CONTROL_SHUTDOWN: s_service->Shutdown(); break;
- case SERVICE_CONTROL_INTERROGATE: break;
- default: break;
- }
-}
-
-#pragma endregion
-
-
-#pragma region Service Constructor and Destructor
-
-//
-// FUNCTION: CServiceBase::CServiceBase(PWSTR, BOOL, BOOL, BOOL)
-//
-// PURPOSE: The constructor of CServiceBase. It initializes a new instance
-// of the CServiceBase class. The optional parameters (fCanStop,
-/// fCanShutdown and fCanPauseContinue) allow you to specify whether the
-// service can be stopped, paused and continued, or be notified when system
-// shutdown occurs.
-//
-// PARAMETERS:
-// * pszServiceName - the name of the service
-// * fCanStop - the service can be stopped
-// * fCanShutdown - the service is notified when system shutdown occurs
-// * fCanPauseContinue - the service can be paused and continued
-//
-CServiceBase::CServiceBase(PSTR pszServiceName,
- BOOL fCanStop,
- BOOL fCanShutdown,
- BOOL fCanPauseContinue)
-{
- // Service name must be a valid string and cannot be NULL.
- m_name = (pszServiceName == NULL) ? "" : pszServiceName;
-
- m_statusHandle = NULL;
-
- // The service runs in its own process.
- m_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
-
- // The service is starting.
- m_status.dwCurrentState = SERVICE_START_PENDING;
-
- // The accepted commands of the service.
- DWORD dwControlsAccepted = 0;
- if (fCanStop)
- dwControlsAccepted |= SERVICE_ACCEPT_STOP;
- if (fCanShutdown)
- dwControlsAccepted |= SERVICE_ACCEPT_SHUTDOWN;
- if (fCanPauseContinue)
- dwControlsAccepted |= SERVICE_ACCEPT_PAUSE_CONTINUE;
- m_status.dwControlsAccepted = dwControlsAccepted;
-
- m_status.dwWin32ExitCode = NO_ERROR;
- m_status.dwServiceSpecificExitCode = 0;
- m_status.dwCheckPoint = 0;
- m_status.dwWaitHint = 0;
-}
-
-
-//
-// FUNCTION: CServiceBase::~CServiceBase()
-//
-// PURPOSE: The virtual destructor of CServiceBase.
-//
-CServiceBase::~CServiceBase(void)
-{
-}
-
-#pragma endregion
-
-
-#pragma region Service Start, Stop, Pause, Continue, and Shutdown
-
-//
-// FUNCTION: CServiceBase::Start(DWORD, PWSTR *)
-//
-// PURPOSE: The function starts the service. It calls the OnStart virtual
-// function in which you can specify the actions to take when the service
-// starts. If an error occurs during the startup, the error will be logged
-// in the Application event log, and the service will be stopped.
-//
-// PARAMETERS:
-// * dwArgc - number of command line arguments
-// * lpszArgv - array of command line arguments
-//
-void CServiceBase::Start(DWORD dwArgc, PSTR *pszArgv)
-{
- try
- {
- // Tell SCM that the service is starting.
- SetServiceStatus(SERVICE_START_PENDING);
-
- // Perform service-specific initialization.
- OnStart(dwArgc, pszArgv);
-
- // Tell SCM that the service is started.
- SetServiceStatus(SERVICE_RUNNING);
- }
- catch (DWORD dwError)
- {
- // Log the error.
- WriteErrorLogEntry("Service Start", dwError);
-
- // Set the service status to be stopped.
- SetServiceStatus(SERVICE_STOPPED, dwError);
- }
- catch (...)
- {
- // Log the error.
- WriteEventLogEntry("Service failed to start.", EVENTLOG_ERROR_TYPE);
-
- // Set the service status to be stopped.
- SetServiceStatus(SERVICE_STOPPED);
- }
-}
-
-
-//
-// FUNCTION: CServiceBase::OnStart(DWORD, PWSTR *)
-//
-// PURPOSE: When implemented in a derived class, executes when a Start
-// command is sent to the service by the SCM or when the operating system
-// starts (for a service that starts automatically). Specifies actions to
-// take when the service starts. Be sure to periodically call
-// CServiceBase::SetServiceStatus() with SERVICE_START_PENDING if the
-// procedure is going to take long time. You may also consider spawning a
-// new thread in OnStart to perform time-consuming initialization tasks.
-//
-// PARAMETERS:
-// * dwArgc - number of command line arguments
-// * lpszArgv - array of command line arguments
-//
-void CServiceBase::OnStart(DWORD dwArgc, PSTR *pszArgv)
-{
-}
-
-
-//
-// FUNCTION: CServiceBase::Stop()
-//
-// PURPOSE: The function stops the service. It calls the OnStop virtual
-// function in which you can specify the actions to take when the service
-// stops. If an error occurs, the error will be logged in the Application
-// event log, and the service will be restored to the original state.
-//
-void CServiceBase::Stop()
-{
- DWORD dwOriginalState = m_status.dwCurrentState;
- try
- {
- // Tell SCM that the service is stopping.
- SetServiceStatus(SERVICE_STOP_PENDING);
-
- // Perform service-specific stop operations.
- OnStop();
-
- // Tell SCM that the service is stopped.
- SetServiceStatus(SERVICE_STOPPED);
- }
- catch (DWORD dwError)
- {
- // Log the error.
- WriteErrorLogEntry("Service Stop", dwError);
-
- // Set the orginal service status.
- SetServiceStatus(dwOriginalState);
- }
- catch (...)
- {
- // Log the error.
- WriteEventLogEntry("Service failed to stop.", EVENTLOG_ERROR_TYPE);
-
- // Set the orginal service status.
- SetServiceStatus(dwOriginalState);
- }
-}
-
-
-//
-// FUNCTION: CServiceBase::OnStop()
-//
-// PURPOSE: When implemented in a derived class, executes when a Stop
-// command is sent to the service by the SCM. Specifies actions to take
-// when a service stops running. Be sure to periodically call
-// CServiceBase::SetServiceStatus() with SERVICE_STOP_PENDING if the
-// procedure is going to take long time.
-//
-void CServiceBase::OnStop()
-{
-}
-
-
-//
-// FUNCTION: CServiceBase::Pause()
-//
-// PURPOSE: The function pauses the service if the service supports pause
-// and continue. It calls the OnPause virtual function in which you can
-// specify the actions to take when the service pauses. If an error occurs,
-// the error will be logged in the Application event log, and the service
-// will become running.
-//
-void CServiceBase::Pause()
-{
- try
- {
- // Tell SCM that the service is pausing.
- SetServiceStatus(SERVICE_PAUSE_PENDING);
-
- // Perform service-specific pause operations.
- OnPause();
-
- // Tell SCM that the service is paused.
- SetServiceStatus(SERVICE_PAUSED);
- }
- catch (DWORD dwError)
- {
- // Log the error.
- WriteErrorLogEntry("Service Pause", dwError);
-
- // Tell SCM that the service is still running.
- SetServiceStatus(SERVICE_RUNNING);
- }
- catch (...)
- {
- // Log the error.
- WriteEventLogEntry("Service failed to pause.", EVENTLOG_ERROR_TYPE);
-
- // Tell SCM that the service is still running.
- SetServiceStatus(SERVICE_RUNNING);
- }
-}
-
-
-//
-// FUNCTION: CServiceBase::OnPause()
-//
-// PURPOSE: When implemented in a derived class, executes when a Pause
-// command is sent to the service by the SCM. Specifies actions to take
-// when a service pauses.
-//
-void CServiceBase::OnPause()
-{
-}
-
-
-//
-// FUNCTION: CServiceBase::Continue()
-//
-// PURPOSE: The function resumes normal functioning after being paused if
-// the service supports pause and continue. It calls the OnContinue virtual
-// function in which you can specify the actions to take when the service
-// continues. If an error occurs, the error will be logged in the
-// Application event log, and the service will still be paused.
-//
-void CServiceBase::Continue()
-{
- try
- {
- // Tell SCM that the service is resuming.
- SetServiceStatus(SERVICE_CONTINUE_PENDING);
-
- // Perform service-specific continue operations.
- OnContinue();
-
- // Tell SCM that the service is running.
- SetServiceStatus(SERVICE_RUNNING);
- }
- catch (DWORD dwError)
- {
- // Log the error.
- WriteErrorLogEntry("Service Continue", dwError);
-
- // Tell SCM that the service is still paused.
- SetServiceStatus(SERVICE_PAUSED);
- }
- catch (...)
- {
- // Log the error.
- WriteEventLogEntry("Service failed to resume.", EVENTLOG_ERROR_TYPE);
-
- // Tell SCM that the service is still paused.
- SetServiceStatus(SERVICE_PAUSED);
- }
-}
-
-
-//
-// FUNCTION: CServiceBase::OnContinue()
-//
-// PURPOSE: When implemented in a derived class, OnContinue runs when a
-// Continue command is sent to the service by the SCM. Specifies actions to
-// take when a service resumes normal functioning after being paused.
-//
-void CServiceBase::OnContinue()
-{
-}
-
-
-//
-// FUNCTION: CServiceBase::Shutdown()
-//
-// PURPOSE: The function executes when the system is shutting down. It
-// calls the OnShutdown virtual function in which you can specify what
-// should occur immediately prior to the system shutting down. If an error
-// occurs, the error will be logged in the Application event log.
-//
-void CServiceBase::Shutdown()
-{
- try
- {
- // Perform service-specific shutdown operations.
- OnShutdown();
-
- // Tell SCM that the service is stopped.
- SetServiceStatus(SERVICE_STOPPED);
- }
- catch (DWORD dwError)
- {
- // Log the error.
- WriteErrorLogEntry("Service Shutdown", dwError);
- }
- catch (...)
- {
- // Log the error.
- WriteEventLogEntry("Service failed to shut down.", EVENTLOG_ERROR_TYPE);
- }
-}
-
-
-//
-// FUNCTION: CServiceBase::OnShutdown()
-//
-// PURPOSE: When implemented in a derived class, executes when the system
-// is shutting down. Specifies what should occur immediately prior to the
-// system shutting down.
-//
-void CServiceBase::OnShutdown()
-{
-}
-
-#pragma endregion
-
-
-#pragma region Helper Functions
-
-//
-// FUNCTION: CServiceBase::SetServiceStatus(DWORD, DWORD, DWORD)
-//
-// PURPOSE: The function sets the service status and reports the status to
-// the SCM.
-//
-// PARAMETERS:
-// * dwCurrentState - the state of the service
-// * dwWin32ExitCode - error code to report
-// * dwWaitHint - estimated time for pending operation, in milliseconds
-//
-void CServiceBase::SetServiceStatus(DWORD dwCurrentState,
- DWORD dwWin32ExitCode,
- DWORD dwWaitHint)
-{
- static DWORD dwCheckPoint = 1;
-
- // Fill in the SERVICE_STATUS structure of the service.
-
- m_status.dwCurrentState = dwCurrentState;
- m_status.dwWin32ExitCode = dwWin32ExitCode;
- m_status.dwWaitHint = dwWaitHint;
-
- m_status.dwCheckPoint =
- ((dwCurrentState == SERVICE_RUNNING) ||
- (dwCurrentState == SERVICE_STOPPED)) ?
- 0 : dwCheckPoint++;
-
- // Report the status of the service to the SCM.
- ::SetServiceStatus(m_statusHandle, &m_status);
-}
-
-
-//
-// FUNCTION: CServiceBase::WriteEventLogEntry(PWSTR, WORD)
-//
-// PURPOSE: Log a message to the Application event log.
-//
-// PARAMETERS:
-// * pszMessage - string message to be logged.
-// * wType - the type of event to be logged. The parameter can be one of
-// the following values.
-//
-// EVENTLOG_SUCCESS
-// EVENTLOG_AUDIT_FAILURE
-// EVENTLOG_AUDIT_SUCCESS
-// EVENTLOG_ERROR_TYPE
-// EVENTLOG_INFORMATION_TYPE
-// EVENTLOG_WARNING_TYPE
-//
-void CServiceBase::WriteEventLogEntry(PSTR pszMessage, WORD wType)
-{
- HANDLE hEventSource = NULL;
- LPCSTR lpszStrings[2] = { NULL, NULL };
-
- hEventSource = RegisterEventSource(NULL, m_name);
- if (hEventSource)
- {
- lpszStrings[0] = m_name;
- lpszStrings[1] = pszMessage;
-
- ReportEvent(hEventSource, // Event log handle
- wType, // Event type
- 0, // Event category
- 0, // Event identifier
- NULL, // No security identifier
- 2, // Size of lpszStrings array
- 0, // No binary data
- lpszStrings, // Array of strings
- NULL // No binary data
- );
-
- DeregisterEventSource(hEventSource);
- }
-}
-
-
-//
-// FUNCTION: CServiceBase::WriteErrorLogEntry(PWSTR, DWORD)
-//
-// PURPOSE: Log an error message to the Application event log.
-//
-// PARAMETERS:
-// * pszFunction - the function that gives the error
-// * dwError - the error code
-//
-void CServiceBase::WriteErrorLogEntry(PSTR pszFunction, DWORD dwError)
-{
- char szMessage[260];
- StringCchPrintf(szMessage, ARRAYSIZE(szMessage),
- "%s failed w/err 0x%08lx", pszFunction, dwError);
- WriteEventLogEntry(szMessage, EVENTLOG_ERROR_TYPE);
-}
-
-#pragma endregion \ No newline at end of file
diff --git a/zerotierone/windows/ZeroTierOne/ServiceBase.h b/zerotierone/windows/ZeroTierOne/ServiceBase.h
deleted file mode 100644
index 6d62b1f..0000000
--- a/zerotierone/windows/ZeroTierOne/ServiceBase.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************** Module Header ******************************\
-* Module Name: ServiceBase.h
-* Project: CppWindowsService
-* Copyright (c) Microsoft Corporation.
-*
-* Provides a base class for a service that will exist as part of a service
-* application. CServiceBase must be derived from when creating a new service
-* class.
-*
-* This source is subject to the Microsoft Public License.
-* See http://www.microsoft.com/en-us/openness/resources/licenses.aspx#MPL.
-* All other rights reserved.
-*
-* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
-* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
-\***************************************************************************/
-
-#pragma once
-
-#include <WinSock2.h>
-#include <windows.h>
-
-class CServiceBase
-{
-public:
-
- // Register the executable for a service with the Service Control Manager
- // (SCM). After you call Run(ServiceBase), the SCM issues a Start command,
- // which results in a call to the OnStart method in the service. This
- // method blocks until the service has stopped.
- static BOOL Run(CServiceBase &service);
-
- // Service object constructor. The optional parameters (fCanStop,
- // fCanShutdown and fCanPauseContinue) allow you to specify whether the
- // service can be stopped, paused and continued, or be notified when
- // system shutdown occurs.
- CServiceBase(LPSTR pszServiceName,
- BOOL fCanStop = TRUE,
- BOOL fCanShutdown = TRUE,
- BOOL fCanPauseContinue = FALSE);
-
- // Service object destructor.
- virtual ~CServiceBase(void);
-
- // Stop the service.
- void Stop();
-
-protected:
-
- // When implemented in a derived class, executes when a Start command is
- // sent to the service by the SCM or when the operating system starts
- // (for a service that starts automatically). Specifies actions to take
- // when the service starts.
- virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
-
- // When implemented in a derived class, executes when a Stop command is
- // sent to the service by the SCM. Specifies actions to take when a
- // service stops running.
- virtual void OnStop();
-
- // When implemented in a derived class, executes when a Pause command is
- // sent to the service by the SCM. Specifies actions to take when a
- // service pauses.
- virtual void OnPause();
-
- // When implemented in a derived class, OnContinue runs when a Continue
- // command is sent to the service by the SCM. Specifies actions to take
- // when a service resumes normal functioning after being paused.
- virtual void OnContinue();
-
- // When implemented in a derived class, executes when the system is
- // shutting down. Specifies what should occur immediately prior to the
- // system shutting down.
- virtual void OnShutdown();
-
- // Set the service status and report the status to the SCM.
- void SetServiceStatus(DWORD dwCurrentState,
- DWORD dwWin32ExitCode = NO_ERROR,
- DWORD dwWaitHint = 0);
-
- // Log a message to the Application event log.
- void WriteEventLogEntry(PSTR pszMessage, WORD wType);
-
- // Log an error message to the Application event log.
- void WriteErrorLogEntry(PSTR pszFunction,
- DWORD dwError = GetLastError());
-
-private:
-
- // Entry point for the service. It registers the handler function for the
- // service and starts the service.
- static void WINAPI ServiceMain(DWORD dwArgc, LPSTR *lpszArgv);
-
- // The function is called by the SCM whenever a control code is sent to
- // the service.
- static void WINAPI ServiceCtrlHandler(DWORD dwCtrl);
-
- // Start the service.
- void Start(DWORD dwArgc, PSTR *pszArgv);
-
- // Pause the service.
- void Pause();
-
- // Resume the service after being paused.
- void Continue();
-
- // Execute when the system is shutting down.
- void Shutdown();
-
- // The singleton service instance.
- static CServiceBase *s_service;
-
- // The name of the service
- LPSTR m_name;
-
- // The status of the service
- SERVICE_STATUS m_status;
-
- // The service status handle
- SERVICE_STATUS_HANDLE m_statusHandle;
-}; \ No newline at end of file
diff --git a/zerotierone/windows/ZeroTierOne/ServiceInstaller.cpp b/zerotierone/windows/ZeroTierOne/ServiceInstaller.cpp
deleted file mode 100644
index d302d9f..0000000
--- a/zerotierone/windows/ZeroTierOne/ServiceInstaller.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/****************************** Module Header ******************************\
-* Module Name: ServiceInstaller.cpp
-* Project: CppWindowsService
-* Copyright (c) Microsoft Corporation.
-*
-* The file implements functions that install and uninstall the service.
-*
-* This source is subject to the Microsoft Public License.
-* See http://www.microsoft.com/en-us/openness/resources/licenses.aspx#MPL.
-* All other rights reserved.
-*
-* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
-* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
-\***************************************************************************/
-
-#pragma region "Includes"
-#include <stdio.h>
-#include <windows.h>
-#include "ServiceInstaller.h"
-#pragma endregion
-
-
-//
-// FUNCTION: InstallService
-//
-// PURPOSE: Install the current application as a service to the local
-// service control manager database.
-//
-// PARAMETERS:
-// * pszServiceName - the name of the service to be installed
-// * pszDisplayName - the display name of the service
-// * dwStartType - the service start option. This parameter can be one of
-// the following values: SERVICE_AUTO_START, SERVICE_BOOT_START,
-// SERVICE_DEMAND_START, SERVICE_DISABLED, SERVICE_SYSTEM_START.
-// * pszDependencies - a pointer to a double null-terminated array of null-
-// separated names of services or load ordering groups that the system
-// must start before this service.
-// * pszAccount - the name of the account under which the service runs.
-// * pszPassword - the password to the account name.
-//
-// NOTE: If the function fails to install the service, it prints the error
-// in the standard output stream for users to diagnose the problem.
-//
-std::string InstallService(PSTR pszServiceName,
- PSTR pszDisplayName,
- DWORD dwStartType,
- PSTR pszDependencies,
- PSTR pszAccount,
- PSTR pszPassword)
-{
- std::string ret;
- char szPathTmp[MAX_PATH],szPath[MAX_PATH];
- SC_HANDLE schSCManager = NULL;
- SC_HANDLE schService = NULL;
-
- if (GetModuleFileName(NULL, szPathTmp, ARRAYSIZE(szPath)) == 0)
- {
- ret = "GetModuleFileName failed, unable to get path to self";
- goto Cleanup;
- }
-
- // Quote path in case it contains spaces
- _snprintf_s(szPath,sizeof(szPath),"\"%s\"",szPathTmp);
-
- // Open the local default service control manager database
- schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT |
- SC_MANAGER_CREATE_SERVICE);
- if (schSCManager == NULL)
- {
- ret = "OpenSCManager failed";
- goto Cleanup;
- }
-
- // Install the service into SCM by calling CreateService
- schService = CreateService(
- schSCManager, // SCManager database
- pszServiceName, // Name of service
- pszDisplayName, // Name to display
- SERVICE_QUERY_STATUS, // Desired access
- SERVICE_WIN32_OWN_PROCESS, // Service type
- dwStartType, // Service start type
- SERVICE_ERROR_NORMAL, // Error control type
- szPath, // Service's binary
- NULL, // No load ordering group
- NULL, // No tag identifier
- pszDependencies, // Dependencies
- pszAccount, // Service running account
- pszPassword // Password of the account
- );
- if (schService == NULL)
- {
- ret = "CreateService failed";
- goto Cleanup;
- }
-
-Cleanup:
- // Centralized cleanup for all allocated resources.
- if (schSCManager)
- {
- CloseServiceHandle(schSCManager);
- schSCManager = NULL;
- }
- if (schService)
- {
- CloseServiceHandle(schService);
- schService = NULL;
- }
-
- return ret;
-}
-
-
-//
-// FUNCTION: UninstallService
-//
-// PURPOSE: Stop and remove the service from the local service control
-// manager database.
-//
-// PARAMETERS:
-// * pszServiceName - the name of the service to be removed.
-//
-// NOTE: If the function fails to uninstall the service, it prints the
-// error in the standard output stream for users to diagnose the problem.
-//
-std::string UninstallService(PSTR pszServiceName)
-{
- std::string ret;
- SC_HANDLE schSCManager = NULL;
- SC_HANDLE schService = NULL;
- SERVICE_STATUS ssSvcStatus = {};
-
- // Open the local default service control manager database
- schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
- if (schSCManager == NULL)
- {
- ret = "OpenSCManager failed";
- goto Cleanup;
- }
-
- // Open the service with delete, stop, and query status permissions
- schService = OpenService(schSCManager, pszServiceName, SERVICE_STOP |
- SERVICE_QUERY_STATUS | DELETE);
- if (schService == NULL)
- {
- ret = "OpenService failed (is service installed?)";
- goto Cleanup;
- }
-
- // Try to stop the service
- if (ControlService(schService, SERVICE_CONTROL_STOP, &ssSvcStatus))
- {
- Sleep(500);
-
- while (QueryServiceStatus(schService, &ssSvcStatus))
- {
- if (ssSvcStatus.dwCurrentState == SERVICE_STOP_PENDING)
- {
- Sleep(500);
- }
- else break;
- }
- }
-
- // Now remove the service by calling DeleteService.
- if (!DeleteService(schService))
- {
- ret = "DeleteService failed (is service running?)";
- goto Cleanup;
- }
-
-Cleanup:
- // Centralized cleanup for all allocated resources.
- if (schSCManager)
- {
- CloseServiceHandle(schSCManager);
- schSCManager = NULL;
- }
- if (schService)
- {
- CloseServiceHandle(schService);
- schService = NULL;
- }
-
- return ret;
-}
diff --git a/zerotierone/windows/ZeroTierOne/ServiceInstaller.h b/zerotierone/windows/ZeroTierOne/ServiceInstaller.h
deleted file mode 100644
index ee9856d..0000000
--- a/zerotierone/windows/ZeroTierOne/ServiceInstaller.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************** Module Header ******************************\
-* Module Name: ServiceInstaller.h
-* Project: CppWindowsService
-* Copyright (c) Microsoft Corporation.
-*
-* The file declares functions that install and uninstall the service.
-*
-* This source is subject to the Microsoft Public License.
-* See http://www.microsoft.com/en-us/openness/resources/licenses.aspx#MPL.
-* All other rights reserved.
-*
-* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
-* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
-\***************************************************************************/
-
-#pragma once
-
-#include <string>
-
-//
-// FUNCTION: InstallService
-//
-// PURPOSE: Install the current application as a service to the local
-// service control manager database.
-//
-// PARAMETERS:
-// * pszServiceName - the name of the service to be installed
-// * pszDisplayName - the display name of the service
-// * dwStartType - the service start option. This parameter can be one of
-// the following values: SERVICE_AUTO_START, SERVICE_BOOT_START,
-// SERVICE_DEMAND_START, SERVICE_DISABLED, SERVICE_SYSTEM_START.
-// * pszDependencies - a pointer to a double null-terminated array of null-
-// separated names of services or load ordering groups that the system
-// must start before this service.
-// * pszAccount - the name of the account under which the service runs.
-// * pszPassword - the password to the account name.
-//
-// NOTE: If the function fails to install the service, it prints the error
-// in the standard output stream for users to diagnose the problem.
-//
-// modified for ZT1 to return an error or empty string on success
-std::string InstallService(PSTR pszServiceName,
- PSTR pszDisplayName,
- DWORD dwStartType,
- PSTR pszDependencies,
- PSTR pszAccount,
- PSTR pszPassword);
-
-
-//
-// FUNCTION: UninstallService
-//
-// PURPOSE: Stop and remove the service from the local service control
-// manager database.
-//
-// PARAMETERS:
-// * pszServiceName - the name of the service to be removed.
-//
-// NOTE: If the function fails to uninstall the service, it prints the
-// error in the standard output stream for users to diagnose the problem.
-//
-// Also modified to return rather than print errors
-std::string UninstallService(PSTR pszServiceName);
diff --git a/zerotierone/windows/ZeroTierOne/ZeroTierOne.aps b/zerotierone/windows/ZeroTierOne/ZeroTierOne.aps
deleted file mode 100644
index 1de4112..0000000
--- a/zerotierone/windows/ZeroTierOne/ZeroTierOne.aps
+++ /dev/null
Binary files differ
diff --git a/zerotierone/windows/ZeroTierOne/ZeroTierOne.rc b/zerotierone/windows/ZeroTierOne/ZeroTierOne.rc
deleted file mode 100644
index 0d7c7a7..0000000
--- a/zerotierone/windows/ZeroTierOne/ZeroTierOne.rc
+++ /dev/null
Binary files differ
diff --git a/zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj b/zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj
deleted file mode 100644
index d0b027f..0000000
--- a/zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj
+++ /dev/null
@@ -1,322 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\controller\EmbeddedNetworkController.cpp" />
- <ClCompile Include="..\..\controller\JSONDB.cpp" />
- <ClCompile Include="..\..\ext\http-parser\http_parser.c" />
- <ClCompile Include="..\..\ext\libnatpmp\getgateway.c" />
- <ClCompile Include="..\..\ext\libnatpmp\natpmp.c" />
- <ClCompile Include="..\..\ext\libnatpmp\wingettimeofday.c" />
- <ClCompile Include="..\..\ext\miniupnpc\connecthostport.c" />
- <ClCompile Include="..\..\ext\miniupnpc\igd_desc_parse.c" />
- <ClCompile Include="..\..\ext\miniupnpc\minisoap.c" />
- <ClCompile Include="..\..\ext\miniupnpc\minissdpc.c" />
- <ClCompile Include="..\..\ext\miniupnpc\miniupnpc.c" />
- <ClCompile Include="..\..\ext\miniupnpc\miniwget.c" />
- <ClCompile Include="..\..\ext\miniupnpc\minixml.c" />
- <ClCompile Include="..\..\ext\miniupnpc\portlistingparse.c" />
- <ClCompile Include="..\..\ext\miniupnpc\receivedata.c" />
- <ClCompile Include="..\..\ext\miniupnpc\upnpcommands.c" />
- <ClCompile Include="..\..\ext\miniupnpc\upnpdev.c" />
- <ClCompile Include="..\..\ext\miniupnpc\upnperrors.c" />
- <ClCompile Include="..\..\ext\miniupnpc\upnpreplyparse.c" />
- <ClCompile Include="..\..\node\C25519.cpp" />
- <ClCompile Include="..\..\node\Capability.cpp" />
- <ClCompile Include="..\..\node\CertificateOfMembership.cpp" />
- <ClCompile Include="..\..\node\CertificateOfOwnership.cpp" />
- <ClCompile Include="..\..\node\Cluster.cpp" />
- <ClCompile Include="..\..\node\Identity.cpp" />
- <ClCompile Include="..\..\node\IncomingPacket.cpp" />
- <ClCompile Include="..\..\node\InetAddress.cpp" />
- <ClCompile Include="..\..\node\Membership.cpp" />
- <ClCompile Include="..\..\node\Multicaster.cpp" />
- <ClCompile Include="..\..\node\Network.cpp" />
- <ClCompile Include="..\..\node\NetworkConfig.cpp" />
- <ClCompile Include="..\..\node\Node.cpp" />
- <ClCompile Include="..\..\node\OutboundMulticast.cpp" />
- <ClCompile Include="..\..\node\Packet.cpp" />
- <ClCompile Include="..\..\node\Path.cpp" />
- <ClCompile Include="..\..\node\Peer.cpp" />
- <ClCompile Include="..\..\node\Poly1305.cpp" />
- <ClCompile Include="..\..\node\Revocation.cpp" />
- <ClCompile Include="..\..\node\Salsa20.cpp" />
- <ClCompile Include="..\..\node\SelfAwareness.cpp" />
- <ClCompile Include="..\..\node\SHA512.cpp" />
- <ClCompile Include="..\..\node\Switch.cpp" />
- <ClCompile Include="..\..\node\Tag.cpp" />
- <ClCompile Include="..\..\node\Topology.cpp" />
- <ClCompile Include="..\..\node\Utils.cpp" />
- <ClCompile Include="..\..\one.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
- </ClCompile>
- <ClCompile Include="..\..\osdep\Http.cpp" />
- <ClCompile Include="..\..\osdep\ManagedRoute.cpp" />
- <ClCompile Include="..\..\osdep\OSUtils.cpp" />
- <ClCompile Include="..\..\osdep\PortMapper.cpp" />
- <ClCompile Include="..\..\osdep\WindowsEthernetTap.cpp" />
- <ClCompile Include="..\..\service\ControlPlane.cpp" />
- <ClCompile Include="..\..\service\OneService.cpp" />
- <ClCompile Include="..\..\service\SoftwareUpdater.cpp" />
- <ClCompile Include="ServiceBase.cpp" />
- <ClCompile Include="ServiceInstaller.cpp" />
- <ClCompile Include="ZeroTierOneService.cpp" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\..\ext\http-parser\http_parser.h" />
- <ClInclude Include="..\..\ext\json\json.hpp" />
- <ClInclude Include="..\..\ext\libnatpmp\getgateway.h" />
- <ClInclude Include="..\..\ext\libnatpmp\natpmp.h" />
- <ClInclude Include="..\..\ext\libnatpmp\wingettimeofday.h" />
- <ClInclude Include="..\..\ext\miniupnpc\codelength.h" />
- <ClInclude Include="..\..\ext\miniupnpc\connecthostport.h" />
- <ClInclude Include="..\..\ext\miniupnpc\igd_desc_parse.h" />
- <ClInclude Include="..\..\ext\miniupnpc\minisoap.h" />
- <ClInclude Include="..\..\ext\miniupnpc\minissdpc.h" />
- <ClInclude Include="..\..\ext\miniupnpc\miniupnpc.h" />
- <ClInclude Include="..\..\ext\miniupnpc\miniupnpctypes.h" />
- <ClInclude Include="..\..\ext\miniupnpc\miniupnpc_declspec.h" />
- <ClInclude Include="..\..\ext\miniupnpc\miniwget.h" />
- <ClInclude Include="..\..\ext\miniupnpc\minixml.h" />
- <ClInclude Include="..\..\ext\miniupnpc\portlistingparse.h" />
- <ClInclude Include="..\..\ext\miniupnpc\receivedata.h" />
- <ClInclude Include="..\..\ext\miniupnpc\upnpcommands.h" />
- <ClInclude Include="..\..\ext\miniupnpc\upnpdev.h" />
- <ClInclude Include="..\..\ext\miniupnpc\upnperrors.h" />
- <ClInclude Include="..\..\ext\miniupnpc\upnpreplyparse.h" />
- <ClInclude Include="..\..\include\ZeroTierOne.h" />
- <ClInclude Include="..\..\node\Address.hpp" />
- <ClInclude Include="..\..\node\Array.hpp" />
- <ClInclude Include="..\..\node\AtomicCounter.hpp" />
- <ClInclude Include="..\..\node\BandwidthAccount.hpp" />
- <ClInclude Include="..\..\node\BinarySemaphore.hpp" />
- <ClInclude Include="..\..\node\Buffer.hpp" />
- <ClInclude Include="..\..\node\C25519.hpp" />
- <ClInclude Include="..\..\node\CertificateOfMembership.hpp" />
- <ClInclude Include="..\..\node\CertificateOfOwnership.hpp" />
- <ClInclude Include="..\..\node\Cluster.hpp" />
- <ClInclude Include="..\..\node\CMWC4096.hpp" />
- <ClInclude Include="..\..\node\Constants.hpp" />
- <ClInclude Include="..\..\node\DeferredPackets.hpp" />
- <ClInclude Include="..\..\node\Dictionary.hpp" />
- <ClInclude Include="..\..\node\Hashtable.hpp" />
- <ClInclude Include="..\..\node\Identity.hpp" />
- <ClInclude Include="..\..\node\IncomingPacket.hpp" />
- <ClInclude Include="..\..\node\InetAddress.hpp" />
- <ClInclude Include="..\..\node\MAC.hpp" />
- <ClInclude Include="..\..\node\Multicaster.hpp" />
- <ClInclude Include="..\..\node\MulticastGroup.hpp" />
- <ClInclude Include="..\..\node\Mutex.hpp" />
- <ClInclude Include="..\..\node\Network.hpp" />
- <ClInclude Include="..\..\node\NetworkConfig.hpp" />
- <ClInclude Include="..\..\node\NetworkController.hpp" />
- <ClInclude Include="..\..\node\Node.hpp" />
- <ClInclude Include="..\..\node\NonCopyable.hpp" />
- <ClInclude Include="..\..\node\OutboundMulticast.hpp" />
- <ClInclude Include="..\..\node\Packet.hpp" />
- <ClInclude Include="..\..\node\Path.hpp" />
- <ClInclude Include="..\..\node\Peer.hpp" />
- <ClInclude Include="..\..\node\Poly1305.hpp" />
- <ClInclude Include="..\..\node\RuntimeEnvironment.hpp" />
- <ClInclude Include="..\..\node\Salsa20.hpp" />
- <ClInclude Include="..\..\node\SelfAwareness.hpp" />
- <ClInclude Include="..\..\node\SHA512.hpp" />
- <ClInclude Include="..\..\node\SharedPtr.hpp" />
- <ClInclude Include="..\..\node\Switch.hpp" />
- <ClInclude Include="..\..\node\Topology.hpp" />
- <ClInclude Include="..\..\node\Utils.hpp" />
- <ClInclude Include="..\..\node\World.hpp" />
- <ClInclude Include="..\..\osdep\Binder.hpp" />
- <ClInclude Include="..\..\osdep\Http.hpp" />
- <ClInclude Include="..\..\osdep\ManagedRoute.hpp" />
- <ClInclude Include="..\..\osdep\OSUtils.hpp" />
- <ClInclude Include="..\..\osdep\Phy.hpp" />
- <ClInclude Include="..\..\osdep\PortMapper.hpp" />
- <ClInclude Include="..\..\osdep\Thread.hpp" />
- <ClInclude Include="..\..\osdep\WindowsEthernetTap.hpp" />
- <ClInclude Include="..\..\service\ControlPlane.hpp" />
- <ClInclude Include="..\..\service\OneService.hpp" />
- <ClInclude Include="..\..\service\SoftwareUpdater.hpp" />
- <ClInclude Include="..\..\version.h" />
- <ClInclude Include="resource.h" />
- <ClInclude Include="ServiceBase.h" />
- <ClInclude Include="ServiceInstaller.h" />
- <ClInclude Include="ZeroTierOneService.h" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="ZeroTierOne.rc" />
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{B00A4957-5977-4AC1-9EF4-571DC27EADA2}</ProjectGuid>
- <RootNamespace>ZeroTierOne</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <TargetExt>.exe</TargetExt>
- <OutDir>$(SolutionDir)\Build\$(Platform)\$(Configuration)\</OutDir>
- <TargetName>zerotier-one_x86</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetExt>.exe</TargetExt>
- <OutDir>$(SolutionDir)\Build\$(Platform)\$(Configuration)\</OutDir>
- <TargetName>zerotier-one_x86</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetExt>.exe</TargetExt>
- <OutDir>$(SolutionDir)\Build\$(Platform)\$(Configuration)\</OutDir>
- <TargetName>zerotier-one_x64</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <TargetExt>.exe</TargetExt>
- <OutDir>$(SolutionDir)\Build\$(Platform)\$(Configuration)\</OutDir>
- <TargetName>zerotier-one_x64</TargetName>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <SDLCheck>true</SDLCheck>
- <AdditionalIncludeDirectories>
- </AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <DisableSpecificWarnings>4996</DisableSpecificWarnings>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <SDLCheck>true</SDLCheck>
- <AdditionalIncludeDirectories>
- </AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MultiProcessorCompilation>false</MultiProcessorCompilation>
- <DisableSpecificWarnings>4996</DisableSpecificWarnings>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
- <AdditionalOptions>"notelemetry.obj" %(AdditionalOptions)</AdditionalOptions>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <SDLCheck>true</SDLCheck>
- <AdditionalIncludeDirectories>
- </AdditionalIncludeDirectories>
- <PreprocessorDefinitions>STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
- <StringPooling>true</StringPooling>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <DisableSpecificWarnings>4996</DisableSpecificWarnings>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <AdditionalDependencies>wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <SDLCheck>true</SDLCheck>
- <AdditionalIncludeDirectories>
- </AdditionalIncludeDirectories>
- <PreprocessorDefinitions>STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
- <StringPooling>true</StringPooling>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <DisableSpecificWarnings>4996</DisableSpecificWarnings>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <AdditionalDependencies>wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
- </Link>
- </ItemDefinitionGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters
deleted file mode 100644
index 1b7b469..0000000
--- a/zerotierone/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters
+++ /dev/null
@@ -1,497 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- <Filter Include="Source Files\node">
- <UniqueIdentifier>{67b1c0f8-b018-4169-9c14-7032ed12c786}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\include">
- <UniqueIdentifier>{40761a4c-e8db-4a91-9cab-7afef332f4a8}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\node">
- <UniqueIdentifier>{da3b8126-840c-45db-8abe-9d7e7976f8be}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\osdep">
- <UniqueIdentifier>{6054dfae-4ed2-4d69-8cf5-d6f27646f2d7}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\service">
- <UniqueIdentifier>{9944293a-4a1a-40e9-b92a-eff31fe87e2c}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\osdep">
- <UniqueIdentifier>{ca21bd6b-ff4e-4f9e-bedd-c9f603d2d0d6}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\service">
- <UniqueIdentifier>{e1743b3c-1d18-47f1-ab5a-f5703c19f1df}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\ext">
- <UniqueIdentifier>{71865460-d693-4c73-84f6-dbff42f49df6}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\ext\http-parser">
- <UniqueIdentifier>{17ae9a01-d39f-4c6d-a800-8f2cd0804c96}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\ext">
- <UniqueIdentifier>{7784af31-5b60-4300-b07e-44cf864c54db}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\ext\http-parser">
- <UniqueIdentifier>{f8a1c208-15b8-4d85-a4cb-11d2b82f2d1e}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\windows">
- <UniqueIdentifier>{43f75f84-c70d-4d44-a0ef-28a7a399abd4}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\windows\ZeroTierOne">
- <UniqueIdentifier>{0da07a2f-8922-4827-ac51-29ca3f30f881}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\windows">
- <UniqueIdentifier>{b74916eb-bb6c-4449-a2a2-fa0b17f60121}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\windows\ZeroTierOne">
- <UniqueIdentifier>{bf604491-14c4-4a74-81a6-6105d07c5c7c}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\ext\miniupnpc">
- <UniqueIdentifier>{5423fb64-896b-432e-a19d-88d4467f89f9}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\ext\miniupnpc">
- <UniqueIdentifier>{56cc3ab8-3336-4a22-9471-c267ee46cd54}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\ext\libnatpmp">
- <UniqueIdentifier>{d7292d0d-72a0-4ed6-b717-21debb120737}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\ext\libnatpmp">
- <UniqueIdentifier>{409ec37e-ff36-4c13-b18d-52d6052e0ca2}</UniqueIdentifier>
- </Filter>
- <Filter Include="Source Files\controller">
- <UniqueIdentifier>{3cad34c8-c436-43ae-8323-57803637c832}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files\ext\json">
- <UniqueIdentifier>{ff20532b-d9a2-440d-a7b4-b49e26a9b2f8}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\service\ControlPlane.cpp">
- <Filter>Source Files\service</Filter>
- </ClCompile>
- <ClCompile Include="..\..\service\OneService.cpp">
- <Filter>Source Files\service</Filter>
- </ClCompile>
- <ClCompile Include="..\..\osdep\WindowsEthernetTap.cpp">
- <Filter>Source Files\osdep</Filter>
- </ClCompile>
- <ClCompile Include="..\..\osdep\Http.cpp">
- <Filter>Source Files\osdep</Filter>
- </ClCompile>
- <ClCompile Include="..\..\osdep\OSUtils.cpp">
- <Filter>Source Files\osdep</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\C25519.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\CertificateOfMembership.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Identity.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\IncomingPacket.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\InetAddress.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Multicaster.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Network.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\NetworkConfig.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Node.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\OutboundMulticast.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Packet.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Peer.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Poly1305.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Salsa20.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\SelfAwareness.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\SHA512.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Switch.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Topology.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Utils.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\http-parser\http_parser.c">
- <Filter>Source Files\ext\http-parser</Filter>
- </ClCompile>
- <ClCompile Include="..\..\one.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ServiceBase.cpp">
- <Filter>Source Files\windows\ZeroTierOne</Filter>
- </ClCompile>
- <ClCompile Include="ServiceInstaller.cpp">
- <Filter>Source Files\windows\ZeroTierOne</Filter>
- </ClCompile>
- <ClCompile Include="ZeroTierOneService.cpp">
- <Filter>Source Files\windows\ZeroTierOne</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Path.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Cluster.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\connecthostport.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\igd_desc_parse.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\minisoap.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\minissdpc.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\miniupnpc.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\miniwget.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\minixml.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\portlistingparse.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\receivedata.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\upnpcommands.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\upnpdev.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\upnperrors.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\miniupnpc\upnpreplyparse.c">
- <Filter>Source Files\ext\miniupnpc</Filter>
- </ClCompile>
- <ClCompile Include="..\..\osdep\PortMapper.cpp">
- <Filter>Source Files\osdep</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\libnatpmp\getgateway.c">
- <Filter>Source Files\ext\libnatpmp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\libnatpmp\natpmp.c">
- <Filter>Source Files\ext\libnatpmp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\ext\libnatpmp\wingettimeofday.c">
- <Filter>Source Files\ext\libnatpmp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\osdep\ManagedRoute.cpp">
- <Filter>Source Files\osdep</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Membership.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Capability.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Revocation.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\Tag.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- <ClCompile Include="..\..\controller\EmbeddedNetworkController.cpp">
- <Filter>Source Files\controller</Filter>
- </ClCompile>
- <ClCompile Include="..\..\controller\JSONDB.cpp">
- <Filter>Source Files\controller</Filter>
- </ClCompile>
- <ClCompile Include="..\..\service\SoftwareUpdater.cpp">
- <Filter>Source Files\service</Filter>
- </ClCompile>
- <ClCompile Include="..\..\node\CertificateOfOwnership.cpp">
- <Filter>Source Files\node</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="resource.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\version.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\include\ZeroTierOne.h">
- <Filter>Header Files\include</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\Http.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\OSUtils.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\Phy.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\Thread.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\WindowsEthernetTap.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\service\ControlPlane.hpp">
- <Filter>Header Files\service</Filter>
- </ClInclude>
- <ClInclude Include="..\..\service\OneService.hpp">
- <Filter>Header Files\service</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Address.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Array.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\AtomicCounter.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\BandwidthAccount.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Buffer.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\C25519.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\CertificateOfMembership.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\CMWC4096.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Constants.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Dictionary.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Identity.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\IncomingPacket.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\InetAddress.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\MAC.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Multicaster.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\MulticastGroup.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Mutex.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Network.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\NetworkConfig.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\NetworkController.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Node.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\NonCopyable.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\OutboundMulticast.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Packet.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Path.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Peer.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Poly1305.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\RuntimeEnvironment.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Salsa20.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\SelfAwareness.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\SHA512.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\SharedPtr.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Switch.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Topology.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Utils.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\http-parser\http_parser.h">
- <Filter>Header Files\ext\http-parser</Filter>
- </ClInclude>
- <ClInclude Include="ServiceBase.h">
- <Filter>Header Files\windows\ZeroTierOne</Filter>
- </ClInclude>
- <ClInclude Include="ServiceInstaller.h">
- <Filter>Header Files\windows\ZeroTierOne</Filter>
- </ClInclude>
- <ClInclude Include="ZeroTierOneService.h">
- <Filter>Header Files\windows\ZeroTierOne</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\BinarySemaphore.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Cluster.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\Hashtable.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\DeferredPackets.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\World.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\codelength.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\connecthostport.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\igd_desc_parse.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\minisoap.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\minissdpc.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\miniupnpc.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\miniupnpc_declspec.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\miniupnpctypes.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\miniwget.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\minixml.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\portlistingparse.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\receivedata.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\upnpcommands.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\upnpdev.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\upnperrors.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\miniupnpc\upnpreplyparse.h">
- <Filter>Header Files\ext\miniupnpc</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\PortMapper.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\libnatpmp\getgateway.h">
- <Filter>Header Files\ext\libnatpmp</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\libnatpmp\natpmp.h">
- <Filter>Header Files\ext\libnatpmp</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\libnatpmp\wingettimeofday.h">
- <Filter>Header Files\ext\libnatpmp</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\Binder.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\osdep\ManagedRoute.hpp">
- <Filter>Header Files\osdep</Filter>
- </ClInclude>
- <ClInclude Include="..\..\service\SoftwareUpdater.hpp">
- <Filter>Header Files\service</Filter>
- </ClInclude>
- <ClInclude Include="..\..\ext\json\json.hpp">
- <Filter>Header Files\ext\json</Filter>
- </ClInclude>
- <ClInclude Include="..\..\node\CertificateOfOwnership.hpp">
- <Filter>Header Files\node</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="ZeroTierOne.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/zerotierone/windows/ZeroTierOne/ZeroTierOneService.cpp b/zerotierone/windows/ZeroTierOne/ZeroTierOneService.cpp
deleted file mode 100644
index 8e0b9c3..0000000
--- a/zerotierone/windows/ZeroTierOne/ZeroTierOneService.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma region Includes
-
-#include <WinSock2.h>
-#include <Windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "ZeroTierOneService.h"
-
-#include "../../version.h"
-#include "../../include/ZeroTierOne.h"
-
-#include "../../node/Constants.hpp"
-#include "../../node/Utils.hpp"
-#include "../../osdep/OSUtils.hpp"
-#include "../../service/OneService.hpp"
-
-#pragma endregion // Includes
-
-#ifdef ZT_DEBUG_SERVICE
-FILE *SVCDBGfile = (FILE *)0;
-ZeroTier::Mutex SVCDBGfile_m;
-#endif
-
-ZeroTierOneService::ZeroTierOneService() :
- CServiceBase(ZT_SERVICE_NAME,TRUE,TRUE,FALSE),
- _service((ZeroTier::OneService *)0)
-{
-#ifdef ZT_DEBUG_SERVICE
- SVCDBGfile_m.lock();
- if (!SVCDBGfile)
- SVCDBGfile = fopen(ZT_DEBUG_SERVICE,"a");
- SVCDBGfile_m.unlock();
-#endif
-
- ZT_SVCDBG("ZeroTierOneService::ZeroTierOneService()\r\n");
-}
-
-ZeroTierOneService::~ZeroTierOneService(void)
-{
- ZT_SVCDBG("ZeroTierOneService::~ZeroTierOneService()\r\n");
-
-#ifdef ZT_DEBUG_SERVICE
- SVCDBGfile_m.lock();
- if (SVCDBGfile) {
- fclose(SVCDBGfile);
- SVCDBGfile = (FILE *)0;
- }
- SVCDBGfile_m.unlock();
-#endif
-}
-
-void ZeroTierOneService::threadMain()
- throw()
-{
- ZT_SVCDBG("ZeroTierOneService::threadMain()\r\n");
-
-restart_node:
- try {
- {
- ZeroTier::Mutex::Lock _l(_lock);
- delete _service;
- _service = (ZeroTier::OneService *)0; // in case newInstance() fails
- _service = ZeroTier::OneService::newInstance(
- ZeroTier::OneService::platformDefaultHomePath().c_str(),
- ZT_DEFAULT_PORT);
- }
- switch(_service->run()) {
- case ZeroTier::OneService::ONE_UNRECOVERABLE_ERROR: {
- std::string err("ZeroTier One encountered an unrecoverable error: ");
- err.append(_service->fatalErrorMessage());
- err.append(" (restarting in 5 seconds)");
- WriteEventLogEntry(const_cast <PSTR>(err.c_str()),EVENTLOG_ERROR_TYPE);
- Sleep(5000);
- } goto restart_node;
-
- case ZeroTier::OneService::ONE_IDENTITY_COLLISION: {
- std::string homeDir(ZeroTier::OneService::platformDefaultHomePath());
- delete _service;
- _service = (ZeroTier::OneService *)0;
- std::string oldid;
- ZeroTier::OSUtils::readFile((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret").c_str(),oldid);
- if (oldid.length()) {
- ZeroTier::OSUtils::writeFile((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret.saved_after_collision").c_str(),oldid);
- ZeroTier::OSUtils::rm((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret").c_str());
- ZeroTier::OSUtils::rm((homeDir + ZT_PATH_SEPARATOR_S + "identity.public").c_str());
- }
- } goto restart_node;
-
- default: // normal termination
- break;
- }
- } catch ( ... ) {
- // sanity check, shouldn't happen since Node::run() should catch all its own errors
- // could also happen if we're out of memory though!
- WriteEventLogEntry("unexpected exception (out of memory?) (trying again in 5 seconds)",EVENTLOG_ERROR_TYPE);
- Sleep(5000);
- goto restart_node;
- }
-
- {
- ZeroTier::Mutex::Lock _l(_lock);
- delete _service;
- _service = (ZeroTier::OneService *)0;
- }
-}
-
-void ZeroTierOneService::OnStart(DWORD dwArgc, LPSTR *lpszArgv)
-{
- ZT_SVCDBG("ZeroTierOneService::OnStart()\r\n");
-
- try {
- _thread = ZeroTier::Thread::start(this);
- } catch ( ... ) {
- throw (DWORD)ERROR_EXCEPTION_IN_SERVICE;
- }
-}
-
-void ZeroTierOneService::OnStop()
-{
- ZT_SVCDBG("ZeroTierOneService::OnStop()\r\n");
-
- _lock.lock();
- ZeroTier::OneService *s = _service;
- _lock.unlock();
-
- if (s) {
- s->terminate();
- ZeroTier::Thread::join(_thread);
- }
-}
-
-void ZeroTierOneService::OnShutdown()
-{
- ZT_SVCDBG("ZeroTierOneService::OnShutdown()\r\n");
-
- // stop thread on system shutdown (if it hasn't happened already)
- OnStop();
-}
diff --git a/zerotierone/windows/ZeroTierOne/ZeroTierOneService.h b/zerotierone/windows/ZeroTierOne/ZeroTierOneService.h
deleted file mode 100644
index 9c23d0f..0000000
--- a/zerotierone/windows/ZeroTierOne/ZeroTierOneService.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-
-#include <stdio.h>
-
-#include "ServiceBase.h"
-
-#include <string>
-
-#include "../../node/Mutex.hpp"
-#include "../../osdep/Thread.hpp"
-#include "../../service/OneService.hpp"
-
-// Uncomment to make debugging Windows services suck slightly less hard.
-//#define ZT_DEBUG_SERVICE "C:\\ZeroTierOneServiceDebugLog.txt"
-
-#ifdef ZT_DEBUG_SERVICE
-extern FILE *SVCDBGfile;
-extern ZeroTier::Mutex SVCDBGfile_m;
-#define ZT_SVCDBG(f,...) { SVCDBGfile_m.lock(); fprintf(SVCDBGfile,f,##__VA_ARGS__); fflush(SVCDBGfile); SVCDBGfile_m.unlock(); }
-#else
-#define ZT_SVCDBG(f,...) {}
-#endif
-
-#define ZT_SERVICE_NAME "ZeroTierOneService"
-#define ZT_SERVICE_DISPLAY_NAME "ZeroTier One"
-#define ZT_SERVICE_START_TYPE SERVICE_AUTO_START
-#define ZT_SERVICE_DEPENDENCIES ""
-//#define ZT_SERVICE_ACCOUNT "NT AUTHORITY\\LocalService"
-#define ZT_SERVICE_ACCOUNT NULL
-#define ZT_SERVICE_PASSWORD NULL
-
-class ZeroTierOneService : public CServiceBase
-{
-public:
- ZeroTierOneService();
- virtual ~ZeroTierOneService(void);
-
- /**
- * Thread main method; do not call elsewhere
- */
- void threadMain()
- throw();
-
-protected:
- virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
- virtual void OnStop();
- virtual void OnShutdown();
-
-private:
- ZeroTier::OneService *volatile _service;
- ZeroTier::Mutex _lock;
- ZeroTier::Thread _thread;
-};
diff --git a/zerotierone/windows/ZeroTierOne/resource.h b/zerotierone/windows/ZeroTierOne/resource.h
deleted file mode 100644
index 1aad215..0000000
--- a/zerotierone/windows/ZeroTierOne/resource.h
+++ /dev/null
@@ -1,14 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by ZeroTierOne.rc
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/zerotierone/AUTHORS.md b/zto/AUTHORS.md
index 043ff00..043ff00 100644
--- a/zerotierone/AUTHORS.md
+++ b/zto/AUTHORS.md
diff --git a/zerotierone/COPYING b/zto/COPYING
index 23d42df..23d42df 100644
--- a/zerotierone/COPYING
+++ b/zto/COPYING
diff --git a/zerotierone/LICENSE.GPL-2 b/zto/LICENSE.GPL-2
index d159169..d159169 100644
--- a/zerotierone/LICENSE.GPL-2
+++ b/zto/LICENSE.GPL-2
diff --git a/zerotierone/LICENSE.GPL-3 b/zto/LICENSE.GPL-3
index 94a9ed0..94a9ed0 100644
--- a/zerotierone/LICENSE.GPL-3
+++ b/zto/LICENSE.GPL-3
diff --git a/zerotierone/Makefile b/zto/Makefile
index 2f11e5f..2f11e5f 100644
--- a/zerotierone/Makefile
+++ b/zto/Makefile
diff --git a/zerotierone/README.md b/zto/README.md
index 49feac6..47bfc87 100644
--- a/zerotierone/README.md
+++ b/zto/README.md
@@ -1,7 +1,9 @@
ZeroTier - A Planetary Ethernet Switch
======
-ZeroTier is an advanced SDN Ethernet switch for planet Earth. It erases the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges arising from the inflexible nature of physical networks obsolete. Everything is encrypted end-to-end and traffic takes the most direct (peer to peer) path available.
+ZeroTier is an enterprise Ethernet switch for planet Earth.
+
+It erases the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges arising from the inflexible nature of physical networks obsolete. Everything is encrypted end-to-end and traffic takes the most direct (peer to peer) path available.
Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download.shtml). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
diff --git a/zto/RELEASE-NOTES.md b/zto/RELEASE-NOTES.md
new file mode 100644
index 0000000..42a2aaa
--- /dev/null
+++ b/zto/RELEASE-NOTES.md
@@ -0,0 +1,92 @@
+ZeroTier Release Notes
+======
+
+*As of 1.2.0 this will serve as a detailed changelog, which we've needed for a long time.*
+
+# 2017-03-13 -- Version 1.2.0
+
+Version 1.2.0 is a major milestone release and introduces a large number of new capabilities to the ZeroTier core network hypervisor. It also includes some security tightening, major UI improvements for Windows and Macintosh platforms, and a number of bug fixes and platform issue workarounds.
+
+## Features in 1.2.0
+
+### The ZeroTier Rules Engine
+
+The largest new feature in 1.2.0, and the product of many months of work, is our advanced network rules engine. With this release we achieve traffic control, security monitoring, and micro-segmentation capability on par with many enterprise SDN solutions designed for use in advanced data centers and corporate networks.
+
+Rules allow you to filter packets on your network and vector traffic to security observers (e.g. a node running Snort). Security observation can be performed in-band using REDIRECT or out of band using TEE, and for tha latter it can be done for headers only, for select traffic, or probabilistically to reduce overhead on large distributed networks.
+
+Tags and capabilites provide advanced methods for implementing fine grained permission structures and micro-segmentation schemes without bloating the size and complexity of your rules table.
+
+See our manual for more information.
+
+### Root Server Federation
+
+It's now possible to create your own root servers and add them to the root server pool on your nodes. This is done by creating what's called a "moon," which is a signed enumeration of root servers and their stable points on the network. Refer to the manual for more details on how to do this and how it works.
+
+Federated roots achieve a number of things:
+
+ * You can deploy your own infrastructure to reduce dependency on ours.
+ * You can deploy them *inside your LAN* to ensure that network connectivity inside your facility still works if the Internet goes down. This is the first step toward making ZeroTier viable as an in-house SDN solution.
+ * Roots can be deployed inside national boundaries for countries with data residency laws or "great firewalls." (As of 1.2.0 there is still no way to force all traffic to use these roots, but that will be easy to do in a later version.)
+ * Last but not least this makes ZeroTier somewhat less centralized by eliminating any hard dependency on ZeroTier, Inc.'s infrastructure.
+
+Our roots will of course remain and continue to provide zero-configuration instant-on deployment, a secure global authority for identities, and free traffic relaying for those who can't establish peer to peer connections.
+
+### Local Configuration
+
+An element of our design philosophy is "features are bugs." This isn't an absolute dogma but more of a guiding principle. We try as hard as we can to avoid adding features, especially "knobs" that must be tweaked by a user.
+
+As of 1.2.0 we've decided that certain knobs are unavoidable, and so there is now a `local.conf` file that can be used to configure them. See the ZeroTier One documentation for these. They include:
+
+ * Blacklisting interfaces you want to make sure ZeroTier doesn't use for network traffic, such as VPNs, slow links, or backplanes designated for only certain kinds of traffic.
+ * Turning uPnP/NAT-PMP on or off.
+ * Configuring software updates on Windows and Mac platforms.
+ * Defining trusted paths (the old trusted paths file is now deprecated)
+ * Setting the ZeroTier main port so it doesn't have to be changed on the command line, which is very inconvenient in many cases.
+
+### Improved In-Band Software Updates
+
+A good software update system for Windows and Mac clients has been a missing feature in previous versions. It does exist but we've been shy about using it so far due to its fragility in some environments.
+
+We've greatly improved this mechanism in 1.2.0. Not only does it now do a better job of actually invoking the update, but it also transfers updates in-band using the ZeroTier protocol. This means it can work in environments that do not allows http/https traffic or that force it through proxies. There's also now an update channel setting: `beta` or `release` (the default).
+
+As before software updates are authenticated in two ways:
+
+ 1. ZeroTier's own signing key is used to sign all updates and this signature is checked prior to installation. Our signatures are done on an air-gapped machine.
+
+ 2. Updates for Mac and Windows are signed using Apple and Microsoft (DigiCert) keys and will not install unless these signatures are also valid.
+
+Version 1.2.0's in-band mechanism effectively adds a third way: updates are fetched in-band from a designated ZeroTier node, thus authenticating the source using ZeroTier's built-in encryption and authentication mechanisms.
+
+Updates are now configurable via `local.conf`. There are three options: `disable`, `download`, and `apply`. The third is the default for official builds on Windows and Mac, making updates happen silently and automatically as they do for popular browsers like Chrome and Firefox. For managed enterprise deployments IT people could ship a local.conf that disables updates and instead push updates via their management capabilities. Updates are disabled on Linux and other Unix-type platforms as these get updates through package repositories.
+
+### Path Quality Monitoring (QoS and SD-WAN phase one)
+
+Version 1.2.0 is now aware of the link quality of direct paths with other 1.2.0 nodes. This information isn't used yet but is visible through the JSON API. (Quality always shows as 100% with pre-1.2.0 nodes.)
+
+Link quality monitoring is a precursor to intelligent multi-path and QoS support, which will in future versions bring us to feature parity with SD-WAN products like Cisco iWAN.
+
+"Connect all the things!"
+
+### Security Improvements
+
+Version 1.2.0 adds anti-DOS (denial of service) rate limits and other hardening for improved resiliency against a number of denial of service attack scenarios.
+
+It also adds a mechanism for instantaneous credential revocation. This can be used to revoke certificates of membership instantly to kick a node off a network (for private networks) and also to revoke capabilities and tags. The new controller sends revocations by default when a peer is de-authorized.
+
+Revocations propagate using a "rumor mill" peer to peer algorithm. This means that a controller need only successfully send a revocation to at least one member of a network with connections to other active members. At this point the revocation will flood through the network peer to peer very quickly. This helps make revocations more robust in the face of poor connectivity with the controller or attempts to incapacitate the controller with denial of service attacks, as well as making revocations faster on huge networks.
+
+### Windows and Macintosh UI Improvements (ZeroTier One)
+
+The Mac has a whole new UI built natively in Objective-C. It provides a pulldown similar in appearance and operation to the Mac WiFi task bar menu. The Windows UI has also been improved and now provides a task bar icon that can be right-clicked to manage networks. Both now expose managed route and IP permissions, allowing nodes to easily opt in to full tunnel operation if you have a router configured on your network.
+
+## Major Bug Fixes in 1.2.0
+
+ * **The Windows HyperV 100% CPU bug**
+ * This long-running problem turns out to have been an issue with Windows itself, but one we were triggering by placing invalid data into the Windows registry. Microsoft is aware of the issue but we've also fixed the triggering problem on our side. ZeroTier should now co-exist quite well with HyperV and should now be able to be bridged with a HyperV virtual switch.
+ * **Segmenation Faults on musl-libc based Linux Systems**
+ * Alpine Linux and some embedded Linux systems that use musl libc (a minimal libc) experienced segmentation faults. These were due to a smaller default stack size. A work-around that sets the stack size for new threads has been added.
+ * **Windows Firewall Blocks Local JSON API**
+ * On some Windows systems the firewall likes to block 127.0.0.1:9993 for mysterious reasons. This is now fixed in the installer via the addition of another firewall exemption rule.
+ * **UI Crash on Embedded Windows Due to Missing Fonts**
+ * The MSI installer now ships fonts and will install them if they are not present, so this should be fixed.
diff --git a/zerotierone/controller/EmbeddedNetworkController.cpp b/zto/controller/EmbeddedNetworkController.cpp
index b731db8..d2f40b1 100644
--- a/zerotierone/controller/EmbeddedNetworkController.cpp
+++ b/zto/controller/EmbeddedNetworkController.cpp
@@ -53,7 +53,7 @@ using json = nlohmann::json;
#define ZT_NETCONF_CONTROLLER_API_VERSION 3
// Number of requests to remember in member history
-#define ZT_NETCONF_DB_MEMBER_HISTORY_LENGTH 24
+#define ZT_NETCONF_DB_MEMBER_HISTORY_LENGTH 2
// Min duration between requests for an address/nwid combo to prevent floods
#define ZT_NETCONF_MIN_REQUEST_PERIOD 1000
@@ -61,6 +61,9 @@ using json = nlohmann::json;
// Nodes are considered active if they've queried in less than this long
#define ZT_NETCONF_NODE_ACTIVE_THRESHOLD (ZT_NETWORK_AUTOCONF_DELAY * 2)
+// Timeout for disk read cache (ms)
+#define ZT_NETCONF_DB_CACHE_TTL 60000
+
namespace ZeroTier {
static json _renderRule(ZT_VirtualNetworkRule &rule)
@@ -500,7 +503,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpGET(
json network;
{
Mutex::Lock _l(_db_m);
- network = _db.get("network",nwids,0);
+ network = _db.get("network",nwids,ZT_NETCONF_DB_CACHE_TTL);
}
if (!network.size())
return 404;
@@ -515,7 +518,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpGET(
json member;
{
Mutex::Lock _l(_db_m);
- member = _db.get("network",nwids,"member",Address(address).toString(),0);
+ member = _db.get("network",nwids,"member",Address(address).toString(),ZT_NETCONF_DB_CACHE_TTL);
}
if (!member.size())
return 404;
@@ -531,7 +534,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpGET(
responseBody = "{";
std::string pfx(std::string("network/") + nwids + "member/");
- _db.filter(pfx,120000,[&responseBody](const std::string &n,const json &member) {
+ _db.filter(pfx,ZT_NETCONF_DB_CACHE_TTL,[&responseBody](const std::string &n,const json &member) {
if (member.size() > 0) {
responseBody.append((responseBody.length() == 1) ? "\"" : ",\"");
responseBody.append(OSUtils::jsonString(member["id"],""));
@@ -639,7 +642,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
json member;
{
Mutex::Lock _l(_db_m);
- member = _db.get("network",nwids,"member",Address(address).toString(),0);
+ member = _db.get("network",nwids,"member",Address(address).toString(),ZT_NETCONF_DB_CACHE_TTL);
}
json origMember(member); // for detecting changes
_initMember(member);
@@ -822,7 +825,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
uint64_t tryNwid = nwidPrefix | (nwidPostfix & 0xffffffULL);
if ((tryNwid & 0xffffffULL) == 0ULL) tryNwid |= 1ULL;
Utils::snprintf(nwids,sizeof(nwids),"%.16llx",(unsigned long long)tryNwid);
- if (_db.get("network",nwids,120000).size() <= 0) {
+ if (_db.get("network",nwids,ZT_NETCONF_DB_CACHE_TTL).size() <= 0) {
nwid = tryNwid;
break;
}
@@ -831,7 +834,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
return 503;
}
- network = _db.get("network",nwids,0);
+ network = _db.get("network",nwids,ZT_NETCONF_DB_CACHE_TTL);
}
json origNetwork(network); // for detecting changes
_initNetwork(network);
@@ -1093,7 +1096,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpDELETE(
json network;
{
Mutex::Lock _l(_db_m);
- network = _db.get("network",nwids,0);
+ network = _db.get("network",nwids,ZT_NETCONF_DB_CACHE_TTL);
}
if (!network.size())
return 404;
@@ -1104,7 +1107,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpDELETE(
Mutex::Lock _l(_db_m);
- json member = _db.get("network",nwids,"member",Address(address).toString(),0);
+ json member = _db.get("network",nwids,"member",Address(address).toString(),ZT_NETCONF_DB_CACHE_TTL);
_db.erase("network",nwids,"member",Address(address).toString());
if (!member.size())
@@ -1244,8 +1247,8 @@ void EmbeddedNetworkController::_request(
json member;
{
Mutex::Lock _l(_db_m);
- network = _db.get("network",nwids,0);
- member = _db.get("network",nwids,"member",identity.address().toString(),0);
+ network = _db.get("network",nwids,ZT_NETCONF_DB_CACHE_TTL);
+ member = _db.get("network",nwids,"member",identity.address().toString(),ZT_NETCONF_DB_CACHE_TTL);
}
if (!network.size()) {
diff --git a/zerotierone/controller/EmbeddedNetworkController.hpp b/zto/controller/EmbeddedNetworkController.hpp
index bca0956..a7277ac 100644
--- a/zerotierone/controller/EmbeddedNetworkController.hpp
+++ b/zto/controller/EmbeddedNetworkController.hpp
@@ -44,7 +44,7 @@
#include "JSONDB.hpp"
// Number of background threads to start -- not actually started until needed
-#define ZT_EMBEDDEDNETWORKCONTROLLER_BACKGROUND_THREAD_COUNT 2
+#define ZT_EMBEDDEDNETWORKCONTROLLER_BACKGROUND_THREAD_COUNT 4
// TTL for circuit tests
#define ZT_EMBEDDEDNETWORKCONTROLLER_CIRCUIT_TEST_EXPIRATION 120000
diff --git a/zerotierone/controller/JSONDB.cpp b/zto/controller/JSONDB.cpp
index 1277aab..1277aab 100644
--- a/zerotierone/controller/JSONDB.cpp
+++ b/zto/controller/JSONDB.cpp
diff --git a/zerotierone/controller/JSONDB.hpp b/zto/controller/JSONDB.hpp
index 5b7c5e5..5b7c5e5 100644
--- a/zerotierone/controller/JSONDB.hpp
+++ b/zto/controller/JSONDB.hpp
diff --git a/zerotierone/controller/README.md b/zto/controller/README.md
index db8d015..db8d015 100644
--- a/zerotierone/controller/README.md
+++ b/zto/controller/README.md
diff --git a/zerotierone/controller/migrate-sqlite/migrate.js b/zto/controller/migrate-sqlite/migrate.js
index ac9678a..ac9678a 100644
--- a/zerotierone/controller/migrate-sqlite/migrate.js
+++ b/zto/controller/migrate-sqlite/migrate.js
diff --git a/zerotierone/controller/migrate-sqlite/package.json b/zto/controller/migrate-sqlite/package.json
index 0dac008..0dac008 100644
--- a/zerotierone/controller/migrate-sqlite/package.json
+++ b/zto/controller/migrate-sqlite/package.json
diff --git a/zerotierone/ext/README.md b/zto/ext/README.md
index be9484c..be9484c 100644
--- a/zerotierone/ext/README.md
+++ b/zto/ext/README.md
diff --git a/zerotierone/ext/bin/tap-mac/tap.kext/Contents/Info.plist b/zto/ext/bin/tap-mac/tap.kext/Contents/Info.plist
index c20eefa..c20eefa 100644
--- a/zerotierone/ext/bin/tap-mac/tap.kext/Contents/Info.plist
+++ b/zto/ext/bin/tap-mac/tap.kext/Contents/Info.plist
diff --git a/zerotierone/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap b/zto/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap
index 48bf962..48bf962 100755
--- a/zerotierone/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap
+++ b/zto/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap
Binary files differ
diff --git a/zerotierone/ext/bin/tap-mac/tap.kext/Contents/_CodeSignature/CodeResources b/zto/ext/bin/tap-mac/tap.kext/Contents/_CodeSignature/CodeResources
index 0710b40..0710b40 100644
--- a/zerotierone/ext/bin/tap-mac/tap.kext/Contents/_CodeSignature/CodeResources
+++ b/zto/ext/bin/tap-mac/tap.kext/Contents/_CodeSignature/CodeResources
diff --git a/zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.cat b/zto/ext/bin/tap-windows-ndis6/x64/zttap300.cat
index 8b9114c..8b9114c 100644
--- a/zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.cat
+++ b/zto/ext/bin/tap-windows-ndis6/x64/zttap300.cat
Binary files differ
diff --git a/zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.inf b/zto/ext/bin/tap-windows-ndis6/x64/zttap300.inf
index 453797b..453797b 100644
--- a/zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.inf
+++ b/zto/ext/bin/tap-windows-ndis6/x64/zttap300.inf
diff --git a/zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.sys b/zto/ext/bin/tap-windows-ndis6/x64/zttap300.sys
index 3d846a5..3d846a5 100644
--- a/zerotierone/ext/bin/tap-windows-ndis6/x64/zttap300.sys
+++ b/zto/ext/bin/tap-windows-ndis6/x64/zttap300.sys
Binary files differ
diff --git a/zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.cat b/zto/ext/bin/tap-windows-ndis6/x86/zttap300.cat
index 44347f5..44347f5 100644
--- a/zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.cat
+++ b/zto/ext/bin/tap-windows-ndis6/x86/zttap300.cat
Binary files differ
diff --git a/zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.inf b/zto/ext/bin/tap-windows-ndis6/x86/zttap300.inf
index 453797b..453797b 100644
--- a/zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.inf
+++ b/zto/ext/bin/tap-windows-ndis6/x86/zttap300.inf
diff --git a/zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.sys b/zto/ext/bin/tap-windows-ndis6/x86/zttap300.sys
index 664398e..664398e 100644
--- a/zerotierone/ext/bin/tap-windows-ndis6/x86/zttap300.sys
+++ b/zto/ext/bin/tap-windows-ndis6/x86/zttap300.sys
Binary files differ
diff --git a/zerotierone/ext/http-parser/AUTHORS b/zto/ext/http-parser/AUTHORS
index 5323b68..5323b68 100644
--- a/zerotierone/ext/http-parser/AUTHORS
+++ b/zto/ext/http-parser/AUTHORS
diff --git a/zerotierone/ext/http-parser/LICENSE-MIT b/zto/ext/http-parser/LICENSE-MIT
index 58010b3..58010b3 100644
--- a/zerotierone/ext/http-parser/LICENSE-MIT
+++ b/zto/ext/http-parser/LICENSE-MIT
diff --git a/zerotierone/ext/http-parser/README.md b/zto/ext/http-parser/README.md
index 439b309..439b309 100644
--- a/zerotierone/ext/http-parser/README.md
+++ b/zto/ext/http-parser/README.md
diff --git a/zerotierone/ext/http-parser/http_parser.c b/zto/ext/http-parser/http_parser.c
index 895bf0c..895bf0c 100644
--- a/zerotierone/ext/http-parser/http_parser.c
+++ b/zto/ext/http-parser/http_parser.c
diff --git a/zerotierone/ext/http-parser/http_parser.h b/zto/ext/http-parser/http_parser.h
index 45c72a0..45c72a0 100644
--- a/zerotierone/ext/http-parser/http_parser.h
+++ b/zto/ext/http-parser/http_parser.h
diff --git a/zerotierone/ext/json/LICENSE.MIT b/zto/ext/json/LICENSE.MIT
index e2ac489..e2ac489 100644
--- a/zerotierone/ext/json/LICENSE.MIT
+++ b/zto/ext/json/LICENSE.MIT
diff --git a/zerotierone/ext/json/README.md b/zto/ext/json/README.md
index 4bcbe97..4bcbe97 100644
--- a/zerotierone/ext/json/README.md
+++ b/zto/ext/json/README.md
diff --git a/zerotierone/ext/json/json.hpp b/zto/ext/json/json.hpp
index 9d48e7a..9d48e7a 100644
--- a/zerotierone/ext/json/json.hpp
+++ b/zto/ext/json/json.hpp
diff --git a/zerotierone/ext/libnatpmp/Changelog.txt b/zto/ext/libnatpmp/Changelog.txt
index be75a0b..be75a0b 100644
--- a/zerotierone/ext/libnatpmp/Changelog.txt
+++ b/zto/ext/libnatpmp/Changelog.txt
diff --git a/zerotierone/ext/libnatpmp/JavaTest.java b/zto/ext/libnatpmp/JavaTest.java
index 0379c18..0379c18 100644
--- a/zerotierone/ext/libnatpmp/JavaTest.java
+++ b/zto/ext/libnatpmp/JavaTest.java
diff --git a/zerotierone/ext/libnatpmp/LICENSE b/zto/ext/libnatpmp/LICENSE
index 7fff2c2..7fff2c2 100644
--- a/zerotierone/ext/libnatpmp/LICENSE
+++ b/zto/ext/libnatpmp/LICENSE
diff --git a/zerotierone/ext/libnatpmp/Makefile b/zto/ext/libnatpmp/Makefile
index b67b3e8..b67b3e8 100644
--- a/zerotierone/ext/libnatpmp/Makefile
+++ b/zto/ext/libnatpmp/Makefile
diff --git a/zerotierone/ext/libnatpmp/README b/zto/ext/libnatpmp/README
index 269392d..269392d 100644
--- a/zerotierone/ext/libnatpmp/README
+++ b/zto/ext/libnatpmp/README
diff --git a/zerotierone/ext/libnatpmp/build.bat b/zto/ext/libnatpmp/build.bat
index 2d2f27c..2d2f27c 100644
--- a/zerotierone/ext/libnatpmp/build.bat
+++ b/zto/ext/libnatpmp/build.bat
diff --git a/zerotierone/ext/libnatpmp/declspec.h b/zto/ext/libnatpmp/declspec.h
index a76be02..a76be02 100644
--- a/zerotierone/ext/libnatpmp/declspec.h
+++ b/zto/ext/libnatpmp/declspec.h
diff --git a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/LibraryExtractor.java b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/LibraryExtractor.java
index 5491d94..5491d94 100644
--- a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/LibraryExtractor.java
+++ b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/LibraryExtractor.java
diff --git a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmp.java b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmp.java
index 2f1ddd3..2f1ddd3 100644
--- a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmp.java
+++ b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmp.java
diff --git a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmpResponse.java b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmpResponse.java
index 35c87ea..35c87ea 100644
--- a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmpResponse.java
+++ b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/NatPmpResponse.java
diff --git a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/URLUtils.java b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/URLUtils.java
index 5b419ab..5b419ab 100644
--- a/zerotierone/ext/libnatpmp/fr/free/miniupnp/libnatpmp/URLUtils.java
+++ b/zto/ext/libnatpmp/fr/free/miniupnp/libnatpmp/URLUtils.java
diff --git a/zerotierone/ext/libnatpmp/getgateway.c b/zto/ext/libnatpmp/getgateway.c
index f743a08..f743a08 100644
--- a/zerotierone/ext/libnatpmp/getgateway.c
+++ b/zto/ext/libnatpmp/getgateway.c
diff --git a/zerotierone/ext/libnatpmp/getgateway.h b/zto/ext/libnatpmp/getgateway.h
index 5d3df73..5d3df73 100644
--- a/zerotierone/ext/libnatpmp/getgateway.h
+++ b/zto/ext/libnatpmp/getgateway.h
diff --git a/zerotierone/ext/libnatpmp/libnatpmpmodule.c b/zto/ext/libnatpmp/libnatpmpmodule.c
index 0fd9914..0fd9914 100644
--- a/zerotierone/ext/libnatpmp/libnatpmpmodule.c
+++ b/zto/ext/libnatpmp/libnatpmpmodule.c
diff --git a/zerotierone/ext/libnatpmp/msvc/libnatpmp.sln b/zto/ext/libnatpmp/msvc/libnatpmp.sln
index ac746d4..ac746d4 100644
--- a/zerotierone/ext/libnatpmp/msvc/libnatpmp.sln
+++ b/zto/ext/libnatpmp/msvc/libnatpmp.sln
diff --git a/zerotierone/ext/libnatpmp/msvc/libnatpmp.vcproj b/zto/ext/libnatpmp/msvc/libnatpmp.vcproj
index 9bae5c1..9bae5c1 100644
--- a/zerotierone/ext/libnatpmp/msvc/libnatpmp.vcproj
+++ b/zto/ext/libnatpmp/msvc/libnatpmp.vcproj
diff --git a/zerotierone/ext/libnatpmp/msvc/natpmpc-static.vcproj b/zto/ext/libnatpmp/msvc/natpmpc-static.vcproj
index c2052d9..c2052d9 100644
--- a/zerotierone/ext/libnatpmp/msvc/natpmpc-static.vcproj
+++ b/zto/ext/libnatpmp/msvc/natpmpc-static.vcproj
diff --git a/zerotierone/ext/libnatpmp/natpmp-jni.c b/zto/ext/libnatpmp/natpmp-jni.c
index feec1ce..feec1ce 100644
--- a/zerotierone/ext/libnatpmp/natpmp-jni.c
+++ b/zto/ext/libnatpmp/natpmp-jni.c
diff --git a/zerotierone/ext/libnatpmp/natpmp.c b/zto/ext/libnatpmp/natpmp.c
index 9843c41..9843c41 100644
--- a/zerotierone/ext/libnatpmp/natpmp.c
+++ b/zto/ext/libnatpmp/natpmp.c
diff --git a/zerotierone/ext/libnatpmp/natpmp.def b/zto/ext/libnatpmp/natpmp.def
index cd11003..cd11003 100644
--- a/zerotierone/ext/libnatpmp/natpmp.def
+++ b/zto/ext/libnatpmp/natpmp.def
diff --git a/zerotierone/ext/libnatpmp/natpmp.h b/zto/ext/libnatpmp/natpmp.h
index 7889d20..7889d20 100644
--- a/zerotierone/ext/libnatpmp/natpmp.h
+++ b/zto/ext/libnatpmp/natpmp.h
diff --git a/zerotierone/ext/libnatpmp/natpmpc.1 b/zto/ext/libnatpmp/natpmpc.1
index 5f0003d..5f0003d 100644
--- a/zerotierone/ext/libnatpmp/natpmpc.1
+++ b/zto/ext/libnatpmp/natpmpc.1
diff --git a/zerotierone/ext/libnatpmp/natpmpc.c b/zto/ext/libnatpmp/natpmpc.c
index 611bd2d..611bd2d 100644
--- a/zerotierone/ext/libnatpmp/natpmpc.c
+++ b/zto/ext/libnatpmp/natpmpc.c
diff --git a/zerotierone/ext/libnatpmp/setup.py b/zto/ext/libnatpmp/setup.py
index aa774ee..aa774ee 100644
--- a/zerotierone/ext/libnatpmp/setup.py
+++ b/zto/ext/libnatpmp/setup.py
diff --git a/zerotierone/ext/libnatpmp/setupmingw32.py b/zto/ext/libnatpmp/setupmingw32.py
index d02fdfc..d02fdfc 100644
--- a/zerotierone/ext/libnatpmp/setupmingw32.py
+++ b/zto/ext/libnatpmp/setupmingw32.py
diff --git a/zerotierone/ext/libnatpmp/testgetgateway.c b/zto/ext/libnatpmp/testgetgateway.c
index 24cbe7d..24cbe7d 100644
--- a/zerotierone/ext/libnatpmp/testgetgateway.c
+++ b/zto/ext/libnatpmp/testgetgateway.c
diff --git a/zerotierone/ext/libnatpmp/wingettimeofday.c b/zto/ext/libnatpmp/wingettimeofday.c
index cb730e1..cb730e1 100644
--- a/zerotierone/ext/libnatpmp/wingettimeofday.c
+++ b/zto/ext/libnatpmp/wingettimeofday.c
diff --git a/zerotierone/ext/libnatpmp/wingettimeofday.h b/zto/ext/libnatpmp/wingettimeofday.h
index 1d18d9f..1d18d9f 100644
--- a/zerotierone/ext/libnatpmp/wingettimeofday.h
+++ b/zto/ext/libnatpmp/wingettimeofday.h
diff --git a/zerotierone/ext/miniupnpc/Changelog.txt b/zto/ext/miniupnpc/Changelog.txt
index 078bebc..078bebc 100644
--- a/zerotierone/ext/miniupnpc/Changelog.txt
+++ b/zto/ext/miniupnpc/Changelog.txt
diff --git a/zerotierone/ext/miniupnpc/LICENSE b/zto/ext/miniupnpc/LICENSE
index cb5a060..cb5a060 100644
--- a/zerotierone/ext/miniupnpc/LICENSE
+++ b/zto/ext/miniupnpc/LICENSE
diff --git a/zerotierone/ext/miniupnpc/MANIFEST.in b/zto/ext/miniupnpc/MANIFEST.in
index 54b86f9..54b86f9 100644
--- a/zerotierone/ext/miniupnpc/MANIFEST.in
+++ b/zto/ext/miniupnpc/MANIFEST.in
diff --git a/zerotierone/ext/miniupnpc/README b/zto/ext/miniupnpc/README
index 91535db..91535db 100644
--- a/zerotierone/ext/miniupnpc/README
+++ b/zto/ext/miniupnpc/README
diff --git a/zerotierone/ext/miniupnpc/VERSION b/zto/ext/miniupnpc/VERSION
index cd5ac03..cd5ac03 100644
--- a/zerotierone/ext/miniupnpc/VERSION
+++ b/zto/ext/miniupnpc/VERSION
diff --git a/zerotierone/ext/miniupnpc/apiversions.txt b/zto/ext/miniupnpc/apiversions.txt
index 9464a86..9464a86 100644
--- a/zerotierone/ext/miniupnpc/apiversions.txt
+++ b/zto/ext/miniupnpc/apiversions.txt
diff --git a/zerotierone/ext/miniupnpc/codelength.h b/zto/ext/miniupnpc/codelength.h
index f5f8e30..f5f8e30 100644
--- a/zerotierone/ext/miniupnpc/codelength.h
+++ b/zto/ext/miniupnpc/codelength.h
diff --git a/zerotierone/ext/miniupnpc/connecthostport.c b/zto/ext/miniupnpc/connecthostport.c
index c12d7bd..c12d7bd 100644
--- a/zerotierone/ext/miniupnpc/connecthostport.c
+++ b/zto/ext/miniupnpc/connecthostport.c
diff --git a/zerotierone/ext/miniupnpc/connecthostport.h b/zto/ext/miniupnpc/connecthostport.h
index 56941d6..56941d6 100644
--- a/zerotierone/ext/miniupnpc/connecthostport.h
+++ b/zto/ext/miniupnpc/connecthostport.h
diff --git a/zerotierone/ext/miniupnpc/external-ip.sh b/zto/ext/miniupnpc/external-ip.sh
index 965d86b..965d86b 100755
--- a/zerotierone/ext/miniupnpc/external-ip.sh
+++ b/zto/ext/miniupnpc/external-ip.sh
diff --git a/zerotierone/ext/miniupnpc/igd_desc_parse.c b/zto/ext/miniupnpc/igd_desc_parse.c
index d2999ad..d2999ad 100644
--- a/zerotierone/ext/miniupnpc/igd_desc_parse.c
+++ b/zto/ext/miniupnpc/igd_desc_parse.c
diff --git a/zerotierone/ext/miniupnpc/igd_desc_parse.h b/zto/ext/miniupnpc/igd_desc_parse.h
index 0de546b..0de546b 100644
--- a/zerotierone/ext/miniupnpc/igd_desc_parse.h
+++ b/zto/ext/miniupnpc/igd_desc_parse.h
diff --git a/zerotierone/ext/miniupnpc/listdevices.c b/zto/ext/miniupnpc/listdevices.c
index a93c29f..a93c29f 100644
--- a/zerotierone/ext/miniupnpc/listdevices.c
+++ b/zto/ext/miniupnpc/listdevices.c
diff --git a/zerotierone/ext/miniupnpc/mingw32make.bat b/zto/ext/miniupnpc/mingw32make.bat
index c5d3cc4..c5d3cc4 100644
--- a/zerotierone/ext/miniupnpc/mingw32make.bat
+++ b/zto/ext/miniupnpc/mingw32make.bat
diff --git a/zerotierone/ext/miniupnpc/minihttptestserver.c b/zto/ext/miniupnpc/minihttptestserver.c
index d95dd7c..d95dd7c 100644
--- a/zerotierone/ext/miniupnpc/minihttptestserver.c
+++ b/zto/ext/miniupnpc/minihttptestserver.c
diff --git a/zerotierone/ext/miniupnpc/minisoap.c b/zto/ext/miniupnpc/minisoap.c
index 7aa0213..7aa0213 100644
--- a/zerotierone/ext/miniupnpc/minisoap.c
+++ b/zto/ext/miniupnpc/minisoap.c
diff --git a/zerotierone/ext/miniupnpc/minisoap.h b/zto/ext/miniupnpc/minisoap.h
index 14c859d..14c859d 100644
--- a/zerotierone/ext/miniupnpc/minisoap.h
+++ b/zto/ext/miniupnpc/minisoap.h
diff --git a/zerotierone/ext/miniupnpc/minissdpc.c b/zto/ext/miniupnpc/minissdpc.c
index 06b11e8..06b11e8 100644
--- a/zerotierone/ext/miniupnpc/minissdpc.c
+++ b/zto/ext/miniupnpc/minissdpc.c
diff --git a/zerotierone/ext/miniupnpc/minissdpc.h b/zto/ext/miniupnpc/minissdpc.h
index a5c622b..a5c622b 100644
--- a/zerotierone/ext/miniupnpc/minissdpc.h
+++ b/zto/ext/miniupnpc/minissdpc.h
diff --git a/zerotierone/ext/miniupnpc/miniupnpc.c b/zto/ext/miniupnpc/miniupnpc.c
index 2dc5c95..2dc5c95 100644
--- a/zerotierone/ext/miniupnpc/miniupnpc.c
+++ b/zto/ext/miniupnpc/miniupnpc.c
diff --git a/zerotierone/ext/miniupnpc/miniupnpc.def b/zto/ext/miniupnpc/miniupnpc.def
index 60e0bbe..60e0bbe 100644
--- a/zerotierone/ext/miniupnpc/miniupnpc.def
+++ b/zto/ext/miniupnpc/miniupnpc.def
diff --git a/zerotierone/ext/miniupnpc/miniupnpc.h b/zto/ext/miniupnpc/miniupnpc.h
index 4cc45f7..4cc45f7 100644
--- a/zerotierone/ext/miniupnpc/miniupnpc.h
+++ b/zto/ext/miniupnpc/miniupnpc.h
diff --git a/zerotierone/ext/miniupnpc/miniupnpc_declspec.h b/zto/ext/miniupnpc/miniupnpc_declspec.h
index 40adb92..40adb92 100644
--- a/zerotierone/ext/miniupnpc/miniupnpc_declspec.h
+++ b/zto/ext/miniupnpc/miniupnpc_declspec.h
diff --git a/zerotierone/ext/miniupnpc/miniupnpcmodule.c b/zto/ext/miniupnpc/miniupnpcmodule.c
index a5bdce4..a5bdce4 100644
--- a/zerotierone/ext/miniupnpc/miniupnpcmodule.c
+++ b/zto/ext/miniupnpc/miniupnpcmodule.c
diff --git a/zerotierone/ext/miniupnpc/miniupnpcstrings.h.in b/zto/ext/miniupnpc/miniupnpcstrings.h.in
index 68bf429..68bf429 100644
--- a/zerotierone/ext/miniupnpc/miniupnpcstrings.h.in
+++ b/zto/ext/miniupnpc/miniupnpcstrings.h.in
diff --git a/zerotierone/ext/miniupnpc/miniupnpctypes.h b/zto/ext/miniupnpc/miniupnpctypes.h
index 591c32f..591c32f 100644
--- a/zerotierone/ext/miniupnpc/miniupnpctypes.h
+++ b/zto/ext/miniupnpc/miniupnpctypes.h
diff --git a/zerotierone/ext/miniupnpc/miniwget.c b/zto/ext/miniupnpc/miniwget.c
index 93c8aa6..93c8aa6 100644
--- a/zerotierone/ext/miniupnpc/miniwget.c
+++ b/zto/ext/miniupnpc/miniwget.c
diff --git a/zerotierone/ext/miniupnpc/miniwget.h b/zto/ext/miniupnpc/miniwget.h
index 0701494..0701494 100644
--- a/zerotierone/ext/miniupnpc/miniwget.h
+++ b/zto/ext/miniupnpc/miniwget.h
diff --git a/zerotierone/ext/miniupnpc/minixml.c b/zto/ext/miniupnpc/minixml.c
index 3e201ec..3e201ec 100644
--- a/zerotierone/ext/miniupnpc/minixml.c
+++ b/zto/ext/miniupnpc/minixml.c
diff --git a/zerotierone/ext/miniupnpc/minixml.h b/zto/ext/miniupnpc/minixml.h
index 9f43aa4..9f43aa4 100644
--- a/zerotierone/ext/miniupnpc/minixml.h
+++ b/zto/ext/miniupnpc/minixml.h
diff --git a/zerotierone/ext/miniupnpc/minixmlvalid.c b/zto/ext/miniupnpc/minixmlvalid.c
index dad1488..dad1488 100644
--- a/zerotierone/ext/miniupnpc/minixmlvalid.c
+++ b/zto/ext/miniupnpc/minixmlvalid.c
diff --git a/zerotierone/ext/miniupnpc/portlistingparse.c b/zto/ext/miniupnpc/portlistingparse.c
index d1954f5..d1954f5 100644
--- a/zerotierone/ext/miniupnpc/portlistingparse.c
+++ b/zto/ext/miniupnpc/portlistingparse.c
diff --git a/zerotierone/ext/miniupnpc/portlistingparse.h b/zto/ext/miniupnpc/portlistingparse.h
index 661ad1f..661ad1f 100644
--- a/zerotierone/ext/miniupnpc/portlistingparse.h
+++ b/zto/ext/miniupnpc/portlistingparse.h
diff --git a/zerotierone/ext/miniupnpc/pymoduletest.py b/zto/ext/miniupnpc/pymoduletest.py
index 9fddd9c..9fddd9c 100644
--- a/zerotierone/ext/miniupnpc/pymoduletest.py
+++ b/zto/ext/miniupnpc/pymoduletest.py
diff --git a/zerotierone/ext/miniupnpc/receivedata.c b/zto/ext/miniupnpc/receivedata.c
index ef85a3d..ef85a3d 100644
--- a/zerotierone/ext/miniupnpc/receivedata.c
+++ b/zto/ext/miniupnpc/receivedata.c
diff --git a/zerotierone/ext/miniupnpc/receivedata.h b/zto/ext/miniupnpc/receivedata.h
index 0520a11..0520a11 100644
--- a/zerotierone/ext/miniupnpc/receivedata.h
+++ b/zto/ext/miniupnpc/receivedata.h
diff --git a/zerotierone/ext/miniupnpc/setup.py b/zto/ext/miniupnpc/setup.py
index 97e42bf..97e42bf 100644
--- a/zerotierone/ext/miniupnpc/setup.py
+++ b/zto/ext/miniupnpc/setup.py
diff --git a/zerotierone/ext/miniupnpc/setupmingw32.py b/zto/ext/miniupnpc/setupmingw32.py
index 43dfb46..43dfb46 100644
--- a/zerotierone/ext/miniupnpc/setupmingw32.py
+++ b/zto/ext/miniupnpc/setupmingw32.py
diff --git a/zerotierone/ext/miniupnpc/testdesc/linksys_WAG200G_desc.values b/zto/ext/miniupnpc/testdesc/linksys_WAG200G_desc.values
index cf42221..cf42221 100644
--- a/zerotierone/ext/miniupnpc/testdesc/linksys_WAG200G_desc.values
+++ b/zto/ext/miniupnpc/testdesc/linksys_WAG200G_desc.values
diff --git a/zerotierone/ext/miniupnpc/testdesc/linksys_WAG200G_desc.xml b/zto/ext/miniupnpc/testdesc/linksys_WAG200G_desc.xml
index d428d73..d428d73 100644
--- a/zerotierone/ext/miniupnpc/testdesc/linksys_WAG200G_desc.xml
+++ b/zto/ext/miniupnpc/testdesc/linksys_WAG200G_desc.xml
diff --git a/zerotierone/ext/miniupnpc/testdesc/new_LiveBox_desc.values b/zto/ext/miniupnpc/testdesc/new_LiveBox_desc.values
index c55552e..c55552e 100644
--- a/zerotierone/ext/miniupnpc/testdesc/new_LiveBox_desc.values
+++ b/zto/ext/miniupnpc/testdesc/new_LiveBox_desc.values
diff --git a/zerotierone/ext/miniupnpc/testdesc/new_LiveBox_desc.xml b/zto/ext/miniupnpc/testdesc/new_LiveBox_desc.xml
index 620eb55..620eb55 100644
--- a/zerotierone/ext/miniupnpc/testdesc/new_LiveBox_desc.xml
+++ b/zto/ext/miniupnpc/testdesc/new_LiveBox_desc.xml
diff --git a/zerotierone/ext/miniupnpc/testigddescparse.c b/zto/ext/miniupnpc/testigddescparse.c
index c1907fd..c1907fd 100644
--- a/zerotierone/ext/miniupnpc/testigddescparse.c
+++ b/zto/ext/miniupnpc/testigddescparse.c
diff --git a/zerotierone/ext/miniupnpc/testminiwget.c b/zto/ext/miniupnpc/testminiwget.c
index 5eb49ec..5eb49ec 100644
--- a/zerotierone/ext/miniupnpc/testminiwget.c
+++ b/zto/ext/miniupnpc/testminiwget.c
diff --git a/zerotierone/ext/miniupnpc/testminiwget.sh b/zto/ext/miniupnpc/testminiwget.sh
index 690b405..690b405 100755
--- a/zerotierone/ext/miniupnpc/testminiwget.sh
+++ b/zto/ext/miniupnpc/testminiwget.sh
diff --git a/zerotierone/ext/miniupnpc/testminixml.c b/zto/ext/miniupnpc/testminixml.c
index 57c4a85..57c4a85 100644
--- a/zerotierone/ext/miniupnpc/testminixml.c
+++ b/zto/ext/miniupnpc/testminixml.c
diff --git a/zerotierone/ext/miniupnpc/testportlistingparse.c b/zto/ext/miniupnpc/testportlistingparse.c
index bd9247d..bd9247d 100644
--- a/zerotierone/ext/miniupnpc/testportlistingparse.c
+++ b/zto/ext/miniupnpc/testportlistingparse.c
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/DeletePortMapping.namevalue b/zto/ext/miniupnpc/testreplyparse/DeletePortMapping.namevalue
index 48ca0cc..48ca0cc 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/DeletePortMapping.namevalue
+++ b/zto/ext/miniupnpc/testreplyparse/DeletePortMapping.namevalue
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/DeletePortMapping.xml b/zto/ext/miniupnpc/testreplyparse/DeletePortMapping.xml
index a955c53..a955c53 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/DeletePortMapping.xml
+++ b/zto/ext/miniupnpc/testreplyparse/DeletePortMapping.xml
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue b/zto/ext/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue
index 5aa75f8..5aa75f8 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue
+++ b/zto/ext/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/GetExternalIPAddress.xml b/zto/ext/miniupnpc/testreplyparse/GetExternalIPAddress.xml
index db7ec1f..db7ec1f 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/GetExternalIPAddress.xml
+++ b/zto/ext/miniupnpc/testreplyparse/GetExternalIPAddress.xml
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue
index 26b169c..26b169c 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue
+++ b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml
index bbb540e..bbb540e 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml
+++ b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue
index 2189789..2189789 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue
+++ b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml
index 77e8d9c..77e8d9c 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml
+++ b/zto/ext/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue b/zto/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue
index f78c7e2..f78c7e2 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue
+++ b/zto/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.xml b/zto/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.xml
index ac04c07..ac04c07 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.xml
+++ b/zto/ext/miniupnpc/testreplyparse/SetDefaultConnectionService.xml
diff --git a/zerotierone/ext/miniupnpc/testreplyparse/readme.txt b/zto/ext/miniupnpc/testreplyparse/readme.txt
index 3eb1f01..3eb1f01 100644
--- a/zerotierone/ext/miniupnpc/testreplyparse/readme.txt
+++ b/zto/ext/miniupnpc/testreplyparse/readme.txt
diff --git a/zerotierone/ext/miniupnpc/testupnpigd.py b/zto/ext/miniupnpc/testupnpigd.py
index 6d167a4..6d167a4 100755
--- a/zerotierone/ext/miniupnpc/testupnpigd.py
+++ b/zto/ext/miniupnpc/testupnpigd.py
diff --git a/zerotierone/ext/miniupnpc/testupnpreplyparse.c b/zto/ext/miniupnpc/testupnpreplyparse.c
index 7ba7131..7ba7131 100644
--- a/zerotierone/ext/miniupnpc/testupnpreplyparse.c
+++ b/zto/ext/miniupnpc/testupnpreplyparse.c
diff --git a/zerotierone/ext/miniupnpc/testupnpreplyparse.sh b/zto/ext/miniupnpc/testupnpreplyparse.sh
index 992930b..992930b 100755
--- a/zerotierone/ext/miniupnpc/testupnpreplyparse.sh
+++ b/zto/ext/miniupnpc/testupnpreplyparse.sh
diff --git a/zerotierone/ext/miniupnpc/updateminiupnpcstrings.sh b/zto/ext/miniupnpc/updateminiupnpcstrings.sh
index dde4354..dde4354 100755
--- a/zerotierone/ext/miniupnpc/updateminiupnpcstrings.sh
+++ b/zto/ext/miniupnpc/updateminiupnpcstrings.sh
diff --git a/zerotierone/ext/miniupnpc/upnpc.c b/zto/ext/miniupnpc/upnpc.c
index 8e7edad..8e7edad 100644
--- a/zerotierone/ext/miniupnpc/upnpc.c
+++ b/zto/ext/miniupnpc/upnpc.c
diff --git a/zerotierone/ext/miniupnpc/upnpcommands.c b/zto/ext/miniupnpc/upnpcommands.c
index 3988e49..3988e49 100644
--- a/zerotierone/ext/miniupnpc/upnpcommands.c
+++ b/zto/ext/miniupnpc/upnpcommands.c
diff --git a/zerotierone/ext/miniupnpc/upnpcommands.h b/zto/ext/miniupnpc/upnpcommands.h
index 22eda5e..22eda5e 100644
--- a/zerotierone/ext/miniupnpc/upnpcommands.h
+++ b/zto/ext/miniupnpc/upnpcommands.h
diff --git a/zerotierone/ext/miniupnpc/upnpdev.c b/zto/ext/miniupnpc/upnpdev.c
index d89a993..d89a993 100644
--- a/zerotierone/ext/miniupnpc/upnpdev.c
+++ b/zto/ext/miniupnpc/upnpdev.c
diff --git a/zerotierone/ext/miniupnpc/upnpdev.h b/zto/ext/miniupnpc/upnpdev.h
index f49fbe1..f49fbe1 100644
--- a/zerotierone/ext/miniupnpc/upnpdev.h
+++ b/zto/ext/miniupnpc/upnpdev.h
diff --git a/zerotierone/ext/miniupnpc/upnperrors.c b/zto/ext/miniupnpc/upnperrors.c
index 7ab8ee9..7ab8ee9 100644
--- a/zerotierone/ext/miniupnpc/upnperrors.c
+++ b/zto/ext/miniupnpc/upnperrors.c
diff --git a/zerotierone/ext/miniupnpc/upnperrors.h b/zto/ext/miniupnpc/upnperrors.h
index 3115aee..3115aee 100644
--- a/zerotierone/ext/miniupnpc/upnperrors.h
+++ b/zto/ext/miniupnpc/upnperrors.h
diff --git a/zerotierone/ext/miniupnpc/upnpreplyparse.c b/zto/ext/miniupnpc/upnpreplyparse.c
index 5de5796..5de5796 100644
--- a/zerotierone/ext/miniupnpc/upnpreplyparse.c
+++ b/zto/ext/miniupnpc/upnpreplyparse.c
diff --git a/zerotierone/ext/miniupnpc/upnpreplyparse.h b/zto/ext/miniupnpc/upnpreplyparse.h
index 6badd15..6badd15 100644
--- a/zerotierone/ext/miniupnpc/upnpreplyparse.h
+++ b/zto/ext/miniupnpc/upnpreplyparse.h
diff --git a/zerotierone/ext/miniupnpc/wingenminiupnpcstrings.c b/zto/ext/miniupnpc/wingenminiupnpcstrings.c
index 50df06a..50df06a 100644
--- a/zerotierone/ext/miniupnpc/wingenminiupnpcstrings.c
+++ b/zto/ext/miniupnpc/wingenminiupnpcstrings.c
diff --git a/zerotierone/ext/tap-mac/README.txt b/zto/ext/tap-mac/README.txt
index 177b936..177b936 100644
--- a/zerotierone/ext/tap-mac/README.txt
+++ b/zto/ext/tap-mac/README.txt
diff --git a/zerotierone/ext/tap-mac/tuntap/Makefile b/zto/ext/tap-mac/tuntap/Makefile
index 53ab1a9..53ab1a9 100644
--- a/zerotierone/ext/tap-mac/tuntap/Makefile
+++ b/zto/ext/tap-mac/tuntap/Makefile
diff --git a/zerotierone/ext/tap-mac/tuntap/src/lock.cc b/zto/ext/tap-mac/tuntap/src/lock.cc
index 9c78783..9c78783 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/lock.cc
+++ b/zto/ext/tap-mac/tuntap/src/lock.cc
diff --git a/zerotierone/ext/tap-mac/tuntap/src/lock.h b/zto/ext/tap-mac/tuntap/src/lock.h
index 51d3299..51d3299 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/lock.h
+++ b/zto/ext/tap-mac/tuntap/src/lock.h
diff --git a/zerotierone/ext/tap-mac/tuntap/src/mem.cc b/zto/ext/tap-mac/tuntap/src/mem.cc
index cd3264f..cd3264f 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/mem.cc
+++ b/zto/ext/tap-mac/tuntap/src/mem.cc
diff --git a/zerotierone/ext/tap-mac/tuntap/src/mem.h b/zto/ext/tap-mac/tuntap/src/mem.h
index 4d06fd8..4d06fd8 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/mem.h
+++ b/zto/ext/tap-mac/tuntap/src/mem.h
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tap/Info.plist b/zto/ext/tap-mac/tuntap/src/tap/Info.plist
index bb9b03f..bb9b03f 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tap/Info.plist
+++ b/zto/ext/tap-mac/tuntap/src/tap/Info.plist
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tap/Makefile b/zto/ext/tap-mac/tuntap/src/tap/Makefile
index 306a86d..306a86d 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tap/Makefile
+++ b/zto/ext/tap-mac/tuntap/src/tap/Makefile
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tap/kmod.cc b/zto/ext/tap-mac/tuntap/src/tap/kmod.cc
index f9c4a40..f9c4a40 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tap/kmod.cc
+++ b/zto/ext/tap-mac/tuntap/src/tap/kmod.cc
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tap/tap.cc b/zto/ext/tap-mac/tuntap/src/tap/tap.cc
index b348a85..b348a85 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tap/tap.cc
+++ b/zto/ext/tap-mac/tuntap/src/tap/tap.cc
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tap/tap.h b/zto/ext/tap-mac/tuntap/src/tap/tap.h
index a5164d4..a5164d4 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tap/tap.h
+++ b/zto/ext/tap-mac/tuntap/src/tap/tap.h
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tuntap.cc b/zto/ext/tap-mac/tuntap/src/tuntap.cc
index d0f8901..d0f8901 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tuntap.cc
+++ b/zto/ext/tap-mac/tuntap/src/tuntap.cc
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tuntap.h b/zto/ext/tap-mac/tuntap/src/tuntap.h
index d5f398d..d5f398d 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tuntap.h
+++ b/zto/ext/tap-mac/tuntap/src/tuntap.h
diff --git a/zerotierone/ext/tap-mac/tuntap/src/tuntap_mgr.cc b/zto/ext/tap-mac/tuntap/src/tuntap_mgr.cc
index f41394e..f41394e 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/tuntap_mgr.cc
+++ b/zto/ext/tap-mac/tuntap/src/tuntap_mgr.cc
diff --git a/zerotierone/ext/tap-mac/tuntap/src/util.h b/zto/ext/tap-mac/tuntap/src/util.h
index 0f6955e..0f6955e 100644
--- a/zerotierone/ext/tap-mac/tuntap/src/util.h
+++ b/zto/ext/tap-mac/tuntap/src/util.h
diff --git a/zerotierone/include/README.md b/zto/include/README.md
index a3254ba..a3254ba 100644
--- a/zerotierone/include/README.md
+++ b/zto/include/README.md
diff --git a/zerotierone/include/ZeroTierOne.h b/zto/include/ZeroTierOne.h
index 7a11334..98413a2 100644
--- a/zerotierone/include/ZeroTierOne.h
+++ b/zto/include/ZeroTierOne.h
@@ -74,7 +74,7 @@ extern "C" {
* We use 2800, which leaves some room for other payload in other types of
* messages such as multicast propagation or future support for bridging.
*/
-#define ZT_MAX_MTU 2000
+#define ZT_MAX_MTU 2800
/**
* Maximum length of network short name
diff --git a/zerotierone/make-bsd.mk b/zto/make-bsd.mk
index b038d13..b038d13 100644
--- a/zerotierone/make-bsd.mk
+++ b/zto/make-bsd.mk
diff --git a/zerotierone/make-linux.mk b/zto/make-linux.mk
index 68f865b..1bb6285 100644
--- a/zerotierone/make-linux.mk
+++ b/zto/make-linux.mk
@@ -185,10 +185,10 @@ uninstall: FORCE
# These are just for convenience for building Linux packages
-debian: distclean
- debuild -I -i -us -uc
+debian: FORCE
+ debuild -I -i -us -uc -nc -b
-redhat: distclean
+redhat: FORCE
rpmbuild -ba zerotier-one.spec
FORCE:
diff --git a/zerotierone/make-mac.mk b/zto/make-mac.mk
index 6c388a7..8ff1b77 100644
--- a/zerotierone/make-mac.mk
+++ b/zto/make-mac.mk
@@ -85,7 +85,7 @@ mac-dist-pkg: FORCE
$(PRODUCTSIGN) --sign $(CODESIGN_INSTALLER_CERT) "ZeroTier One.pkg" "ZeroTier One Signed.pkg"
if [ -f "ZeroTier One Signed.pkg" ]; then mv -f "ZeroTier One Signed.pkg" "ZeroTier One.pkg"; fi
rm -f zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_*
- cat ext/installfiles/mac-update/updater.tmpl.sh "ZeroTier One.pkg" >zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_$(ZT_VERSION_MAJOR).$(ZT_VERSION_MINOR).$(ZT_VERSION_REV)_$(ZT_VERSION_BUILD)
+ cat ext/installfiles/mac-update/updater.tmpl.sh "ZeroTier One.pkg" >zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_$(ZT_VERSION_MAJOR).$(ZT_VERSION_MINOR).$(ZT_VERSION_REV)_$(ZT_VERSION_BUILD).exe
# For ZeroTier, Inc. to build official signed packages
official: FORCE
diff --git a/zerotierone/node/Address.hpp b/zto/node/Address.hpp
index 4a5883b..4a5883b 100644
--- a/zerotierone/node/Address.hpp
+++ b/zto/node/Address.hpp
diff --git a/zerotierone/node/Array.hpp b/zto/node/Array.hpp
index 19b29eb..19b29eb 100644
--- a/zerotierone/node/Array.hpp
+++ b/zto/node/Array.hpp
diff --git a/zerotierone/node/AtomicCounter.hpp b/zto/node/AtomicCounter.hpp
index a0f29ba..a0f29ba 100644
--- a/zerotierone/node/AtomicCounter.hpp
+++ b/zto/node/AtomicCounter.hpp
diff --git a/zerotierone/node/Buffer.hpp b/zto/node/Buffer.hpp
index 37f39e7..37f39e7 100644
--- a/zerotierone/node/Buffer.hpp
+++ b/zto/node/Buffer.hpp
diff --git a/zerotierone/node/C25519.cpp b/zto/node/C25519.cpp
index e9ffecc..e9ffecc 100644
--- a/zerotierone/node/C25519.cpp
+++ b/zto/node/C25519.cpp
diff --git a/zerotierone/node/C25519.hpp b/zto/node/C25519.hpp
index b19d969..b19d969 100644
--- a/zerotierone/node/C25519.hpp
+++ b/zto/node/C25519.hpp
diff --git a/zerotierone/node/Capability.cpp b/zto/node/Capability.cpp
index 0a736ca..0a736ca 100644
--- a/zerotierone/node/Capability.cpp
+++ b/zto/node/Capability.cpp
diff --git a/zerotierone/node/Capability.hpp b/zto/node/Capability.hpp
index 1ad6ea4..d070f2a 100644
--- a/zerotierone/node/Capability.hpp
+++ b/zto/node/Capability.hpp
@@ -52,6 +52,11 @@ class RuntimeEnvironment;
*
* Note that this is after evaluation of network scope rules and only if
* network scope rules do not deliver an explicit match.
+ *
+ * Capabilities support a chain of custody. This is currently unused but
+ * in the future would allow the publication of capabilities that can be
+ * handed off between nodes. Limited transferrability of capabilities is
+ * a feature of true capability based security.
*/
class Capability
{
diff --git a/zerotierone/node/CertificateOfMembership.cpp b/zto/node/CertificateOfMembership.cpp
index 43efcd2..43efcd2 100644
--- a/zerotierone/node/CertificateOfMembership.cpp
+++ b/zto/node/CertificateOfMembership.cpp
diff --git a/zerotierone/node/CertificateOfMembership.hpp b/zto/node/CertificateOfMembership.hpp
index 2d7c2cb..2d7c2cb 100644
--- a/zerotierone/node/CertificateOfMembership.hpp
+++ b/zto/node/CertificateOfMembership.hpp
diff --git a/zerotierone/node/CertificateOfOwnership.cpp b/zto/node/CertificateOfOwnership.cpp
index 6fc59ad..6fc59ad 100644
--- a/zerotierone/node/CertificateOfOwnership.cpp
+++ b/zto/node/CertificateOfOwnership.cpp
diff --git a/zerotierone/node/CertificateOfOwnership.hpp b/zto/node/CertificateOfOwnership.hpp
index 7e71c9b..7e71c9b 100644
--- a/zerotierone/node/CertificateOfOwnership.hpp
+++ b/zto/node/CertificateOfOwnership.hpp
diff --git a/zerotierone/node/CertificateOfRepresentation.hpp b/zto/node/CertificateOfRepresentation.hpp
index 7c239a9..02e961c 100644
--- a/zerotierone/node/CertificateOfRepresentation.hpp
+++ b/zto/node/CertificateOfRepresentation.hpp
@@ -32,6 +32,21 @@
namespace ZeroTier {
+/**
+ * A signed enumeration of a node's roots (planet and moons)
+ *
+ * This is sent as part of HELLO and attests to which roots a node trusts
+ * to represent it on the network. Federated roots (moons) can send these
+ * further upstream to tell global roots which nodes they represent, making
+ * them reachable via federated roots if they are not reachable directly.
+ *
+ * As of 1.2.0 this is sent but not used. Right now nodes still always
+ * announce to planetary roots no matter what. In the future this can be
+ * used to implement even better fault tolerance for federation for the
+ * no roots are reachable case as well as a "privacy mode" where federated
+ * roots can shield nodes entirely and p2p connectivity behind them can
+ * be disabled. This will be desirable for a number of use cases.
+ */
class CertificateOfRepresentation
{
public:
diff --git a/zerotierone/node/Cluster.cpp b/zto/node/Cluster.cpp
index 52e03ff..52e03ff 100644
--- a/zerotierone/node/Cluster.cpp
+++ b/zto/node/Cluster.cpp
diff --git a/zerotierone/node/Cluster.hpp b/zto/node/Cluster.hpp
index 08e32a9..08e32a9 100644
--- a/zerotierone/node/Cluster.hpp
+++ b/zto/node/Cluster.hpp
diff --git a/zerotierone/node/Constants.hpp b/zto/node/Constants.hpp
index 3bda380..410a245 100644
--- a/zerotierone/node/Constants.hpp
+++ b/zto/node/Constants.hpp
@@ -202,7 +202,7 @@
/**
* Maximum identity WHOIS retries (each attempt tries consulting a different peer)
*/
-#define ZT_MAX_WHOIS_RETRIES 3
+#define ZT_MAX_WHOIS_RETRIES 4
/**
* Transmit queue entry timeout
@@ -391,6 +391,11 @@
#define ZT_PEER_CREDEITIALS_CUTOFF_LIMIT 15
/**
+ * WHOIS rate limit (we allow these to be pretty fast)
+ */
+#define ZT_PEER_WHOIS_RATE_LIMIT 100
+
+/**
* General rate limit for other kinds of rate-limited packets (HELLO, credential request, etc.) both inbound and outbound
*/
#define ZT_PEER_GENERAL_RATE_LIMIT 1000
diff --git a/zerotierone/node/Dictionary.hpp b/zto/node/Dictionary.hpp
index 15ab9ce..15ab9ce 100644
--- a/zerotierone/node/Dictionary.hpp
+++ b/zto/node/Dictionary.hpp
diff --git a/zerotierone/node/Hashtable.hpp b/zto/node/Hashtable.hpp
index 66f2990..66f2990 100644
--- a/zerotierone/node/Hashtable.hpp
+++ b/zto/node/Hashtable.hpp
diff --git a/zerotierone/node/Identity.cpp b/zto/node/Identity.cpp
index 89fdb83..89fdb83 100644
--- a/zerotierone/node/Identity.cpp
+++ b/zto/node/Identity.cpp
diff --git a/zerotierone/node/Identity.hpp b/zto/node/Identity.hpp
index e452273..e452273 100644
--- a/zerotierone/node/Identity.hpp
+++ b/zto/node/Identity.hpp
diff --git a/zerotierone/node/IncomingPacket.cpp b/zto/node/IncomingPacket.cpp
index 856538b..800985d 100644
--- a/zerotierone/node/IncomingPacket.cpp
+++ b/zto/node/IncomingPacket.cpp
@@ -320,7 +320,7 @@ bool IncomingPacket::_doHELLO(const RuntimeEnvironment *RR,const bool alreadyAut
// Get moon IDs and timestamps if present
if ((ptr + 2) <= size()) {
- unsigned int numMoons = at<uint16_t>(ptr); ptr += 2;
+ const unsigned int numMoons = at<uint16_t>(ptr); ptr += 2;
for(unsigned int i=0;i<numMoons;++i) {
if ((World::Type)(*this)[ptr++] == World::TYPE_MOON)
moonIdsAndTimestamps.push_back(std::pair<uint64_t,uint64_t>(at<uint64_t>(ptr),at<uint64_t>(ptr + 8)));
@@ -552,7 +552,7 @@ bool IncomingPacket::_doOK(const RuntimeEnvironment *RR,const SharedPtr<Peer> &p
bool IncomingPacket::_doWHOIS(const RuntimeEnvironment *RR,const SharedPtr<Peer> &peer)
{
try {
- if (!peer->rateGateInboundWhoisRequest(RR->node->now())) {
+ if ((!RR->topology->amRoot())&&(!peer->rateGateInboundWhoisRequest(RR->node->now()))) {
TRACE("dropped WHOIS from %s(%s): rate limit circuit breaker tripped",source().toString().c_str(),_path->address().toString().c_str());
return true;
}
diff --git a/zerotierone/node/IncomingPacket.hpp b/zto/node/IncomingPacket.hpp
index febff28..febff28 100644
--- a/zerotierone/node/IncomingPacket.hpp
+++ b/zto/node/IncomingPacket.hpp
diff --git a/zerotierone/node/InetAddress.cpp b/zto/node/InetAddress.cpp
index 7d22eea..7d22eea 100644
--- a/zerotierone/node/InetAddress.cpp
+++ b/zto/node/InetAddress.cpp
diff --git a/zerotierone/node/InetAddress.hpp b/zto/node/InetAddress.hpp
index c37fa62..c37fa62 100644
--- a/zerotierone/node/InetAddress.hpp
+++ b/zto/node/InetAddress.hpp
diff --git a/zerotierone/node/MAC.hpp b/zto/node/MAC.hpp
index 95623f1..95623f1 100644
--- a/zerotierone/node/MAC.hpp
+++ b/zto/node/MAC.hpp
diff --git a/zerotierone/node/Membership.cpp b/zto/node/Membership.cpp
index a60b86b..3b2e3b1 100644
--- a/zerotierone/node/Membership.cpp
+++ b/zto/node/Membership.cpp
@@ -223,8 +223,7 @@ Membership::AddCredentialResult Membership::addCredential(const RuntimeEnvironme
const uint64_t now = RR->node->now();
switch(rev.type()) {
default:
- //case Revocation::CREDENTIAL_TYPE_ALL:
- return ( (_revokeCom(rev)||_revokeCap(rev,now)||_revokeTag(rev,now)||_revokeCoo(rev,now)) ? ADD_ACCEPTED_NEW : ADD_ACCEPTED_REDUNDANT );
+ return ADD_REJECTED;
case Revocation::CREDENTIAL_TYPE_COM:
return (_revokeCom(rev) ? ADD_ACCEPTED_NEW : ADD_ACCEPTED_REDUNDANT);
case Revocation::CREDENTIAL_TYPE_CAPABILITY:
diff --git a/zerotierone/node/Membership.hpp b/zto/node/Membership.hpp
index 97510b5..97510b5 100644
--- a/zerotierone/node/Membership.hpp
+++ b/zto/node/Membership.hpp
diff --git a/zerotierone/node/MulticastGroup.hpp b/zto/node/MulticastGroup.hpp
index be4e808..be4e808 100644
--- a/zerotierone/node/MulticastGroup.hpp
+++ b/zto/node/MulticastGroup.hpp
diff --git a/zerotierone/node/Multicaster.cpp b/zto/node/Multicaster.cpp
index f8d5850..f8d5850 100644
--- a/zerotierone/node/Multicaster.cpp
+++ b/zto/node/Multicaster.cpp
diff --git a/zerotierone/node/Multicaster.hpp b/zto/node/Multicaster.hpp
index 32dec9c..32dec9c 100644
--- a/zerotierone/node/Multicaster.hpp
+++ b/zto/node/Multicaster.hpp
diff --git a/zerotierone/node/Mutex.hpp b/zto/node/Mutex.hpp
index d451ede..d451ede 100644
--- a/zerotierone/node/Mutex.hpp
+++ b/zto/node/Mutex.hpp
diff --git a/zerotierone/node/Network.cpp b/zto/node/Network.cpp
index dd812ca..dd812ca 100644
--- a/zerotierone/node/Network.cpp
+++ b/zto/node/Network.cpp
diff --git a/zerotierone/node/Network.hpp b/zto/node/Network.hpp
index 56c7fc6..56c7fc6 100644
--- a/zerotierone/node/Network.hpp
+++ b/zto/node/Network.hpp
diff --git a/zerotierone/node/NetworkConfig.cpp b/zto/node/NetworkConfig.cpp
index fe7393e..fe7393e 100644
--- a/zerotierone/node/NetworkConfig.cpp
+++ b/zto/node/NetworkConfig.cpp
diff --git a/zerotierone/node/NetworkConfig.hpp b/zto/node/NetworkConfig.hpp
index 85c2409..85c2409 100644
--- a/zerotierone/node/NetworkConfig.hpp
+++ b/zto/node/NetworkConfig.hpp
diff --git a/zerotierone/node/NetworkController.hpp b/zto/node/NetworkController.hpp
index 0634f43..0634f43 100644
--- a/zerotierone/node/NetworkController.hpp
+++ b/zto/node/NetworkController.hpp
diff --git a/zerotierone/node/Node.cpp b/zto/node/Node.cpp
index 1125ca7..1125ca7 100644
--- a/zerotierone/node/Node.cpp
+++ b/zto/node/Node.cpp
diff --git a/zerotierone/node/Node.hpp b/zto/node/Node.hpp
index 21eac61..21eac61 100644
--- a/zerotierone/node/Node.hpp
+++ b/zto/node/Node.hpp
diff --git a/zerotierone/node/NonCopyable.hpp b/zto/node/NonCopyable.hpp
index 6d4daa8..6d4daa8 100644
--- a/zerotierone/node/NonCopyable.hpp
+++ b/zto/node/NonCopyable.hpp
diff --git a/zerotierone/node/OutboundMulticast.cpp b/zto/node/OutboundMulticast.cpp
index 36dc41f..36dc41f 100644
--- a/zerotierone/node/OutboundMulticast.cpp
+++ b/zto/node/OutboundMulticast.cpp
diff --git a/zerotierone/node/OutboundMulticast.hpp b/zto/node/OutboundMulticast.hpp
index 6370d0d..6370d0d 100644
--- a/zerotierone/node/OutboundMulticast.hpp
+++ b/zto/node/OutboundMulticast.hpp
diff --git a/zerotierone/node/Packet.cpp b/zto/node/Packet.cpp
index 82a5d7e..c825ea9 100644
--- a/zerotierone/node/Packet.cpp
+++ b/zto/node/Packet.cpp
@@ -2025,16 +2025,12 @@ bool Packet::dearmor(const void *key)
void Packet::cryptField(const void *key,unsigned int start,unsigned int len)
{
- unsigned char mangledKey[32];
- unsigned char macKey[32];
- _salsa20MangleKey((const unsigned char *)key,mangledKey);
- mangledKey[0] ^= 0x7f;
- mangledKey[1] ^= ((start >> 8) & 0xff);
- mangledKey[2] ^= (start & 0xff); // slightly alter key for this use case as an added guard against key stream reuse
- Salsa20 s20(mangledKey,256,field(ZT_PACKET_IDX_IV,8));
- s20.crypt12(ZERO_KEY,macKey,sizeof(macKey)); // discard the first 32 bytes of key stream (the ones use for MAC in armor()) as a precaution
- unsigned char *const ptr = field(start,len);
- s20.crypt12(ptr,ptr,len);
+ uint8_t *const data = reinterpret_cast<uint8_t *>(unsafeData());
+ uint8_t iv[8];
+ for(int i=0;i<8;++i) iv[i] = data[i];
+ iv[7] &= 0xf8; // mask off least significant 3 bits of packet ID / IV since this is unset when this function gets called
+ Salsa20 s20(key,256,iv);
+ s20.crypt12(data + start,data + start,len);
}
bool Packet::compress()
diff --git a/zerotierone/node/Packet.hpp b/zto/node/Packet.hpp
index fb332b7..fb332b7 100644
--- a/zerotierone/node/Packet.hpp
+++ b/zto/node/Packet.hpp
diff --git a/zerotierone/node/Path.cpp b/zto/node/Path.cpp
index 5592bac..5592bac 100644
--- a/zerotierone/node/Path.cpp
+++ b/zto/node/Path.cpp
diff --git a/zerotierone/node/Path.hpp b/zto/node/Path.hpp
index dd6455d..62f29c2 100644
--- a/zerotierone/node/Path.hpp
+++ b/zto/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/zerotierone/node/Peer.cpp b/zto/node/Peer.cpp
index fa3ce6c..fa3ce6c 100644
--- a/zerotierone/node/Peer.cpp
+++ b/zto/node/Peer.cpp
diff --git a/zerotierone/node/Peer.hpp b/zto/node/Peer.hpp
index 783f48b..72040b1 100644
--- a/zerotierone/node/Peer.hpp
+++ b/zto/node/Peer.hpp
@@ -370,7 +370,7 @@ public:
*/
inline bool rateGateInboundWhoisRequest(const uint64_t now)
{
- if ((now - _lastWhoisRequestReceived) >= ZT_PEER_GENERAL_RATE_LIMIT) {
+ if ((now - _lastWhoisRequestReceived) >= ZT_PEER_WHOIS_RATE_LIMIT) {
_lastWhoisRequestReceived = now;
return true;
}
diff --git a/zerotierone/node/Poly1305.cpp b/zto/node/Poly1305.cpp
index b78071f..b78071f 100644
--- a/zerotierone/node/Poly1305.cpp
+++ b/zto/node/Poly1305.cpp
diff --git a/zerotierone/node/Poly1305.hpp b/zto/node/Poly1305.hpp
index 62d5754..62d5754 100644
--- a/zerotierone/node/Poly1305.hpp
+++ b/zto/node/Poly1305.hpp
diff --git a/zerotierone/node/README.md b/zto/node/README.md
index 1728400..1728400 100644
--- a/zerotierone/node/README.md
+++ b/zto/node/README.md
diff --git a/zerotierone/node/Revocation.cpp b/zto/node/Revocation.cpp
index 420476a..420476a 100644
--- a/zerotierone/node/Revocation.cpp
+++ b/zto/node/Revocation.cpp
diff --git a/zerotierone/node/Revocation.hpp b/zto/node/Revocation.hpp
index 1697b52..93c5511 100644
--- a/zerotierone/node/Revocation.hpp
+++ b/zto/node/Revocation.hpp
@@ -47,9 +47,12 @@ class RuntimeEnvironment;
class Revocation
{
public:
+ /**
+ * Credential type being revoked
+ */
enum CredentialType
{
- CREDENTIAL_TYPE_ALL = 0,
+ CREDENTIAL_TYPE_NULL = 0,
CREDENTIAL_TYPE_COM = 1, // CertificateOfMembership
CREDENTIAL_TYPE_CAPABILITY = 2,
CREDENTIAL_TYPE_TAG = 3,
@@ -61,6 +64,15 @@ public:
memset(this,0,sizeof(Revocation));
}
+ /**
+ * @param i ID (arbitrary for revocations, currently random)
+ * @param nwid Network ID
+ * @param cid Credential ID being revoked (0 for all or for COMs, which lack IDs)
+ * @param thr Revocation time threshold before which credentials will be revoked
+ * @param fl Flags
+ * @param tgt Target node whose credential(s) are being revoked
+ * @param ct Credential type being revoked
+ */
Revocation(const uint64_t i,const uint64_t nwid,const uint64_t cid,const uint64_t thr,const uint64_t fl,const Address &tgt,const CredentialType ct) :
_id(i),
_networkId(nwid),
diff --git a/zerotierone/node/RuntimeEnvironment.hpp b/zto/node/RuntimeEnvironment.hpp
index 7ba1c98..7ba1c98 100644
--- a/zerotierone/node/RuntimeEnvironment.hpp
+++ b/zto/node/RuntimeEnvironment.hpp
diff --git a/zerotierone/node/SHA512.cpp b/zto/node/SHA512.cpp
index 76737d3..76737d3 100644
--- a/zerotierone/node/SHA512.cpp
+++ b/zto/node/SHA512.cpp
diff --git a/zerotierone/node/SHA512.hpp b/zto/node/SHA512.hpp
index 639a7df..639a7df 100644
--- a/zerotierone/node/SHA512.hpp
+++ b/zto/node/SHA512.hpp
diff --git a/zerotierone/node/Salsa20.cpp b/zto/node/Salsa20.cpp
index 1a4641f..1a4641f 100644
--- a/zerotierone/node/Salsa20.cpp
+++ b/zto/node/Salsa20.cpp
diff --git a/zerotierone/node/Salsa20.hpp b/zto/node/Salsa20.hpp
index 6405d45..6405d45 100644
--- a/zerotierone/node/Salsa20.hpp
+++ b/zto/node/Salsa20.hpp
diff --git a/zerotierone/node/SelfAwareness.cpp b/zto/node/SelfAwareness.cpp
index e84b7b6..e84b7b6 100644
--- a/zerotierone/node/SelfAwareness.cpp
+++ b/zto/node/SelfAwareness.cpp
diff --git a/zerotierone/node/SelfAwareness.hpp b/zto/node/SelfAwareness.hpp
index 4bdafeb..4bdafeb 100644
--- a/zerotierone/node/SelfAwareness.hpp
+++ b/zto/node/SelfAwareness.hpp
diff --git a/zerotierone/node/SharedPtr.hpp b/zto/node/SharedPtr.hpp
index 1dd3b43..1dd3b43 100644
--- a/zerotierone/node/SharedPtr.hpp
+++ b/zto/node/SharedPtr.hpp
diff --git a/zerotierone/node/Switch.cpp b/zto/node/Switch.cpp
index 0392aec..85103aa 100644
--- a/zerotierone/node/Switch.cpp
+++ b/zto/node/Switch.cpp
@@ -688,9 +688,9 @@ unsigned long Switch::doTimerTasks(uint64_t now)
_outstandingWhoisRequests.erase(*a);
} else {
r->lastSent = now;
- r->peersConsulted[r->retries] = _sendWhoisRequest(*a,r->peersConsulted,r->retries);
- ++r->retries;
+ r->peersConsulted[r->retries] = _sendWhoisRequest(*a,r->peersConsulted,(r->retries > 1) ? r->retries : 0);
TRACE("WHOIS %s (retry %u)",a->toString().c_str(),r->retries);
+ ++r->retries;
nextDelay = std::min(nextDelay,(unsigned long)ZT_WHOIS_RETRY_DELAY);
}
} else {
diff --git a/zerotierone/node/Switch.hpp b/zto/node/Switch.hpp
index 9245c03..9245c03 100644
--- a/zerotierone/node/Switch.hpp
+++ b/zto/node/Switch.hpp
diff --git a/zerotierone/node/Tag.cpp b/zto/node/Tag.cpp
index eb4026b..eb4026b 100644
--- a/zerotierone/node/Tag.cpp
+++ b/zto/node/Tag.cpp
diff --git a/zerotierone/node/Tag.hpp b/zto/node/Tag.hpp
index 146e8da..146e8da 100644
--- a/zerotierone/node/Tag.hpp
+++ b/zto/node/Tag.hpp
diff --git a/zerotierone/node/Topology.cpp b/zto/node/Topology.cpp
index 5abc4df..21547cd 100644
--- a/zerotierone/node/Topology.cpp
+++ b/zto/node/Topology.cpp
@@ -159,61 +159,40 @@ void Topology::saveIdentity(const Identity &id)
SharedPtr<Peer> Topology::getUpstreamPeer(const Address *avoid,unsigned int avoidCount,bool strictAvoid)
{
const uint64_t now = RR->node->now();
+ unsigned int bestQualityOverall = ~((unsigned int)0);
+ unsigned int bestQualityNotAvoid = ~((unsigned int)0);
+ const SharedPtr<Peer> *bestOverall = (const SharedPtr<Peer> *)0;
+ const SharedPtr<Peer> *bestNotAvoid = (const SharedPtr<Peer> *)0;
+
Mutex::Lock _l1(_peers_m);
Mutex::Lock _l2(_upstreams_m);
- if (_amRoot) {
- /* If I am a root, pick another root that isn't mine and that
- * has a numerically greater ID. This causes packets to roam
- * around the top rather than bouncing between just two. */
-
- for(unsigned long p=0;p<_upstreamAddresses.size();++p) {
- if (_upstreamAddresses[p] == RR->identity.address()) {
- for(unsigned long q=1;q<_upstreamAddresses.size();++q) {
- const SharedPtr<Peer> *const nextsn = _peers.get(_upstreamAddresses[(p + q) % _upstreamAddresses.size()]);
- if ((nextsn)&&((*nextsn)->hasActiveDirectPath(now)))
- return *nextsn;
+ for(std::vector<Address>::const_iterator a(_upstreamAddresses.begin());a!=_upstreamAddresses.end();++a) {
+ const SharedPtr<Peer> *p = _peers.get(*a);
+ if (p) {
+ bool avoiding = false;
+ for(unsigned int i=0;i<avoidCount;++i) {
+ if (avoid[i] == (*p)->address()) {
+ avoiding = true;
+ break;
}
- break;
}
- }
-
- } else {
- /* Otherwise pick the bestest looking upstream */
-
- unsigned int bestQualityOverall = ~((unsigned int)0);
- unsigned int bestQualityNotAvoid = ~((unsigned int)0);
- const SharedPtr<Peer> *bestOverall = (const SharedPtr<Peer> *)0;
- const SharedPtr<Peer> *bestNotAvoid = (const SharedPtr<Peer> *)0;
-
- for(std::vector<Address>::const_iterator a(_upstreamAddresses.begin());a!=_upstreamAddresses.end();++a) {
- const SharedPtr<Peer> *p = _peers.get(*a);
- if (p) {
- bool avoiding = false;
- for(unsigned int i=0;i<avoidCount;++i) {
- if (avoid[i] == (*p)->address()) {
- avoiding = true;
- break;
- }
- }
- const unsigned int q = (*p)->relayQuality(now);
- if (q <= bestQualityOverall) {
- bestQualityOverall = q;
- bestOverall = &(*p);
- }
- if ((!avoiding)&&(q <= bestQualityNotAvoid)) {
- bestQualityNotAvoid = q;
- bestNotAvoid = &(*p);
- }
+ const unsigned int q = (*p)->relayQuality(now);
+ if (q <= bestQualityOverall) {
+ bestQualityOverall = q;
+ bestOverall = &(*p);
+ }
+ if ((!avoiding)&&(q <= bestQualityNotAvoid)) {
+ bestQualityNotAvoid = q;
+ bestNotAvoid = &(*p);
}
}
+ }
- if (bestNotAvoid) {
- return *bestNotAvoid;
- } else if ((!strictAvoid)&&(bestOverall)) {
- return *bestOverall;
- }
-
+ if (bestNotAvoid) {
+ return *bestNotAvoid;
+ } else if ((!strictAvoid)&&(bestOverall)) {
+ return *bestOverall;
}
return SharedPtr<Peer>();
diff --git a/zerotierone/node/Topology.hpp b/zto/node/Topology.hpp
index 37615b4..37615b4 100644
--- a/zerotierone/node/Topology.hpp
+++ b/zto/node/Topology.hpp
diff --git a/zerotierone/node/Utils.cpp b/zto/node/Utils.cpp
index fb448dd..fb448dd 100644
--- a/zerotierone/node/Utils.cpp
+++ b/zto/node/Utils.cpp
diff --git a/zerotierone/node/Utils.hpp b/zto/node/Utils.hpp
index ceb29d7..ceb29d7 100644
--- a/zerotierone/node/Utils.hpp
+++ b/zto/node/Utils.hpp
diff --git a/zerotierone/node/World.hpp b/zto/node/World.hpp
index 6e835be..6e835be 100644
--- a/zerotierone/node/World.hpp
+++ b/zto/node/World.hpp
diff --git a/zerotierone/objects.mk b/zto/objects.mk
index 427024e..74efc33 100644
--- a/zerotierone/objects.mk
+++ b/zto/objects.mk
@@ -31,5 +31,4 @@ OBJS=\
osdep/Http.o \
osdep/OSUtils.o \
service/ClusterGeoIpService.o \
- service/ControlPlane.o \
service/SoftwareUpdater.o
diff --git a/zerotierone/one.cpp b/zto/one.cpp
index 8f116aa..f704f7e 100644
--- a/zerotierone/one.cpp
+++ b/zto/one.cpp
@@ -787,7 +787,7 @@ static int idtool(int argc,char **argv)
mj["objtype"] = "world";
mj["worldType"] = "moon";
mj["updatesMustBeSignedBy"] = mj["signingKey"] = Utils::hex(kp.pub.data,(unsigned int)kp.pub.size());
- mj["updatesMustBeSignedBy_SECRET"] = Utils::hex(kp.priv.data,(unsigned int)kp.priv.size());
+ mj["signingKey_SECRET"] = Utils::hex(kp.priv.data,(unsigned int)kp.priv.size());
mj["id"] = id.address().toString();
nlohmann::json seedj;
seedj["identity"] = id.toString(false);
@@ -825,8 +825,10 @@ static int idtool(int argc,char **argv)
}
C25519::Pair signingKey;
- Utils::unhex(OSUtils::jsonString(mj["updatesMustBeSignedBy"],""),signingKey.pub.data,(unsigned int)signingKey.pub.size());
- Utils::unhex(OSUtils::jsonString(mj["updatesMustBeSignedBy_SECRET"],""),signingKey.priv.data,(unsigned int)signingKey.priv.size());
+ C25519::Public updatesMustBeSignedBy;
+ Utils::unhex(OSUtils::jsonString(mj["signingKey"],""),signingKey.pub.data,(unsigned int)signingKey.pub.size());
+ Utils::unhex(OSUtils::jsonString(mj["signingKey_SECRET"],""),signingKey.priv.data,(unsigned int)signingKey.priv.size());
+ Utils::unhex(OSUtils::jsonString(mj["updatesMustBeSignedBy"],""),updatesMustBeSignedBy.data,(unsigned int)updatesMustBeSignedBy.size());
std::vector<World::Root> roots;
nlohmann::json &rootsj = mj["roots"];
@@ -848,11 +850,11 @@ static int idtool(int argc,char **argv)
std::sort(roots.begin(),roots.end());
const uint64_t now = OSUtils::now();
- World w(World::make(t,id,now,signingKey.pub,roots,signingKey));
+ World w(World::make(t,id,now,updatesMustBeSignedBy,roots,signingKey));
Buffer<ZT_WORLD_MAX_SERIALIZED_LENGTH> wbuf;
w.serialize(wbuf);
char fn[128];
- Utils::snprintf(fn,sizeof(fn),"%.16llx_%.16llx.moon",w.id(),now);
+ Utils::snprintf(fn,sizeof(fn),"%.16llx.moon",w.id());
OSUtils::writeFile(fn,wbuf.data(),wbuf.size());
printf("wrote %s (signed world with timestamp %llu)" ZT_EOL_S,fn,(unsigned long long)now);
}
diff --git a/zerotierone/osdep/Arp.cpp b/zto/osdep/Arp.cpp
index fcc122f..fcc122f 100644
--- a/zerotierone/osdep/Arp.cpp
+++ b/zto/osdep/Arp.cpp
diff --git a/zerotierone/osdep/Arp.hpp b/zto/osdep/Arp.hpp
index 5f0d199..5f0d199 100644
--- a/zerotierone/osdep/Arp.hpp
+++ b/zto/osdep/Arp.hpp
diff --git a/zerotierone/osdep/BSDEthernetTap.cpp b/zto/osdep/BSDEthernetTap.cpp
index 0e1ada6..0e1ada6 100644
--- a/zerotierone/osdep/BSDEthernetTap.cpp
+++ b/zto/osdep/BSDEthernetTap.cpp
diff --git a/zerotierone/osdep/BSDEthernetTap.hpp b/zto/osdep/BSDEthernetTap.hpp
index 1bb48d3..1bb48d3 100644
--- a/zerotierone/osdep/BSDEthernetTap.hpp
+++ b/zto/osdep/BSDEthernetTap.hpp
diff --git a/zerotierone/osdep/Binder.hpp b/zto/osdep/Binder.hpp
index 9829f17..9829f17 100644
--- a/zerotierone/osdep/Binder.hpp
+++ b/zto/osdep/Binder.hpp
diff --git a/zerotierone/osdep/BlockingQueue.hpp b/zto/osdep/BlockingQueue.hpp
index 6172f4d..6172f4d 100644
--- a/zerotierone/osdep/BlockingQueue.hpp
+++ b/zto/osdep/BlockingQueue.hpp
diff --git a/zerotierone/osdep/Http.cpp b/zto/osdep/Http.cpp
index d4f43d1..d4f43d1 100644
--- a/zerotierone/osdep/Http.cpp
+++ b/zto/osdep/Http.cpp
diff --git a/zerotierone/osdep/Http.hpp b/zto/osdep/Http.hpp
index 1ecf4ee..1ecf4ee 100644
--- a/zerotierone/osdep/Http.hpp
+++ b/zto/osdep/Http.hpp
diff --git a/zerotierone/osdep/LinuxEthernetTap.cpp b/zto/osdep/LinuxEthernetTap.cpp
index 9d3773f..e7fe657 100644
--- a/zerotierone/osdep/LinuxEthernetTap.cpp
+++ b/zto/osdep/LinuxEthernetTap.cpp
@@ -220,6 +220,7 @@ static bool ___removeIp(const std::string &_dev,const InetAddress &ip)
}
}
+#ifdef __SYNOLOGY__
bool LinuxEthernetTap::addIpSyn(std::vector<InetAddress> ips)
{
// Here we fill out interface config (ifcfg-dev) to prevent it from being killed
@@ -233,14 +234,14 @@ bool LinuxEthernetTap::addIpSyn(std::vector<InetAddress> ips)
setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin", 1);
// We must know if there is at least (one) of each protocol version so we
// can properly enumerate address/netmask combinations in the ifcfg-dev file
- for(int i=0; i<ips.size(); i++) {
+ for(int i=0; i<(int)ips.size(); i++) {
if (ips[i].isV4())
ip4_tot++;
else
ip6_tot++;
}
// Assemble and write contents of ifcfg-dev file
- for(int i=0; i<ips.size(); i++) {
+ for(int i=0; i<(int)ips.size(); i++) {
if (ips[i].isV4()) {
std::string numstr4 = ip4_tot > 1 ? std::to_string(ip4) : "";
cfg_contents += "\nIPADDR"+numstr4+"="+ips[i].toIpString()
@@ -256,7 +257,7 @@ bool LinuxEthernetTap::addIpSyn(std::vector<InetAddress> ips)
}
OSUtils::writeFile(filepath.c_str(), cfg_contents.c_str(), cfg_contents.length());
// Finaly, add IPs
- for(int i=0; i<ips.size(); i++){
+ for(int i=0; i<(int)ips.size(); i++){
if (ips[i].isV4())
::execlp("ip","ip","addr","add",ips[i].toString().c_str(),"broadcast",ips[i].broadcast().toIpString().c_str(),"dev",_dev.c_str(),(const char *)0);
else
@@ -270,6 +271,7 @@ bool LinuxEthernetTap::addIpSyn(std::vector<InetAddress> ips)
}
return true;
}
+#endif // __SYNOLOGY__
bool LinuxEthernetTap::addIp(const InetAddress &ip)
{
diff --git a/zerotierone/osdep/LinuxEthernetTap.hpp b/zto/osdep/LinuxEthernetTap.hpp
index acdff9d..7dd7e01 100644
--- a/zerotierone/osdep/LinuxEthernetTap.hpp
+++ b/zto/osdep/LinuxEthernetTap.hpp
@@ -52,7 +52,9 @@ public:
void setEnabled(bool en);
bool enabled() const;
bool addIp(const InetAddress &ip);
+#ifdef __SYNOLOGY__
bool addIpSyn(std::vector<InetAddress> ips);
+#endif
bool removeIp(const InetAddress &ip);
std::vector<InetAddress> ips() const;
void put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len);
diff --git a/zerotierone/osdep/ManagedRoute.cpp b/zto/osdep/ManagedRoute.cpp
index 1fc6c78..1fc6c78 100644
--- a/zerotierone/osdep/ManagedRoute.cpp
+++ b/zto/osdep/ManagedRoute.cpp
diff --git a/zerotierone/osdep/ManagedRoute.hpp b/zto/osdep/ManagedRoute.hpp
index fd77a79..fd77a79 100644
--- a/zerotierone/osdep/ManagedRoute.hpp
+++ b/zto/osdep/ManagedRoute.hpp
diff --git a/zerotierone/osdep/NeighborDiscovery.cpp b/zto/osdep/NeighborDiscovery.cpp
index 4f63631..4f63631 100644
--- a/zerotierone/osdep/NeighborDiscovery.cpp
+++ b/zto/osdep/NeighborDiscovery.cpp
diff --git a/zerotierone/osdep/NeighborDiscovery.hpp b/zto/osdep/NeighborDiscovery.hpp
index 47831bd..47831bd 100644
--- a/zerotierone/osdep/NeighborDiscovery.hpp
+++ b/zto/osdep/NeighborDiscovery.hpp
diff --git a/zerotierone/osdep/OSUtils.cpp b/zto/osdep/OSUtils.cpp
index fc02109..6b95258 100644
--- a/zerotierone/osdep/OSUtils.cpp
+++ b/zto/osdep/OSUtils.cpp
@@ -145,6 +145,64 @@ std::map<std::string,char> OSUtils::listDirectoryFull(const char *path)
return r;
}
+long OSUtils::cleanDirectory(const char *path,const uint64_t olderThan)
+{
+ long cleaned = 0;
+
+#ifdef __WINDOWS__
+ HANDLE hFind;
+ WIN32_FIND_DATAA ffd;
+ LARGE_INTEGER date,adjust;
+ adjust.QuadPart = 11644473600000 * 10000;
+ char tmp[4096];
+ if ((hFind = FindFirstFileA((std::string(path) + "\\*").c_str(),&ffd)) != INVALID_HANDLE_VALUE) {
+ do {
+ if ((strcmp(ffd.cFileName,"."))&&(strcmp(ffd.cFileName,".."))&&((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)) {
+ date.HighPart = ffd.ftLastWriteTime.dwHighDateTime;
+ date.LowPart = ffd.ftLastWriteTime.dwLowDateTime;
+ if (date.QuadPart > 0) {
+ date.QuadPart -= adjust.QuadPart;
+ if (((date.QuadPart / 10000000) * 1000) < olderThan) {
+ Utils::snprintf(tmp, sizeof(tmp), "%s\\%s", path, ffd.cFileName);
+ if (DeleteFileA(tmp))
+ ++cleaned;
+ }
+ }
+ }
+ } while (FindNextFileA(hFind,&ffd));
+ FindClose(hFind);
+ }
+#else
+ struct dirent de;
+ struct dirent *dptr;
+ struct stat st;
+ char tmp[4096];
+ DIR *d = opendir(path);
+ if (!d)
+ return -1;
+ dptr = (struct dirent *)0;
+ for(;;) {
+ if (readdir_r(d,&de,&dptr))
+ break;
+ if (dptr) {
+ if ((strcmp(dptr->d_name,"."))&&(strcmp(dptr->d_name,".."))&&(dptr->d_type == DT_REG)) {
+ Utils::snprintf(tmp,sizeof(tmp),"%s/%s",path,dptr->d_name);
+ if (stat(tmp,&st) == 0) {
+ uint64_t mt = (uint64_t)(st.st_mtime);
+ if ((mt > 0)&&((mt * 1000) < olderThan)) {
+ if (unlink(tmp) == 0)
+ ++cleaned;
+ }
+ }
+ }
+ } else break;
+ }
+ closedir(d);
+#endif
+
+ return cleaned;
+}
+
bool OSUtils::rmDashRf(const char *path)
{
#ifdef __WINDOWS__
@@ -369,7 +427,7 @@ std::string OSUtils::platformDefaultHomePath()
}
// Inline these massive JSON operations in one place only to reduce binary footprint and compile time
-nlohmann::json OSUtils::jsonParse(const std::string &buf) { return nlohmann::json::parse(buf); }
+nlohmann::json OSUtils::jsonParse(const std::string &buf) { return nlohmann::json::parse(buf.c_str()); }
std::string OSUtils::jsonDump(const nlohmann::json &j) { return j.dump(1); }
uint64_t OSUtils::jsonInt(const nlohmann::json &jv,const uint64_t dfl)
diff --git a/zerotierone/osdep/OSUtils.hpp b/zto/osdep/OSUtils.hpp
index 2fe0197..adf1488 100644
--- a/zerotierone/osdep/OSUtils.hpp
+++ b/zto/osdep/OSUtils.hpp
@@ -120,6 +120,16 @@ public:
static std::map<std::string,char> listDirectoryFull(const char *path);
/**
+ * Clean a directory of files whose last modified time is older than this
+ *
+ * This ignores directories, symbolic links, and other special files.
+ *
+ * @param olderThan Last modified older than timestamp (ms since epoch)
+ * @return Number of cleaned files or negative on fatal error
+ */
+ static long cleanDirectory(const char *path,const uint64_t olderThan);
+
+ /**
* Delete a directory and all its files and subdirectories recursively
*
* @param path Path to delete
diff --git a/zerotierone/osdep/OSXEthernetTap.cpp b/zto/osdep/OSXEthernetTap.cpp
index b358092..b358092 100644
--- a/zerotierone/osdep/OSXEthernetTap.cpp
+++ b/zto/osdep/OSXEthernetTap.cpp
diff --git a/zerotierone/osdep/OSXEthernetTap.hpp b/zto/osdep/OSXEthernetTap.hpp
index de48f9a..de48f9a 100644
--- a/zerotierone/osdep/OSXEthernetTap.hpp
+++ b/zto/osdep/OSXEthernetTap.hpp
diff --git a/zerotierone/osdep/Phy.hpp b/zto/osdep/Phy.hpp
index 62dd079..5201cff 100644
--- a/zerotierone/osdep/Phy.hpp
+++ b/zto/osdep/Phy.hpp
@@ -917,7 +917,7 @@ public:
}
if ((FD_ISSET(sock,&wfds))&&(FD_ISSET(sock,&_writefds))) {
try {
- _handler->phyOnTcpWritable((PhySocket *)&(*s),&(s->uptr),false);
+ _handler->phyOnTcpWritable((PhySocket *)&(*s),&(s->uptr), false);
} catch ( ... ) {}
}
} break;
diff --git a/zerotierone/osdep/PortMapper.cpp b/zto/osdep/PortMapper.cpp
index d3a1938..d3a1938 100644
--- a/zerotierone/osdep/PortMapper.cpp
+++ b/zto/osdep/PortMapper.cpp
diff --git a/zerotierone/osdep/PortMapper.hpp b/zto/osdep/PortMapper.hpp
index 0b8d15f..0b8d15f 100644
--- a/zerotierone/osdep/PortMapper.hpp
+++ b/zto/osdep/PortMapper.hpp
diff --git a/zerotierone/osdep/README.md b/zto/osdep/README.md
index a77297a..a77297a 100644
--- a/zerotierone/osdep/README.md
+++ b/zto/osdep/README.md
diff --git a/zerotierone/osdep/Thread.hpp b/zto/osdep/Thread.hpp
index 227c2cf..227c2cf 100644
--- a/zerotierone/osdep/Thread.hpp
+++ b/zto/osdep/Thread.hpp
diff --git a/zerotierone/osdep/WindowsEthernetTap.cpp b/zto/osdep/WindowsEthernetTap.cpp
index 8ee088b..8ee088b 100644
--- a/zerotierone/osdep/WindowsEthernetTap.cpp
+++ b/zto/osdep/WindowsEthernetTap.cpp
diff --git a/zerotierone/osdep/WindowsEthernetTap.hpp b/zto/osdep/WindowsEthernetTap.hpp
index 53bba3e..53bba3e 100644
--- a/zerotierone/osdep/WindowsEthernetTap.hpp
+++ b/zto/osdep/WindowsEthernetTap.hpp
diff --git a/zerotierone/selftest.cpp b/zto/selftest.cpp
index 8a45079..8a45079 100644
--- a/zerotierone/selftest.cpp
+++ b/zto/selftest.cpp
diff --git a/zerotierone/service/ClusterDefinition.hpp b/zto/service/ClusterDefinition.hpp
index dda1a8c..dda1a8c 100644
--- a/zerotierone/service/ClusterDefinition.hpp
+++ b/zto/service/ClusterDefinition.hpp
diff --git a/zerotierone/service/ClusterGeoIpService.cpp b/zto/service/ClusterGeoIpService.cpp
index 89015c5..89015c5 100644
--- a/zerotierone/service/ClusterGeoIpService.cpp
+++ b/zto/service/ClusterGeoIpService.cpp
diff --git a/zerotierone/service/ClusterGeoIpService.hpp b/zto/service/ClusterGeoIpService.hpp
index ff2fcdb..ff2fcdb 100644
--- a/zerotierone/service/ClusterGeoIpService.hpp
+++ b/zto/service/ClusterGeoIpService.hpp
diff --git a/zerotierone/service/OneService.cpp b/zto/service/OneService.cpp
index 486b836..29ef3a6 100644
--- a/zerotierone/service/OneService.cpp
+++ b/zto/service/OneService.cpp
@@ -38,6 +38,7 @@
#include "../node/InetAddress.hpp"
#include "../node/MAC.hpp"
#include "../node/Identity.hpp"
+#include "../node/World.hpp"
#include "../osdep/Phy.hpp"
#include "../osdep/Thread.hpp"
@@ -48,11 +49,24 @@
#include "../osdep/ManagedRoute.hpp"
#include "OneService.hpp"
-#include "ControlPlane.hpp"
#include "ClusterGeoIpService.hpp"
#include "ClusterDefinition.hpp"
#include "SoftwareUpdater.hpp"
+#ifdef __WINDOWS__
+#include <WinSock2.h>
+#include <Windows.h>
+#include <ShlObj.h>
+#include <netioapi.h>
+#include <iphlpapi.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <ifaddrs.h>
+#endif
+
#ifdef ZT_USE_SYSTEM_HTTP_PARSER
#include <http_parser.h>
#else
@@ -75,20 +89,6 @@ using json = nlohmann::json;
#include "../controller/EmbeddedNetworkController.hpp"
-#ifdef __WINDOWS__
-#include <WinSock2.h>
-#include <Windows.h>
-#include <ShlObj.h>
-#include <netioapi.h>
-#include <iphlpapi.h>
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <ifaddrs.h>
-#endif
-
// Include the right tap device driver for this platform -- add new platforms here
#ifdef ZT_SDK
@@ -119,7 +119,7 @@ namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
#endif // __OpenBSD__
-#endif // ZT_SDK
+#endif // ZT_SERVICE_NETCON
// Sanity limits for HTTP
#define ZT_MAX_HTTP_MESSAGE_SIZE (1024 * 1024 * 64)
@@ -147,6 +147,9 @@ namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
// How often to check for local interface addresses
#define ZT_LOCAL_INTERFACE_CHECK_INTERVAL 60000
+// Clean files from iddb.d that are older than this (60 days)
+#define ZT_IDDB_CLEANUP_AGE 5184000000ULL
+
namespace ZeroTier {
namespace {
@@ -170,6 +173,122 @@ static std::string _trimString(const std::string &s)
return s.substr(start,end - start);
}
+static void _networkToJson(nlohmann::json &nj,const ZT_VirtualNetworkConfig *nc,const std::string &portDeviceName,const OneService::NetworkSettings &localSettings)
+{
+ char tmp[256];
+
+ const char *nstatus = "",*ntype = "";
+ switch(nc->status) {
+ case ZT_NETWORK_STATUS_REQUESTING_CONFIGURATION: nstatus = "REQUESTING_CONFIGURATION"; break;
+ case ZT_NETWORK_STATUS_OK: nstatus = "OK"; break;
+ case ZT_NETWORK_STATUS_ACCESS_DENIED: nstatus = "ACCESS_DENIED"; break;
+ case ZT_NETWORK_STATUS_NOT_FOUND: nstatus = "NOT_FOUND"; break;
+ case ZT_NETWORK_STATUS_PORT_ERROR: nstatus = "PORT_ERROR"; break;
+ case ZT_NETWORK_STATUS_CLIENT_TOO_OLD: nstatus = "CLIENT_TOO_OLD"; break;
+ }
+ switch(nc->type) {
+ case ZT_NETWORK_TYPE_PRIVATE: ntype = "PRIVATE"; break;
+ case ZT_NETWORK_TYPE_PUBLIC: ntype = "PUBLIC"; break;
+ }
+
+ Utils::snprintf(tmp,sizeof(tmp),"%.16llx",nc->nwid);
+ nj["id"] = tmp;
+ nj["nwid"] = tmp;
+ Utils::snprintf(tmp,sizeof(tmp),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(unsigned int)((nc->mac >> 40) & 0xff),(unsigned int)((nc->mac >> 32) & 0xff),(unsigned int)((nc->mac >> 24) & 0xff),(unsigned int)((nc->mac >> 16) & 0xff),(unsigned int)((nc->mac >> 8) & 0xff),(unsigned int)(nc->mac & 0xff));
+ nj["mac"] = tmp;
+ nj["name"] = nc->name;
+ nj["status"] = nstatus;
+ nj["type"] = ntype;
+ nj["mtu"] = nc->mtu;
+ nj["dhcp"] = (bool)(nc->dhcp != 0);
+ nj["bridge"] = (bool)(nc->bridge != 0);
+ nj["broadcastEnabled"] = (bool)(nc->broadcastEnabled != 0);
+ nj["portError"] = nc->portError;
+ nj["netconfRevision"] = nc->netconfRevision;
+ nj["portDeviceName"] = portDeviceName;
+ nj["allowManaged"] = localSettings.allowManaged;
+ nj["allowGlobal"] = localSettings.allowGlobal;
+ nj["allowDefault"] = localSettings.allowDefault;
+
+ nlohmann::json aa = nlohmann::json::array();
+ for(unsigned int i=0;i<nc->assignedAddressCount;++i) {
+ aa.push_back(reinterpret_cast<const InetAddress *>(&(nc->assignedAddresses[i]))->toString());
+ }
+ nj["assignedAddresses"] = aa;
+
+ nlohmann::json ra = nlohmann::json::array();
+ for(unsigned int i=0;i<nc->routeCount;++i) {
+ nlohmann::json rj;
+ rj["target"] = reinterpret_cast<const InetAddress *>(&(nc->routes[i].target))->toString();
+ if (nc->routes[i].via.ss_family == nc->routes[i].target.ss_family)
+ rj["via"] = reinterpret_cast<const InetAddress *>(&(nc->routes[i].via))->toIpString();
+ else rj["via"] = nlohmann::json();
+ rj["flags"] = (int)nc->routes[i].flags;
+ rj["metric"] = (int)nc->routes[i].metric;
+ ra.push_back(rj);
+ }
+ nj["routes"] = ra;
+}
+
+static void _peerToJson(nlohmann::json &pj,const ZT_Peer *peer)
+{
+ char tmp[256];
+
+ const char *prole = "";
+ switch(peer->role) {
+ case ZT_PEER_ROLE_LEAF: prole = "LEAF"; break;
+ case ZT_PEER_ROLE_MOON: prole = "MOON"; break;
+ case ZT_PEER_ROLE_PLANET: prole = "PLANET"; break;
+ }
+
+ Utils::snprintf(tmp,sizeof(tmp),"%.10llx",peer->address);
+ pj["address"] = tmp;
+ pj["versionMajor"] = peer->versionMajor;
+ pj["versionMinor"] = peer->versionMinor;
+ pj["versionRev"] = peer->versionRev;
+ Utils::snprintf(tmp,sizeof(tmp),"%d.%d.%d",peer->versionMajor,peer->versionMinor,peer->versionRev);
+ pj["version"] = tmp;
+ pj["latency"] = peer->latency;
+ pj["role"] = prole;
+
+ nlohmann::json pa = nlohmann::json::array();
+ for(unsigned int i=0;i<peer->pathCount;++i) {
+ nlohmann::json j;
+ j["address"] = reinterpret_cast<const InetAddress *>(&(peer->paths[i].address))->toString();
+ j["lastSend"] = peer->paths[i].lastSend;
+ j["lastReceive"] = peer->paths[i].lastReceive;
+ j["trustedPathId"] = peer->paths[i].trustedPathId;
+ j["linkQuality"] = (double)peer->paths[i].linkQuality / (double)ZT_PATH_LINK_QUALITY_MAX;
+ j["active"] = (bool)(peer->paths[i].expired == 0);
+ j["expired"] = (bool)(peer->paths[i].expired != 0);
+ j["preferred"] = (bool)(peer->paths[i].preferred != 0);
+ pa.push_back(j);
+ }
+ pj["paths"] = pa;
+}
+
+static void _moonToJson(nlohmann::json &mj,const World &world)
+{
+ char tmp[64];
+ Utils::snprintf(tmp,sizeof(tmp),"%.16llx",world.id());
+ mj["id"] = tmp;
+ mj["timestamp"] = world.timestamp();
+ 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<World::Root>::const_iterator r(world.roots().begin());r!=world.roots().end();++r) {
+ nlohmann::json rj;
+ rj["identity"] = r->identity.toString(false);
+ nlohmann::json eps = nlohmann::json::array();
+ for(std::vector<InetAddress>::const_iterator a(r->stableEndpoints.begin());a!=r->stableEndpoints.end();++a)
+ eps.push_back(a->toString());
+ rj["stableEndpoints"] = eps;
+ ra.push_back(rj);
+ }
+ mj["roots"] = ra;
+ mj["waiting"] = false;
+}
+
class OneServiceImpl;
static int SnodeVirtualNetworkConfigFunction(ZT_Node *node,void *uptr,uint64_t nwid,void **nuptr,enum ZT_VirtualNetworkConfigOperation op,const ZT_VirtualNetworkConfig *nwconf);
@@ -261,6 +380,7 @@ public:
// begin member variables --------------------------------------------------
const std::string _homePath;
+ std::string _authToken;
EmbeddedNetworkController *_controller;
Phy<OneServiceImpl *> _phy;
Node *_node;
@@ -299,9 +419,6 @@ public:
PhySocket *_v4TcpControlSocket;
PhySocket *_v6TcpControlSocket;
- // JSON API handler
- ControlPlane *_controlPlane;
-
// Time we last received a packet from a global address
uint64_t _lastDirectReceiveFromGlobal;
#ifdef ZT_TCP_FALLBACK_RELAY
@@ -371,7 +488,6 @@ public:
,_updater((SoftwareUpdater *)0)
,_updateAutoApply(false)
,_primaryPort(port)
- ,_controlPlane((ControlPlane *)0)
,_lastDirectReceiveFromGlobal(0)
#ifdef ZT_TCP_FALLBACK_RELAY
,_lastSendToGlobalV4(0)
@@ -420,16 +536,15 @@ public:
virtual ReasonForTermination run()
{
try {
- std::string authToken;
{
- std::string authTokenPath(_homePath + ZT_PATH_SEPARATOR_S "authtoken.secret");
- if (!OSUtils::readFile(authTokenPath.c_str(),authToken)) {
+ const std::string authTokenPath(_homePath + ZT_PATH_SEPARATOR_S "authtoken.secret");
+ if (!OSUtils::readFile(authTokenPath.c_str(),_authToken)) {
unsigned char foo[24];
Utils::getSecureRandom(foo,sizeof(foo));
- authToken = "";
+ _authToken = "";
for(unsigned int i=0;i<sizeof(foo);++i)
- authToken.push_back("abcdefghijklmnopqrstuvwxyz0123456789"[(unsigned long)foo[i] % 36]);
- if (!OSUtils::writeFile(authTokenPath.c_str(),authToken)) {
+ _authToken.push_back("abcdefghijklmnopqrstuvwxyz0123456789"[(unsigned long)foo[i] % 36]);
+ if (!OSUtils::writeFile(authTokenPath.c_str(),_authToken)) {
Mutex::Lock _l(_termReason_m);
_termReason = ONE_UNRECOVERABLE_ERROR;
_fatalErrorMessage = "authtoken.secret could not be written";
@@ -438,8 +553,8 @@ public:
OSUtils::lockDownFile(authTokenPath.c_str(),false);
}
}
+ _authToken = _trimString(_authToken);
}
- authToken = _trimString(authToken);
// Clean up any legacy files if present
OSUtils::rm((_homePath + ZT_PATH_SEPARATOR_S "peers.save").c_str());
@@ -690,10 +805,6 @@ public:
}
#endif
- _controlPlane = new ControlPlane(this,_node);
- _controlPlane->addAuthToken(authToken.c_str());
- _controlPlane->setController(_controller);
-
{ // Load existing networks
std::vector<std::string> networksDotD(OSUtils::listDirectory((_homePath + ZT_PATH_SEPARATOR_S "networks.d").c_str()));
for(std::vector<std::string>::iterator f(networksDotD.begin());f!=networksDotD.end();++f) {
@@ -718,6 +829,7 @@ public:
uint64_t lastBindRefresh = 0;
uint64_t lastUpdateCheck = clockShouldBe;
uint64_t lastLocalInterfaceAddressCheck = (clockShouldBe - ZT_LOCAL_INTERFACE_CHECK_INTERVAL) + 15000; // do this in 15s to give portmapper time to configure and other things time to settle
+ uint64_t lastCleanedIddb = 0;
for(;;) {
_run_m.lock();
if (!_run) {
@@ -732,6 +844,12 @@ public:
const uint64_t now = OSUtils::now();
+ // Clean iddb.d on start and every 24 hours
+ if ((now - lastCleanedIddb) > 86400000) {
+ lastCleanedIddb = now;
+ OSUtils::cleanDirectory((_homePath + ZT_PATH_SEPARATOR_S "iddb.d").c_str(),now - ZT_IDDB_CLEANUP_AGE);
+ }
+
// Attempt to detect sleep/wake events by detecting delay overruns
bool restarted = false;
if ((now > clockShouldBe)&&((now - clockShouldBe) > 10000)) {
@@ -831,8 +949,6 @@ public:
_nets.clear();
}
- delete _controlPlane;
- _controlPlane = (ControlPlane *)0;
delete _updater;
_updater = (SoftwareUpdater *)0;
delete _node;
@@ -862,11 +978,6 @@ public:
else return std::string();
}
- virtual bool tcpFallbackActive() const
- {
- return (_tcpFallbackTunnel != (TcpConnection *)0);
- }
-
virtual void terminate()
{
_run_m.lock();
@@ -943,16 +1054,411 @@ public:
// Internal implementation methods -----------------------------------------
+ inline unsigned int handleControlPlaneHttpRequest(
+ const InetAddress &fromAddress,
+ unsigned int httpMethod,
+ const std::string &path,
+ const std::map<std::string,std::string> &headers,
+ const std::string &body,
+ std::string &responseBody,
+ std::string &responseContentType)
+ {
+ char tmp[256];
+ unsigned int scode = 404;
+ json res;
+ std::vector<std::string> ps(OSUtils::split(path.c_str(),"/","",""));
+ std::map<std::string,std::string> urlArgs;
+
+ /* Note: this is kind of restricted in what it'll take. It does not support
+ * URL encoding, and /'s in URL args will screw it up. But the only URL args
+ * it really uses in ?jsonp=funcionName, and otherwise it just takes simple
+ * paths to simply-named resources. */
+ if (ps.size() > 0) {
+ std::size_t qpos = ps[ps.size() - 1].find('?');
+ if (qpos != std::string::npos) {
+ std::string args(ps[ps.size() - 1].substr(qpos + 1));
+ ps[ps.size() - 1] = ps[ps.size() - 1].substr(0,qpos);
+ std::vector<std::string> asplit(OSUtils::split(args.c_str(),"&","",""));
+ for(std::vector<std::string>::iterator a(asplit.begin());a!=asplit.end();++a) {
+ std::size_t eqpos = a->find('=');
+ if (eqpos == std::string::npos)
+ urlArgs[*a] = "";
+ else urlArgs[a->substr(0,eqpos)] = a->substr(eqpos + 1);
+ }
+ }
+ }
+
+ bool isAuth = false;
+ {
+ std::map<std::string,std::string>::const_iterator ah(headers.find("x-zt1-auth"));
+ if ((ah != headers.end())&&(_authToken == ah->second)) {
+ isAuth = true;
+ } else {
+ ah = urlArgs.find("auth");
+ if ((ah != urlArgs.end())&&(_authToken == ah->second))
+ isAuth = true;
+ }
+ }
+
+#ifdef __SYNOLOGY__
+ // Authenticate via Synology's built-in cgi script
+ if (!isAuth) {
+ /*
+ fprintf(stderr, "path = %s\n", path.c_str());
+ fprintf(stderr, "headers.size=%d\n", headers.size());
+ std::map<std::string, std::string>::const_iterator it(headers.begin());
+ while(it != headers.end()) {
+ fprintf(stderr,"header[%s] = %s\n", (it->first).c_str(), (it->second).c_str());
+ it++;
+ }
+ */
+ // parse out url args
+ int synotoken_pos = path.find("SynoToken");
+ int argpos = path.find("?");
+ if(synotoken_pos != std::string::npos && argpos != std::string::npos) {
+ std::string cookie = path.substr(argpos+1, synotoken_pos-(argpos+1));
+ std::string synotoken = path.substr(synotoken_pos);
+ std::string cookie_val = cookie.substr(cookie.find("=")+1);
+ std::string synotoken_val = synotoken.substr(synotoken.find("=")+1);
+ // Set necessary env for auth script
+ std::map<std::string,std::string>::const_iterator ah2(headers.find("x-forwarded-for"));
+ setenv("HTTP_COOKIE", cookie_val.c_str(), true);
+ setenv("HTTP_X_SYNO_TOKEN", synotoken_val.c_str(), true);
+ setenv("REMOTE_ADDR", ah2->second.c_str(),true);
+ //fprintf(stderr, "HTTP_COOKIE: %s\n",std::getenv ("HTTP_COOKIE"));
+ //fprintf(stderr, "HTTP_X_SYNO_TOKEN: %s\n",std::getenv ("HTTP_X_SYNO_TOKEN"));
+ //fprintf(stderr, "REMOTE_ADDR: %s\n",std::getenv ("REMOTE_ADDR"));
+ // check synology web auth
+ char user[256], buf[1024];
+ FILE *fp = NULL;
+ bzero(user, 256);
+ fp = popen("/usr/syno/synoman/webman/modules/authenticate.cgi", "r");
+ if(!fp)
+ isAuth = false;
+ else {
+ bzero(buf, sizeof(buf));
+ fread(buf, 1024, 1, fp);
+ if(strlen(buf) > 0) {
+ snprintf(user, 256, "%s", buf);
+ isAuth = true;
+ }
+ }
+ pclose(fp);
+ }
+ }
+#endif
+
+ if (httpMethod == HTTP_GET) {
+ if (isAuth) {
+ if (ps[0] == "status") {
+ ZT_NodeStatus status;
+ _node->status(&status);
+
+ Utils::snprintf(tmp,sizeof(tmp),"%.10llx",status.address);
+ res["address"] = tmp;
+ res["publicIdentity"] = status.publicIdentity;
+ res["online"] = (bool)(status.online != 0);
+ res["tcpFallbackActive"] = (_tcpFallbackTunnel != (TcpConnection *)0);
+ res["versionMajor"] = ZEROTIER_ONE_VERSION_MAJOR;
+ res["versionMinor"] = ZEROTIER_ONE_VERSION_MINOR;
+ res["versionRev"] = ZEROTIER_ONE_VERSION_REVISION;
+ res["versionBuild"] = ZEROTIER_ONE_VERSION_BUILD;
+ Utils::snprintf(tmp,sizeof(tmp),"%d.%d.%d",ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION);
+ res["version"] = tmp;
+ res["clock"] = OSUtils::now();
+
+ {
+ Mutex::Lock _l(_localConfig_m);
+ res["config"] = _localConfig;
+ }
+ json &settings = res["config"]["settings"];
+ settings["primaryPort"] = OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff;
+#ifdef ZT_USE_MINIUPNPC
+ settings["portMappingEnabled"] = OSUtils::jsonBool(settings["portMappingEnabled"],true);
+#else
+ settings["portMappingEnabled"] = false; // not supported in build
+#endif
+ //settings["softwareUpdate"] = OSUtils::jsonString(settings["softwareUpdate"],ZT_SOFTWARE_UPDATE_DEFAULT);
+ //settings["softwareUpdateChannel"] = OSUtils::jsonString(settings["softwareUpdateChannel"],ZT_SOFTWARE_UPDATE_DEFAULT_CHANNEL);
+
+ const World planet(_node->planet());
+ res["planetWorldId"] = planet.id();
+ res["planetWorldTimestamp"] = planet.timestamp();
+
+#ifdef ZT_ENABLE_CLUSTER
+ json cj;
+ ZT_ClusterStatus cs;
+ _node->clusterStatus(&cs);
+ if (cs.clusterSize >= 1) {
+ json cja = json::array();
+ for(unsigned int i=0;i<cs.clusterSize;++i) {
+ json cjm;
+ cjm["id"] = (int)cs.members[i].id;
+ cjm["msSinceLastHeartbeat"] = cs.members[i].msSinceLastHeartbeat;
+ cjm["alive"] = (bool)(cs.members[i].alive != 0);
+ cjm["x"] = cs.members[i].x;
+ cjm["y"] = cs.members[i].y;
+ cjm["z"] = cs.members[i].z;
+ cjm["load"] = cs.members[i].load;
+ cjm["peers"] = cs.members[i].peers;
+ cja.push_back(cjm);
+ }
+ cj["members"] = cja;
+ cj["myId"] = (int)cs.myId;
+ cj["clusterSize"] = cs.clusterSize;
+ }
+ res["cluster"] = cj;
+#else
+ res["cluster"] = json();
+#endif
+
+ scode = 200;
+ } else if (ps[0] == "moon") {
+ std::vector<World> moons(_node->moons());
+ if (ps.size() == 1) {
+ // Return [array] of all moons
+
+ res = json::array();
+ for(std::vector<World>::const_iterator m(moons.begin());m!=moons.end();++m) {
+ json mj;
+ _moonToJson(mj,*m);
+ res.push_back(mj);
+ }
+
+ scode = 200;
+ } else {
+ // Return a single moon by ID
+
+ const uint64_t id = Utils::hexStrToU64(ps[1].c_str());
+ for(std::vector<World>::const_iterator m(moons.begin());m!=moons.end();++m) {
+ if (m->id() == id) {
+ _moonToJson(res,*m);
+ scode = 200;
+ break;
+ }
+ }
+
+ }
+ } else if (ps[0] == "network") {
+ ZT_VirtualNetworkList *nws = _node->networks();
+ if (nws) {
+ if (ps.size() == 1) {
+ // Return [array] of all networks
+
+ res = nlohmann::json::array();
+ for(unsigned long i=0;i<nws->networkCount;++i) {
+ OneService::NetworkSettings localSettings;
+ getNetworkSettings(nws->networks[i].nwid,localSettings);
+ nlohmann::json nj;
+ _networkToJson(nj,&(nws->networks[i]),portDeviceName(nws->networks[i].nwid),localSettings);
+ res.push_back(nj);
+ }
+
+ scode = 200;
+ } else if (ps.size() == 2) {
+ // Return a single network by ID or 404 if not found
+
+ const uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str());
+ for(unsigned long i=0;i<nws->networkCount;++i) {
+ if (nws->networks[i].nwid == wantnw) {
+ OneService::NetworkSettings localSettings;
+ getNetworkSettings(nws->networks[i].nwid,localSettings);
+ _networkToJson(res,&(nws->networks[i]),portDeviceName(nws->networks[i].nwid),localSettings);
+ scode = 200;
+ break;
+ }
+ }
+
+ } else scode = 404;
+ _node->freeQueryResult((void *)nws);
+ } else scode = 500;
+ } else if (ps[0] == "peer") {
+ ZT_PeerList *pl = _node->peers();
+ if (pl) {
+ if (ps.size() == 1) {
+ // Return [array] of all peers
+
+ res = nlohmann::json::array();
+ for(unsigned long i=0;i<pl->peerCount;++i) {
+ nlohmann::json pj;
+ _peerToJson(pj,&(pl->peers[i]));
+ res.push_back(pj);
+ }
+
+ scode = 200;
+ } else if (ps.size() == 2) {
+ // Return a single peer by ID or 404 if not found
+
+ uint64_t wantp = Utils::hexStrToU64(ps[1].c_str());
+ for(unsigned long i=0;i<pl->peerCount;++i) {
+ if (pl->peers[i].address == wantp) {
+ _peerToJson(res,&(pl->peers[i]));
+ scode = 200;
+ break;
+ }
+ }
+
+ } else scode = 404;
+ _node->freeQueryResult((void *)pl);
+ } else scode = 500;
+ } else {
+ if (_controller) {
+ scode = _controller->handleControlPlaneHttpGET(std::vector<std::string>(ps.begin()+1,ps.end()),urlArgs,headers,body,responseBody,responseContentType);
+ } else scode = 404;
+ }
+
+ } else scode = 401; // isAuth == false
+ } else if ((httpMethod == HTTP_POST)||(httpMethod == HTTP_PUT)) {
+ if (isAuth) {
+
+ if (ps[0] == "moon") {
+ if (ps.size() == 2) {
+
+ uint64_t seed = 0;
+ try {
+ json j(OSUtils::jsonParse(body));
+ if (j.is_object()) {
+ seed = Utils::hexStrToU64(OSUtils::jsonString(j["seed"],"0").c_str());
+ }
+ } catch ( ... ) {
+ // discard invalid JSON
+ }
+
+ std::vector<World> moons(_node->moons());
+ const uint64_t id = Utils::hexStrToU64(ps[1].c_str());
+ for(std::vector<World>::const_iterator m(moons.begin());m!=moons.end();++m) {
+ if (m->id() == id) {
+ _moonToJson(res,*m);
+ scode = 200;
+ break;
+ }
+ }
+
+ if ((scode != 200)&&(seed != 0)) {
+ char tmp[64];
+ Utils::snprintf(tmp,sizeof(tmp),"%.16llx",id);
+ res["id"] = tmp;
+ res["roots"] = json::array();
+ res["timestamp"] = 0;
+ res["signature"] = json();
+ res["updatesMustBeSignedBy"] = json();
+ res["waiting"] = true;
+ _node->orbit(id,seed);
+ scode = 200;
+ }
+
+ } else scode = 404;
+ } else if (ps[0] == "network") {
+ if (ps.size() == 2) {
+
+ uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str());
+ _node->join(wantnw,(void *)0); // does nothing if we are a member
+ ZT_VirtualNetworkList *nws = _node->networks();
+ if (nws) {
+ for(unsigned long i=0;i<nws->networkCount;++i) {
+ if (nws->networks[i].nwid == wantnw) {
+ OneService::NetworkSettings localSettings;
+ getNetworkSettings(nws->networks[i].nwid,localSettings);
+
+ try {
+ json j(OSUtils::jsonParse(body));
+ if (j.is_object()) {
+ json &allowManaged = j["allowManaged"];
+ if (allowManaged.is_boolean()) localSettings.allowManaged = (bool)allowManaged;
+ json &allowGlobal = j["allowGlobal"];
+ if (allowGlobal.is_boolean()) localSettings.allowGlobal = (bool)allowGlobal;
+ json &allowDefault = j["allowDefault"];
+ if (allowDefault.is_boolean()) localSettings.allowDefault = (bool)allowDefault;
+ }
+ } catch ( ... ) {
+ // discard invalid JSON
+ }
+
+ setNetworkSettings(nws->networks[i].nwid,localSettings);
+ _networkToJson(res,&(nws->networks[i]),portDeviceName(nws->networks[i].nwid),localSettings);
+
+ scode = 200;
+ break;
+ }
+ }
+ _node->freeQueryResult((void *)nws);
+ } else scode = 500;
+
+ } else scode = 404;
+ } else {
+ if (_controller)
+ scode = _controller->handleControlPlaneHttpPOST(std::vector<std::string>(ps.begin()+1,ps.end()),urlArgs,headers,body,responseBody,responseContentType);
+ else scode = 404;
+ }
+
+ } else scode = 401; // isAuth == false
+ } else if (httpMethod == HTTP_DELETE) {
+ if (isAuth) {
+
+ if (ps[0] == "moon") {
+ if (ps.size() == 2) {
+ _node->deorbit(Utils::hexStrToU64(ps[1].c_str()));
+ res["result"] = true;
+ scode = 200;
+ } // else 404
+ } else if (ps[0] == "network") {
+ ZT_VirtualNetworkList *nws = _node->networks();
+ if (nws) {
+ if (ps.size() == 2) {
+ uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str());
+ for(unsigned long i=0;i<nws->networkCount;++i) {
+ if (nws->networks[i].nwid == wantnw) {
+ _node->leave(wantnw,(void **)0);
+ res["result"] = true;
+ scode = 200;
+ break;
+ }
+ }
+ } // else 404
+ _node->freeQueryResult((void *)nws);
+ } else scode = 500;
+ } else {
+ if (_controller)
+ scode = _controller->handleControlPlaneHttpDELETE(std::vector<std::string>(ps.begin()+1,ps.end()),urlArgs,headers,body,responseBody,responseContentType);
+ else scode = 404;
+ }
+
+ } else scode = 401; // isAuth = false
+ } else {
+ scode = 400;
+ }
+
+ if (responseBody.length() == 0) {
+ if ((res.is_object())||(res.is_array()))
+ responseBody = OSUtils::jsonDump(res);
+ else responseBody = "{}";
+ responseContentType = "application/json";
+ }
+
+ // Wrap result in jsonp function call if the user included a jsonp= url argument.
+ // Also double-check isAuth since forbidding this without auth feels safer.
+ std::map<std::string,std::string>::const_iterator jsonp(urlArgs.find("jsonp"));
+ if ((isAuth)&&(jsonp != urlArgs.end())&&(responseContentType == "application/json")) {
+ if (responseBody.length() > 0)
+ responseBody = jsonp->second + "(" + responseBody + ");";
+ else responseBody = jsonp->second + "(null);";
+ responseContentType = "application/javascript";
+ }
+
+ return scode;
+ }
+
// Must be called after _localConfig is read or modified
void applyLocalConfig()
{
Mutex::Lock _l(_localConfig_m);
+ json lc(_localConfig);
_v4Hints.clear();
_v6Hints.clear();
_v4Blacklists.clear();
_v6Blacklists.clear();
- json &virt = _localConfig["virtual"];
+ json &virt = lc["virtual"];
if (virt.is_object()) {
for(json::iterator v(virt.begin());v!=virt.end();++v) {
const std::string nstr = v.key();
@@ -997,7 +1503,7 @@ public:
_globalV4Blacklist.clear();
_globalV6Blacklist.clear();
- json &physical = _localConfig["physical"];
+ json &physical = lc["physical"];
if (physical.is_object()) {
for(json::iterator phy(physical.begin());phy!=physical.end();++phy) {
const InetAddress net(OSUtils::jsonString(phy.key(),""));
@@ -1016,42 +1522,41 @@ public:
_allowManagementFrom.clear();
_interfacePrefixBlacklist.clear();
- json &settings = _localConfig["settings"];
- if (settings.is_object()) {
- _primaryPort = (unsigned int)OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff;
- _portMappingEnabled = OSUtils::jsonBool(settings["portMappingEnabled"],true);
+ json &settings = lc["settings"];
+
+ _primaryPort = (unsigned int)OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff;
+ _portMappingEnabled = OSUtils::jsonBool(settings["portMappingEnabled"],true);
/*
- const std::string up(OSUtils::jsonString(settings["softwareUpdate"],ZT_SOFTWARE_UPDATE_DEFAULT));
- const bool udist = OSUtils::jsonBool(settings["softwareUpdateDist"],false);
- if (((up == "apply")||(up == "download"))||(udist)) {
- if (!_updater)
- _updater = new SoftwareUpdater(*_node,_homePath);
- _updateAutoApply = (up == "apply");
- _updater->setUpdateDistribution(udist);
- _updater->setChannel(OSUtils::jsonString(settings["softwareUpdateChannel"],ZT_SOFTWARE_UPDATE_DEFAULT_CHANNEL));
- } else {
- delete _updater;
- _updater = (SoftwareUpdater *)0;
- _updateAutoApply = false;
- }
+ const std::string up(OSUtils::jsonString(settings["softwareUpdate"],ZT_SOFTWARE_UPDATE_DEFAULT));
+ const bool udist = OSUtils::jsonBool(settings["softwareUpdateDist"],false);
+ if (((up == "apply")||(up == "download"))||(udist)) {
+ if (!_updater)
+ _updater = new SoftwareUpdater(*_node,_homePath);
+ _updateAutoApply = (up == "apply");
+ _updater->setUpdateDistribution(udist);
+ _updater->setChannel(OSUtils::jsonString(settings["softwareUpdateChannel"],ZT_SOFTWARE_UPDATE_DEFAULT_CHANNEL));
+ } else {
+ delete _updater;
+ _updater = (SoftwareUpdater *)0;
+ _updateAutoApply = false;
+ }
*/
- json &ignoreIfs = settings["interfacePrefixBlacklist"];
- if (ignoreIfs.is_array()) {
- for(unsigned long i=0;i<ignoreIfs.size();++i) {
- const std::string tmp(OSUtils::jsonString(ignoreIfs[i],""));
- if (tmp.length() > 0)
- _interfacePrefixBlacklist.push_back(tmp);
- }
+ json &ignoreIfs = settings["interfacePrefixBlacklist"];
+ if (ignoreIfs.is_array()) {
+ for(unsigned long i=0;i<ignoreIfs.size();++i) {
+ const std::string tmp(OSUtils::jsonString(ignoreIfs[i],""));
+ if (tmp.length() > 0)
+ _interfacePrefixBlacklist.push_back(tmp);
}
+ }
- json &amf = settings["allowManagementFrom"];
- if (amf.is_array()) {
- for(unsigned long i=0;i<amf.size();++i) {
- const InetAddress nw(OSUtils::jsonString(amf[i],""));
- if (nw)
- _allowManagementFrom.push_back(nw);
- }
+ json &amf = settings["allowManagementFrom"];
+ if (amf.is_array()) {
+ for(unsigned long i=0;i<amf.size();++i) {
+ const InetAddress nw(OSUtils::jsonString(amf[i],""));
+ if (nw)
+ _allowManagementFrom.push_back(nw);
}
}
}
@@ -1202,7 +1707,9 @@ public:
}
}
- // Handlers for Node and Phy<> callbacks -----------------------------------
+ // =========================================================================
+ // Handlers for Node and Phy<> callbacks
+ // =========================================================================
inline void phyOnDatagram(PhySocket *sock,void **uptr,const struct sockaddr *localAddr,const struct sockaddr *from,void *data,unsigned long len)
{
@@ -1812,9 +2319,7 @@ public:
if (allow) {
try {
- if (_controlPlane)
- scode = _controlPlane->handleRequest(tc->from,tc->parser.method,tc->url,tc->headers,tc->body,data,contentType);
- else scode = 500;
+ scode = handleControlPlaneHttpRequest(tc->from,tc->parser.method,tc->url,tc->headers,tc->body,data,contentType);
} catch (std::exception &exc) {
fprintf(stderr,"WARNING: unexpected exception processing control HTTP request: %s" ZT_EOL_S,exc.what());
scode = 500;
diff --git a/zerotierone/service/OneService.hpp b/zto/service/OneService.hpp
index 6689932..37d8295 100644
--- a/zerotierone/service/OneService.hpp
+++ b/zto/service/OneService.hpp
@@ -23,7 +23,6 @@
#include <vector>
#include "../node/InetAddress.hpp"
-
#include "../node/Node.hpp"
// Include the right tap device driver for this platform -- add new platforms here
@@ -141,11 +140,6 @@ public:
virtual std::string portDeviceName(uint64_t nwid) const = 0;
/**
- * @return True if TCP fallback is currently active
- */
- virtual bool tcpFallbackActive() const = 0;
-
- /**
* Terminate background service (can be called from other threads)
*/
virtual void terminate() = 0;
@@ -177,7 +171,7 @@ public:
*/
virtual Node * getNode() = 0;
#endif
-
+
/**
* Get local settings for a network
*
diff --git a/zerotierone/service/README.md b/zto/service/README.md
index bdf713c..bdf713c 100644
--- a/zerotierone/service/README.md
+++ b/zto/service/README.md
diff --git a/zerotierone/service/SoftwareUpdater.cpp b/zto/service/SoftwareUpdater.cpp
index c1d77f9..c1d77f9 100644
--- a/zerotierone/service/SoftwareUpdater.cpp
+++ b/zto/service/SoftwareUpdater.cpp
diff --git a/zerotierone/service/SoftwareUpdater.hpp b/zto/service/SoftwareUpdater.hpp
index e6e6b0c..8950782 100644
--- a/zerotierone/service/SoftwareUpdater.hpp
+++ b/zto/service/SoftwareUpdater.hpp
@@ -64,8 +64,7 @@
/**
* How often (ms) do we check?
*/
-//#define ZT_SOFTWARE_UPDATE_CHECK_PERIOD (60 * 60 * 1000)
-#define ZT_SOFTWARE_UPDATE_CHECK_PERIOD 5000
+#define ZT_SOFTWARE_UPDATE_CHECK_PERIOD (60 * 10 * 1000)
/**
* Default update channel
@@ -82,21 +81,21 @@
*/
#define ZT_SOFTWARE_UPDATE_BIN_FILENAME "latest-update.exe"
-#define ZT_SOFTWARE_UPDATE_JSON_VERSION_MAJOR "versionMajor"
-#define ZT_SOFTWARE_UPDATE_JSON_VERSION_MINOR "versionMinor"
-#define ZT_SOFTWARE_UPDATE_JSON_VERSION_REVISION "versionRev"
-#define ZT_SOFTWARE_UPDATE_JSON_VERSION_BUILD "versionBuild"
+#define ZT_SOFTWARE_UPDATE_JSON_VERSION_MAJOR "vMajor"
+#define ZT_SOFTWARE_UPDATE_JSON_VERSION_MINOR "vMinor"
+#define ZT_SOFTWARE_UPDATE_JSON_VERSION_REVISION "vRev"
+#define ZT_SOFTWARE_UPDATE_JSON_VERSION_BUILD "vBuild"
#define ZT_SOFTWARE_UPDATE_JSON_PLATFORM "platform"
#define ZT_SOFTWARE_UPDATE_JSON_ARCHITECTURE "arch"
#define ZT_SOFTWARE_UPDATE_JSON_VENDOR "vendor"
#define ZT_SOFTWARE_UPDATE_JSON_CHANNEL "channel"
#define ZT_SOFTWARE_UPDATE_JSON_EXPECT_SIGNED_BY "expectedSigner"
-#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIGNED_BY "updateSigner"
-#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIGNATURE "updateSig"
-#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_HASH "updateHash"
-#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIZE "updateSize"
-#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_EXEC_ARGS "updateExecArgs"
-#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_URL "updateUrl"
+#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIGNED_BY "signer"
+#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIGNATURE "signature"
+#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_HASH "hash"
+#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_SIZE "size"
+#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_EXEC_ARGS "execArgs"
+#define ZT_SOFTWARE_UPDATE_JSON_UPDATE_URL "url"
namespace ZeroTier {
diff --git a/zerotierone/tcp-proxy/Makefile b/zto/tcp-proxy/Makefile
index af4e71e..af4e71e 100644
--- a/zerotierone/tcp-proxy/Makefile
+++ b/zto/tcp-proxy/Makefile
diff --git a/zerotierone/tcp-proxy/README.md b/zto/tcp-proxy/README.md
index 6f347d6..6f347d6 100644
--- a/zerotierone/tcp-proxy/README.md
+++ b/zto/tcp-proxy/README.md
diff --git a/zerotierone/tcp-proxy/tcp-proxy.cpp b/zto/tcp-proxy/tcp-proxy.cpp
index a7906aa..a7906aa 100644
--- a/zerotierone/tcp-proxy/tcp-proxy.cpp
+++ b/zto/tcp-proxy/tcp-proxy.cpp
diff --git a/zerotierone/version.h b/zto/version.h
index 9f61666..b83cab0 100644
--- a/zerotierone/version.h
+++ b/zto/version.h
@@ -27,12 +27,12 @@
/**
* Minor version
*/
-#define ZEROTIER_ONE_VERSION_MINOR 1
+#define ZEROTIER_ONE_VERSION_MINOR 2
/**
* Revision
*/
-#define ZEROTIER_ONE_VERSION_REVISION 17
+#define ZEROTIER_ONE_VERSION_REVISION 0
/**
* Build version
diff --git a/zerotierone/windows/README.md b/zto/windows/README.md
index 9f3f48b..9f3f48b 100644
--- a/zerotierone/windows/README.md
+++ b/zto/windows/README.md
diff --git a/zerotierone/windows/TapDriver6/TapDriver6.vcxproj b/zto/windows/TapDriver6/TapDriver6.vcxproj
index cf6b150..cf6b150 100644
--- a/zerotierone/windows/TapDriver6/TapDriver6.vcxproj
+++ b/zto/windows/TapDriver6/TapDriver6.vcxproj
diff --git a/zerotierone/windows/TapDriver6/TapDriver6.vcxproj.filters b/zto/windows/TapDriver6/TapDriver6.vcxproj.filters
index 14cbbde..14cbbde 100644
--- a/zerotierone/windows/TapDriver6/TapDriver6.vcxproj.filters
+++ b/zto/windows/TapDriver6/TapDriver6.vcxproj.filters
diff --git a/zerotierone/windows/TapDriver6/adapter.c b/zto/windows/TapDriver6/adapter.c
index 7ce4b31..7ce4b31 100644
--- a/zerotierone/windows/TapDriver6/adapter.c
+++ b/zto/windows/TapDriver6/adapter.c
diff --git a/zerotierone/windows/TapDriver6/adapter.h b/zto/windows/TapDriver6/adapter.h
index 0ebaaea..0ebaaea 100644
--- a/zerotierone/windows/TapDriver6/adapter.h
+++ b/zto/windows/TapDriver6/adapter.h
diff --git a/zerotierone/windows/TapDriver6/config.h b/zto/windows/TapDriver6/config.h
index 4d36c5a..4d36c5a 100644
--- a/zerotierone/windows/TapDriver6/config.h
+++ b/zto/windows/TapDriver6/config.h
diff --git a/zerotierone/windows/TapDriver6/constants.h b/zto/windows/TapDriver6/constants.h
index 91a876f..91a876f 100644
--- a/zerotierone/windows/TapDriver6/constants.h
+++ b/zto/windows/TapDriver6/constants.h
diff --git a/zerotierone/windows/TapDriver6/device.c b/zto/windows/TapDriver6/device.c
index 7367143..7367143 100644
--- a/zerotierone/windows/TapDriver6/device.c
+++ b/zto/windows/TapDriver6/device.c
diff --git a/zerotierone/windows/TapDriver6/device.h b/zto/windows/TapDriver6/device.h
index 93dae0d..93dae0d 100644
--- a/zerotierone/windows/TapDriver6/device.h
+++ b/zto/windows/TapDriver6/device.h
diff --git a/zerotierone/windows/TapDriver6/endian.h b/zto/windows/TapDriver6/endian.h
index b7d3449..b7d3449 100644
--- a/zerotierone/windows/TapDriver6/endian.h
+++ b/zto/windows/TapDriver6/endian.h
diff --git a/zerotierone/windows/TapDriver6/error.c b/zto/windows/TapDriver6/error.c
index 1fad1d3..1fad1d3 100644
--- a/zerotierone/windows/TapDriver6/error.c
+++ b/zto/windows/TapDriver6/error.c
diff --git a/zerotierone/windows/TapDriver6/error.h b/zto/windows/TapDriver6/error.h
index 2ba39cc..2ba39cc 100644
--- a/zerotierone/windows/TapDriver6/error.h
+++ b/zto/windows/TapDriver6/error.h
diff --git a/zerotierone/windows/TapDriver6/hexdump.h b/zto/windows/TapDriver6/hexdump.h
index d6275c1..d6275c1 100644
--- a/zerotierone/windows/TapDriver6/hexdump.h
+++ b/zto/windows/TapDriver6/hexdump.h
diff --git a/zerotierone/windows/TapDriver6/lock.h b/zto/windows/TapDriver6/lock.h
index c80b164..c80b164 100644
--- a/zerotierone/windows/TapDriver6/lock.h
+++ b/zto/windows/TapDriver6/lock.h
diff --git a/zerotierone/windows/TapDriver6/macinfo.c b/zto/windows/TapDriver6/macinfo.c
index dfd0a07..dfd0a07 100644
--- a/zerotierone/windows/TapDriver6/macinfo.c
+++ b/zto/windows/TapDriver6/macinfo.c
diff --git a/zerotierone/windows/TapDriver6/macinfo.h b/zto/windows/TapDriver6/macinfo.h
index dd88b6f..dd88b6f 100644
--- a/zerotierone/windows/TapDriver6/macinfo.h
+++ b/zto/windows/TapDriver6/macinfo.h
diff --git a/zerotierone/windows/TapDriver6/mem.c b/zto/windows/TapDriver6/mem.c
index ae2e3d4..ae2e3d4 100644
--- a/zerotierone/windows/TapDriver6/mem.c
+++ b/zto/windows/TapDriver6/mem.c
diff --git a/zerotierone/windows/TapDriver6/mem.h b/zto/windows/TapDriver6/mem.h
index a8359e1..a8359e1 100644
--- a/zerotierone/windows/TapDriver6/mem.h
+++ b/zto/windows/TapDriver6/mem.h
diff --git a/zerotierone/windows/TapDriver6/oidrequest.c b/zto/windows/TapDriver6/oidrequest.c
index a6882f8..a6882f8 100644
--- a/zerotierone/windows/TapDriver6/oidrequest.c
+++ b/zto/windows/TapDriver6/oidrequest.c
diff --git a/zerotierone/windows/TapDriver6/proto.h b/zto/windows/TapDriver6/proto.h
index cc23de6..cc23de6 100644
--- a/zerotierone/windows/TapDriver6/proto.h
+++ b/zto/windows/TapDriver6/proto.h
diff --git a/zerotierone/windows/TapDriver6/prototypes.h b/zto/windows/TapDriver6/prototypes.h
index a48d35e..a48d35e 100644
--- a/zerotierone/windows/TapDriver6/prototypes.h
+++ b/zto/windows/TapDriver6/prototypes.h
diff --git a/zerotierone/windows/TapDriver6/resource.h b/zto/windows/TapDriver6/resource.h
index e736408..e736408 100644
--- a/zerotierone/windows/TapDriver6/resource.h
+++ b/zto/windows/TapDriver6/resource.h
diff --git a/zerotierone/windows/TapDriver6/resource.rc b/zto/windows/TapDriver6/resource.rc
index 2b65e2b..2b65e2b 100644
--- a/zerotierone/windows/TapDriver6/resource.rc
+++ b/zto/windows/TapDriver6/resource.rc
diff --git a/zerotierone/windows/TapDriver6/rxpath.c b/zto/windows/TapDriver6/rxpath.c
index 318bc56..318bc56 100644
--- a/zerotierone/windows/TapDriver6/rxpath.c
+++ b/zto/windows/TapDriver6/rxpath.c
diff --git a/zerotierone/windows/TapDriver6/tap-windows.h b/zto/windows/TapDriver6/tap-windows.h
index fd41a79..fd41a79 100644
--- a/zerotierone/windows/TapDriver6/tap-windows.h
+++ b/zto/windows/TapDriver6/tap-windows.h
diff --git a/zerotierone/windows/TapDriver6/tap.h b/zto/windows/TapDriver6/tap.h
index 079b279..079b279 100644
--- a/zerotierone/windows/TapDriver6/tap.h
+++ b/zto/windows/TapDriver6/tap.h
diff --git a/zerotierone/windows/TapDriver6/tapdrvr.c b/zto/windows/TapDriver6/tapdrvr.c
index 6c537f1..6c537f1 100644
--- a/zerotierone/windows/TapDriver6/tapdrvr.c
+++ b/zto/windows/TapDriver6/tapdrvr.c
diff --git a/zerotierone/windows/TapDriver6/txpath.c b/zto/windows/TapDriver6/txpath.c
index 7993ca4..7993ca4 100644
--- a/zerotierone/windows/TapDriver6/txpath.c
+++ b/zto/windows/TapDriver6/txpath.c
diff --git a/zerotierone/windows/TapDriver6/types.h b/zto/windows/TapDriver6/types.h
index acea175..acea175 100644
--- a/zerotierone/windows/TapDriver6/types.h
+++ b/zto/windows/TapDriver6/types.h
diff --git a/zerotierone/windows/TapDriver6/zttap300.inf b/zto/windows/TapDriver6/zttap300.inf
index f901b13..f901b13 100644
--- a/zerotierone/windows/TapDriver6/zttap300.inf
+++ b/zto/windows/TapDriver6/zttap300.inf
diff --git a/zerotierone/windows/WinUI/APIHandler.cs b/zto/windows/WinUI/APIHandler.cs
index a762fff..81c5b77 100644
--- a/zerotierone/windows/WinUI/APIHandler.cs
+++ b/zto/windows/WinUI/APIHandler.cs
@@ -230,16 +230,23 @@ namespace WinUI
request.Method = "POST";
request.ContentType = "applicaiton/json";
request.Timeout = 10000;
-
- using (var streamWriter = new StreamWriter(((HttpWebRequest)request).GetRequestStream()))
- {
- string json = "{\"allowManaged\":" + (allowManaged ? "true" : "false") + "," +
- "\"allowGlobal\":" + (allowGlobal ? "true" : "false") + "," +
- "\"allowDefault\":" + (allowDefault ? "true" : "false") + "}";
- streamWriter.Write(json);
- streamWriter.Flush();
- streamWriter.Close();
- }
+ try
+ {
+ using (var streamWriter = new StreamWriter(((HttpWebRequest)request).GetRequestStream()))
+ {
+ string json = "{\"allowManaged\":" + (allowManaged ? "true" : "false") + "," +
+ "\"allowGlobal\":" + (allowGlobal ? "true" : "false") + "," +
+ "\"allowDefault\":" + (allowDefault ? "true" : "false") + "}";
+ streamWriter.Write(json);
+ streamWriter.Flush();
+ streamWriter.Close();
+ }
+ }
+ catch (System.Net.WebException)
+ {
+ MessageBox.Show("Error Joining Network: Cannot connect to ZeroTier service.");
+ return;
+ }
try
{
diff --git a/zerotierone/windows/WinUI/AboutView.xaml b/zto/windows/WinUI/AboutView.xaml
index 5def46a..5def46a 100644
--- a/zerotierone/windows/WinUI/AboutView.xaml
+++ b/zto/windows/WinUI/AboutView.xaml
diff --git a/zerotierone/windows/WinUI/AboutView.xaml.cs b/zto/windows/WinUI/AboutView.xaml.cs
index 9c48493..9c48493 100644
--- a/zerotierone/windows/WinUI/AboutView.xaml.cs
+++ b/zto/windows/WinUI/AboutView.xaml.cs
diff --git a/zerotierone/windows/WinUI/App.config b/zto/windows/WinUI/App.config
index 8e15646..8e15646 100644
--- a/zerotierone/windows/WinUI/App.config
+++ b/zto/windows/WinUI/App.config
diff --git a/zerotierone/windows/WinUI/App.xaml b/zto/windows/WinUI/App.xaml
index 12ed85f..12ed85f 100644
--- a/zerotierone/windows/WinUI/App.xaml
+++ b/zto/windows/WinUI/App.xaml
diff --git a/zerotierone/windows/WinUI/App.xaml.cs b/zto/windows/WinUI/App.xaml.cs
index 53ef2f6..53ef2f6 100644
--- a/zerotierone/windows/WinUI/App.xaml.cs
+++ b/zto/windows/WinUI/App.xaml.cs
diff --git a/zerotierone/windows/WinUI/JoinNetworkView.xaml b/zto/windows/WinUI/JoinNetworkView.xaml
index 1cd1e98..1cd1e98 100644
--- a/zerotierone/windows/WinUI/JoinNetworkView.xaml
+++ b/zto/windows/WinUI/JoinNetworkView.xaml
diff --git a/zerotierone/windows/WinUI/JoinNetworkView.xaml.cs b/zto/windows/WinUI/JoinNetworkView.xaml.cs
index 548a51e..548a51e 100644
--- a/zerotierone/windows/WinUI/JoinNetworkView.xaml.cs
+++ b/zto/windows/WinUI/JoinNetworkView.xaml.cs
diff --git a/zerotierone/windows/WinUI/MainWindow.xaml.cs b/zto/windows/WinUI/MainWindow.xaml.cs
index e4a82f9..e4a82f9 100644
--- a/zerotierone/windows/WinUI/MainWindow.xaml.cs
+++ b/zto/windows/WinUI/MainWindow.xaml.cs
diff --git a/zerotierone/windows/WinUI/NetworkInfoView.xaml b/zto/windows/WinUI/NetworkInfoView.xaml
index 6b32569..6b32569 100644
--- a/zerotierone/windows/WinUI/NetworkInfoView.xaml
+++ b/zto/windows/WinUI/NetworkInfoView.xaml
diff --git a/zerotierone/windows/WinUI/NetworkInfoView.xaml.cs b/zto/windows/WinUI/NetworkInfoView.xaml.cs
index 1f99a1f..1f99a1f 100644
--- a/zerotierone/windows/WinUI/NetworkInfoView.xaml.cs
+++ b/zto/windows/WinUI/NetworkInfoView.xaml.cs
diff --git a/zerotierone/windows/WinUI/NetworkListView.xaml b/zto/windows/WinUI/NetworkListView.xaml
index 1dc774b..1dc774b 100644
--- a/zerotierone/windows/WinUI/NetworkListView.xaml
+++ b/zto/windows/WinUI/NetworkListView.xaml
diff --git a/zerotierone/windows/WinUI/NetworkListView.xaml.cs b/zto/windows/WinUI/NetworkListView.xaml.cs
index 26c4025..26c4025 100644
--- a/zerotierone/windows/WinUI/NetworkListView.xaml.cs
+++ b/zto/windows/WinUI/NetworkListView.xaml.cs
diff --git a/zerotierone/windows/WinUI/NetworkMonitor.cs b/zto/windows/WinUI/NetworkMonitor.cs
index 4877d34..c276079 100644
--- a/zerotierone/windows/WinUI/NetworkMonitor.cs
+++ b/zto/windows/WinUI/NetworkMonitor.cs
@@ -102,6 +102,11 @@ namespace WinUI
private void apiNetworkCallback(List<ZeroTierNetwork> networks)
{
+ if (networks == null)
+ {
+ return;
+ }
+
lock (_knownNetworks)
{
_knownNetworks = _knownNetworks.Union(networks, new NetworkEqualityComparer()).ToList();
diff --git a/zerotierone/windows/WinUI/NetworkRoute.cs b/zto/windows/WinUI/NetworkRoute.cs
index ce26ef7..ce26ef7 100644
--- a/zerotierone/windows/WinUI/NetworkRoute.cs
+++ b/zto/windows/WinUI/NetworkRoute.cs
diff --git a/zerotierone/windows/WinUI/NetworksPage.xaml b/zto/windows/WinUI/NetworksPage.xaml
index 6f95bc0..6f95bc0 100644
--- a/zerotierone/windows/WinUI/NetworksPage.xaml
+++ b/zto/windows/WinUI/NetworksPage.xaml
diff --git a/zerotierone/windows/WinUI/NetworksPage.xaml.cs b/zto/windows/WinUI/NetworksPage.xaml.cs
index 39a2fef..39a2fef 100644
--- a/zerotierone/windows/WinUI/NetworksPage.xaml.cs
+++ b/zto/windows/WinUI/NetworksPage.xaml.cs
diff --git a/zerotierone/windows/WinUI/PeersPage.xaml b/zto/windows/WinUI/PeersPage.xaml
index 57b11ed..57b11ed 100644
--- a/zerotierone/windows/WinUI/PeersPage.xaml
+++ b/zto/windows/WinUI/PeersPage.xaml
diff --git a/zerotierone/windows/WinUI/PeersPage.xaml.cs b/zto/windows/WinUI/PeersPage.xaml.cs
index fac22a4..fac22a4 100644
--- a/zerotierone/windows/WinUI/PeersPage.xaml.cs
+++ b/zto/windows/WinUI/PeersPage.xaml.cs
diff --git a/zerotierone/windows/WinUI/PreferencesView.xaml b/zto/windows/WinUI/PreferencesView.xaml
index ac61fff..ac61fff 100644
--- a/zerotierone/windows/WinUI/PreferencesView.xaml
+++ b/zto/windows/WinUI/PreferencesView.xaml
diff --git a/zerotierone/windows/WinUI/PreferencesView.xaml.cs b/zto/windows/WinUI/PreferencesView.xaml.cs
index c6733be..c6733be 100644
--- a/zerotierone/windows/WinUI/PreferencesView.xaml.cs
+++ b/zto/windows/WinUI/PreferencesView.xaml.cs
diff --git a/zerotierone/windows/WinUI/Properties/AssemblyInfo.cs b/zto/windows/WinUI/Properties/AssemblyInfo.cs
index 9c7cd13..9c7cd13 100644
--- a/zerotierone/windows/WinUI/Properties/AssemblyInfo.cs
+++ b/zto/windows/WinUI/Properties/AssemblyInfo.cs
diff --git a/zerotierone/windows/WinUI/Properties/Resources.Designer.cs b/zto/windows/WinUI/Properties/Resources.Designer.cs
index 3e5c78a..3e5c78a 100644
--- a/zerotierone/windows/WinUI/Properties/Resources.Designer.cs
+++ b/zto/windows/WinUI/Properties/Resources.Designer.cs
diff --git a/zerotierone/windows/WinUI/Properties/Resources.resx b/zto/windows/WinUI/Properties/Resources.resx
index 0872fce..0872fce 100644
--- a/zerotierone/windows/WinUI/Properties/Resources.resx
+++ b/zto/windows/WinUI/Properties/Resources.resx
diff --git a/zerotierone/windows/WinUI/Properties/Settings.Designer.cs b/zto/windows/WinUI/Properties/Settings.Designer.cs
index 6812ccc..6812ccc 100644
--- a/zerotierone/windows/WinUI/Properties/Settings.Designer.cs
+++ b/zto/windows/WinUI/Properties/Settings.Designer.cs
diff --git a/zerotierone/windows/WinUI/Properties/Settings.settings b/zto/windows/WinUI/Properties/Settings.settings
index 033d7a5..033d7a5 100644
--- a/zerotierone/windows/WinUI/Properties/Settings.settings
+++ b/zto/windows/WinUI/Properties/Settings.settings
diff --git a/zerotierone/windows/WinUI/Resources/ZeroTierIcon.ico b/zto/windows/WinUI/Resources/ZeroTierIcon.ico
index 5d06b9f..5d06b9f 100644
--- a/zerotierone/windows/WinUI/Resources/ZeroTierIcon.ico
+++ b/zto/windows/WinUI/Resources/ZeroTierIcon.ico
Binary files differ
diff --git a/zerotierone/windows/WinUI/Simple Styles.xaml b/zto/windows/WinUI/Simple Styles.xaml
index a03348b..a03348b 100644
--- a/zerotierone/windows/WinUI/Simple Styles.xaml
+++ b/zto/windows/WinUI/Simple Styles.xaml
diff --git a/zerotierone/windows/WinUI/Themes/Generic.xaml b/zto/windows/WinUI/Themes/Generic.xaml
index 2b47588..2b47588 100644
--- a/zerotierone/windows/WinUI/Themes/Generic.xaml
+++ b/zto/windows/WinUI/Themes/Generic.xaml
diff --git a/zerotierone/windows/WinUI/ToolbarItem.xaml b/zto/windows/WinUI/ToolbarItem.xaml
index 3b064fc..3b064fc 100644
--- a/zerotierone/windows/WinUI/ToolbarItem.xaml
+++ b/zto/windows/WinUI/ToolbarItem.xaml
diff --git a/zerotierone/windows/WinUI/ToolbarItem.xaml.cs b/zto/windows/WinUI/ToolbarItem.xaml.cs
index 29791a4..29791a4 100644
--- a/zerotierone/windows/WinUI/ToolbarItem.xaml.cs
+++ b/zto/windows/WinUI/ToolbarItem.xaml.cs
diff --git a/zerotierone/windows/WinUI/WinUI.csproj b/zto/windows/WinUI/WinUI.csproj
index 6b8013e..6b8013e 100644
--- a/zerotierone/windows/WinUI/WinUI.csproj
+++ b/zto/windows/WinUI/WinUI.csproj
diff --git a/zerotierone/windows/WinUI/ZeroTierIcon.ico b/zto/windows/WinUI/ZeroTierIcon.ico
index 2d190c4..2d190c4 100644
--- a/zerotierone/windows/WinUI/ZeroTierIcon.ico
+++ b/zto/windows/WinUI/ZeroTierIcon.ico
Binary files differ
diff --git a/zerotierone/windows/WinUI/ZeroTierNetwork.cs b/zto/windows/WinUI/ZeroTierNetwork.cs
index d680238..d680238 100644
--- a/zerotierone/windows/WinUI/ZeroTierNetwork.cs
+++ b/zto/windows/WinUI/ZeroTierNetwork.cs
diff --git a/zerotierone/windows/WinUI/ZeroTierPeer.cs b/zto/windows/WinUI/ZeroTierPeer.cs
index 1597cf2..1597cf2 100644
--- a/zerotierone/windows/WinUI/ZeroTierPeer.cs
+++ b/zto/windows/WinUI/ZeroTierPeer.cs
diff --git a/zerotierone/windows/WinUI/ZeroTierPeerPhysicalPath.cs b/zto/windows/WinUI/ZeroTierPeerPhysicalPath.cs
index 3eaa802..3eaa802 100644
--- a/zerotierone/windows/WinUI/ZeroTierPeerPhysicalPath.cs
+++ b/zto/windows/WinUI/ZeroTierPeerPhysicalPath.cs
diff --git a/zerotierone/windows/WinUI/ZeroTierStatus.cs b/zto/windows/WinUI/ZeroTierStatus.cs
index 2851d01..2851d01 100644
--- a/zerotierone/windows/WinUI/ZeroTierStatus.cs
+++ b/zto/windows/WinUI/ZeroTierStatus.cs
diff --git a/zerotierone/windows/WinUI/app.manifest b/zto/windows/WinUI/app.manifest
index b537bf4..b537bf4 100644
--- a/zerotierone/windows/WinUI/app.manifest
+++ b/zto/windows/WinUI/app.manifest
diff --git a/zerotierone/windows/WinUI/packages.config b/zto/windows/WinUI/packages.config
index e6803f8..e6803f8 100644
--- a/zerotierone/windows/WinUI/packages.config
+++ b/zto/windows/WinUI/packages.config
diff --git a/zerotierone/windows/ZeroTierOne.sln b/zto/windows/ZeroTierOne.sln
index a136dd0..9baadd8 100644
--- a/zerotierone/windows/ZeroTierOne.sln
+++ b/zto/windows/ZeroTierOne.sln
@@ -20,57 +20,46 @@ Global
CD_ROM|Mixed Platforms = CD_ROM|Mixed Platforms
CD_ROM|Win32 = CD_ROM|Win32
CD_ROM|x64 = CD_ROM|x64
- CD_ROM|x86 = CD_ROM|x86
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
DVD-5|Any CPU = DVD-5|Any CPU
DVD-5|Mixed Platforms = DVD-5|Mixed Platforms
DVD-5|Win32 = DVD-5|Win32
DVD-5|x64 = DVD-5|x64
- DVD-5|x86 = DVD-5|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
- Release|x86 = Release|x86
SingleImage|Any CPU = SingleImage|Any CPU
SingleImage|Mixed Platforms = SingleImage|Mixed Platforms
SingleImage|Win32 = SingleImage|Win32
SingleImage|x64 = SingleImage|x64
- SingleImage|x86 = SingleImage|x86
Vista Debug|Any CPU = Vista Debug|Any CPU
Vista Debug|Mixed Platforms = Vista Debug|Mixed Platforms
Vista Debug|Win32 = Vista Debug|Win32
Vista Debug|x64 = Vista Debug|x64
- Vista Debug|x86 = Vista Debug|x86
Vista Release|Any CPU = Vista Release|Any CPU
Vista Release|Mixed Platforms = Vista Release|Mixed Platforms
Vista Release|Win32 = Vista Release|Win32
Vista Release|x64 = Vista Release|x64
- Vista Release|x86 = Vista Release|x86
Win7 Debug|Any CPU = Win7 Debug|Any CPU
Win7 Debug|Mixed Platforms = Win7 Debug|Mixed Platforms
Win7 Debug|Win32 = Win7 Debug|Win32
Win7 Debug|x64 = Win7 Debug|x64
- Win7 Debug|x86 = Win7 Debug|x86
Win7 Release|Any CPU = Win7 Release|Any CPU
Win7 Release|Mixed Platforms = Win7 Release|Mixed Platforms
Win7 Release|Win32 = Win7 Release|Win32
Win7 Release|x64 = Win7 Release|x64
- Win7 Release|x86 = Win7 Release|x86
Win8 Debug|Any CPU = Win8 Debug|Any CPU
Win8 Debug|Mixed Platforms = Win8 Debug|Mixed Platforms
Win8 Debug|Win32 = Win8 Debug|Win32
Win8 Debug|x64 = Win8 Debug|x64
- Win8 Debug|x86 = Win8 Debug|x86
Win8 Release|Any CPU = Win8 Release|Any CPU
Win8 Release|Mixed Platforms = Win8 Release|Mixed Platforms
Win8 Release|Win32 = Win8 Release|Win32
Win8 Release|x64 = Win8 Release|x64
- Win8 Release|x86 = Win8 Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.CD_ROM|Any CPU.ActiveCfg = Release|Win32
@@ -83,9 +72,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.CD_ROM|x64.ActiveCfg = Release|x64
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.CD_ROM|x64.Build.0 = Release|x64
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.CD_ROM|x64.Deploy.0 = Release|x64
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.CD_ROM|x86.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.CD_ROM|x86.Build.0 = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.CD_ROM|x86.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -95,9 +81,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Win32.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|x64.ActiveCfg = Debug|x64
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|x64.Build.0 = Debug|x64
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|x86.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|x86.Build.0 = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|x86.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|Any CPU.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|Mixed Platforms.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|Mixed Platforms.Build.0 = Debug|Win32
@@ -108,9 +91,6 @@ 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}.DVD-5|x86.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|x86.Build.0 = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.DVD-5|x86.Deploy.0 = Debug|Win32
{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
@@ -119,9 +99,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Win32.Build.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Win32.Deploy.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|x64.ActiveCfg = Release|x64
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|x86.ActiveCfg = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|x86.Build.0 = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|x86.Deploy.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|Any CPU.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|Mixed Platforms.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|Mixed Platforms.Build.0 = Release|Win32
@@ -132,9 +109,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|x64.ActiveCfg = Release|x64
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|x64.Build.0 = Release|x64
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|x64.Deploy.0 = Release|x64
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|x86.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|x86.Build.0 = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.SingleImage|x86.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|Any CPU.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -143,9 +117,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|Win32.Build.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|Win32.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|x64.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|x86.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|x86.Build.0 = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Debug|x86.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|Any CPU.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|Mixed Platforms.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|Mixed Platforms.Build.0 = Release|Win32
@@ -154,9 +125,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|Win32.Build.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|Win32.Deploy.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|x64.ActiveCfg = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|x86.ActiveCfg = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|x86.Build.0 = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Vista Release|x86.Deploy.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|Any CPU.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -166,9 +134,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Debug|Win32.Deploy.0 = 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
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|Any CPU.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|Mixed Platforms.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win7 Release|Mixed Platforms.Build.0 = Release|Win32
@@ -178,9 +143,6 @@ Global
{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
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|Any CPU.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -189,9 +151,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|Win32.Build.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|Win32.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|x64.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|x86.ActiveCfg = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|x86.Build.0 = Debug|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Debug|x86.Deploy.0 = Debug|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|Any CPU.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|Mixed Platforms.ActiveCfg = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|Mixed Platforms.Build.0 = Release|Win32
@@ -200,9 +159,6 @@ Global
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|Win32.Build.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|Win32.Deploy.0 = Release|Win32
{B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|x64.ActiveCfg = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|x86.ActiveCfg = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|x86.Build.0 = Release|Win32
- {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Win8 Release|x86.Deploy.0 = Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|Any CPU.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|Mixed Platforms.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|Mixed Platforms.Build.0 = Win8 Release|Win32
@@ -213,9 +169,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|x64.ActiveCfg = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|x64.Build.0 = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|x64.Deploy.0 = Win8 Release|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|x86.ActiveCfg = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|x86.Build.0 = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.CD_ROM|x86.Deploy.0 = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|Any CPU.ActiveCfg = Win7 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|Mixed Platforms.ActiveCfg = Win7 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|Mixed Platforms.Build.0 = Win7 Debug|Win32
@@ -226,9 +179,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|x64.ActiveCfg = Win7 Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|x64.Build.0 = Win7 Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|x64.Deploy.0 = Win7 Debug|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|x86.ActiveCfg = Win7 Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|x86.Build.0 = Win7 Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Debug|x86.Deploy.0 = Win7 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|Any CPU.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|Mixed Platforms.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|Mixed Platforms.Build.0 = Win8 Release|Win32
@@ -239,9 +189,6 @@ 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}.DVD-5|x86.ActiveCfg = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|x86.Build.0 = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.DVD-5|x86.Deploy.0 = Win8 Release|Win32
{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
@@ -252,9 +199,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|x64.ActiveCfg = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|x64.Build.0 = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|x64.Deploy.0 = Win8 Release|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|x86.ActiveCfg = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|x86.Build.0 = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|x86.Deploy.0 = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|Any CPU.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|Mixed Platforms.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|Mixed Platforms.Build.0 = Win8 Release|Win32
@@ -265,9 +209,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|x64.ActiveCfg = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|x64.Build.0 = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|x64.Deploy.0 = Win8 Release|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|x86.ActiveCfg = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|x86.Build.0 = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.SingleImage|x86.Deploy.0 = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|Any CPU.ActiveCfg = Vista Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|Mixed Platforms.ActiveCfg = Vista Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|Mixed Platforms.Build.0 = Vista Debug|Win32
@@ -278,9 +219,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|x64.ActiveCfg = Vista Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|x64.Build.0 = Vista Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|x64.Deploy.0 = Vista Debug|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|x86.ActiveCfg = Vista Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|x86.Build.0 = Vista Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Debug|x86.Deploy.0 = Vista Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|Any CPU.ActiveCfg = Vista Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|Mixed Platforms.ActiveCfg = Vista Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|Mixed Platforms.Build.0 = Vista Release|Win32
@@ -291,9 +229,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|x64.ActiveCfg = Vista Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|x64.Build.0 = Vista Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|x64.Deploy.0 = Vista Release|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|x86.ActiveCfg = Vista Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|x86.Build.0 = Vista Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Vista Release|x86.Deploy.0 = Vista Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|Any CPU.ActiveCfg = Win7 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|Mixed Platforms.ActiveCfg = Win7 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|Mixed Platforms.Build.0 = Win7 Debug|Win32
@@ -304,9 +239,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|x64.Build.0 = Win7 Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|x64.Deploy.0 = Win7 Debug|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|x86.ActiveCfg = Win7 Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|x86.Build.0 = Win7 Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Debug|x86.Deploy.0 = Win7 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|Any CPU.ActiveCfg = Win7 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|Mixed Platforms.ActiveCfg = Win7 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|Mixed Platforms.Build.0 = Win7 Release|Win32
@@ -317,9 +249,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|x64.ActiveCfg = Win7 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|x64.Build.0 = Win7 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|x64.Deploy.0 = Win7 Release|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|x86.ActiveCfg = Win7 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|x86.Build.0 = Win7 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win7 Release|x86.Deploy.0 = Win7 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|Any CPU.ActiveCfg = Win8 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|Mixed Platforms.ActiveCfg = Win8 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|Mixed Platforms.Build.0 = Win8 Debug|Win32
@@ -330,9 +259,6 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|x64.Build.0 = Win8 Debug|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|x64.Deploy.0 = Win8 Debug|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|x86.ActiveCfg = Win8 Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|x86.Build.0 = Win8 Debug|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Debug|x86.Deploy.0 = Win8 Debug|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|Any CPU.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|Mixed Platforms.ActiveCfg = Win8 Release|Win32
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|Mixed Platforms.Build.0 = Win8 Release|Win32
@@ -343,58 +269,48 @@ Global
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|x64.ActiveCfg = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|x64.Build.0 = Win8 Release|x64
{43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|x64.Deploy.0 = Win8 Release|x64
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|x86.ActiveCfg = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|x86.Build.0 = Win8 Release|Win32
- {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Win8 Release|x86.Deploy.0 = Win8 Release|Win32
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.CD_ROM|Mixed Platforms.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.CD_ROM|Mixed Platforms.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.CD_ROM|Win32.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.CD_ROM|x64.ActiveCfg = Release|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.CD_ROM|x86.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Debug|Win32.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Debug|x86.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.DVD-5|Mixed Platforms.ActiveCfg = Debug|Any CPU
{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}.DVD-5|x86.ActiveCfg = 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
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Release|Win32.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Release|x64.ActiveCfg = Release|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Release|x86.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.SingleImage|Mixed Platforms.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.SingleImage|Mixed Platforms.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.SingleImage|Win32.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.SingleImage|x64.ActiveCfg = Release|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.SingleImage|x86.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Debug|Any CPU.Build.0 = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Debug|Win32.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Debug|x64.ActiveCfg = Debug|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Debug|x86.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Release|Any CPU.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Release|Any CPU.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Release|Mixed Platforms.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Release|Win32.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Release|x64.ActiveCfg = Release|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Vista Release|x86.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|Any CPU.Build.0 = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win7 Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -402,8 +318,6 @@ Global
{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
@@ -411,22 +325,18 @@ Global
{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
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Debug|Win32.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Debug|x64.ActiveCfg = Debug|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Debug|x86.ActiveCfg = Debug|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Release|Any CPU.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Release|Any CPU.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Release|Mixed Platforms.Build.0 = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Release|Win32.ActiveCfg = Release|Any CPU
{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Release|x64.ActiveCfg = Release|Any CPU
- {4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}.Win8 Release|x86.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -435,8 +345,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|Win32.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|x64.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|x64.Build.0 = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|x86.ActiveCfg = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.CD_ROM|x86.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -445,8 +353,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|Win32.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|x64.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|x64.Build.0 = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|x86.ActiveCfg = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Debug|x86.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.DVD-5|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -455,8 +361,6 @@ 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}.DVD-5|x86.ActiveCfg = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.DVD-5|x86.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
@@ -465,8 +369,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|Win32.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|x64.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|x64.Build.0 = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|x86.ActiveCfg = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Release|x86.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -475,8 +377,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|Win32.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|x64.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|x64.Build.0 = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|x86.ActiveCfg = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.SingleImage|x86.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|Any CPU.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -485,8 +385,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|Win32.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|x64.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|x64.Build.0 = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|x86.ActiveCfg = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Debug|x86.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|Any CPU.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|Any CPU.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -495,8 +393,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|Win32.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|x64.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|x64.Build.0 = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|x86.ActiveCfg = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Vista Release|x86.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|Any CPU.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -505,8 +401,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|Win32.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|x64.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|x64.Build.0 = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|x86.ActiveCfg = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Debug|x86.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|Any CPU.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|Any CPU.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -515,8 +409,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|Win32.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|x64.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|x64.Build.0 = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|x86.ActiveCfg = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win7 Release|x86.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|Any CPU.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -525,8 +417,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|Win32.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|x64.ActiveCfg = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|x64.Build.0 = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|x86.ActiveCfg = Debug|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Debug|x86.Build.0 = Debug|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|Any CPU.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|Any CPU.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -535,8 +425,6 @@ Global
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|Win32.Build.0 = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|x64.ActiveCfg = Release|Any CPU
{6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|x64.Build.0 = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|x86.ActiveCfg = Release|Any CPU
- {6D27214A-087B-4484-B898-AD2A13FA3B9E}.Win8 Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/zerotierone/windows/copyutil/App.config b/zto/windows/copyutil/App.config
index 88fa402..88fa402 100644
--- a/zerotierone/windows/copyutil/App.config
+++ b/zto/windows/copyutil/App.config
diff --git a/zerotierone/windows/copyutil/Program.cs b/zto/windows/copyutil/Program.cs
index f65a577..f65a577 100644
--- a/zerotierone/windows/copyutil/Program.cs
+++ b/zto/windows/copyutil/Program.cs
diff --git a/zerotierone/windows/copyutil/Properties/AssemblyInfo.cs b/zto/windows/copyutil/Properties/AssemblyInfo.cs
index 5c4c646..5c4c646 100644
--- a/zerotierone/windows/copyutil/Properties/AssemblyInfo.cs
+++ b/zto/windows/copyutil/Properties/AssemblyInfo.cs
diff --git a/zerotierone/windows/copyutil/copyutil.csproj b/zto/windows/copyutil/copyutil.csproj
index 099208f..099208f 100644
--- a/zerotierone/windows/copyutil/copyutil.csproj
+++ b/zto/windows/copyutil/copyutil.csproj
diff --git a/zerotierone/windows/packages/.gitignore b/zto/windows/packages/.gitignore
index 0acda71..0acda71 100644
--- a/zerotierone/windows/packages/.gitignore
+++ b/zto/windows/packages/.gitignore
diff --git a/zerotierone/windows/packages/repositories.config b/zto/windows/packages/repositories.config
index f819765..f819765 100644
--- a/zerotierone/windows/packages/repositories.config
+++ b/zto/windows/packages/repositories.config
diff --git a/zerotierone/zerotier-one.spec b/zto/zerotier-one.spec
index 5c01e5b..0a3b045 100644
--- a/zerotierone/zerotier-one.spec
+++ b/zto/zerotier-one.spec
@@ -1,18 +1,16 @@
Name: zerotier-one
-Version: 1.1.14
-Release: 0.1%{?dist}
+Version: 1.2.0
+Release: 1%{?dist}
Summary: ZeroTier One network virtualization service
License: GPLv3
URL: https://www.zerotier.com
-Source0: %{name}-%{version}.tar.gz
%if 0%{?rhel} >= 7
BuildRequires: systemd
%endif
%if 0%{?fedora} >= 21
-BuildRequires: libnatpmp-devel
BuildRequires: systemd
%endif
@@ -20,6 +18,7 @@ Requires: iproute
%if 0%{?rhel} >= 7
Requires: systemd
+Requires(pre): /usr/sbin/useradd, /usr/bin/getent
%endif
%if 0%{?rhel} <= 6
@@ -27,15 +26,8 @@ Requires: chkconfig
%endif
%if 0%{?fedora} >= 21
-Requires: libnatpmp
Requires: systemd
-%endif
-
-Provides: bundled(http-parser) = 2.7.0
-Provides: bundled(miniupnpc) = 2.0.20161216
-
-%if 0%{?rhel} >= 6
-Provides: bundled(libnatpmp) = 20131126
+Requires(pre): /usr/sbin/useradd, /usr/bin/getent
%endif
%description
@@ -51,33 +43,43 @@ like conventional VPNs or VLANs. It can run on native systems, VMs, or
containers (Docker, OpenVZ, etc.).
%prep
-rm -rf *
-ln -s %{getenv:PWD} %{name}-%{version}
-tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/*
-rm -f %{name}-%{version}
-cp -a %{getenv:PWD}/* .
+#rm -rf *
+#ln -s %{getenv:PWD} %{name}-%{version}
+#tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/*
+#rm -f %{name}-%{version}
+#cp -a %{getenv:PWD}/* .
%build
-%if 0%{?rhel} <= 7
-make CFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" CXXFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
-%else
-make CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
+#%if 0%{?rhel} <= 7
+#make CFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" CXXFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
+#%else
+#make CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
+#%endif
+
+%pre
+%if 0%{?rhel} >= 7
+/usr/bin/getent passwd zerotier-one || /usr/sbin/useradd -r -d /var/lib/zerotier-one -s /sbin/nologin zerotier-one
+%endif
+%if 0%{?fedora} >= 21
+/usr/bin/getent passwd zerotier-one || /usr/sbin/useradd -r -d /var/lib/zerotier-one -s /sbin/nologin zerotier-one
%endif
%install
rm -rf $RPM_BUILD_ROOT
+pushd %{getenv:PWD}
make install DESTDIR=$RPM_BUILD_ROOT
+popd
%if 0%{?rhel} >= 7
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
-cp debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
+cp %{getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
%endif
%if 0%{?fedora} >= 21
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
-cp debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
+cp ${getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
%endif
%if 0%{?rhel} <= 6
mkdir -p $RPM_BUILD_ROOT/etc/init.d
-cp ext/installfiles/linux/zerotier-one.init.rhel6 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
+cp %{getenv:PWD}/ext/installfiles/linux/zerotier-one.init.rhel6 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
chmod 0755 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
%endif