mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-09-22 15:29:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91b16310ea | ||
|
|
609873e6d1 | ||
|
|
4c616621c2 | ||
|
|
05470bf202 | ||
|
|
633cf9ec04 | ||
|
|
f3c3a90393 | ||
|
|
25a48f2f44 | ||
|
|
d214a5437f | ||
|
|
de0a5aa840 | ||
|
|
6f9e3e3b78 | ||
|
|
5c5e7fc7ff | ||
|
|
43e98930e9 | ||
|
|
51ebefc3ab | ||
|
|
86add4a6d3 | ||
|
|
221a3f9a08 | ||
|
|
2f74bd5150 | ||
|
|
e8ae333443 | ||
|
|
52a166a71f | ||
|
|
509da3ac34 | ||
|
|
fe18579061 | ||
|
|
2ec53df7ab | ||
|
|
1c7b553331 | ||
|
|
a0fb519696 | ||
|
|
83e6864b78 | ||
|
|
98af3c0dc1 | ||
|
|
5341c216a7 | ||
|
|
96a0c3d764 | ||
|
|
783b49e383 | ||
|
|
d4dc983a01 | ||
|
|
72ccd1020a | ||
|
|
6a9a577c59 | ||
|
|
730305ecc7 | ||
|
|
f8f2432ece | ||
|
|
55087521f6 | ||
|
|
760ae07d72 | ||
|
|
28d0070ce2 | ||
|
|
ad2a7c2590 | ||
|
|
8b97755fc5 | ||
|
|
7bb0d9be1b | ||
|
|
6c44fcc290 | ||
|
|
c8e7031198 | ||
|
|
fb3b2820b5 | ||
|
|
c83a4aef55 | ||
|
|
af7a70bf02 | ||
|
|
4d70640a15 | ||
|
|
b11627a8bc | ||
|
|
7436f85ad0 | ||
|
|
237c379866 | ||
|
|
aca31c7055 | ||
|
|
6073e7972f | ||
|
|
f7e8d8f1dd | ||
|
|
87016ae815 | ||
|
|
3ed8e46782 | ||
|
|
3db0197865 | ||
|
|
6174c0c103 | ||
|
|
8898cb342b | ||
|
|
9cc76d1115 | ||
|
|
5289d3327c | ||
|
|
00fb9c475e | ||
|
|
3c776675b3 | ||
|
|
37d508ab96 | ||
|
|
f4f8fef82e | ||
|
|
cd2e3c79f2 | ||
|
|
7722350178 | ||
|
|
a77b4ecddb | ||
|
|
818b7e4a2e | ||
|
|
00d63f6046 | ||
|
|
639fc60257 | ||
|
|
21467596bc | ||
|
|
75ebe5172f | ||
|
|
4a9030b4a0 | ||
|
|
fdc708a624 | ||
|
|
67beea1e3d | ||
|
|
34364ab8ee | ||
|
|
bb99ef1351 | ||
|
|
b3891e5506 | ||
|
|
632d6e04ad | ||
|
|
db813db7e8 | ||
|
|
837c6270f2 | ||
|
|
8c3c07cb5d | ||
|
|
5cc0dd7f55 | ||
|
|
79c4d98b61 | ||
|
|
678e11530e | ||
|
|
a8f2b39f15 | ||
|
|
add2ac0369 | ||
|
|
1e475edd1c | ||
|
|
745483708a | ||
|
|
d9432f2f1e | ||
|
|
eb7081d2a3 | ||
|
|
d9befe3fb3 | ||
|
|
0618452615 | ||
|
|
f6b080b8a2 | ||
|
|
c8c33db1d1 | ||
|
|
196bac726c | ||
|
|
ac2688de58 | ||
|
|
d2af12b6a0 | ||
|
|
6958ba9557 | ||
|
|
5f11daadf2 | ||
|
|
99df3fe433 | ||
|
|
d4d350a285 | ||
|
|
8a0b75c83a | ||
|
|
9cf74657e0 | ||
|
|
5edd04638d | ||
|
|
eb2f851e65 | ||
|
|
a0f47b12b4 | ||
|
|
1b2d9e202e | ||
|
|
daa8839005 | ||
|
|
80124bb753 | ||
|
|
861a319014 | ||
|
|
d43e810ecb | ||
|
|
7afcc17024 | ||
|
|
2ab2f68725 | ||
|
|
90872c906f | ||
|
|
bdc2ec1f5e | ||
|
|
692733fffb | ||
|
|
d3728d5859 | ||
|
|
389331ca29 | ||
|
|
b2c4b7e99f | ||
|
|
fee6aae442 | ||
|
|
409406d114 | ||
|
|
203414910f | ||
|
|
ac0082a67e | ||
|
|
9ccbe85923 | ||
|
|
dffbd2113a | ||
|
|
7db073d993 | ||
|
|
3c02c2e4bd | ||
|
|
a17c760181 | ||
|
|
54d2fa65dd | ||
|
|
a019c3dd5d | ||
|
|
a3ef9b8a15 | ||
|
|
554e0b7c6d | ||
|
|
fd74e2a583 | ||
|
|
af5d3a7f0b | ||
|
|
bb0808c99c | ||
|
|
f0295b154b | ||
|
|
b041de831a | ||
|
|
21e844cd82 | ||
|
|
4e2439bd12 | ||
|
|
c5a07c7f20 | ||
|
|
e2900f4f3c | ||
|
|
aa831dd843 | ||
|
|
2dc783214c | ||
|
|
523df47a65 | ||
|
|
f66fac3982 | ||
|
|
9c51ce9c40 | ||
|
|
9797540212 | ||
|
|
ce2338c24a | ||
|
|
3b188ba672 | ||
|
|
eb84d61deb | ||
|
|
47d29ddcaf | ||
|
|
f411eb1651 | ||
|
|
94bd2918fa | ||
|
|
c3bfcf560b | ||
|
|
5b2b088714 | ||
|
|
0bdfad52e7 | ||
|
|
cf046a4039 | ||
|
|
700cc92083 | ||
|
|
2eb9c0924a | ||
|
|
ebadc6f203 | ||
|
|
87bce1a36b | ||
|
|
848f822171 | ||
|
|
d4199ddb3e | ||
|
|
e4abc91d35 | ||
|
|
37d321afc8 | ||
|
|
541e5c510e | ||
|
|
90d324ae96 | ||
|
|
cacdb445c7 | ||
|
|
4743ad0b16 | ||
|
|
2d5c6fa975 | ||
|
|
95ef13f7a1 | ||
|
|
298e1d5a74 | ||
|
|
87c75d033e | ||
|
|
71ae678930 | ||
|
|
6a027c9c0a | ||
|
|
6014df2847 | ||
|
|
55a9e6e05e | ||
|
|
02f0eead1c | ||
|
|
d77846dcea | ||
|
|
92c811deb7 | ||
|
|
92f199ab98 | ||
|
|
b65feeba85 | ||
|
|
6914425b03 | ||
|
|
89f57124b2 | ||
|
|
65823332d4 | ||
|
|
ee8682ac75 | ||
|
|
e3e5137757 | ||
|
|
d81549a7b1 | ||
|
|
d5ac8512e3 | ||
|
|
f23e354272 | ||
|
|
6475e1faf6 | ||
|
|
752fc0742e | ||
|
|
e1091611da | ||
|
|
678116b6d1 | ||
|
|
0a9e2227e8 | ||
|
|
2600b1f144 | ||
|
|
b56753ea9f | ||
|
|
97046b265c | ||
|
|
2966eac64f | ||
|
|
d530356055 | ||
|
|
af3ec000a0 | ||
|
|
8051127c3b | ||
|
|
e37eb0aa54 | ||
|
|
130fa35bb1 | ||
|
|
39e1021f62 | ||
|
|
63ec19674c | ||
|
|
af60e769b0 | ||
|
|
087c75d5ee | ||
|
|
e03102dbcb | ||
|
|
9d7b7c72b2 | ||
|
|
99c3f02343 | ||
|
|
95bfc29c92 | ||
|
|
e3cc7c9a80 | ||
|
|
d4c0349de9 | ||
|
|
d7a6357393 | ||
|
|
6fbf21b4f0 | ||
|
|
993d850f69 | ||
|
|
cda07b20a2 | ||
|
|
52c85aa605 | ||
|
|
e5155df6d5 | ||
|
|
293d2064c4 | ||
|
|
171cc3e01a | ||
|
|
8141043560 | ||
|
|
9a3cc93d74 | ||
|
|
fcb4221f97 | ||
|
|
1f13374a4f | ||
|
|
801401a6e7 | ||
|
|
de1fc43cc5 | ||
|
|
270debb3fc | ||
|
|
59a0a25f35 | ||
|
|
a788486803 | ||
|
|
3d21f0a91f | ||
|
|
f726044e29 | ||
|
|
a4b1917361 | ||
|
|
a3b2aeb001 | ||
|
|
5b1ef2fb03 | ||
|
|
d0f78f1e03 | ||
|
|
541e91ed8e | ||
|
|
321cada1d7 | ||
|
|
34c1023ba7 | ||
|
|
82a21d4b71 | ||
|
|
23996c7e6b | ||
|
|
d7091a0bac | ||
|
|
7414418e2e | ||
|
|
2294770e56 | ||
|
|
d98bdb5643 | ||
|
|
21f4f16e63 | ||
|
|
0e597191b8 | ||
|
|
001ba1a4a7 | ||
|
|
b59c4a2106 | ||
|
|
c35933cd1e | ||
|
|
0da2efa633 | ||
|
|
e23d95bf03 | ||
|
|
f6e9f0e2a2 | ||
|
|
4a89729529 | ||
|
|
56a58f2b11 | ||
|
|
e959908c51 | ||
|
|
6e3144370a | ||
|
|
20f02bb772 | ||
|
|
1c86f25fab | ||
|
|
e6f9ab929d | ||
|
|
18d1772bb4 | ||
|
|
5535cad773 | ||
|
|
ec84934d48 | ||
|
|
328d08781a | ||
|
|
c8d5215870 | ||
|
|
62ccb48a0b | ||
|
|
82409eb345 | ||
|
|
b75f212d70 | ||
|
|
ccb856749f | ||
|
|
9d2bc9bf4e | ||
|
|
52c4385c16 | ||
|
|
5da7d6d1ae | ||
|
|
65e0a74718 | ||
|
|
01d5d7d78b | ||
|
|
e3381a4c1f | ||
|
|
03e35b25b8 | ||
|
|
e2b0fb26b1 | ||
|
|
01c18cc442 | ||
|
|
01e6df4d46 | ||
|
|
882b03436d | ||
|
|
690bd933d5 | ||
|
|
6684559cd9 | ||
|
|
4ed7d20a48 | ||
|
|
350116c513 | ||
|
|
7bde2c089d | ||
|
|
90631adb9b | ||
|
|
f6450cd7e1 | ||
|
|
3b6b1d1674 | ||
|
|
33d7b22abe | ||
|
|
2f9712e6a7 | ||
|
|
b937aeb857 | ||
|
|
f3d8846df3 | ||
|
|
2729db9555 | ||
|
|
1cec4b1c4c | ||
|
|
7048c77ebc | ||
|
|
c9c17eaddd | ||
|
|
f1b82b734a | ||
|
|
4c0e7aa8b0 | ||
|
|
296e4616cc | ||
|
|
15649334a6 | ||
|
|
b3c2c0866f | ||
|
|
c6ae81fac7 | ||
|
|
79086f0858 | ||
|
|
c148a23df4 | ||
|
|
c56831767e | ||
|
|
72a724f075 | ||
|
|
96e1df5854 | ||
|
|
2e44b90f63 | ||
|
|
5a0adba798 | ||
|
|
761cc5c923 | ||
|
|
f901b9dd6b | ||
|
|
d87fcca176 | ||
|
|
7c72653385 | ||
|
|
7dbccf08ae | ||
|
|
2d21c18ebd | ||
|
|
15d0aad3c0 | ||
|
|
f0fc9b1766 | ||
|
|
7c0331997a | ||
|
|
04de2302a7 | ||
|
|
1da1409db2 | ||
|
|
c1ea1329c1 | ||
|
|
417aa9547b | ||
|
|
60d5a3c631 | ||
|
|
7a42416a78 | ||
|
|
2a143a7505 | ||
|
|
0510f85a8f | ||
|
|
5b222d0a09 | ||
|
|
133b64679c | ||
|
|
79b88a22c3 | ||
|
|
88d879987d | ||
|
|
27c37a18f3 | ||
|
|
b8268d894b | ||
|
|
79b47b055a | ||
|
|
8e260bae11 | ||
|
|
af61ee6f3a | ||
|
|
04d7a1df96 | ||
|
|
b9fd50e348 | ||
|
|
ef48d11266 | ||
|
|
a47559d9e3 | ||
|
|
cffb992ae8 | ||
|
|
39e720e811 | ||
|
|
7b87e9c0cb | ||
|
|
3dd9b1aa9b | ||
|
|
0fddebc791 | ||
|
|
701d64936d | ||
|
|
0ec6215493 | ||
|
|
de45bdb448 | ||
|
|
7b608c6ca3 | ||
|
|
6ff78c9c26 | ||
|
|
d701f4e331 | ||
|
|
92abc92463 | ||
|
|
a4be9ceb5a | ||
|
|
e21b6e1daf | ||
|
|
2e3b03fff9 | ||
|
|
cd657da431 | ||
|
|
17af09a5cc | ||
|
|
ceff48b07c | ||
|
|
199566965e | ||
|
|
46e46e9b7b | ||
|
|
8b292d2dc7 | ||
|
|
88abd6ffc6 | ||
|
|
76b4ec12a0 | ||
|
|
0e4cfd897b | ||
|
|
515d7962b0 | ||
|
|
553101e8b5 | ||
|
|
3cd0ab1b3b | ||
|
|
fc6dba0797 | ||
|
|
e01c0adff2 | ||
|
|
65b0030342 | ||
|
|
f302fac423 | ||
|
|
28cb40529d | ||
|
|
bdcdccfcc3 | ||
|
|
52264d5e28 | ||
|
|
17fbb020e7 | ||
|
|
f8005b88ad | ||
|
|
0faa655b83 | ||
|
|
6fddf31db3 | ||
|
|
7c53adbcfe | ||
|
|
9681fedbb4 | ||
|
|
b6d97af451 | ||
|
|
b9975845ff | ||
|
|
b22405b64b | ||
|
|
62210e57f1 | ||
|
|
4dd093efc9 | ||
|
|
91a22a686a | ||
|
|
46a7a2be2e | ||
|
|
8199dbd0dc | ||
|
|
3ace61ef85 | ||
|
|
442595d6fc | ||
|
|
be469f4dd0 | ||
|
|
7da4b0af15 | ||
|
|
2fff651378 | ||
|
|
c24d16e62e | ||
|
|
91c8e82c42 | ||
|
|
1debe2292d | ||
|
|
6a2ba4baca | ||
|
|
836d897aec | ||
|
|
740b0fbbf6 | ||
|
|
c7115a0671 | ||
|
|
381bbb0e5e | ||
|
|
05bfafbce8 | ||
|
|
9da7967197 | ||
|
|
2021f8cb5f | ||
|
|
af74fe1711 | ||
|
|
c908b9f67a | ||
|
|
209f6d9d2d | ||
|
|
b601041b5b | ||
|
|
0945d6ec0d | ||
|
|
e61d4ab67a | ||
|
|
2d289a3308 | ||
|
|
bdb2cc7c85 | ||
|
|
7793060723 | ||
|
|
84302ae9c7 | ||
|
|
cd801b96fa | ||
|
|
5ff0653f9e | ||
|
|
9574d635c1 | ||
|
|
381857ea49 |
No files matched your search
@@ -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 ]
|
||||
|
||||
@@ -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.
|
||||
@@ -4,6 +4,7 @@
|
||||
/zerotier-cli
|
||||
/zerotier-selftest
|
||||
/zerotier
|
||||
/nltest
|
||||
|
||||
# OS-created garbage files from various platforms
|
||||
.DS_Store
|
||||
@@ -50,6 +51,7 @@ enc_temp_folder
|
||||
/world/mkworld
|
||||
/world/*.c25519
|
||||
zt1-src.tar.gz
|
||||
/MacEthernetTapAgent
|
||||
|
||||
# Miscellaneous temporaries, build files, etc.
|
||||
*.log
|
||||
@@ -116,3 +118,5 @@ ext/librethinkdbxx/build
|
||||
.vscode
|
||||
__pycache__
|
||||
*~
|
||||
attic/world/*.c25519
|
||||
attic/world/mkworld
|
||||
+10
-8
@@ -1,7 +1,10 @@
|
||||
# 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
|
||||
@@ -25,7 +28,7 @@
|
||||
|
||||
## 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
|
||||
|
||||
@@ -45,13 +48,6 @@ ZeroTier includes the following third party code, either in ext/ or incorporated
|
||||
* 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
|
||||
|
||||
* tap-windows6 by the OpenVPN project
|
||||
|
||||
* Files: windows/TapDriver6/*
|
||||
@@ -71,3 +67,9 @@ ZeroTier includes the following third party code, either in ext/ or incorporated
|
||||
* Files: ext/libnatpmp/* ext/miniupnpc/*
|
||||
* Home page: http://miniupnp.free.fr/
|
||||
* License grant: BSD attribution no-endorsement
|
||||
|
||||
* cpp-httplib by yhirose
|
||||
|
||||
* Files: ext/cpp-httplib/*
|
||||
* Home page: https://github.com/yhirose/cpp-httplib
|
||||
* License grant: MIT
|
||||
@@ -1,13 +1,8 @@
|
||||
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
|
||||
Copyright © 2011–2018 ZeroTier, Inc.
|
||||
Copyright © 2011–2019 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:
|
||||
|
||||
Vendored
+48
-48
@@ -24,61 +24,61 @@ parallel 'centos7': {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
}, 'android-ndk': {
|
||||
node('android-ndk') {
|
||||
try {
|
||||
checkout scm
|
||||
// }, 'android-ndk': {
|
||||
// node('android-ndk') {
|
||||
// try {
|
||||
// checkout scm
|
||||
|
||||
stage('Build Android NDK') {
|
||||
sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}"
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
currentBuild.result = "FAILURE"
|
||||
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)"
|
||||
// stage('Build Android NDK') {
|
||||
// sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}"
|
||||
// }
|
||||
// }
|
||||
// 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
|
||||
// throw err
|
||||
// }
|
||||
// }
|
||||
// }, 'macOS': {
|
||||
// node('macOS') {
|
||||
// try {
|
||||
// checkout scm
|
||||
|
||||
stage('Build macOS') {
|
||||
sh 'make -f make-mac.mk'
|
||||
}
|
||||
// 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>)"
|
||||
// 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
|
||||
// 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>)"
|
||||
// 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
|
||||
}
|
||||
}
|
||||
// throw err
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
mattermostSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)"
|
||||
-339
@@ -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.
|
||||
-674
File diff suppressed because it is too large.
Load diff
+138
-28
@@ -1,37 +1,147 @@
|
||||
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 1.4.4
|
||||
The Licensed Work is (c)2019 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.
|
||||
|
||||
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 Derviative 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: 2023-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 License’s 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 License’s 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.
|
||||
@@ -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.
|
||||
@@ -1,62 +1,65 @@
|
||||
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.
|
||||
- `debian/`: files for building Debian packages on Linux.
|
||||
- `doc/`: manual pages and other documentation.
|
||||
- `docker/`: Dockerfile to build as a container for containerized Linux systems and Kubernetes clusters.
|
||||
- `ext/`: third party libraries, binaries that we ship for convenience on some platforms (Mac and Windows), and installation support files.
|
||||
- `include/`: include files for the ZeroTier core.
|
||||
- `java/`: a JNI wrapper used with our Android mobile app. (The whole Android app is not open source but may be made so in the future.)
|
||||
- `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 +88,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 +104,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).
|
||||
+34
-4
@@ -1,6 +1,36 @@
|
||||
ZeroTier Release Notes
|
||||
======
|
||||
|
||||
# 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.
|
||||
@@ -43,7 +73,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).
|
||||
@@ -85,7 +115,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/).)
|
||||
|
||||
@@ -168,7 +198,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.
|
||||
|
||||
@@ -183,7 +213,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: 4.6 KiB |
-1042
File diff suppressed because it is too large.
Load diff
@@ -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
|
||||
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
*/
|
||||
@@ -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
|
||||
-101
@@ -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
|
||||
File diff suppressed because it is too large.
Load diff
Loaded 20 of 332 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user