mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-21 10:01:46 +00:00
Docs, Node picks a default home folder if created with NULL as its home path, and add binary tap drivers (self-signed for now).
This commit is contained in:
parent
6d7b1c1e5f
commit
e0bdc02139
@ -22,5 +22,8 @@ ZeroTier One includes or links with the following third party software:
|
|||||||
* TunTapOSX by Mattias Nissler (with tiny modifications) (BSD license)
|
* TunTapOSX by Mattias Nissler (with tiny modifications) (BSD license)
|
||||||
http://tuntaposx.sourceforge.net
|
http://tuntaposx.sourceforge.net
|
||||||
|
|
||||||
|
* tap-windows by the OpenVPN project (forked for ZT1) (GPL)
|
||||||
|
https://github.com/OpenVPN/tap-windows
|
||||||
|
|
||||||
* Salsa20 stream cipher by D. J. Bernstein (public domain)
|
* Salsa20 stream cipher by D. J. Bernstein (public domain)
|
||||||
http://cr.yp.to/snuffle.html
|
http://cr.yp.to/snuffle.html
|
||||||
|
85
ext/bin/tap-windows/x64/ztTap100.inf
Normal file
85
ext/bin/tap-windows/x64/ztTap100.inf
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
[Version]
|
||||||
|
Signature="$WINDOWS NT$"
|
||||||
|
Class=Net
|
||||||
|
ClassGuid={4d36e972-e325-11ce-bfc1-08002be10318}
|
||||||
|
Provider=%Provider%
|
||||||
|
CatalogFile=ztTap100.cat
|
||||||
|
DriverVer=08/24/2013,16.12.30.608
|
||||||
|
|
||||||
|
|
||||||
|
[Strings]
|
||||||
|
DeviceDescription = "ZeroTier One Ethernet Tap"
|
||||||
|
Provider = "ZeroTier Networks"
|
||||||
|
|
||||||
|
[Manufacturer]
|
||||||
|
%Provider%=ztTap100,NTamd64
|
||||||
|
|
||||||
|
[ztTap100]
|
||||||
|
%DeviceDescription%=ztTap100.ndi,ztTap100
|
||||||
|
|
||||||
|
[ztTap100.NTamd64]
|
||||||
|
%DeviceDescription%=ztTap100.ndi,ztTap100
|
||||||
|
|
||||||
|
[ztTap100.ndi]
|
||||||
|
CopyFiles = ztTap100.driver,ztTap100.files
|
||||||
|
AddReg = ztTap100.reg
|
||||||
|
AddReg = ztTap100.params.reg
|
||||||
|
Characteristics = 0x81
|
||||||
|
|
||||||
|
[ztTap100.ndi.Services]
|
||||||
|
AddService = ztTap100, 2, ztTap100.service
|
||||||
|
|
||||||
|
[ztTap100.reg]
|
||||||
|
HKR, Ndi, Service, 0, "ztTap100"
|
||||||
|
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
|
||||||
|
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
|
||||||
|
HKR, , Manufacturer, 0, "%Provider%"
|
||||||
|
HKR, , ProductName, 0, "%DeviceDescription%"
|
||||||
|
|
||||||
|
[ztTap100.params.reg]
|
||||||
|
HKR, Ndi\params\MTU, ParamDesc, 0, "MTU"
|
||||||
|
HKR, Ndi\params\MTU, Type, 0, "int"
|
||||||
|
HKR, Ndi\params\MTU, Default, 0, "2800"
|
||||||
|
HKR, Ndi\params\MTU, Optional, 0, "0"
|
||||||
|
HKR, Ndi\params\MTU, Min, 0, "100"
|
||||||
|
HKR, Ndi\params\MTU, Max, 0, "2800"
|
||||||
|
HKR, Ndi\params\MTU, Step, 0, "1"
|
||||||
|
HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status"
|
||||||
|
HKR, Ndi\params\MediaStatus, Type, 0, "enum"
|
||||||
|
HKR, Ndi\params\MediaStatus, Default, 0, "0"
|
||||||
|
HKR, Ndi\params\MediaStatus, Optional, 0, "0"
|
||||||
|
HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled"
|
||||||
|
HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected"
|
||||||
|
HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address"
|
||||||
|
HKR, Ndi\params\MAC, Type, 0, "edit"
|
||||||
|
HKR, Ndi\params\MAC, Optional, 0, "1"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, Default, 0, "0"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed"
|
||||||
|
|
||||||
|
[ztTap100.service]
|
||||||
|
DisplayName = %DeviceDescription%
|
||||||
|
ServiceType = 1
|
||||||
|
StartType = 3
|
||||||
|
ErrorControl = 1
|
||||||
|
LoadOrderGroup = NDIS
|
||||||
|
ServiceBinary = %12%\ztTap100.sys
|
||||||
|
|
||||||
|
[SourceDisksNames]
|
||||||
|
1 = %DeviceDescription%, ztTap100.sys
|
||||||
|
|
||||||
|
[SourceDisksFiles]
|
||||||
|
ztTap100.sys = 1
|
||||||
|
|
||||||
|
[DestinationDirs]
|
||||||
|
ztTap100.files = 11
|
||||||
|
ztTap100.driver = 12
|
||||||
|
|
||||||
|
[ztTap100.files]
|
||||||
|
;
|
||||||
|
|
||||||
|
[ztTap100.driver]
|
||||||
|
ztTap100.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
|
BIN
ext/bin/tap-windows/x64/ztTap100.sys
Normal file
BIN
ext/bin/tap-windows/x64/ztTap100.sys
Normal file
Binary file not shown.
85
ext/bin/tap-windows/x86/ztTap100.inf
Normal file
85
ext/bin/tap-windows/x86/ztTap100.inf
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
[Version]
|
||||||
|
Signature="$WINDOWS NT$"
|
||||||
|
Class=Net
|
||||||
|
ClassGuid={4d36e972-e325-11ce-bfc1-08002be10318}
|
||||||
|
Provider=%Provider%
|
||||||
|
CatalogFile=ztTap100.cat
|
||||||
|
DriverVer=08/24/2013,16.12.37.14
|
||||||
|
|
||||||
|
|
||||||
|
[Strings]
|
||||||
|
DeviceDescription = "ZeroTier One Ethernet Tap"
|
||||||
|
Provider = "ZeroTier Networks"
|
||||||
|
|
||||||
|
[Manufacturer]
|
||||||
|
%Provider%=ztTap100,NTamd64
|
||||||
|
|
||||||
|
[ztTap100]
|
||||||
|
%DeviceDescription%=ztTap100.ndi,ztTap100
|
||||||
|
|
||||||
|
[ztTap100.NTamd64]
|
||||||
|
%DeviceDescription%=ztTap100.ndi,ztTap100
|
||||||
|
|
||||||
|
[ztTap100.ndi]
|
||||||
|
CopyFiles = ztTap100.driver,ztTap100.files
|
||||||
|
AddReg = ztTap100.reg
|
||||||
|
AddReg = ztTap100.params.reg
|
||||||
|
Characteristics = 0x81
|
||||||
|
|
||||||
|
[ztTap100.ndi.Services]
|
||||||
|
AddService = ztTap100, 2, ztTap100.service
|
||||||
|
|
||||||
|
[ztTap100.reg]
|
||||||
|
HKR, Ndi, Service, 0, "ztTap100"
|
||||||
|
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
|
||||||
|
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
|
||||||
|
HKR, , Manufacturer, 0, "%Provider%"
|
||||||
|
HKR, , ProductName, 0, "%DeviceDescription%"
|
||||||
|
|
||||||
|
[ztTap100.params.reg]
|
||||||
|
HKR, Ndi\params\MTU, ParamDesc, 0, "MTU"
|
||||||
|
HKR, Ndi\params\MTU, Type, 0, "int"
|
||||||
|
HKR, Ndi\params\MTU, Default, 0, "2800"
|
||||||
|
HKR, Ndi\params\MTU, Optional, 0, "0"
|
||||||
|
HKR, Ndi\params\MTU, Min, 0, "100"
|
||||||
|
HKR, Ndi\params\MTU, Max, 0, "2800"
|
||||||
|
HKR, Ndi\params\MTU, Step, 0, "1"
|
||||||
|
HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status"
|
||||||
|
HKR, Ndi\params\MediaStatus, Type, 0, "enum"
|
||||||
|
HKR, Ndi\params\MediaStatus, Default, 0, "0"
|
||||||
|
HKR, Ndi\params\MediaStatus, Optional, 0, "0"
|
||||||
|
HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled"
|
||||||
|
HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected"
|
||||||
|
HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address"
|
||||||
|
HKR, Ndi\params\MAC, Type, 0, "edit"
|
||||||
|
HKR, Ndi\params\MAC, Optional, 0, "1"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, Default, 0, "0"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed"
|
||||||
|
HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed"
|
||||||
|
|
||||||
|
[ztTap100.service]
|
||||||
|
DisplayName = %DeviceDescription%
|
||||||
|
ServiceType = 1
|
||||||
|
StartType = 3
|
||||||
|
ErrorControl = 1
|
||||||
|
LoadOrderGroup = NDIS
|
||||||
|
ServiceBinary = %12%\ztTap100.sys
|
||||||
|
|
||||||
|
[SourceDisksNames]
|
||||||
|
1 = %DeviceDescription%, ztTap100.sys
|
||||||
|
|
||||||
|
[SourceDisksFiles]
|
||||||
|
ztTap100.sys = 1
|
||||||
|
|
||||||
|
[DestinationDirs]
|
||||||
|
ztTap100.files = 11
|
||||||
|
ztTap100.driver = 12
|
||||||
|
|
||||||
|
[ztTap100.files]
|
||||||
|
;
|
||||||
|
|
||||||
|
[ztTap100.driver]
|
||||||
|
ztTap100.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
|
BIN
ext/bin/tap-windows/x86/ztTap100.sys
Normal file
BIN
ext/bin/tap-windows/x86/ztTap100.sys
Normal file
Binary file not shown.
@ -25,8 +25,18 @@
|
|||||||
* LLC. Start here: http://www.zerotier.com/
|
* LLC. Start here: http://www.zerotier.com/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Defaults.hpp"
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "Constants.hpp"
|
#include "Constants.hpp"
|
||||||
|
#include "Defaults.hpp"
|
||||||
|
#include "Utils.hpp"
|
||||||
|
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
#include <WinSock2.h>
|
||||||
|
#include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
|
||||||
@ -66,8 +76,32 @@ static inline std::map< Identity,std::vector<InetAddress> > _mkSupernodeMap()
|
|||||||
return sn;
|
return sn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline std::string _mkDefaultHomePath()
|
||||||
|
{
|
||||||
|
#ifdef __UNIX_LIKE__
|
||||||
|
#ifdef __APPLE__
|
||||||
|
return std::string("/Library/Application\ Support/ZeroTier/One");
|
||||||
|
#else
|
||||||
|
return std::string("/var/lib/zerotier-one");
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
OSVERSIONINFO vi;
|
||||||
|
memset (&vi,0,sizeof(vi));
|
||||||
|
vi.dwOSVersionInfoSize = sizeof(vi);
|
||||||
|
GetVersionEx(&vi);
|
||||||
|
if (vi.dwMajorVersion < 6)
|
||||||
|
return std::string("C:\\Documents and Settings\\All Users\\Application Data\\ZeroTier\\One");
|
||||||
|
return std::string("C:\\ProgramData\\ZeroTier\\One");
|
||||||
|
#else
|
||||||
|
// unknown platform
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
Defaults::Defaults()
|
Defaults::Defaults()
|
||||||
throw(std::runtime_error) :
|
throw(std::runtime_error) :
|
||||||
|
defaultHomePath(_mkDefaultHomePath()),
|
||||||
supernodes(_mkSupernodeMap())
|
supernodes(_mkSupernodeMap())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,11 @@ public:
|
|||||||
throw(std::runtime_error);
|
throw(std::runtime_error);
|
||||||
~Defaults() {}
|
~Defaults() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default home path for this platform
|
||||||
|
*/
|
||||||
|
const std::string defaultHomePath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supernodes on the ZeroTier network
|
* Supernodes on the ZeroTier network
|
||||||
*/
|
*/
|
||||||
|
@ -258,8 +258,9 @@ Node::Node(const char *hp)
|
|||||||
{
|
{
|
||||||
_NodeImpl *impl = (_NodeImpl *)_impl;
|
_NodeImpl *impl = (_NodeImpl *)_impl;
|
||||||
|
|
||||||
impl->renv.homePath = hp;
|
if (hp)
|
||||||
|
impl->renv.homePath = hp;
|
||||||
|
else impl->renv.homePath = ZT_DEFAULTS.defaultHomePath;
|
||||||
impl->reasonForTermination = Node::NODE_RUNNING;
|
impl->reasonForTermination = Node::NODE_RUNNING;
|
||||||
impl->started = false;
|
impl->started = false;
|
||||||
impl->running = false;
|
impl->running = false;
|
||||||
|
@ -41,9 +41,11 @@
|
|||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>$(SolutionDir)\Build\$(Configuration)\</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(SolutionDir)\Build\$(Configuration)\</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user