Compare commits

...

1462 Commits

Author SHA1 Message Date
7d951783ca A bunch of little warning removal and format fix things. 2020-12-04 15:52:30 -05:00
ec76f6e1d2 Mirror over a few more AES fixes. 2020-12-03 22:29:38 -05:00
c943d0e807 InetAddress fix ported from 1.6 2020-12-03 22:28:40 -05:00
a1ceccaf6e Port back over some improvements from 1.6 2020-11-18 21:56:16 -05:00
326a871fac Mirror over Mac fixes. 2020-11-02 19:57:57 -05:00
e462750bdd Remove unnecessary includes that are not needed. 2020-10-30 16:14:44 -04:00
7c599fe83e Typo / thinko 2020-10-27 10:41:46 -04:00
d7e4404c17 A little more clarity to locator display. 2020-10-26 22:41:49 -04:00
441f4986ac Locator CLI plumbing. 2020-10-26 22:33:01 -04:00
d70cfe6850 typo 2020-10-26 20:32:27 -04:00
4ed77e0c0f Upgrade Go modules. 2020-10-26 19:41:55 -04:00
f8e3251efe Locator CGo API fixes. 2020-10-26 19:35:10 -04:00
1bb43476e8 Build fix, add Go unit tests for CGo Locator interface. 2020-10-26 18:44:45 -04:00
387d293793 Use Base32 everywhere for blobs to be consistent with core. 2020-10-23 18:10:25 -04:00
bd96e53bcc Remove redundant includes. 2020-10-22 16:18:18 -04:00
bab9a7f508 Fix and modernize API peer list function. 2020-10-22 15:53:35 -04:00
31eb950750 Missing flag. 2020-10-20 18:53:11 -04:00
31ef205828 ARM build fixes. 2020-10-16 18:29:16 -04:00
a7350bc312 Bust out ARM crypto extensions AES into a separate file too. 2020-10-16 17:41:03 -04:00
0e396526e4 Some small Go stuff, and break out AES-NI into its own .cpp file for easier management. 2020-10-16 15:04:22 -04:00
8e5f8140a2 One more thing to move to CAPI.cpp. 2020-10-14 19:02:32 -04:00
8f746f5099 Move C API into its own source file, and fix some build flags to mirror fix in 1.6.0 to run on old Atom processors. 2020-10-14 18:10:59 -04:00
bc8aa6c359 Mirror over some AES function attribute changes. 2020-10-13 16:10:53 -04:00
00714f5f2e cleanup 2020-10-08 19:03:46 -04:00
d20470d30f cleanup 2020-09-18 19:54:27 -04:00
c2d14599c5 Make protocol versions same as 1.x series. 2020-08-25 08:06:59 -07:00
896656115f Build fix for Go 1.15 2020-08-17 14:53:34 -07:00
72114e4cf8 Remove HTTP stuff from core API. This will be handled entirely in the service. 2020-08-13 17:46:58 -07:00
2abf2c5695 More certificate stuff... 2020-08-12 21:28:06 -07:00
fe01352412 Cert CLI stuff, module bump. 2020-08-12 16:40:17 -07:00
782f15f8c9 Small software GMAC optimization. 2020-08-11 20:50:36 +00:00
e0492a7e69 More Go CLI work, and some cleanup. 2020-08-11 13:24:27 -07:00
cb147a3e8a Documentation in CLI, indicate what commands require a running node. 2020-08-10 16:04:05 -07:00
f97e9e1f5d Warning removal, Go work... 2020-08-10 12:35:26 -07:00
f1b6cb2ace GMAC is faster in software now. 2020-08-07 17:33:27 +00:00
27939a5233 AES performance on rpi4 is now at least acceptable. 2020-08-06 23:09:34 +00:00
7d5ba6f739 AES on pi4 2020-08-06 14:34:34 -07:00
37360d5e2e More test timing fixes. 2020-08-06 09:53:33 -07:00
ae13983b10 Fix benchmarks to not take forever on slower chips. 2020-08-06 09:48:07 -07:00
78670aea58 AES software optimizations to make rpi4 faster. 2020-08-06 09:34:37 -07:00
d0cc3ac333 Small AES optimizations on ARM64. 2020-08-03 23:14:02 +00:00
4273d89373 Linux/GCC fixes. 2020-07-31 16:18:06 -07:00
9ef780e05c Build fix-- these are not needed. 2020-07-31 15:48:18 -07:00
9da0b43d2d Fix some JSON names, regularize use of IP/port info in service code. 2020-07-31 15:32:09 -07:00
7c929099b3 Change date bump for v2.0 2020-07-31 14:26:55 -07:00
ea2f95ed70 Optimizations, make Locator deserialize the same regardless of serialized field order. 2020-07-31 14:05:54 -07:00
fc39894541 Small fix to reduce memory use a little bit more. 2020-07-31 13:53:11 -07:00
1fc4dce835 A bunch of cleanup, make Location serialization format saner, reduce core memory use. 2020-07-31 13:27:27 -07:00
0c56d7c769 Don't kick in AVX2/AVX512 VTEC unless the packet is larger than 256 bytes. 2020-07-30 10:02:37 -07:00
1f2a107d1d Some formatting. 2020-07-29 22:10:54 -07:00
4474303b01 Indent fix. 2020-07-29 21:59:53 -07:00
3b773da8bc Add separate accelerated() function for AES::GMAC. 2020-07-29 21:52:07 -07:00
7efaab2af1 Add 4X parallel ARM AES so VTEC will kick in, yo. Seems to help on Graviton, not much on small chips but thats okay. 2020-07-30 04:17:01 +00:00
064cb6dad7 AES-GMAC for ARM crypto extensions (pmull) 2020-07-30 03:45:40 +00:00
d5afba2610 ARM auto-detection (unfinished) 2020-07-29 21:17:17 +00:00
b4d0307d9e Some AES NEON reorg. 2020-07-29 13:37:32 -07:00
71b72a1ef2 AES (but not yet GMAC) for ARM64 native AES intrinsics, performs really well! 2020-07-29 20:10:27 +00:00
b0e8bac310 Add CMake options to automatically add AArch64 flags for crypto enable, etc. 2020-07-29 09:13:55 -07:00
9a501a76d1 Starting on AES ARM intrinsics work. 2020-07-28 20:44:19 -07:00
becc4aa8ea More certificate plumbing. 2020-07-28 14:38:41 -07:00
95d7970f34 Compiler flags, docs. 2020-07-28 09:41:43 -07:00
81530e5990 Certificate plumbing in Go. 2020-07-27 16:45:43 -07:00
825b19aedc Code readability improvement. 2020-07-23 15:13:42 -07:00
0f04b5afc7 Add CRL fields to Go shadow of Certificate. 2020-07-23 15:05:12 -07:00
189dea7c96 Certificate work, and add an Endpoint attributes field to Locator for future use. 2020-07-22 20:38:57 -07:00
85ef9535d5 So that's where those NULLs came from... 2020-07-17 21:12:28 -07:00
71a2206c5d Move a few things. 2020-07-17 10:57:01 -07:00
641d1a52c8 Warning removal. 2020-07-17 10:49:53 -07:00
407f737212 A bunch of Topology simplification, integrate some cert and root changes. 2020-07-16 20:04:05 -07:00
0d58865061 Fix certificte self-test. 2020-07-16 12:30:09 -07:00
cfb0bc4f8e Better CRL implementation, AES fix. 2020-07-16 12:01:24 -07:00
dfe230be8b CRL support 2020-07-16 10:51:54 -07:00
75ecfffd52 More tweaks. 2020-07-15 16:51:39 -07:00
883cbd182d Some optimization work on crypto code. 2020-07-15 14:33:02 -07:00
866a20e85b More small stuff. 2020-07-14 16:34:46 -07:00
a19bc1e826 Cleanup, remove legacy accessors, formatting. 2020-07-14 16:23:53 -07:00
a117c92a1e Module update for Go code. 2020-07-13 15:53:49 -07:00
65ef40b091 Some Go reorg. 2020-07-13 15:44:54 -07:00
15f5125c8c Hide some low-level stuff from public certificate API in Go. 2020-07-13 14:54:53 -07:00
e5f2314055 Fix another not-fun bug. Also exterminate a memory leak and do a few optimizations. 2020-07-10 16:38:32 -07:00
f018fefeb4 Even less bugs! 2020-07-09 20:08:08 -07:00
04d8c3dd79 Now with less bugs! 2020-07-09 14:57:44 -07:00
7994e3aa78 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-09 10:12:31 -07:00
1eacbdf374 Some cleanup, and fix a really obscure bug in Certificate. 2020-07-09 10:12:24 -07:00
492e78e2cf back to not building all archs by default 2020-07-08 10:27:41 -07:00
8b1c691a5e Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-07 10:12:49 -07:00
b02fc1f28b CGo hell, fix a thinko in CMakeFile. 2020-07-07 10:12:38 -07:00
ecf1fe9aa5 had these transposed 2020-07-07 08:57:53 -07:00
7e341ed397 More certificate plumbing. 2020-07-06 19:28:43 -07:00
e5e6f82a8e Windows build fix. 2020-07-06 15:28:25 -07:00
eca929faef Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-06 15:16:05 -07:00
b027a83789 Minor stuff... 2020-07-06 15:15:21 -07:00
1ad0fbdb76 Revert "fix compilation of zt_service_tests on Windows"
This reverts commit 8f1e6a2fde.
2020-07-06 15:04:46 -07:00
8f1e6a2fde fix compilation of zt_service_tests on Windows 2020-07-06 12:45:06 -07:00
451e6be180 Evil not very fun CGO glue for Certificate works! Also added a self-test project for Go code. Not using "go test" because of CMake build and CGO linking requirements that make it a pain in the derriere. 2020-07-03 16:05:43 -07:00
7b869684c6 More cert Go plumbing. 2020-07-03 14:42:29 -07:00
0d764f5a3d CGO glue for certificates, and Go formatting and other boring stuff. 2020-07-03 13:08:40 -07:00
899f0c9749 Certificate API 2020-07-02 22:22:31 -07:00
727aa8e71f Warning removal. 2020-07-02 15:03:12 -07:00
404b7a5493 Even more clever... and would crash if something weird happened, which is desirable. 2020-07-02 13:58:31 -07:00
befc50ac3a Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-02 13:57:32 -07:00
94c35d395e A bit more optimization/cleanup. 2020-07-02 13:57:19 -07:00
7883e5d8ad Fix cast order of operations 2020-07-02 13:28:58 -07:00
97cd184211 cleanup 2020-07-02 13:09:59 -07:00
c17ac16728 Windows fix. 2020-07-02 11:53:47 -07:00
b696ab12b8 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-02 11:52:34 -07:00
e7ccd74a9e Disable functions missing in MinGW 2020-07-02 11:52:20 -07:00
676a3444cd fix s390x static section of jenkinsfile 2020-07-02 11:19:35 -07:00
bd0299f392 Some cleanup and optimization. 2020-07-02 10:33:34 -07:00
e213317532 -lm is needed on some platforms, harmless on others 2020-07-01 12:38:22 -07:00
206524b9e6 BSD fixes. 2020-07-01 12:30:41 -07:00
7a458e0138 BSD fixes. 2020-07-01 12:28:44 -07:00
9db9211ed3 Fix method name problem. 2020-07-01 11:14:01 -07:00
2ee550bbfd Some optimization. 2020-06-30 23:44:24 -07:00
9029570452 Test certificate copy/construct. 2020-06-30 23:20:50 -07:00
6af39da61a Some formatting and optimization. 2020-06-30 22:23:57 -07:00
ad692b07c3 Add CPUID output to self-test. 2020-06-30 20:51:14 -07:00
3f4809457f A bunch of compile fixes, and an edge case fix in Dictionary. 2020-06-30 20:31:41 -07:00
53b85a2bbb Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-30 11:20:50 -07:00
92d2bbc63c Some symbol renaming, performance improvements, a bug fix for compiling on some platforms, and some Topology work. 2020-06-30 11:20:44 -07:00
536be73006 s390x all static 2020-06-30 11:06:33 -07:00
115187204f remove debug output 2020-06-30 10:04:19 -07:00
b482064a55 reenable some temporarily disabled stuff 2020-06-30 09:59:18 -07:00
722a50f7be armel image build shortcut 2020-06-29 17:15:18 -07:00
623213ea0b fix wheezy symlink 2020-06-29 17:13:56 -07:00
0589c4ab6a fix stretch symlink 2020-06-29 17:12:52 -07:00
46c4a11a7a fix jessie symlink 2020-06-29 17:11:55 -07:00
16d27dfddb fix buster ld symlink 2020-06-29 17:09:15 -07:00
aee344fe47 kill a couple docker images 2020-06-29 15:18:01 -07:00
696c77f5c8 no static builds for armel
no support in Alpine, can't build it
2020-06-29 14:50:52 -07:00
8921914098 force use of vendored modules 2020-06-29 14:24:06 -07:00
f33574dfbc needed on Jessie, too 2020-06-29 13:29:33 -07:00
e2bc081740 hack to run go on armel containers 2020-06-29 13:17:20 -07:00
a6d7f7cac2 -latomic for armel 2020-06-29 12:19:25 -07:00
c714112e00 fix building cmake on arm32 2020-06-29 09:23:48 -07:00
bae91724a1 Certificate passes all tests. 2020-06-27 14:52:55 -07:00
daef6a24d1 Now with less bugs, and less limits that could pose an issue later. 2020-06-27 13:52:12 -07:00
661ebfee94 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-26 13:09:35 -07:00
73d0e2e7e0 Interim commit of some cert and cert testing work, also other cleanup in Utils. 2020-06-26 13:09:24 -07:00
917cc58560 Only build problems left are the compiler errors adam has tickets for 2020-06-25 18:01:27 -07:00
1eea80194b apparently not in backports as advertised 2020-06-25 15:40:10 -07:00
d569217ff5 echo, not cat 2020-06-25 15:38:21 -07:00
d823725eb6 update alpine base image 2020-06-25 15:23:09 -07:00
f08d20560b stretch has mips golang 1.11 in backports
don't know if it'll work though
2020-06-25 15:15:16 -07:00
c0385466e2 no golang packages for buster or stretch on mips64
no mips on stretch at all
2020-06-25 15:07:12 -07:00
c22b002226 Looks like we have to turn off bullseye 32-bit ARM too 2020-06-25 14:55:01 -07:00
9aac1fc47f default BUILD_ALL flag to true for now
since that's what I"m testing now
2020-06-25 14:52:08 -07:00
39d4fadf90 add mips64le to debian native build lists 2020-06-25 11:56:32 -07:00
4968afb89a no 32-bit arm on sid for the time being 2020-06-25 11:41:09 -07:00
8b45018f28 remove ldflag on windows 2020-06-25 09:39:06 -07:00
007b3bd10b openssl dev for sid 2020-06-25 08:49:23 -07:00
5e1b7f2ba6 Certificate stuff, but not plumbled through to CLI yet to actually make them. 2020-06-25 07:40:21 -07:00
40820ddea9 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-24 17:08:19 -07:00
4fbc29158d A few more things to manually merge in CMakeLists.txt 2020-06-24 17:08:11 -07:00
6e1115ea03 More cert work, support certs in data store, and manually merge CMakefile. 2020-06-24 17:05:34 -07:00
d5d1f4a313 forgot the -y on apt-get 2020-06-24 14:59:38 -07:00
1e65aad95b args 2020-06-24 14:53:02 -07:00
495ac17346 debian mips64 image fixes 2020-06-24 14:51:59 -07:00
2f82db97ed blah 2020-06-24 14:46:30 -07:00
35f3d16084 bullseye base version 2020-06-24 14:23:30 -07:00
29dfe240e4 mips64le updates 2020-06-24 14:21:47 -07:00
aa9ca845e8 Merge edge, still need to resolve CMakeLists.txt 2020-06-24 10:50:16 -07:00
05a3831acb Certificates, and rename credentials to credential since they are not truly certificates (according to the common definition). 2020-06-24 10:46:59 -07:00
9a7d26cd9e fix package name 2020-06-24 10:07:08 -07:00
ab36607a48 docker & build parallelization 2020-06-24 09:57:38 -07:00
02a810b8d6 same issue on sid, apparently 2020-06-23 17:18:54 -07:00
2d1ca5f346 cmake version from debian-bullseye doesn't like ARM
so let's build the latest from src
2020-06-23 17:12:52 -07:00
65aca7d84a let's not force the build server to swap out when building releases 2020-06-23 16:48:50 -07:00
d3a9ce95bc more flag fixes 2020-06-23 16:41:55 -07:00
ee53f056ce fix flags 2020-06-23 16:29:35 -07:00
f3defdf3a6 one more 2020-06-23 14:42:18 -07:00
6d88a13407 fix variable 2020-06-23 14:28:32 -07:00
9722bdef75 fix variable name 2020-06-23 13:33:59 -07:00
f87e41abee jenkinsfile armhf/armel stuff 2020-06-23 12:56:29 -07:00
d7c6f8ae3f armel/armhf differentiation in builds 2020-06-23 11:49:43 -07:00
4d80f7c41d more go static build flags 2020-06-23 09:53:46 -07:00
de00486b80 no armhf for ubuntu focal 2020-06-23 09:41:45 -07:00
c2664033bc try to force 32-bit package for centos7 i386 2020-06-23 09:04:45 -07:00
f96a9f63ea . 2020-06-23 08:53:13 -07:00
78b18f2bdb remove centos6 from jenkinsfile 2020-06-23 08:40:24 -07:00
8bb0753f62 get cmake from yum for centos8 2020-06-22 16:23:34 -07:00
0c5d1a793c fix docker images for static targets 2020-06-22 15:58:49 -07:00
34692489cb RIP Centos 6 2020-06-22 15:18:30 -07:00
52b619b38f temporarily disable builds of Debian Stretch, FreeBSD, Ubuntu Bionic AMD64, and Ubuntu Xenial 2020-06-22 14:34:23 -07:00
9009a864ab re-enable static build packaging with updates 2020-06-22 14:03:27 -07:00
09a8b66d3b enable -DPACKAGE_STATIC=1 builds
Only configures the project for packaging of the statically built binary placed in build/
2020-06-22 13:50:35 -07:00
7c6f5e2c37 make install works on Linux 2020-06-22 11:00:48 -07:00
930bd91598 finish up rpm generation 2020-06-22 09:49:25 -07:00
050615f2d2 fix centos7 x64 2020-06-19 16:50:42 -07:00
05cc4ea36a dont use __has_include 2020-06-19 16:36:04 -07:00
4cafc1b776 extraneous ` in rpm building 2020-06-19 16:32:43 -07:00
fb559434b6 jenkins builds rpms 2020-06-19 16:24:32 -07:00
02493d473f basic RPM package
still needs systemd/init scripts
2020-06-19 16:21:47 -07:00
1abcb5adf5 parallelize make 2020-06-19 15:42:33 -07:00
1b8703db95 add cmake package args 2020-06-19 15:40:48 -07:00
517a171a6c dont split debian description over multiple lines 2020-06-19 15:35:42 -07:00
b126bf727a non-static build debian packages 2020-06-19 15:33:08 -07:00
cfc2a43f51 A whole bunch of minor refactoring, and rename a bunch of classes to be more canonical. A credential really is not a certficiate, so just call IdentificationCertificate Certificate and call the network auth stuff credentials. 2020-06-18 17:02:36 -07:00
0477e16860 freebsd doesn't like the root makefile 2020-06-18 16:31:15 -07:00
cc13bf1049 fix jenkinsfile 2020-06-18 15:35:35 -07:00
a66b4a6f5e add freebsd build target 2020-06-18 15:26:29 -07:00
f989758159 parallelize windows build 2020-06-18 13:46:57 -07:00
ade8373c0c because reasons 2020-06-18 13:44:19 -07:00
fa4ecea095 wtf 2020-06-18 13:34:01 -07:00
7ae9c6d55c . 2020-06-18 13:19:30 -07:00
b369d4b9a1 fix 32-bit windows build 2020-06-18 13:01:05 -07:00
ea5bb43cf9 windows 32bit builds 2020-06-18 11:58:00 -07:00
6ea60bc429 let's see if paths with no spaces works 2020-06-18 11:26:57 -07:00
b094278b64 explicitly set SHELL environment variable 2020-06-18 10:59:46 -07:00
f21384e499 windows fun 2020-06-18 10:54:31 -07:00
620fa9ab54 🤷‍♂️ 2020-06-17 13:26:36 -07:00
d8c83dbb08 pita 2020-06-17 13:18:01 -07:00
992d1471b8 add CMake and Go to Windows PATH 2020-06-17 12:29:03 -07:00
27b14aefcd help it find cmd.exe 2020-06-17 12:19:06 -07:00
a7fee6b02f playing with paths 2020-06-17 12:14:50 -07:00
cea297b69d enable windows builds 2020-06-17 12:04:29 -07:00
c348bfff30 Fix quote craziness. 2020-06-16 22:33:43 -07:00
224c468aa3 OMG Windows builds! 2020-06-16 22:26:47 -07:00
a472aafb3e Windows now builds at least to the point of running zt_core_tests. Go will need a revision to the command in CMake files. 2020-06-16 21:21:24 -07:00
b165b9dd4f another fix 2020-06-16 17:46:22 -07:00
7d388e0c79 fix mac jenkins 2020-06-16 17:34:58 -07:00
4036657e32 add macos build to jenkins 2020-06-16 16:13:01 -07:00
d50c6ee1ce need ssl dev 2020-06-16 15:07:31 -07:00
143f4bef9f Select the right C++ library, hopefully. 2020-06-16 15:00:59 -07:00
765dc413db Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-16 15:00:25 -07:00
423b0d891c need stdint.h on Windows, too 2020-06-16 14:48:27 -07:00
3db0e9d068 use correct dockerfile for Xenial x64 2020-06-16 14:07:40 -07:00
1f3f9bc341 for ptrdiff_t 2020-06-16 13:52:26 -07:00
e84bfca5a5 xenial needs newer cmake, too 2020-06-16 13:45:35 -07:00
bd488a08f8 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-16 13:36:48 -07:00
3c6448a717 Move all CGO flags into CMakeLists.txt so they can inherit all our system detection and stuff. 2020-06-16 13:36:43 -07:00
0a2dfc719a fix centos 7 & debian stretch 2020-06-16 13:33:05 -07:00
f0fc4713d8 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-16 13:01:20 -07:00
b2132aa975 needs libssl dev 2020-06-16 12:19:31 -07:00
7739984c56 typo 2020-06-16 12:11:48 -07:00
034188b0ee reset WORKDIR back to root once built 2020-06-16 12:07:20 -07:00
98ea27ecb0 have to build & install cmake on non-x64 versions of debian stretch 2020-06-16 11:59:08 -07:00
8d2a0f764b Some minor reorg. 2020-06-16 11:51:41 -07:00
6c43e0b946 add scl-utils 2020-06-16 11:28:42 -07:00
77342f8571 try setting scl_source on centos7 for newer compilers 2020-06-16 10:40:01 -07:00
e808b4b45f add ubuntu focal builds 2020-06-16 10:26:48 -07:00
86d91cb625 no ubuntu 20.04 for ArmV7 2020-06-16 10:10:51 -07:00
3f21e59ab4 more DEBIAN_FRONTEND=noninteractive 2020-06-16 09:53:42 -07:00
3669cac3c9 apparently apt now asks for your region interactively. Even in a docker image 2020-06-16 09:50:16 -07:00
b919f5a95b helps to load the correct dockerfile 2020-06-16 09:46:42 -07:00
5e6484ff5a add docker images for ubuntu 20.04 2020-06-16 09:08:26 -07:00
ecb09aa2e1 Fix bounds check bug. 2020-06-15 16:30:52 -07:00
346d4b572b Fix symbol issues in static build. 2020-06-15 15:02:07 -07:00
1a38dfdbde back to go main 2020-06-15 13:51:24 -07:00
69f1c8701b Define uint since that is not a standard symbol. 2020-06-15 13:13:03 -07:00
9daf4540de Certificates, and it builds again. 2020-06-15 11:17:24 -07:00
f447608d6b Certificates, etc... work in progress. 2020-06-13 21:41:39 -07:00
001fb54b15 fix go static command line 2020-06-12 16:08:34 -07:00
ffc786d796 update make call for static 2020-06-12 15:59:53 -07:00
a1649d6cda trying again for static build. also add static go flags 2020-06-12 15:58:00 -07:00
541b2cbef0 . 2020-06-12 15:49:28 -07:00
5166aa6913 added static build option 2020-06-12 15:43:12 -07:00
b88000c349 . 2020-06-12 15:39:02 -07:00
49eefe7e78 rename error for static 2020-06-12 15:31:34 -07:00
bfdac7a8f0 use alpine go package 2020-06-12 15:21:48 -07:00
d9dd77bc6e let cgo find versionl.h 2020-06-12 15:09:31 -07:00
e46a342e17 ensure version.h is in the include path 2020-06-12 14:57:41 -07:00
760607f58a static alpine builds reenabled 2020-06-12 14:46:48 -07:00
35b5780907 remove __has_include 2020-06-12 14:44:25 -07:00
51159601b0 one more time 2020-06-12 14:27:34 -07:00
4cb35a2975 yes pipe too 2020-06-12 13:58:50 -07:00
405250ce79 tell curl to follow redirects 2020-06-12 13:56:44 -07:00
81b11168c9 centos 8 update 2020-06-12 13:48:31 -07:00
066cdfe2ac alternate newer cmake install 2020-06-12 13:46:40 -07:00
062189b589 add sid 32bit 2020-06-12 11:40:34 -07:00
a11d0027ce cast to uintptr_t instead
should fix non 64-bit platforms
2020-06-12 09:22:58 -07:00
c9ae7e811f Should fix non x64 platforms
Need adam to check
2020-06-12 09:22:17 -07:00
47ec246520 try to force 32 bit with BUILD_32BIT flag. force VERBOSE=1 cmake build too 2020-06-10 16:19:39 -07:00
42104cfc4c go wrangling 2020-06-10 15:56:16 -07:00
1bab9b202f default off 2020-06-10 15:40:14 -07:00
74ce98f39b set CMAKE_SYSTEM_PROCESSOR to x86 2020-06-10 15:39:48 -07:00
3268effabf enable 32bit builds on 64-bit hosts 2020-06-10 15:31:40 -07:00
96965647bc wtf 2020-06-10 14:51:44 -07:00
808ab715d9 forgot to save a few files 2020-06-10 13:02:38 -07:00
fa1e16085b permissions in docker containers 2020-06-10 12:40:44 -07:00
dd46e56af2 add include <mmintrin.h> 2020-06-10 12:27:22 -07:00
d8d871745e add cmake 2020-06-10 10:50:01 -07:00
09c9e338bc needs /bin? 2020-06-10 09:51:57 -07:00
df9483408d CMake error if go not found 2020-06-10 09:33:48 -07:00
cb342bfb12 make GCC happy 2020-06-09 15:30:01 -07:00
04266a1180 don't build static binaries yet. Don't have the build config in there for it yet 2020-06-09 14:49:37 -07:00
86eda5fe65 use zerotier as binary name for 2.0 2020-06-09 14:31:00 -07:00
bc1fa3bf20 make it easier to update go version for docker build containers 2020-06-09 14:29:40 -07:00
e63920404c copy over dockerbuild files for releases 2020-06-09 14:16:36 -07:00
4833478eee Fix linux link ordering and add Dockerfile for central controllers
Builds but obviously won't actually do anything yet
2020-06-09 14:14:11 -07:00
c8b6850520 add central controller build target 2020-06-09 14:14:06 -07:00
938cbba449 Root set stuff, code formatting and other boring stuff. 2020-06-09 12:26:52 -07:00
c8f640f3f2 compile go code to static library & call via main.cpp
This allows CMake to manage the linkage of C/C++ libraries rather than an exponentially growing list of cgo directives based on build options
2020-06-09 12:03:16 -07:00
2272189955 macOS: link static versions of lipq and libhiredis on mac
will need to grab them via homebrew
2020-06-08 16:14:01 -07:00
736edeeed0 figure out conditional compilation & cgo based on go build tags 2020-06-08 15:54:10 -07:00
bf33368add Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-08 14:45:08 -07:00
40d48c969c Some cleanup, revision to Endpoint string format, stub out HTTP API callbacks. 2020-06-08 14:41:13 -07:00
17f0dc9ba2 2.0 compiles with postgres/redis controller code
Probably doesn't work yet
2020-06-08 14:11:07 -07:00
016d85b169 Code formatting and similar. 2020-06-08 11:47:28 -07:00
2bceabdfa5 add redis dependencies for central controller 2020-06-08 11:23:41 -07:00
d18c33d6df Code cleanup, Linux build fixes. 2020-06-05 22:18:58 -07:00
e2ca065f28 Cleanup, revise join command 2020-06-05 16:36:31 -07:00
fe28501126 Also clean CLion directories. 2020-06-05 14:40:04 -07:00
73795d05eb Reorg done and builds 2020-06-05 14:38:35 -07:00
af846f7e3f Fix clean 2020-06-05 13:45:43 -07:00
a0374da4f3 Reorg. 2020-06-05 13:42:34 -07:00
4e44fa009c Clean up gitignore 2020-06-05 13:31:10 -07:00
3dd2c94f4e Moar reorganization. 2020-06-05 13:26:35 -07:00
6da8f2bb05 Temporarily stash stuff in attic that needs update before beta/release. 2020-06-05 13:06:01 -07:00
e21fcb8104 Reorg. 2020-06-05 13:05:28 -07:00
3c11c13af4 More reorg, work in progress. 2020-06-05 13:04:37 -07:00
d3cf7b2202 Reorg. 2020-06-05 12:56:20 -07:00
03bcdf74a8 Some CLI help updates, some code formatting, pre-reorg. 2020-06-05 12:49:35 -07:00
45b90a0dfa Formatting and boring stuff 2020-06-05 10:41:32 -07:00
9babfcb9b6 A bunch more go plumbing. 2020-06-04 16:03:11 -07:00
1b2a4f00f2 Take like ten on the addRoot thing, making it even simpler. Explicit locator commands are still present but they will remain just for use in creating subscriptions etc. 2020-06-04 10:32:13 -07:00
90b5acfca6 Docs, simplification. 2020-06-04 07:16:15 -07:00
741f7814c2 Various build fixes. 2020-06-03 22:15:19 -07:00
a4ae4941c3 Try to ignore temporary IPv6 addresses, fix Peer serialization, add an endpoint cache to Peer, some more Go stuff. 2020-06-03 22:03:34 -07:00
8a6ef33c4a revert 2020-06-03 12:27:35 -07:00
5ac2596429 More CLI work, link go.mod and go.sum for some Go editors to work. 2020-06-03 11:59:24 -07:00
5dac2e82a7 A bunch of tweaks around CLI parameters and string formats of things. 2020-06-02 11:37:04 -07:00
8e29acd664 Causes build problems, revert. 2020-06-01 16:24:12 -07:00
1d29bc3e8e Move go.mod and go.sum into base. 2020-06-01 16:07:49 -07:00
dc1ef0c49e Code formatting and other boring stuff. 2020-06-01 15:40:00 -07:00
1003455160 Cleanup. 2020-05-31 15:30:24 -07:00
20ae12d385 Clean up some NAT traversal code, modify algorithm to eliminate the need for toggle-able options. 2020-05-31 15:11:47 -07:00
dcc686a3a7 Docs, YAGNI removal, use locator endpoints in peer contact attempts. 2020-05-31 06:47:56 -07:00
89c27c112a Flesh out tests, fix a signing bug. 2020-05-30 19:08:45 -07:00
3621fe8897 Some AES cleanup and include controller with Go build. 2020-05-30 17:03:12 -07:00
33269cd29d Some CGo fixes. 2020-05-30 12:07:52 -07:00
1970dab13d Move some toString/fromString to C++ since any ZT code base would need it, and stub out the controller commands. 2020-05-30 11:42:59 -07:00
a5390b1bc8 Plumb new locator code through to Go, fix some cgo issues, fix some compiler warnings. 2020-05-29 10:16:38 -07:00
864e33cf2d A bunch of build fixes. 2020-05-29 07:06:00 -07:00
b9bf6d1242 Simplification of addRoot/removeRoot, and some code reformatting and other cleanup across multiple files. 2020-05-29 06:30:02 -07:00
caad356b93 A bunch of go fixes, wire up root add/delete. 2020-05-25 18:05:34 -07:00
964c235ecf Golang fixes 2020-05-25 14:23:48 -07:00
c881094202 Warning removal. 2020-05-25 09:55:47 -07:00
6051c973d3 A bunch of warning removal, build fixes, and cleanup. 2020-05-25 09:48:18 -07:00
1f9717250c Update release notes, rip out trusted paths which were clunky and rarely used and of dubious value, and some other cleanup. 2020-05-21 13:04:27 -07:00
8ebbbc33cc Clean up and revise how roots are added/specced. 2020-05-21 11:21:39 -07:00
98bcff1928 Warning fix. 2020-05-19 15:03:30 -07:00
cef708c8ad Build fixes. 2020-05-19 15:01:52 -07:00
a925e2d783 Build fixes. 2020-05-19 14:02:32 -07:00
a1193f0e30 A few AES-GMAC-SIV tweaks to use a bit more IV state. 2020-05-19 12:18:50 -07:00
f209037efe Cleanup, slightly slow down V1 identity generation, faster Salsa20 (by a bit). 2020-05-19 10:13:12 -07:00
b99dd7d916 Fix code generation for AES stuff so it runs on chips that do not have AVX or VAES. 2020-05-18 16:50:05 -07:00
aad21cf395 Blazing fast VAES (256 and 512) AES-CTR, Identity fixes, test fixes. 2020-05-18 16:29:41 -07:00
d537428421 Build fixes. 2020-05-18 09:44:23 -07:00
996589894d Build fixes 2020-05-14 11:53:45 -07:00
d3777b3eb4 A bunch of boring formattings stuff, etc. 2020-05-14 10:55:41 -07:00
52e1f5502d More VL1 work after re-re-re-refactor... 2020-05-13 14:26:53 -07:00
664a128e9e Yet more work in progress... mostly cleanup and re-implementation without depending on struture padding. 2020-05-11 13:08:55 -07:00
666d44b14a More endless work in progress... 2020-05-06 10:42:09 -07:00
b533c300d8 A ton more work... almost there 2020-04-28 19:52:09 -07:00
78d223d709 A bunch more cleanup, remove a ton of reinterpret_cast cruft in favor of a simple union in InetAddress. 2020-04-16 16:01:39 -07:00
2b0127c26d Work in progress on crypto stuff, refactoring to back out of use of structs for encode/decode as it is questionably portable. 2020-04-16 12:34:51 -07:00
16a3c14c53 A bunch of cleanup and refactoring, implementation of prep for forward secrecy still in progress. 2020-04-13 12:22:08 -07:00
c65391a344 Add symmetric key container, tons of cleanup. 2020-04-06 16:54:35 -07:00
fbf4ae823b Clean up timing stuff in Peer and make it more rational, implement some more P2P stuff, rename some methods, cleanup cleanup cleanup. 2020-04-03 10:18:46 -07:00
3d6d9c5808 LINT cleanliness. 2020-03-31 14:30:02 -07:00
64c533c189 More warning removal. 2020-03-31 14:09:17 -07:00
7fd78a87d1 Use static_assert more. 2020-03-31 13:45:05 -07:00
b9f60fc3c2 A bunch of warning removal and LINT cleanliness. 2020-03-31 12:35:54 -07:00
afa01074c5 File this idea away. 2020-03-31 11:03:02 -07:00
1f85b0402e Just use unordered_map, and some other cleanup. 2020-03-31 09:01:58 -07:00
b3314cd34f Small build fixes. 2020-03-30 18:09:11 -07:00
9428fc53f6 A bunch of cleanup, bug fix, just use unordered_map, etc. 2020-03-30 17:28:23 -07:00
0d05e4bcae Remove capability chain of custody stuff which was never used and was really overly complex and a potential source of security problems. 2020-03-28 12:06:10 -07:00
87da45b3f5 Faster hash table, various other optimizations and simplification. 2020-03-28 01:06:29 -07:00
cbf174f96d Warning removal. 2020-03-27 19:35:37 -07:00
0aa78d0ecb Small fixes. 2020-03-27 19:03:09 -07:00
a87d4f1864 Build fix. 2020-03-27 17:26:49 -07:00
c0e86de6db Forgot one spot. 2020-03-27 17:25:05 -07:00
60fa07bff2 Implement fingerprint option on join in Go land 2020-03-27 17:02:44 -07:00
1df7f21f5f Add ability to fully specify controller fingerprint on join for the paranoid. 2020-03-27 16:36:38 -07:00
674edab814 docs 2020-03-27 15:09:09 -07:00
369df245e3 Some perf stuff, docs, HELLO design tweaks for ephemeral keys. 2020-03-27 13:09:37 -07:00
1f2e94a51d Some optimization and raw memory access cleanup. 2020-03-27 07:40:14 -07:00
3f32cffc40 dead code removal 2020-03-26 15:56:26 -07:00
3914964a35 AES docs 2020-03-26 15:55:31 -07:00
bedf63e257 Some minor security tightening stuff and AES fixes. 2020-03-26 13:54:15 -07:00
d151d731a6 (1) Mask bit 31 of AES-CTR nonce to disallow uint32 overflow, (2) get rid of handling of uint32/uint64 overflow in our AES-CTR code to optimize, (3) optimize AES software a bit 2020-03-26 10:28:59 -07:00
2d862f1d32 Little comments and stuff 2020-03-26 08:38:23 -07:00
f92fca03a0 Update SIV diagram, length pad AAD. 2020-03-25 15:09:49 -07:00
b5c01999b8 More tweaks to COM stuff. 2020-03-25 14:10:26 -07:00
e9da35bac3 Harden some stuff around COMs and members of networks. 2020-03-25 13:21:50 -07:00
d3a7468e83 Implement AES-GMAC-SIV and benchmark, rework COM and add a lot of comments and docs, and comments and docs elsewhere too. 2020-03-25 09:05:44 -07:00
f3540a5c7c Linux build fixes, warning removal. 2020-03-24 08:39:54 -07:00
8cf6808c50 build fix 2020-03-23 16:24:39 -07:00
274db26339 Fix accidentally removed file. 2020-03-23 16:15:36 -07:00
490b9c4d79 Moar build fixes, clock perf improvement. 2020-03-23 16:12:45 -07:00
2da096944d Everything but root builds now. Back to testing. 2020-03-18 07:20:04 -07:00
83f830618f It almost builds! 2020-03-17 16:27:31 -07:00
cdbb86b830 ARM64 stuff 2020-03-16 09:57:51 -07:00
483b47474d ARM64 stuff 2020-03-16 09:51:18 -07:00
1d314858ef ARM64 build fixes 2020-03-16 09:27:56 -07:00
37d4e83fad ARM64 build fixes 2020-03-16 09:24:57 -07:00
c7f3f3add9 Small fix, docs, warning removal. 2020-03-16 06:14:41 -07:00
1c7baa544b Reduce PoW cost just a bit. 2020-03-15 20:14:35 -07:00
3408839b33 build fix 2020-03-15 20:07:21 -07:00
a7409486bb minor stuff 2020-03-15 19:44:40 -07:00
cf24ed4108 This PoW seems decent 2020-03-15 14:08:53 -07:00
8a379ba0a1 The MIMC thing was neat but unfortunately is amenable to too much GPU acceleration. 2020-03-14 20:29:44 -07:00
4b20638568 more test fixes 2020-03-14 15:27:01 -07:00
eebe2046f0 docs 2020-03-14 12:17:30 -07:00
1e457dbd76 Fix tests, fix identity issue 2020-03-14 12:08:40 -07:00
a20aebaaf8 Some work on delay function... which is delaying us... but need to get it right because its hard as hell to change later. 2020-03-09 15:19:58 -07:00
5463c70aaf Minor stuff, and some docs 2020-03-06 12:18:20 -08:00
24e30a684b A bunch of little nit-picky header and name cleanup. 2020-03-04 08:16:44 -08:00
05e52493a4 Go module update 2020-03-03 07:41:15 -08:00
d8f1e01b77 cleanup 2020-03-03 07:40:19 -08:00
da5b11bf2d Rename version constants to something more canonical, and more cleanup. 2020-03-03 07:38:51 -08:00
b824ea7bcf Add buffer life cycle stuff to API for fewer memcpys. 2020-03-02 17:15:00 -08:00
b96ea5ae03 Fingerprint string conversion, API stuff 2020-03-02 15:13:34 -08:00
fbd3e10488 cleanup 2020-03-02 14:41:15 -08:00
51f0882849 comments 2020-03-02 14:39:42 -08:00
416068f68e Regularize use of fingerprint concept across code. 2020-03-02 12:09:38 -08:00
a8db4a8d2d Minor future proofing and cleanup in CertificateOfMembership, improve comments in a few places. 2020-03-02 10:25:15 -08:00
6b49148d4e More cross-platform build fixes and add tests for hton/ntoh/other byte order stuff because breakage there would be annoying. 2020-02-28 11:27:30 -08:00
77e59818a3 dead code removal 2020-02-27 15:59:39 -08:00
6262374205 Add tests for identity marshal/unmarshal and fix an issue found. 2020-02-27 15:40:31 -08:00
ed8271530f cleanup 2020-02-27 14:54:15 -08:00
8e4d7c56d8 Stub out a protocol field in Endpoint INETADDR types for future use. 2020-02-27 14:24:11 -08:00
0598315d68 Fix V1 sample ID 2020-02-27 12:59:00 -08:00
05e5d08959 A little more delay margin 2020-02-27 12:13:12 -08:00
ca33eaf28d FPU trick seems to always be faster 2020-02-27 12:09:26 -08:00
13e86fdb6c lalala build fixes 2020-02-27 11:57:45 -08:00
ffbd18f4ef build fix 2020-02-27 11:52:32 -08:00
fabb0f734a build fix 2020-02-27 11:47:01 -08:00
1e59d92df3 warning removal 2020-02-27 11:45:56 -08:00
ecd09946e6 warning removal 2020-02-27 11:45:06 -08:00
789b8b8454 compile fix 2020-02-27 11:43:54 -08:00
f107a71796 docs, compile fixes. 2020-02-27 11:42:00 -08:00
066b4c27a4 tweaks 2020-02-27 10:31:55 -08:00
fbfa99fac5 Speed up V1 identity verification a little, and add some comments. 2020-02-27 09:43:58 -08:00
c5bd21a23e various optimization 2020-02-26 17:00:03 -08:00
1c7e1da4d1 cleanup, docs 2020-02-26 12:40:29 -08:00
5cec5fe6b1 Make Fingerprint (a full length identity hash) a first class type 2020-02-26 11:39:18 -08:00
ea0961dfd2 docs 2020-02-26 11:32:54 -08:00
f20905b08a Throw some more mulmod52 implementations in there (but currently disabled) for future use so we do not have to hunt them down again. 2020-02-26 11:31:03 -08:00
83e79e1a1b V1 identities now use a VDF (verifiable delay function) 2020-02-26 11:08:03 -08:00
c6a7b5774c MIMC52 2020-02-26 09:58:28 -08:00
27ab88db1e little stuff 2020-02-25 16:21:51 -08:00
1b71b6d01a hash() -> fingerprint() 2020-02-25 16:15:14 -08:00
dcb3d49d35 Cleanup, Address refactoring, tweak V1 identity generation a bit. 2020-02-25 16:08:27 -08:00
5c14a072d5 rename 2020-02-25 06:03:24 -08:00
4eb491065b clean out old files 2020-02-25 06:03:04 -08:00
b87e8d8e41 readability++ 2020-02-25 06:00:52 -08:00
a58f11e601 Tweak protocol getPacketId(), unit tests for defragmenter, AES fix. 2020-02-25 05:36:48 -08:00
547f39bb49 Fixes for Buf, unit test 2020-02-24 15:40:19 -08:00
df99f5e3f3 More crypto benchmarks 2020-02-24 14:44:20 -08:00
15e88a8b7e MOAR AES V-TEC 2020-02-24 13:53:50 -08:00
61b72d42b8 More AES tweaks 2020-02-24 13:30:35 -08:00
56bf504ec2 Small AES tweak 2020-02-24 12:48:56 -08:00
1f02250dd8 Ridiculously fast AES-CTR 2020-02-24 11:56:37 -08:00
5d0c6db19c Crypto fixes and benchmarks. 2020-02-21 19:32:36 -08:00
4af3467757 AES-CTR test vectors and fixes to CTR code. 2020-02-21 17:22:26 -08:00
87890565f3 It builds, and basic stuff and crypto passes tests. 2020-02-21 16:43:12 -08:00
d603a73715 Build fixes. 2020-02-21 15:58:28 -08:00
55b0555aa0 A bunch more build fixes. 2020-02-21 14:46:01 -08:00
1a2378a3d4 More crypto unit tests. 2020-02-21 12:20:57 -08:00
c6ce6b46ce build fixes 2020-02-21 08:44:53 -08:00
f109f2e612 Identity v1 hash tweak 2020-02-21 08:10:43 -08:00
8f8e3f4960 OS/platform include cleanup 2020-02-21 08:01:58 -08:00
1d885cf810 Build fixes, put uint128_t detection in one place. 2020-02-21 07:25:43 -08:00
5275a34b0b more refactoring 2020-02-21 07:11:16 -08:00
c3b5c45fea Fix InetAddress sizing by delving into crazy C++ weeds, fix Peer compile issues. 2020-02-20 13:55:09 -08:00
565a686be7 include cleanup 2020-02-20 13:25:56 -08:00
12cfb6501d Cleanup in ECC384 including const-correctness, etc. 2020-02-20 13:11:51 -08:00
de1b54821e Starting to (re)write unit tests. 2020-02-20 12:54:46 -08:00
320c8429c2 Yet more perf, security hardening, and compile fix tweaks. 2020-02-20 09:33:11 -08:00
a4e24c8390 Build fixes 2020-02-19 11:32:16 -08:00
0589964f99 Yet more cleanup, and add meters to paths. 2020-02-19 11:06:05 -08:00
1affb6814c A little more cleanup and build fixes. 2020-02-19 10:32:02 -08:00
b70ab0d354 Include file cleanup, docs, and build fixes. 2020-02-19 10:18:52 -08:00
4a9266feef Comment out not-yet-refactored code in Network 2020-02-19 09:42:11 -08:00
1e0a930d23 Create a container for identity hashes, replace some "volatile" hacky junk with std::atomic, clean up some security checks, rename raw data in Buf to unsafeData to permit search for unsafe. 2020-02-19 09:28:18 -08:00
46d3780e89 AES stuff, port sending network credentials to new packet format. 2020-02-18 17:17:10 -08:00
311c98e24e Various other small things. 2020-02-18 14:20:49 -08:00
9ad8dd3700 Add Peer method for getting preferred cipher, various cleanup in VL1 2020-02-18 12:38:48 -08:00
0dc476518b Documentation changes, and move HMAC auth on HELLO to before object decoding since this is good cryptographic practice. 2020-02-18 10:31:31 -08:00
8c8a3c58ec Various little things... 2020-02-18 06:33:31 -08:00
a0ac4a744e Change the type 1 identity a bit to make locallyValidate() super fast, eliminating a scaling issue with v0. 2020-02-17 15:09:26 -08:00
3448e6fc76 Yet MORE refactoring, including moving expected-reply-to out of Node and into its own class for cleanliness. 2020-02-14 14:12:42 -08:00
e5c7366e71 Yet more minor refactoring and redesign Meter to be more thread-safe. 2020-02-14 11:34:47 -08:00
e236d6f743 More minor refactoring 2020-02-14 10:19:45 -08:00
5db0d9438c More built-in AES and GMAC primitive work. 2020-02-14 09:05:48 -08:00
08e06f9b8f More refactoring and a bunch of AES goodness. 2020-02-13 14:44:18 -08:00
018fe04163 More nit-picky refactoring. 2020-02-12 14:14:31 -08:00
f21ecb3762 Yet more major and very nit-picky refactoring for performance, etc. Also use std::atomic<> now with a TODO to implement a shim if we ever do need to build this on a pre-c++11 compiler. 2020-02-12 14:04:25 -08:00
60de5ed3dd It almost compiles again 2020-02-07 13:54:17 -08:00
df4b1e9b12 Yet more work on VL1/VL2 2020-02-07 00:02:29 -08:00
c3d3605f70 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-02-06 18:07:22 -08:00
a9003d16f2 Put Switch in attic too 2020-02-06 18:07:17 -08:00
84619a7788 A bunch more refactoring including splitting Switch into VL1 and VL2 2020-02-06 18:06:50 -08:00
db127887b6 libssl-dev on trusty images 2020-02-05 10:57:29 -08:00
e0588b89b2 libssl-dev 2020-02-04 12:48:58 -08:00
7d2eceef01 no building cmake on wheezy either 2020-02-04 12:36:39 -08:00
e5e444c7ae can't even build cmake on Centos 6. Will need another method for packaging 2020-02-04 12:08:47 -08:00
4b083b8c41 more dependencies 2020-02-04 12:06:26 -08:00
245d92b40c add openssl-devel to centos images 2020-02-04 11:46:09 -08:00
931ad1aca8 Add CMake to all the docker images 2020-02-04 11:38:42 -08:00
5e488d3aa0 fix PATH 2020-02-04 10:33:18 -08:00
cc52835ce3 remove unneeded output 2020-02-04 09:39:13 -08:00
7d11522768 Just about everything refactored for new Protocol/Buf code except Switch. 2020-02-03 16:18:33 -08:00
417cdc17dc Skip generating packages on edge as that's not reimplemented in CMake yet 2020-02-03 14:00:46 -08:00
c537955c65 ensure go is in the PATH for jenkins builds 2020-02-03 13:57:03 -08:00
a0efea8e0f Merge branch 'dev' into edge
# Conflicts:
#	.gitignore
#	Jenkinsfile
#	attic/macui/ZeroTier One.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
#	attic/service/OneService.cpp
2020-02-03 13:54:49 -08:00
cce51cea5d Merge branch 'pipeline' into dev 2020-02-03 13:48:46 -08:00
df346a6df6 Work in progress... clean up memcpy and create an annotation for that, lots more porting to new Buf/Protocol code, etc. 2020-02-03 13:00:13 -08:00
ba4324f992 Update jenkinsfile for new build process 2020-02-03 12:51:46 -08:00
81e982991b add kali rolling 2020-02-03 10:46:39 -08:00
f6f4fba90e Add docker configs for multi arch jenkins builds 2020-02-03 09:57:48 -08:00
23d5a972ba disable lintian because sid/bullseye are sitting there running /bin/sleep 3 endlessly on this step 2020-01-31 13:15:23 -08:00
cdc6c42375 Take Dictionary behind the barn... 2020-01-25 18:02:11 -08:00
d5b9a54c55 Continuing work on new buffer type... 2020-01-25 01:17:56 -08:00
59da359b06 More porting to new Buf system. 2020-01-24 23:36:08 -08:00
91ce4c4ea6 Refactoring protocol marshal/unmarshal code... 2020-01-24 21:16:07 -08:00
e9656ecf11 More wiring up of addroot/removeroot etc. 2020-01-24 13:27:01 -08:00
5c6bf9d0a4 Wiring up addroot/removeroot 2020-01-23 18:05:34 -08:00
0de194dab3 It builds again 2020-01-23 14:41:59 -08:00
33bb61c63d Loads of refactoring, integration of new version of Trace. 2020-01-23 13:05:33 -08:00
5faf0f8ab6 whoops 2020-01-23 09:46:15 -08:00
0f17cd4791 Update to jenkinsfile for multi-platform release builds 2020-01-23 09:41:17 -08:00
e0518ab176 testing armv5t instead of armv5 flag 2020-01-22 16:36:26 -08:00
e6273b3300 cleanup 2020-01-21 13:12:07 -08:00
d7b31fe014 Warning removal and build fixes. 2020-01-21 12:55:51 -08:00
5aae5f95bf Merge commit 'bba132414527f1742dd1ca550dad5ecce94dfa40' into edge 2020-01-21 11:05:12 -08:00
bba1324145 One more sanity check. 2020-01-21 11:04:18 -08:00
182561f7e6 Port checking fixes. 2020-01-21 11:00:06 -08:00
41871c8b1e Merge commit 'ff655292fba09c0a0d1ed4b4dda738c165ad4404' into edge 2020-01-21 10:59:44 -08:00
ff655292fb Allocate packet on heap, add extra sanity checks on packet size. 2020-01-21 10:58:41 -08:00
782b75a64e Linux build fixes 2020-01-20 21:27:51 -08:00
0c58901469 cleanup 2020-01-20 21:05:29 -08:00
73b23f1b16 Go code cleanup and fixes, other cleanup. 2020-01-20 16:03:19 -08:00
5a29f9ba2d cleanup 2020-01-20 11:18:38 -08:00
03190c5a55 Bunch of build fixes, some docs 2020-01-20 10:40:31 -08:00
dab968ed96 Put LZ4 in its own file. 2020-01-20 09:38:05 -08:00
b598263261 More 2.x notice updates. 2020-01-20 08:49:10 -08:00
eef70e198b Version 2.x notice updates and other boring stuff. 2020-01-20 08:46:20 -08:00
89c41f88a4 Module version bump, vendor, cleanup 2020-01-20 08:23:30 -08:00
53b7c8f725 Make Peer bootstrap field an Endpoint even though we only support InetAddress right now, and a bunch more stuff. 2020-01-20 08:08:38 -08:00
d471142908 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-01-17 14:01:32 -08:00
3ff9ffd5d4 A bunch of wiring up of stuff... 2020-01-17 14:01:22 -08:00
2558bd1b9b include iomanip 2020-01-16 09:11:12 -08:00
95d0944b9f add /metrics endpoint for exposing root metrics to Prometheus 2020-01-16 09:08:52 -08:00
6e72b6fb37 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-01-15 16:12:51 -08:00
0c9be4de14 add /metrics endpoint for exposing root metrics to Prometheus 2020-01-15 16:12:34 -08:00
b53b7f4950 . 2020-01-14 15:34:06 -08:00
b2f0b35608 Move self-test so it can be called from CLI and always builds, implement Endpoint and Locator deserialization in Go as well as C++. 2020-01-14 14:37:49 -08:00
cba7a5d4d7 Self test is back, wiring up roots again. 2020-01-13 16:35:49 -08:00
8e1a88c2fb Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-01-13 15:32:31 -08:00
ee5a988f14 Wiring back up PUSH_DIRECT_PATHS and friends. 2020-01-13 14:04:17 -08:00
f814a07ab3 Go build works now 2020-01-10 22:12:56 -08:00
a5aea2f3bb Everything but the Go code builds now! 2020-01-10 21:09:13 -08:00
7291ac2093 A bunch more cleanup and build fixes, and remove old version of multipath code to prep for new version. 2020-01-10 20:40:14 -08:00
790fe50fac Go code cleanup for new changes 2020-01-10 16:54:01 -08:00
83eacdfada New Buffer implementation (not used yet) and cleanup 2020-01-10 15:28:27 -08:00
2fbeaaf148 Bunch more fixes, implement C API for Identity operations. 2020-01-09 13:50:51 -08:00
57710cbc38 . 2020-01-09 08:39:47 -08:00
8bae0acaf9 More cleanup and build fixes, almost builds again! 2020-01-08 21:48:01 -08:00
ef64e6a336 Build fixes, cleanup 2020-01-08 21:24:47 -08:00
9642ff5fb9 . 2020-01-08 18:08:41 -08:00
263798d1c3 cleanup 2020-01-07 14:04:08 -08:00
3fbfad5585 cleanup 2020-01-07 14:03:50 -08:00
627533cf48 . 2020-01-07 13:24:15 -08:00
19899de5a6 . 2020-01-06 18:14:35 -08:00
c1b2c7903c . 2020-01-02 19:04:36 -05:00
28df0c2e38 Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev 2019-12-17 10:56:53 -08:00
7696d45093 Fix handling of invalid conf file
Fixes GitHub issue #1068
2019-12-17 10:51:01 -08:00
2a7d4fcde5 update vs project settings 2019-12-17 10:49:21 -08:00
3b94ef99ae Bunch of new-gen serialization work 2019-12-16 11:57:33 -08:00
6267c67888 A bunch of cleanup and refactoring toward 2.x 2019-12-12 16:15:49 -08:00
23d6a3aacd Moar refactoring 2019-12-11 13:46:44 -08:00
72361fb1c8 Cleanup and refactor 2019-12-11 13:27:11 -08:00
b55f98b813 wip 2019-12-11 12:04:22 -08:00
995fa4a76c Merge branch 'refs/heads/master' into dev 2019-11-22 15:00:39 -08:00
d8597884f6 jenkins windows 2019-11-22 11:25:31 -08:00
a993ddc54d Merge branch 'refs/heads/master' into dev 2019-11-21 15:12:37 -08:00
54e25084fe re-enable CI on master 2019-11-21 14:51:33 -08:00
e58a0b3efb build central controller docker images on macOS 2019-11-21 14:49:24 -08:00
381f15382c Convert central-controller docker build to use a builder subcontainer 2019-11-20 13:56:26 -08:00
5a4d681af8 Build fixes. 2019-11-19 16:45:53 -08:00
a16a0a8ce5 Warning removal. 2019-11-19 16:22:11 -08:00
91d679af15 Merge pull request #1087 from skunkwerks/dev
drop -Werror from DEBUG builds
2019-11-19 08:47:38 -08:00
8396f16dd2 drop -Werror from DEBUG builds
Appease compilers. Thanks @glimberg for the diff.
Closes #1086
2019-11-19 16:45:06 +00:00
203df51752 ignore workspace/ folder
It's where I usually put temporary identity, etc. files for testing
2019-11-13 12:48:32 -08:00
dc19deb6c3 . 2019-11-13 12:46:52 -08:00
86abd31659 fix log line 2019-11-13 12:46:16 -08:00
b8e70d866a Compile fix for unterminated conditional directive 2019-11-12 09:46:39 -08:00
e1e27eb19d Bugfix for incorrect port binding of secondary and tertiary ports 2019-11-11 12:03:49 -08:00
47b4efd49b Work in progress... 2019-11-04 14:24:37 -08:00
088dab4f04 Let's not print this to the logs 2019-10-31 15:13:20 -07:00
cc79ec6179 use std::string instead of const char* in rmq struct 2019-10-31 15:08:59 -07:00
74478b24b0 add librabbitmq binaries for macos for testing central controller 2019-10-31 14:04:25 -07:00
14fab11081 Merge dev, clean up old files 2019-10-16 06:05:29 -07:00
4c55f3eaa5 Work in progress 2019-10-16 06:03:32 -07:00
bad95d7c67 Update cli help to say <network ID> instead of <network>
Closes #1054
2019-10-15 13:15:45 -07:00
891bf99894 work in progress 2019-10-15 12:49:03 -07:00
22e95b3bcb . 2019-10-09 10:00:30 -07:00
4da315fab2 Plumb through external interface stuff 2019-10-03 10:43:28 -07:00
507ba7d26a Go build stuff, root stuff 2019-10-02 17:55:15 -07:00
68ac884d47 . 2019-10-02 14:30:46 -07:00
e2f3996843 Fix callbacks 2019-10-02 13:39:48 -07:00
57ade250af . 2019-10-02 12:19:37 -07:00
c3e0f262d1 Regularize JSON stuff 2019-10-02 09:34:44 -07:00
b9911d0db7 More plumbing 2019-10-02 07:09:54 -07:00
d1b780c7be addroot 2019-10-01 13:09:53 -07:00
1711cced3e . 2019-09-30 20:31:48 -07:00
63e6693255 . 2019-09-30 20:10:53 -07:00
9b8d191bb1 Locator fix 2019-09-30 20:09:35 -07:00
6db2b8c66d . 2019-09-30 20:03:03 -07:00
47a08ccbd4 Identity management plumbing to Go 2019-09-30 18:59:57 -07:00
7fc78129f4 A bunch of CLI work 2019-09-30 16:12:08 -07:00
c4504fd3ff Vendor Go modules 2019-09-30 12:41:21 -07:00
e4799ff8c4 Bunch of small warnings and stylistic things... 2019-09-30 11:10:47 -07:00
f680924585 Build fixes 2019-09-30 09:48:44 -07:00
b0d222768a Root admin stuff 2019-09-30 09:32:00 -07:00
4303c43db7 . 2019-09-27 14:55:46 -07:00
3b3e6d2bfc Simplify root API 2019-09-26 13:35:56 -07:00
7061f13b24 . 2019-09-26 09:34:31 -07:00
5175636d36 . 2019-09-25 14:31:08 -07:00
570032484f . 2019-09-25 14:16:55 -07:00
9c37fc1a5f . 2019-09-25 13:32:46 -07:00
105023bd87 Build fix 2019-09-25 12:43:14 -07:00
8a9669f130 . 2019-09-25 12:36:49 -07:00
e5bd230fb0 . 2019-09-24 16:44:29 -07:00
e3d47e588a . 2019-09-24 12:32:35 -07:00
f4a5abeed9 Go CLI work 2019-09-24 12:19:28 -07:00
a7e38d2b00 . 2019-09-23 16:58:55 -07:00
84ba396ed3 . 2019-09-23 16:47:13 -07:00
6683280a37 . 2019-09-23 16:46:58 -07:00
1edf680464 . 2019-09-23 16:46:31 -07:00
4df090469a Clean out obsolete dependencies. 2019-09-23 16:42:23 -07:00
3c63f58532 Build fix. 2019-09-23 16:21:43 -07:00
64c8171e13 Port binding check. 2019-09-23 16:21:02 -07:00
b6175bd408 Gogogogogogogo 2019-09-23 15:18:52 -07:00
b44bd19c53 . 2019-09-22 22:33:11 -07:00
536bc59abb . 2019-09-22 22:25:55 -07:00
70d5da1e2a . 2019-09-22 19:25:40 -07:00
90d4d79828 Peers and paths 2019-09-22 17:41:15 -07:00
ccc9be2d4d All that cgo crap compiles! 2019-09-22 00:06:07 -07:00
3341c4a670 Rooting around 2019-09-21 22:54:58 -07:00
bcb9df9cdf Network config stuff in Go 2019-09-21 20:40:06 -07:00
2eef9d22e6 getting there... 2019-09-21 18:22:25 -07:00
5e35346f17 Gogog 2019-09-21 15:35:27 -07:00
bb53ee9567 Going once... going twice! 2019-09-21 15:04:00 -07:00
9934a856dd More go 2019-09-21 12:54:45 -07:00
24904c5083 Go F yourself 2019-09-21 11:56:31 -07:00
6ce4663a31 GoGoGo 2019-09-21 00:19:20 -07:00
fbf74d3baa Go! Go! https://www.youtube.com/watch?v=hyGYdqMfrQQ 2019-09-20 21:00:54 -07:00
b540181990 Go! Go! Go! - Moby 2019-09-20 20:34:31 -07:00
02a6b15e6b Moar Go 2019-09-20 19:51:57 -07:00
b34aa10bf8 Go code! 2019-09-20 18:48:48 -07:00
e0ddbc2f28 Update build process, Go glue builds now. 2019-09-20 15:00:53 -07:00
ed2024285d More Go boilerplate. 2019-09-20 14:11:15 -07:00
ae2120eb96 New service, work in progress 2019-09-20 09:09:05 -07:00
3ceb2257e5 Plumb through roots via API. 2019-09-19 09:47:12 -07:00
624efde7e4 Make sure threads dont exit on spurious return values from recvfrom unless we are really dying. 2019-09-16 20:41:23 -07:00
50009fef6f Merge branch 'dev' into edge 2019-09-16 20:26:41 -07:00
de127056c2 Add notarization to "make official". 2019-09-16 20:13:20 -07:00
dde937e197 cleanup 2019-09-16 19:58:21 -07:00
07a480b37a Build fix. 2019-09-16 18:04:32 -07:00
9f5bccec30 Add a recv timeout to root 2019-09-16 18:03:17 -07:00
ade52bf81e Fix RENDEZVOUS issue and possibly improve GeoIP resolution. 2019-09-16 17:04:13 -07:00
71c766a3b2 Build fix 2019-09-16 15:09:56 -07:00
eef66aee9a build fix 2019-09-16 14:51:02 -07:00
e245eb1eb5 Trim some unnecessary locks from root, and cleanup elsewhere. 2019-09-16 14:48:27 -07:00
e08fc81397 More threading improvements in root, more DNS TXT and multicast work (in progress) 2019-09-16 10:33:59 -07:00
9f9032ae36 Cleanup and warning removal. 2019-09-13 16:24:02 -07:00
063a16fcd6 Ensure SSE is enabled for Salsa20 on x64 2019-09-13 11:16:21 -07:00
0db4151492 cleanup 2019-09-13 11:10:56 -07:00
e44d7a553f The root technically does not need to do this, and its slow. 2019-09-13 10:29:11 -07:00
53a2de98de Packet ID fix 2019-09-13 10:23:35 -07:00
2deaaeef28 Some root cleanup and more lock contention reduction. 2019-09-13 10:20:29 -07:00
1f9e16f63e AES optimization rabbit hole 2019-09-13 09:37:09 -07:00
87fe69c27c AES optimization rabbit hole 2019-09-13 09:35:49 -07:00
2d1eeda188 Cleanup, optimization 2019-09-12 14:32:37 -07:00
5c06d40358 cleanup 2019-09-12 10:37:26 -07:00
31e193756d cleanup 2019-09-12 09:59:46 -07:00
5aa744db84 Simplification and further concurrency improvements. 2019-09-12 08:41:34 -07:00
0ad82dad80 Linux build fix 2019-09-12 08:25:26 -07:00
99c36ed2f2 Parallelization improvements 2019-09-12 08:20:38 -07:00
44878e583a Bug fixes 2019-09-11 16:10:06 -07:00
0723a85ab3 Build fixes. 2019-09-11 15:52:18 -07:00
d8dae365f6 Cleanup, optimization, multicast stuff, and it now compiles again. 2019-09-11 15:34:55 -07:00
bccb86a401 More multicast work... 2019-09-10 16:20:28 -07:00
592e743349 Yet more multicast work. 2019-09-09 15:49:17 -07:00
fb6161e9ac May as well make it a full self-signature. 2019-09-09 10:45:49 -07:00
787277d282 More multicast work, add a signature in identity for safety margin, cleanup. 2019-09-09 10:44:31 -07:00
540ee69773 A bunch of multicast work... in progress. 2019-09-07 19:15:21 -07:00
0d2c87fe4e map fix 2019-09-06 08:54:27 -07:00
2460de9713 map fix 2019-09-06 08:50:36 -07:00
0d32f42d26 map fix 2019-09-06 08:47:32 -07:00
277497684e Revert "map fix"
This reverts commit f4a83e516c.
2019-09-06 08:45:39 -07:00
f4a83e516c map fix 2019-09-06 08:41:03 -07:00
d2eb1ed9a5 map fix 2019-09-06 08:27:03 -07:00
a3ec5846df map fix 2019-09-06 08:18:11 -07:00
b6047899a8 map fix 2019-09-06 08:12:46 -07:00
3516070b6e map fix 2019-09-06 08:11:20 -07:00
56ec87e00e map fix 2019-09-06 08:03:59 -07:00
fe0b896665 map fix 2019-09-06 07:58:43 -07:00
e4721417e6 map fix 2019-09-06 07:55:36 -07:00
45f5b3b648 map fix 2019-09-06 07:40:32 -07:00
3123102211 root cleanup and add nifty geoip thing 2019-09-06 07:37:44 -07:00
c6141ffbc7 cleanup 2019-09-05 18:06:48 -07:00
c0e92d06a5 faster without const variable second-guessing of the compiler 2019-09-05 17:31:12 -07:00
274b2682d6 cleanup and docs 2019-09-05 15:09:20 -07:00
171d661b84 cleanup 2019-09-05 12:17:04 -07:00
5cea8da664 Optimization and naming cleanup 2019-09-05 12:03:11 -07:00
44dd52d08f KBKDF 2019-09-05 11:39:16 -07:00
70648d006d Merge branch 'dev' into edge 2019-09-05 11:06:27 -07:00
0767ea5d69 * Update default root list to latest
* ARM32 platform build and flag fixes
 * Add a clarification line to LICENSE.txt
 * Fix license message in CLI
 * Windows service now looks for service command line arguments
 * Fixed a bug that could cause excessive queued multicasts
2019-09-05 11:02:16 -07:00
43e6a9e9ee more fastitude 2019-09-05 09:54:30 -07:00
0599c1710b Merge branch 'dev' into edge 2019-09-04 16:41:05 -07:00
abf218a9cd cleanup 2019-09-04 16:38:55 -07:00
55f4f9aaeb cleanup 2019-09-04 16:15:10 -07:00
82b7e1dbcb HMAC fix 2019-09-04 15:22:15 -07:00
e8f8b0f8e5 cleanup 2019-09-04 14:40:36 -07:00
7566d4fbab Merge dev 2019-09-04 14:38:35 -07:00
3a0d385119 Implement changes to AES-GMAC-CTR: four keys with one for each role/purpose instead of just two, and simpler CTR-IV calculation. 2019-09-04 14:37:38 -07:00
8454a14eac new Windows GUID for build #2 2019-09-04 14:25:57 -07:00
ecee310087 Update built-in root list. 2019-09-04 14:17:41 -07:00
bcdab95e4c Windows installer version bump, build fix. 2019-09-04 14:13:45 -07:00
a16377cea5 Add mitigations against borked ARM32 exception unrollers, possibly fix GitHub issue #1003 2019-09-04 12:48:28 -07:00
ef69f1bb27 ARM wrestling 2019-09-04 12:37:54 -07:00
27c8eb0d6d GitHub issue #1019 2019-09-04 12:21:51 -07:00
a465afa83d Merge branch 'dev' into edge 2019-09-04 08:19:39 -07:00
3c0f54257b Debian typo fix 2019-09-04 08:19:33 -07:00
185e90c40f AES-GMAC-CTR tweaks, self test tweaks, debian typo fix. 2019-09-04 08:19:12 -07:00
e29c2d0260 Fix field headers 2019-09-03 15:59:34 -07:00
acf6425ae9 Formatting fix 2019-09-03 15:55:23 -07:00
5e8d49de0f Stats, tweak P2P success rate stat. 2019-09-03 15:48:10 -07:00
1f9456a462 Estimate P2P Success Rate 2019-09-03 15:19:17 -07:00
a7d8285c3a Don't require siblings field 2019-09-03 14:57:54 -07:00
5f1dc4b851 cleanup 2019-09-03 14:57:02 -07:00
b1c22949c5 Cleanup, add support for distributing a new planet file 2019-09-03 14:44:13 -07:00
29be175743 Make relay max hops configurable on roots 2019-09-03 13:17:12 -07:00
b6c5ba264b One more fix for discarding hops exceeded packets. 2019-09-03 13:01:01 -07:00
8e7e3c2b11 Fix max hops. 2019-09-03 12:58:23 -07:00
0e7df129d8 Fix variable shadowing bug. 2019-09-03 12:51:32 -07:00
50709cbd21 Fix siblings in peers list, fix meter. 2019-09-03 12:44:09 -07:00
fd6e8d8c5c Add instrumentation to root, add capability to forward to siblings if no path is known to a peer. 2019-09-03 12:21:57 -07:00
2e7496130c Fix silly thinko in root that harms p2p establishment. 2019-08-30 21:17:34 -07:00
9666ab5797 Merge branch 'dev' into edge 2019-08-30 17:57:11 -07:00
e6ead35884 docs 2019-08-30 17:48:22 -07:00
a6dff8ff2f Add an extra catch as workaround for possible cause of ARM crash. 2019-08-30 17:47:13 -07:00
4281b6b448 Ignore MULTICAST_GATHER replies with the wrong count. 2019-08-30 17:45:10 -07:00
4c08ac7873 Fix MULTICAST_GATHER reply problem in root 2019-08-30 17:34:05 -07:00
5435ec7545 Merge dev 2019-08-30 15:40:00 -07:00
6897f602bf 1.4.6 version bump 2019-08-30 15:30:37 -07:00
8764d50179 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2019-08-30 15:16:21 -07:00
075321fd0d debian build version bump 2019-08-30 15:16:05 -07:00
62cdb8dc94 cleanup 2019-08-30 12:47:19 -07:00
5e8e935189 world! 2019-08-30 11:57:18 -07:00
ebb5f1256f ARM wrestling 2019-08-30 10:03:07 -07:00
7c6d0d3c0f ARM wrestling 2019-08-30 09:50:37 -07:00
9918a1092f JSON fix 2019-08-30 09:39:46 -07:00
7d89511fda JSON fix 2019-08-30 09:38:18 -07:00
795b6d13d1 Simple status output on root of HTTP tree 2019-08-30 09:29:06 -07:00
8328b6f657 Lib fix 2019-08-30 09:10:11 -07:00
9994e591bd More root work and CMake-ify root 2019-08-30 09:08:39 -07:00
b27a38e55e Implement WHOIS 2019-08-29 14:27:41 -07:00
f6d747a5a0 Fix some more multicast stuff (minor) 2019-08-29 12:02:37 -07:00
b7da7574d1 Helps to decompress the packet 2019-08-29 11:40:31 -07:00
dbad9585cd Fix parsing of MULTICAST_GATHER 2019-08-29 11:23:23 -07:00
2d7a97bb94 Fix V4/V6 forwarding issue in root 2019-08-29 10:58:47 -07:00
da19da0360 RENDEZVOUS works now 2019-08-29 08:00:54 -07:00
ee7361ee2e crash fix 2019-08-29 07:25:16 -07:00
6e3e09bed4 Add RENDEZVOUS to high throughput root 2019-08-29 07:17:18 -07:00
86762d2b40 high throughput root is working! 2019-08-28 15:52:18 -07:00
ef12c5af99 . 2019-08-28 15:22:28 -07:00
933404b1dd . 2019-08-28 15:20:34 -07:00
ccec49e444 . 2019-08-28 15:17:16 -07:00
e5f1bf81f7 . 2019-08-28 15:15:21 -07:00
0e627f4f68 . 2019-08-28 15:07:38 -07:00
d33f7d2bf5 . 2019-08-28 14:49:16 -07:00
e07a019615 . 2019-08-28 14:47:05 -07:00
34ca3012e6 . 2019-08-28 14:43:37 -07:00
62634ca2da . 2019-08-28 14:39:31 -07:00
846c96e8d5 . 2019-08-28 14:36:29 -07:00
63775723c1 . 2019-08-28 14:28:07 -07:00
2f7d3e655a . 2019-08-28 14:26:13 -07:00
b19634d7e4 . 2019-08-28 14:21:02 -07:00
a92967a7c1 . 2019-08-28 14:16:14 -07:00
8915b88de5 . 2019-08-28 14:06:45 -07:00
7bca81464b . 2019-08-28 14:04:42 -07:00
b974ece24f . 2019-08-28 13:59:23 -07:00
b1c8e6ad59 . 2019-08-28 13:51:13 -07:00
64f7185e3a . 2019-08-28 13:44:15 -07:00
807cc9afc3 . 2019-08-28 13:40:49 -07:00
0adf306dd4 . 2019-08-28 13:38:52 -07:00
db0f602e86 . 2019-08-28 13:10:36 -07:00
17ec47f5c0 . 2019-08-28 13:09:14 -07:00
cf831d9cd3 . 2019-08-28 13:04:58 -07:00
5e3c633f74 root work 2019-08-28 11:59:13 -07:00
4e4b27b6ab build fix 2019-08-28 11:54:09 -07:00
c0c9590904 High throughput root stuff 2019-08-28 11:49:45 -07:00
24c9577e39 cleanup 2019-08-28 11:28:51 -07:00
59ee0cfe88 Safety upgrades to code 2019-08-28 10:34:32 -07:00
1977b9b764 Use -flto on Mac for release 2019-08-28 07:45:49 -07:00
6f9d1fc14c Merge branch 'dev' into edge 2019-08-28 07:43:36 -07:00
1b6b38e395 Add default addIps() implementation to EthernetTap base class to fix build on systems that do not need addIps(). 2019-08-28 07:43:18 -07:00
8ac59ae2be cleanup 2019-08-28 07:40:13 -07:00
46db37e06c Yield in ticket lock 2019-08-28 07:34:24 -07:00
9d1207b339 Merge branch 'dev' into edge 2019-08-28 07:31:33 -07:00
6e730cfad1 Cleanup, multicast fingerprint, benchmark asymmetric crypto 2019-08-28 07:31:17 -07:00
1cf953c046 working docker image for end users.
GitHub Issue #1013
2019-08-27 16:57:07 -07:00
e5bf4565da readme in central controller docker folder 2019-08-27 15:43:11 -07:00
ddc904a502 remove docker line from readme 2019-08-27 15:27:41 -07:00
5cda292d15 comment out docker docker target from makefile because broken 2019-08-27 15:16:05 -07:00
e51cf0d4d2 moved elsewhere for controller builds 2019-08-27 15:14:55 -07:00
d8de837c60 LinuxEthernetTap addIps virtual function fix for SYNOLOGY builds 2019-08-27 14:43:30 -07:00
199b3345a0 cleanup 2019-08-27 14:42:49 -07:00
b7f504b8a4 cleanup 2019-08-27 14:40:01 -07:00
1b459b0560 cleanup 2019-08-27 14:31:04 -07:00
40803a4dc1 cleanup 2019-08-27 14:25:11 -07:00
6f22570648 Optimization and cleanup 2019-08-26 20:18:28 -07:00
8203547cfc Warning removal. 2019-08-26 20:01:54 -07:00
dad160209e Add -mmacosx-version-min=10.9 2019-08-26 19:54:24 -07:00
8faaaec710 Add check for PCLMUL instruction too. Virtually all CPUs with AES-NI have it but good to be sure. 2019-08-26 19:48:56 -07:00
012fba617d Set SSE/AES-NI flags only on x86/x64 targets. 2019-08-26 19:40:22 -07:00
9ca495229b Revert "optimization stuff"
This reverts commit e63f624d3a.
2019-08-26 19:03:09 -07:00
e63f624d3a optimization stuff 2019-08-26 19:02:28 -07:00
e1dd413266 cleanup 2019-08-26 18:44:56 -07:00
b9ef09dd58 Optimization stuff 2019-08-26 18:15:32 -07:00
990333e7ec cleanup, re-enable AES-NI check 2019-08-26 16:35:28 -07:00
ec9582f3f2 More test vectors, software mode GCM. 2019-08-26 16:24:42 -07:00
ea65386e15 Merge branch 'dev' into edge 2019-08-26 12:22:20 -07:00
ca89695270 Fix make central-controller-docker 2019-08-26 12:19:50 -07:00
a0fd4ad23f Cleanup, Linux build fix. 2019-08-26 12:17:23 -07:00
b6d7a95028 Merge branch 'dev' into edge 2019-08-26 11:09:19 -07:00
91b16310ea * Change license from GPL3 to BSL 1.1, see LICENSE.txt
* Fix an issue with the "ipauth" rule and auto-generated unforgeable IPv6 addresses
 * Fix socket/bind errors setting IPs and routes on Linux
2019-08-26 10:33:26 -07:00
609873e6d1 Windows version bump 2019-08-23 22:10:15 -07:00
4c616621c2 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-08-23 21:38:15 -07:00
05470bf202 Fix RPM targets 2019-08-23 21:38:04 -07:00
633cf9ec04 Warning removal 2019-08-23 21:28:26 -07:00
f3c3a90393 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-08-23 21:24:34 -07:00
25a48f2f44 Fix RedHat sub-version. 2019-08-23 21:24:05 -07:00
1d8f3cee62 cleanup 2019-08-23 21:12:24 -07:00
5ba6e21967 cleanup 2019-08-23 20:34:09 -07:00
52f7f6e6cf Fully implement the packet encryption/decryption algorithms. 2019-08-23 20:20:32 -07:00
9fd5ec673b Get rid of complicated AES-GCM + scramble construct in favor of a simpler construct thanks to "Squeamish Ossifrage" on crypto.stackexchange.com 2019-08-23 18:41:21 -07:00
e905b3c963 cleanup 2019-08-23 17:22:23 -07:00
d214a5437f Bump Mac pkg version 2019-08-23 15:24:52 -07:00
f12370c348 more opt 2019-08-23 12:40:08 -07:00
b727e2a67a More opt stuff 2019-08-23 12:34:45 -07:00
8e87319925 Optimization stuff 2019-08-23 12:18:02 -07:00
1ab29b1ab0 Merge branch 'dev' into edge 2019-08-23 12:11:07 -07:00
de0a5aa840 GitHub issue #994 2019-08-23 12:09:31 -07:00
52d55e34e6 Licenses, and use full strength AES-128 in scramble. 2019-08-23 12:03:13 -07:00
c79360f58b Merge dev 2019-08-23 11:37:40 -07:00
6f9e3e3b78 Back out unnecessary hack 2019-08-23 11:14:17 -07:00
5c5e7fc7ff Merge branch 'dev' of https://github.com/zerotier/ZeroTierOne into dev 2019-08-23 11:13:13 -07:00
43e98930e9 distro cleanup 2019-08-23 11:12:25 -07:00
51ebefc3ab Ifdef these to stop non-Windows IDEs from complaining. 2019-08-23 10:34:37 -07:00
86add4a6d3 Tolerate any libstdc++6 package "version" for Mint and other distros with weird versions on libstdc++6. 2019-08-23 10:31:12 -07:00
221a3f9a08 Merge branch 'dev' of http://10.187.0.8/zerotier/ZeroTierOne into dev 2019-08-23 10:20:04 -07:00
2f74bd5150 Add "make docker" for GitHub issue #1013 2019-08-23 10:19:59 -07:00
e8ae333443 Version bumps, license fixed, and GitHub issue #990 take two 2019-08-23 10:15:13 -07:00
8057c826bc cleanup 2019-08-23 09:34:26 -07:00
6f6138c500 Merge relicensing change from dev 2019-08-23 09:27:13 -07:00
52a166a71f Relicense: GPLv3 -> ZeroTier BSL 1.1 2019-08-23 09:23:39 -07:00
903a18db1d work in progress 2019-08-23 08:41:22 -07:00
0731f3f1a9 wiring more stuff up, and simplification of timing loops 2019-08-23 07:04:20 -07:00
37047a39f9 More cleanup, and fix SHA384 built-in C code. 2019-08-22 14:52:47 -07:00
91d0cbe892 cleanup 2019-08-22 13:08:10 -07:00
b66431bc29 Work in progress... 2019-08-22 13:06:08 -07:00
0e18b14087 Merge branch 'dev' into edge 2019-08-21 14:58:26 -07:00
31bd413166 stub out new verbs 2019-08-21 14:57:57 -07:00
95a6fce2b4 Yet more cleanup, it builds again now. 2019-08-21 14:36:56 -07:00
0b5472f9fb Tons and tons of cleanup and cruft removal 2019-08-21 14:24:45 -07:00
5280d28505 cleanup 2019-08-21 10:44:52 -07:00
67a9898a99 Bunch more work on DNS, cleanup, removal of obsolete cruft. 2019-08-21 09:27:45 -07:00
509da3ac34 Merge pull request #1012 from wendelb/wendelb-patch-1
Controller-Docs little cleanup
2019-08-21 08:14:38 -07:00
fe8815f80f cleanup 2019-08-20 15:36:18 -07:00
3a21fdc304 Crypto work, packet work 2019-08-20 15:34:30 -07:00
83d723eb79 type 1 (P-384) identities 2019-08-20 13:32:23 -07:00
6e771607c0 cleanup 2019-08-19 20:35:16 -07:00
e73b220104 cleanup 2019-08-19 20:30:34 -07:00
5c1fc43610 cleanup 2019-08-19 20:29:24 -07:00
cfbd7e3bf5 Add stubs to easily build and include all of libnatpmp and miniupnpc in osdep/ 2019-08-19 20:28:44 -07:00
c8ca1cfa3c Kill old inline software update, we will use https and secondary auth for new versions. 2019-08-19 19:24:23 -07:00
5cfbb0a423 Clean up dead stuff from OneService and fix build errors. 2019-08-19 19:21:33 -07:00
900ec143a8 . 2019-08-19 16:45:29 -07:00
7bda3d0f74 put sse4.1 back 2019-08-19 15:49:13 -07:00
7650786fb5 cleanup, Locator fix and self-test 2019-08-19 15:43:15 -07:00
ca60d08621 cleanup, scrambler functions 2019-08-19 12:49:33 -07:00
b34218c8c2 auto-set -j option in makefile, and split out cmake setup rule 2019-08-19 10:06:39 -07:00
b14a59629c cleanup 2019-08-19 06:58:42 -07:00
fe18579061 Removed duplicate line creationTime 2019-08-17 22:50:13 +02:00
0914bf8cf0 Some ARM NEON code (not finished) 2019-08-16 19:22:03 -07:00
7bdca83de3 Add decrypt 2019-08-16 18:40:22 -07:00
846f03504e Add DNS TXT resolver (need one for Windows) 2019-08-16 16:49:30 -07:00
01e8fd0b07 The newer C ed25519 is the same speed as the old ASM, so drop it to simplify. 2019-08-16 14:42:38 -07:00
7f301c44b7 more cleanup 2019-08-16 14:26:45 -07:00
51a25fdec9 Remove ASM Salsa20 since it will not be the default in 2.x any more... reduce build complexity. 2019-08-16 14:26:25 -07:00
2b681c37ac Consolidate common compiler flags 2019-08-16 11:42:43 -07:00
cb4ebfdbd2 Dragging adam into CMake kicking and screaming :) 2019-08-16 10:45:14 -07:00
206c85222c Fix Constants.hpp inclusion of version.h 2019-08-16 09:52:13 -07:00
18071e038e Fix MacEthernetTapAgent & Cmake integration 2019-08-16 09:44:31 -07:00
39f7ce15ad mac compiler flags 2019-08-15 17:40:21 -07:00
e39b42bbd3 fixing some CMake stuff on Linux 2019-08-15 17:29:33 -07:00
607d8f72e8 cruftectomy 2019-08-15 15:43:35 -07:00
c483f75fb4 cleanup 2019-08-15 15:32:16 -07:00
81f0175251 cleanup 2019-08-15 14:14:49 -07:00
f753519729 A bit more optimization 2019-08-15 14:07:52 -07:00
f39693f97e cleanup 2019-08-15 13:52:23 -07:00
f83ae0e39e Add self-test for AES and AES-GCM using public test vectors. 2019-08-15 13:47:43 -07:00
521d371b5d A bunch more refactoring to rip out obsolete stuff related to old root system and general cleanup. 2019-08-15 10:49:50 -07:00
b23d551d00 cleanup 2019-08-14 16:05:09 -07:00
1b20cc6075 More optimization and cleanup 2019-08-14 15:59:45 -07:00
2043e12ac2 . 2019-08-14 15:50:25 -07:00
9461bc948f . 2019-08-14 15:28:10 -07:00
9740ab8bd6 more cleanup 2019-08-14 15:17:06 -07:00
6947a6b1d4 more cleanup 2019-08-14 15:12:49 -07:00
4da8036222 More refactor 2019-08-14 15:00:18 -07:00
e6b4006c70 Refactoring to eliminate duplicated code 2019-08-14 14:55:37 -07:00
8f5f7f1baa More work in progress 2019-08-14 12:48:45 -07:00
573d3eea87 Merge branch 'dev' into edge 2019-08-14 10:53:03 -07:00
2ec53df7ab Put a limit on the multicast TX queue to prevent memory use ridiculousness. 2019-08-14 10:52:21 -07:00
eb84eec0f4 Merge branch 'dev' into edge 2019-08-14 10:48:07 -07:00
1c7b553331 GitHub issue #1000 2019-08-14 10:47:58 -07:00
d7a31088ba Cleanup, warning removal, cppcheck informed cleanup. 2019-08-14 10:35:57 -07:00
a028e04ab9 Merge branch 'dev' into edge 2019-08-13 15:51:19 -07:00
a0fb519696 Make sure libstdc++ is in RH spec file 2019-08-13 12:58:14 -07:00
83e6864b78 Version bump in Linux packages for new binaries. 2019-08-13 09:34:56 -07:00
a0520536df . 2019-08-13 08:49:25 -07:00
af137fd5d3 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2019-08-12 15:37:55 -07:00
f7bc9f01c9 More AES stuff 2019-08-12 15:37:50 -07:00
e4ce1ffd85 Windows detection of AES-NI 2019-08-12 15:28:42 -07:00
2384b49156 set cmake windows build target to Windows 7 2019-08-12 15:28:30 -07:00
f5e71f64ed Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2019-08-12 13:27:07 -07:00
927ef22cf8 Merge branch 'dev' into edge 2019-08-12 13:27:00 -07:00
b6eaec1278 run selftest 2019-08-12 13:26:34 -07:00
c7d1eb71da build & run selftest as part of jenkins 2019-08-12 13:25:14 -07:00
98af3c0dc1 * Fix high CPU use bug on some platforms
* Fix issues with PostgreSQL controller DB (only affects Central)
 * Restore backward compatibility with MacOS versions prior to 10.13
2019-08-12 13:25:12 -07:00
7d41d267a3 silencing warnings for code paths that will never be hit 2019-08-12 13:18:21 -07:00
0ead65ad2d change this 2019-08-12 13:11:43 -07:00
8c5481a3d5 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2019-08-12 12:58:20 -07:00
741258051e this should work better 2019-08-12 12:58:10 -07:00
0f4fc8635b Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2019-08-12 12:51:38 -07:00
d02d3f72fe AES-GCM code 2019-08-12 12:51:32 -07:00
710b69fc75 kill build dir before jenkins build 2019-08-12 12:44:47 -07:00
4fae382ffd Auto-generate version.h 2019-08-12 12:43:51 -07:00
68b94a3188 CMake for edge branch 2019-08-12 12:35:07 -07:00
8e04f83232 Merge branch 'edge' into cmake 2019-08-12 12:24:25 -07:00
cc9fd9f8ce Merge branch 'dev' into cmake 2019-08-12 12:23:36 -07:00
1e8fcf1344 Add AES to build 2019-08-09 13:42:40 -05:00
809c8305b1 AES code 2019-08-09 10:54:08 -05:00
652c7e8f37 Locator work 2019-08-08 23:23:16 -05:00
beebca98fe Merge branch 'dev' into edge 2019-08-08 19:42:16 -05:00
5341c216a7 Comment ugly query 2019-08-08 19:20:01 -05:00
96a0c3d764 ugly query is ugly 2019-08-08 19:16:11 -05:00
783b49e383 more worky less not worky 2019-08-08 18:58:22 -05:00
ce67abc32f Merge branch 'dev' into edge 2019-08-08 18:49:03 -05:00
d4dc983a01 fix bad column name 2019-08-08 18:31:41 -05:00
72ccd1020a Another exception fix 2019-08-08 18:11:06 -05:00
6a9a577c59 rulesSource needs to be required in network or pgsql has issues 2019-08-08 17:56:27 -05:00
730305ecc7 One more sync fix. 2019-08-08 17:31:32 -05:00
f8f2432ece Shutdown fix 2019-08-08 17:22:20 -05:00
55087521f6 Add periodic sync check when syncing LF<>another DB 2019-08-08 17:20:50 -05:00
760ae07d72 Sync bug fix 2019-08-08 16:30:52 -05:00
52cc482521 Merge branch 'dev' into edge 2019-08-08 15:59:58 -05:00
28d0070ce2 Fix race in multiple DB mirroring configurations. 2019-08-08 15:29:13 -05:00
ad2a7c2590 More windows build fixes 2019-08-08 15:15:12 -05:00
5eacad444d workinprogress 2019-08-08 15:03:52 -05:00
8b97755fc5 Windows fixes. 2019-08-08 14:08:35 -05:00
e8155cbbeb Merge dev 2019-08-08 13:05:28 -05:00
7bb0d9be1b warning removal 2019-08-08 11:04:11 -05:00
6c44fcc290 more warning cleanup 2019-08-08 10:28:57 -05:00
c8e7031198 warning cleanup 2019-08-08 10:01:57 -05:00
fb3b2820b5 centos 7 docs 2019-08-08 09:50:05 -05:00
663376e385 cleanup 2019-08-08 08:42:27 -05:00
3c590994db Finish up ECC384 identity generation. 2019-08-07 23:50:47 -05:00
14c8564893 Merge branch 'dev' into edge 2019-08-07 22:35:27 -05:00
91a37f8868 Add base64 code (unpadded standard alphabet) 2019-08-07 22:35:17 -05:00
c83a4aef55 cleanup 2019-08-07 21:47:06 -05:00
af7a70bf02 cleanup 2019-08-07 21:11:48 -05:00
1a2ff884b3 Merge branch 'dev' into edge 2019-08-07 19:08:35 -05:00
4d70640a15 Remove debug line 2019-08-07 19:06:02 -05:00
b11627a8bc add SDK VirtualTap to new factory method 2019-08-07 18:45:04 -05:00
7436f85ad0 Require MacOS 10.10 2019-08-07 18:22:03 -05:00
237c379866 Choose which tap to use (feth or kext) on Mac based on Darwin version. 2019-08-07 18:20:17 -05:00
aca31c7055 Put kext back in Mac distro and use on versions older than High Sierra (which lack the feth device) 2019-08-07 18:14:12 -05:00
0298719be0 Use SHA384 with ECC384 to match FIPS / Suite B recommendation. 2019-08-07 17:06:03 -05:00
d0746da5e2 Add SHA384 support, more cleanup 2019-08-07 16:41:58 -05:00
5b1cf33b1b Merge branch 'dev' into edge 2019-08-07 11:31:32 -05:00
6073e7972f Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-08-07 11:24:04 -05:00
f7e8d8f1dd Fix LFDB path issue when using with Postgress in DBMirrorSet config 2019-08-07 11:23:48 -05:00
54a1bbd016 . 2019-08-07 11:20:12 -05:00
87016ae815 network update to upsert 2019-08-06 15:30:50 -07:00
455cd5551b . 2019-08-06 17:06:39 -05:00
3ed8e46782 Use devtoolset-8 on RHEL/CentOS 7 2019-08-06 16:46:41 -05:00
b3e1783658 . 2019-08-06 16:46:13 -05:00
906c83af83 Merge branch 'dev' into edge 2019-08-06 15:47:54 -05:00
3db0197865 Add try/catch in LFDB and add introspection into multicast subscriptions in client network status API 2019-08-06 15:22:57 -05:00
f9900cc6fb Merge dev to edge 2019-08-06 14:13:07 -05:00
6174c0c103 Fix deadlock bug. 2019-08-06 13:20:37 -05:00
8898cb342b . 2019-08-06 13:12:45 -05:00
9cc76d1115 Remove debug line 2019-08-06 11:01:08 -05:00
5289d3327c Build fixes 2019-08-06 11:00:35 -05:00
00fb9c475e More work on DB mirroring. 2019-08-06 10:42:54 -05:00
3c776675b3 Cruftectomy, work in progress on mirrorring 2019-08-06 08:51:23 -05:00
37d508ab96 Refactoring in prep for mirroring 2019-08-06 07:51:50 -05:00
f4f8fef82e LFDB fix 2019-08-05 15:30:03 -05:00
cd2e3c79f2 Windows AIP version bump 2019-08-04 20:27:09 -07:00
7722350178 Version bump to 1.4.2 for all but Windows AIP 2019-08-04 20:13:12 -07:00
a77b4ecddb Add optional function in DB change listener for member online events. 2019-08-04 19:55:52 -07:00
818b7e4a2e GitHub issue #993 (???) 2019-08-04 15:35:43 -07:00
00d63f6046 GitHub issue #993 (???) 2019-08-04 15:15:02 -07:00
639fc60257 GitHub issue #990 2019-08-04 15:08:33 -07:00
21467596bc Merge branch 'remove_network_status_table' into dev 2019-08-04 12:38:12 -07:00
75ebe5172f Fix for sharing of capabilities in 1.4 (problem introduced when push frequency was reduced) 2019-08-02 20:43:02 -07:00
4a9030b4a0 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-08-02 13:59:10 -07:00
fdc708a624 GitHub issue #979 2019-08-02 13:59:03 -07:00
8e20187d8c set OS X deployment target to 10.9 2019-08-01 15:58:32 -07:00
28dac7ff0e build MacEthernetTapAgent 2019-08-01 15:41:50 -07:00
e385b3d377 Merge branch 'dev' into cmake 2019-08-01 15:16:31 -07:00
7e5c68c553 update jenkins to use cmake for builds 2019-08-01 15:13:06 -07:00
39ad7bc741 update cmake to add LFDB and force C++11 2019-08-01 14:36:35 -07:00
c2f9aab068 Merge branch 'master' into cmake 2019-08-01 13:49:30 -07:00
67beea1e3d Batch file to clean Windows build dir 2019-08-01 13:21:36 -07:00
34364ab8ee Bump version 2019-07-31 16:41:35 -07:00
bb99ef1351 Get rid of online status stuff in FileDB, not necessary at all. 2019-07-31 16:41:12 -07:00
b3891e5506 Version 1.4.0.1: bug fix for Mac multicast and IPv4 issues, no change for other platforms 2019-07-31 13:27:08 -07:00
632d6e04ad Mac multicast bug fix -- GitHub issue #986 2019-07-31 13:25:58 -07:00
db813db7e8 2019-07-29 -- Version 1.4.0
Major Changes

 * Mac version no longer requires a kernel extension, instead making use of the [feth interfaces](https://apple.stackexc
 * Added support for concurrent multipath (multiple paths at once) with traffic weighting by link quality and faster rec
 * Added under-the-hood support for QoS (not yet exposed) that will eventually be configurable via our rules engine.

Minor Changes and Bug Fixes

 * Experimental DB driver for [LF](https://github.com/zerotier/lf) to store network controller data (LFDB.cpp / LFDB.hpp
 * Modified credential push and direct path push timings and algorithms to somewhat reduce "chattiness" of the protocol
 * Removed our beta/half-baked integration of Central with the Windows UI. We're going to do a whole new UI of some kind
 * Fixed stack overflow issues on Linux versions using musl libc.
 * Fixed some alignment problems reported on ARM and ARM64, but some reports we could not reproduce so please report any
 * Fixed numerous other small issues and bugs such as ARM alignment issues causing crashes on some devices.
 * Windows now sets the adapter name such that it is consistent in both the Windows UI and command line utilities.
2019-07-29 16:11:06 -07:00
837c6270f2 More docs 2019-07-29 15:14:37 -07:00
8c3c07cb5d docs 2019-07-29 13:50:02 -07:00
5cc0dd7f55 Windows installer version bump 2019-07-29 12:36:10 -07:00
79c4d98b61 docs 2019-07-29 12:10:39 -07:00
678e11530e 1.4 bump 2019-07-29 12:07:44 -07:00
a8f2b39f15 Windows project fixes 2019-07-29 11:05:46 -07:00
add2ac0369 Merge pull request #963 from atopuzov/armv6l
Fix compiling on Raspberry PI Zero W on Arch Linux
2019-07-29 10:23:09 -07:00
1e475edd1c Merge pull request #973 from unquietwiki/patch-1
Update Dockerfile
2019-07-29 10:22:36 -07:00
745483708a Merge pull request #974 from squeakbat/master
Don't relink zerotier-one every time.
2019-07-29 10:21:35 -07:00
d9432f2f1e cleanup 2019-07-29 10:19:20 -07:00
eb7081d2a3 Fix for detecting changes in LF from other instances of the same controller. 2019-07-26 19:28:09 -07:00
d9befe3fb3 Debug code removal 2019-07-26 18:51:50 -07:00
0618452615 LF masking key should be a secret 2019-07-26 17:44:05 -07:00
f6b080b8a2 Abstract out change listener from controller itself to permit DBs to shadow changes from other DBs. 2019-07-26 17:39:00 -07:00
c8c33db1d1 . 2019-07-26 16:03:21 -07:00
196bac726c Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-07-23 16:06:40 -07:00
ac2688de58 More LFDB work 2019-07-23 16:06:35 -07:00
d2af12b6a0 Forgot to add ZT_DISABLE_COMPRESSION to linux makefile 2019-07-23 13:33:25 -07:00
6958ba9557 Added ZT_DISABLE_COMPRESSION build flag for SDK and low-end NAS builds 2019-07-23 12:39:07 -07:00
5f11daadf2 Build fix 2019-07-23 09:30:40 -07:00
99df3fe433 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-07-23 09:29:12 -07:00
d4d350a285 Work in progress 2019-07-23 09:29:08 -07:00
8a0b75c83a Added LFDB.o to objects.mk 2019-07-22 15:24:16 -07:00
9cf74657e0 Commented out rtnetlink error debug trace 2019-07-22 14:12:21 -07:00
5edd04638d LFDB work in progress 2019-07-22 13:43:06 -07:00
eb2f851e65 Don't relink zerotier-one every time.
Because zerotier-one depends on "one", which is a phony target,
making it relinks zerotier-one every time, which is probably
not the desired behavior.

In any case, zerotier-one, zerotier-cli, and zerotier-idtool are
real target, so they should have real dependencies and actions.
The "one" target now depends on these three files.

Behavior is mostly unchanged otherwise.
2019-07-21 21:37:01 -07:00
a0f47b12b4 Removed Synology-specific home path, changes made elsewhere in SPK 2019-07-19 16:34:31 -07:00
1b2d9e202e Remove 44/8 as pseudoprivate since it is now partly global. 2019-07-19 13:33:14 -07:00
daa8839005 Update Dockerfile
Update Dockerfile to use Debian 10 + pull the main.sh directly from Github; works for Portainer use.
2019-07-18 17:48:41 -07:00
7e105343e2 WIP 2019-07-17 16:53:33 -05:00
fe2215df00 TON of refactoring, moon/planet is DEAD, ECC P-384 is integrated (but not enabled), and multicast work and cleanup. Whew. 2019-07-17 10:52:08 -05:00
80124bb753 Update release notes 2019-07-16 15:34:26 -07:00
640bbaabbf Safer value 2019-07-16 17:28:42 -05:00
da2965cb4e P-384 test vectors 2019-07-16 17:25:25 -05:00
861a319014 Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev 2019-07-16 15:20:05 -07:00
d43e810ecb Finally figured out how to update the network interface names on Windows so that they'll be visible in ipconfig, Get-NetAdapter etc. 2019-07-16 15:16:49 -07:00
94ba242c33 Nist P-384 guts and glory 2019-07-16 16:09:14 -05:00
7afcc17024 no usleep() on Windows 2019-07-16 13:09:10 -07:00
2ab2f68725 Add a central database schema version check to central controller startup 2019-07-16 12:15:38 -07:00
debd5a5c5e Add capability for P2P multicast propagation, and some cleanup. 2019-07-16 13:33:11 -05:00
98bbb84a63 Merge branch 'dev' into edge 2019-07-15 19:40:52 -05:00
90872c906f Fix FileDB stuff and latency measurement. 2019-07-15 16:30:34 -05:00
bdc2ec1f5e Track online status in FileDB 2019-07-15 15:27:53 -05:00
692733fffb Don't write to ztc_network_status table anymore in central controller 2019-07-15 13:00:16 -07:00
9d908a11ed Some new stuff, may not live forever... 2019-07-15 13:57:42 -05:00
d3728d5859 cleanup 2019-07-10 21:30:11 -04:00
389331ca29 Ticket #915, added allowSecondaryPort to optionally force ZT to use a single port 2019-07-09 10:31:03 -07:00
b2c4b7e99f Version bunmp 2019-07-09 10:36:25 -04:00
fee6aae442 Drop in faster C25519 agreement code. 2019-07-09 10:31:08 -04:00
409406d114 Whoops 2019-07-08 12:36:49 -07:00
203414910f Give up to a second for the interface to appear to assign IP addresses 2019-07-08 12:33:26 -07:00
ac0082a67e Update README.md 2019-07-02 11:56:19 -07:00
9ccbe85923 Fix compiling on Raspberry PI Zero W on Arch Linux
* Should also fix it for Raspberry PI 1
* "gcc -dumpmachine | cut -d '-' -f 1" reports armv6l
2019-07-01 14:56:02 +01:00
dffbd2113a Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-06-28 11:20:49 -07:00
7db073d993 Start 1.4.0 release notes. 2019-06-28 11:20:38 -07:00
3c02c2e4bd Windows installer bump 2019-06-28 08:48:06 -07:00
a17c760181 Fix Mac installer 2019-06-27 14:36:31 -07:00
54d2fa65dd Version bump, cleanup 2019-06-27 14:31:10 -07:00
a019c3dd5d Tighten up credential push just a bit for faster up-time with older nodes, should not have significant impact on bandwidth. Also some cleanup and push direct path timing fixes. 2019-06-25 13:42:20 -07:00
a3ef9b8a15 Cleanup 2019-06-25 10:06:50 -07:00
4d599e2f9f Linux build with CMake 2019-06-21 15:16:20 -07:00
d3b33e5512 Can now build the Windows UI via CMake as well 2019-06-21 12:54:53 -07:00
c8487cc395 no message 2019-06-20 16:15:19 -07:00
0b3b5f6174 Beginning CMake configuration for ZT
Only tested on Windows so far
2019-06-20 16:13:52 -07:00
554e0b7c6d Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-06-20 15:20:46 -07:00
fd74e2a583 Windows build changes for 1.2.99 (1.4.0pre) 2019-06-20 15:20:42 -07:00
af5d3a7f0b dockerfile updates 2019-06-20 14:17:38 -07:00
bb0808c99c Remove current multithreaded receive path, which is not that efficient. We will do something better in the future. 2019-06-19 10:19:59 -07:00
f0295b154b Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-06-17 15:50:11 -07:00
b041de831a More stack->heap 2019-06-17 15:50:05 -07:00
21e844cd82 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2019-06-17 15:32:27 -07:00
4e2439bd12 Don't call _phy->getIfName if localSocket is -1 2019-06-17 15:32:21 -07:00
c5a07c7f20 More stack->heap 2019-06-17 15:28:02 -07:00
e2900f4f3c Fix valgrind warning... not sure if it is an actual issue. 2019-06-17 15:23:52 -07:00
aa831dd843 More stack->heap... 2019-06-17 14:55:33 -07:00
2dc783214c Allocate outp on heap in Peer. 2019-06-17 14:38:27 -07:00
523df47a65 Check for null data ptr 2019-06-17 14:02:35 -07:00
f66fac3982 Win32 build fix 2019-06-17 13:48:42 -07:00
9c51ce9c40 Windows build fixes, fix double/float types to get rid of warnings. 2019-06-17 13:32:41 -07:00
9797540212 merge 2019-06-13 12:53:05 -07:00
ce2338c24a Fix null ptr on managed routes if no IPs are set. 2019-06-13 12:52:38 -07:00
3b188ba672 no message 2019-06-13 10:38:42 -07:00
eb84d61deb remove these from jenkins for now 2019-06-13 10:35:54 -07:00
47d29ddcaf Compiler warning cleanup 2019-06-13 10:28:09 -07:00
f411eb1651 Remove old RethinkDB.cpp/.hpp files from visual studio project 2019-06-13 10:15:45 -07:00
94bd2918fa Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2019-06-12 13:14:23 -07:00
c3bfcf560b Removed check for port number in multipath path replacement logic 2019-06-12 13:14:14 -07:00
5b2b088714 Cleanup, version bump. 2019-06-11 14:58:23 -07:00
0bdfad52e7 docs 2019-06-11 13:51:10 -07:00
cf046a4039 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-06-11 11:01:20 -07:00
700cc92083 Indent fix 2019-06-11 11:01:12 -07:00
2eb9c0924a Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2019-06-11 10:54:14 -07:00
ebadc6f203 Added s390x arch flags to makefile and ZeroTierOne.h for ticket #950 2019-06-11 10:54:06 -07:00
87bce1a36b GitHub issue #886 2019-06-11 10:53:35 -07:00
848f822171 . 2019-06-06 10:04:11 -07:00
d4199ddb3e Commented out RingBuffer::dump() as an alternative solution to PR #952 2019-06-03 11:00:04 -07:00
e4abc91d35 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2019-05-31 15:10:53 -07:00
37d321afc8 dont spin as much in the onlineNotificationThread 2019-05-31 15:10:45 -07:00
541e5c510e CLI improvements (peers, and get/set ip, ip4, ip6, etc) 2019-05-31 11:41:24 -07:00
90d324ae96 Fixed ZT_SDK build issue. Moved ZT_SDK preprocessor directives to more permanent homes 2019-05-17 10:15:40 -07:00
cacdb445c7 Bump protocol version to 10 2019-05-14 13:54:27 -07:00
4743ad0b16 Added convenience swtich for disabling JSON support in SDK build 2019-05-13 12:24:55 -07:00
2d5c6fa975 Disabled compression for outbound packets in SDK build 2019-05-13 12:24:22 -07:00
95ef13f7a1 Added divisor for ZT_PEER_ACTIVITY_TIMEOUT, gives quicker indication to status change in SDK 2019-05-13 12:24:01 -07:00
298e1d5a74 Added 90x90 AppIcon 2019-05-01 12:53:50 -07:00
87c75d033e pt 2 2019-04-22 11:36:14 -07:00
71ae678930 Make things compile with Android NDK again 2019-04-22 11:35:35 -07:00
6a027c9c0a amqp_consume_message now has a timeout
RabbitMQ::consume() will return an empty string if the call to amqp_consume_message times out
2019-04-18 14:57:06 -07:00
6014df2847 fix compile & sql errors 2019-04-04 15:11:01 -07:00
55a9e6e05e Queue up inserts in onlineNotificationThread() into a multiple insert statement 2019-04-04 12:40:49 -07:00
02f0eead1c More new Mac ethernet tap bugs. 2019-03-29 15:14:03 -07:00
d77846dcea Add bigness to buffers to prevent overflow on high traffic (Mac tap). 2019-03-29 12:45:02 -07:00
92c811deb7 Destroy feth devices before creating to delete old ones if they were left behind (MacEthernetTap). 2019-03-29 12:14:03 -07:00
92f199ab98 More bug fixing for AARCH64. 2019-03-28 22:40:28 +00:00
b65feeba85 One more AARCH64 fix. 2019-03-28 15:23:53 -07:00
6914425b03 cleanup 2019-03-28 13:58:19 -07:00
89f57124b2 Never mind, only unused on some builds so leave them there. 2019-03-27 09:30:45 -07:00
65823332d4 Comment out some unused functions. 2019-03-27 09:29:34 -07:00
ee8682ac75 Temporarily disable the symmetric NAT port prediction code since the current version adds protocol overhead and probably is not that effective. 2019-03-26 15:23:51 -07:00
e3e5137757 Fix more alignment hell in LinuxNetLink for AARCH64 and probably other pedantic architectures. 2019-03-25 22:53:06 +00:00
d81549a7b1 Various other fixes including removal of more mem*() issues and netlink fixes for AARCH64. 2019-03-25 22:19:52 +00:00
d5ac8512e3 ... 2019-03-25 12:58:43 -07:00
f23e354272 Nope, more... 2019-03-25 12:56:03 -07:00
6475e1faf6 I think this is the last one. 2019-03-25 12:53:31 -07:00
752fc0742e More mem*() stuff... sigh... 2019-03-25 12:52:19 -07:00
e1091611da More mem*() stuff... 2019-03-25 12:41:59 -07:00
678116b6d1 One more. 2019-03-25 12:36:54 -07:00
0a9e2227e8 ... and more 2019-03-25 12:00:54 -07:00
2600b1f144 Removal of more mem*() calls. 2019-03-25 11:59:14 -07:00
b56753ea9f Get rid of some mem* calls that are bad C++ form (but worked fine) and cause warnings. 2019-03-25 11:45:32 -07:00
97046b265c Kill ZT_FAST_MEMCPY in selftest. 2019-03-22 15:52:16 -07:00
2966eac64f Get rid of ZT_FAST_MEMCPY because this is not really needed. 2019-03-22 15:50:15 -07:00
d530356055 RingBuffer<> is now templated with size, buffer is now static. 2019-03-22 14:39:52 -07:00
af3ec000a0 Merge branch 'dev' into edge 2019-03-22 09:38:41 -07:00
8051127c3b Update credits. 2019-03-21 16:43:53 -07:00
e37eb0aa54 More cleanup of old stuff no longer used. 2019-03-21 16:42:52 -07:00
130fa35bb1 cleanup 2019-03-21 16:39:56 -07:00
39e1021f62 Replace certificate based gating of multicast like/gather with a simpler more efficient method, fix some minor issues with request based com/cert push, and clean up some other random stuff. 2019-03-21 16:18:49 -07:00
63ec19674c . 2019-03-19 16:43:43 -07:00
af60e769b0 Allow mac users to make central-controller
Made the smallest change I could figure out.
Had to remove -Werror because something in the postgres adapter woudn't
compile.

brew install postgresql rabbitmq-c
and seems to put the libs in the right place
2019-03-18 17:01:05 -07:00
087c75d5ee More cleanup. 2019-03-14 16:40:22 -07:00
e03102dbcb Clean out some unnecessarily pedantic auth stuff in favor of a simpler way of gating multicast gathers. 2019-03-14 14:29:15 -07:00
9d7b7c72b2 Merge branch 'dev' into edge 2019-03-14 13:49:49 -07:00
99c3f02343 Update controller readme
Delete `/controller/network/<network ID>/active` docs

re: #921
2019-03-12 13:02:49 -07:00
95bfc29c92 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2019-03-11 12:26:57 -07:00
e3cc7c9a80 fix non-central controller builds 2019-03-11 11:16:44 -07:00
d4c0349de9 Revert "#ifdef'd out multipath/QoS statistics buffers allocations for ZT_PROTOCOL_VERSION<10"
This reverts commit 270debb3fc.
2019-03-11 09:44:40 -07:00
d7a6357393 Merge branch 'dev' into edge 2019-03-08 13:16:02 -08:00
6fbf21b4f0 Use a smaller MTU, which should not impact throughput since 2800+overhead/2 still fits in two of these. 2019-03-08 13:15:47 -08:00
993d850f69 more logs 2019-03-08 10:50:33 -08:00
cda07b20a2 add mutex to channel numbering 2019-03-08 10:29:36 -08:00
52c85aa605 now with more -fPIC 2019-03-08 10:29:19 -08:00
e5155df6d5 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2019-03-08 10:21:19 -08:00
293d2064c4 librabbitmq built with same clang version as zt 2019-03-08 10:20:53 -08:00
171cc3e01a reorder a couple of things 2019-03-08 10:20:19 -08:00
8141043560 finish up rabbitmq integration 2019-03-06 16:16:49 -08:00
9a3cc93d74 update dockerfile to generate rabbitmq config settings when necessary 2019-03-05 15:47:04 -08:00
fcb4221f97 rabbitMQ implementation 2019-03-05 15:11:50 -08:00
1f13374a4f added struct for rabbitmq config 2019-03-04 17:01:16 -08:00
801401a6e7 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2019-03-04 16:31:36 -08:00
de1fc43cc5 added librabbitmq library for central controller 2019-03-04 16:27:39 -08:00
270debb3fc #ifdef'd out multipath/QoS statistics buffers allocations for ZT_PROTOCOL_VERSION<10 2019-03-01 13:28:00 -08:00
59a0a25f35 Merge branch 'controller-live' into dev 2019-03-01 11:13:49 -08:00
a788486803 Remove /controller/network/<network ID>/active from controller documentation as that path no longer exists.
GitHub Issue #921
2019-02-25 12:13:55 -08:00
3d21f0a91f update docker registry used 2019-02-08 10:40:57 -08:00
f726044e29 no message 2019-02-05 11:48:03 -08:00
a4b1917361 Fixed a bug where UI elements were attempting to be updated in a background thread.
Also code cleanup & removed confusing startup UI
2019-02-05 11:47:37 -08:00
a3b2aeb001 Take netmask bits from most specific route. 2019-02-01 14:06:34 -08:00
5b1ef2fb03 Take netmask bits from most specific route. 2019-02-01 14:05:29 -08:00
d0f78f1e03 Bugfix for heap-use-after-free in concurrent packet processing code (manifests only after terminate() is called) 2019-02-01 11:50:52 -08:00
541e91ed8e Fixed potential memory leak in RingBuffer 2019-02-01 11:44:43 -08:00
321cada1d7 Wrong criteria was wrong. Now with less wrong. 2019-02-01 11:38:19 -08:00
34c1023ba7 Wrong criteria was wrong. Now with less wrong. 2019-02-01 11:37:30 -08:00
82a21d4b71 Bugfix for heap-use-after-free in concurrent packet processing code (manifests only after terminate() is called) 2019-01-30 22:29:51 -08:00
23996c7e6b Fixed potential memory leak in RingBuffer 2019-01-27 14:43:29 -08:00
d7091a0bac Fixed sign-comparison compile warnings in QoS code 2019-01-25 13:24:31 -08:00
7414418e2e insert/update host_port on controller start 2019-01-21 11:29:13 -08:00
2294770e56 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2019-01-21 11:18:25 -08:00
d98bdb5643 WIP: Pass listen port down to Postgres 2019-01-21 11:18:20 -08:00
21f4f16e63 Disable HTTP control plane for libzt builds, introduction of getRoutes() for SDK API 2019-01-14 11:34:46 -08:00
0e597191b8 Updated licenses for 2019 2019-01-14 10:25:53 -08:00
001ba1a4a7 Update link to knowledge base. 2019-01-09 10:19:02 -08:00
b59c4a2106 Print error & exit on local.conf parsing error 2019-01-07 11:19:50 -08:00
c35933cd1e Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-12-10 12:27:00 -08:00
0da2efa633 add application_name to pgbouncer connectio string 2018-12-10 12:26:20 -08:00
e23d95bf03 sleep 60 seconds between deployments 2018-12-07 15:17:12 -08:00
f6e9f0e2a2 cleanup 2018-12-07 01:58:23 -08:00
4a89729529 add INCOMING_PACKET_CONCURRENCY environment variable to be able to specify max threads for receive in controller 2018-12-07 00:59:08 -08:00
56a58f2b11 more logging of exits from the central controller 2018-12-06 13:26:53 -08:00
e959908c51 log message 2018-12-06 13:19:36 -08:00
6e3144370a exit controller if onlinenotification thread exits while _run == 1 2018-12-06 13:10:59 -08:00
20f02bb772 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-12-06 13:08:39 -08:00
1c86f25fab update # of threads for Postgres 2018-12-06 13:08:31 -08:00
e6f9ab929d More speed stuff. 2018-12-06 12:47:58 -08:00
18d1772bb4 stuff for speed and stuff (testing) 2018-12-06 12:00:49 -08:00
5535cad773 Revert mutex change. 2018-12-04 16:15:46 -08:00
ec84934d48 Disable spinlock to check CPU usage implications on multithreaded controllers. 2018-12-04 15:59:39 -08:00
328d08781a finish pgbouncer integration 2018-12-03 16:12:15 -08:00
c8d5215870 add handling for PGBOUNCER_CONNSTR environment variable.
alows Central controllers to connect to PGBouncer on some threads.  LISTEN threads still require a direct connection to the DB
2018-12-03 15:19:15 -08:00
62ccb48a0b allow alternative ports for central controllers 2018-12-03 15:06:26 -08:00
82409eb345 add script to cycle central controllers 2018-12-03 15:04:46 -08:00
b75f212d70 Replace RethinkDB section in controller/README with PostgreSQL 2018-11-30 10:41:54 -08:00
ccb856749f back to plain old libpq in dev 2018-11-30 10:40:57 -08:00
9d2bc9bf4e Merge branch 'master' into dev 2018-11-28 08:44:45 -08:00
52c4385c16 Merge branch 'master' of http://git.int.zerotier.com/zerotier/ZeroTierOne 2018-11-28 08:44:12 -08:00
5da7d6d1ae Merge docker update PR 2018-11-28 08:43:50 -08:00
65e0a74718 Merge pull request #869 from bltavares/patch-2
Update ZeroTier version on Docker
2018-11-28 08:41:42 -08:00
01d5d7d78b Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-11-13 16:20:01 -08:00
e3381a4c1f fix member init query 2018-11-13 16:19:55 -08:00
03e35b25b8 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-11-13 16:02:31 -08:00
e2b0fb26b1 self-test build fix. 2018-11-13 16:02:26 -08:00
01c18cc442 update makefile for libpqxx controller 2018-11-13 16:01:43 -08:00
01e6df4d46 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-11-13 16:00:17 -08:00
882b03436d WIP: libpxx instead of libpq 2018-11-13 16:00:13 -08:00
690bd933d5 Support shutdown with postLimit in BlockingQueue 2018-11-13 13:52:45 -08:00
6684559cd9 More Mac tap improvements and threading efficiency improvements. 2018-11-13 13:51:25 -08:00
4ed7d20a48 Another stability fix... turns out vfork is problematic here. 2018-11-13 12:46:36 -08:00
350116c513 Stability improvements for Mac virtual Ethernet tap driver. 2018-11-13 12:42:03 -08:00
7bde2c089d Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-11-13 12:08:02 -08:00
90631adb9b Improve multithreading support for OneService (faster, dynamic adjustment of thread count based on HW concurrency). 2018-11-13 12:07:58 -08:00
f6450cd7e1 Cleanup and a minor performance improvement. 2018-11-13 10:19:51 -08:00
3b6b1d1674 Make incoming packet processor thread pool dynamic based on core count. 2018-11-13 09:35:20 -08:00
33d7b22abe Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-11-11 23:06:31 -08:00
2f9712e6a7 utility script to update public controllers 2018-11-11 23:06:24 -08:00
b937aeb857 cleanup 2018-11-11 23:03:51 -08:00
f3d8846df3 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-11-11 22:55:57 -08:00
2729db9555 exceptions 2018-11-11 22:55:53 -08:00
1cec4b1c4c Raise thread count to 8 2018-11-11 22:55:38 -08:00
7048c77ebc Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-11-11 22:35:26 -08:00
c9c17eaddd Retire RethinkDB, simple receive path multithreading. 2018-11-11 22:35:15 -08:00
f1b82b734a Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-11-11 21:09:35 -08:00
4c0e7aa8b0 more error checking 2018-11-11 21:08:51 -08:00
296e4616cc Migrate Windows to use Visual Studio 2017 Community instead of 2015. 2018-11-11 20:31:31 -08:00
15649334a6 Do not use new "feth" devices for ZT traffic. 2018-11-11 19:22:07 -08:00
b3c2c0866f Times should be int64_t, not uint64_t 2018-11-11 17:38:17 -08:00
c6ae81fac7 Added preprocessor check for __APPLE__ as an attempted fix for ticket #600 2018-11-11 14:23:24 -08:00
79086f0858 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-10-26 12:00:01 -07:00
c148a23df4 Added preprocessor check for ZT_NO_CAPABILITIES around header includes 2018-10-26 11:59:55 -07:00
c56831767e Fix Mac tap agent abort on EINTR. 2018-10-25 20:44:32 -07:00
72a724f075 Clean up some stuff after new feth tap implementation, and comment agent file. 2018-10-25 13:10:24 -07:00
96e1df5854 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-10-25 12:43:35 -07:00
2e44b90f63 OSX no longer requires the kext due to feth black magic! The MacEthernetTapAgent must be installed in /Library/Application Support/ZeroTier/One for ZT to work now. Eventually this can let us do an app bundle, get rid of the pkg, and have ZT itself run with normal or reduced privileges. Also fixes GitHub issue #870 (at least for me) and may be faster than the old kext. 2018-10-25 12:43:30 -07:00
5a0adba798 Setup docker container to use jemalloc 2018-10-24 13:36:21 -07:00
761cc5c923 remove another noisy log line 2018-10-24 13:36:07 -07:00
f901b9dd6b Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-10-24 12:08:48 -07:00
d87fcca176 Fully operational pgsql controller 2018-10-24 12:06:17 -07:00
7c72653385 because Windows.... 2018-10-23 13:21:25 -07:00
7dbccf08ae Removed unnecessary block before get request. Possible bug fix for Synology NAS ticket #27 2018-10-23 10:58:25 -07:00
2d21c18ebd Update ZeroTier version on Docker
This commit changes the Dockerfile ot use the multi-stage build and help
to get an automated build on Docker.

The idea of the multi-stage build is to use the already stable Debian
distribution channel to provide up-to-date versions of ZeroTier.

The benefit is that it would be possible to automate the image build,
either on Docker Hub, Travis or taking advantage of the [docker-library/official-images] infrastructure.

This changes follows the best-practices suggested by
[docker-library/official-images], such as using a High Availability GPG
keyserver, providing a default CMD, allowing "bash" on `docker run` and
others.

Given that both the builder `debian:stretch` and `alpine:latest` are
official messages and have [manifests], this means that this Dockerfile
is also multi-platform. This means that this same Dockerfile will
pick-up the correct Debian package according to the architecture of the
running system during build.

With this changes we could try to promote the image to be parte of
[docker-library/official-images], and take advantage of automated
publishing of multi-architecture images. Others would be able to use
`docker run zerotier` and download the latest version appropriate to
their system.

Related to #682

[docker-library/official-images]: https://github.com/docker-library/official-images
[manifests]: https://blog.docker.com/2017/09/docker-official-images-now-multi-platform/
2018-10-21 11:28:04 -03:00
15d0aad3c0 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-10-19 10:06:06 -05:00
f0fc9b1766 Merge branch 'master' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-10-19 10:05:51 -05:00
7c0331997a Ticket #739 - Fixed what appears to be a copy-paste error for machine type detection in linux makefile, added line for armv7hl 2018-10-03 15:40:16 -07:00
04de2302a7 More insightful errors for get command 2018-10-03 14:24:21 -07:00
1da1409db2 get rid of a noisy log line 2018-09-28 10:58:26 -07:00
c1ea1329c1 Merge branch 'dev' into libpq 2018-09-28 10:56:40 -07:00
417aa9547b Working controller & docker container for GKE 2018-09-28 10:55:39 -07:00
60d5a3c631 Merge pull request #853 from darkain/dev
Fix IPv6 address string representation
2018-09-25 15:32:39 -07:00
7a42416a78 Merge pull request #822 from dschulz/controller-patch1-dschulz
Add functionality to erase members from networks using file backend i…
2018-09-25 11:38:25 -07:00
2a143a7505 Merge pull request #858 from tommyang/fix/mac-uninstall-script
macOS uninstall script: remove symlinks from the actual location
2018-09-25 11:36:28 -07:00
0510f85a8f Merge branch 'dev' into libpq 2018-09-25 10:19:59 -07:00
5b222d0a09 cleanup connections after errors 2018-09-25 10:17:15 -07:00
133b64679c Update README.md 2018-09-24 15:02:11 -07:00
79b88a22c3 Update README.md
Document that allowManagementFrom is an array
2018-09-24 14:58:44 -07:00
88d879987d Remove symlinks from the actual location
Binary symlinks are in `/usr/local/bin` instead of `/usr/bin` since commit 0cf4ddd
2018-09-23 16:53:30 -07:00
27c37a18f3 Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev 2018-09-17 14:42:33 -07:00
b8268d894b Changed home path for Synology 2018-09-17 11:44:56 -07:00
79b47b055a Only null terminate the first character 2018-09-15 12:13:06 -07:00
8e260bae11 Correcting conversion to/from IP address / string
1) Use existing standard libraries to convert to/from IPv4/IPv6 strings and binary representation.
2) Move null terminator assignment InetAddress::toIpString to top of function, this way if ANY errors occurs that don't write content to the buffer, we're not passing a potentially dangerous buffer around.
2018-09-14 22:42:58 -07:00
af61ee6f3a Merge pull request #836 from skunkwerks/feature/add-freebsd-debugs
add support for debug flags in FreeBSD
2018-09-14 08:08:59 -07:00
04d7a1df96 Merge pull request #837 from skunkwerks/feature/update-ext-json
update external JSON dependency to address libc++ compatibility
2018-09-14 08:08:21 -07:00
b9fd50e348 Merge pull request #845 from asbjornenge/docker-updates
Using multi-stage build for Dockerfile
2018-09-14 08:07:36 -07:00
ef48d11266 Merge pull request #848 from darkain/master
Fix compile on FreeBSD targeting ARMv6 (Raspberry Pi)
2018-09-14 08:05:39 -07:00
a47559d9e3 dev should have odd minor version 2018-09-14 08:05:07 -07:00
cffb992ae8 Adding ARM/NEON detection for non-Linux targets 2018-09-12 19:51:28 -07:00
39e720e811 Adding proper EABI target for ARM32/Salsa 2018-09-12 19:49:14 -07:00
7b87e9c0cb Added ability for OneService to monitor local.conf for changes and automatically reload 2018-09-11 16:55:46 -07:00
3dd9b1aa9b Added ability to specify zt home directory via ZEROTIER_HOME - Addresses ticket #829 2018-09-10 16:25:39 -07:00
0fddebc791 Added ability to manually set secondary and tertiary ports in local.conf 2018-09-10 13:06:05 -07:00
701d64936d Using builder pattern to build in container while keeping final image small 2018-09-07 14:11:25 +02:00
0ec6215493 Send member/network change notifications via Postgres 2018-09-06 15:14:16 -07:00
de45bdb448 quieting things down a little bit 2018-09-05 17:03:49 -07:00
7b608c6ca3 Fix testing for true/false. Dont attempt to update member status on networks that we know dont exist 2018-09-05 16:54:23 -07:00
6ff78c9c26 fix crashes 2018-09-05 16:08:06 -07:00
d701f4e331 Added some exception hadling. Dont want to live *too* dangerously here 2018-09-05 11:49:07 -07:00
92abc92463 Theoretically we have PostgreSQL support now 2018-09-05 11:30:17 -07:00
a4be9ceb5a dont insert/update creation time. Let the database handle it with the default value 2018-09-04 16:08:26 -07:00
e21b6e1daf commit thread WIP 2018-09-04 16:05:34 -07:00
2e3b03fff9 members initialized 2018-09-04 14:51:35 -07:00
cd657da431 Online Update/Notify thread 2018-09-04 14:00:02 -07:00
17af09a5cc Postgres Integration has begun 2018-08-31 14:58:15 -07:00
ceff48b07c Update bug_report.md 2018-08-29 10:15:10 -07:00
199566965e Update issue templates 2018-08-29 09:39:18 -07:00
46e46e9b7b Update issue templates 2018-08-29 09:37:39 -07:00
8b292d2dc7 ext: update nlohmann/json to v3.2.0
- include libc++7 compatibility for FreeBSD
- see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230629
2018-08-24 08:19:38 +00:00
88abd6ffc6 add support for debug flags in FreeBSD 2018-08-24 08:18:25 +00:00
76b4ec12a0 Vault-related amendments 2018-08-09 14:32:26 -07:00
0e4cfd897b Multipath-related amendments from merge into edge 2018-08-09 13:40:49 -07:00
515d7962b0 Build fixes. 2018-08-09 11:39:42 -07:00
553101e8b5 merge dev 2018-08-09 11:31:37 -07:00
3cd0ab1b3b Remove direct include of bits/sockaddr.h 2018-08-03 16:20:08 -07:00
fc6dba0797 Add functionality to erase members from networks using file backend in controller microservice
Signed-off-by: Diego Schulz <dschulz@gmail.com>
2018-08-02 17:13:55 -04:00
e01c0adff2 Added ifdef checks to omit some ManagedRoute code in SDK builds 2018-08-01 17:17:04 -07:00
e75a093a8c 2018-07-27 -- Version 1.2.12
* Fixed a bug that caused exits to take a long time on Mac due to huge numbers of redundant attempts to delete managed routes.
 * Fixed a socket limit problem on Windows that caused the ZeroTier service to run out of sockets, causing the UI and CLI to be unable to access the API.
 * Fixed a threading bug in the ZeroTier Core, albeit one that never manifested on the regular ZeroTier One service/client.
 * Fixed a bug that could cause the service to crash if an authorized local client accessed an invalid URL via the control API. (Not exploitable since you needed admin access anyway.)
2018-07-27 14:14:09 -07:00
dcffb042ff Windows Advanced Installer to 1.2.12 2018-07-27 13:35:20 -07:00
d724af6a99 Replace Sao Paolo root with Buenos Aires in default planet def (will push to network too) 2018-07-25 15:03:01 -07:00
b30f423fc9 . 2018-07-25 12:11:59 -07:00
1fc14292fe Version bumps. 2018-07-25 12:09:31 -07:00
fa7e7fc6f9 Revert fix for GitHub issue #600 because it causes route objects to build up forever (at least on Mac). Bleh. #600 is a rare issue and will need some other fix after reliable duplication. 2018-07-20 15:53:19 -07:00
5b114791e5 Fix a bug that caused a crash on empty HTTP requests (localhost only) and add a lightweight lock to the RX queue to prevent possible threads stepping on each other in parallel receive paths. 2018-07-20 14:01:58 -07:00
9bc11a369c Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev 2018-07-20 07:41:52 -07:00
ac40f2191c . 2018-07-20 07:41:47 -07:00
62a93c58fd Added ifdefs surrounding usage of getifaddrs() on Android 2018-07-19 17:50:10 -07:00
65b0030342 Added basic QoS rule handling 2018-07-11 16:55:13 -07:00
f302fac423 Minor tweak to linux makefile 2018-07-11 16:32:49 -07:00
f94aea8119 Return error 503 if RethinkDB is down when built as RethinkDB-based controller. 2018-07-11 10:42:31 -07:00
28cb40529d Rough draft of fq-codel implementation 2018-07-10 16:50:12 -07:00
37ae3b2b80 Remote debug printf. 2018-07-03 12:52:35 -07:00
73e4286fbf Fix two controller bugs: filesystem bug and another possible infinite recursion bug. 2018-07-03 12:51:41 -07:00
4e6151ebd9 Added "Create and Join Network" menu item to windows system tray UI 2018-06-28 15:24:45 -07:00
fc225401a5 use easy mode for network creation 2018-06-28 15:05:24 -07:00
d74817f79f Added blurb about allowTcpFallbackRelay to README 2018-06-22 16:46:50 -07:00
bdcdccfcc3 Improved path selection, more efficient traffic allocation, lower QoS/ACK overhead 2018-06-22 16:30:20 -07:00
352ec3430f Add a define to set FD_SETSIZE=1024 on Windows
Default on Windows is extremely low at 64 and is the likely culprit behind the UI and CLI not being able to talk to the background service
2018-06-21 12:11:10 -07:00
978d2fcb56 Optimize C25519 and Poly1305 on Windows even in debug. 2018-06-21 12:08:15 -07:00
52264d5e28 Fixed aggregateLinkLatency(). Also changed unit for throughput from byte to bit 2018-06-14 16:48:35 -07:00
17fbb020e7 Added multipath field to zerotier-cli status output. Adjusted how path estimates are computed and cached 2018-06-14 16:34:45 -07:00
f8005b88ad Minor cleanup. More efficient push() operation for RingBuffer 2018-06-13 14:50:37 -07:00
0faa655b83 Reduced how often relative path qualities and aggregate link allocations are computed 2018-06-12 16:30:46 -07:00
6fddf31db3 Improved rate limit logic for QoS/ACK packets. Also reduced how often processBackgroundPathMeasurements() is called 2018-06-12 15:24:12 -07:00
01257a461e Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev 2018-06-12 09:39:15 -07:00
817b9d012e Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev 2018-06-12 09:38:52 -07:00
04b3525e0f Merge pull request #755 from skunkwerks/fix/c++-17-deprecation
fix clang C++17 deprecation when building with ZT_DEBUG=1
2018-06-12 09:38:26 -07:00
d55c732e19 Merge pull request #764 from Elfe/master
fix MAC address rule parsing as even/uneven switches at every colon
2018-06-12 09:37:28 -07:00
d223427e22 Merge pull request #773 from alexforencich/master
Add UFW firewall application preset
2018-06-12 09:37:01 -07:00
64856adc3c Merge pull request #776 from Wykks/patch-1
Improve debian service requirements
2018-06-12 09:36:46 -07:00
7c53adbcfe quieting things down unless ZT_TRACE is defined 2018-06-11 10:47:58 -07:00
dce9cb27c1 helps to have an ==0 on a strcmp 2018-06-11 09:53:11 -07:00
4199c56e99 cant compare character arrays with == 2018-06-11 09:53:00 -07:00
9681fedbb4 Spellcheck sweep across codebase 2018-06-07 17:25:27 -07:00
b6d97af451 Added rate gates for QOS and ACK packets 2018-06-07 15:26:18 -07:00
a9ca26c698 Added TX queue cap for issue #769 2018-06-07 12:58:07 -07:00
9463d4abe4 Fix for issue #778
Double quote before member name in `/controller/network/network_id/member` API
2018-06-05 12:55:39 -07:00
b9975845ff Merge branch 'rtnetlink' into edge 2018-06-04 12:24:58 -07:00
b22405b64b rtnetlink integrated. no more callouts to iproute2 2018-06-04 12:24:12 -07:00
62210e57f1 helps to have an ==0 on a strcmp 2018-06-04 11:24:24 -07:00
4dd093efc9 cant compare character arrays with == 2018-06-04 11:07:12 -07:00
91a22a686a Added auto-escalation to multipath if both peers support it. Improved QoS/ACK tracking. Related bug fixes 2018-06-01 18:03:59 -07:00
a307dff3b7 Improve debian service requirements 2018-05-31 23:55:36 +02:00
20f0bed2f6 Add UFW firewall application preset 2018-05-30 19:10:51 -07:00
46a7a2be2e Added VERB_ACK and VERB_QOS_MEASUREMENT, refined notion of path quality 2018-05-30 17:45:29 -07:00
8199dbd0dc Merge branch 'dev' into edge 2018-05-30 11:19:12 -07:00
dfe426e4e0 fix MAC address rule parsing as even/uneven switches at every colon 2018-05-26 21:00:09 +02:00
3ace61ef85 comment out addInterface/removeInterface code for now
We already have ioctl based code to do this
2018-05-25 15:37:00 -07:00
442595d6fc also store binary representation of mac address in the interface lookup table for later use 2018-05-25 14:25:44 -07:00
be469f4dd0 add/remove routes via rtnetlink 2018-05-25 14:18:06 -07:00
7da4b0af15 better data localization in LinuxNetLink now that I know what Im doing 2018-05-24 16:15:03 -07:00
2fff651378 whoops. committed a binary 2018-05-24 16:14:32 -07:00
c24d16e62e ManagedRoute uses ioctl to add/remove routes on Linux
Added LinuxNetLink to talk to the rtnetlink socket for adding interfaces, addresses routes.  Not yet complete.  Can currently monitor changes on the system.
2018-05-24 15:22:11 -07:00
c36c92e077 node: remove deprecated register hint for C++17 compatibility
when building with `ZT_DEBUG=1` this hint produces a warning:

> node/Packet.cpp:335:43: error: 'register' storage class specifier is deprecated and incompatible with C++17 [-Werror,-Wdeprecated-register]
See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4340
2018-05-18 09:09:27 +00:00
c0efba79c7 Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev 2018-05-11 13:40:22 -07:00
5809941ae9 Windows 1.2.10 2018-05-11 13:40:03 -07:00
535ba8a207 Consolidated powerpc64le machine types, added 32-bit powerpc machine type and a flag to disable use of Linux capabilities 2018-05-09 13:51:32 -07:00
43331d3fe8 Merge branch 'master' into dev 2018-05-09 10:31:19 -07:00
9765ba334a 1.2.10 2018-05-08 13:07:20 -07:00
0cd01b6ff8 Fix silly bug where moons and networks were being loaded by the address of an array rather than the proper value. 2018-05-07 12:51:39 -07:00
5f85e33510 GitHub issue #734 (warning removal) 2018-05-07 12:15:55 -07:00
22301a4599 Added override directive to CFLAGS for Synology builds in make-linux.mk 2018-05-04 14:31:34 -07:00
c8a907fd71 Added override directive to CXXFLAGS for Synology builds in make-linux.mk 2018-05-04 13:03:52 -07:00
d01b1ffde5 Added -fPIC for Synology builds 2018-05-04 12:09:04 -07:00
f4e993c814 Debian clean fix and CentOS 6 upgrade fix. 2018-05-03 12:51:49 -07:00
91c8e82c42 Adjusted locking order of _paths_m for path pruning. Other minor multipath changes 2018-05-02 15:24:14 -07:00
776ff46db7 User useradd not adduser on Debian. 2018-05-02 14:12:10 -07:00
9001ab5858 Do not add zerotier-one user if it does not exist (Debian) 2018-05-02 14:08:42 -07:00
1debe2292d Cleanup. Misc type conversion and signedness fixes 2018-05-02 11:22:07 -07:00
6a2ba4baca Introduced basic multipath support 2018-05-01 16:32:15 -07:00
836d897aec Re-ordered local.conf and node init logic, also split software update config into separate method to fix bad node pointer reference 2018-05-01 13:39:06 -07:00
740b0fbbf6 Merge branch 'dev' into edge 2018-04-30 13:08:24 -07:00
92e716d93d Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev 2018-04-30 13:08:16 -07:00
c7115a0671 Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2018-04-30 13:07:52 -07:00
020bbed935 ARM32 fix. 2018-04-30 13:07:32 -07:00
0c60963a94 app icon with no alpha channel 2018-04-30 12:08:09 -07:00
d704f5f2d2 Remove alpha channel from app store icon 2018-04-30 12:06:41 -07:00
381bbb0e5e Merge branch 'dev' into edge 2018-04-30 08:47:51 -07:00
0ebd19c14a Merge branch 'dev' of /media/psf/Code/ZeroTier/ZeroTierOne into dev 2018-04-27 20:49:46 -07:00
d4160afac8 Another squeeze fix to see if we can make this work. 2018-04-27 19:51:27 -07:00
fffb037873 Fix for packaging on old Debian squeeze. 2018-04-27 18:53:55 -07:00
1df5d0453d Remove separate dh-systemd dependency since this is obsolete on newer Debian anyway. 2018-04-27 18:50:40 -07:00
19d453cb90 Add some more icon sizes
20x20, 60x60, 1024x1024 pngs
getting ready for an iOS release
2018-04-27 16:48:34 -07:00
6e7437a0d0 Add some more icon sizes
20x20, 60x60, 1024x1024 pngs
getting ready for an iOS release
2018-04-27 16:40:36 -07:00
caf849fcba Typo. 2018-04-27 16:22:36 -07:00
7533d244a9 Debian build fix. 2018-04-27 16:21:22 -07:00
0a52840fa3 1.2.8 Windows Advanced Installer update. 2018-04-27 13:52:33 -07:00
a7d0905b74 1.2.8 bump for all but Windows install files. 2018-04-27 13:06:00 -07:00
05bfafbce8 Merge branch 'master' into edge 2018-04-25 06:41:44 -07:00
d32a26f780 Merge pull request #428 from danielskowronski/netbsd-support
NetBSD support (we still consider this unsupported, but it might work -- thanks!)
2018-04-25 06:39:37 -07:00
42ec780a6f Merge branch 'dev' into netbsd-support 2018-04-25 06:39:02 -07:00
4608880fb0 Re-enable faster ed25519 signatures on x64 thanks to PR from @jonathonf 2018-04-25 06:34:34 -07:00
7492e2789f Merge pull request #722 from jonathonf/dev
Fix ed25519-amd64-asm PIC compatibility
2018-04-25 06:08:12 -07:00
9564a8eaf6 Delete junk. 2018-04-23 14:56:22 -07:00
f12c0e79c9 GitHub issue #723 2018-04-23 14:11:26 -07:00
e4e0be979e Fix ed25519-amd64-asm PIC compatibility
The Hyperledger implementation (https://github.com/hyperledger/iroha-ed25519)
contains changes to the assembly code to allow PIC. This in turn fixes
compilation/linking of ZeroTier One when "full hardening" flags are used.
2018-04-21 16:18:00 +01:00
86637cda9f Disable ASM ed25519 by default (it only helps significantly on controllers) so fPIE will work -- GitHub issue #717 2018-04-20 11:35:50 -07:00
94f41e2332 Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev 2018-04-18 08:08:06 -07:00
3d2a50f811 Merge pull request #654 from atopuzov/armv7l
Add support for armv7l
2018-04-18 08:06:53 -07:00
c2ffbb8627 Merge pull request #673 from neutronscott/dev
check physical blacklist for interface binding as well
2018-04-18 08:05:51 -07:00
54218f6c3c Merge pull request #690 from Pablohn26/master
Warn about invalid network id instead of help
2018-04-18 08:05:28 -07:00
6fdbdf9272 Merge pull request #712 from elmar/master
fix typo in documentation
2018-04-18 08:04:19 -07:00
c14f9cc247 fix typo in documentation 2018-04-14 10:52:30 +02:00
9da7967197 Merge branch 'dev' into edge 2018-04-12 09:08:48 -04:00
2021f8cb5f Merge branch 'dev' into edge 2018-03-29 13:34:54 -07:00
af74fe1711 Merge branch 'dev' into edge 2018-03-21 15:32:04 -07:00
c908b9f67a Add anchor and multicast hub address field to new multicast enabled ad-hoc address format. 2018-03-21 15:27:26 -07:00
209f6d9d2d Merge branch 'dev' into edge 2018-03-19 11:18:54 -07:00
a9778549f2 Warn about invalid network id instead of help 2018-03-11 03:39:13 +01:00
b601041b5b Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2018-03-09 07:51:43 -08:00
0945d6ec0d Merge branch 'dev' into edge 2018-03-09 07:50:38 -08:00
e61d4ab67a Merge branch 'dev' into edge 2018-02-23 13:58:24 -08:00
2d289a3308 Just a little cleanup 2018-02-16 15:20:07 -08:00
bdb2cc7c85 Linux: link system libcurl when compiling with ZT_VAULT_SUPPORT=1
Requires libcurl and development headers to be installed
2018-02-16 15:08:04 -08:00
7793060723 Add HashiCorp Vault storage of ZeroTier's public & secret identity
Adds a "vault" section to local.conf.  Example local.conf:

{
  "config": {
    "vault": {
      "vaultURL": "https://some.vault.host:8200",
      "vaultToken": "my-super-secret-vault-token",
      "vaultPath": "secure/place/to/put/identity"
    }
}

Additionally, the following environment variables can be set.  Environment variables override local.conf:

VAULT_ADDR
VAULT_TOKEN
VAULT_PATH

Identities will be placed in the keys "public" and "secret" under the user specified path.  If no path is specified, they will be placed in the token specific cubbyhole.

If identity.public and identity.secret exist on disk and vault is configured, they will be automatically added to Vault and removed from disk.

TODO:
 *  Decide behavior for if Vault cannot be reached.
 *  Add libcurl as a dependency in Linux & Mac builds
 *  Add libcurl as a requirement for linux packages
2018-02-16 14:30:27 -08:00
84302ae9c7 Add CURL libs to VC project 2018-02-16 14:21:38 -08:00
cd801b96fa libcurl binaries for Windows 2018-02-16 10:31:37 -08:00
5ff0653f9e Hooks into StateGet and StatePut for grabbing identity.secret from Vault 2018-02-16 10:18:10 -08:00
9574d635c1 Add Vault configuration option parsing to local.conf
{
   "settings": {
       ...
      "valut": {
         "vaultURL": "...",
         "vaultKey": "...",
         "vaultPath": "..."
      }
   }
}
2018-02-16 10:18:10 -08:00
73ca9b6373 check physical blacklist for interface binding as well 2018-02-03 14:53:46 -05:00
381857ea49 macOS: add libcurl to libraries when ZT_VAULT_SUPPORT=1 is specified on the make command line 2018-01-03 11:56:20 -08:00
50aef368f6 Add support for armv7l
* GCC running on Raspberry Pi 3 on Arch linux ARM reports arch as
  armv7l-unknown-linux-gnueabihf
2018-01-02 11:32:17 +01:00
18c9dc8a06 fix RTF_MULTICAST and g++ -w 2016-12-27 13:07:05 +01:00
ba07d1f91d cleanup 2016-12-27 11:57:05 +01:00
9a2310395d mimic BSDEthernetTap but with creating/destroying char tap device 2016-12-27 11:42:43 +01:00
218ace51a7 use /dev/tap{0..3}; it is fully working now 2016-12-26 02:52:07 +01:00
f09eedbd7a make it compilable 2016-12-25 22:54:27 +01:00
546e8a3b44 initial netbsd support in makefile/flags 2016-12-25 20:59:12 +01:00
1027 changed files with 130030 additions and 140814 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
.git/
build/
!build/zerotier

46
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,46 @@
---
name: Bug report
about: Create a report to help us improve
---
**Alternative, faster ways to get help**
If you have just started using ZeroTier, here are some places to get help:
- my.zerotier.com has a _Community_ tab. It's a live chat with other users and the developers.
- [ZeroTier Knowledge Base](https://zerotier.atlassian.net/wiki/spaces/SD/overview)
- www.zerotier.com has a Contact Us button
- email contact@zerotier.com
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a Network '...'
2. Install zerotier-one '....'
3. '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots or console output to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Mac, Linux, Windows, BSD]
- OS/Distribution Version
- ZeroTier Version [e.g. 1.2.4]
- Hardware [e.g. raspberry pi 3]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Version [e.g. 1.2.4]
**Additional context**
Add any other context about the problem here.
- ZeroTier Network Configuration
- Router Config
- Firewall Config (try turning the firewall off)
- General Network Environment: [ e.g Home, University Campus, Corporate LAN ]

View File

@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

115
.gitignore vendored Executable file → Normal file
View File

@ -1,58 +1,23 @@
# Main binaries created in *nix builds
/zerotier-one
/zerotier-idtool
/zerotier-cli
/zerotier-selftest
/zerotier
# OS-created garbage files from various platforms
/build
/cmake-build-debug
/cmake-build-release
/core/version.h
/.idea
/.ide-*
.DS_Store
.Trashes
*.swp
._*
*~
*~.nib
*.secret
.Apple*
Thumbs.db
@eaDir
._*
# Windows build droppings
/windows/ZeroTierOne.sdf
/windows/ZeroTierOne.v11.suo
/windows/x64
/windows/Win32
/windows/*/x64
/windows/*/Win32
/windows/ZeroTierOne/Release
/windows/ZeroTierOneService/obj
/windows/ZeroTierOneService/bin
/windows/Build
/windows/Debug
/windows/Release
/windows/WebUIWrapper/bin
/windows/WebUIWrapper/obj
/windows/lib
/ext/installfiles/windows/ZeroTier One-SetupFiles
/ext/installfiles/windows/Prerequisites
/ext/installfiles/windows/*-cache
/ZeroTier One.msi
/windows/.vs
*.vcxproj.backup
/windows/TapDriver6/Win7Debug
/windows/TapDriver6/win7Release
/windows/*.db
/windows/*.opendb
enc_temp_folder
/windows/copyutil/bin
/windows/copyutil/obj
# *nix/Mac build droppings
/build-*
/ZeroTierOneInstaller-*
/examples/docker/zerotier-one
/examples/docker/test-*.env
/world/mkworld
/world/*.c25519
zt1-src.tar.gz
# Miscellaneous temporaries, build files, etc.
.vscode
__pycache__
*.log
*.bak
*.opensdf
*.user
*.cache
@ -61,10 +26,6 @@ zt1-src.tar.gz
*.pid
*.pkg
*.o
/*.a
*.dylib
*.so
*.so.*
*.o-*
*.core
*.deb
@ -73,46 +34,6 @@ zt1-src.tar.gz
*.tmp
.depend
node_modules
zt1_update_*
debian/files
debian/zerotier-one
debian/zerotier-one*.debhelper
debian/*.log
debian/zerotier-one.substvars
root-watcher/config.json
# Java/Android/JNI build droppings
java/obj/
java/libs/
java/bin/
java/classes/
java/doc/
java/build_win64/
java/build_win32/
/java/mac32_64/
windows/WinUI/obj/
windows/WinUI/bin/
windows/ZeroTierOne/Debug/
/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg
# Miscellaneous mac/Xcode droppings
.DS_Store
.Trashes
*.swp
*~.nib
DerivedData/
build/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
*.xccheckout
xcuserdata/
ext/librethinkdbxx/build
.vscode
__pycache__
*~
*.vcxproj.backup
/*.db
/*.opendb

View File

@ -1,12 +1,15 @@
# Authors and Third Party Code Licensing Information
## Primary Authors
* ZeroTier Core and ZeroTier One virtual networking service<br>
Adam Ierymenko / adam.ierymenko@zerotier.com
Joseph Henry / joseph.henry@zerotier.com (QoS and multipath)
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)<br>
Grant Limberg / glimberg@gmail.com
* ZeroTier SDK (formerly known as Network Containers)<br>
* ZeroTier SDK / libzt<br>
Joseph Henry / joseph.henry@zerotier.com
## Third Party Contributors
@ -25,49 +28,34 @@
## Third-Party Code
ZeroTier includes the following third party code, either in ext/ or incorporated into the ZeroTier core.
ZeroTier includes the following third party code, either in ext/ or incorporated into the ZeroTier core. This third party code remains licensed under its original license and is not subject to ZeroTier's BSL license.
* LZ4 compression algorithm by Yann Collet
* Files: node/Packet.cpp (bundled within anonymous namespace)
* Files: node/LZ4.cpp
* Home page: http://code.google.com/p/lz4/
* License grant: BSD 2-clause
* http-parser by Joyent, Inc. (many authors)
* Files: ext/http-parser/*
* Home page: https://github.com/joyent/http-parser/
* License grant: MIT/Expat
* License: BSD 2-clause
* C++11 json (nlohmann/json) by Niels Lohmann
* Files: ext/json/*
* Home page: https://github.com/nlohmann/json
* License grant: MIT
* TunTapOSX by Mattias Nissler
* Files: ext/tap-mac/tuntap/*
* Home page: http://tuntaposx.sourceforge.net/
* License grant: BSD attribution no-endorsement
* ZeroTier Modifications: change interface name to zt#, increase max MTU, increase max devices
* License: MIT
* tap-windows6 by the OpenVPN project
* Files: windows/TapDriver6/*
* Home page: https://github.com/OpenVPN/tap-windows6/
* License grant: GNU GPL v2
* ZeroTier Modifications: change name of driver to ZeroTier, add ioctl() to get L2 multicast memberships (source is in ext/ and modifications inherit GPL)
* License: GNU GPL v2
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519 digital signature algorithm, and Poly1305 MAC algorithm, all by Daniel J. Bernstein
* Files: node/Salsa20.* node/C25519.* node/Poly1305.*
* Home page: http://cr.yp.to/
* License grant: public domain
* ZeroTier Modifications: slight cryptographically-irrelevant modifications for inclusion into ZeroTier core
* License: public domain
* MiniUPNPC and libnatpmp by Thomas Bernard
* cpp-httplib by yhirose
* Files: ext/libnatpmp/* ext/miniupnpc/*
* Home page: http://miniupnp.free.fr/
* License grant: BSD attribution no-endorsement
* Files: ext/cpp-httplib/*
* Home page: https://github.com/yhirose/cpp-httplib
* License: MIT

View File

@ -1,12 +1,346 @@
# CMake build script for libzerotiercore.a
cmake_minimum_required (VERSION 3.8)
cmake_minimum_required (VERSION 2.8)
project (zerotiercore)
cmake_policy(SET CMP0048 NEW)
set (PROJ_DIR ${PROJECT_SOURCE_DIR})
set (ZT_DEFS -std=c++11)
if(${CMAKE_VERSION} VERSION_LESS 3.15)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.15)
endif()
file(GLOB core_src_glob ${PROJ_DIR}/node/*.cpp)
add_library(zerotiercore STATIC ${core_src_glob})
set(ZEROTIER_VERSION_MAJOR 1 CACHE INTERNAL "")
set(ZEROTIER_VERSION_MINOR 9 CACHE INTERNAL "")
set(ZEROTIER_VERSION_REVISION 0 CACHE INTERNAL "")
set(ZEROTIER_VERSION_BUILD 0 CACHE INTERNAL "")
target_compile_options(zerotiercore PRIVATE ${ZT_DEFS})
project(zerotier
VERSION ${ZEROTIER_VERSION_MAJOR}.${ZEROTIER_VERSION_MINOR}.${ZEROTIER_VERSION_REVISION}.${ZEROTIER_VERSION_BUILD}
DESCRIPTION "ZeroTier Network Hypervisor"
LANGUAGES CXX C)
if(NOT PACKAGE_STATIC)
find_program(
GO go
HINTS "/usr/local/go/bin" "/usr/bin" "/usr/local/bin" "C:/go/bin"
)
if(NOT GO)
message(FATAL_ERROR "Golang not found")
else(NOT GO)
message(STATUS "Found Golang at ${GO}")
endif(NOT GO)
set(default_build_type "Release")
if(WIN32)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_SYSTEM_VERSION "7" CACHE STRING INTERNAL FORCE)
else(WIN32)
if(APPLE)
set(CMAKE_CXX_STANDARD 17)
else(APPLE)
set(CMAKE_CXX_STANDARD 11)
endif(APPLE)
endif(WIN32)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
option(BUILD_CENTRAL_CONTROLLER "Build ZeroTier Central Controller" OFF)
if(BUILD_CENTRAL_CONTROLLER)
find_package(PkgConfig REQUIRED)
if(APPLE)
set(CMAKE_PREFIX_PATH
${CMAKE_PREFIX_PATH}
/usr/local/opt/libpq
/usr/local/lib
)
endif(APPLE)
find_package(PostgreSQL REQUIRED)
pkg_check_modules(hiredis REQUIRED IMPORTED_TARGET hiredis)
add_subdirectory(controller/thirdparty/redis-plus-plus-1.1.1)
set(redispp_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/controller/thirdparty/redis-plus-plus-1.1.1/src/sw)
set(redispp_STATIC_LIB redispp_static)
endif(BUILD_CENTRAL_CONTROLLER)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DZT_DEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(WIN32)
message("++ Setting Windows Compiler Flags ${CMAKE_BUILD_TYPE}")
add_definitions(-DNOMINMAX)
add_compile_options(
-Wall
-Wno-deprecated
-Wno-unused-function
-Wno-format
$<$<CONFIG:DEBUG>:-g>
$<$<CONFIG:DEBUG>:-O0>
$<$<CONFIG:RELEASE>:-O3>
$<$<CONFIG:RELEASE>:-ffast-math>
$<$<CONFIG:RELWITHDEBINFO>:-O3>
$<$<CONFIG:RELWITHDEBINFO>:-g>
)
set(GOFLAGS
-a
-trimpath
)
if(BUILD_32BIT)
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
set(GOARCH "GOARCH=386" CACHE STRING "go architecture")
add_compile_options(
-m32
)
add_link_options(
-m32
)
endif(BUILD_32BIT)
else(WIN32)
set(GOFLAGS
-trimpath
-buildmode=pie
)
if(APPLE)
message("++ Setting MacOS Compiler Flags ${CMAKE_BUILD_TYPE}")
set(MACOS_VERSION_MIN "10.12")
add_compile_options(
-Wall
-Wno-deprecated
-Wno-unused-function
-mmacosx-version-min=${MACOS_VERSION_MIN}
$<$<CONFIG:DEBUG>:-g>
$<$<CONFIG:DEBUG>:-O0>
$<$<CONFIG:RELEASE>:-Ofast>
$<$<CONFIG:RELEASE>:-ffast-math>
$<$<CONFIG:RELEASE>:-fPIE>
$<$<CONFIG:RELEASE>:-flto>
$<$<CONFIG:RELWITHDEBINFO>:-O1>
$<$<CONFIG:RELWITHDEBINFO>:-fPIE>
$<$<CONFIG:RELWITHDEBINFO>:-g>
)
add_link_options(
-mmacosx-version-min=${MACOS_VERSION_MIN}
$<$<CONFIG:RELEASE>:-flto>
)
set(GOFLAGS
${GOFLAGS}
-a
-ldflags '-w -extldflags \"-Wl,-undefined -Wl,dynamic_lookup\"'
)
else(APPLE)
message("++ Setting Linux/BSD/Posix Compiler Flags (${CMAKE_BUILD_TYPE})")
add_compile_options(
-Wall
-Wno-deprecated
-Wno-unused-function
-Wno-format
$<$<CONFIG:DEBUG>:-g>
$<$<CONFIG:DEBUG>:-O0>
$<$<CONFIG:RELEASE>:-O3>
$<$<CONFIG:RELEASE>:-ffast-math>
$<$<CONFIG:RELEASE>:-fPIE>
$<$<CONFIG:RELWITHDEBINFO>:-O3>
$<$<CONFIG:RELWITHDEBINFO>:-fPIE>
$<$<CONFIG:RELWITHDEBINFO>:-g>
)
option(BUILD_32BIT "Force building as 32-bit binary" OFF)
option(BUILD_STATIC "Build statically linked executable" OFF)
option(BUILD_ARM_V5 "Build ARMv5" OFF)
option(BUILD_ARM_V6 "Build ARMv6" OFF)
if(BUILD_ARM_V5 AND BUILD_ARM_V6)
message(FATAL_ERROR "BUILD_ARM_V5 and BUILD_ARM_V6 are mutually exclusive!")
endif(BUILD_ARM_V5 AND BUILD_ARM_V6)
if(BUILD_32BIT)
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
set(GOARCH "GOARCH=386" CACHE STRING "go architecture")
add_compile_options(
-m32
)
endif(BUILD_32BIT)
if(BUILD_STATIC)
add_link_options(
-static
)
set(CMAKE_EXE_LINKER_FLAGS "-static ${CMAKE_EXE_LINKER_FLAGS}")
set(GOFLAGS
${GOFLAGS}
-a
-tags osusergo,netgo
-ldflags '-w -extldflags \"-static -Wl,-unresolved-symbols=ignore-all\"'
)
else(BUILD_STATIC)
set(GOFLAGS
${GOFLAGS}
-a
-ldflags '-w -extldflags \"-Wl,-unresolved-symbols=ignore-all\"'
)
endif(BUILD_STATIC)
if(BUILD_ARM_V5)
set(GOARM "GOARM=5")
endif(BUILD_ARM_V5)
if(BUILD_ARM_V6)
set(GOARM "GOARM=6")
endif(BUILD_ARM_V6)
endif(APPLE)
endif(WIN32)
if (
CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "X86_64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "x64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "X64"
)
message("++ Adding flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
add_compile_options(-maes -mrdrnd -mpclmul -msse -msse2)
endif()
if (
CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "AARCH64"
)
message("++ Adding flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
add_compile_options(-march=armv8-a+aes+crypto -mtune=generic -mstrict-align)
endif()
set(GO_BUILD_TAGS)
if(BUILD_CENTRAL_CONTROLLER)
add_definitions(-DZT_CONTROLLER_USE_LIBPQ=1)
set(GO_BUILD_TAGS -tags central)
endif(BUILD_CENTRAL_CONTROLLER)
add_subdirectory(core)
add_subdirectory(controller)
add_subdirectory(osdep)
add_subdirectory(serviceiocore)
file(GLOB go_src
${CMAKE_SOURCE_DIR}/cmd/*.go
${CMAKE_SOURCE_DIR}/cmd/cmd/*.go
${CMAKE_SOURCE_DIR}/pkg/zerotier/*.go
)
file(GLOB go_zt_service_tests_cmd_src
${CMAKE_SOURCE_DIR}/cmd/zt_service_tests/*.go
)
if(WIN32)
set(GO_EXE_NAME "zerotier.exe")
set(GO_SERVICE_TESTS_EXE_NAME "zt_service_tests.exe")
set(GO_EXTRA_LIBRARIES "-lstdc++ -lwsock32 -lws2_32 -liphlpapi -lole32 -loleaut32 -lrpcrt4 -luuid")
else(WIN32)
set(GO_EXE_NAME "zerotier")
set(GO_SERVICE_TESTS_EXE_NAME "zt_service_tests")
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(GO_EXTRA_LIBRARIES "-lstdc++")
if(BUILD_ARM_V5)
set(GO_EXTRA_LIBRARIES
${GO_EXTRA_LIBRARIES}
"-latomic"
)
endif(BUILD_ARM_V5)
else()
set(GO_EXTRA_LIBRARIES "-lc++" "-lm")
endif()
endif(WIN32)
add_custom_target(
zt_service_tests ALL
BYPRODUCTS ${CMAKE_BINARY_DIR}/zt_service_tests
SOURCES ${go_src} ${go_zt_service_tests_cmd_src}
COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$<TARGET_FILE:zt_core> $<TARGET_FILE:zt_controller> $<TARGET_FILE:zt_service_io_core> $<TARGET_FILE:zt_osdep> ${GO_EXTRA_LIBRARIES}\" ${GO} build -mod=vendor ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_SERVICE_TESTS_EXE_NAME} ${go_zt_service_tests_cmd_src}
COMMENT "Compiling zt_service_tests (Go/cgo self-tests)..."
)
add_dependencies(zt_service_tests zt_osdep zt_core zt_controller zt_service_io_core)
add_custom_target(
zerotier ALL
BYPRODUCTS ${CMAKE_BINARY_DIR}/zerotier
SOURCES ${go_src}
COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$<TARGET_FILE:zt_core> $<TARGET_FILE:zt_controller> $<TARGET_FILE:zt_service_io_core> $<TARGET_FILE:zt_osdep> ${GO_EXTRA_LIBRARIES}\" ${GO} build -mod=vendor ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_EXE_NAME} ${CMAKE_SOURCE_DIR}/cmd/zerotier/zerotier.go
COMMENT "Compiling Go Code..."
)
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zerotier DESTINATION bin)
else(NOT PACKAGE_STATIC)
if(BUILD_32BIT)
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
add_compile_options(
-m32
)
endif(BUILD_32BIT)
set(STATIC_BINARY ${CMAKE_BINARY_DIR}/zerotier)
set(IMPORTED_LOCATION ${CMAKE_BINARY_DIR})
add_executable(zerotier IMPORTED GLOBAL)
install(PROGRAMS ${STATIC_BINARY} DESTINATION bin)
endif(NOT PACKAGE_STATIC)
# Linux packaging
if("${CMAKE_SYSTEM_NAME}" EQUAL "Linux")
if(IS_DIRECTORY /lib/systemd/system)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.service
DESTINATION /lib/systemd/system
)
elseif(IS_DIRECTORY /usr/lib/systemd/system)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.service
DESTINATION /usr/lib/systemd/system
)
else()
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.init
DESTINATION /etc/init.d
)
endif()
endif()
if("${ZT_PACKAGE_FORMAT}" MATCHES "DEB")
include(packaging/debian.cmake)
elseif("${ZT_PACKAGE_FORMAT}" MATCHES "RPM")
include(packaging/rpm.cmake)
else()
endif()

11
COPYING
View File

@ -1,13 +1,8 @@
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
Copyright © 20112018 ZeroTier, Inc.
Copyright © 20132020 ZeroTier, Inc.
ZeroTier One 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.
See the file LICENSE.GPL-3 for the text of the GNU GPL version 3.
If that file is not present, see <http://www.gnu.org/licenses/>.
ZeroTier is released under the terms of the BSL version 1.1. See the
file LICENSE.txt for details.
..
Local variables:

568
Jenkinsfile vendored
View File

@ -1,84 +1,502 @@
#!/usr/bin/env groovy
node('master') {
checkout scm
pipeline {
options {
disableConcurrentBuilds()
preserveStashes(buildCount: 10)
timestamps()
}
parameters {
booleanParam(name: "BUILD_ALL", defaultValue: false, description: "Build all supported platform/architecture combos. Defaults to x86/x64 only")
}
environment {
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
}
def changelog = getChangeLog currentBuild
agent none
stages {
stage ("Build") {
steps {
script {
def tasks = [:]
tasks << buildStaticBinaries()
tasks << buildDebianNative()
tasks << buildCentosNative()
tasks << buildMacOS()
tasks << buildWindows()
tasks << buildFreeBSD()
mattermostSend "Building ${env.JOB_NAME} #${env.BUILD_NUMBER} \n Change Log: \n ${changelog}"
}
parallel 'centos7': {
node('centos7') {
try {
checkout scm
stage('Build Centos 7') {
sh 'make -f make-linux.mk'
parallel tasks
}
}
}
catch (err) {
currentBuild.result = "FAILURE"
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Centos 7 (<${env.BUILD_URL}|Open>)"
throw err
}
}
}, 'android-ndk': {
node('android-ndk') {
try {
checkout scm
stage('Build Android NDK') {
sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}"
stage ("Package Static") {
steps {
script {
parallel packageStatic()
}
}
}
catch (err) {
currentBuild.result = "FAILURE"
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)"
throw err
}
}
}, 'macOS': {
node('macOS') {
try {
checkout scm
stage('Build macOS') {
sh 'make -f make-mac.mk'
}
stage('Build macOS UI') {
sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug'
}
}
catch (err) {
currentBuild.result = "FAILURE"
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)"
throw err
}
}
}, 'windows': {
node('windows') {
try {
checkout scm
stage('Build Windows') {
bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64
git clean -dfx
msbuild windows\\ZeroTierOne.sln
'''
}
}
catch (err) {
currentBuild.result = "FAILURE"
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)"
throw err
}
}
}
mattermostSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)"
def buildMacOS() {
def tasks = [:]
tasks << getTasks(['mac'],['amd64'], {unused1, unused2 ->
def myNode = {
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
node ('mac') {
dir("build") {
checkout scm
sh 'make'
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
return myNode
})
return tasks
}
def buildWindows() {
def tasks = [:]
tasks << getTasks(['windows'], ['amd64', 'i386'], { unused1, platform ->
def myNode = {
node ('windows') {
env.SHELL = 'C:/Windows/System32/cmd.exe'
dir ("build") {
checkout scm
dir ("build") {
withEnv(["PATH=C:\\TDM-GCC-64\\bin;C:\\WINDOWS;C:\\Windows\\system32;C:\\CMake\\bin;C:\\Go\\bin"]) {
def cmakeFlags = ""
if (platform == "i386") {
cmakeFlags = '-DBUILD_32BIT=1'
}
bat """
cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ${cmakeFlags} ..
mingw32-make -j8
"""
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
}
return myNode
})
return tasks
}
def buildFreeBSD() {
def tasks = [:]
tasks << getTasks(['freebsd12'], ['amd64'], { unused1, unused2 ->
def myNode = {
node ('freebsd12') {
dir('build') {
checkout scm
sh 'make setup'
dir('build') {
sh 'make -j4'
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
return myNode
})
return tasks
}
def buildStaticBinaries() {
def tasks = [:]
def dist = ["alpine"]
def archs = []
if (params.BUILD_ALL == true) {
archs = ["arm64", "amd64", "i386", "armhf", "ppc64le", "s390x"]
} else {
archs = ["amd64", "i386"]
}
tasks << getTasks(dist, archs, { distro, platform ->
def myNode = {
node ('linux-build') {
env.PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${platform}:latest")
runtime.inside {
dir("build") {
def cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"'
if (platform == "i386") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"'
} else if (platform == "armhf") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DBUILD_ARM_V6=1"'
}
sh "${cmakeFlags} make"
dir("build") {
sh "mv zerotier zerotier-static-${platform}"
stash includes: 'zerotier-static-*', name: "static-${platform}"
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
}
return myNode
})
return tasks
}
def getTasks(axisDistro, axisPlatform, task) {
def tasks = [:]
for(int i=0; i< axisDistro.size(); i++) {
def axisDistroValue = axisDistro[i]
for(int j=0; j< axisPlatform.size(); j++) {
def axisPlatformValue = axisPlatform[j]
tasks["${axisDistroValue}/${axisPlatformValue}"] = task(axisDistroValue, axisPlatformValue)
}
}
return tasks
}
def packageStatic() {
def tasks = [:]
def centos7 = ["centos7"]
def centos7Arch = ["i386"]
tasks << getTasks(centos7, centos7Arch, { distro, arch ->
def myNode = {
node ('linux-build') {
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
runtime.inside {
dir("build") {
unstash "static-${arch}"
sh "mkdir -p build"
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
sh 'CMAKE_ARGS="-DBUILD_32BIT=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=RPM" make setup'
dir("build") {
sh 'make package -j4 VERBOSE=1'
}
sh "mkdir -p ${distro}"
sh "cp -av build/*.rpm ${distro}/"
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
return myNode
})
if (params.BUILD_ALL == true) {
def s390xStatics = ["clefos", "debian-buster", "debian-sid", "debian-bullseye", "debian-stretch", "ubuntu-bionic", "ubuntu-eoan", "ubuntu-focal"]
def s390x = ["s390x"]
tasks << getTasks(s390xStatics, s390x , { distro, arch ->
def myNode = {
node ('linux-build') {
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
def pkgFormat = "DEB"
if (distro == "clefos") {
pkgFormat = "RPM"
}
runtime.inside {
dir("build/") {
unstash "static-${arch}"
sh "mkdir -p build"
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
sh "CMAKE_ARGS=\"-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=${pkgFormat}\" make setup"
dir("build") {
sh 'make package -j4 VERBOSE=1'
}
sh "mkdir -p ${distro}"
sh "cp -av build/*.rpm ${distro}/"
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
return myNode
})
}
def debianJessie = ["debian-jessie"]
def debianJessieArchs = []
if (params.BUILD_ALL == true) {
debianJessieArch = ["armhf", "amd64", "i386"]
} else {
debianJessieArch = ["amd64", "i386"]
}
tasks << getTasks(debianJessie, debianJessieArch, { distro, arch ->
def myNode = {
node ('linux-build') {
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
runtime.inside {
dir('build/') {
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
if (arch == "i386") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
} else if (arch == "armel") {
cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
} else if (arch == "armhf") {
cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
}
unstash "static-${arch}"
sh "mkdir -p build"
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
sh "${cmakeFlags} make setup"
dir("build") {
sh 'make package -j4 VERBOSE=1'
}
sh "mkdir -p ${distro}"
sh "cp -av build/*.deb ${distro}/"
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
return myNode
})
def ubuntuTrusty = ["ubuntu-trusty"]
def ubuntuTrustyArch = []
if (params.BUILD_ALL == true) {
ubuntuTrustyArch = ["i386", "amd64", "arm64", "ppc64le"]
} else {
ubuntuTrustyArch = ["i386", "amd64"]
}
tasks << getTasks(ubuntuTrusty, ubuntuTrustyArch, { distro, arch ->
def myNode = {
node ('linux-build') {
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
runtime.inside {
dir('build/') {
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
if (arch == "i386") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
} else if (arch == "armel") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
} else if (arch == "armhf") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
}
unstash "static-${arch}"
sh "mkdir -p build"
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
sh "${cmakeFlags} make setup"
dir("build") {
sh 'make package -j4 VERBOSE=1'
}
sh "mkdir -p ${distro}"
sh "cp -av build/*.deb ${distro}/"
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
return myNode
})
def debianWheezy = ["debian-wheezy"]
def debianWheezyArchs = []
if (params.BUILD_ALL == true) {
debianWheezyArchs = ["armhf", "amd64", "i386"]
} else {
debianWheezyArchs = ["amd64", "i386"]
}
tasks << getTasks(debianJessie, debianJessieArch, { distro, arch ->
def myNode = {
node ('linux-build') {
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
runtime.inside {
dir('build/') {
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
if (arch == "i386") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
} else if (arch == "armel") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
} else if (arch == "armhf") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
}
unstash "static-${arch}"
sh "mkdir -p build"
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
sh "${cmakeFlags} make setup"
dir("build") {
sh 'make package -j4 VERBOSE=1'
}
sh "mkdir -p ${distro}"
sh "cp -av build/*.deb ${distro}/"
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
}
}
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
return myNode
})
return tasks
}
def buildDebianNative() {
def tasks = [:]
def debian = ["debian-buster" , "debian-stretch", "debian-sid", "debian-bullseye"]
def debianArchs = []
if (params.BUILD_ALL) {
debianArchs = ["ppc64le", "i386", "armhf", "armel", "arm64", "amd64"]
} else {
debianArchs = ["amd64", "i386"]
}
def build = { distro, arch ->
def myNode = {
node ('linux-build') {
env.PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
runtime.inside {
def cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB"'
if (arch == "i386") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DZT_PACKAGE_FORMAT=DEB"'
} else if (arch == "armel") {
cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
} else if (arch == "armhf") {
cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
}
dir("build") {
sh "${cmakeFlags} make setup"
dir("build") {
sh "make package -j4 VERBOSE=1"
}
}
sh "mkdir -p ${distro}"
sh "mv build/build/*.deb ${distro}"
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
}
return myNode
}
tasks << getTasks(debian, debianArchs, build)
// bash is broken when running under QEMU-s390x on Xenial
def xenial = ["ubuntu-xenial"]
def xenialArchs = []
if (params.BUILD_ALL == true) {
xenialArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le"]
} else {
xenialArchs = ["i386", "amd64"]
}
tasks << getTasks(xenial, xenialArchs, build)
def ubuntu = ["ubuntu-bionic", "ubuntu-eoan"]
def ubuntuArchs = []
if (params.BUILD_ALL == true) {
ubuntuArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le"]
} else {
ubuntuArchs = ["i386", "amd64"]
}
tasks << getTasks(ubuntu, ubuntuArchs, build)
def ubuntuFocal = ["ubuntu-focal"]
def ubuntuFocalArchs = []
if (params.BUILD_ALL == true) {
ubuntuFocalArchs = ["amd64", "arm64", "ppc64le"]
} else {
ubuntuFocalArchs = ["amd64"]
}
tasks << getTasks(ubuntuFocal, ubuntuFocalArchs, build)
def kali = ["kali-rolling"]
def kaliArchs = ["amd64"]
tasks << getTasks(kali, kaliArchs, build)
return tasks
}
def buildCentosNative() {
def tasks = [:]
def build = { distro, arch ->
def myNode = {
node ('linux-build') {
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
dir ("build") {
checkout scm
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
runtime.inside {
dir("build") {
if (distro == 'centos7' && arch == 'amd64') {
sh 'source scl_source enable devtoolset-8 llvm-toolset-7 && CMAKE_ARGS="-DZT_PACKAGE_FORMAT=RPM" make setup'
} else {
sh 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=RPM" make setup'
}
dir ("build") {
if (distro == 'centos7' && arch == 'amd64') {
sh 'source scl_source enable devtoolset-8 llvm-toolset-7 && make package -j4 VERBOSE=1'
} else {
sh 'make package -j4 VERBOSE=1'
}
}
}
sh "mkdir -p ${distro}"
sh "cp -av build/build/*.rpm ${distro}/"
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
}
}
}
return myNode
}
def centos8 = ["centos8"]
def centos8Archs = []
if (params.BUILD_ALL == true) {
centos8Archs = ["amd64", "arm64", "ppc64le"]
} else {
centos8Archs = ["amd64"]
}
tasks << getTasks(centos8, centos8Archs, build)
def centos7 = ["centos7"]
def centos7Archs = ["amd64"]
tasks << getTasks(centos7, centos7Archs, build)
return tasks
}

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,37 +1,149 @@
ZeroTier One - Network Virtualization Everywhere
Copyright (C) 2011-2017 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.
Business Source License 1.1
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.
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------
See LICENSE.GPL-3 for the full GNU GPL v3 license.
Parameters
--
Licensor: ZeroTier, Inc.
Licensed Work: ZeroTier Network Virtualization Engine
The Licensed Work is (c)2013-2020 ZeroTier, Inc.
Additional Use Grant: You may make use of the Licensed Work, provided you
do not use it in any of the following ways:
You can be released from the requirements of the license by purchasing
a commercial license. Buying such a license is mandatory as soon as you
develop commercial closed-source software that incorporates or links
directly against ZeroTier software without disclosing the source code
of your own application.
* Sell hosted ZeroTier services as a "SaaS" Product
--
(1) Operate or sell access to ZeroTier root servers,
network controllers, or authorization key or certificate
generation components of the Licensed Work as a
for-profit service, regardless of whether the use of
these components is sold alone or is bundled with other
services. Note that this does not apply to the use of
ZeroTier behind the scenes to operate a service not
related to ZeroTier network administration.
The above license does not apply to third party code included with or
linked against by ZeroTier software. See the third party code section
of the AUTHORS.md for an index of third party software included in
this software repository.
* Create Non-Open-Source Commercial Derivative Works
Licenses for third party code are all relatively permissive: MIT,
BSD, and public domain. The only exception is the tap-windows driver
which is under the GPLv2, but this is only needed to produce the
binary tap device driver used by the ZeroTier service on Windows.
(2) Link or directly include the Licensed Work in a
commercial or for-profit application or other product
not distributed under an Open Source Initiative (OSI)
compliant license. See: https://opensource.org/licenses
(3) Remove the name, logo, copyright, or other branding
material from the Licensed Work to create a "rebranded"
or "white labeled" version to distribute as part of
any commercial or for-profit product or service.
* Certain Government Uses
(4) Use or deploy the Licensed Work in a government
setting in support of any active government function
or operation with the exception of the following:
physical or mental health care, family and social
services, social welfare, senior care, child care, and
the care of persons with disabilities.
Change Date: 2025-01-01
Change License: Apache License version 2.0 as published by the Apache
Software Foundation
https://www.apache.org/licenses/
Alternative Licensing
If you would like to use the Licensed Work in any way that conflicts with
the stipulations of the Additional Use Grant, contact ZeroTier, Inc. to
obtain an alternative commercial license.
Visit us on the web at: https://www.zerotier.com/
Notice
The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
For more information on the use of the Business Source License for ZeroTier
products, please visit our pricing page which contains license details and
and license FAQ: https://zerotier.com/pricing
For more information on the use of the Business Source License generally,
please visit the Adopting and Developing Business Source License FAQ at
https://mariadb.com/bsl-faq-adopting.
-----------------------------------------------------------------------------
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
-----------------------------------------------------------------------------
MariaDB hereby grants you permission to use this Licenses text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:
1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where "compatible" means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.
2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text "None".
3. To specify a Change Date.
4. Not to modify this License in any other way.

View File

@ -1,24 +1,31 @@
# Common makefile -- loads make rules for each platform
BUILDDIR := build
TIMESTAMP=$(shell date +"%Y%m%d%H%M")
OSTYPE=$(shell uname -s)
.PHONY: all
ifeq ($(OSTYPE),Darwin)
include make-mac.mk
endif
all: setup
cd ${BUILDDIR} && $(MAKE) -j4 VERBOSE=1
ifeq ($(OSTYPE),Linux)
include make-linux.mk
endif
setup:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}
ifeq ($(OSTYPE),FreeBSD)
CC=clang
CXX=clang++
ZT_BUILD_PLATFORM=7
include make-bsd.mk
endif
ifeq ($(OSTYPE),OpenBSD)
CC=egcc
CXX=eg++
ZT_BUILD_PLATFORM=9
include make-bsd.mk
endif
setup-debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS}
debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS} && $(MAKE)
central-controller:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
central-controller-debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
central-controller-docker:
docker build -t registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f controller/central-docker/Dockerfile .
clean:
rm -rf ${BUILDDIR}
distclean:
rm -rf ${BUILDDIR}

View File

@ -1,22 +1,32 @@
ZeroTier - A Planetary Ethernet Switch
ZeroTier - Global Area Networking
======
ZeroTier is a smart programmable Ethernet switch for planet Earth.
ZeroTier is a smart programmable Ethernet switch for planet Earth. It allows all networked devices, VMs, containers, and applications to communicate as if they all reside in the same physical data center or cloud region.
It replaces the physical LAN/WAN boundary with a virtual one, allowing devices of any type at any location to be managed as if they all reside in the same cloud region or data center. All traffic is encrypted end-to-end and takes the most direct path available for minimum latency and maximum performance. The goals and design of ZeroTier are inspired by among other things the original [Google BeyondCorp](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43231.pdf) paper and the [Jericho Forum](https://en.wikipedia.org/wiki/Jericho_Forum).
This is accomplished by combining a cryptographically addressed and secure peer to peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.
Visit [ZeroTier's site](https://www.zerotier.com/?pk_campaign=github_ZeroTierOne) for more information and [pre-built binary packages](https://www.zerotier.com/download.shtml?pk_campaign=github_ZeroTierOne). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer to peer, though we offer free (but slow) relaying for users who cannot establish peer to peer connetions.
The goals and design principles of ZeroTier are inspired by among other things the original [Google BeyondCorp](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43231.pdf) paper and the [Jericho Forum](https://en.wikipedia.org/wiki/Jericho_Forum) with its notion of "deperimeterization."
Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download/). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
ZeroTier is licensed under the [BSL version 1.1](https://mariadb.com/bsl11/). See [LICENSE.txt](LICENSE.txt) and the [ZeroTier pricing page](https://www.zerotier.com/pricing) for details. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license.
A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See [AUTHORS.md] for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.).
### Getting Started
Everything in the ZeroTier world is controlled by two types of identifier: 40-bit/10-digit *ZeroTier addresses* and 64-bit/16-digit *network IDs*. A ZeroTier address identifies a node or "device" (laptop, phone, server, VM, app, etc.) while a network ID identifies a virtual Ethernet network that can be joined by devices.
Everything in the ZeroTier world is controlled by two types of identifier: 40-bit/10-digit *ZeroTier addresses* and 64-bit/16-digit *network IDs*. These identifiers are easily distinguished by their length. A ZeroTier address identifies a node or "device" (laptop, phone, server, VM, app, etc.) while a network ID identifies a virtual Ethernet network that can be joined by devices.
Another way of thinking about it is that ZeroTier addresses are port numbers on a giant planetary-sized smart switch while network IDs are VLANs to which these ports can be assigned. For more details read about VL1 and VL2 in [the ZeroTier manual](https://www.zerotier.com/manual.shtml).
ZeroTier addresses can be thought of as port numbers on an enormous planet-wide enterprise Ethernet smart switch supporting VLANs. Network IDs are VLAN IDs to which these ports may be assigned. A single port can be assigned to more than one VLAN.
*Network controllers* are ZeroTier nodes that act as access control certificate authorities and configuration managers for virtual networks. The first 40 bits (or 10 digits) of a network ID is the ZeroTier address of its controller. You can create networks with our [hosted controllers](https://my.zerotier.com/) and web UI/API or [host your own](controller/) if you don't mind posting some JSON configuration info or writing a script to do so.
A ZeroTier address looks like `8056c2e21c` and a network ID looks like `8056c2e21c000001`. Network IDs are composed of the ZeroTier address of that network's primary controller and an arbitrary 24-bit ID that identifies the network on this controller. Network controllers are roughly analogous to SDN controllers in SDN protocols like [OpenFlow](https://en.wikipedia.org/wiki/OpenFlow), though as with the analogy between VXLAN and VL2 this should not be read to imply that the protocols or design are the same. You can use our convenient and inexpensive SaaS hosted controllers at [my.zerotier.com](https://my.zerotier.com/) or [run your own controller](controller/) if you don't mind messing around with JSON configuration files or writing scripts to do so.
### Project Layout
The base path contains the ZeroTier One service main entry point (`one.cpp`), self test code, makefiles, etc.
- `artwork/`: icons, logos, etc.
- `attic/`: old stuff and experimental code that we want to keep around for reference.
- `controller/`: the reference network controller implementation, which is built and included by default on desktop and server build targets.
@ -28,35 +38,27 @@ Another way of thinking about it is that ZeroTier addresses are port numbers on
- `macui/`: a Macintosh menu-bar app for controlling ZeroTier One, written in Objective C.
- `node/`: the ZeroTier virtual Ethernet switch core, which is designed to be entirely separate from the rest of the code and able to be built as a stand-alone OS-independent library. Note to developers: do not use C++11 features in here, since we want this to build on old embedded platforms that lack C++11 support. C++11 can be used elsewhere.
- `osdep/`: code to support and integrate with OSes, including platform-specific stuff only built for certain targets.
- `rule-compiler/`: JavaScript rules language compiler for defining network-level rules.
- `service/`: the ZeroTier One service, which wraps the ZeroTier core and provides VPN-like connectivity to virtual networks for desktops, laptops, servers, VMs, and containers.
- `tcp-proxy/`: TCP proxy code run by ZeroTier, Inc. to provide TCP fallback (this will die soon!).
- `windows/`: Visual Studio solution files, Windows service code for ZeroTier One, and the Windows task bar app UI.
The base path contains the ZeroTier One service main entry point (`one.cpp`), self test code, makefiles, etc.
- `windows/`: Visual Studio solution files, Windows service code, and the Windows task bar app UI.
### Build and Platform Notes
To build on Mac and Linux just type `make`. On FreeBSD and OpenBSD `gmake` (GNU make) is required and can be installed from packages or ports. For Windows there is a Visual Studio solution in `windows/'.
- **Mac**
- Xcode command line tools for OSX 10.7 or newer are required.
- Tap device driver kext source is in `ext/tap-mac` and a signed pre-built binary can be found in `ext/bin/tap-mac`. You should not need to build it yourself. It's a fork of [tuntaposx](http://tuntaposx.sourceforge.net) with device names changed to `zt#`, support for a larger MTU, and tun functionality removed.
- Xcode command line tools for OSX 10.8 or newer are required.
- **Linux**
- The minimum compiler versions required are GCC/G++ 4.9.3 or CLANG/CLANG++ 3.4.2.
- The minimum compiler versions required are GCC/G++ 4.9.3 or CLANG/CLANG++ 3.4.2. (Install `clang` on CentOS 7 as G++ is too old.)
- Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
- CentOS 7 ships with a version of GCC/G++ that is too old, but a new enough version of CLANG can be found in the *epel* repositories. Type `yum install epel-release` and then `yum install clang` to build there.
- **Windows**
- Windows 7 or newer is supported. This *may* work on Vista but isn't officially supported there. It will not work on Windows XP.
- We build with Visual Studio 2015. Older versions may not work. Clang or MinGW will also probably work but may require some makefile hacking.
- Pre-built signed Windows drivers are included in `ext/bin/tap-windows-ndis6`. The MSI files found there will install them on 32-bit and 64-bit systems. We don't recommend trying to build Windows drivers from scratch unless you know what you're doing. One does not simply "build" a Windows driver.
- We build with Visual Studio 2017. Older versions may not work. Clang or MinGW will also probably work but may require some makefile hacking.
- **FreeBSD**
- Tested most recently on FreeBSD-11. Older versions may work but we're not sure.
- GCC/G++ 4.9 and gmake are required. These can be installed from packages or ports. Type `gmake` to build.
- GNU make is required. Type `gmake` to build.
- **OpenBSD**
- There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`). We're not sure if this can be increased.
- OpenBSD lacks `getifmaddrs` (or any equivalent method) to get interface multicast memberships. As a result multicast will only work on OpenBSD for ARP and NDP (IP/MAC lookup) and not for other purposes.
- Only tested on OpenBSD 6.0. Older versions may not work.
- GCC/G++ 4.9 and gmake are required and can be installed using `pkg_add` or from ports. They get installed in `/usr/local/bin` as `egcc` and `eg++` and our makefile is pre-configured to use them on OpenBSD.
- There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`).
- GNU make is required. Type `gmake` to build.
Typing `make selftest` will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
@ -85,7 +87,7 @@ Running ZeroTier One on a Mac is the same, but OSX requires a kernel extension.
This will create the home folder for Mac, place *tap.kext* there, and set its modes correctly to enable ZeroTier One to manage it with *kextload* and *kextunload*.
### Troubleshooting
### Basic Troubleshooting
For most users, it just works.
@ -101,14 +103,6 @@ ZeroTier One peers will automatically locate each other and communicate directly
Users behind certain types of firewalls and "symmetric" NAT devices may not able able to connect to external peers directly at all. ZeroTier has limited support for port prediction and will *attempt* to traverse symmetric NATs, but this doesn't always work. If P2P connectivity fails you'll be bouncing UDP packets off our relay servers resulting in slower performance. Some NAT router(s) have a configurable NAT mode, and setting this to "full cone" will eliminate this problem. If you do this you may also see a magical improvement for things like VoIP phones, Skype, BitTorrent, WebRTC, certain games, etc., since all of these use NAT traversal techniques similar to ours.
If you're interested, there's a [technical deep dive about NAT traversal on our blog](https://www.zerotier.com/blog/?p=226?pk_campaign=github_ZeroTierOne). A troubleshooting tool to help you diagnose NAT issues is planned for the future as are uPnP/IGD/NAT-PMP and IPv6 transport.
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
### Contributing
Please make pull requests against the `dev` branch. The `master` branch is release, and `edge` is for unstable and work in progress changes and is not likely to work.
### License
The ZeroTier source code is open source and is licensed under the GNU GPL v3 (not LGPL). If you'd like to embed it in a closed-source commercial product or appliance, please e-mail [contact@zerotier.com](mailto:contact@zerotier.com) to discuss commercial licensing. Otherwise it can be used for free.
Additional help [can be found in our knowledge base](https://zerotier.atlassian.net/wiki/spaces/SD/overview).

View File

@ -1,6 +1,103 @@
ZeroTier Release Notes
======
# Version 1.9.0 (2.0 beta)
Version 2.0 is a very significant release with many changes. It remains backward compatibility to version 1.4.0 (and possibly earlier versions but this is not guaranteed) but makes numerous local and behavioral changes that should be reviewed before upgrading production systems.
After this release we're going to be working to get to a more frequent, less extreme, more "agile" release cadence.
Protocol changes:
* Trusted paths have been completely removed. The new AES mode is so fast on CPUs with AES acceleration that much of the rationale for this is gone, and this feature was never used much to begin with due to inconvenience and obvious security concerns. Environments using trusted paths will need to upgrade all nodes at once.
* The symmetric encryption algorithm and mode is now AES-GMAC-SIV, a variation of AES-GCM using the same primitives but offering superior security bounds and behavior under non-ideal conditions. It's also a lot faster than Salsa20/12 and Poly1305 on CPUs with AES acceleration (almost all desktops, laptops, and newer routers and phones). Salsa20/12 with Poly1305 is still supported for communication with older versions and small devices that lack AES acceleration.
* A new identity type (1) has been introduced that contains both Curve25519 and NIST P-384 public key types, but classic type 0 remains the default for new identities for now. ECDH key agreement between V1 identities uses both keys and hashes the resulting secrets to yield security equal to the best of the two, but V1 identities can also agree with V0 identities using only their Curve25519 component.
* Roots can now be joined and left like networks in a much more convenient way, and the old "moon" and "planet" terminology is deprecated.
* A new peer to peer multicast algorithm has been introduced that offers much better scalability and better performance, especially when the physical network itself is hub-and-spoke with many low latency peers connected by higher latency WAN links.
* Forward secrecy is finally supported via periodic re-keying using ephemeral asymmetric keys. Both Curve25519 and NIST P-384 keys are used with secrets being hashed to provide security equal to the stronger of the two curves.
* As part of forward secrecy implementation peers now always exchange HELLO messages even if they don't have a direct path.
* Compression is only enabled for control packets as almost all data packets are largely un-compressable.
* New NAT traversal tricks have been added, such as (ab)use of port 500.
Code changes:
* Migrated from GNU make to cmake for easier cross platform builds and simplified build files.
* The core network hypervisor has been significantly refactored, almost amounting to a partial rewrite.
* Critical packet handling paths have been streamlined with unnecessary memcpy() steps removed.
* Host service code has been completely rewritten in Go. Packet handling code remains in C++, but Go offers superior developer productivity when it comes to implementing more complex local service and local API features. Go imposes a little bit more memory overhead but not much and has been tuned to minimize memory use.
User interface:
* Command line interface has been redesigned and rewritten. Old commands names are supported but their output will be different.
Other things:
* The V2 design, protocol, and cryptographic primitives (AES-GMAC-SIV) have been security audited by [Trail of Bits](https://www.trailofbits.com), and the code is being audited as well prior to full 2.0 release.
---
# Older version release notes
# 2019-08-30 -- Version 1.4.6
* Update default root list to latest
* ARM32 platform build and flag fixes
* Add a clarification line to LICENSE.txt
* Fix license message in CLI
* Windows service now looks for service command line arguments
* Fixed a bug that could cause excessive queued multicasts
# 2019-08-23 -- Version 1.4.4
* Change license from GPL3 to BSL 1.1, see LICENSE.txt
* Fix an issue with the "ipauth" rule and auto-generated unforgeable IPv6 addresses
* Fix socket/bind errors setting IPs and routes on Linux
# 2019-08-12 -- Version 1.4.2
* Fix high CPU use bug on some platforms
* Fix issues with PostgreSQL controller DB (only affects Central)
* Restore backward compatibility with MacOS versions prior to 10.13
# 2019-07-29 -- Version 1.4.0
### Major Changes
* Mac version no longer requires a kernel extension, instead making use of the [feth interfaces](https://apple.stackexchange.com/questions/337715/fake-ethernet-interfaces-feth-if-fake-anyone-ever-seen-this).
* Added support for concurrent multipath (multiple paths at once) with traffic weighting by link quality and faster recovery from lost links.
* Added under-the-hood support for QoS (not yet exposed) that will eventually be configurable via our rules engine.
### Minor Changes and Bug Fixes
* Experimental controller DB driver for [LF](https://github.com/zerotier/lf) to store network controller data (LFDB.cpp / LFDB.hpp).
* Modified credential push and direct path push timings and algorithms to somewhat reduce "chattiness" of the protocol when idle. More radical background overhead reductions will have to wait for the 2.x line.
* Removed our beta/half-baked integration of Central with the Windows UI. We're going to do a whole new UI of some kind in the future at least for Windows and Mac.
* Fixed stack overflow issues on Linux versions using musl libc.
* Fixed some alignment problems reported on ARM and ARM64, but some reports we could not reproduce so please report any issues with exact chip, OS/distro, and ZeroTier version in use.
* Fixed numerous other small issues and bugs such as ARM alignment issues causing crashes on some devices.
* Windows now sets the adapter name such that it is consistent in both the Windows UI and command line utilities.
# 2018-07-27 -- Version 1.2.12
* Fixed a bug that caused exits to take a long time on Mac due to huge numbers of redundant attempts to delete managed routes.
* Fixed a socket limit problem on Windows that caused the ZeroTier service to run out of sockets, causing the UI and CLI to be unable to access the API.
* Fixed a threading bug in the ZeroTier Core, albeit one that never manifested on the regular ZeroTier One service/client.
* Fixed a bug that could cause the service to crash if an authorized local client accessed an invalid URL via the control API. (Not exploitable since you needed admin access anyway.)
# 2018-05-08 -- Version 1.2.10
* Fix bug loading `moons.d/` files for federated root operation.
* Fix compile problem with ZT_DEBUG on some versions of `clang`
* Fix slow network startup bug related to loading of `networks.d/` cache files
# 2018-04-27 -- Version 1.2.8
* Linux version once again builds with PIE (position independent executable) flags
* Fixed bug in zerotier-idtool file sign and verify
* Fixed minor OSX app typo
* Merged alpha NetBSD support (mostly untested, so YMMV)
* Merged several minor typo and one-liner bug fixes
# 2018-04-17 -- Version 1.2.6
* Features and Core Improvements
@ -22,7 +119,7 @@ ZeroTier Release Notes
* Fixed two very rare multithreading issues that were only observed on certain systems
* Platform-Specific Changes
* MacOS
* Installer now loads the kernel extension right away so that High Sierra users will see the prompt to authorize it. This is done in the "Security & Privacy" preference pane and must be done driectly on the console (not via remote desktop). On High Sierra and newer kexts must be authorized at the console via security settings system preferences pane.
* Installer now loads the kernel extension right away so that High Sierra users will see the prompt to authorize it. This is done in the "Security & Privacy" preference pane and must be done directly on the console (not via remote desktop). On High Sierra and newer kexts must be authorized at the console via security settings system preferences pane.
* Windows
* The Windows installer should now install the driver without requiring a special prompt in most cases. This should make it easier for our packages to be accepted into and updated in the Chocolatey repository and should make it easier to perform remote installs across groups of machines using IT management and provisioning tools.
* The Windows official packages are now signed with an EV certificate (with hardware key).
@ -64,7 +161,7 @@ The largest new feature in 1.2.0, and the product of many months of work, is our
Rules allow you to filter packets on your network and vector traffic to security observers. Security observation can be performed in-band using REDIRECT or out of band using TEE.
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.
Tags and capabilities provide advanced methods for implementing fine grained permission structures and micro-segmentation schemes without bloating the size and complexity of your rules table.
See the [rules engine announcement blog post](https://www.zerotier.com/blog/?p=927) for an in-depth discussion of theory and implementation. The [manual](https://www.zerotier.com/manual.shtml) contains detailed information on rule, tag, and capability use, and the `rule-compiler/` subfolder of the ZeroTier source tree contains a JavaScript function to compile rules in our human-readable rule definition language into rules suitable for import into a network controller. (ZeroTier Central uses this same script to compile rules on [my.zerotier.com](https://my.zerotier.com/).)
@ -147,7 +244,7 @@ A special kind of public network called an ad-hoc network may be accessed by joi
| Start of port range (hex)
Reserved ZeroTier address prefix indicating a controller-less network
Ad-hoc networks are public (no access control) networks that have no network controller. Instead their configuration and other credentials are generated locally. Ad-hoc networks permit only IPv6 UDP and TCP unicast traffic (no multicast or broadcast) using 6plane format NDP-emulated IPv6 addresses. In addition an ad-hoc network ID encodes an IP port range. UDP packets and TCP SYN (connection open) packets are only allowed to desintation ports within the encoded range.
Ad-hoc networks are public (no access control) networks that have no network controller. Instead their configuration and other credentials are generated locally. Ad-hoc networks permit only IPv6 UDP and TCP unicast traffic (no multicast or broadcast) using 6plane format NDP-emulated IPv6 addresses. In addition an ad-hoc network ID encodes an IP port range. UDP packets and TCP SYN (connection open) packets are only allowed to destination ports within the encoded range.
For example `ff00160016000000` is an ad-hoc network allowing only SSH, while `ff0000ffff000000` is an ad-hoc network allowing any UDP or TCP port.
@ -162,7 +259,7 @@ If you have data in an old SQLite3 controller we've included a NodeJS script in
## Major Bug Fixes in 1.2.0
* **The Windows HyperV 100% CPU bug is FINALLY DEAD**: 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.
* **Segmentation 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
artwork/AppIcon_20x20.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

BIN
artwork/AppIcon_60x60.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
artwork/AppIcon_90x90.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,463 +0,0 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2017 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/>.
*
* --
*
* You can be released from the requirements of the license by purchasing
* a commercial license. Buying such a license is mandatory as soon as you
* develop commercial closed-source software that incorporates or links
* directly against ZeroTier software without disclosing the source code
* of your own application.
*/
#ifndef ZT_CLUSTER_HPP
#define ZT_CLUSTER_HPP
#ifdef ZT_ENABLE_CLUSTER
#include <map>
#include "Constants.hpp"
#include "../include/ZeroTierOne.h"
#include "Address.hpp"
#include "InetAddress.hpp"
#include "SHA512.hpp"
#include "Utils.hpp"
#include "Buffer.hpp"
#include "Mutex.hpp"
#include "SharedPtr.hpp"
#include "Hashtable.hpp"
#include "Packet.hpp"
#include "SharedPtr.hpp"
/**
* Timeout for cluster members being considered "alive"
*
* A cluster member is considered dead and will no longer have peers
* redirected to it if we have not heard a heartbeat in this long.
*/
#define ZT_CLUSTER_TIMEOUT 5000
/**
* Desired period between doPeriodicTasks() in milliseconds
*/
#define ZT_CLUSTER_PERIODIC_TASK_PERIOD 20
/**
* How often to flush outgoing message queues (maximum interval)
*/
#define ZT_CLUSTER_FLUSH_PERIOD ZT_CLUSTER_PERIODIC_TASK_PERIOD
/**
* Maximum number of queued outgoing packets per sender address
*/
#define ZT_CLUSTER_MAX_QUEUE_PER_SENDER 16
/**
* Expiration time for send queue entries
*/
#define ZT_CLUSTER_QUEUE_EXPIRATION 3000
/**
* Chunk size for allocating queue entries
*
* Queue entries are allocated in chunks of this many and are added to a pool.
* ZT_CLUSTER_MAX_QUEUE_GLOBAL must be evenly divisible by this.
*/
#define ZT_CLUSTER_QUEUE_CHUNK_SIZE 32
/**
* Maximum number of chunks to ever allocate
*
* This is a global sanity limit to prevent resource exhaustion attacks. It
* works out to about 600mb of RAM. You'll never see this on a normal edge
* node. We're unlikely to see this on a root server unless someone is DOSing
* us. In that case cluster relaying will be affected but other functions
* should continue to operate normally.
*/
#define ZT_CLUSTER_MAX_QUEUE_CHUNKS 8194
/**
* Max data per queue entry
*/
#define ZT_CLUSTER_SEND_QUEUE_DATA_MAX 1500
/**
* We won't send WANT_PEER to other members more than every (ms) per recipient
*/
#define ZT_CLUSTER_WANT_PEER_EVERY 1000
namespace ZeroTier {
class RuntimeEnvironment;
class MulticastGroup;
class Peer;
class Identity;
// Internal class implemented inside Cluster.cpp
class _ClusterSendQueue;
/**
* Multi-homing cluster state replication and packet relaying
*
* Multi-homing means more than one node sharing the same ZeroTier identity.
* There is nothing in the protocol to prevent this, but to make it work well
* requires the devices sharing an identity to cooperate and share some
* information.
*
* There are three use cases we want to fulfill:
*
* (1) Multi-homing of root servers with handoff for efficient routing,
* HA, and load balancing across many commodity nodes.
* (2) Multi-homing of network controllers for the same reason.
* (3) Multi-homing of nodes on virtual networks, such as domain servers
* and other important endpoints.
*
* These use cases are in order of escalating difficulty. The initial
* version of Cluster is aimed at satisfying the first, though you are
* free to try #2 and #3.
*/
class Cluster
{
public:
/**
* State message types
*/
enum StateMessageType
{
CLUSTER_MESSAGE_NOP = 0,
/**
* This cluster member is alive:
* <[2] version minor>
* <[2] version major>
* <[2] version revision>
* <[1] protocol version>
* <[4] X location (signed 32-bit)>
* <[4] Y location (signed 32-bit)>
* <[4] Z location (signed 32-bit)>
* <[8] local clock at this member>
* <[8] load average>
* <[8] number of peers>
* <[8] flags (currently unused, must be zero)>
* <[1] number of preferred ZeroTier endpoints>
* <[...] InetAddress(es) of preferred ZeroTier endpoint(s)>
*
* Cluster members constantly broadcast an alive heartbeat and will only
* receive peer redirects if they've done so within the timeout.
*/
CLUSTER_MESSAGE_ALIVE = 1,
/**
* Cluster member has this peer:
* <[...] serialized identity of peer>
*
* This is typically sent in response to WANT_PEER but can also be pushed
* to prepopulate if this makes sense.
*/
CLUSTER_MESSAGE_HAVE_PEER = 2,
/**
* Cluster member wants this peer:
* <[5] ZeroTier address of peer>
*
* Members that have a direct link to this peer will respond with
* HAVE_PEER.
*/
CLUSTER_MESSAGE_WANT_PEER = 3,
/**
* A remote packet that we should also possibly respond to:
* <[2] 16-bit length of remote packet>
* <[...] remote packet payload>
*
* Cluster members may relay requests by relaying the request packet.
* These may include requests such as WHOIS and MULTICAST_GATHER. The
* packet must be already decrypted, decompressed, and authenticated.
*
* This can only be used for small request packets as per the cluster
* message size limit, but since these are the only ones in question
* this is fine.
*
* If a response is generated it is sent via PROXY_SEND.
*/
CLUSTER_MESSAGE_REMOTE_PACKET = 4,
/**
* Request that VERB_RENDEZVOUS be sent to a peer that we have:
* <[5] ZeroTier address of peer on recipient's side>
* <[5] ZeroTier address of peer on sender's side>
* <[1] 8-bit number of sender's peer's active path addresses>
* <[...] series of serialized InetAddresses of sender's peer's paths>
*
* This requests that we perform NAT-t introduction between a peer that
* we have and one on the sender's side. The sender furnishes contact
* info for its peer, and we send VERB_RENDEZVOUS to both sides: to ours
* directly and with PROXY_SEND to theirs.
*/
CLUSTER_MESSAGE_PROXY_UNITE = 5,
/**
* Request that a cluster member send a packet to a locally-known peer:
* <[5] ZeroTier address of recipient>
* <[1] packet verb>
* <[2] length of packet payload>
* <[...] packet payload>
*
* This differs from RELAY in that it requests the receiving cluster
* member to actually compose a ZeroTier Packet from itself to the
* provided recipient. RELAY simply says "please forward this blob."
* RELAY is used to implement peer-to-peer relaying with RENDEZVOUS,
* while PROXY_SEND is used to implement proxy sending (which right
* now is only used to send RENDEZVOUS).
*/
CLUSTER_MESSAGE_PROXY_SEND = 6,
/**
* Replicate a network config for a network we belong to:
* <[...] network config chunk>
*
* This is used by clusters to avoid every member having to query
* for the same netconf for networks all members belong to.
*
* The first field of a network config chunk is the network ID,
* so this can be checked to look up the network on receipt.
*/
CLUSTER_MESSAGE_NETWORK_CONFIG = 7
};
/**
* Construct a new cluster
*/
Cluster(
const RuntimeEnvironment *renv,
uint16_t id,
const std::vector<InetAddress> &zeroTierPhysicalEndpoints,
int32_t x,
int32_t y,
int32_t z,
void (*sendFunction)(void *,unsigned int,const void *,unsigned int),
void *sendFunctionArg,
int (*addressToLocationFunction)(void *,const struct sockaddr_storage *,int *,int *,int *),
void *addressToLocationFunctionArg);
~Cluster();
/**
* @return This cluster member's ID
*/
inline uint16_t id() const throw() { return _id; }
/**
* Handle an incoming intra-cluster message
*
* @param data Message data
* @param len Message length (max: ZT_CLUSTER_MAX_MESSAGE_LENGTH)
*/
void handleIncomingStateMessage(const void *msg,unsigned int len);
/**
* Broadcast that we have a given peer
*
* This should be done when new peers are first contacted.
*
* @param id Identity of peer
*/
void broadcastHavePeer(const Identity &id);
/**
* Broadcast a network config chunk to other members of cluster
*
* @param chunk Chunk data
* @param len Length of chunk
*/
void broadcastNetworkConfigChunk(const void *chunk,unsigned int len);
/**
* If the cluster has this peer, prepare the packet to send via cluster
*
* Note that outp is only armored (or modified at all) if the return value is a member ID.
*
* @param toPeerAddress Value of outp.destination(), simply to save additional lookup
* @param ts Result: set to time of last HAVE_PEER from the cluster
* @param peerSecret Result: Buffer to fill with peer secret on valid return value, must be at least ZT_PEER_SECRET_KEY_LENGTH bytes
* @return -1 if cluster does not know this peer, or a member ID to pass to sendViaCluster()
*/
int checkSendViaCluster(const Address &toPeerAddress,uint64_t &mostRecentTs,void *peerSecret);
/**
* Send data via cluster front plane (packet head or fragment)
*
* @param haveMemberId Member ID that has this peer as returned by prepSendviaCluster()
* @param toPeerAddress Destination peer address
* @param data Packet or packet fragment data
* @param len Length of packet or fragment
* @return True if packet was sent (and outp was modified via armoring)
*/
bool sendViaCluster(int haveMemberId,const Address &toPeerAddress,const void *data,unsigned int len);
/**
* Relay a packet via the cluster
*
* This is used in the outgoing packet and relaying logic in Switch to
* relay packets to other cluster members. It isn't PROXY_SEND-- that is
* used internally in Cluster to send responses to peer queries.
*
* @param fromPeerAddress Source peer address (if known, should be NULL for fragments)
* @param toPeerAddress Destination peer address
* @param data Packet or packet fragment data
* @param len Length of packet or fragment
* @param unite If true, also request proxy unite across cluster
*/
void relayViaCluster(const Address &fromPeerAddress,const Address &toPeerAddress,const void *data,unsigned int len,bool unite);
/**
* Send a distributed query to other cluster members
*
* Some queries such as WHOIS or MULTICAST_GATHER need a response from other
* cluster members. Replies (if any) will be sent back to the peer via
* PROXY_SEND across the cluster.
*
* @param pkt Packet to distribute
*/
void sendDistributedQuery(const Packet &pkt);
/**
* Call every ~ZT_CLUSTER_PERIODIC_TASK_PERIOD milliseconds.
*/
void doPeriodicTasks();
/**
* Add a member ID to this cluster
*
* @param memberId Member ID
*/
void addMember(uint16_t memberId);
/**
* Remove a member ID from this cluster
*
* @param memberId Member ID to remove
*/
void removeMember(uint16_t memberId);
/**
* Find a better cluster endpoint for this peer (if any)
*
* @param redirectTo InetAddress to be set to a better endpoint (if there is one)
* @param peerAddress Address of peer to (possibly) redirect
* @param peerPhysicalAddress Physical address of peer's current best path (where packet was most recently received or getBestPath()->address())
* @param offload Always redirect if possible -- can be used to offload peers during shutdown
* @return True if redirectTo was set to a new address, false if redirectTo was not modified
*/
bool findBetterEndpoint(InetAddress &redirectTo,const Address &peerAddress,const InetAddress &peerPhysicalAddress,bool offload);
/**
* @param ip Address to check
* @return True if this is a cluster frontplane address (excluding our addresses)
*/
bool isClusterPeerFrontplane(const InetAddress &ip) const;
/**
* Fill out ZT_ClusterStatus structure (from core API)
*
* @param status Reference to structure to hold result (anything there is replaced)
*/
void status(ZT_ClusterStatus &status) const;
private:
void _send(uint16_t memberId,StateMessageType type,const void *msg,unsigned int len);
void _flush(uint16_t memberId);
void _doREMOTE_WHOIS(uint64_t fromMemberId,const Packet &remotep);
void _doREMOTE_MULTICAST_GATHER(uint64_t fromMemberId,const Packet &remotep);
// These are initialized in the constructor and remain immutable ------------
uint16_t _masterSecret[ZT_SHA512_DIGEST_LEN / sizeof(uint16_t)];
unsigned char _key[ZT_PEER_SECRET_KEY_LENGTH];
const RuntimeEnvironment *RR;
_ClusterSendQueue *const _sendQueue;
void (*_sendFunction)(void *,unsigned int,const void *,unsigned int);
void *_sendFunctionArg;
int (*_addressToLocationFunction)(void *,const struct sockaddr_storage *,int *,int *,int *);
void *_addressToLocationFunctionArg;
const int32_t _x;
const int32_t _y;
const int32_t _z;
const uint16_t _id;
const std::vector<InetAddress> _zeroTierPhysicalEndpoints;
// end immutable fields -----------------------------------------------------
struct _Member
{
unsigned char key[ZT_PEER_SECRET_KEY_LENGTH];
uint64_t lastReceivedAliveAnnouncement;
uint64_t lastAnnouncedAliveTo;
uint64_t load;
uint64_t peers;
int32_t x,y,z;
std::vector<InetAddress> zeroTierPhysicalEndpoints;
Buffer<ZT_CLUSTER_MAX_MESSAGE_LENGTH> q;
Mutex lock;
inline void clear()
{
lastReceivedAliveAnnouncement = 0;
lastAnnouncedAliveTo = 0;
load = 0;
peers = 0;
x = 0;
y = 0;
z = 0;
zeroTierPhysicalEndpoints.clear();
q.clear();
}
_Member() { this->clear(); }
~_Member() { Utils::burn(key,sizeof(key)); }
};
_Member *const _members;
std::vector<uint16_t> _memberIds;
Mutex _memberIds_m;
struct _RemotePeer
{
_RemotePeer() : lastHavePeerReceived(0),lastSentWantPeer(0) {}
~_RemotePeer() { Utils::burn(key,ZT_PEER_SECRET_KEY_LENGTH); }
uint64_t lastHavePeerReceived;
uint64_t lastSentWantPeer;
uint8_t key[ZT_PEER_SECRET_KEY_LENGTH]; // secret key from identity agreement
};
std::map< std::pair<Address,unsigned int>,_RemotePeer > _remotePeers; // we need ordered behavior and lower_bound here
Mutex _remotePeers_m;
uint64_t _lastFlushed;
uint64_t _lastCleanedRemotePeers;
uint64_t _lastCleanedQueue;
};
} // namespace ZeroTier
#endif // ZT_ENABLE_CLUSTER
#endif

View File

@ -1,168 +0,0 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2017 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/>.
*
* --
*
* You can be released from the requirements of the license by purchasing
* a commercial license. Buying such a license is mandatory as soon as you
* develop commercial closed-source software that incorporates or links
* directly against ZeroTier software without disclosing the source code
* of your own application.
*/
#ifndef ZT_CLUSTERDEFINITION_HPP
#define ZT_CLUSTERDEFINITION_HPP
#ifdef ZT_ENABLE_CLUSTER
#include <vector>
#include <algorithm>
#include "../node/Constants.hpp"
#include "../node/Utils.hpp"
#include "../node/NonCopyable.hpp"
#include "../osdep/OSUtils.hpp"
#include "ClusterGeoIpService.hpp"
namespace ZeroTier {
/**
* Parser for cluster definition file
*/
class ClusterDefinition : NonCopyable
{
public:
struct MemberDefinition
{
MemberDefinition() : id(0),x(0),y(0),z(0) { name[0] = (char)0; }
unsigned int id;
int x,y,z;
char name[256];
InetAddress clusterEndpoint;
std::vector<InetAddress> zeroTierEndpoints;
};
/**
* Load and initialize cluster definition and GeoIP data if any
*
* @param myAddress My ZeroTier address
* @param pathToClusterFile Path to cluster definition file
* @throws std::runtime_error Invalid cluster definition or unable to load data
*/
ClusterDefinition(uint64_t myAddress,const char *pathToClusterFile)
{
std::string cf;
if (!OSUtils::readFile(pathToClusterFile,cf))
return;
char myAddressStr[64];
Utils::ztsnprintf(myAddressStr,sizeof(myAddressStr),"%.10llx",myAddress);
std::vector<std::string> lines(OSUtils::split(cf.c_str(),"\r\n","",""));
for(std::vector<std::string>::iterator l(lines.begin());l!=lines.end();++l) {
std::vector<std::string> fields(OSUtils::split(l->c_str()," \t","",""));
if ((fields.size() < 5)||(fields[0][0] == '#')||(fields[0] != myAddressStr))
continue;
// <address> geo <CSV path> <ip start column> <ip end column> <latitutde column> <longitude column>
if (fields[1] == "geo") {
if ((fields.size() >= 7)&&(OSUtils::fileExists(fields[2].c_str()))) {
int ipStartColumn = Utils::strToInt(fields[3].c_str());
int ipEndColumn = Utils::strToInt(fields[4].c_str());
int latitudeColumn = Utils::strToInt(fields[5].c_str());
int longitudeColumn = Utils::strToInt(fields[6].c_str());
if (_geo.load(fields[2].c_str(),ipStartColumn,ipEndColumn,latitudeColumn,longitudeColumn) <= 0)
throw std::runtime_error(std::string("failed to load geo-ip data from ")+fields[2]);
}
continue;
}
// <address> <ID> <name> <backplane IP/port(s)> <ZT frontplane IP/port(s)> <x,y,z>
int id = Utils::strToUInt(fields[1].c_str());
if ((id < 0)||(id > ZT_CLUSTER_MAX_MEMBERS))
throw std::runtime_error(std::string("invalid cluster member ID: ")+fields[1]);
MemberDefinition &md = _md[id];
md.id = (unsigned int)id;
if (fields.size() >= 6) {
std::vector<std::string> xyz(OSUtils::split(fields[5].c_str(),",","",""));
md.x = (xyz.size() > 0) ? Utils::strToInt(xyz[0].c_str()) : 0;
md.y = (xyz.size() > 1) ? Utils::strToInt(xyz[1].c_str()) : 0;
md.z = (xyz.size() > 2) ? Utils::strToInt(xyz[2].c_str()) : 0;
}
Utils::scopy(md.name,sizeof(md.name),fields[2].c_str());
md.clusterEndpoint.fromString(fields[3]);
if (!md.clusterEndpoint)
continue;
std::vector<std::string> zips(OSUtils::split(fields[4].c_str(),",","",""));
for(std::vector<std::string>::iterator zip(zips.begin());zip!=zips.end();++zip) {
InetAddress i;
i.fromString(*zip);
if (i)
md.zeroTierEndpoints.push_back(i);
}
_ids.push_back((unsigned int)id);
}
std::sort(_ids.begin(),_ids.end());
}
/**
* @return All member definitions in this cluster by ID (ID is array index)
*/
inline const MemberDefinition &operator[](unsigned int id) const throw() { return _md[id]; }
/**
* @return Number of members in this cluster
*/
inline unsigned int size() const throw() { return (unsigned int)_ids.size(); }
/**
* @return IDs of members in this cluster sorted by ID
*/
inline const std::vector<unsigned int> &ids() const throw() { return _ids; }
/**
* @return GeoIP service for this cluster
*/
inline ClusterGeoIpService &geo() throw() { return _geo; }
/**
* @return A vector (new copy) containing all cluster members
*/
inline std::vector<MemberDefinition> members() const
{
std::vector<MemberDefinition> m;
for(std::vector<unsigned int>::const_iterator i(_ids.begin());i!=_ids.end();++i)
m.push_back(_md[*i]);
return m;
}
private:
MemberDefinition _md[ZT_CLUSTER_MAX_MEMBERS];
std::vector<unsigned int> _ids;
ClusterGeoIpService _geo;
};
} // namespace ZeroTier
#endif // ZT_ENABLE_CLUSTER
#endif

View File

@ -1,243 +0,0 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2017 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/>.
*
* --
*
* You can be released from the requirements of the license by purchasing
* a commercial license. Buying such a license is mandatory as soon as you
* develop commercial closed-source software that incorporates or links
* directly against ZeroTier software without disclosing the source code
* of your own application.
*/
#ifdef ZT_ENABLE_CLUSTER
#include <math.h>
#include <cmath>
#include "ClusterGeoIpService.hpp"
#include "../node/Utils.hpp"
#include "../osdep/OSUtils.hpp"
#define ZT_CLUSTERGEOIPSERVICE_FILE_MODIFICATION_CHECK_EVERY 10000
namespace ZeroTier {
ClusterGeoIpService::ClusterGeoIpService() :
_pathToCsv(),
_ipStartColumn(-1),
_ipEndColumn(-1),
_latitudeColumn(-1),
_longitudeColumn(-1),
_lastFileCheckTime(0),
_csvModificationTime(0),
_csvFileSize(0)
{
}
ClusterGeoIpService::~ClusterGeoIpService()
{
}
bool ClusterGeoIpService::locate(const InetAddress &ip,int &x,int &y,int &z)
{
Mutex::Lock _l(_lock);
if ((_pathToCsv.length() > 0)&&((OSUtils::now() - _lastFileCheckTime) > ZT_CLUSTERGEOIPSERVICE_FILE_MODIFICATION_CHECK_EVERY)) {
_lastFileCheckTime = OSUtils::now();
if ((_csvFileSize != OSUtils::getFileSize(_pathToCsv.c_str()))||(_csvModificationTime != OSUtils::getLastModified(_pathToCsv.c_str())))
_load(_pathToCsv.c_str(),_ipStartColumn,_ipEndColumn,_latitudeColumn,_longitudeColumn);
}
/* We search by looking up the upper bound of the sorted vXdb vectors
* and then iterating down for a matching IP range. We stop when we hit
* the beginning or an entry whose start and end are before the IP we
* are searching. */
if ((ip.ss_family == AF_INET)&&(_v4db.size() > 0)) {
_V4E key;
key.start = Utils::ntoh((uint32_t)(reinterpret_cast<const struct sockaddr_in *>(&ip)->sin_addr.s_addr));
std::vector<_V4E>::const_iterator i(std::upper_bound(_v4db.begin(),_v4db.end(),key));
while (i != _v4db.begin()) {
--i;
if ((key.start >= i->start)&&(key.start <= i->end)) {
x = i->x;
y = i->y;
z = i->z;
//printf("%s : %f,%f %d,%d,%d\n",ip.toIpString().c_str(),i->lat,i->lon,x,y,z);
return true;
} else if ((key.start > i->start)&&(key.start > i->end))
break;
}
} else if ((ip.ss_family == AF_INET6)&&(_v6db.size() > 0)) {
_V6E key;
memcpy(key.start,reinterpret_cast<const struct sockaddr_in6 *>(&ip)->sin6_addr.s6_addr,16);
std::vector<_V6E>::const_iterator i(std::upper_bound(_v6db.begin(),_v6db.end(),key));
while (i != _v6db.begin()) {
--i;
const int s_vs_s = memcmp(key.start,i->start,16);
const int s_vs_e = memcmp(key.start,i->end,16);
if ((s_vs_s >= 0)&&(s_vs_e <= 0)) {
x = i->x;
y = i->y;
z = i->z;
//printf("%s : %f,%f %d,%d,%d\n",ip.toIpString().c_str(),i->lat,i->lon,x,y,z);
return true;
} else if ((s_vs_s > 0)&&(s_vs_e > 0))
break;
}
}
return false;
}
void ClusterGeoIpService::_parseLine(const char *line,std::vector<_V4E> &v4db,std::vector<_V6E> &v6db,int ipStartColumn,int ipEndColumn,int latitudeColumn,int longitudeColumn)
{
std::vector<std::string> ls(OSUtils::split(line,",\t","\\","\"'"));
if ( ((ipStartColumn >= 0)&&(ipStartColumn < (int)ls.size()))&&
((ipEndColumn >= 0)&&(ipEndColumn < (int)ls.size()))&&
((latitudeColumn >= 0)&&(latitudeColumn < (int)ls.size()))&&
((longitudeColumn >= 0)&&(longitudeColumn < (int)ls.size())) ) {
InetAddress ipStart(ls[ipStartColumn].c_str(),0);
InetAddress ipEnd(ls[ipEndColumn].c_str(),0);
const double lat = strtod(ls[latitudeColumn].c_str(),(char **)0);
const double lon = strtod(ls[longitudeColumn].c_str(),(char **)0);
if ((ipStart.ss_family == ipEnd.ss_family)&&(ipStart)&&(ipEnd)&&(std::isfinite(lat))&&(std::isfinite(lon))) {
const double latRadians = lat * 0.01745329251994; // PI / 180
const double lonRadians = lon * 0.01745329251994; // PI / 180
const double cosLat = cos(latRadians);
const int x = (int)round((-6371.0) * cosLat * cos(lonRadians)); // 6371 == Earth's approximate radius in kilometers
const int y = (int)round(6371.0 * sin(latRadians));
const int z = (int)round(6371.0 * cosLat * sin(lonRadians));
if (ipStart.ss_family == AF_INET) {
v4db.push_back(_V4E());
v4db.back().start = Utils::ntoh((uint32_t)(reinterpret_cast<const struct sockaddr_in *>(&ipStart)->sin_addr.s_addr));
v4db.back().end = Utils::ntoh((uint32_t)(reinterpret_cast<const struct sockaddr_in *>(&ipEnd)->sin_addr.s_addr));
v4db.back().lat = (float)lat;
v4db.back().lon = (float)lon;
v4db.back().x = x;
v4db.back().y = y;
v4db.back().z = z;
//printf("%s - %s : %d,%d,%d\n",ipStart.toIpString().c_str(),ipEnd.toIpString().c_str(),x,y,z);
} else if (ipStart.ss_family == AF_INET6) {
v6db.push_back(_V6E());
memcpy(v6db.back().start,reinterpret_cast<const struct sockaddr_in6 *>(&ipStart)->sin6_addr.s6_addr,16);
memcpy(v6db.back().end,reinterpret_cast<const struct sockaddr_in6 *>(&ipEnd)->sin6_addr.s6_addr,16);
v6db.back().lat = (float)lat;
v6db.back().lon = (float)lon;
v6db.back().x = x;
v6db.back().y = y;
v6db.back().z = z;
//printf("%s - %s : %d,%d,%d\n",ipStart.toIpString().c_str(),ipEnd.toIpString().c_str(),x,y,z);
}
}
}
}
long ClusterGeoIpService::_load(const char *pathToCsv,int ipStartColumn,int ipEndColumn,int latitudeColumn,int longitudeColumn)
{
// assumes _lock is locked
FILE *f = fopen(pathToCsv,"rb");
if (!f)
return -1;
std::vector<_V4E> v4db;
std::vector<_V6E> v6db;
v4db.reserve(16777216);
v6db.reserve(16777216);
char buf[4096];
char linebuf[1024];
unsigned int lineptr = 0;
for(;;) {
int n = (int)fread(buf,1,sizeof(buf),f);
if (n <= 0)
break;
for(int i=0;i<n;++i) {
if ((buf[i] == '\r')||(buf[i] == '\n')||(buf[i] == (char)0)) {
if (lineptr) {
linebuf[lineptr] = (char)0;
_parseLine(linebuf,v4db,v6db,ipStartColumn,ipEndColumn,latitudeColumn,longitudeColumn);
}
lineptr = 0;
} else if (lineptr < (unsigned int)sizeof(linebuf))
linebuf[lineptr++] = buf[i];
}
}
if (lineptr) {
linebuf[lineptr] = (char)0;
_parseLine(linebuf,v4db,v6db,ipStartColumn,ipEndColumn,latitudeColumn,longitudeColumn);
}
fclose(f);
if ((v4db.size() > 0)||(v6db.size() > 0)) {
std::sort(v4db.begin(),v4db.end());
std::sort(v6db.begin(),v6db.end());
_pathToCsv = pathToCsv;
_ipStartColumn = ipStartColumn;
_ipEndColumn = ipEndColumn;
_latitudeColumn = latitudeColumn;
_longitudeColumn = longitudeColumn;
_lastFileCheckTime = OSUtils::now();
_csvModificationTime = OSUtils::getLastModified(pathToCsv);
_csvFileSize = OSUtils::getFileSize(pathToCsv);
_v4db.swap(v4db);
_v6db.swap(v6db);
return (long)(_v4db.size() + _v6db.size());
} else {
return 0;
}
}
} // namespace ZeroTier
#endif // ZT_ENABLE_CLUSTER
/*
int main(int argc,char **argv)
{
char buf[1024];
ZeroTier::ClusterGeoIpService gip;
printf("loading...\n");
gip.load("/Users/api/Code/ZeroTier/Infrastructure/root-servers/zerotier-one/cluster-geoip.csv",0,1,5,6);
printf("... done!\n"); fflush(stdout);
while (gets(buf)) { // unsafe, testing only
ZeroTier::InetAddress addr(buf,0);
printf("looking up: %s\n",addr.toString().c_str()); fflush(stdout);
int x = 0,y = 0,z = 0;
if (gip.locate(addr,x,y,z)) {
//printf("%s: %d,%d,%d\n",addr.toString().c_str(),x,y,z); fflush(stdout);
} else {
printf("%s: not found!\n",addr.toString().c_str()); fflush(stdout);
}
}
return 0;
}
*/

View File

@ -1,151 +0,0 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2017 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/>.
*
* --
*
* You can be released from the requirements of the license by purchasing
* a commercial license. Buying such a license is mandatory as soon as you
* develop commercial closed-source software that incorporates or links
* directly against ZeroTier software without disclosing the source code
* of your own application.
*/
#ifndef ZT_CLUSTERGEOIPSERVICE_HPP
#define ZT_CLUSTERGEOIPSERVICE_HPP
#ifdef ZT_ENABLE_CLUSTER
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <algorithm>
#include "../node/Constants.hpp"
#include "../node/Mutex.hpp"
#include "../node/NonCopyable.hpp"
#include "../node/InetAddress.hpp"
namespace ZeroTier {
/**
* Loads a GeoIP CSV into memory for fast lookup, reloading as needed
*
* This was designed around the CSV from https://db-ip.com but can be used
* with any similar GeoIP CSV database that is presented in the form of an
* IP range and lat/long coordinates.
*
* It loads the whole database into memory, which can be kind of large. If
* the CSV file changes, the changes are loaded automatically.
*/
class ClusterGeoIpService : NonCopyable
{
public:
ClusterGeoIpService();
~ClusterGeoIpService();
/**
* Load or reload CSV file
*
* CSV column indexes start at zero. CSVs can be quoted with single or
* double quotes. Whitespace before or after commas is ignored. Backslash
* may be used for escaping whitespace as well.
*
* @param pathToCsv Path to (uncompressed) CSV file
* @param ipStartColumn Column with IP range start
* @param ipEndColumn Column with IP range end (inclusive)
* @param latitudeColumn Column with latitude
* @param longitudeColumn Column with longitude
* @return Number of valid records loaded or -1 on error (invalid file, not found, etc.)
*/
inline long load(const char *pathToCsv,int ipStartColumn,int ipEndColumn,int latitudeColumn,int longitudeColumn)
{
Mutex::Lock _l(_lock);
return _load(pathToCsv,ipStartColumn,ipEndColumn,latitudeColumn,longitudeColumn);
}
/**
* Attempt to locate an IP
*
* This returns true if x, y, and z are set. If the return value is false
* the values of x, y, and z are undefined.
*
* @param ip IPv4 or IPv6 address
* @param x Reference to variable to receive X
* @param y Reference to variable to receive Y
* @param z Reference to variable to receive Z
* @return True if coordinates were set
*/
bool locate(const InetAddress &ip,int &x,int &y,int &z);
/**
* @return True if IP database/service is available for queries (otherwise locate() will always be false)
*/
inline bool available() const
{
Mutex::Lock _l(_lock);
return ((_v4db.size() + _v6db.size()) > 0);
}
private:
struct _V4E
{
uint32_t start;
uint32_t end;
float lat,lon;
int16_t x,y,z;
inline bool operator<(const _V4E &e) const { return (start < e.start); }
};
struct _V6E
{
uint8_t start[16];
uint8_t end[16];
float lat,lon;
int16_t x,y,z;
inline bool operator<(const _V6E &e) const { return (memcmp(start,e.start,16) < 0); }
};
static void _parseLine(const char *line,std::vector<_V4E> &v4db,std::vector<_V6E> &v6db,int ipStartColumn,int ipEndColumn,int latitudeColumn,int longitudeColumn);
long _load(const char *pathToCsv,int ipStartColumn,int ipEndColumn,int latitudeColumn,int longitudeColumn);
std::string _pathToCsv;
int _ipStartColumn;
int _ipEndColumn;
int _latitudeColumn;
int _longitudeColumn;
uint64_t _lastFileCheckTime;
uint64_t _csvModificationTime;
int64_t _csvFileSize;
std::vector<_V4E> _v4db;
std::vector<_V6E> _v6db;
Mutex _lock;
};
} // namespace ZeroTier
#endif // ZT_ENABLE_CLUSTER
#endif

View File

@ -1,101 +0,0 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2018 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/>.
*
* --
*
* You can be released from the requirements of the license by purchasing
* a commercial license. Buying such a license is mandatory as soon as you
* develop commercial closed-source software that incorporates or links
* directly against ZeroTier software without disclosing the source code
* of your own application.
*/
#include "Constants.hpp"
namespace ZeroTier {
/**
* A really simple fixed capacity vector
*
* This class does no bounds checking, so the user must ensure that
* no more than C elements are ever added and that accesses are in
* bounds.
*
* @tparam T Type to contain
* @tparam C Capacity of vector
*/
template<typename T,unsigned long C>
class FCV
{
public:
FCV() : _s(0) {}
~FCV() { clear(); }
FCV(const FCV &v) :
_s(v._s)
{
for(unsigned long i=0;i<_s;++i) {
new (reinterpret_cast<T *>(_mem + (sizeof(T) * i))) T(reinterpret_cast<const T *>(v._mem)[i]);
}
}
inline FCV &operator=(const FCV &v)
{
clear();
_s = v._s;
for(unsigned long i=0;i<_s;++i) {
new (reinterpret_cast<T *>(_mem + (sizeof(T) * i))) T(reinterpret_cast<const T *>(v._mem)[i]);
}
return *this;
}
typedef T * iterator;
typedef const T * const_iterator;
typedef unsigned long size_type;
inline iterator begin() { return (T *)_mem; }
inline iterator end() { return (T *)(_mem + (sizeof(T) * _s)); }
inline iterator begin() const { return (const T *)_mem; }
inline iterator end() const { return (const T *)(_mem + (sizeof(T) * _s)); }
inline T &operator[](const size_type i) { return reinterpret_cast<T *>(_mem)[i]; }
inline const T &operator[](const size_type i) const { return reinterpret_cast<const T *>(_mem)[i]; }
inline T &front() { return reinterpret_cast<T *>(_mem)[0]; }
inline const T &front() const { return reinterpret_cast<const T *>(_mem)[0]; }
inline T &back() { return reinterpret_cast<T *>(_mem)[_s - 1]; }
inline const T &back() const { return reinterpret_cast<const T *>(_mem)[_s - 1]; }
inline void push_back(const T &v) { new (reinterpret_cast<T *>(_mem + (sizeof(T) * _s++))) T(v); }
inline void pop_back() { reinterpret_cast<T *>(_mem + (sizeof(T) * --_s))->~T(); }
inline size_type size() const { return _s; }
inline size_type capacity() const { return C; }
inline void clear()
{
for(unsigned long i=0;i<_s;++i)
reinterpret_cast<T *>(_mem + (sizeof(T) * i))->~T();
_s = 0;
}
private:
char _mem[sizeof(T) * C];
unsigned long _s;
};
} // namespace ZeroTier

View File

@ -13,7 +13,6 @@ The version must be incremented in all of the following files:
/zerotier-one.spec
/debian/changelog
/ext/installfiles/mac/ZeroTier One.pkgproj
/ext/installfiles/windows/chocolatey/zerotier-one.nuspec
/ext/installfiles/windows/ZeroTier One.aip
/windows/WinUI/AboutView.xaml
@ -29,21 +28,6 @@ Mac's easy. Just type:
You will need [Packages](http://s.sudre.free.fr/Software/Packages/about.html) and our release signing key in the keychain.
## Linux
See `LinuxBuild` environment on `linux-build` VM and use: `chroots/mount-build.sh`, `chroots/build.sh`, and the scripts in `build/` to make APT and RPM repositories.
## Windows
First load the Visual Studio solution and rebuild the UI and ZeroTier One in both x64 and i386 `Release` mode. Then load [Advanced Installer Enterprise](http://www.advancedinstaller.com/), check that the version is correct, and build. The build will fail if any build artifacts are missing, and Windows must have our product singing key (from DigiCert) available to sign the resulting MSI file. The MSI must then be tested on at least a few different CLEAN Windows VMs to ensure that the installer is valid and properly signed.
*After the MSI is published to download.zerotier.com in the proper RELEASE/#.#.#/dist subfolder for its version* the Chocolatey package must be rebuilt and published. Open a command prompt, change to `ext/installfiles/windows/chocolatey`, and type `choco pack`. Then use `choco push` to push it to Chocolatey (API key required).
choco pack
choco push zerotier-one.#.#.#.nupkg -s https://chocolatey.org/
Note that this does not cover rebuilding the drivers or their containing MSI projects, as this is typically not necessary and they are shipped in binary form in the repository for convenience.
## iOS, Android
... no docs here yet since this is done entirely out of band with regular installs.

View File

@ -1,650 +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 <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/select.h>
#include <sys/cdefs.h>
#include <sys/uio.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/route.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <netinet6/in6_var.h>
#include <netinet/in_var.h>
#include <netinet/icmp6.h>
#include <pcap/pcap.h>
// OSX compile fix... in6_var defines this in a struct which namespaces it for C++ ... why?!?
struct prf_ra {
u_char onlink : 1;
u_char autonomous : 1;
u_char reserved : 6;
} prf_ra;
#include <netinet6/nd6.h>
#include <ifaddrs.h>
// These are KERNEL_PRIVATE... why?
#ifndef SIOCAUTOCONF_START
#define SIOCAUTOCONF_START _IOWR('i', 132, struct in6_ifreq) /* accept rtadvd on this interface */
#endif
#ifndef SIOCAUTOCONF_STOP
#define SIOCAUTOCONF_STOP _IOWR('i', 133, struct in6_ifreq) /* stop accepting rtadv for this interface */
#endif
#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// This source is from:
// http://www.opensource.apple.com/source/Libinfo/Libinfo-406.17/gen.subproj/getifmaddrs.c?txt
// It's here because OSX 10.6 does not have this convenience function.
#define SALIGN (sizeof(uint32_t) - 1)
#define SA_RLEN(sa) ((sa)->sa_len ? (((sa)->sa_len + SALIGN) & ~SALIGN) : \
(SALIGN + 1))
#define MAX_SYSCTL_TRY 5
#define RTA_MASKS (RTA_GATEWAY | RTA_IFP | RTA_IFA)
/* FreeBSD uses NET_RT_IFMALIST and RTM_NEWMADDR from <sys/socket.h> */
/* We can use NET_RT_IFLIST2 and RTM_NEWMADDR2 on Darwin */
//#define DARWIN_COMPAT
//#ifdef DARWIN_COMPAT
#define GIM_SYSCTL_MIB NET_RT_IFLIST2
#define GIM_RTM_ADDR RTM_NEWMADDR2
//#else
//#define GIM_SYSCTL_MIB NET_RT_IFMALIST
//#define GIM_RTM_ADDR RTM_NEWMADDR
//#endif
// Not in 10.6 includes so use our own
struct _intl_ifmaddrs {
struct _intl_ifmaddrs *ifma_next;
struct sockaddr *ifma_name;
struct sockaddr *ifma_addr;
struct sockaddr *ifma_lladdr;
};
static inline int _intl_getifmaddrs(struct _intl_ifmaddrs **pif)
{
int icnt = 1;
int dcnt = 0;
int ntry = 0;
size_t len;
size_t needed;
int mib[6];
int i;
char *buf;
char *data;
char *next;
char *p;
struct ifma_msghdr2 *ifmam;
struct _intl_ifmaddrs *ifa, *ift;
struct rt_msghdr *rtm;
struct sockaddr *sa;
mib[0] = CTL_NET;
mib[1] = PF_ROUTE;
mib[2] = 0; /* protocol */
mib[3] = 0; /* wildcard address family */
mib[4] = GIM_SYSCTL_MIB;
mib[5] = 0; /* no flags */
do {
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
return (-1);
if ((buf = (char *)malloc(needed)) == NULL)
return (-1);
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
free(buf);
return (-1);
}
free(buf);
buf = NULL;
}
} while (buf == NULL);
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
rtm = (struct rt_msghdr *)(void *)next;
if (rtm->rtm_version != RTM_VERSION)
continue;
switch (rtm->rtm_type) {
case GIM_RTM_ADDR:
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
break;
icnt++;
p = (char *)(ifmam + 1);
for (i = 0; i < RTAX_MAX; i++) {
if ((RTA_MASKS & ifmam->ifmam_addrs &
(1 << i)) == 0)
continue;
sa = (struct sockaddr *)(void *)p;
len = SA_RLEN(sa);
dcnt += len;
p += len;
}
break;
}
}
data = (char *)malloc(sizeof(struct _intl_ifmaddrs) * icnt + dcnt);
if (data == NULL) {
free(buf);
return (-1);
}
ifa = (struct _intl_ifmaddrs *)(void *)data;
data += sizeof(struct _intl_ifmaddrs) * icnt;
memset(ifa, 0, sizeof(struct _intl_ifmaddrs) * icnt);
ift = ifa;
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
rtm = (struct rt_msghdr *)(void *)next;
if (rtm->rtm_version != RTM_VERSION)
continue;
switch (rtm->rtm_type) {
case GIM_RTM_ADDR:
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
break;
p = (char *)(ifmam + 1);
for (i = 0; i < RTAX_MAX; i++) {
if ((RTA_MASKS & ifmam->ifmam_addrs &
(1 << i)) == 0)
continue;
sa = (struct sockaddr *)(void *)p;
len = SA_RLEN(sa);
switch (i) {
case RTAX_GATEWAY:
ift->ifma_lladdr =
(struct sockaddr *)(void *)data;
memcpy(data, p, len);
data += len;
break;
case RTAX_IFP:
ift->ifma_name =
(struct sockaddr *)(void *)data;
memcpy(data, p, len);
data += len;
break;
case RTAX_IFA:
ift->ifma_addr =
(struct sockaddr *)(void *)data;
memcpy(data, p, len);
data += len;
break;
default:
data += len;
break;
}
p += len;
}
ift->ifma_next = ift + 1;
ift = ift->ifma_next;
break;
}
}
free(buf);
if (ift > ifa) {
ift--;
ift->ifma_next = NULL;
*pif = ifa;
} else {
*pif = NULL;
free(ifa);
}
return (0);
}
static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
{
free(ifmp);
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include "../node/Constants.hpp"
#include "../node/Utils.hpp"
#include "../node/Mutex.hpp"
#include "../node/Dictionary.hpp"
#include "OSUtils.hpp"
#include "OSXEthernetTap.hpp"
// ff:ff:ff:ff:ff:ff with no ADI
static const ZeroTier::MulticastGroup _blindWildcardMulticastGroup(ZeroTier::MAC(0xff),0);
static inline bool _setIpv6Stuff(const char *ifname,bool performNUD,bool acceptRouterAdverts)
{
struct in6_ndireq nd;
struct in6_ifreq ifr;
int s = socket(AF_INET6,SOCK_DGRAM,0);
if (s <= 0)
return false;
memset(&nd,0,sizeof(nd));
strncpy(nd.ifname,ifname,sizeof(nd.ifname));
if (ioctl(s,SIOCGIFINFO_IN6,&nd)) {
close(s);
return false;
}
unsigned long oldFlags = (unsigned long)nd.ndi.flags;
if (performNUD)
nd.ndi.flags |= ND6_IFF_PERFORMNUD;
else nd.ndi.flags &= ~ND6_IFF_PERFORMNUD;
if (oldFlags != (unsigned long)nd.ndi.flags) {
if (ioctl(s,SIOCSIFINFO_FLAGS,&nd)) {
close(s);
return false;
}
}
memset(&ifr,0,sizeof(ifr));
strncpy(ifr.ifr_name,ifname,sizeof(ifr.ifr_name));
if (ioctl(s,acceptRouterAdverts ? SIOCAUTOCONF_START : SIOCAUTOCONF_STOP,&ifr)) {
close(s);
return false;
}
close(s);
return true;
}
namespace ZeroTier {
static std::set<std::string> globalDeviceNames;
static Mutex globalTapCreateLock;
OSXEthernetTap::OSXEthernetTap(
const char *homePath,
const MAC &mac,
unsigned int mtu,
unsigned int metric,
uint64_t nwid,
const char *friendlyName,
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *data,unsigned int len),
void *arg) :
_handler(handler),
_arg(arg),
_pcap((void *)0),
_nwid(nwid),
_mac(mac),
_homePath(homePath),
_mtu(mtu),
_metric(metric),
_enabled(true)
{
char errbuf[PCAP_ERRBUF_SIZE];
char devname[64],ethaddr[64],mtustr[32],metstr[32],nwids[32];
Utils::snprintf(nwids,sizeof(nwids),"%.16llx",nwid);
if (mtu > 2800)
throw std::runtime_error("max tap MTU is 2800");
Mutex::Lock _gl(globalTapCreateLock);
std::string desiredDevice;
Dictionary devmap;
{
std::string devmapbuf;
if (OSUtils::readFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmapbuf)) {
devmap.fromString(devmapbuf);
desiredDevice = devmap.get(nwids,"");
}
}
if ((desiredDevice.length() >= 9)&&(desiredDevice.substr(0,6) == "bridge")) {
// length() >= 9 matches bridge### or bridge####
_dev = desiredDevice;
} else {
if (globalDeviceNames.size() >= (10000 - 128)) // sanity check... this would be nuts
throw std::runtime_error("too many devices!");
unsigned int pseudoBridgeNo = (unsigned int)((nwid ^ (nwid >> 32)) % (10000 - 128)) + 128; // range: bridge128 to bridge9999
sprintf(devname,"bridge%u",pseudoBridgeNo);
while (globalDeviceNames.count(std::string(devname)) > 0) {
++pseudoBridgeNo;
if (pseudoBridgeNo > 9999)
pseudoBridgeNo = 64;
sprintf(devname,"bridge%u",pseudoBridgeNo);
}
_dev = devname;
}
// Configure MAC address and MTU, bring interface up
long cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"create",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
if (exitcode != 0)
throw std::runtime_error("ifconfig failure setting link-layer address and activating tap interface");
} else throw std::runtime_error("unable to fork()");
Utils::snprintf(ethaddr,sizeof(ethaddr),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(int)mac[0],(int)mac[1],(int)mac[2],(int)mac[3],(int)mac[4],(int)mac[5]);
Utils::snprintf(mtustr,sizeof(mtustr),"%u",_mtu);
Utils::snprintf(metstr,sizeof(metstr),"%u",_metric);
cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"lladdr",ethaddr,"mtu",mtustr,"metric",metstr,"up",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
if (exitcode != 0)
throw std::runtime_error("ifconfig failure setting link-layer address and activating tap interface");
} else throw std::runtime_error("unable to fork()");
_setIpv6Stuff(_dev.c_str(),true,false);
_pcap = (void *)pcap_create(_dev.c_str(),errbuf);
if (!_pcap) {
cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"destroy",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
}
throw std::runtime_error((std::string("pcap_create() on new bridge device failed: ") + errbuf).c_str());
}
pcap_set_promisc(reinterpret_cast<pcap_t *>(_pcap),1);
pcap_set_timeout(reinterpret_cast<pcap_t *>(_pcap),120000);
pcap_set_immediate_mode(reinterpret_cast<pcap_t *>(_pcap),1);
if (pcap_set_buffer_size(reinterpret_cast<pcap_t *>(_pcap),1024 * 1024 * 16) != 0) // 16MB
fprintf(stderr,"WARNING: pcap_set_buffer_size() failed!\n");
if (pcap_set_snaplen(reinterpret_cast<pcap_t *>(_pcap),4096) != 0)
fprintf(stderr,"WARNING: pcap_set_snaplen() failed!\n");
if (pcap_activate(reinterpret_cast<pcap_t *>(_pcap)) != 0) {
pcap_close(reinterpret_cast<pcap_t *>(_pcap));
cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"destroy",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
}
throw std::runtime_error("pcap_activate() on new bridge device failed.");
}
globalDeviceNames.insert(_dev);
devmap[nwids] = _dev;
OSUtils::writeFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmap.toString());
_thread = Thread::start(this);
}
OSXEthernetTap::~OSXEthernetTap()
{
_enabled = false;
Mutex::Lock _gl(globalTapCreateLock);
globalDeviceNames.erase(_dev);
long cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"destroy",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
if (exitcode == 0) {
// Destroying the interface nukes pcap and terminates the thread.
Thread::join(_thread);
}
}
pcap_close(reinterpret_cast<pcap_t *>(_pcap));
}
static bool ___removeIp(const std::string &_dev,const InetAddress &ip)
{
long cpid = (long)vfork();
if (cpid == 0) {
execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"inet",ip.toIpString().c_str(),"-alias",(const char *)0);
_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
waitpid(cpid,&exitcode,0);
return (exitcode == 0);
}
return false; // never reached, make compiler shut up about return value
}
bool OSXEthernetTap::addIp(const InetAddress &ip)
{
if (!ip)
return false;
std::vector<InetAddress> allIps(ips());
if (std::binary_search(allIps.begin(),allIps.end(),ip))
return true;
// Remove and reconfigure if address is the same but netmask is different
for(std::vector<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) {
if ((i->ipsEqual(ip))&&(i->netmaskBits() != ip.netmaskBits())) {
if (___removeIp(_dev,*i))
break;
}
}
long cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),ip.isV4() ? "inet" : "inet6",ip.toString().c_str(),"alias",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
return (exitcode == 0);
} // else return false...
return false;
}
bool OSXEthernetTap::removeIp(const InetAddress &ip)
{
if (!ip)
return true;
std::vector<InetAddress> allIps(ips());
if (!std::binary_search(allIps.begin(),allIps.end(),ip)) {
if (___removeIp(_dev,ip))
return true;
}
return false;
}
std::vector<InetAddress> OSXEthernetTap::ips() const
{
struct ifaddrs *ifa = (struct ifaddrs *)0;
if (getifaddrs(&ifa))
return std::vector<InetAddress>();
std::vector<InetAddress> r;
struct ifaddrs *p = ifa;
while (p) {
if ((!strcmp(p->ifa_name,_dev.c_str()))&&(p->ifa_addr)&&(p->ifa_netmask)&&(p->ifa_addr->sa_family == p->ifa_netmask->sa_family)) {
switch(p->ifa_addr->sa_family) {
case AF_INET: {
struct sockaddr_in *sin = (struct sockaddr_in *)p->ifa_addr;
struct sockaddr_in *nm = (struct sockaddr_in *)p->ifa_netmask;
r.push_back(InetAddress(&(sin->sin_addr.s_addr),4,Utils::countBits((uint32_t)nm->sin_addr.s_addr)));
} break;
case AF_INET6: {
struct sockaddr_in6 *sin = (struct sockaddr_in6 *)p->ifa_addr;
struct sockaddr_in6 *nm = (struct sockaddr_in6 *)p->ifa_netmask;
uint32_t b[4];
memcpy(b,nm->sin6_addr.s6_addr,sizeof(b));
r.push_back(InetAddress(sin->sin6_addr.s6_addr,16,Utils::countBits(b[0]) + Utils::countBits(b[1]) + Utils::countBits(b[2]) + Utils::countBits(b[3])));
} break;
}
}
p = p->ifa_next;
}
if (ifa)
freeifaddrs(ifa);
std::sort(r.begin(),r.end());
std::unique(r.begin(),r.end());
return r;
}
void OSXEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
{
char putBuf[4096];
if ((len <= _mtu)&&(_enabled)) {
to.copyTo(putBuf,6);
from.copyTo(putBuf + 6,6);
*((uint16_t *)(putBuf + 12)) = htons((uint16_t)etherType);
memcpy(putBuf + 14,data,len);
len += 14;
int r = pcap_inject(reinterpret_cast<pcap_t *>(_pcap),putBuf,len);
if (r <= 0) {
printf("%s: pcap_inject() failed\n",_dev.c_str());
return;
}
printf("%s: inject %s -> %s etherType==%u len=%u r==%d\n",_dev.c_str(),from.toString().c_str(),to.toString().c_str(),etherType,len,r);
}
}
std::string OSXEthernetTap::deviceName() const
{
return _dev;
}
void OSXEthernetTap::setFriendlyName(const char *friendlyName)
{
}
void OSXEthernetTap::scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed)
{
std::vector<MulticastGroup> newGroups;
struct _intl_ifmaddrs *ifmap = (struct _intl_ifmaddrs *)0;
if (!_intl_getifmaddrs(&ifmap)) {
struct _intl_ifmaddrs *p = ifmap;
while (p) {
if (p->ifma_addr->sa_family == AF_LINK) {
struct sockaddr_dl *in = (struct sockaddr_dl *)p->ifma_name;
struct sockaddr_dl *la = (struct sockaddr_dl *)p->ifma_addr;
if ((la->sdl_alen == 6)&&(in->sdl_nlen <= _dev.length())&&(!memcmp(_dev.data(),in->sdl_data,in->sdl_nlen)))
newGroups.push_back(MulticastGroup(MAC(la->sdl_data + la->sdl_nlen,6),0));
}
p = p->ifma_next;
}
_intl_freeifmaddrs(ifmap);
}
std::vector<InetAddress> allIps(ips());
for(std::vector<InetAddress>::iterator ip(allIps.begin());ip!=allIps.end();++ip)
newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip));
std::sort(newGroups.begin(),newGroups.end());
std::unique(newGroups.begin(),newGroups.end());
for(std::vector<MulticastGroup>::iterator m(newGroups.begin());m!=newGroups.end();++m) {
if (!std::binary_search(_multicastGroups.begin(),_multicastGroups.end(),*m))
added.push_back(*m);
}
for(std::vector<MulticastGroup>::iterator m(_multicastGroups.begin());m!=_multicastGroups.end();++m) {
if (!std::binary_search(newGroups.begin(),newGroups.end(),*m))
removed.push_back(*m);
}
_multicastGroups.swap(newGroups);
}
static void _pcapHandler(u_char *ptr,const struct pcap_pkthdr *hdr,const u_char *data)
{
OSXEthernetTap *tap = reinterpret_cast<OSXEthernetTap *>(ptr);
if (hdr->caplen > 14) {
MAC to(data,6);
MAC from(data + 6,6);
if (from == tap->_mac) {
unsigned int etherType = ntohs(((const uint16_t *)data)[6]);
printf("%s: %s -> %s etherType==%u len==%u\n",tap->_dev.c_str(),from.toString().c_str(),to.toString().c_str(),etherType,(unsigned int)hdr->caplen);
// TODO: VLAN support
tap->_handler(tap->_arg,tap->_nwid,from,to,etherType,0,(const void *)(data + 14),hdr->len - 14);
}
}
}
void OSXEthernetTap::threadMain()
throw()
{
pcap_loop(reinterpret_cast<pcap_t *>(_pcap),-1,&_pcapHandler,reinterpret_cast<u_char *>(this));
}
} // namespace ZeroTier

View File

@ -1,831 +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 <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/select.h>
#include <sys/cdefs.h>
#include <sys/uio.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sys_domain.h>
#include <sys/kern_control.h>
#include <net/if_utun.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/route.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <netinet6/in6_var.h>
#include <netinet/in_var.h>
#include <netinet/icmp6.h>
// OSX compile fix... in6_var defines this in a struct which namespaces it for C++ ... why?!?
struct prf_ra {
u_char onlink : 1;
u_char autonomous : 1;
u_char reserved : 6;
} prf_ra;
#include <netinet6/nd6.h>
#include <ifaddrs.h>
// These are KERNEL_PRIVATE... why?
#ifndef SIOCAUTOCONF_START
#define SIOCAUTOCONF_START _IOWR('i', 132, struct in6_ifreq) /* accept rtadvd on this interface */
#endif
#ifndef SIOCAUTOCONF_STOP
#define SIOCAUTOCONF_STOP _IOWR('i', 133, struct in6_ifreq) /* stop accepting rtadv for this interface */
#endif
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// This source is from:
// http://www.opensource.apple.com/source/Libinfo/Libinfo-406.17/gen.subproj/getifmaddrs.c?txt
// It's here because OSX 10.6 does not have this convenience function.
#define SALIGN (sizeof(uint32_t) - 1)
#define SA_RLEN(sa) ((sa)->sa_len ? (((sa)->sa_len + SALIGN) & ~SALIGN) : \
(SALIGN + 1))
#define MAX_SYSCTL_TRY 5
#define RTA_MASKS (RTA_GATEWAY | RTA_IFP | RTA_IFA)
/* FreeBSD uses NET_RT_IFMALIST and RTM_NEWMADDR from <sys/socket.h> */
/* We can use NET_RT_IFLIST2 and RTM_NEWMADDR2 on Darwin */
//#define DARWIN_COMPAT
//#ifdef DARWIN_COMPAT
#define GIM_SYSCTL_MIB NET_RT_IFLIST2
#define GIM_RTM_ADDR RTM_NEWMADDR2
//#else
//#define GIM_SYSCTL_MIB NET_RT_IFMALIST
//#define GIM_RTM_ADDR RTM_NEWMADDR
//#endif
// Not in 10.6 includes so use our own
struct _intl_ifmaddrs {
struct _intl_ifmaddrs *ifma_next;
struct sockaddr *ifma_name;
struct sockaddr *ifma_addr;
struct sockaddr *ifma_lladdr;
};
static inline int _intl_getifmaddrs(struct _intl_ifmaddrs **pif)
{
int icnt = 1;
int dcnt = 0;
int ntry = 0;
size_t len;
size_t needed;
int mib[6];
int i;
char *buf;
char *data;
char *next;
char *p;
struct ifma_msghdr2 *ifmam;
struct _intl_ifmaddrs *ifa, *ift;
struct rt_msghdr *rtm;
struct sockaddr *sa;
mib[0] = CTL_NET;
mib[1] = PF_ROUTE;
mib[2] = 0; /* protocol */
mib[3] = 0; /* wildcard address family */
mib[4] = GIM_SYSCTL_MIB;
mib[5] = 0; /* no flags */
do {
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
return (-1);
if ((buf = (char *)malloc(needed)) == NULL)
return (-1);
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
free(buf);
return (-1);
}
free(buf);
buf = NULL;
}
} while (buf == NULL);
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
rtm = (struct rt_msghdr *)(void *)next;
if (rtm->rtm_version != RTM_VERSION)
continue;
switch (rtm->rtm_type) {
case GIM_RTM_ADDR:
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
break;
icnt++;
p = (char *)(ifmam + 1);
for (i = 0; i < RTAX_MAX; i++) {
if ((RTA_MASKS & ifmam->ifmam_addrs &
(1 << i)) == 0)
continue;
sa = (struct sockaddr *)(void *)p;
len = SA_RLEN(sa);
dcnt += len;
p += len;
}
break;
}
}
data = (char *)malloc(sizeof(struct _intl_ifmaddrs) * icnt + dcnt);
if (data == NULL) {
free(buf);
return (-1);
}
ifa = (struct _intl_ifmaddrs *)(void *)data;
data += sizeof(struct _intl_ifmaddrs) * icnt;
memset(ifa, 0, sizeof(struct _intl_ifmaddrs) * icnt);
ift = ifa;
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
rtm = (struct rt_msghdr *)(void *)next;
if (rtm->rtm_version != RTM_VERSION)
continue;
switch (rtm->rtm_type) {
case GIM_RTM_ADDR:
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
break;
p = (char *)(ifmam + 1);
for (i = 0; i < RTAX_MAX; i++) {
if ((RTA_MASKS & ifmam->ifmam_addrs &
(1 << i)) == 0)
continue;
sa = (struct sockaddr *)(void *)p;
len = SA_RLEN(sa);
switch (i) {
case RTAX_GATEWAY:
ift->ifma_lladdr =
(struct sockaddr *)(void *)data;
memcpy(data, p, len);
data += len;
break;
case RTAX_IFP:
ift->ifma_name =
(struct sockaddr *)(void *)data;
memcpy(data, p, len);
data += len;
break;
case RTAX_IFA:
ift->ifma_addr =
(struct sockaddr *)(void *)data;
memcpy(data, p, len);
data += len;
break;
default:
data += len;
break;
}
p += len;
}
ift->ifma_next = ift + 1;
ift = ift->ifma_next;
break;
}
}
free(buf);
if (ift > ifa) {
ift--;
ift->ifma_next = NULL;
*pif = ifa;
} else {
*pif = NULL;
free(ifa);
}
return (0);
}
static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
{
free(ifmp);
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include "../node/Constants.hpp"
#include "../node/Utils.hpp"
#include "../node/Mutex.hpp"
#include "../node/Dictionary.hpp"
#include "Arp.hpp"
#include "OSUtils.hpp"
#include "OSXEthernetTap.hpp"
// ff:ff:ff:ff:ff:ff with no ADI
static const ZeroTier::MulticastGroup _blindWildcardMulticastGroup(ZeroTier::MAC(0xff),0);
static inline bool _setIpv6Stuff(const char *ifname,bool performNUD,bool acceptRouterAdverts)
{
struct in6_ndireq nd;
struct in6_ifreq ifr;
int s = socket(AF_INET6,SOCK_DGRAM,0);
if (s <= 0)
return false;
memset(&nd,0,sizeof(nd));
strncpy(nd.ifname,ifname,sizeof(nd.ifname));
if (ioctl(s,SIOCGIFINFO_IN6,&nd)) {
close(s);
return false;
}
unsigned long oldFlags = (unsigned long)nd.ndi.flags;
if (performNUD)
nd.ndi.flags |= ND6_IFF_PERFORMNUD;
else nd.ndi.flags &= ~ND6_IFF_PERFORMNUD;
if (oldFlags != (unsigned long)nd.ndi.flags) {
if (ioctl(s,SIOCSIFINFO_FLAGS,&nd)) {
close(s);
return false;
}
}
memset(&ifr,0,sizeof(ifr));
strncpy(ifr.ifr_name,ifname,sizeof(ifr.ifr_name));
if (ioctl(s,acceptRouterAdverts ? SIOCAUTOCONF_START : SIOCAUTOCONF_STOP,&ifr)) {
close(s);
return false;
}
close(s);
return true;
}
// Create an OSX-native utun device (utun# where # is desiredNumber)
// Adapted from public domain utun example code by Jonathan Levin
static int _make_utun(int desiredNumber)
{
struct sockaddr_ctl sc;
struct ctl_info ctlInfo;
struct ifreq ifr;
memset(&ctlInfo, 0, sizeof(ctlInfo));
if (strlcpy(ctlInfo.ctl_name, UTUN_CONTROL_NAME, sizeof(ctlInfo.ctl_name)) >= sizeof(ctlInfo.ctl_name)) {
return -1;
}
int fd = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
if (fd == -1)
return -1;
if (ioctl(fd, CTLIOCGINFO, &ctlInfo) == -1) {
close(fd);
return -1;
}
sc.sc_id = ctlInfo.ctl_id;
sc.sc_len = sizeof(sc);
sc.sc_family = AF_SYSTEM;
sc.ss_sysaddr = AF_SYS_CONTROL;
sc.sc_unit = desiredNumber + 1;
if (connect(fd, (struct sockaddr *)&sc, sizeof(sc)) == -1) {
close(fd);
return -1;
}
memset(&ifr,0,sizeof(ifr));
sprintf(ifr.ifr_name,"utun%d",desiredNumber);
if (ioctl(fd,SIOCGIFFLAGS,(void *)&ifr) < 0) {
printf("SIOCGIFFLAGS failed\n");
}
ifr.ifr_flags &= ~IFF_POINTOPOINT;
if (ioctl(fd,SIOCSIFFLAGS,(void *)&ifr) < 0) {
printf("clear IFF_POINTOPOINT failed\n");
}
return fd;
}
namespace ZeroTier {
static long globalTapsRunning = 0;
static Mutex globalTapCreateLock;
OSXEthernetTap::OSXEthernetTap(
const char *homePath,
const MAC &mac,
unsigned int mtu,
unsigned int metric,
uint64_t nwid,
const char *friendlyName,
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *data,unsigned int len),
void *arg) :
_handler(handler),
_arg(arg),
_arp((Arp *)0),
_nwid(nwid),
_homePath(homePath),
_mtu(mtu),
_metric(metric),
_fd(0),
_utun(false),
_enabled(true)
{
char devpath[64],ethaddr[64],mtustr[32],metstr[32],nwids[32];
struct stat stattmp;
Utils::snprintf(nwids,sizeof(nwids),"%.16llx",nwid);
if (mtu > 2800)
throw std::runtime_error("max tap MTU is 2800");
Mutex::Lock _gl(globalTapCreateLock);
// Read remembered previous device name, if any -- we'll try to reuse
Dictionary devmap;
std::string desiredDevice;
{
std::string devmapbuf;
if (OSUtils::readFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmapbuf)) {
devmap.fromString(devmapbuf);
desiredDevice = devmap.get(nwids,"");
}
}
if (::stat((_homePath + ZT_PATH_SEPARATOR_S + "tap.kext").c_str(),&stattmp) == 0) {
// Try to init kext if it's there, otherwise revert to utun mode
if (::stat("/dev/zt0",&stattmp)) {
long kextpid = (long)vfork();
if (kextpid == 0) {
::chdir(homePath);
OSUtils::redirectUnixOutputs("/dev/null",(const char *)0);
::execl("/sbin/kextload","/sbin/kextload","-q","-repository",homePath,"tap.kext",(const char *)0);
::_exit(-1);
} else if (kextpid > 0) {
int exitcode = -1;
::waitpid(kextpid,&exitcode,0);
}
::usleep(500); // give tap device driver time to start up and try again
if (::stat("/dev/zt0",&stattmp))
_utun = true;
}
if (!_utun) {
// See if we can re-use the last device we had.
bool recalledDevice = false;
if (desiredDevice.length() > 2) {
Utils::snprintf(devpath,sizeof(devpath),"/dev/%s",desiredDevice.c_str());
if (stat(devpath,&stattmp) == 0) {
_fd = ::open(devpath,O_RDWR);
if (_fd > 0) {
_dev = desiredDevice;
recalledDevice = true;
}
}
}
// Open the first unused tap device if we didn't recall a previous one.
if (!recalledDevice) {
for(int i=0;i<64;++i) {
Utils::snprintf(devpath,sizeof(devpath),"/dev/zt%d",i);
if (stat(devpath,&stattmp)) {
_utun = true;
break;
}
_fd = ::open(devpath,O_RDWR);
if (_fd > 0) {
char foo[16];
Utils::snprintf(foo,sizeof(foo),"zt%d",i);
_dev = foo;
break;
}
}
}
if (_fd <= 0)
_utun = true;
}
} else {
_utun = true;
}
if (_utun) {
// Use OSX built-in utun device if kext is not available or doesn't work
int utunNo = 0;
if ((desiredDevice.length() > 4)&&(desiredDevice.substr(0,4) == "utun")) {
utunNo = Utils::strToInt(desiredDevice.substr(4).c_str());
if (utunNo >= 0)
_fd = _make_utun(utunNo);
}
if (_fd <= 0) {
// Start at utun8 to leave lower utuns unused since other stuff might
// want them -- OpenVPN, cjdns, etc. I'm not sure if those are smart
// enough to scan upward like this.
for(utunNo=8;utunNo<=256;++utunNo) {
if ((_fd = _make_utun(utunNo)) > 0)
break;
}
}
if (_fd <= 0)
throw std::runtime_error("unable to find/load ZeroTier tap driver OR use built-in utun driver in OSX; permission or system problem or too many open devices?");
Utils::snprintf(devpath,sizeof(devpath),"utun%d",utunNo);
_dev = devpath;
// Configure address and bring it up
Utils::snprintf(mtustr,sizeof(mtustr),"%u",_mtu);
Utils::snprintf(metstr,sizeof(metstr),"%u",_metric);
long cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"mtu",mtustr,"metric",metstr,"up",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
if (exitcode) {
::close(_fd);
throw std::runtime_error("ifconfig failure activating utun interface");
}
}
} else {
// Use our ZeroTier OSX tun/tap driver for zt# Ethernet tap device
if (fcntl(_fd,F_SETFL,fcntl(_fd,F_GETFL) & ~O_NONBLOCK) == -1) {
::close(_fd);
throw std::runtime_error("unable to set flags on file descriptor for TAP device");
}
// Configure MAC address and MTU, bring interface up
Utils::snprintf(ethaddr,sizeof(ethaddr),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(int)mac[0],(int)mac[1],(int)mac[2],(int)mac[3],(int)mac[4],(int)mac[5]);
Utils::snprintf(mtustr,sizeof(mtustr),"%u",_mtu);
Utils::snprintf(metstr,sizeof(metstr),"%u",_metric);
long cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"lladdr",ethaddr,"mtu",mtustr,"metric",metstr,"up",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
if (exitcode) {
::close(_fd);
throw std::runtime_error("ifconfig failure setting link-layer address and activating tap interface");
}
}
_setIpv6Stuff(_dev.c_str(),true,false);
}
// Set close-on-exec so that devices cannot persist if we fork/exec for update
fcntl(_fd,F_SETFD,fcntl(_fd,F_GETFD) | FD_CLOEXEC);
::pipe(_shutdownSignalPipe);
++globalTapsRunning;
devmap[nwids] = _dev;
OSUtils::writeFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmap.toString());
_thread = Thread::start(this);
}
OSXEthernetTap::~OSXEthernetTap()
{
Mutex::Lock _gl(globalTapCreateLock);
::write(_shutdownSignalPipe[1],(const void *)this,1); // writing a byte causes thread to exit
Thread::join(_thread);
::close(_fd);
::close(_shutdownSignalPipe[0]);
::close(_shutdownSignalPipe[1]);
if (_utun) {
delete _arp;
} else {
if (--globalTapsRunning <= 0) {
globalTapsRunning = 0; // sanity check -- should not be possible
char tmp[16384];
sprintf(tmp,"%s/%s",_homePath.c_str(),"tap.kext");
long kextpid = (long)vfork();
if (kextpid == 0) {
OSUtils::redirectUnixOutputs("/dev/null",(const char *)0);
::execl("/sbin/kextunload","/sbin/kextunload",tmp,(const char *)0);
::_exit(-1);
} else if (kextpid > 0) {
int exitcode = -1;
::waitpid(kextpid,&exitcode,0);
}
}
}
}
void OSXEthernetTap::setEnabled(bool en)
{
_enabled = en;
// TODO: interface status change
}
bool OSXEthernetTap::enabled() const
{
return _enabled;
}
static bool ___removeIp(const std::string &_dev,const InetAddress &ip)
{
long cpid = (long)vfork();
if (cpid == 0) {
execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"inet",ip.toIpString().c_str(),"-alias",(const char *)0);
_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
waitpid(cpid,&exitcode,0);
return (exitcode == 0);
}
return false; // never reached, make compiler shut up about return value
}
bool OSXEthernetTap::addIp(const InetAddress &ip)
{
if (!ip)
return false;
std::vector<InetAddress> allIps(ips());
if (std::binary_search(allIps.begin(),allIps.end(),ip))
return true;
// Remove and reconfigure if address is the same but netmask is different
for(std::vector<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) {
if ((i->ipsEqual(ip))&&(i->netmaskBits() != ip.netmaskBits())) {
if (___removeIp(_dev,*i))
break;
}
}
if (_utun) {
long cpid = (long)vfork();
if (cpid == 0) {
if (ip.ss_family == AF_INET6) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"inet6",ip.toString().c_str(),"alias",(const char *)0);
} else {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),ip.toString().c_str(),ip.toIpString().c_str(),"alias",(const char *)0);
}
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
if (exitcode == 0) {
if (ip.ss_family == AF_INET) {
// Add route to network over tun for IPv4 -- otherwise it behaves
// as a simple point to point tunnel instead of a true route.
cpid = (long)vfork();
if (cpid == 0) {
::close(STDERR_FILENO);
::close(STDOUT_FILENO);
::execl("/sbin/route","/sbin/route","add",ip.network().toString().c_str(),ip.toIpString().c_str(),(const char *)0);
::exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
return (exitcode == 0);
}
} else return true;
}
}
} else {
long cpid = (long)vfork();
if (cpid == 0) {
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),ip.isV4() ? "inet" : "inet6",ip.toString().c_str(),"alias",(const char *)0);
::_exit(-1);
} else if (cpid > 0) {
int exitcode = -1;
::waitpid(cpid,&exitcode,0);
return (exitcode == 0);
}
}
return false;
}
bool OSXEthernetTap::removeIp(const InetAddress &ip)
{
if (!ip)
return true;
std::vector<InetAddress> allIps(ips());
if (!std::binary_search(allIps.begin(),allIps.end(),ip)) {
if (___removeIp(_dev,ip))
return true;
}
return false;
}
std::vector<InetAddress> OSXEthernetTap::ips() const
{
struct ifaddrs *ifa = (struct ifaddrs *)0;
if (getifaddrs(&ifa))
return std::vector<InetAddress>();
std::vector<InetAddress> r;
struct ifaddrs *p = ifa;
while (p) {
if ((!strcmp(p->ifa_name,_dev.c_str()))&&(p->ifa_addr)&&(p->ifa_netmask)&&(p->ifa_addr->sa_family == p->ifa_netmask->sa_family)) {
switch(p->ifa_addr->sa_family) {
case AF_INET: {
struct sockaddr_in *sin = (struct sockaddr_in *)p->ifa_addr;
struct sockaddr_in *nm = (struct sockaddr_in *)p->ifa_netmask;
r.push_back(InetAddress(&(sin->sin_addr.s_addr),4,Utils::countBits((uint32_t)nm->sin_addr.s_addr)));
} break;
case AF_INET6: {
struct sockaddr_in6 *sin = (struct sockaddr_in6 *)p->ifa_addr;
struct sockaddr_in6 *nm = (struct sockaddr_in6 *)p->ifa_netmask;
uint32_t b[4];
memcpy(b,nm->sin6_addr.s6_addr,sizeof(b));
r.push_back(InetAddress(sin->sin6_addr.s6_addr,16,Utils::countBits(b[0]) + Utils::countBits(b[1]) + Utils::countBits(b[2]) + Utils::countBits(b[3])));
} break;
}
}
p = p->ifa_next;
}
if (ifa)
freeifaddrs(ifa);
std::sort(r.begin(),r.end());
std::unique(r.begin(),r.end());
return r;
}
void OSXEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
{
char putBuf[4096];
if ((_fd > 0)&&(len <= _mtu)&&(_enabled)) {
to.copyTo(putBuf,6);
from.copyTo(putBuf + 6,6);
*((uint16_t *)(putBuf + 12)) = htons((uint16_t)etherType);
memcpy(putBuf + 14,data,len);
len += 14;
::write(_fd,putBuf,len);
}
}
std::string OSXEthernetTap::deviceName() const
{
return _dev;
}
void OSXEthernetTap::setFriendlyName(const char *friendlyName)
{
}
void OSXEthernetTap::scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed)
{
std::vector<MulticastGroup> newGroups;
struct _intl_ifmaddrs *ifmap = (struct _intl_ifmaddrs *)0;
if (!_intl_getifmaddrs(&ifmap)) {
struct _intl_ifmaddrs *p = ifmap;
while (p) {
if (p->ifma_addr->sa_family == AF_LINK) {
struct sockaddr_dl *in = (struct sockaddr_dl *)p->ifma_name;
struct sockaddr_dl *la = (struct sockaddr_dl *)p->ifma_addr;
if ((la->sdl_alen == 6)&&(in->sdl_nlen <= _dev.length())&&(!memcmp(_dev.data(),in->sdl_data,in->sdl_nlen)))
newGroups.push_back(MulticastGroup(MAC(la->sdl_data + la->sdl_nlen,6),0));
}
p = p->ifma_next;
}
_intl_freeifmaddrs(ifmap);
}
std::vector<InetAddress> allIps(ips());
for(std::vector<InetAddress>::iterator ip(allIps.begin());ip!=allIps.end();++ip)
newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip));
std::sort(newGroups.begin(),newGroups.end());
std::unique(newGroups.begin(),newGroups.end());
for(std::vector<MulticastGroup>::iterator m(newGroups.begin());m!=newGroups.end();++m) {
if (!std::binary_search(_multicastGroups.begin(),_multicastGroups.end(),*m))
added.push_back(*m);
}
for(std::vector<MulticastGroup>::iterator m(_multicastGroups.begin());m!=_multicastGroups.end();++m) {
if (!std::binary_search(newGroups.begin(),newGroups.end(),*m))
removed.push_back(*m);
}
_multicastGroups.swap(newGroups);
}
void OSXEthernetTap::threadMain()
throw()
{
fd_set readfds,nullfds;
MAC to,from;
int n,nfds,r;
char getBuf[8194];
Thread::sleep(500);
FD_ZERO(&readfds);
FD_ZERO(&nullfds);
nfds = (int)std::max(_shutdownSignalPipe[0],_fd) + 1;
r = 0;
for(;;) {
FD_SET(_shutdownSignalPipe[0],&readfds);
FD_SET(_fd,&readfds);
select(nfds,&readfds,&nullfds,&nullfds,(struct timeval *)0);
if (FD_ISSET(_shutdownSignalPipe[0],&readfds)) // writes to shutdown pipe terminate thread
break;
if (FD_ISSET(_fd,&readfds)) {
n = (int)::read(_fd,getBuf + r,sizeof(getBuf) - r);
if (n < 0) {
if ((errno != EINTR)&&(errno != ETIMEDOUT))
break;
} else {
// Some tap drivers like to send the ethernet frame and the
// payload in two chunks, so handle that by accumulating
// data until we have at least a frame.
r += n;
if (r > 14) {
if (r > ((int)_mtu + 14)) // sanity check for weird TAP behavior on some platforms
r = _mtu + 14;
if (_enabled) {
to.setTo(getBuf,6);
from.setTo(getBuf + 6,6);
unsigned int etherType = ntohs(((const uint16_t *)getBuf)[6]);
// TODO: VLAN support
_handler(_arg,_nwid,from,to,etherType,0,(const void *)(getBuf + 14),r - 14);
}
r = 0;
}
}
}
}
}
} // namespace ZeroTier

View File

@ -1,96 +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_OSXETHERNETTAP_HPP
#define ZT_OSXETHERNETTAP_HPP
#include <stdio.h>
#include <stdlib.h>
#include <stdexcept>
#include <string>
#include <vector>
#include "../node/Constants.hpp"
#include "../node/MAC.hpp"
#include "../node/InetAddress.hpp"
#include "../node/MulticastGroup.hpp"
#include "Thread.hpp"
namespace ZeroTier {
/**
* OSX Ethernet tap using ZeroTier kernel extension zt# devices
*/
class OSXEthernetTap
{
public:
OSXEthernetTap(
const char *homePath,
const MAC &mac,
unsigned int mtu,
unsigned int metric,
uint64_t nwid,
const char *friendlyName,
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int),
void *arg);
~OSXEthernetTap();
inline void setEnabled(bool en) { _enabled = en; }
inline bool enabled() const { return _enabled; }
bool addIp(const InetAddress &ip);
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);
std::string deviceName() const;
void setFriendlyName(const char *friendlyName);
void scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed);
void threadMain()
throw();
// Private members of OSXEthernetTap have public visibility to be accessable
// from an internal bounce function; don't modify directly.
void (*_handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int);
void *_arg;
void *_pcap; // pcap_t *
uint64_t _nwid;
MAC _mac;
Thread _thread;
std::string _homePath;
std::string _dev;
std::vector<MulticastGroup> _multicastGroups;
unsigned int _mtu;
unsigned int _metric;
volatile bool _enabled;
};
} // namespace ZeroTier
#endif

View File

@ -1,101 +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_OSXETHERNETTAP_HPP
#define ZT_OSXETHERNETTAP_HPP
#include <stdio.h>
#include <stdlib.h>
#include <stdexcept>
#include <string>
#include <vector>
#include "../node/Constants.hpp"
#include "../node/MAC.hpp"
#include "../node/InetAddress.hpp"
#include "../node/MulticastGroup.hpp"
#include "Thread.hpp"
namespace ZeroTier {
class Arp;
/**
* OSX Ethernet tap supporting either ZeroTier tun/tap kext or OSX-native utun
*/
class OSXEthernetTap
{
public:
OSXEthernetTap(
const char *homePath,
const MAC &mac,
unsigned int mtu,
unsigned int metric,
uint64_t nwid,
const char *friendlyName,
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int),
void *arg);
~OSXEthernetTap();
void setEnabled(bool en);
bool enabled() const;
bool addIp(const InetAddress &ip);
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);
std::string deviceName() const;
void setFriendlyName(const char *friendlyName);
void scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed);
inline bool isNativeUtun() const { return _utun; }
void threadMain()
throw();
private:
void (*_handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int);
void *_arg;
Arp *_arp; // created and used if utun is enabled
uint64_t _nwid;
Thread _thread;
std::string _homePath;
std::string _dev;
std::vector<MulticastGroup> _multicastGroups;
unsigned int _mtu;
unsigned int _metric;
int _fd;
int _shutdownSignalPipe[2];
bool _utun;
volatile bool _enabled;
};
} // namespace ZeroTier
#endif

119
attic/PeerList.hpp Normal file
View File

@ -0,0 +1,119 @@
/*
* Copyright (c)2013-2020 ZeroTier, Inc.
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file in the project's root directory.
*
* Change Date: 2025-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2.0 of the Apache License.
*/
/****/
#ifndef ZT_PEERLIST_HPP
#define ZT_PEERLIST_HPP
#include "Constants.hpp"
#include "SharedPtr.hpp"
#include "Peer.hpp"
namespace ZeroTier {
/**
* A list of peers
*
* This is a simple vector optimized for the case where there will almost always
* be zero or one element. In that case it doesn't allocate. If there's more than
* one element, it will grow to include all elements.
*
* It's used to return lookups in Topology where there will almost always be zero
* or one peers returned but where there technically (but very rarely) can be more.
*/
class PeerList
{
public:
ZT_INLINE PeerList() noexcept:
m_onePeer(),
m_peers(&m_onePeer),
m_peerCount(0)
{}
ZT_INLINE PeerList(const PeerList &pl)
{
const unsigned int pc = pl.m_peerCount;
if (likely(pc <= 1)) {
m_onePeer = pl.m_onePeer;
m_peers = &m_onePeer;
} else {
m_peers = new SharedPtr<Peer>[pc];
for (unsigned int i = 0;i < pc;++i)
m_peers[i] = pl.m_peers[i];
}
m_peerCount = pc;
}
ZT_INLINE ~PeerList()
{
if (unlikely(m_peers != &m_onePeer))
delete[] m_peers;
}
ZT_INLINE PeerList &operator=(const PeerList &pl)
{
if (&pl != this) {
if (unlikely(m_peers != &m_onePeer))
delete[] m_peers;
if (likely(pl.m_peerCount <= 1)) {
m_onePeer = pl.m_onePeer;
m_peers = &m_onePeer;
} else {
m_onePeer.zero();
m_peers = new SharedPtr<Peer>[pl.m_peerCount];
for (unsigned int i = 0;i < pl.m_peerCount;++i)
m_peers[i] = pl.m_peers[i];
}
m_peerCount = pl.m_peerCount;
}
return *this;
}
/**
* Resize the peer list to store a given number of members
*
* To populate the list, this must be called first followed by each member
* being set with the [] operator. List content after this call is undefined
* and may contain old data if the object is being re-used.
*
* @param s New size of list
*/
ZT_INLINE void resize(const unsigned int s)
{
if (unlikely(m_peers != &m_onePeer))
delete[] m_peers;
m_peerCount = s;
if (likely(s <= 1)) {
m_peers = &m_onePeer;
} else {
m_peers = new SharedPtr<Peer>[s];
}
}
ZT_INLINE SharedPtr <Peer> &operator[](const unsigned int i) noexcept
{ return m_peers[i]; }
ZT_INLINE const SharedPtr <Peer> &operator[](const unsigned int i) const noexcept
{ return m_peers[i]; }
ZT_INLINE unsigned int size() const noexcept
{ return m_peerCount; }
private:
SharedPtr <Peer> m_onePeer;
SharedPtr <Peer> *m_peers;
unsigned int m_peerCount;
};
} // namespace ZeroTier
#endif

View File

@ -1,4 +0,0 @@
Retired Code and Miscellaneous Junk
======
This directory is for old code that isn't used but we don't want to lose track of, and for anything else random like debug scripts.

View File

@ -0,0 +1,26 @@
# Dockerfile for ZeroTier Central Controllers
FROM centos:7 as builder
MAINTAINER Adam Ierymekno <adam.ierymenko@zerotier.com>, Grant Limberg <grant.limberg@zerotier.com>
ARG git_branch=master
RUN yum update -y
RUN yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
RUN yum -y install epel-release && yum -y update && yum clean all
RUN yum groupinstall -y "Development Tools"
RUN yum install -y bash postgresql10 postgresql10-devel libpqxx-devel glibc-static libstdc++-static clang jemalloc jemalloc-devel
RUN git clone http://git.int.zerotier.com/zerotier/ZeroTierOne.git
RUN if [ "$git_branch" != "master" ]; then cd ZeroTierOne && git checkout -b $git_branch origin/$git_branch; fi
RUN ldconfig
RUN cd ZeroTierOne && make central-controller
FROM centos:7
COPY --from=builder /ZeroTierOne/zerotier-one /usr/local/bin/zerotier-one
RUN chmod a+x /usr/local/bin/zerotier-one
ADD ext/central-controller-docker/main.sh /
RUN chmod a+x /main.sh
ENTRYPOINT /main.sh

View File

@ -0,0 +1,3 @@
# ZeroTier Central Controller Docker Image
Dockerfile & startup script for use with [ZeroTier Central](https://my.zerotier.com). Not intended for public use.

View File

@ -0,0 +1,80 @@
#!/bin/bash
if [ -z "$ZT_IDENTITY_PATH" ]; then
echo '*** FAILED: ZT_IDENTITY_PATH environment variable is not defined'
exit 1
fi
if [ -z "$ZT_DB_HOST" ]; then
echo '*** FAILED: ZT_DB_HOST environment variable not defined'
exit 1
fi
if [ -z "$ZT_DB_PORT" ]; then
echo '*** FAILED: ZT_DB_PORT environment variable not defined'
exit 1
fi
if [ -z "$ZT_DB_NAME" ]; then
echo '*** FAILED: ZT_DB_NAME environment variable not defined'
exit 1
fi
if [ -z "$ZT_DB_USER" ]; then
echo '*** FAILED: ZT_DB_USER environment variable not defined'
exit 1
fi
if [ -z "$ZT_DB_PASSWORD" ]; then
echo '*** FAILED: ZT_DB_PASSWORD environment variable not defined'
exit 1
fi
RMQ=""
if [ "$ZT_USE_RABBITMQ" == "true" ]; then
if [ -z "$RABBITMQ_HOST" ]; then
echo '*** FAILED: RABBITMQ_HOST environment variable not defined'
exit 1
fi
if [ -z "$RABBITMQ_PORT" ]; then
echo '*** FAILED: RABBITMQ_PORT environment variable not defined'
exit 1
fi
if [ -z "$RABBITMQ_USERNAME" ]; then
echo '*** FAILED: RABBITMQ_USERNAME environment variable not defined'
exit 1
fi
if [ -z "$RABBITMQ_PASSWORD" ]; then
echo '*** FAILED: RABBITMQ_PASSWORD environment variable not defined'
exit 1
fi
RMQ=", \"rabbitmq\": {
\"host\": \"${RABBITMQ_HOST}\",
\"port\": ${RABBITMQ_PORT},
\"username\": \"${RABBITMQ_USERNAME}\",
\"password\": \"${RABBITMQ_PASSWORD}\"
}"
fi
mkdir -p /var/lib/zerotier-one
pushd /var/lib/zerotier-one
ln -s $ZT_IDENTITY_PATH/identity.public identity.public
ln -s $ZT_IDENTITY_PATH/identity.secret identity.secret
popd
DEFAULT_PORT=9993
echo "{
\"settings\": {
\"portMappingEnabled\": true,
\"softwareUpdate\": \"disable\",
\"interfacePrefixBlacklist\": [
\"inot\",
\"nat64\"
],
\"controllerDbPath\": \"postgres:host=${ZT_DB_HOST} port=${ZT_DB_PORT} dbname=${ZT_DB_NAME} user=${ZT_DB_USER} password=${ZT_DB_PASSWORD} sslmode=prefer sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}\"
${RMQ}
}
}
" > /var/lib/zerotier-one/local.conf
export GLIBCXX_FORCE_NEW=1
export GLIBCPP_FORCE_NEW=1
export LD_PRELOAD="/usr/lib64/libjemalloc.so"
exec /usr/local/bin/zerotier-one -p${ZT_CONTROLLER_PORT:-$DEFAULT_PORT} /var/lib/zerotier-one

9
attic/cycle_controllers.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
CONTROLLERS=`kubectl get pods -o=name | grep controller | sed "s/^.\{4\}//"`
for c in ${CONTROLLERS[@]}
do
kubectl delete pod ${c}
sleep 30
done

View File

@ -1,3 +1,57 @@
zerotier-one (1.4.6) unstable; urgency=medium
* Update default root server list
* Fix build flags on "armhf" (32-bit ARM) platforms for better
compatibility with Pi Zero and other devices.
* Fix license text in one.cpp.
* Add a clarification to LICENSE.txt.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 30 Aug 2019 01:00:00 -0700
zerotier-one (1.4.4) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.
* License changed to BSL 1.1
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 23 Aug 2019 01:00:00 -0700
zerotier-one (1.4.2-2) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.
* This is a new build that fixes a binary build issue with containers and SELinux
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 04 Aug 2019 01:00:00 -0700
zerotier-one (1.4.2) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 04 Aug 2019 01:00:00 -0700
zerotier-one (1.4.0) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 29 Jul 2019 01:00:00 -0700
zerotier-one (1.2.12) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 25 Jul 2018 01:00:00 -0700
zerotier-one (1.2.10) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 08 May 2018 01:00:00 -0700
zerotier-one (1.2.8) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 27 Apr 2018 01:00:00 -0700
zerotier-one (1.2.6) unstable; urgency=medium
* See https://github.com/zerotier/ZeroTierOne for release notes.

1
attic/debian/compat Normal file
View File

@ -0,0 +1 @@
8

View File

@ -3,7 +3,7 @@ Maintainer: Adam Ierymenko <adam.ierymenko@zerotier.com>
Section: net
Priority: optional
Standards-Version: 3.9.6
Build-Depends: debhelper (>= 9), dh-systemd
Build-Depends: debhelper (>= 9)
Vcs-Git: git://github.com/zerotier/ZeroTierOne
Vcs-Browser: https://github.com/zerotier/ZeroTierOne
Homepage: https://www.zerotier.com/

View File

@ -3,7 +3,7 @@ Maintainer: Adam Ierymenko <adam.ierymenko@zerotier.com>
Section: net
Priority: optional
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9)
Build-Depends: debhelper
Vcs-Git: git://github.com/zerotier/ZeroTierOne
Vcs-Browser: https://github.com/zerotier/ZeroTierOne
Homepage: https://www.zerotier.com/

18
attic/debian/copyright Normal file
View File

@ -0,0 +1,18 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: zerotier-one
Source: https://github.com/zerotier/ZeroTierOne
Files: *
Copyright: 2011-2016 ZeroTier, Inc.
License: ZeroTier BSL 1.1
License: ZeroTier BSL 1.1
Copyright (c)2019 ZeroTier, Inc.
Use of this software is governed by the Business Source License included
in the LICENSE.TXT file in the project's root directory.
Change Date: 2023-01-01
On the date above, in accordance with the Business Source License, use
of this software will be governed by version 2.0 of the Apache License.

11
attic/debian/postinst Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh -e
case "$1" in
configure)
if ! id zerotier-one >>/dev/null 2>&1; then
useradd --system --user-group --home-dir /var/lib/zerotier-one --no-create-home zerotier-one
fi
;;
esac
#DEBHELPER#

View File

@ -0,0 +1,4 @@
[zerotier-one]
title=ZeroTier One
description=A planetary Ethernet switch
ports=9993/udp

View File

@ -1,6 +1,7 @@
[Unit]
Description=ZeroTier One
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/sbin/zerotier-one

BIN
attic/doc/2015-GCM-SIV.pdf Normal file

Binary file not shown.

BIN
attic/doc/AES-GMAC-SIV.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

149
attic/doc/SECURITY.md Normal file
View File

@ -0,0 +1,149 @@
ZeroTier security and cryptographic design
=======
(c)2020 ZeroTier, Inc.
Author(s): Adam Ierymenko <adam@zerotier.com>
# Introduction
This document describes the core components of ZeroTier's cryptographic and security architecture. It focuses primarily on version 2.0 and only briefly touches on v1.x constructions that are being phased out.
The intended audience for this document is developers, auditors, and security professionals wishing to understand ZeroTier's design from a security posture point of view. It's also written to serve as the basis for professional security audits of the ZeroTier protocol and code base.
## High-Level Protocol Design
ZeroTier's protocol is split into two conceptual layers that we term **VL1** and **VL2**.
VL1 stands for *virtual layer 1* and is a cryptographically addressed secure global peer-to-peer network responsible for moving packets between ZeroTier nodes. It's a virtual analogue of the physical wire or radio transciever in an Ethernet or WiFi network respectively. Think of it as a gigantic wire closet for planet Earth.
VL2 stands for *virtual layer 2* and is a full Ethernet emulation layer incorporating cryptographic certificate and token based access control. It is similar (but not identical) to other Ethernet virtualization protocols like VXLAN. VL2 is conceptually separate from VL1 but for the sake of simplicity and ease of use leverages VL1's cryptographic infrastructure for its own authentication needs.
## VL1 Asymmetric Cryptography: Identities, and Addressing
VL1 peers are cryptographically addressed, meaning addresses are strongly bound to public keys. Cryptographic addressing is extremely convenient in peer-to-peer networks as it leverages authenticated (AEAD) encryption to implicity authenticate endpoint addresses.
A ZeroTier identity is comprised of one or more cryptographic public keys and a short **ZeroTier address** derived from a hash of those keys. In addition to this short address there also exists a longer fingerprint in the form of a SHA-384 hash of identity public key(s).
#### Identity Types and Corresponding Algorithms
* **Type 0** (v1.x and v2.x): one Curve25519 key for elliptic curve Diffie-Hellman and one Ed25519 key for Ed25519 signatures, with the address and fingerprint computed from a hash of both.
* **Type 1** (v2.x only): Curve25519, Ed25519, and NIST P-384 public keys, with the latter being used for signatures (the Ed25519 key is still there but is presently unused) and with *both* Curve25519 and NIST P-384 being used for elliptic curve Diffie-Hellman key agreement. In key agreement the resulting raw secret keys are hashed together using SHA-384 to combine them and yield a single session key.
Session keys resulting from identity key exchange and agreement are *long-lived keys* that remain static for the lifetime of a particular pair of identities. A different mechanism is used for ephemeral key negotiation.
#### ZeroTier Addresses and Identity Fingerprints
In the simplest form of cryptographic addressing, keys are used directly as addresses throughout the system. Unfortunately even public key cryptosystems with short keys like Curve25519 still result in string representations that are prohibitively long for human beings to type. ZeroTier mitigates this usability problem by using a short hash of the public key termed a **ZeroTier address** to refer to a peer's full identity. This short address is also used at the wire level to reduce the size of the packet header. Peers may request full identities based on addresses from from root servers.
ZeroTier addresses are very short: only 40 bits or 10 hexadecimal digits, e.g. `89e92ceee5.` This makes them convenient to type, but such a short hash would in a naive implementation introduce a significant risk that an attacker could create a duplicate identity with a different key pair but the same address. With 40 bits an intentional collision would require only an average of about 549,755,813,888 attempts for a 50% chance of colliding. If an attempt requires 0.5ms of CPU time on a typical contemporary desktop or server CPU, this would require about 3,000 CPU-days. Since this type of search is easy to parallelize, it would take only a few days for someone with access to a few thousand CPU cores.
To provide this short hash with a larger security margin, an intentionally slow one-way "hashcash" or "proof of work" function is required during identity generation. This work function is slow to compute but fast to verify, and an address is not valid unless its work checks out. This gives identity address derivation the following costs:
* Type 1 identities: an average of about 500ms per key pair per typical 2.4ghz CPU core, requiring around 3 million CPU-days to reach a 50% collision probability.
* Type 2 identities: an average of about one second per key pair per typical 2.4ghz CPU core, requiring around 6.3 million CPU-days to reach a 50% collision probability.
While too costly for the vast majority of attackers, this cost may not be prohibitive to a nation-state level attacker or to a criminal with significant funds and/or access to a very large "botnet." It's also possible that FPGA, GPU, or ASIC acceleration could be leveraged to decrease this time in a manner similar to what's been accomplished in the area of cryptocurrency mining.
Fingerprints are full SHA-384 hashes of identity public keys. In base32-encoding they look like this:
```
bzg7fc3sn46fzyxcxw2ev4c4m2u5fyisb3o4wz5hfmvexbzwk6et3fsglkdcn6nnjobxi3bq7hgxqox3n4u4k
```
These are too large to type but not to copy/paste, store in databases, or use in scripts and APIs.
Once a device has joined a network, network controllers will remember and check its full identity or identity fingerprint (depending on implementation) rather than just the device's ZeroTier address.
## VL1 Wire Protocol
ZeroTier's wire protocol is packet based with packets having the following format:
```
[0:8] 64-bit packet ID and cryptographic nonce
[8:13] 40-bit destination ZeroTier address
[13:18] 40-bit source ZeroTier address
[18:19] 8-bit cleartext flags, cipher, and hop count (bits: FFCCCHHH)
[19:27] 64-bit message authentication code (MAC)
-- BEGIN ENCRYPTED SECTION --
[27:28] 8-bit inner flags and 5-bit protocol verb (bits: FFFVVVVV)
[28:...] Verb-specific packet payload
```
All fields (both those that remain cleartext and those that are encrypted) in a packet are authenticated except for the last three "hops" bits of the combined flags/cipher/hops field. These are masked to zero during MAC computation and verification. This is because the hops field is the only field that can be modified by third party peers in transit. It's incremented whenever a packet is forwarded by a root server or connectivity-assisting peer and is checked against a limit to prevent infinite forwarding loops.
Packets can be up to 16,384 bytes in size. Since the most common transport is UDP and this transport does not reliably support fragmentation, ZeroTier implements its own packet fragmentation and re-assembly scheme using fragments with the following wire format:
```
[0:8] 64-bit packet ID of packet of which this is a fragment
[8:13] 40-bit destination ZeroTier address
[13:14] 0xff here indicates a fragment since addresses cannot start with this byte
[14:15] 4-bit total fragments and 4-bit fragment number (bits: TTTTNNNN)
[15:16] 5 reserved bits, 3-bit hop count (bits: rrrrrHHH)
[16:...] Fragment data
```
A fragmented packet is indicated by the presence of the flag 0x40 in its cleartext flags field. If this flag is present the receiver must expect the receipt of one or more fragments in addition to the packet's header and first fragment. The total number of fragments expected is not contained in the header but will be contained within each subsequent fragment. If a fragment is received prior to its head, it's held in the event that its head arrives as the protocol does support out of order receipt of fragments.
Fragmentation can be effectively ignored from a security point of view (with the exception of denial of service concerns, which are mitigated by way of limits and heuristics in the code) since packet message authentication codes are checked at the packet level. Any improperly fragmented packet will fail cryptographic MAC check and be discarded.
*Legacy: In v1.x the packet ID and nonce field was assigned from a counter maintained to avoid duplicate nonce assignment and the MAC field was the first 64 bits of a Poly1305 MAC of the packet. The overall construction was identical in form to the NaCl Salsa20/Poly1305 "secret box" construction in which the first 32 bytes of Salsa20 output are used as a one-time Poly1305 key for each packet.*
In v2.x the packet ID and MAC field are in reality a single split 128-bit encrypted nonce and MAC field. See AES-GMAC-SIV below.
## Symmetric Encryption: AES-GMAC-SIV
**This is a draft and may change based on peer review and feedback.**
In v1.x there is a risk of nonce re-use due in part to the small size of the MAC and in part to the way ZeroTier is used. More specifically the risk arises when ZeroTier VMs are cloned or ZeroTier is used on small devices that have the potential to lack both accurate timekeeping and native strong random sources.
Salsa20 was used in v1.x since at the time the protocol was initially designed AES acceleration was not available on most mobile phones, embedded chips, and small ARM processors such as those use on Raspberry Pi and similar devices. This is no longer the case.
For v2.x our design has three objectives:
- Make use of FIPS140-compliant cryptographic primitives that would be available in a FIPS140-ceritified library (e.g. a FIPS build of crypto++ or openssl libcrypto), and use them in a way that could pass FIPS/NIST/NSA review.
- Use AES with hardware acceleration for extremely high performance processors with AES hardware acceleration, which is most non-trivial CPUs today.
- Incorporate some form of nonce-reuse-resistance to reduce the risk of duplicate nonces when virtual machines are cloned or on small devices, and to mitigate the short MAC.
The proposed AES-GMAC-SIV construction attempts to achieve all these objectives by using GMAC combined with AES-CTR (both FIPS140 primitives) in a way that achieves the security bounds and characteristics of AES-GCM-SIV but could be certified as FIPS compliant. The design is almost identical to another proposed mode called AES-GCM-SIV except that GMAC is used "as-is" for FIPS-certifiability reasons.
#### AES-GMAC-SIV Session Setup
For each new session key, derive two sub-keys **K0** and **K1** using a key derivation function such as KBKDF-HMAC-SHA384.
#### AES-GMAC-SIV Encryption
<img src="AES-GMAC-SIV.png">
As with all other SIV (synthetic IV) modes of operation, encryption requires two passes. Since messages are small in our system it's very likely that the second pass would be operating on data already in CPU L0 cache, reducing the additional overhead of this two-pass requirement.
1. Generate a new unique 64-bit packet ID in the same manner as v1.x.
2. Expand this 64-bit ID to a 96-bit AES-GMAC nonce by padding the remainder with the size of the packet in bytes and the direction of communication (sender > recipient or recipient > sender). This adds a small amount of additional entropy taken from characteristics of the packet.
3. Using session sub-key **K0** compute AES-GMAC(K0, plaintext) to yield a 128-bit GMAC tag.
4. Take the first 64 bits of this 128-bit GMAC tag and append it to the 64-bit packet ID generated in step 1 to yield a 128-bit combined nonce+MAC field.
5. Obtain a 128-bit AES-CTR nonce by encrypting this 128-bit combined nonce+MAC field as a single AES block using **K1**. This is done because GMAC alone is not a cryptographic PRF (pseudo-random function) and we want to ensure that we destroy any algebraic structure before using it with AES-CTR.
6. Using the encrypted nonce+MAC field as a 128-bit nonce, encrypt the encrypted section of the packet with AES-CTR. This is also done using **K1**, meaning that the first block of CTR padding data is actually AES(K1,AES(K1,nonce+MAC)).
7. Encrypt the 128-bit AES-CTR nonce again as a single AES block using **K0** to yield a final encrypted 128-bit combined nonce and MAC. *(Question for peer review: does this step have any attack-mitigating value? AES-CTR does not require that its nonce/IV be a secret.)*
8. Split this final encrypted nonce+IV into two 64-bit chunks, replacing the packet ID with one and placing the other in the packet MAC field.
#### AES-GMAC-SIV Decryption
Unlike encryption, SIV decryption can be performed in a single pass if there is a performance benefit to doing so.
1. Re-combine the packet ID and MAC fields into a single 128-bit block.
2. Decrypt this block with AES using **K0** to yield the AES-CTR nonce.
3. Decrypt the packet using AES-CTR with **K1**.
4. Decrypt the 128-bit AES-CTR nonce field *again* as a single AES block using **K1** to obtain the original packet nonce and 64-bit truncated GMAC tag.
5. Expand the 64-bit packet ID / nonce into a 96-bit GMAC nonce as in encryption step 2.
6. Compute AES-GMAC(K0,plaintext) as in encryption step 3.
7. Verify that the first 64 bytes of the resulting GMAC tag equals the tag (last 64 bits) obtained in decryption step 4 and discard the packet if they do not match.
#### Discussion
Most standard stream cipher modes such as AES-GCM or Salsa20/Poly1305 require that message nonce/IV values are never duplicated for the same session key. Since these stream modes generate key streams that are simply XORed with message plaintext, nonce duplication reveals the plaintext of both messages for which the nonce is duplicated due to the commutativity of the XOR operation. It may also allow the MAC (GMAC or Poly1305) itself to be attacked in such a way as to enable message forgery.
SIV modes mitigate these attacks by making the actual cryptographic nonce used for stream encryption dependent on the content of the message. If a nonce is repeated when two messages differ, ciphertext will still be unique unless a MAC collision also occurs. The chance of this is quite small, only 1/2^64 in our system for any given pair of repeated nonce values. If a repeated nonce occurs and both messages are the same, the protocol will leak only the fact that a message was repeated. The actual plaintext and MAC are not compromised.
Our AES-GMAC-SIV mode is almost identical to a proposed mode called [AES-GCM-SIV](https://cyber.biu.ac.il/aes-gcm-siv/). The proposed AES-GCM-SIV mode uses a variant of GMAC called POLYVAL with very minor performance improvements while ours retains standard GMAC for compatibility with existing standards and libraries. We call our mode AES-GMAC-SIV to distinguish it.
*Question for peer review: both GMAC and AES-CTR are FIPS140 approved primitives, and the use of AES-CTR with an approved MAC is permitted. Is it actually feasible that this could be FIPS certified if it were documented in a correct and "strategic" way? It would be described as GMAC authenticated AES-CTR with the CTR IV being constructed via keyed hash (AES) from an initial plaintext IV and a "salt" taken from the MAC, or some similar description.*

View File

@ -0,0 +1,23 @@
FROM alpine:3.11.3
ARG go_pkg_url
RUN apk add --update alpine-sdk linux-headers cmake openssh curl
RUN adduser -D -s /bin/ash jenkins && \
passwd -u jenkins && \
ssh-keygen -A && \
mkdir /home/jenkins/.ssh && \
chown -R jenkins:jenkins /home/jenkins
RUN curl -s $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz
COPY authorized_keys /home/jenkins/.ssh/authorized_keys
RUN chown -R jenkins:jenkins /home/jenkins/.ssh && \
chmod 600 /home/jenkins/.ssh/authorized_keys
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

View File

@ -0,0 +1,20 @@
FROM centos:6
ARG go_pkg_url
RUN yum update -y
RUN yum install -y curl git wget openssh-server sudo make rpmdevtools && yum clean all
RUN curl -s $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN echo $'\n\
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
>> ~/.bash_profile
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
CMD ["/usr/sbin/sshd", "-D"]

View File

@ -0,0 +1,21 @@
FROM i386/centos:6
ARG go_pkg_url
RUN echo i386 > /etc/yum/vars/basearch && echo i686 > /etc/yum/vars/arch
RUN yum install -y curl git wget openssh-server sudo make rpmdevtools && yum clean all
RUN curl -s $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN echo $'\n\
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
>> ~/.bash_profile
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
CMD ["/usr/sbin/sshd", "-D"]

View File

@ -0,0 +1,32 @@
FROM centos:7
ARG go_pkg_url
RUN yum install -y epel-release
RUN yum install -y curl git wget openssh-server sudo make development-tools rpmdevtools clang gcc-c++ ruby ruby-devel centos-release-scl devtoolset-8 llvm-toolset-7 openssl-devel && yum clean all
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
tar -xzf cmake.tar.gz && \
cd cmake-3.16.3 && \
./bootstrap && \
make -j4 && \
make install
RUN curl -s $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN wget -qO- "https://cmake.org/files/v3.15/cmake-3.15.1-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
RUN /usr/bin/ssh-keygen -A
RUN useradd jenkins-build
RUN echo $'\n\
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n\
source scl_source enable devtoolset-8 llvm-toolset-7\n'\
>> ~/.bash_profile
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
CMD ["/usr/sbin/sshd", "-D"]

View File

@ -0,0 +1,29 @@
FROM centos:7
ARG go_pkg_url
RUN yum install -y curl git wget openssh-server sudo make development-tools rpmdevtools clang gcc-c++ ruby ruby-devel openssl-devel && yum clean all
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
tar -xzf cmake.tar.gz && \
cd cmake-3.16.3 && \
./bootstrap && \
make -j4 && \
make install
RUN curl -s $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN /usr/bin/ssh-keygen -A
RUN useradd jenkins-build
RUN echo $'\n\
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
>> ~/.bash_profile
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
CMD ["/usr/sbin/sshd", "-D"]

View File

@ -0,0 +1,25 @@
FROM centos:8
ARG go_pkg_url
RUN yum install -y epel-release
RUN yum install -y curl git wget openssh-server sudo make rpmdevtools clang gcc-c++ ruby ruby-devel cmake && yum clean all
RUN curl -s $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN wget -qO- "https://cmake.org/files/v3.15/cmake-3.15.1-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
RUN /usr/bin/ssh-keygen -A
RUN useradd jenkins-build
RUN echo $'\n\
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n\
source scl_source enable devtoolset-8 llvm-toolset-7\n'\
>> ~/.bash_profile
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
CMD ["/usr/sbin/sshd", "-D"]

View File

@ -0,0 +1,26 @@
FROM s390x/clefos:7
ARG go_pkg_url
RUN yum install -y curl git wget openssh-server sudo make development-tools rpmdevtools clang gcc-c++ ruby ruby-devel openssl-devel && yum clean all
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
tar -xzf cmake.tar.gz && \
cd cmake-3.16.3 && \
./bootstrap && \
make -j4 && \
make install
RUN curl -s $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN /usr/bin/ssh-keygen -A
RUN echo $'\n\
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
>> ~/.bash_profile
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
CMD ["/usr/sbin/sshd", "-D"]

View File

@ -0,0 +1,15 @@
FROM debian:bullseye-20191224
ARG go_pkg_url
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,15 @@
FROM debian:buster-20191224
ARG go_pkg_url
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,22 @@
FROM debian:jessie-20191224
ARG go_pkg_url
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd libssl-dev
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
tar -xzf cmake.tar.gz && \
cd cmake-3.16.3 && \
./bootstrap && \
make -j4 && \
make install
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,15 @@
FROM debian:sid-20191224
ARG go_pkg_url
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,22 @@
FROM debian:stretch-20191224
ARG go_pkg_url
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd libssl-dev
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
tar -xzf cmake.tar.gz && \
cd cmake-3.16.3 && \
./bootstrap && \
make -j4 && \
make install
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,23 @@
FROM debian:wheezy-20190228
ARG go_pkg_url
RUN echo "deb http://archive.debian.org/debian/ wheezy contrib main non-free" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ wheezy contrib main non-free" >> /etc/apt/sources.list && \
apt-get update && apt-get install -y apt-utils && \
apt-get install -y --force-yes \
curl gcc make sudo expect gnupg fakeroot perl-base=5.14.2-21+deb7u3 perl \
libc-bin=2.13-38+deb7u10 libc6=2.13-38+deb7u10 libc6-dev build-essential \
cdbs devscripts equivs automake autoconf libtool libaudit-dev selinux-basics \
libdb5.1=5.1.29-5 libdb5.1-dev libssl1.0.0=1.0.1e-2+deb7u20 procps gawk libsigsegv2 \
curl ca-certificates devscripts
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,15 @@
FROM kalilinux/kali-rolling:latest
ARG go_pkg_url
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,15 @@
FROM ubuntu:bionic-20200112
ARG go_pkg_url
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,15 @@
FROM ubuntu:eoan-20200114
ARG go_pkg_url
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,22 @@
FROM ubuntu:trusty-20191217
ARG go_pkg_url
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd libssl-dev
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
tar -xzf cmake.tar.gz && \
cd cmake-3.16.3 && \
./bootstrap && \
make -j4 && \
make install
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

View File

@ -0,0 +1,22 @@
FROM ubuntu:xenial-20200114
ARG go_pkg_url
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
tar -xzf cmake.tar.gz && \
cd cmake-3.16.3 && \
./bootstrap && \
make -j4 && \
make install
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
RUN chmod 777 /home
CMD ["/usr/bin/sshd", "-D"]

111
attic/dockerbuild/Makefile Normal file
View File

@ -0,0 +1,111 @@
.PHONY: all
all: alpine centos clefos debian ubuntu kali-rolling
alpine:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.alpine . -t ztbuild/alpine-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.alpine . -t ztbuild/alpine-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.alpine . -t ztbuild/alpine-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.alpine . -t ztbuild/alpine-armel --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.alpine . -t ztbuild/alpine-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.alpine . -t ztbuild/alpine-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.alpine . -t ztbuild/alpine-s390x --load
centos:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.centos7 . -t ztbuild/centos7-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.centos7-i386 . -t ztbuild/centos7-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.centos6 . -t ztbuild/centos6-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.centos6-i386 . -t ztbuild/centos6-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.centos8 . -t ztbuild/centos8-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.centos8 . -t ztbuild/centos8-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.centos8 . -t ztbuild/centos8-ppc64le --load
clefos:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.clefos-s390x . -t ztbuild/clefos-s390x --load
debian: debian-wheezy debian-jessie debian-buster debian-stretch debian-bullseye debian-sid
debian-wheezy:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-armel --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-i386 --load
debian-jessie:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-armel --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-i386 --load
debian-buster:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-armel --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-buster . -t ztbuild/debian-buster-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-buster . -t ztbuild/debian-buster-s390x --load
debian-stretch:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-armel --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-s390x --load
debian-bullseye:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-armel --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-s390x --load
debian-sid:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-armel --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-sid . -t ztbuild/debian-sid-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-sid . -t ztbuild/debian-sid-s390x --load
ubuntu: ubuntu-trusty ubuntu-xenial ubuntu-bionic ubuntu-eoan
ubuntu-trusty:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-ppc64le --load
ubuntu-xenial:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-s390x --load
ubuntu-bionic:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-s390x --load
ubuntu-eoan:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-amd64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-arm64 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-armhf --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-i386 --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-ppc64le --load
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-s390x --load
kali-rolling:
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.kali-rolling . -t ztbuild/kali-rolling-amd64 --load

View File

@ -0,0 +1,2 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8hgysbj2Luu3aN/Ya2wr4Y9LpUGqWWfn3k+UhIwOIE/Kd7/YpLjxHpseUA1hLnj9kHFShH8eiqoY0S6EDIYrTUwbXMMu8454lX/LcJOCJ9RlSeMMf7vpkxcI7cVRgOA430a3FR7M0Q8vKlyJzxxAEjMIxMyuVyinknfanNt+sQFiDUvOXoacqgZAHBWMlO7wOPyHWHNOzy7g8N0dHiJveKZqX/UUwuqJuS6UBq7MBMSU6TcMvJwHr+AbNvfyIUWCqlTByqFL9cmviRbIvQanxoRxi/5fVUGhtVBXUYvbCdFxDw5W2Svo9fDMm4Z5xWAD7rY1J3AM15RVyRTTtYvgD

View File

@ -0,0 +1,13 @@
# curl (REST API)
# User
JENKINS_USER=grant
# Api key from "/me/configure" on my Jenkins instance
JENKINS_USER_KEY=11edf2d49321321119712c46c6349eaad7
# Url for my local Jenkins instance.
JENKINS_URL=http://$JENKINS_USER:$JENKINS_USER_KEY@jenkins.int.zerotier.com
# JENKINS_CRUMB is needed if your Jenkins master has CRSF protection enabled (which it should)
JENKINS_CRUMB=`curl "$JENKINS_URL/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)"`
curl -X POST -H $JENKINS_CRUMB -F "jenkinsfile=<Jenkinsfile" $JENKINS_URL/pipeline-model-converter/validate

View File

@ -6,11 +6,9 @@ LOCAL_MODULE := ZeroTierOneJNI
LOCAL_C_INCLUDES := \
$(ZT1)/include \
$(ZT1)/node \
$(ZT1)/osdep \
$(ZT1)/ext/miniupnpc \
$(ZT1)/ext/libnatpmp
$(ZT1)/osdep
LOCAL_LDLIBS := -llog -latomic
LOCAL_LDLIBS := -llog
# LOCAL_CFLAGS := -g
LOCAL_CFLAGS := -DZT_USE_MINIUPNPC
@ -19,8 +17,8 @@ LOCAL_CFLAGS := -DZT_USE_MINIUPNPC
LOCAL_SRC_FILES := \
$(ZT1)/node/C25519.cpp \
$(ZT1)/node/Capability.cpp \
$(ZT1)/node/CertificateOfMembership.cpp \
$(ZT1)/node/CertificateOfOwnership.cpp \
$(ZT1)/node/MembershipCredential.cpp \
$(ZT1)/node/OwnershipCredential.cpp \
$(ZT1)/node/Identity.cpp \
$(ZT1)/node/IncomingPacket.cpp \
$(ZT1)/node/InetAddress.cpp \
@ -43,26 +41,7 @@ LOCAL_SRC_FILES := \
$(ZT1)/node/Topology.cpp \
$(ZT1)/node/Trace.cpp \
$(ZT1)/node/Utils.cpp \
$(ZT1)/osdep/OSUtils.cpp \
$(ZT1)/osdep/PortMapper.cpp
# libminiupnpc and libnatpmp files
LOCAL_SRC_FILES += \
$(ZT1)/ext/miniupnpc/connecthostport.c \
$(ZT1)/ext/miniupnpc/igd_desc_parse.c \
$(ZT1)/ext/miniupnpc/minisoap.c \
$(ZT1)/ext/miniupnpc/minissdpc.c \
$(ZT1)/ext/miniupnpc/miniupnpc.c \
$(ZT1)/ext/miniupnpc/miniwget.c \
$(ZT1)/ext/miniupnpc/minixml.c \
$(ZT1)/ext/miniupnpc/portlistingparse.c \
$(ZT1)/ext/miniupnpc/receivedata.c \
$(ZT1)/ext/miniupnpc/upnpcommands.c \
$(ZT1)/ext/miniupnpc/upnpdev.c \
$(ZT1)/ext/miniupnpc/upnperrors.c \
$(ZT1)/ext/miniupnpc/upnpreplyparse.c \
$(ZT1)/ext/libnatpmp/natpmp.c \
$(ZT1)/ext/libnatpmp/getgateway.c
$(ZT1)/osdep/OSUtils.cpp
# JNI Files
LOCAL_SRC_FILES += \

View File

@ -1,5 +1,5 @@
# NDK_TOOLCHAIN_VERSION := clang3.5
APP_STL := c++_static
APP_CPPFLAGS := -Wall -fstack-protector -fexceptions -fno-strict-aliasing -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
APP_CPPFLAGS := -Wall -fstack-protector -fexceptions -fno-strict-aliasing -frtti -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
APP_PLATFORM := android-14
APP_ABI := all

View File

@ -32,8 +32,6 @@
#include <ZeroTierOne.h>
#include "Mutex.hpp"
#include "PortMapper.hpp"
#include <map>
#include <string>
#include <assert.h>
@ -60,7 +58,6 @@ namespace {
, configListener(NULL)
, pathChecker(NULL)
, callbacks(NULL)
, portMapper(NULL)
{
callbacks = (ZT_Node_Callbacks*)malloc(sizeof(ZT_Node_Callbacks));
memset(callbacks, 0, sizeof(ZT_Node_Callbacks));
@ -81,9 +78,6 @@ namespace {
free(callbacks);
callbacks = NULL;
delete portMapper;
portMapper = NULL;
}
int64_t id;
@ -101,8 +95,6 @@ namespace {
jobject pathChecker;
ZT_Node_Callbacks *callbacks;
ZeroTier::PortMapper *portMapper;
};
@ -880,13 +872,6 @@ JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_node_1init(
return resultObject;
}
uint64_t nodeId = ZT_Node_address(node);
if (nodeId != 0) {
char uniqueName[64];
snprintf(uniqueName, sizeof(uniqueName), "ZeroTier Android/%.10llx@%u", (unsigned long long)nodeId, 9993);
ref->portMapper = new ZeroTier::PortMapper(9993, uniqueName);
}
ZeroTier::Mutex::Lock lock(nodeMapMutex);
ref->node = node;
nodeMap.insert(std::make_pair(ref->id, ref));

Some files were not shown because too many files have changed in this diff Show More