mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-25 02:29:25 +00:00
Compare commits
2771 Commits
1.1.6
...
v2-before-
Author | SHA1 | Date | |
---|---|---|---|
7d951783ca | |||
ec76f6e1d2 | |||
c943d0e807 | |||
a1ceccaf6e | |||
326a871fac | |||
e462750bdd | |||
7c599fe83e | |||
d7e4404c17 | |||
441f4986ac | |||
d70cfe6850 | |||
4ed77e0c0f | |||
f8e3251efe | |||
1bb43476e8 | |||
387d293793 | |||
bd96e53bcc | |||
bab9a7f508 | |||
31eb950750 | |||
31ef205828 | |||
a7350bc312 | |||
0e396526e4 | |||
8e5f8140a2 | |||
8f746f5099 | |||
bc8aa6c359 | |||
00714f5f2e | |||
d20470d30f | |||
c2d14599c5 | |||
896656115f | |||
72114e4cf8 | |||
2abf2c5695 | |||
fe01352412 | |||
782f15f8c9 | |||
e0492a7e69 | |||
cb147a3e8a | |||
f97e9e1f5d | |||
f1b6cb2ace | |||
27939a5233 | |||
7d5ba6f739 | |||
37360d5e2e | |||
ae13983b10 | |||
78670aea58 | |||
d0cc3ac333 | |||
4273d89373 | |||
9ef780e05c | |||
9da0b43d2d | |||
7c929099b3 | |||
ea2f95ed70 | |||
fc39894541 | |||
1fc4dce835 | |||
0c56d7c769 | |||
1f2a107d1d | |||
4474303b01 | |||
3b773da8bc | |||
7efaab2af1 | |||
064cb6dad7 | |||
d5afba2610 | |||
b4d0307d9e | |||
71b72a1ef2 | |||
b0e8bac310 | |||
9a501a76d1 | |||
becc4aa8ea | |||
95d7970f34 | |||
81530e5990 | |||
825b19aedc | |||
0f04b5afc7 | |||
189dea7c96 | |||
85ef9535d5 | |||
71a2206c5d | |||
641d1a52c8 | |||
407f737212 | |||
0d58865061 | |||
cfb0bc4f8e | |||
dfe230be8b | |||
75ecfffd52 | |||
883cbd182d | |||
866a20e85b | |||
a19bc1e826 | |||
a117c92a1e | |||
65ef40b091 | |||
15f5125c8c | |||
e5f2314055 | |||
f018fefeb4 | |||
04d8c3dd79 | |||
7994e3aa78 | |||
1eacbdf374 | |||
492e78e2cf | |||
8b1c691a5e | |||
b02fc1f28b | |||
ecf1fe9aa5 | |||
7e341ed397 | |||
e5e6f82a8e | |||
eca929faef | |||
b027a83789 | |||
1ad0fbdb76 | |||
8f1e6a2fde | |||
451e6be180 | |||
7b869684c6 | |||
0d764f5a3d | |||
899f0c9749 | |||
727aa8e71f | |||
404b7a5493 | |||
befc50ac3a | |||
94c35d395e | |||
7883e5d8ad | |||
97cd184211 | |||
c17ac16728 | |||
b696ab12b8 | |||
e7ccd74a9e | |||
676a3444cd | |||
bd0299f392 | |||
e213317532 | |||
206524b9e6 | |||
7a458e0138 | |||
9db9211ed3 | |||
2ee550bbfd | |||
9029570452 | |||
6af39da61a | |||
ad692b07c3 | |||
3f4809457f | |||
53b85a2bbb | |||
92d2bbc63c | |||
536be73006 | |||
115187204f | |||
b482064a55 | |||
722a50f7be | |||
623213ea0b | |||
0589c4ab6a | |||
46c4a11a7a | |||
16d27dfddb | |||
aee344fe47 | |||
696c77f5c8 | |||
8921914098 | |||
f33574dfbc | |||
e2bc081740 | |||
a6d7f7cac2 | |||
c714112e00 | |||
bae91724a1 | |||
daef6a24d1 | |||
661ebfee94 | |||
73d0e2e7e0 | |||
917cc58560 | |||
1eea80194b | |||
d569217ff5 | |||
d823725eb6 | |||
f08d20560b | |||
c0385466e2 | |||
c22b002226 | |||
9aac1fc47f | |||
39d4fadf90 | |||
4968afb89a | |||
8b45018f28 | |||
007b3bd10b | |||
5e1b7f2ba6 | |||
40820ddea9 | |||
4fbc29158d | |||
6e1115ea03 | |||
d5d1f4a313 | |||
1e65aad95b | |||
495ac17346 | |||
2f82db97ed | |||
35f3d16084 | |||
29dfe240e4 | |||
aa9ca845e8 | |||
05a3831acb | |||
9a7d26cd9e | |||
ab36607a48 | |||
02a810b8d6 | |||
2d1ca5f346 | |||
65aca7d84a | |||
d3a9ce95bc | |||
ee53f056ce | |||
f3defdf3a6 | |||
6d88a13407 | |||
9722bdef75 | |||
f87e41abee | |||
d7c6f8ae3f | |||
4d80f7c41d | |||
de00486b80 | |||
c2664033bc | |||
f96a9f63ea | |||
78b18f2bdb | |||
8bb0753f62 | |||
0c5d1a793c | |||
34692489cb | |||
52b619b38f | |||
9009a864ab | |||
09a8b66d3b | |||
7c6f5e2c37 | |||
930bd91598 | |||
050615f2d2 | |||
05cc4ea36a | |||
4cafc1b776 | |||
fb559434b6 | |||
02493d473f | |||
1abcb5adf5 | |||
1b8703db95 | |||
517a171a6c | |||
b126bf727a | |||
cfc2a43f51 | |||
0477e16860 | |||
cc13bf1049 | |||
a66b4a6f5e | |||
f989758159 | |||
ade8373c0c | |||
fa4ecea095 | |||
7ae9c6d55c | |||
b369d4b9a1 | |||
ea5bb43cf9 | |||
6ea60bc429 | |||
b094278b64 | |||
f21384e499 | |||
620fa9ab54 | |||
d8c83dbb08 | |||
992d1471b8 | |||
27b14aefcd | |||
a7fee6b02f | |||
cea297b69d | |||
c348bfff30 | |||
224c468aa3 | |||
a472aafb3e | |||
b165b9dd4f | |||
7d388e0c79 | |||
4036657e32 | |||
d50c6ee1ce | |||
143f4bef9f | |||
765dc413db | |||
423b0d891c | |||
3db0e9d068 | |||
1f3f9bc341 | |||
e84bfca5a5 | |||
bd488a08f8 | |||
3c6448a717 | |||
0a2dfc719a | |||
f0fc4713d8 | |||
b2132aa975 | |||
7739984c56 | |||
034188b0ee | |||
98ea27ecb0 | |||
8d2a0f764b | |||
6c43e0b946 | |||
77342f8571 | |||
e808b4b45f | |||
86d91cb625 | |||
3f21e59ab4 | |||
3669cac3c9 | |||
b919f5a95b | |||
5e6484ff5a | |||
ecb09aa2e1 | |||
346d4b572b | |||
1a38dfdbde | |||
69f1c8701b | |||
9daf4540de | |||
f447608d6b | |||
001fb54b15 | |||
ffc786d796 | |||
a1649d6cda | |||
541b2cbef0 | |||
5166aa6913 | |||
b88000c349 | |||
49eefe7e78 | |||
bfdac7a8f0 | |||
d9dd77bc6e | |||
e46a342e17 | |||
760607f58a | |||
35b5780907 | |||
51159601b0 | |||
4cb35a2975 | |||
405250ce79 | |||
81b11168c9 | |||
066cdfe2ac | |||
062189b589 | |||
a11d0027ce | |||
c9ae7e811f | |||
47ec246520 | |||
42104cfc4c | |||
1bab9b202f | |||
74ce98f39b | |||
3268effabf | |||
96965647bc | |||
808ab715d9 | |||
fa1e16085b | |||
dd46e56af2 | |||
d8d871745e | |||
09c9e338bc | |||
df9483408d | |||
cb342bfb12 | |||
04266a1180 | |||
86eda5fe65 | |||
bc1fa3bf20 | |||
e63920404c | |||
4833478eee | |||
c8b6850520 | |||
938cbba449 | |||
c8f640f3f2 | |||
2272189955 | |||
736edeeed0 | |||
bf33368add | |||
40d48c969c | |||
17f0dc9ba2 | |||
016d85b169 | |||
2bceabdfa5 | |||
d18c33d6df | |||
e2ca065f28 | |||
fe28501126 | |||
73795d05eb | |||
af846f7e3f | |||
a0374da4f3 | |||
4e44fa009c | |||
3dd2c94f4e | |||
6da8f2bb05 | |||
e21fcb8104 | |||
3c11c13af4 | |||
d3cf7b2202 | |||
03bcdf74a8 | |||
45b90a0dfa | |||
9babfcb9b6 | |||
1b2a4f00f2 | |||
90b5acfca6 | |||
741f7814c2 | |||
a4ae4941c3 | |||
8a6ef33c4a | |||
5ac2596429 | |||
5dac2e82a7 | |||
8e29acd664 | |||
1d29bc3e8e | |||
dc1ef0c49e | |||
1003455160 | |||
20ae12d385 | |||
dcc686a3a7 | |||
89c27c112a | |||
3621fe8897 | |||
33269cd29d | |||
1970dab13d | |||
a5390b1bc8 | |||
864e33cf2d | |||
b9bf6d1242 | |||
caad356b93 | |||
964c235ecf | |||
c881094202 | |||
6051c973d3 | |||
1f9717250c | |||
8ebbbc33cc | |||
98bcff1928 | |||
cef708c8ad | |||
a925e2d783 | |||
a1193f0e30 | |||
f209037efe | |||
b99dd7d916 | |||
aad21cf395 | |||
d537428421 | |||
996589894d | |||
d3777b3eb4 | |||
52e1f5502d | |||
664a128e9e | |||
666d44b14a | |||
b533c300d8 | |||
78d223d709 | |||
2b0127c26d | |||
16a3c14c53 | |||
c65391a344 | |||
fbf4ae823b | |||
3d6d9c5808 | |||
64c533c189 | |||
7fd78a87d1 | |||
b9f60fc3c2 | |||
afa01074c5 | |||
1f85b0402e | |||
b3314cd34f | |||
9428fc53f6 | |||
0d05e4bcae | |||
87da45b3f5 | |||
cbf174f96d | |||
0aa78d0ecb | |||
a87d4f1864 | |||
c0e86de6db | |||
60fa07bff2 | |||
1df7f21f5f | |||
674edab814 | |||
369df245e3 | |||
1f2e94a51d | |||
3f32cffc40 | |||
3914964a35 | |||
bedf63e257 | |||
d151d731a6 | |||
2d862f1d32 | |||
f92fca03a0 | |||
b5c01999b8 | |||
e9da35bac3 | |||
d3a7468e83 | |||
f3540a5c7c | |||
8cf6808c50 | |||
274db26339 | |||
490b9c4d79 | |||
2da096944d | |||
83f830618f | |||
cdbb86b830 | |||
483b47474d | |||
1d314858ef | |||
37d4e83fad | |||
c7f3f3add9 | |||
1c7baa544b | |||
3408839b33 | |||
a7409486bb | |||
cf24ed4108 | |||
8a379ba0a1 | |||
4b20638568 | |||
eebe2046f0 | |||
1e457dbd76 | |||
a20aebaaf8 | |||
5463c70aaf | |||
24e30a684b | |||
05e52493a4 | |||
d8f1e01b77 | |||
da5b11bf2d | |||
b824ea7bcf | |||
b96ea5ae03 | |||
fbd3e10488 | |||
51f0882849 | |||
416068f68e | |||
a8db4a8d2d | |||
6b49148d4e | |||
77e59818a3 | |||
6262374205 | |||
ed8271530f | |||
8e4d7c56d8 | |||
0598315d68 | |||
05e5d08959 | |||
ca33eaf28d | |||
13e86fdb6c | |||
ffbd18f4ef | |||
fabb0f734a | |||
1e59d92df3 | |||
ecd09946e6 | |||
789b8b8454 | |||
f107a71796 | |||
066b4c27a4 | |||
fbfa99fac5 | |||
c5bd21a23e | |||
1c7e1da4d1 | |||
5cec5fe6b1 | |||
ea0961dfd2 | |||
f20905b08a | |||
83e79e1a1b | |||
c6a7b5774c | |||
27ab88db1e | |||
1b71b6d01a | |||
dcb3d49d35 | |||
5c14a072d5 | |||
4eb491065b | |||
b87e8d8e41 | |||
a58f11e601 | |||
547f39bb49 | |||
df99f5e3f3 | |||
15e88a8b7e | |||
61b72d42b8 | |||
56bf504ec2 | |||
1f02250dd8 | |||
5d0c6db19c | |||
4af3467757 | |||
87890565f3 | |||
d603a73715 | |||
55b0555aa0 | |||
1a2378a3d4 | |||
c6ce6b46ce | |||
f109f2e612 | |||
8f8e3f4960 | |||
1d885cf810 | |||
5275a34b0b | |||
c3b5c45fea | |||
565a686be7 | |||
12cfb6501d | |||
de1b54821e | |||
320c8429c2 | |||
a4e24c8390 | |||
0589964f99 | |||
1affb6814c | |||
b70ab0d354 | |||
4a9266feef | |||
1e0a930d23 | |||
46d3780e89 | |||
311c98e24e | |||
9ad8dd3700 | |||
0dc476518b | |||
8c8a3c58ec | |||
a0ac4a744e | |||
3448e6fc76 | |||
e5c7366e71 | |||
e236d6f743 | |||
5db0d9438c | |||
08e06f9b8f | |||
018fe04163 | |||
f21ecb3762 | |||
60de5ed3dd | |||
df4b1e9b12 | |||
c3d3605f70 | |||
a9003d16f2 | |||
84619a7788 | |||
db127887b6 | |||
e0588b89b2 | |||
7d2eceef01 | |||
e5e444c7ae | |||
4b083b8c41 | |||
245d92b40c | |||
931ad1aca8 | |||
5e488d3aa0 | |||
cc52835ce3 | |||
7d11522768 | |||
417cdc17dc | |||
c537955c65 | |||
a0efea8e0f | |||
cce51cea5d | |||
df346a6df6 | |||
ba4324f992 | |||
81e982991b | |||
f6f4fba90e | |||
23d5a972ba | |||
cdc6c42375 | |||
d5b9a54c55 | |||
59da359b06 | |||
91ce4c4ea6 | |||
e9656ecf11 | |||
5c6bf9d0a4 | |||
0de194dab3 | |||
33bb61c63d | |||
5faf0f8ab6 | |||
0f17cd4791 | |||
e0518ab176 | |||
e6273b3300 | |||
d7b31fe014 | |||
5aae5f95bf | |||
bba1324145 | |||
182561f7e6 | |||
41871c8b1e | |||
ff655292fb | |||
782b75a64e | |||
0c58901469 | |||
73b23f1b16 | |||
5a29f9ba2d | |||
03190c5a55 | |||
dab968ed96 | |||
b598263261 | |||
eef70e198b | |||
89c41f88a4 | |||
53b7c8f725 | |||
d471142908 | |||
3ff9ffd5d4 | |||
2558bd1b9b | |||
95d0944b9f | |||
6e72b6fb37 | |||
0c9be4de14 | |||
b53b7f4950 | |||
b2f0b35608 | |||
cba7a5d4d7 | |||
8e1a88c2fb | |||
ee5a988f14 | |||
f814a07ab3 | |||
a5aea2f3bb | |||
7291ac2093 | |||
790fe50fac | |||
83eacdfada | |||
2fbeaaf148 | |||
57710cbc38 | |||
8bae0acaf9 | |||
ef64e6a336 | |||
9642ff5fb9 | |||
263798d1c3 | |||
3fbfad5585 | |||
627533cf48 | |||
19899de5a6 | |||
c1b2c7903c | |||
28df0c2e38 | |||
7696d45093 | |||
2a7d4fcde5 | |||
3b94ef99ae | |||
6267c67888 | |||
23d6a3aacd | |||
72361fb1c8 | |||
b55f98b813 | |||
995fa4a76c | |||
d8597884f6 | |||
a993ddc54d | |||
54e25084fe | |||
e58a0b3efb | |||
381f15382c | |||
5a4d681af8 | |||
a16a0a8ce5 | |||
91d679af15 | |||
8396f16dd2 | |||
203df51752 | |||
dc19deb6c3 | |||
86abd31659 | |||
b8e70d866a | |||
e1e27eb19d | |||
47b4efd49b | |||
088dab4f04 | |||
cc79ec6179 | |||
74478b24b0 | |||
14fab11081 | |||
4c55f3eaa5 | |||
bad95d7c67 | |||
891bf99894 | |||
22e95b3bcb | |||
4da315fab2 | |||
507ba7d26a | |||
68ac884d47 | |||
e2f3996843 | |||
57ade250af | |||
c3e0f262d1 | |||
b9911d0db7 | |||
d1b780c7be | |||
1711cced3e | |||
63e6693255 | |||
9b8d191bb1 | |||
6db2b8c66d | |||
47a08ccbd4 | |||
7fc78129f4 | |||
c4504fd3ff | |||
e4799ff8c4 | |||
f680924585 | |||
b0d222768a | |||
4303c43db7 | |||
3b3e6d2bfc | |||
7061f13b24 | |||
5175636d36 | |||
570032484f | |||
9c37fc1a5f | |||
105023bd87 | |||
8a9669f130 | |||
e5bd230fb0 | |||
e3d47e588a | |||
f4a5abeed9 | |||
a7e38d2b00 | |||
84ba396ed3 | |||
6683280a37 | |||
1edf680464 | |||
4df090469a | |||
3c63f58532 | |||
64c8171e13 | |||
b6175bd408 | |||
b44bd19c53 | |||
536bc59abb | |||
70d5da1e2a | |||
90d4d79828 | |||
ccc9be2d4d | |||
3341c4a670 | |||
bcb9df9cdf | |||
2eef9d22e6 | |||
5e35346f17 | |||
bb53ee9567 | |||
9934a856dd | |||
24904c5083 | |||
6ce4663a31 | |||
fbf74d3baa | |||
b540181990 | |||
02a6b15e6b | |||
b34aa10bf8 | |||
e0ddbc2f28 | |||
ed2024285d | |||
ae2120eb96 | |||
3ceb2257e5 | |||
624efde7e4 | |||
50009fef6f | |||
de127056c2 | |||
dde937e197 | |||
07a480b37a | |||
9f5bccec30 | |||
ade52bf81e | |||
71c766a3b2 | |||
eef66aee9a | |||
e245eb1eb5 | |||
e08fc81397 | |||
9f9032ae36 | |||
063a16fcd6 | |||
0db4151492 | |||
e44d7a553f | |||
53a2de98de | |||
2deaaeef28 | |||
1f9e16f63e | |||
87fe69c27c | |||
2d1eeda188 | |||
5c06d40358 | |||
31e193756d | |||
5aa744db84 | |||
0ad82dad80 | |||
99c36ed2f2 | |||
44878e583a | |||
0723a85ab3 | |||
d8dae365f6 | |||
bccb86a401 | |||
592e743349 | |||
fb6161e9ac | |||
787277d282 | |||
540ee69773 | |||
0d2c87fe4e | |||
2460de9713 | |||
0d32f42d26 | |||
277497684e | |||
f4a83e516c | |||
d2eb1ed9a5 | |||
a3ec5846df | |||
b6047899a8 | |||
3516070b6e | |||
56ec87e00e | |||
fe0b896665 | |||
e4721417e6 | |||
45f5b3b648 | |||
3123102211 | |||
c6141ffbc7 | |||
c0e92d06a5 | |||
274b2682d6 | |||
171d661b84 | |||
5cea8da664 | |||
44dd52d08f | |||
70648d006d | |||
0767ea5d69 | |||
43e6a9e9ee | |||
0599c1710b | |||
abf218a9cd | |||
55f4f9aaeb | |||
82b7e1dbcb | |||
e8f8b0f8e5 | |||
7566d4fbab | |||
3a0d385119 | |||
8454a14eac | |||
ecee310087 | |||
bcdab95e4c | |||
a16377cea5 | |||
ef69f1bb27 | |||
27c8eb0d6d | |||
a465afa83d | |||
3c0f54257b | |||
185e90c40f | |||
e29c2d0260 | |||
acf6425ae9 | |||
5e8d49de0f | |||
1f9456a462 | |||
a7d8285c3a | |||
5f1dc4b851 | |||
b1c22949c5 | |||
29be175743 | |||
b6c5ba264b | |||
8e7e3c2b11 | |||
0e7df129d8 | |||
50709cbd21 | |||
fd6e8d8c5c | |||
2e7496130c | |||
9666ab5797 | |||
e6ead35884 | |||
a6dff8ff2f | |||
4281b6b448 | |||
4c08ac7873 | |||
5435ec7545 | |||
6897f602bf | |||
8764d50179 | |||
075321fd0d | |||
62cdb8dc94 | |||
5e8e935189 | |||
ebb5f1256f | |||
7c6d0d3c0f | |||
9918a1092f | |||
7d89511fda | |||
795b6d13d1 | |||
8328b6f657 | |||
9994e591bd | |||
b27a38e55e | |||
f6d747a5a0 | |||
b7da7574d1 | |||
dbad9585cd | |||
2d7a97bb94 | |||
da19da0360 | |||
ee7361ee2e | |||
6e3e09bed4 | |||
86762d2b40 | |||
ef12c5af99 | |||
933404b1dd | |||
ccec49e444 | |||
e5f1bf81f7 | |||
0e627f4f68 | |||
d33f7d2bf5 | |||
e07a019615 | |||
34ca3012e6 | |||
62634ca2da | |||
846c96e8d5 | |||
63775723c1 | |||
2f7d3e655a | |||
b19634d7e4 | |||
a92967a7c1 | |||
8915b88de5 | |||
7bca81464b | |||
b974ece24f | |||
b1c8e6ad59 | |||
64f7185e3a | |||
807cc9afc3 | |||
0adf306dd4 | |||
db0f602e86 | |||
17ec47f5c0 | |||
cf831d9cd3 | |||
5e3c633f74 | |||
4e4b27b6ab | |||
c0c9590904 | |||
24c9577e39 | |||
59ee0cfe88 | |||
1977b9b764 | |||
6f9d1fc14c | |||
1b6b38e395 | |||
8ac59ae2be | |||
46db37e06c | |||
9d1207b339 | |||
6e730cfad1 | |||
1cf953c046 | |||
e5bf4565da | |||
ddc904a502 | |||
5cda292d15 | |||
e51cf0d4d2 | |||
d8de837c60 | |||
199b3345a0 | |||
b7f504b8a4 | |||
1b459b0560 | |||
40803a4dc1 | |||
6f22570648 | |||
8203547cfc | |||
dad160209e | |||
8faaaec710 | |||
012fba617d | |||
9ca495229b | |||
e63f624d3a | |||
e1dd413266 | |||
b9ef09dd58 | |||
990333e7ec | |||
ec9582f3f2 | |||
ea65386e15 | |||
ca89695270 | |||
a0fd4ad23f | |||
b6d7a95028 | |||
91b16310ea | |||
609873e6d1 | |||
4c616621c2 | |||
05470bf202 | |||
633cf9ec04 | |||
f3c3a90393 | |||
25a48f2f44 | |||
1d8f3cee62 | |||
5ba6e21967 | |||
52f7f6e6cf | |||
9fd5ec673b | |||
e905b3c963 | |||
d214a5437f | |||
f12370c348 | |||
b727e2a67a | |||
8e87319925 | |||
1ab29b1ab0 | |||
de0a5aa840 | |||
52d55e34e6 | |||
c79360f58b | |||
6f9e3e3b78 | |||
5c5e7fc7ff | |||
43e98930e9 | |||
51ebefc3ab | |||
86add4a6d3 | |||
221a3f9a08 | |||
2f74bd5150 | |||
e8ae333443 | |||
8057c826bc | |||
6f6138c500 | |||
52a166a71f | |||
903a18db1d | |||
0731f3f1a9 | |||
37047a39f9 | |||
91d0cbe892 | |||
b66431bc29 | |||
0e18b14087 | |||
31bd413166 | |||
95a6fce2b4 | |||
0b5472f9fb | |||
5280d28505 | |||
67a9898a99 | |||
509da3ac34 | |||
fe8815f80f | |||
3a21fdc304 | |||
83d723eb79 | |||
6e771607c0 | |||
e73b220104 | |||
5c1fc43610 | |||
cfbd7e3bf5 | |||
c8ca1cfa3c | |||
5cfbb0a423 | |||
900ec143a8 | |||
7bda3d0f74 | |||
7650786fb5 | |||
ca60d08621 | |||
b34218c8c2 | |||
b14a59629c | |||
fe18579061 | |||
0914bf8cf0 | |||
7bdca83de3 | |||
846f03504e | |||
01e8fd0b07 | |||
7f301c44b7 | |||
51a25fdec9 | |||
2b681c37ac | |||
cb4ebfdbd2 | |||
206c85222c | |||
18071e038e | |||
39f7ce15ad | |||
e39b42bbd3 | |||
607d8f72e8 | |||
c483f75fb4 | |||
81f0175251 | |||
f753519729 | |||
f39693f97e | |||
f83ae0e39e | |||
521d371b5d | |||
b23d551d00 | |||
1b20cc6075 | |||
2043e12ac2 | |||
9461bc948f | |||
9740ab8bd6 | |||
6947a6b1d4 | |||
4da8036222 | |||
e6b4006c70 | |||
8f5f7f1baa | |||
573d3eea87 | |||
2ec53df7ab | |||
eb84eec0f4 | |||
1c7b553331 | |||
d7a31088ba | |||
a028e04ab9 | |||
a0fb519696 | |||
83e6864b78 | |||
a0520536df | |||
af137fd5d3 | |||
f7bc9f01c9 | |||
e4ce1ffd85 | |||
2384b49156 | |||
f5e71f64ed | |||
927ef22cf8 | |||
b6eaec1278 | |||
c7d1eb71da | |||
98af3c0dc1 | |||
7d41d267a3 | |||
0ead65ad2d | |||
8c5481a3d5 | |||
741258051e | |||
0f4fc8635b | |||
d02d3f72fe | |||
710b69fc75 | |||
4fae382ffd | |||
68b94a3188 | |||
8e04f83232 | |||
cc9fd9f8ce | |||
1e8fcf1344 | |||
809c8305b1 | |||
652c7e8f37 | |||
beebca98fe | |||
5341c216a7 | |||
96a0c3d764 | |||
783b49e383 | |||
ce67abc32f | |||
d4dc983a01 | |||
72ccd1020a | |||
6a9a577c59 | |||
730305ecc7 | |||
f8f2432ece | |||
55087521f6 | |||
760ae07d72 | |||
52cc482521 | |||
28d0070ce2 | |||
ad2a7c2590 | |||
5eacad444d | |||
8b97755fc5 | |||
e8155cbbeb | |||
7bb0d9be1b | |||
6c44fcc290 | |||
c8e7031198 | |||
fb3b2820b5 | |||
663376e385 | |||
3c590994db | |||
14c8564893 | |||
91a37f8868 | |||
c83a4aef55 | |||
af7a70bf02 | |||
1a2ff884b3 | |||
4d70640a15 | |||
b11627a8bc | |||
7436f85ad0 | |||
237c379866 | |||
aca31c7055 | |||
0298719be0 | |||
d0746da5e2 | |||
5b1cf33b1b | |||
6073e7972f | |||
f7e8d8f1dd | |||
54a1bbd016 | |||
87016ae815 | |||
455cd5551b | |||
3ed8e46782 | |||
b3e1783658 | |||
906c83af83 | |||
3db0197865 | |||
f9900cc6fb | |||
6174c0c103 | |||
8898cb342b | |||
9cc76d1115 | |||
5289d3327c | |||
00fb9c475e | |||
3c776675b3 | |||
37d508ab96 | |||
f4f8fef82e | |||
cd2e3c79f2 | |||
7722350178 | |||
a77b4ecddb | |||
818b7e4a2e | |||
00d63f6046 | |||
639fc60257 | |||
21467596bc | |||
75ebe5172f | |||
4a9030b4a0 | |||
fdc708a624 | |||
8e20187d8c | |||
28dac7ff0e | |||
e385b3d377 | |||
7e5c68c553 | |||
39ad7bc741 | |||
c2f9aab068 | |||
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 | |||
7e105343e2 | |||
fe2215df00 | |||
80124bb753 | |||
640bbaabbf | |||
da2965cb4e | |||
861a319014 | |||
d43e810ecb | |||
94ba242c33 | |||
7afcc17024 | |||
2ab2f68725 | |||
debd5a5c5e | |||
98bbb84a63 | |||
90872c906f | |||
bdc2ec1f5e | |||
692733fffb | |||
9d908a11ed | |||
d3728d5859 | |||
389331ca29 | |||
b2c4b7e99f | |||
fee6aae442 | |||
409406d114 | |||
203414910f | |||
ac0082a67e | |||
9ccbe85923 | |||
dffbd2113a | |||
7db073d993 | |||
3c02c2e4bd | |||
a17c760181 | |||
54d2fa65dd | |||
a019c3dd5d | |||
a3ef9b8a15 | |||
4d599e2f9f | |||
d3b33e5512 | |||
c8487cc395 | |||
0b3b5f6174 | |||
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 | |||
e75a093a8c | |||
dcffb042ff | |||
d724af6a99 | |||
b30f423fc9 | |||
1fc14292fe | |||
fa7e7fc6f9 | |||
5b114791e5 | |||
9bc11a369c | |||
ac40f2191c | |||
62a93c58fd | |||
65b0030342 | |||
f302fac423 | |||
f94aea8119 | |||
28cb40529d | |||
37ae3b2b80 | |||
73e4286fbf | |||
4e6151ebd9 | |||
fc225401a5 | |||
d74817f79f | |||
bdcdccfcc3 | |||
352ec3430f | |||
978d2fcb56 | |||
52264d5e28 | |||
17fbb020e7 | |||
f8005b88ad | |||
0faa655b83 | |||
6fddf31db3 | |||
01257a461e | |||
817b9d012e | |||
04b3525e0f | |||
d55c732e19 | |||
d223427e22 | |||
64856adc3c | |||
7c53adbcfe | |||
dce9cb27c1 | |||
4199c56e99 | |||
9681fedbb4 | |||
b6d97af451 | |||
a9ca26c698 | |||
9463d4abe4 | |||
b9975845ff | |||
b22405b64b | |||
62210e57f1 | |||
4dd093efc9 | |||
91a22a686a | |||
a307dff3b7 | |||
20f0bed2f6 | |||
46a7a2be2e | |||
8199dbd0dc | |||
dfe426e4e0 | |||
3ace61ef85 | |||
442595d6fc | |||
be469f4dd0 | |||
7da4b0af15 | |||
2fff651378 | |||
c24d16e62e | |||
c36c92e077 | |||
c0efba79c7 | |||
5809941ae9 | |||
535ba8a207 | |||
43331d3fe8 | |||
9765ba334a | |||
0cd01b6ff8 | |||
5f85e33510 | |||
22301a4599 | |||
c8a907fd71 | |||
d01b1ffde5 | |||
f4e993c814 | |||
91c8e82c42 | |||
776ff46db7 | |||
9001ab5858 | |||
1debe2292d | |||
6a2ba4baca | |||
836d897aec | |||
740b0fbbf6 | |||
92e716d93d | |||
c7115a0671 | |||
020bbed935 | |||
0c60963a94 | |||
d704f5f2d2 | |||
381bbb0e5e | |||
0ebd19c14a | |||
d4160afac8 | |||
fffb037873 | |||
1df5d0453d | |||
19d453cb90 | |||
6e7437a0d0 | |||
caf849fcba | |||
7533d244a9 | |||
0a52840fa3 | |||
a7d0905b74 | |||
05bfafbce8 | |||
d32a26f780 | |||
42ec780a6f | |||
4608880fb0 | |||
7492e2789f | |||
9564a8eaf6 | |||
f12c0e79c9 | |||
e4e0be979e | |||
86637cda9f | |||
94f41e2332 | |||
3d2a50f811 | |||
c2ffbb8627 | |||
54218f6c3c | |||
6fdbdf9272 | |||
3de7691af3 | |||
bbed93bcf4 | |||
8900b30b6e | |||
ae4fb799e4 | |||
3f1d1fb3c3 | |||
f0a23ae0ea | |||
c14f9cc247 | |||
e276b6463e | |||
9da7967197 | |||
74f2b78c04 | |||
2021f8cb5f | |||
40a9ebd078 | |||
8c1b73b29c | |||
6679a55693 | |||
1101c1d919 | |||
fcb529b348 | |||
680b1ca208 | |||
af74fe1711 | |||
494cf4049e | |||
c908b9f67a | |||
209f6d9d2d | |||
916077012e | |||
beb170e4fb | |||
a59912f3af | |||
610e594a50 | |||
b4e2547052 | |||
a9778549f2 | |||
b601041b5b | |||
0945d6ec0d | |||
78d9cee416 | |||
bbdb2aa672 | |||
574b24c082 | |||
874a187c7f | |||
e8fb443313 | |||
57b96af2c4 | |||
e61d4ab67a | |||
2ee358dbfc | |||
e3bb67d188 | |||
2d289a3308 | |||
bdb2cc7c85 | |||
7793060723 | |||
84302ae9c7 | |||
cd801b96fa | |||
5ff0653f9e | |||
9574d635c1 | |||
1bec8ddce4 | |||
f9b07c63db | |||
8828fc7520 | |||
978d8fcd4a | |||
51aadcf901 | |||
db952a050a | |||
f049740ae5 | |||
73ca9b6373 | |||
c6949aad2d | |||
e57d0fdccc | |||
82f383be43 | |||
26aaf253ac | |||
51715376bf | |||
ff95b0278c | |||
fe1fa20c6c | |||
a867fe404b | |||
d6e8a5f3ca | |||
4878d8ec15 | |||
f7019d9e80 | |||
6d8e1e8783 | |||
939ab43ceb | |||
d3d58ba8a7 | |||
f03fd57997 | |||
e74cd4b4ef | |||
f3dfd63634 | |||
5f5302e595 | |||
125ec622ca | |||
384e5b66de | |||
7e7723e98f | |||
4419734a7d | |||
f821db29f3 | |||
6c64f1816d | |||
34e2ad0dfc | |||
055b99c3cb | |||
531842dc6b | |||
d7f3c33d72 | |||
4e689998f9 | |||
cd2a4b709c | |||
d96aeac335 | |||
c594351bcc | |||
5f976d7430 | |||
f87326fc21 | |||
0574a70fac | |||
4e79804cd3 | |||
86d5264167 | |||
5bc4399a58 | |||
406bcf7d3f | |||
f17cc1c6d8 | |||
57077e4607 | |||
6304c85d3f | |||
a1992d76f2 | |||
98b07f7f3c | |||
6e1823ac81 | |||
640cc22749 | |||
9bab49d2f9 | |||
2751a6d56d | |||
07cb62a503 | |||
8a3b698407 | |||
0c71d658fb | |||
7e2d614975 | |||
09e4ab9aa1 | |||
2e1bc6e500 | |||
1aea096b63 | |||
30694f0b20 | |||
01b4cb64ee | |||
6fbd15f8b2 | |||
65c07afe05 | |||
e338c5f91d | |||
0b0b5da240 | |||
9c7ee5a21e | |||
f7b3ffe8a0 | |||
381857ea49 | |||
50aef368f6 | |||
a9c4ce38f0 | |||
bbc39d7648 | |||
d3e8e9629b | |||
1f0b3a32d5 | |||
0608704626 | |||
cb8e7b4d5e | |||
346fa4d7f4 | |||
7a22f01dd8 | |||
4704d115c4 | |||
12c621c230 | |||
cba65d897a | |||
e4a10cc510 | |||
249c27afd5 | |||
38cc89b2ca | |||
aeb1794be1 | |||
dae728124e | |||
cf30b1fcdf | |||
19bfef36f1 | |||
8d9464c414 | |||
ada611d597 | |||
f13886d343 | |||
520b0601db | |||
926ecf9640 | |||
c57198decd | |||
431716e249 | |||
694709f392 | |||
16613ab5fb | |||
c26bf45e28 | |||
23e5c7b38d | |||
382dd82eb6 | |||
f18d5b2efe | |||
0fb22df633 | |||
750e36993f | |||
f7f658605d | |||
192e5dbff8 | |||
ef224c3547 | |||
c12b68a6b2 | |||
4166d8ca35 | |||
53e7e950f1 | |||
0612879dec | |||
3b21f946e4 | |||
9f85371073 | |||
cb550ab4fe | |||
b8cbf08617 | |||
1613f42d00 | |||
e5d1243dd2 | |||
7fc9094d8e | |||
92c7070aa8 | |||
b68bca35db | |||
d97adc8789 | |||
f5014d7d71 | |||
4e88c80a22 | |||
a6203ed038 | |||
1db547d607 | |||
2cc4dc5a6f | |||
fac7dc9c91 | |||
508fa6a7fe | |||
71bdaa9508 | |||
459f1e7bfb | |||
0d8b8d8426 | |||
2d0dc62a53 | |||
0d8e134f9f | |||
c7d370c17f | |||
395d8b3139 | |||
b92ef67e56 | |||
5a8aa66641 | |||
e87ef18826 | |||
7b78d4f11f | |||
65ac61b2ea | |||
629a3a2a24 | |||
ee4783e3fb | |||
f2c69ede96 | |||
ceeb35eaac | |||
099bedd2e9 | |||
4177a11522 | |||
3d4a1b575e | |||
b1d60df44c | |||
7cf70d111a | |||
e564c56dce | |||
239c2540d6 | |||
c53d140145 | |||
12a6a2f2d2 | |||
9c903567bb | |||
6782dee64a | |||
302c15140e | |||
c666f92e35 | |||
eb42ef68ee | |||
52916eebcf | |||
f8014413a3 | |||
2d858b05ac | |||
b1fb020aea | |||
02ed84774c | |||
283e8d5bc0 | |||
f39e2e2a53 | |||
5bf5d5e9cb | |||
e51e212b95 | |||
6418d02572 | |||
49fa30d495 | |||
dd8b03a5c5 | |||
4d5983114c | |||
0a9c3b5571 | |||
180049a277 | |||
6ee201865b | |||
b1d94c9f93 | |||
a156a4dbe2 | |||
2cebe7a5e0 | |||
9cfc109527 | |||
64758c46b6 | |||
4352202349 | |||
ba07a60c44 | |||
72bfe0953a | |||
bab5647522 | |||
fcaf1d89c2 | |||
106dff0d53 | |||
174ba8884e | |||
1ce0dcf0ea | |||
1387e15c1b | |||
50e7ea088b | |||
59b7cbb591 | |||
23fe8975e7 | |||
a4bc40542b | |||
ee1dc16e8f | |||
1c04cc0485 | |||
2c682b4d1c | |||
6842490c1f | |||
ff5e22031a | |||
e3cf756785 | |||
7e6598e9ca | |||
48d2017629 | |||
e4823381c6 | |||
66feaeb519 | |||
8c6b833fb3 | |||
b62296a40b | |||
fc7728212f | |||
31785f7f6e | |||
ae65eb5105 | |||
727ccb1125 | |||
77ce238457 | |||
1685659e37 | |||
0f03d4ef51 | |||
bcf697cc2b | |||
5e2ea4a81a | |||
b9e1d53d7a | |||
ab0806a036 | |||
3a1ec07db0 | |||
d939d8d21d | |||
d9552fb120 | |||
4ecc0c59ca | |||
0655a1fcbe | |||
c8d0cf2c40 | |||
c692f2e740 | |||
a83c7c0d07 | |||
ba6fd16823 | |||
54893c35c1 | |||
495c5ce81d | |||
4cc773ec1b | |||
69ae35494e | |||
512c3af4ea | |||
d8f1c3dff7 | |||
0a11dd2d24 | |||
78ee7f6573 | |||
dab0fb9e05 | |||
e14d5d49a1 | |||
782b2b1514 | |||
a9582417e2 | |||
69922b6c39 | |||
6fc70f7c16 | |||
a274e774ee | |||
f23a43fb81 | |||
88997a0314 | |||
d2415dee00 | |||
53728b79b4 | |||
dff8c02cfe | |||
640ad577d1 | |||
cd63ecd3f3 | |||
f18158a52d | |||
84748aab51 | |||
3fadc64ee0 | |||
47594f7c99 | |||
2f20258807 | |||
47122a3804 | |||
1730f8f5b7 | |||
d258a75cd3 | |||
baa10c2995 | |||
207d6572e0 | |||
10264cec2f | |||
0ea1749c59 | |||
dd83c680e5 | |||
1a40f35fd4 | |||
8a99113c88 | |||
ada2ea3a6b | |||
355cce3938 | |||
9b2e08dd09 | |||
04cee3b8d3 | |||
c61440efea | |||
02d18af57d | |||
2225bb093a | |||
75a6a7baca | |||
6b130e8311 | |||
1b18923824 | |||
fc2ce439e2 | |||
5b3d9f9184 | |||
dd68c207f4 | |||
9a3c34b5b3 | |||
951d911531 | |||
4f2179b0df | |||
9b287392a4 | |||
aa06470cb6 | |||
d7b4f24a7a | |||
e8d11eb5c5 | |||
7f4da08ff7 | |||
1f9414a30f | |||
6015b529a0 | |||
76452b4e28 | |||
64b7d9ef82 | |||
7bc9666aac | |||
2a4a50b1da | |||
2ec88e8008 | |||
36049a940c | |||
952834f7f3 | |||
f9a9c2d009 | |||
fb71a6e2b4 | |||
5e6a2a17b0 | |||
92289c1981 | |||
99e2098a48 | |||
5fc1c1de28 | |||
2fac693243 | |||
e9b956ed71 | |||
236a952458 | |||
426b7c2c76 | |||
22780a8504 | |||
a437fd420c | |||
2d74c60d47 | |||
ceee56af51 | |||
d297d8fe2e | |||
f479b76772 | |||
73f7088b45 | |||
b3dd5c0e3a | |||
ee7ee22555 | |||
cf49e511a5 | |||
505b9c7f56 | |||
8c30b2b9f5 | |||
b9c1407013 | |||
d905607353 | |||
e5e90b1f71 | |||
d5ed025871 | |||
b55422a528 | |||
909a14fb48 | |||
107e3e4106 | |||
6ef247fb93 | |||
b8e46b835b | |||
0900fee5d9 | |||
1f26cb98de | |||
ceeb8ee0bc | |||
54c47a1e03 | |||
6bb855873d | |||
39db45e144 | |||
41c187ba12 | |||
d7c99728bc | |||
8e19188f49 | |||
625e3e8e25 | |||
fde99e2fcf | |||
132643cd4a | |||
faf7b81c01 | |||
bcc6799902 | |||
718e1d6c08 | |||
a9ce773584 | |||
d69bc4fb5e | |||
1b68d6dbdc | |||
62578a2162 | |||
9e80db0fd1 | |||
e8ab6adf89 | |||
7c184cf991 | |||
72def658d0 | |||
e7cd888c7d | |||
1205578935 | |||
4e77365e8d | |||
4f2a779769 | |||
cafbe44dde | |||
6234bfd8bf | |||
77796caba6 | |||
97f1d7ae2e | |||
487e89d4d0 | |||
fe5257df81 | |||
9161424c97 | |||
cdda0dd043 | |||
f4feccc626 | |||
44cb2f4efd | |||
cacb8fae0d | |||
fa99a5cf12 | |||
e700165eba | |||
8542ee59db | |||
76108671f6 | |||
8b0ce1cc00 | |||
0e88c73f68 | |||
ba0d73d102 | |||
d3ecd1d670 | |||
f9ae5938d0 | |||
a8ced184dc | |||
e7a2c6ecef | |||
a376bcc654 | |||
8e1ac9fb0c | |||
bc61357a44 | |||
f6d92eb737 | |||
48cadcd2fc | |||
bd63a840c7 | |||
aaf597f020 | |||
72bd3064a2 | |||
a1c316b940 | |||
02f84b225c | |||
6551c20005 | |||
a1e94154be | |||
4938e82795 | |||
7a94f63058 | |||
db0edf154c | |||
a1cd94a61d | |||
df48738ac9 | |||
d8f5cfdee4 | |||
95e5345cc3 | |||
ba5d0cc2f9 | |||
1d8ded3293 | |||
2487a8bede | |||
f1c0563c40 | |||
139c4b5633 | |||
645bf4a764 | |||
88a4a3b1ba | |||
6fabaae736 | |||
1b2cfd63e5 | |||
ff2b219abd | |||
33c3af752b | |||
f73a1d2d56 | |||
470ad39d0d | |||
5ad120208f | |||
b48a70db2e | |||
cd050b3423 | |||
eddbc7e757 | |||
8a62ba07e5 | |||
b3298a8f57 | |||
e5284771e4 | |||
5f611dad51 | |||
1c5fdb8a0a | |||
de4b9e9a16 | |||
57b5a33fbb | |||
3f4f7145a3 | |||
b959148447 | |||
855361b5b8 | |||
91c9f4cb20 | |||
e4896b257f | |||
592cac5815 | |||
4244cca48c | |||
179ab5220a | |||
d6bb1b72c3 | |||
3d9a5a4f91 | |||
683ba79ff0 | |||
0c69fc719f | |||
03b48a4ad4 | |||
aa71292265 | |||
d72eee6cf7 | |||
6bb19e7947 | |||
3d2518f799 | |||
5268909075 | |||
c62141fd98 | |||
ae303ee902 | |||
cfe0d0971f | |||
c5c8facc2d | |||
f78d6a8a93 | |||
78ef2c5f16 | |||
ec8e1178e5 | |||
4f3f471b4c | |||
e10325e133 | |||
ef46d3c97d | |||
a9c08c5975 | |||
c467c3b7e4 | |||
cdc0eaec3a | |||
a7cb738175 | |||
d1bb22a583 | |||
553d972de5 | |||
cc883cc3d8 | |||
c6a39ed927 | |||
df30255542 | |||
d5102539dd | |||
e3feaf3f5d | |||
25dc596397 | |||
0daff26fba | |||
94ba5b3fbe | |||
002f9bb105 | |||
e86b1146a6 | |||
d44fb3a2f6 | |||
1ef3069a7e | |||
f99b62c48d | |||
0fd45a640b | |||
0b0d03dbe2 | |||
533baf921f | |||
8e9767f3c6 | |||
27d4bedd73 | |||
c1c26ec73a | |||
8f592ff6e8 | |||
37629aaf87 | |||
d09d193715 | |||
010d0a7d56 | |||
902807ea50 | |||
d0224b3623 | |||
0f3148bda2 | |||
e3b1fc2ac0 | |||
6194d2af3d | |||
db87d95c1d | |||
47166c9614 | |||
ecacdf27a9 | |||
aad6f79efa | |||
0c00b83702 | |||
7320e26730 | |||
1520534660 | |||
6d6719da27 | |||
20085cd15b | |||
9b001823f6 | |||
ed4f84cc57 | |||
c8e66a2b45 | |||
6eb2e3ffa9 | |||
748ad8a978 | |||
d2f897f8de | |||
4b511d80a1 | |||
a74e9e1dd3 | |||
9c1a9f984b | |||
04c7adea07 | |||
5249ce8fb4 | |||
ebd865dbda | |||
d377ef01af | |||
393aa3c527 | |||
d7b6de57c5 | |||
05d4b0cd94 | |||
5dbafc2eeb | |||
a97918f812 | |||
22f86df606 | |||
712e8e828b | |||
7d3846bc49 | |||
9980526aaf | |||
1d2cb867b2 | |||
3859533e73 | |||
7ea7e1898a | |||
5e6a4e5f5e | |||
66dfc33de9 | |||
d56f740dc6 | |||
a109d341ef | |||
87b53d67c5 | |||
a577b8d381 | |||
136fddc7f1 | |||
ce0c87f8ff | |||
d79585d44d | |||
592b628523 | |||
39f886ad88 | |||
1d39be61b2 | |||
2bf9145ae6 | |||
127bcb02ff | |||
4430fc47c6 | |||
2b10a982e9 | |||
31bece7fa0 | |||
4436824faf | |||
dd92f1d03d | |||
b6f87565a9 | |||
0b909997b8 | |||
9d7ff26f25 | |||
06c866ceb4 | |||
fe19ad328c | |||
010dbc8b2b | |||
72653e54f9 | |||
93ec86a26e | |||
10185e92fa | |||
33b94e8478 | |||
2ee53b0e75 | |||
fb00f0f94c | |||
b679ebde3b | |||
f3ca08b0f1 | |||
946e413997 | |||
b475bf4a21 | |||
54fa73844c | |||
32f5a0ab18 | |||
e4135ffb35 | |||
b5b335a6f8 | |||
57ef31d51c | |||
61b413b57f | |||
d2c0203dc9 | |||
afba19e01c | |||
b989c03416 | |||
3361b4030b | |||
bdadd50251 | |||
d01f31197a | |||
8b82f1c609 | |||
de7e8a1ca4 | |||
aa2ee3f7be | |||
af4e79735c | |||
969e09210d | |||
cd7b571da0 | |||
0052877d2f | |||
23bb44f2d6 | |||
16f11e91d1 | |||
4b11566505 | |||
9ae49b5b85 | |||
c95bae2d73 | |||
e4b6611201 | |||
e6840a1863 | |||
78d5f1a803 | |||
42f28bce52 | |||
9a6c3e05ad | |||
cdc289fa9c | |||
672f17c6e9 | |||
723a9a6e9a | |||
59ba7c8bf5 | |||
78d548458b | |||
ac3e883c05 | |||
9ddc2a4331 | |||
435e4c4695 | |||
21f4a97c35 | |||
e0d63c50db | |||
803f74634a | |||
f85a630a64 | |||
43182f8f57 | |||
594cb1fad8 | |||
5eab6c2e5d | |||
3587aa1ea7 | |||
beb642faa5 | |||
31db768e4d | |||
d9e4ba1280 | |||
dcb1233b0d | |||
8a2ff0b31e | |||
be2881ae8d | |||
88cba48f45 | |||
9284e4edfe | |||
62a705af1c | |||
29ec7bf3a2 | |||
fc3f4fb988 | |||
60ff280dcb | |||
b378f5dcd7 | |||
e778d45128 | |||
5e11cf6378 | |||
5dbebc513a | |||
6d5a3cd2e2 | |||
f9ad80aa13 | |||
ed31cb76d6 | |||
eebd271bb1 | |||
ff74ec2482 | |||
49e31ca647 | |||
471108f2e4 | |||
2ceb162df0 | |||
915206405c | |||
5fa1d9796c | |||
77a1dd4737 | |||
9e7c778cc8 | |||
1d775af34a | |||
9f7919f71f | |||
0b3b994241 | |||
bc218f9414 | |||
f102fd7f92 | |||
64774d0d4f | |||
b88f573733 | |||
b211e61671 | |||
871cacf040 | |||
7c3984413e | |||
967ce78a57 | |||
923d3f1fe8 | |||
e11f42a089 | |||
9b8d9b7042 | |||
902e03bccc | |||
ec0e8a9a43 | |||
9e488ce322 | |||
c111bf3080 | |||
8f2a42d1ad | |||
9a475eeff9 | |||
91a37ec639 | |||
db1e2aae41 | |||
4a7c76a11b | |||
f1ed57c62d | |||
3b0969e3a5 | |||
35174a8766 | |||
d79f792e6f | |||
7b231b38b0 | |||
13263b8401 | |||
a604294b1b | |||
89d74cd293 | |||
56e5b34934 | |||
f43365e4ba | |||
4d071081bb | |||
b67b370dba | |||
0995c1dcaa | |||
7612bf3302 | |||
ba158d8dc6 | |||
a90f2249e8 | |||
d8f36db5dd | |||
fd460d93c4 | |||
989cbb4d8d | |||
e9007b1f56 | |||
0fb3d1d582 | |||
81910c1d92 | |||
d150f9b2bd | |||
1346e31a8e | |||
54f25b14ee | |||
0e4d3244b2 | |||
87e3b5f076 | |||
f8e18f2098 | |||
f81c67c0f0 | |||
4f4dd3446c | |||
f149dd9401 | |||
3a730c4a5c | |||
b03247ec3c | |||
8ebb49e972 | |||
84bfec8329 | |||
e1727d6297 | |||
e7bab66d29 | |||
ab25c96821 | |||
c6b0b07605 | |||
b5b583c397 | |||
56d969c709 | |||
3fedf16f35 | |||
5da56776d6 | |||
d58870a92d | |||
15ed7423ac | |||
d7e7ad4f88 | |||
823a1963f6 | |||
6513b21426 | |||
d4321cdd41 | |||
d301540d92 | |||
af5a3376f3 | |||
4aa52ffc77 | |||
47b62ece18 | |||
2aab26a08e | |||
565842b5ec | |||
a064e19b8a | |||
6fb49f68fc | |||
ef7faa7291 | |||
d5528e4e9a | |||
f730f65aaf | |||
dbd577c6b0 | |||
7ebb207005 | |||
e41d71cd19 | |||
0f6c53589e | |||
e2b1a7157e | |||
aaf69d1aff | |||
203b7e17de | |||
18c9dc8a06 | |||
ba07d1f91d | |||
9a2310395d | |||
218ace51a7 | |||
f09eedbd7a | |||
546e8a3b44 | |||
9a2b766aad | |||
24017659df | |||
c175a5fcd7 | |||
5ec8465374 | |||
6b5d6efe6c | |||
5bff70194b | |||
d94d04d7d5 | |||
bf2b9e3692 | |||
c8554504f3 | |||
0d066e3b08 | |||
6b12d86209 | |||
fe530548bb | |||
2eaff6d484 | |||
a54c2b438c | |||
890f6f0d35 | |||
bad4b72f82 | |||
4702c5b4ee | |||
4459d5ad54 | |||
39fb4b1b42 | |||
3864a2e111 | |||
697520f1f5 | |||
244f37179c | |||
4b3a47849d | |||
56faf774ff | |||
fa2bb91ae5 | |||
32478845b2 | |||
44f0e3097e | |||
289917e2b3 | |||
14fcb5867f | |||
cf59362c4a | |||
8472918559 | |||
ae8f51d608 | |||
4a7ee5472d | |||
8718b33a66 | |||
27f1155f1b | |||
84732fcb12 | |||
c6c578ce1d | |||
3c5e28a27d | |||
a39f6e9b4c | |||
adb7a88836 | |||
9892f7bb47 | |||
42ba70e79e | |||
cbaef66e82 | |||
97d915b06c | |||
3a3a23db34 | |||
d159e5ca44 | |||
d3bd10952e | |||
40078a99de | |||
0142c0d339 | |||
2e5de46584 | |||
1be55d6182 | |||
8ebcd44405 | |||
ccdd4ffda7 | |||
a6ed711492 | |||
3fb224cb22 | |||
5ca5af619d | |||
f61c5836b2 | |||
535b33b46e | |||
a8847de910 | |||
2231e878d5 | |||
299a7cab20 | |||
e48d6880c9 | |||
673c0c811e | |||
6e1da35c12 | |||
25f9c294dc | |||
2ea9f516e1 | |||
dbe1461886 | |||
7bea709747 | |||
6536474b94 | |||
ab4021dd0e | |||
1fcbb1fbed | |||
39333c9e8e | |||
1615ef1114 | |||
bf8d71e82c | |||
a4c2740852 | |||
afa1b8cb2d | |||
5447c01e1f | |||
b4bacd50a1 | |||
3c248ec61a | |||
78a8ceda0e | |||
14bf326de2 | |||
dc549b7f3c | |||
456c7ca661 | |||
bab75186f5 | |||
07b2a3818c | |||
15c6e2ec70 | |||
5bd8968eb8 | |||
4ad942522b | |||
b6c99ba3ef | |||
ee5bd57d40 | |||
6445337a32 | |||
f20c7303e8 | |||
c4c8ea62e2 | |||
71aadcbecb | |||
fd71ceeab5 | |||
e26bee45fb | |||
1b10d3413a | |||
f0fcd222a1 | |||
298e4a9f14 | |||
12d32b9311 | |||
226123ca08 | |||
5ebf5077f5 | |||
e1c930f1b7 | |||
c61ca1dea2 | |||
eea712a1ae | |||
1ebfca666d | |||
005b5aacaf | |||
7cf3d2caa1 | |||
e1f9f7b6dc | |||
6b0543ba27 | |||
3d948a930e | |||
6f3595bfd2 | |||
4524899e4d | |||
54206fd44d | |||
6d8c8f9fd1 | |||
00e1b0ed10 | |||
4f8feaa530 | |||
0324e6ca3d | |||
d773ab2806 | |||
8e76363ccf | |||
360c84e035 | |||
4868d21526 | |||
c802811ad2 | |||
5f63d5039b | |||
a454a37a6e | |||
a78d7311a6 | |||
08ff666e99 | |||
0d108d37f6 | |||
cae9041c2a | |||
330a07a554 | |||
7729cbe313 | |||
3e865067be | |||
b03c7b2f30 | |||
1ab9c43135 | |||
efcc24a76b | |||
4762311977 | |||
ab2ccb094a | |||
3c00cd0f88 | |||
a7718bae39 | |||
8ffae313fd | |||
8cced06a2d | |||
965399ba0c | |||
231cc11a62 | |||
1afa9e992c | |||
be543c4039 | |||
7e7462b39e | |||
d2ee37a3e0 | |||
1fcedb8d16 | |||
5c476391da | |||
6cb23e7069 | |||
c976b87ac7 | |||
af2bdfc421 | |||
b01c551197 | |||
df6d3ca66b | |||
5be7374f56 | |||
7300005398 | |||
6cd36edf45 | |||
604a0b1fe6 | |||
046d5bb9ff | |||
0e8442064e | |||
ea1f2762cf | |||
0f3095f130 | |||
7b7ec13349 | |||
7025c7090b | |||
7c12991f57 | |||
f444da80bc | |||
ed58467d12 | |||
c44c3b0530 | |||
46e9c1195c | |||
4730111492 | |||
a813e29491 | |||
344a25c133 | |||
772599a6fc | |||
3a3fe272bb | |||
88e3fe699c | |||
27d997a2e5 | |||
8809c6d122 | |||
6469aa9df9 | |||
ce6b5bc6f5 | |||
4f3775bb86 | |||
2cb760e0ac | |||
8850a8610a | |||
2d6a4e5974 | |||
93b4ac5cb2 | |||
e2509af163 | |||
3f4c166861 | |||
e53f63ca87 | |||
6a50291aa2 | |||
e59ed3e68f | |||
45c4ccb153 | |||
adeb7e7da0 | |||
f1c8706485 | |||
d5f4d381d0 | |||
69c5976775 | |||
988049f39b | |||
6651b8310e | |||
0843ed62fa | |||
d817039f79 | |||
f0794e09b7 | |||
9eaa3756f8 | |||
1eeebba2f7 | |||
2fc3d12fb6 | |||
4fe9a4fe83 | |||
01129d02b3 | |||
e1fbf7b34c | |||
7e90ab3534 | |||
5ee1ccd659 | |||
0b44919ba2 | |||
9f550292fe | |||
5ba7ca91c0 | |||
cc4bacc199 | |||
15c07c58b6 | |||
236fdb450c | |||
7e4b6b594b | |||
eac3667ec1 | |||
e35bca2c3c | |||
46049a1ef6 | |||
1f74dd4589 | |||
40d3993ceb | |||
0564bb3b35 | |||
29711e123f | |||
d3524f3609 | |||
d87f0293e3 | |||
5fadd8bdd2 | |||
3366b53247 | |||
68e549233d | |||
24fce0be86 | |||
740b34124f | |||
15402933bc | |||
8d0b2b781e | |||
83abc00aae | |||
5b6d27e659 | |||
ced8dfc639 | |||
8ef0e4bbaf | |||
0da9a9a3e0 | |||
cba37c6107 | |||
ea1da3321a | |||
34b146f28b | |||
fb46a546db | |||
debc4c45ee | |||
ab9afbc749 | |||
ef87069957 | |||
0d4109a9f1 | |||
16df2c3363 | |||
5ed5b22525 | |||
dccca7df1a | |||
1f6b13b7fd | |||
d23ade879b | |||
8afdb0aa65 | |||
daf8a66ced | |||
20278bb9e4 | |||
c7a4da3dd3 | |||
1908aa55f5 | |||
1c08f5e857 | |||
c9ee8612e4 | |||
a7d988745b | |||
a9f404aac3 | |||
ff9f8b1c2b | |||
b5c86b6ba4 | |||
407ad659ea | |||
f2d2df2b11 | |||
48a374c82c | |||
deee39343e | |||
8a2e8bd585 | |||
43780742b0 | |||
68a966fa55 | |||
43b3ec4b1a | |||
dcf1f70868 | |||
598ca48ed6 | |||
3790ebe77a | |||
d7f2287ce9 | |||
9f717e79ea | |||
26d43c9b06 | |||
8682c90c7d | |||
d063f583ee | |||
eebcf08084 | |||
01aa469591 | |||
4992ac2d9f | |||
412979ba8f | |||
4f8253dcdb | |||
4931e44998 | |||
d1101441b3 | |||
e8f6b4b5d3 | |||
94263ffcc1 | |||
a3bdae9735 | |||
d5e6f59004 | |||
22271f2a49 | |||
8b6d23b9f6 | |||
25056de5d3 | |||
994b25af4e | |||
74afef8eb1 | |||
54489a7f61 | |||
8e3004591b | |||
2ff2a8fd9a | |||
c2a01f6db4 | |||
7a00036954 | |||
914c42537c | |||
cb63babac4 | |||
ac1c127b68 | |||
cb82193333 | |||
f0636ffd4a | |||
51a420671f | |||
77c2bf3ad9 | |||
7223685b96 | |||
e7dff1c785 | |||
a5383d83d8 | |||
a3c7627acf | |||
297b1b4258 | |||
35ac995d05 | |||
6bd5aba4fa | |||
fb5217761b | |||
90f3e94565 | |||
ded5a53a6c | |||
d637988ccf | |||
858e8c5217 | |||
df1ce856c9 | |||
b5e0d014ab | |||
5eaf397a94 | |||
1814016eb7 | |||
6ecb42b031 | |||
584228b2b5 | |||
cd3683f2ba | |||
347ebcd899 | |||
e52c2c41ec | |||
95ff057e04 | |||
60bc291414 | |||
c476285bd6 | |||
63e8ad4cc3 | |||
2cdda38dc4 | |||
ccea3d04d6 | |||
90bd3e07a0 | |||
8e3463d47a | |||
8d594f8b53 | |||
5f4df0c6a9 | |||
0ee4d3554a | |||
0a7a33ef8f | |||
32fa061700 | |||
7036831203 | |||
68b4ca9b31 | |||
0dfc08b317 | |||
77f7dcf40a | |||
9a3c652a51 | |||
6db47de25e | |||
b0d888d235 | |||
af53e63ae2 | |||
35d5ed9c2b | |||
9827b8991d | |||
4dce71879f | |||
727fb197d8 | |||
c2f10a52de | |||
cf2ec0797e | |||
6443049f86 | |||
44bee4e3ff | |||
212a5af9a5 | |||
1cadbfb4d1 | |||
4729fec2eb | |||
f119c4a456 | |||
3e261fb999 | |||
0fd3afe2c8 | |||
9dc507c9ae | |||
5d37eabb59 | |||
169664ffc2 | |||
4c0a7c0fb2 | |||
faa9a06bf5 | |||
183434d30e | |||
c84ce76c59 | |||
1833c61556 | |||
ba78676ace | |||
0d37b7b665 | |||
1254dece5b | |||
b7ebf6edbf | |||
b72847d504 | |||
168b86fdcd | |||
a13f4d8353 | |||
cc808cc2dd | |||
ce001198d8 | |||
c0639ccd37 | |||
58701c1ca8 | |||
402d99ea8d | |||
b08ca49580 | |||
bd15262e54 | |||
3cb2e1197f | |||
7762cd680b | |||
c30f74987f | |||
628ef14d80 | |||
bc48a097f8 | |||
dd21c8a577 | |||
7d906df805 | |||
d166b494ee | |||
81959f14af | |||
2300f3c92b | |||
73fd934fec | |||
a7b635a980 | |||
91b8d6f34f | |||
c9d7845fea | |||
0b0cda2be4 | |||
e1310a764a | |||
dbf3e6c3c9 | |||
dee7f75f7e | |||
774c7e0ea5 | |||
4d498b3765 | |||
bcd05fbdfa | |||
2ba9343607 | |||
8ae07fb9c9 | |||
13682bd919 | |||
b5cab8afaa | |||
c15c9775bd | |||
51cf49a24f | |||
00fd9c3a15 | |||
8007ca56aa | |||
8d7f851b4e | |||
5b13b282ed | |||
d965768004 | |||
a91187e60e | |||
179324e44a | |||
c6dba50e35 | |||
b51d68a419 | |||
a0db48571d | |||
4d7f625aa1 | |||
e2f783ebbd | |||
7a12d8193b | |||
4d9b74b171 | |||
37d139177d | |||
8a7753cfe3 | |||
331382cf2f | |||
98152d974a | |||
56febbf2ba | |||
5cf410490e | |||
404a0bbddd | |||
f057bb63cd | |||
7e6e56e2bc | |||
67cb03742e | |||
a08246ce5d | |||
f54d5e9e8f | |||
91940cbcf5 | |||
77bd8aacd1 | |||
ecc1324bb0 | |||
d3b0081447 | |||
22e44c762b | |||
78e5a00a68 | |||
b9a4d138fc | |||
36a9aff283 | |||
e1755e569e | |||
ae374a78fc | |||
62befe006d | |||
1e6e112806 | |||
830250759c | |||
13100b245c | |||
4929be08f7 | |||
088bbd1c08 | |||
7404eb46c4 | |||
eaf6d6c938 | |||
02d288e9d4 | |||
6f15c4a561 | |||
ae491c277e | |||
ebe7e15475 | |||
dced40361b | |||
faf864b8a2 | |||
8a23d764de | |||
f21af60a13 | |||
10564d8e14 | |||
095aef5f30 | |||
145ac31c8a | |||
b7a5f783ba | |||
3d25a2ea02 | |||
76b785c90f | |||
b3073f44a2 | |||
bcdd158ad8 | |||
693ac4e86c | |||
6320879fe1 | |||
2afe3d89d0 | |||
8a15b42dab | |||
4b9e84f42f | |||
ba87640e4c | |||
a5400e0162 | |||
bdc3b0834b | |||
1a285e5342 | |||
8912515011 | |||
6ec3464ee9 | |||
4b5e43ab0d | |||
a6d9ae3a36 | |||
34e7c8652a | |||
1861f67fa7 | |||
b5e9d3f6f4 | |||
9785fde32a | |||
9657675755 | |||
5d7174b162 | |||
cdb5ceac7b | |||
23391ff9da | |||
3f2b21ce71 | |||
6535730255 | |||
765082fdb6 | |||
aff62e9e10 | |||
2d598dd433 | |||
f86e9b7df2 | |||
898d889537 | |||
0e2964261f | |||
ffe7d8d024 | |||
c01ebbcbde | |||
a6e5914aa7 | |||
6d8de214eb | |||
5bf3c54cd3 | |||
959b64777f | |||
be0af135bc | |||
2d7c58540f | |||
951038a304 | |||
912ee199ed | |||
b9329dc49a | |||
6e08e1ae97 | |||
dd1d2b4d00 | |||
f6d53cc568 | |||
b6cc815447 | |||
ddbbb8afec | |||
a8a497c621 | |||
1a89694980 | |||
5c03416e84 | |||
b732c445b8 | |||
97ec88e346 | |||
192bc4fcf0 | |||
0e6065e3d5 | |||
a156fec25a | |||
fe725f9995 | |||
58207b30d1 | |||
f4192d7b9e | |||
e747692727 | |||
d786c5265f | |||
ba0a45365c | |||
fc4ea57a9c | |||
751497a748 | |||
c714e8baa6 | |||
2331a00555 | |||
decb4261d4 | |||
b0971e3a01 | |||
583cd25506 | |||
1beacc8c32 | |||
9f880d07ab | |||
3fc11e2278 | |||
1756e8b0f2 | |||
d57e343245 | |||
7e17a2072c | |||
9c94d6527a | |||
5da4fd2aef | |||
e621058cfd | |||
f2e2632ae7 | |||
35d1736c97 | |||
3c534abc99 | |||
c3deedd6fd | |||
b256111a17 | |||
b5a90a437b | |||
6d114b7480 | |||
c8f85ffec9 | |||
bae0060552 | |||
c8750e5812 | |||
89cb0e260a | |||
2c1a8524f0 | |||
b085329bca | |||
188f8021f8 | |||
975bcb8aff | |||
51e74f8d4f | |||
b4f3dfc347 | |||
41328eef94 | |||
59cf2ea341 | |||
67d472424d | |||
1d27adb102 | |||
940c0f2b93 | |||
d5620288d5 | |||
da30d2898e | |||
40198d6c13 | |||
4653ebc97f | |||
acd6978a30 | |||
ccbd6f97cd | |||
b4a8057994 | |||
225c2b095b | |||
0582338015 |
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
.git/
|
||||
build/
|
||||
!build/zerotier
|
46
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
46
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
**Alternative, faster ways to get help**
|
||||
If you have just started using ZeroTier, here are some places to get help:
|
||||
- my.zerotier.com has a _Community_ tab. It's a live chat with other users and the developers.
|
||||
- [ZeroTier Knowledge Base](https://zerotier.atlassian.net/wiki/spaces/SD/overview)
|
||||
- www.zerotier.com has a Contact Us button
|
||||
- email contact@zerotier.com
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Create a Network '...'
|
||||
2. Install zerotier-one '....'
|
||||
3. '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots or console output to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. Mac, Linux, Windows, BSD]
|
||||
- OS/Distribution Version
|
||||
- ZeroTier Version [e.g. 1.2.4]
|
||||
- Hardware [e.g. raspberry pi 3]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Version [e.g. 1.2.4]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
- ZeroTier Network Configuration
|
||||
- Router Config
|
||||
- Firewall Config (try turning the firewall off)
|
||||
- General Network Environment: [ e.g Home, University Campus, Corporate LAN ]
|
||||
|
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
83
.gitignore
vendored
Executable file → Normal file
83
.gitignore
vendored
Executable file → Normal file
@ -1,46 +1,23 @@
|
||||
# Main binaries created in *nix builds
|
||||
/zerotier-one
|
||||
/zerotier-idtool
|
||||
/zerotier-cli
|
||||
/zerotier-selftest
|
||||
/zerotier
|
||||
|
||||
# OS-created garbage files from various platforms
|
||||
/build
|
||||
/cmake-build-debug
|
||||
/cmake-build-release
|
||||
/core/version.h
|
||||
/.idea
|
||||
/.ide-*
|
||||
.DS_Store
|
||||
.Trashes
|
||||
*.swp
|
||||
._*
|
||||
*~
|
||||
*~.nib
|
||||
*.secret
|
||||
.Apple*
|
||||
Thumbs.db
|
||||
|
||||
# Windows build droppings
|
||||
/windows/ZeroTierOne.sdf
|
||||
/windows/ZeroTierOne.v11.suo
|
||||
/windows/x64
|
||||
/windows/Win32
|
||||
/windows/*/x64
|
||||
/windows/*/Win32
|
||||
/windows/ZeroTierOne/Release
|
||||
/windows/ZeroTierOneService/obj
|
||||
/windows/ZeroTierOneService/bin
|
||||
/windows/Build
|
||||
/windows/Debug
|
||||
/windows/Release
|
||||
/windows/WebUIWrapper/bin
|
||||
/windows/WebUIWrapper/obj
|
||||
/ext/installfiles/windows/ZeroTier One-SetupFiles
|
||||
/ext/installfiles/windows/Prerequisites
|
||||
/ext/installfiles/windows/*-cache
|
||||
/ZeroTier One.msi
|
||||
|
||||
# *nix/Mac build droppings
|
||||
/build-*
|
||||
/ZeroTierOneInstaller-*
|
||||
/examples/docker/zerotier-one
|
||||
/examples/docker/test-*.env
|
||||
/world/mkworld
|
||||
/world/*.c25519
|
||||
zt1-src.tar.gz
|
||||
|
||||
# Miscellaneous temporaries, build files, etc.
|
||||
@eaDir
|
||||
.vscode
|
||||
__pycache__
|
||||
*.log
|
||||
*.bak
|
||||
*.opensdf
|
||||
*.user
|
||||
*.cache
|
||||
@ -49,36 +26,14 @@ zt1-src.tar.gz
|
||||
*.pid
|
||||
*.pkg
|
||||
*.o
|
||||
*.a
|
||||
*.dylib
|
||||
*.so
|
||||
*.so.*
|
||||
*.o-*
|
||||
*.core
|
||||
*.deb
|
||||
*.rpm
|
||||
*.autosave
|
||||
*.tmp
|
||||
doc/*.1
|
||||
doc/*.2
|
||||
doc/*.8
|
||||
.depend
|
||||
node_modules
|
||||
debian/files
|
||||
debian/zerotier-one
|
||||
debian/zerotier-one*.debhelper
|
||||
debian/*.log
|
||||
debian/zerotier-one.substvars
|
||||
|
||||
# Java/Android/JNI build droppings
|
||||
java/obj/
|
||||
java/libs/
|
||||
java/bin/
|
||||
java/classes/
|
||||
java/doc/
|
||||
java/build_win64/
|
||||
java/build_win32/
|
||||
/java/mac32_64/
|
||||
windows/WinUI/obj/
|
||||
windows/WinUI/bin/
|
||||
windows/ZeroTierOne/Debug/
|
||||
*.vcxproj.backup
|
||||
/*.db
|
||||
/*.opendb
|
||||
|
59
AUTHORS.md
59
AUTHORS.md
@ -1,12 +1,15 @@
|
||||
# Authors and Third Party Code Licensing Information
|
||||
|
||||
## Primary Authors
|
||||
|
||||
* ZeroTier Core and ZeroTier One virtual networking service<br>
|
||||
Adam Ierymenko / adam.ierymenko@zerotier.com
|
||||
Joseph Henry / joseph.henry@zerotier.com (QoS and multipath)
|
||||
|
||||
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)<br>
|
||||
Grant Limberg / glimberg@gmail.com
|
||||
|
||||
* ZeroTier SDK (formerly known as Network Containers)<br>
|
||||
* ZeroTier SDK / libzt<br>
|
||||
Joseph Henry / joseph.henry@zerotier.com
|
||||
|
||||
## Third Party Contributors
|
||||
@ -25,56 +28,34 @@
|
||||
|
||||
## Third-Party Code
|
||||
|
||||
These are included in ext/ for platforms that do not have them available in common repositories. Otherwise they may be linked and the package may ship with them as dependencies.
|
||||
ZeroTier includes the following third party code, either in ext/ or incorporated into the ZeroTier core. This third party code remains licensed under its original license and is not subject to ZeroTier's BSL license.
|
||||
|
||||
* LZ4 compression algorithm by Yann Collet
|
||||
|
||||
* Files: ext/lz4/*
|
||||
* Files: node/LZ4.cpp
|
||||
* Home page: http://code.google.com/p/lz4/
|
||||
* License grant: BSD attribution
|
||||
* License: BSD 2-clause
|
||||
|
||||
* http-parser by Joyent, Inc. (many authors)
|
||||
* C++11 json (nlohmann/json) by Niels Lohmann
|
||||
|
||||
* Files: ext/http-parser/*
|
||||
* Home page: https://github.com/joyent/http-parser/
|
||||
* License grant: MIT/Expat
|
||||
|
||||
* json-parser by James McLaughlin
|
||||
|
||||
* Files: ext/json-parser/*
|
||||
* Home page: https://github.com/udp/json-parser/
|
||||
* License grant: BSD attribution
|
||||
|
||||
* 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
|
||||
* Files: ext/json/*
|
||||
* Home page: https://github.com/nlohmann/json
|
||||
* License: MIT
|
||||
|
||||
* tap-windows6 by the OpenVPN project
|
||||
|
||||
* Files: windows/TapDriver6/*
|
||||
* Home page:
|
||||
https://github.com/OpenVPN/tap-windows6/
|
||||
* License grant: GNU GPL v2
|
||||
* ZeroTier Modifications: change name of driver to ZeroTier, add ioctl() to get L2 multicast memberships (source is in ext/ and modifications inherit GPL)
|
||||
* Home page: https://github.com/OpenVPN/tap-windows6/
|
||||
* License: GNU GPL v2
|
||||
|
||||
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519
|
||||
digital signature algorithm, and Poly1305 MAC algorithm, all by
|
||||
Daniel J. Bernstein
|
||||
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519 digital signature algorithm, and Poly1305 MAC algorithm, all by Daniel J. Bernstein
|
||||
|
||||
* Files:
|
||||
node/Salsa20.hpp
|
||||
node/C25519.hpp
|
||||
node/Poly1305.hpp
|
||||
* Files: node/Salsa20.* node/C25519.* node/Poly1305.*
|
||||
* Home page: http://cr.yp.to/
|
||||
* License grant: public domain
|
||||
* License: public domain
|
||||
|
||||
* MiniUPNPC and libnatpmp by Thomas Bernard
|
||||
* cpp-httplib by yhirose
|
||||
|
||||
* Files:
|
||||
ext/libnatpmp/*
|
||||
ext/miniupnpc/*
|
||||
* Home page: http://miniupnp.free.fr/
|
||||
* License grant: BSD attribution no-endorsement
|
||||
* Files: ext/cpp-httplib/*
|
||||
* Home page: https://github.com/yhirose/cpp-httplib
|
||||
* License: MIT
|
||||
|
346
CMakeLists.txt
Normal file
346
CMakeLists.txt
Normal file
@ -0,0 +1,346 @@
|
||||
cmake_minimum_required (VERSION 3.8)
|
||||
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.15)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
else()
|
||||
cmake_policy(VERSION 3.15)
|
||||
endif()
|
||||
|
||||
set(ZEROTIER_VERSION_MAJOR 1 CACHE INTERNAL "")
|
||||
set(ZEROTIER_VERSION_MINOR 9 CACHE INTERNAL "")
|
||||
set(ZEROTIER_VERSION_REVISION 0 CACHE INTERNAL "")
|
||||
set(ZEROTIER_VERSION_BUILD 0 CACHE INTERNAL "")
|
||||
|
||||
project(zerotier
|
||||
VERSION ${ZEROTIER_VERSION_MAJOR}.${ZEROTIER_VERSION_MINOR}.${ZEROTIER_VERSION_REVISION}.${ZEROTIER_VERSION_BUILD}
|
||||
DESCRIPTION "ZeroTier Network Hypervisor"
|
||||
LANGUAGES CXX C)
|
||||
|
||||
if(NOT PACKAGE_STATIC)
|
||||
|
||||
find_program(
|
||||
GO go
|
||||
HINTS "/usr/local/go/bin" "/usr/bin" "/usr/local/bin" "C:/go/bin"
|
||||
)
|
||||
if(NOT GO)
|
||||
message(FATAL_ERROR "Golang not found")
|
||||
else(NOT GO)
|
||||
message(STATUS "Found Golang at ${GO}")
|
||||
endif(NOT GO)
|
||||
|
||||
set(default_build_type "Release")
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_SYSTEM_VERSION "7" CACHE STRING INTERNAL FORCE)
|
||||
else(WIN32)
|
||||
if(APPLE)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
else(APPLE)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif(APPLE)
|
||||
endif(WIN32)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
option(BUILD_CENTRAL_CONTROLLER "Build ZeroTier Central Controller" OFF)
|
||||
if(BUILD_CENTRAL_CONTROLLER)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
if(APPLE)
|
||||
set(CMAKE_PREFIX_PATH
|
||||
${CMAKE_PREFIX_PATH}
|
||||
/usr/local/opt/libpq
|
||||
/usr/local/lib
|
||||
)
|
||||
endif(APPLE)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
|
||||
pkg_check_modules(hiredis REQUIRED IMPORTED_TARGET hiredis)
|
||||
|
||||
add_subdirectory(controller/thirdparty/redis-plus-plus-1.1.1)
|
||||
set(redispp_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/controller/thirdparty/redis-plus-plus-1.1.1/src/sw)
|
||||
set(redispp_STATIC_LIB redispp_static)
|
||||
endif(BUILD_CENTRAL_CONTROLLER)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-DZT_DEBUG)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
if(WIN32)
|
||||
|
||||
message("++ Setting Windows Compiler Flags ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
add_definitions(-DNOMINMAX)
|
||||
add_compile_options(
|
||||
-Wall
|
||||
-Wno-deprecated
|
||||
-Wno-unused-function
|
||||
-Wno-format
|
||||
$<$<CONFIG:DEBUG>:-g>
|
||||
$<$<CONFIG:DEBUG>:-O0>
|
||||
$<$<CONFIG:RELEASE>:-O3>
|
||||
$<$<CONFIG:RELEASE>:-ffast-math>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-O3>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||
)
|
||||
|
||||
set(GOFLAGS
|
||||
-a
|
||||
-trimpath
|
||||
)
|
||||
|
||||
if(BUILD_32BIT)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
|
||||
set(GOARCH "GOARCH=386" CACHE STRING "go architecture")
|
||||
add_compile_options(
|
||||
-m32
|
||||
)
|
||||
add_link_options(
|
||||
-m32
|
||||
)
|
||||
endif(BUILD_32BIT)
|
||||
|
||||
else(WIN32)
|
||||
|
||||
set(GOFLAGS
|
||||
-trimpath
|
||||
-buildmode=pie
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
|
||||
message("++ Setting MacOS Compiler Flags ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
set(MACOS_VERSION_MIN "10.12")
|
||||
|
||||
add_compile_options(
|
||||
-Wall
|
||||
-Wno-deprecated
|
||||
-Wno-unused-function
|
||||
-mmacosx-version-min=${MACOS_VERSION_MIN}
|
||||
$<$<CONFIG:DEBUG>:-g>
|
||||
$<$<CONFIG:DEBUG>:-O0>
|
||||
$<$<CONFIG:RELEASE>:-Ofast>
|
||||
$<$<CONFIG:RELEASE>:-ffast-math>
|
||||
$<$<CONFIG:RELEASE>:-fPIE>
|
||||
$<$<CONFIG:RELEASE>:-flto>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-O1>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-fPIE>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||
)
|
||||
|
||||
add_link_options(
|
||||
-mmacosx-version-min=${MACOS_VERSION_MIN}
|
||||
$<$<CONFIG:RELEASE>:-flto>
|
||||
)
|
||||
|
||||
set(GOFLAGS
|
||||
${GOFLAGS}
|
||||
-a
|
||||
-ldflags '-w -extldflags \"-Wl,-undefined -Wl,dynamic_lookup\"'
|
||||
)
|
||||
|
||||
else(APPLE)
|
||||
|
||||
message("++ Setting Linux/BSD/Posix Compiler Flags (${CMAKE_BUILD_TYPE})")
|
||||
|
||||
add_compile_options(
|
||||
-Wall
|
||||
-Wno-deprecated
|
||||
-Wno-unused-function
|
||||
-Wno-format
|
||||
$<$<CONFIG:DEBUG>:-g>
|
||||
$<$<CONFIG:DEBUG>:-O0>
|
||||
$<$<CONFIG:RELEASE>:-O3>
|
||||
$<$<CONFIG:RELEASE>:-ffast-math>
|
||||
$<$<CONFIG:RELEASE>:-fPIE>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-O3>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-fPIE>
|
||||
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||
)
|
||||
|
||||
option(BUILD_32BIT "Force building as 32-bit binary" OFF)
|
||||
option(BUILD_STATIC "Build statically linked executable" OFF)
|
||||
option(BUILD_ARM_V5 "Build ARMv5" OFF)
|
||||
option(BUILD_ARM_V6 "Build ARMv6" OFF)
|
||||
|
||||
if(BUILD_ARM_V5 AND BUILD_ARM_V6)
|
||||
message(FATAL_ERROR "BUILD_ARM_V5 and BUILD_ARM_V6 are mutually exclusive!")
|
||||
endif(BUILD_ARM_V5 AND BUILD_ARM_V6)
|
||||
|
||||
if(BUILD_32BIT)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
|
||||
set(GOARCH "GOARCH=386" CACHE STRING "go architecture")
|
||||
add_compile_options(
|
||||
-m32
|
||||
)
|
||||
endif(BUILD_32BIT)
|
||||
|
||||
if(BUILD_STATIC)
|
||||
add_link_options(
|
||||
-static
|
||||
)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-static ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
set(GOFLAGS
|
||||
${GOFLAGS}
|
||||
-a
|
||||
-tags osusergo,netgo
|
||||
-ldflags '-w -extldflags \"-static -Wl,-unresolved-symbols=ignore-all\"'
|
||||
)
|
||||
else(BUILD_STATIC)
|
||||
set(GOFLAGS
|
||||
${GOFLAGS}
|
||||
-a
|
||||
-ldflags '-w -extldflags \"-Wl,-unresolved-symbols=ignore-all\"'
|
||||
)
|
||||
endif(BUILD_STATIC)
|
||||
|
||||
if(BUILD_ARM_V5)
|
||||
set(GOARM "GOARM=5")
|
||||
endif(BUILD_ARM_V5)
|
||||
|
||||
if(BUILD_ARM_V6)
|
||||
set(GOARM "GOARM=6")
|
||||
endif(BUILD_ARM_V6)
|
||||
|
||||
endif(APPLE)
|
||||
endif(WIN32)
|
||||
|
||||
if (
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "X86_64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "x64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "X64"
|
||||
)
|
||||
message("++ Adding flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
add_compile_options(-maes -mrdrnd -mpclmul -msse -msse2)
|
||||
endif()
|
||||
|
||||
if (
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR MATCHES "AARCH64"
|
||||
)
|
||||
message("++ Adding flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
add_compile_options(-march=armv8-a+aes+crypto -mtune=generic -mstrict-align)
|
||||
endif()
|
||||
|
||||
set(GO_BUILD_TAGS)
|
||||
|
||||
if(BUILD_CENTRAL_CONTROLLER)
|
||||
add_definitions(-DZT_CONTROLLER_USE_LIBPQ=1)
|
||||
set(GO_BUILD_TAGS -tags central)
|
||||
endif(BUILD_CENTRAL_CONTROLLER)
|
||||
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(controller)
|
||||
add_subdirectory(osdep)
|
||||
add_subdirectory(serviceiocore)
|
||||
|
||||
file(GLOB go_src
|
||||
${CMAKE_SOURCE_DIR}/cmd/*.go
|
||||
${CMAKE_SOURCE_DIR}/cmd/cmd/*.go
|
||||
${CMAKE_SOURCE_DIR}/pkg/zerotier/*.go
|
||||
)
|
||||
file(GLOB go_zt_service_tests_cmd_src
|
||||
${CMAKE_SOURCE_DIR}/cmd/zt_service_tests/*.go
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(GO_EXE_NAME "zerotier.exe")
|
||||
set(GO_SERVICE_TESTS_EXE_NAME "zt_service_tests.exe")
|
||||
set(GO_EXTRA_LIBRARIES "-lstdc++ -lwsock32 -lws2_32 -liphlpapi -lole32 -loleaut32 -lrpcrt4 -luuid")
|
||||
else(WIN32)
|
||||
set(GO_EXE_NAME "zerotier")
|
||||
set(GO_SERVICE_TESTS_EXE_NAME "zt_service_tests")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(GO_EXTRA_LIBRARIES "-lstdc++")
|
||||
if(BUILD_ARM_V5)
|
||||
set(GO_EXTRA_LIBRARIES
|
||||
${GO_EXTRA_LIBRARIES}
|
||||
"-latomic"
|
||||
)
|
||||
endif(BUILD_ARM_V5)
|
||||
else()
|
||||
set(GO_EXTRA_LIBRARIES "-lc++" "-lm")
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
||||
add_custom_target(
|
||||
zt_service_tests ALL
|
||||
BYPRODUCTS ${CMAKE_BINARY_DIR}/zt_service_tests
|
||||
SOURCES ${go_src} ${go_zt_service_tests_cmd_src}
|
||||
COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$<TARGET_FILE:zt_core> $<TARGET_FILE:zt_controller> $<TARGET_FILE:zt_service_io_core> $<TARGET_FILE:zt_osdep> ${GO_EXTRA_LIBRARIES}\" ${GO} build -mod=vendor ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_SERVICE_TESTS_EXE_NAME} ${go_zt_service_tests_cmd_src}
|
||||
COMMENT "Compiling zt_service_tests (Go/cgo self-tests)..."
|
||||
)
|
||||
add_dependencies(zt_service_tests zt_osdep zt_core zt_controller zt_service_io_core)
|
||||
|
||||
add_custom_target(
|
||||
zerotier ALL
|
||||
BYPRODUCTS ${CMAKE_BINARY_DIR}/zerotier
|
||||
SOURCES ${go_src}
|
||||
COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$<TARGET_FILE:zt_core> $<TARGET_FILE:zt_controller> $<TARGET_FILE:zt_service_io_core> $<TARGET_FILE:zt_osdep> ${GO_EXTRA_LIBRARIES}\" ${GO} build -mod=vendor ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_EXE_NAME} ${CMAKE_SOURCE_DIR}/cmd/zerotier/zerotier.go
|
||||
COMMENT "Compiling Go Code..."
|
||||
)
|
||||
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core)
|
||||
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zerotier DESTINATION bin)
|
||||
|
||||
else(NOT PACKAGE_STATIC)
|
||||
|
||||
if(BUILD_32BIT)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
|
||||
add_compile_options(
|
||||
-m32
|
||||
)
|
||||
endif(BUILD_32BIT)
|
||||
|
||||
set(STATIC_BINARY ${CMAKE_BINARY_DIR}/zerotier)
|
||||
set(IMPORTED_LOCATION ${CMAKE_BINARY_DIR})
|
||||
add_executable(zerotier IMPORTED GLOBAL)
|
||||
install(PROGRAMS ${STATIC_BINARY} DESTINATION bin)
|
||||
|
||||
endif(NOT PACKAGE_STATIC)
|
||||
|
||||
# Linux packaging
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" EQUAL "Linux")
|
||||
if(IS_DIRECTORY /lib/systemd/system)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.service
|
||||
DESTINATION /lib/systemd/system
|
||||
)
|
||||
elseif(IS_DIRECTORY /usr/lib/systemd/system)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.service
|
||||
DESTINATION /usr/lib/systemd/system
|
||||
)
|
||||
else()
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.init
|
||||
DESTINATION /etc/init.d
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("${ZT_PACKAGE_FORMAT}" MATCHES "DEB")
|
||||
include(packaging/debian.cmake)
|
||||
elseif("${ZT_PACKAGE_FORMAT}" MATCHES "RPM")
|
||||
include(packaging/rpm.cmake)
|
||||
else()
|
||||
endif()
|
11
COPYING
11
COPYING
@ -1,13 +1,8 @@
|
||||
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
|
||||
Copyright © 2011–2016 ZeroTier, Inc.
|
||||
Copyright © 2013–2020 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:
|
||||
|
502
Jenkinsfile
vendored
Normal file
502
Jenkinsfile
vendored
Normal file
@ -0,0 +1,502 @@
|
||||
pipeline {
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
preserveStashes(buildCount: 10)
|
||||
timestamps()
|
||||
}
|
||||
parameters {
|
||||
booleanParam(name: "BUILD_ALL", defaultValue: false, description: "Build all supported platform/architecture combos. Defaults to x86/x64 only")
|
||||
}
|
||||
environment {
|
||||
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
}
|
||||
|
||||
agent none
|
||||
|
||||
stages {
|
||||
stage ("Build") {
|
||||
steps {
|
||||
script {
|
||||
def tasks = [:]
|
||||
tasks << buildStaticBinaries()
|
||||
tasks << buildDebianNative()
|
||||
tasks << buildCentosNative()
|
||||
tasks << buildMacOS()
|
||||
tasks << buildWindows()
|
||||
tasks << buildFreeBSD()
|
||||
|
||||
parallel tasks
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Package Static") {
|
||||
steps {
|
||||
script {
|
||||
parallel packageStatic()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def buildMacOS() {
|
||||
def tasks = [:]
|
||||
tasks << getTasks(['mac'],['amd64'], {unused1, unused2 ->
|
||||
def myNode = {
|
||||
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
node ('mac') {
|
||||
dir("build") {
|
||||
checkout scm
|
||||
sh 'make'
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
return tasks
|
||||
}
|
||||
|
||||
def buildWindows() {
|
||||
def tasks = [:]
|
||||
tasks << getTasks(['windows'], ['amd64', 'i386'], { unused1, platform ->
|
||||
def myNode = {
|
||||
node ('windows') {
|
||||
env.SHELL = 'C:/Windows/System32/cmd.exe'
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
|
||||
dir ("build") {
|
||||
withEnv(["PATH=C:\\TDM-GCC-64\\bin;C:\\WINDOWS;C:\\Windows\\system32;C:\\CMake\\bin;C:\\Go\\bin"]) {
|
||||
def cmakeFlags = ""
|
||||
if (platform == "i386") {
|
||||
cmakeFlags = '-DBUILD_32BIT=1'
|
||||
}
|
||||
bat """
|
||||
cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ${cmakeFlags} ..
|
||||
mingw32-make -j8
|
||||
"""
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
|
||||
return tasks
|
||||
}
|
||||
|
||||
def buildFreeBSD() {
|
||||
def tasks = [:]
|
||||
tasks << getTasks(['freebsd12'], ['amd64'], { unused1, unused2 ->
|
||||
def myNode = {
|
||||
node ('freebsd12') {
|
||||
dir('build') {
|
||||
checkout scm
|
||||
sh 'make setup'
|
||||
dir('build') {
|
||||
sh 'make -j4'
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
return tasks
|
||||
}
|
||||
|
||||
def buildStaticBinaries() {
|
||||
def tasks = [:]
|
||||
def dist = ["alpine"]
|
||||
def archs = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
archs = ["arm64", "amd64", "i386", "armhf", "ppc64le", "s390x"]
|
||||
} else {
|
||||
archs = ["amd64", "i386"]
|
||||
}
|
||||
|
||||
tasks << getTasks(dist, archs, { distro, platform ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${platform}:latest")
|
||||
runtime.inside {
|
||||
dir("build") {
|
||||
|
||||
def cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"'
|
||||
if (platform == "i386") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"'
|
||||
} else if (platform == "armhf") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DBUILD_ARM_V6=1"'
|
||||
}
|
||||
|
||||
sh "${cmakeFlags} make"
|
||||
dir("build") {
|
||||
sh "mv zerotier zerotier-static-${platform}"
|
||||
stash includes: 'zerotier-static-*', name: "static-${platform}"
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
|
||||
return tasks
|
||||
}
|
||||
|
||||
def getTasks(axisDistro, axisPlatform, task) {
|
||||
def tasks = [:]
|
||||
for(int i=0; i< axisDistro.size(); i++) {
|
||||
def axisDistroValue = axisDistro[i]
|
||||
for(int j=0; j< axisPlatform.size(); j++) {
|
||||
def axisPlatformValue = axisPlatform[j]
|
||||
tasks["${axisDistroValue}/${axisPlatformValue}"] = task(axisDistroValue, axisPlatformValue)
|
||||
}
|
||||
}
|
||||
return tasks
|
||||
}
|
||||
|
||||
def packageStatic() {
|
||||
def tasks = [:]
|
||||
|
||||
def centos7 = ["centos7"]
|
||||
def centos7Arch = ["i386"]
|
||||
tasks << getTasks(centos7, centos7Arch, { distro, arch ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||
runtime.inside {
|
||||
dir("build") {
|
||||
unstash "static-${arch}"
|
||||
sh "mkdir -p build"
|
||||
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||
sh 'CMAKE_ARGS="-DBUILD_32BIT=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=RPM" make setup'
|
||||
dir("build") {
|
||||
sh 'make package -j4 VERBOSE=1'
|
||||
}
|
||||
sh "mkdir -p ${distro}"
|
||||
sh "cp -av build/*.rpm ${distro}/"
|
||||
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
|
||||
if (params.BUILD_ALL == true) {
|
||||
def s390xStatics = ["clefos", "debian-buster", "debian-sid", "debian-bullseye", "debian-stretch", "ubuntu-bionic", "ubuntu-eoan", "ubuntu-focal"]
|
||||
def s390x = ["s390x"]
|
||||
tasks << getTasks(s390xStatics, s390x , { distro, arch ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||
def pkgFormat = "DEB"
|
||||
if (distro == "clefos") {
|
||||
pkgFormat = "RPM"
|
||||
}
|
||||
runtime.inside {
|
||||
dir("build/") {
|
||||
unstash "static-${arch}"
|
||||
sh "mkdir -p build"
|
||||
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||
sh "CMAKE_ARGS=\"-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=${pkgFormat}\" make setup"
|
||||
dir("build") {
|
||||
sh 'make package -j4 VERBOSE=1'
|
||||
}
|
||||
sh "mkdir -p ${distro}"
|
||||
sh "cp -av build/*.rpm ${distro}/"
|
||||
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
}
|
||||
|
||||
def debianJessie = ["debian-jessie"]
|
||||
def debianJessieArchs = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
debianJessieArch = ["armhf", "amd64", "i386"]
|
||||
} else {
|
||||
debianJessieArch = ["amd64", "i386"]
|
||||
}
|
||||
tasks << getTasks(debianJessie, debianJessieArch, { distro, arch ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||
runtime.inside {
|
||||
dir('build/') {
|
||||
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||
if (arch == "i386") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||
} else if (arch == "armel") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||
} else if (arch == "armhf") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||
}
|
||||
|
||||
unstash "static-${arch}"
|
||||
sh "mkdir -p build"
|
||||
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||
sh "${cmakeFlags} make setup"
|
||||
dir("build") {
|
||||
sh 'make package -j4 VERBOSE=1'
|
||||
}
|
||||
sh "mkdir -p ${distro}"
|
||||
sh "cp -av build/*.deb ${distro}/"
|
||||
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
|
||||
def ubuntuTrusty = ["ubuntu-trusty"]
|
||||
def ubuntuTrustyArch = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
ubuntuTrustyArch = ["i386", "amd64", "arm64", "ppc64le"]
|
||||
} else {
|
||||
ubuntuTrustyArch = ["i386", "amd64"]
|
||||
}
|
||||
tasks << getTasks(ubuntuTrusty, ubuntuTrustyArch, { distro, arch ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||
runtime.inside {
|
||||
dir('build/') {
|
||||
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||
if (arch == "i386") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||
} else if (arch == "armel") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||
} else if (arch == "armhf") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||
}
|
||||
|
||||
unstash "static-${arch}"
|
||||
sh "mkdir -p build"
|
||||
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||
sh "${cmakeFlags} make setup"
|
||||
dir("build") {
|
||||
sh 'make package -j4 VERBOSE=1'
|
||||
}
|
||||
sh "mkdir -p ${distro}"
|
||||
sh "cp -av build/*.deb ${distro}/"
|
||||
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
|
||||
def debianWheezy = ["debian-wheezy"]
|
||||
def debianWheezyArchs = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
debianWheezyArchs = ["armhf", "amd64", "i386"]
|
||||
} else {
|
||||
debianWheezyArchs = ["amd64", "i386"]
|
||||
}
|
||||
tasks << getTasks(debianJessie, debianJessieArch, { distro, arch ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||
runtime.inside {
|
||||
dir('build/') {
|
||||
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||
if (arch == "i386") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||
} else if (arch == "armel") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||
} else if (arch == "armhf") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||
}
|
||||
unstash "static-${arch}"
|
||||
sh "mkdir -p build"
|
||||
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||
sh "${cmakeFlags} make setup"
|
||||
dir("build") {
|
||||
sh 'make package -j4 VERBOSE=1'
|
||||
}
|
||||
sh "mkdir -p ${distro}"
|
||||
sh "cp -av build/*.deb ${distro}/"
|
||||
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
})
|
||||
|
||||
return tasks
|
||||
}
|
||||
|
||||
def buildDebianNative() {
|
||||
def tasks = [:]
|
||||
def debian = ["debian-buster" , "debian-stretch", "debian-sid", "debian-bullseye"]
|
||||
def debianArchs = []
|
||||
if (params.BUILD_ALL) {
|
||||
debianArchs = ["ppc64le", "i386", "armhf", "armel", "arm64", "amd64"]
|
||||
} else {
|
||||
debianArchs = ["amd64", "i386"]
|
||||
}
|
||||
|
||||
def build = { distro, arch ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||
runtime.inside {
|
||||
def cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB"'
|
||||
if (arch == "i386") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||
} else if (arch == "armel") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||
} else if (arch == "armhf") {
|
||||
cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||
}
|
||||
|
||||
dir("build") {
|
||||
sh "${cmakeFlags} make setup"
|
||||
dir("build") {
|
||||
sh "make package -j4 VERBOSE=1"
|
||||
}
|
||||
}
|
||||
sh "mkdir -p ${distro}"
|
||||
sh "mv build/build/*.deb ${distro}"
|
||||
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
}
|
||||
|
||||
tasks << getTasks(debian, debianArchs, build)
|
||||
|
||||
// bash is broken when running under QEMU-s390x on Xenial
|
||||
def xenial = ["ubuntu-xenial"]
|
||||
def xenialArchs = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
xenialArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le"]
|
||||
} else {
|
||||
xenialArchs = ["i386", "amd64"]
|
||||
}
|
||||
tasks << getTasks(xenial, xenialArchs, build)
|
||||
|
||||
def ubuntu = ["ubuntu-bionic", "ubuntu-eoan"]
|
||||
def ubuntuArchs = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
ubuntuArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le"]
|
||||
} else {
|
||||
ubuntuArchs = ["i386", "amd64"]
|
||||
}
|
||||
tasks << getTasks(ubuntu, ubuntuArchs, build)
|
||||
|
||||
def ubuntuFocal = ["ubuntu-focal"]
|
||||
def ubuntuFocalArchs = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
ubuntuFocalArchs = ["amd64", "arm64", "ppc64le"]
|
||||
} else {
|
||||
ubuntuFocalArchs = ["amd64"]
|
||||
}
|
||||
tasks << getTasks(ubuntuFocal, ubuntuFocalArchs, build)
|
||||
|
||||
def kali = ["kali-rolling"]
|
||||
def kaliArchs = ["amd64"]
|
||||
tasks << getTasks(kali, kaliArchs, build)
|
||||
|
||||
return tasks
|
||||
}
|
||||
|
||||
def buildCentosNative() {
|
||||
def tasks = [:]
|
||||
|
||||
def build = { distro, arch ->
|
||||
def myNode = {
|
||||
node ('linux-build') {
|
||||
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||
dir ("build") {
|
||||
checkout scm
|
||||
}
|
||||
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||
runtime.inside {
|
||||
dir("build") {
|
||||
if (distro == 'centos7' && arch == 'amd64') {
|
||||
sh 'source scl_source enable devtoolset-8 llvm-toolset-7 && CMAKE_ARGS="-DZT_PACKAGE_FORMAT=RPM" make setup'
|
||||
} else {
|
||||
sh 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=RPM" make setup'
|
||||
}
|
||||
dir ("build") {
|
||||
if (distro == 'centos7' && arch == 'amd64') {
|
||||
sh 'source scl_source enable devtoolset-8 llvm-toolset-7 && make package -j4 VERBOSE=1'
|
||||
} else {
|
||||
sh 'make package -j4 VERBOSE=1'
|
||||
}
|
||||
}
|
||||
}
|
||||
sh "mkdir -p ${distro}"
|
||||
sh "cp -av build/build/*.rpm ${distro}/"
|
||||
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
|
||||
|
||||
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||
}
|
||||
}
|
||||
}
|
||||
return myNode
|
||||
}
|
||||
|
||||
def centos8 = ["centos8"]
|
||||
def centos8Archs = []
|
||||
if (params.BUILD_ALL == true) {
|
||||
centos8Archs = ["amd64", "arm64", "ppc64le"]
|
||||
} else {
|
||||
centos8Archs = ["amd64"]
|
||||
}
|
||||
tasks << getTasks(centos8, centos8Archs, build)
|
||||
|
||||
def centos7 = ["centos7"]
|
||||
def centos7Archs = ["amd64"]
|
||||
tasks << getTasks(centos7, centos7Archs, build)
|
||||
|
||||
return tasks
|
||||
}
|
339
LICENSE.GPL-2
339
LICENSE.GPL-2
@ -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.
|
149
LICENSE.txt
Normal file
149
LICENSE.txt
Normal file
@ -0,0 +1,149 @@
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Business Source License 1.1
|
||||
|
||||
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
||||
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Parameters
|
||||
|
||||
Licensor: ZeroTier, Inc.
|
||||
Licensed Work: ZeroTier Network Virtualization Engine
|
||||
The Licensed Work is (c)2013-2020 ZeroTier, Inc.
|
||||
Additional Use Grant: You may make use of the Licensed Work, provided you
|
||||
do not use it in any of the following ways:
|
||||
|
||||
* Sell hosted ZeroTier services as a "SaaS" Product
|
||||
|
||||
(1) Operate or sell access to ZeroTier root servers,
|
||||
network controllers, or authorization key or certificate
|
||||
generation components of the Licensed Work as a
|
||||
for-profit service, regardless of whether the use of
|
||||
these components is sold alone or is bundled with other
|
||||
services. Note that this does not apply to the use of
|
||||
ZeroTier behind the scenes to operate a service not
|
||||
related to ZeroTier network administration.
|
||||
|
||||
* Create Non-Open-Source Commercial Derivative Works
|
||||
|
||||
(2) Link or directly include the Licensed Work in a
|
||||
commercial or for-profit application or other product
|
||||
not distributed under an Open Source Initiative (OSI)
|
||||
compliant license. See: https://opensource.org/licenses
|
||||
|
||||
(3) Remove the name, logo, copyright, or other branding
|
||||
material from the Licensed Work to create a "rebranded"
|
||||
or "white labeled" version to distribute as part of
|
||||
any commercial or for-profit product or service.
|
||||
|
||||
* Certain Government Uses
|
||||
|
||||
(4) Use or deploy the Licensed Work in a government
|
||||
setting in support of any active government function
|
||||
or operation with the exception of the following:
|
||||
physical or mental health care, family and social
|
||||
services, social welfare, senior care, child care, and
|
||||
the care of persons with disabilities.
|
||||
|
||||
Change Date: 2025-01-01
|
||||
|
||||
Change License: Apache License version 2.0 as published by the Apache
|
||||
Software Foundation
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
Alternative Licensing
|
||||
|
||||
If you would like to use the Licensed Work in any way that conflicts with
|
||||
the stipulations of the Additional Use Grant, contact ZeroTier, Inc. to
|
||||
obtain an alternative commercial license.
|
||||
|
||||
Visit us on the web at: https://www.zerotier.com/
|
||||
|
||||
Notice
|
||||
|
||||
The Business Source License (this document, or the "License") is not an Open
|
||||
Source license. However, the Licensed Work will eventually be made available
|
||||
under an Open Source License, as stated in this License.
|
||||
|
||||
For more information on the use of the Business Source License for ZeroTier
|
||||
products, please visit our pricing page which contains license details and
|
||||
and license FAQ: https://zerotier.com/pricing
|
||||
|
||||
For more information on the use of the Business Source License generally,
|
||||
please visit the Adopting and Developing Business Source License FAQ at
|
||||
https://mariadb.com/bsl-faq-adopting.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Business Source License 1.1
|
||||
|
||||
Terms
|
||||
|
||||
The Licensor hereby grants you the right to copy, modify, create derivative
|
||||
works, redistribute, and make non-production use of the Licensed Work. The
|
||||
Licensor may make an Additional Use Grant, above, permitting limited
|
||||
production use.
|
||||
|
||||
Effective on the Change Date, or the fourth anniversary of the first publicly
|
||||
available distribution of a specific version of the Licensed Work under this
|
||||
License, whichever comes first, the Licensor hereby grants you rights under
|
||||
the terms of the Change License, and the rights granted in the paragraph
|
||||
above terminate.
|
||||
|
||||
If your use of the Licensed Work does not comply with the requirements
|
||||
currently in effect as described in this License, you must purchase a
|
||||
commercial license from the Licensor, its affiliated entities, or authorized
|
||||
resellers, or you must refrain from using the Licensed Work.
|
||||
|
||||
All copies of the original and modified Licensed Work, and derivative works
|
||||
of the Licensed Work, are subject to this License. This License applies
|
||||
separately for each version of the Licensed Work and the Change Date may vary
|
||||
for each version of the Licensed Work released by Licensor.
|
||||
|
||||
You must conspicuously display this License on each original or modified copy
|
||||
of the Licensed Work. If you receive the Licensed Work in original or
|
||||
modified form from a third party, the terms and conditions set forth in this
|
||||
License apply to your use of that work.
|
||||
|
||||
Any use of the Licensed Work in violation of this License will automatically
|
||||
terminate your rights under this License for the current and all other
|
||||
versions of the Licensed Work.
|
||||
|
||||
This License does not grant you any right in any trademark or logo of
|
||||
Licensor or its affiliates (provided that you may use a trademark or logo of
|
||||
Licensor as expressly required by this License).
|
||||
|
||||
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
||||
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
||||
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
||||
TITLE.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
MariaDB hereby grants you permission to use this 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.
|
41
Makefile
41
Makefile
@ -1,18 +1,31 @@
|
||||
# Common makefile -- loads make rules for each platform
|
||||
BUILDDIR := build
|
||||
TIMESTAMP=$(shell date +"%Y%m%d%H%M")
|
||||
|
||||
OSTYPE=$(shell uname -s)
|
||||
.PHONY: all
|
||||
|
||||
ifeq ($(OSTYPE),Darwin)
|
||||
include make-mac.mk
|
||||
endif
|
||||
all: setup
|
||||
cd ${BUILDDIR} && $(MAKE) -j4 VERBOSE=1
|
||||
|
||||
ifeq ($(OSTYPE),Linux)
|
||||
include make-linux.mk
|
||||
endif
|
||||
setup:
|
||||
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}
|
||||
|
||||
ifeq ($(OSTYPE),FreeBSD)
|
||||
include make-freebsd.mk
|
||||
endif
|
||||
ifeq ($(OSTYPE),OpenBSD)
|
||||
include make-freebsd.mk
|
||||
endif
|
||||
setup-debug:
|
||||
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS}
|
||||
|
||||
debug:
|
||||
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS} && $(MAKE)
|
||||
|
||||
central-controller:
|
||||
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
|
||||
|
||||
central-controller-debug:
|
||||
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
|
||||
|
||||
central-controller-docker:
|
||||
docker build -t registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f controller/central-docker/Dockerfile .
|
||||
|
||||
clean:
|
||||
rm -rf ${BUILDDIR}
|
||||
|
||||
distclean:
|
||||
rm -rf ${BUILDDIR}
|
||||
|
89
README.md
89
README.md
@ -1,52 +1,67 @@
|
||||
ZeroTier - A Planetary Ethernet Switch
|
||||
ZeroTier - Global Area Networking
|
||||
======
|
||||
|
||||
ZeroTier is a software-based managed 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 erases the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges arising from the inflexible nature of physical networks obsolete. Everything is encrypted end-to-end and traffic takes the most direct (peer to peer) path available.
|
||||
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.
|
||||
|
||||
This repository contains ZeroTier One, a service that provides ZeroTier network connectivity to devices running Windows, Mac, Linux, iOS, Android, and FreeBSD and makes joining virtual networks as easy as joining IRC or Slack channels. It also contains the OS-independent core ZeroTier protocol implementation in [node/](node/).
|
||||
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.
|
||||
|
||||
Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download.shtml). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
|
||||
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
|
||||
|
||||
ZeroTier's basic operation is easy to understand. Devices have 10-digit *ZeroTier addresses* like `89e92ceee5` and networks have 16-digit network IDs like `8056c2e21c000001`. All it takes for a device to join a network is its 16-digit ID, and all it takes for a network to authorize a device is its 10-digit address. Everything else is automatic.
|
||||
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.
|
||||
|
||||
A "device" can be anything really: desktops, laptops, phones, servers, VMs/VPSes, containers, and even (soon) apps.
|
||||
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.
|
||||
|
||||
For testing we provide a public virtual network called *Earth* with network ID `8056c2e21c000001`. On Linux and Mac you can do this with:
|
||||
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.
|
||||
|
||||
sudo zerotier-cli join 8056c2e21c000001
|
||||
### Project Layout
|
||||
|
||||
Now wait about 30 seconds and check your system with `ip addr list` or `ifconfig`. You'll see a new interface whose name starts with *zt* and it should quickly get an IPv4 and an IPv6 address. Once you see it get an IP, try pinging `earth.zerotier.net` at `29.209.112.93`. If you've joined Earth from more than one system, try pinging your other machine.
|
||||
The base path contains the ZeroTier One service main entry point (`one.cpp`), self test code, makefiles, etc.
|
||||
|
||||
*(IPv4 addresses for Earth are assigned from the block 28.0.0.0/7, which is not a part of the public Internet but is non-standard for private networks. It's used to avoid IP conflicts during testing. Your networks can run any IP addressing scheme you want.)*
|
||||
- `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.
|
||||
- `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.
|
||||
- `windows/`: Visual Studio solution files, Windows service code, and the Windows task bar app UI.
|
||||
|
||||
If you don't want to belong to a giant Ethernet party line anymore, just type:
|
||||
### Build and Platform Notes
|
||||
|
||||
sudo zerotier-cli leave 8056c2e21c000001
|
||||
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/'.
|
||||
|
||||
The *zt* interface will disappear. You're no longer on the network.
|
||||
|
||||
To create networks of your own you'll need a network controller. You can use [our hosted controller at my.zerotier.com](https://my.zerotier.com) which is free for up to 100 devices on an unlimited number of networks, or you can build your own controller and run it through its local JSON API. See [README.md in controller/](controller/) for more information.
|
||||
|
||||
### Building from Source
|
||||
|
||||
For Mac, Linux, and BSD, just type "make" (or "gmake" on BSD). You won't need much installed; here are the requirements for various platforms:
|
||||
|
||||
* **Mac**: Xcode command line tools. It should build on OSX 10.7 or newer.
|
||||
* **Linux**: gcc/g++ (4.9 or newer recommended) or clang/clang++ (3.4 or newer recommended) Makefile will use clang by default if available. The Linux build will auto-detect the presence of development headers for *json-parser*, *http-parser*, *li8bnatpmp*, and *libminiupnpc* and will link against the system libraries for these if they are present and recent enough. Otherwise the bundled versions in [ext/](ext/) will be used. Type `make install` to install the binaries and other files on the system, though this will not create init.d or systemd links.
|
||||
* **FreeBSD**: C++ compiler (G++ usually) and GNU make (gmake).
|
||||
|
||||
Each supported platform has its own *make-XXX.mk* file that contains the actual make rules for the platform. The right .mk file is included by the main Makefile based on the GNU make *OSTYPE* variable. Take a look at the .mk file for your platform for other targets, debug build rules, etc.
|
||||
- **Mac**
|
||||
- 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. (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.
|
||||
- **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 2017. Older versions may not work. Clang or MinGW will also probably work but may require some makefile hacking.
|
||||
- **FreeBSD**
|
||||
- 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`).
|
||||
- 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.
|
||||
|
||||
Windows, of course, is special. We build for Windows with Microsoft Visual Studio 2012 on Windows 7. A solution file is located in the *windows/* subfolder. Newer versions of Visual Studio (and Windows) may work but haven't been tested. Older versions almost certainly will not, since they lack things like *stdint.h* and certain STL features. MinGW or other ports of gcc/clang to Windows should also work but haven't been tested.
|
||||
|
||||
32 and 64 bit X86 and ARM (e.g. Raspberry Pi, Android) are officially supported. Community members have built for MIPS and Sparc without issues.
|
||||
|
||||
### Running
|
||||
|
||||
Running *zerotier-one* with -h will show help.
|
||||
@ -62,7 +77,7 @@ The service is controlled via the JSON API, which by default is available at 127
|
||||
Here's where home folders live (by default) on each OS:
|
||||
|
||||
* **Linux**: `/var/lib/zerotier-one`
|
||||
* **FreeBSD**: `/var/db/zerotier-one`
|
||||
* **FreeBSD** / **OpenBSD**: `/var/db/zerotier-one`
|
||||
* **Mac**: `/Library/Application Support/ZeroTier/One`
|
||||
* **Windows**: `\ProgramData\ZeroTier\One` (That's for Windows 7. The base 'shared app data' folder might be different on different Windows versions.)
|
||||
|
||||
@ -72,7 +87,7 @@ Running ZeroTier One on a Mac is the same, but OSX requires a kernel extension.
|
||||
|
||||
This will create the home folder for Mac, place *tap.kext* there, and set its modes correctly to enable ZeroTier One to manage it with *kextload* and *kextunload*.
|
||||
|
||||
### Troubleshooting
|
||||
### Basic Troubleshooting
|
||||
|
||||
For most users, it just works.
|
||||
|
||||
@ -88,14 +103,6 @@ ZeroTier One peers will automatically locate each other and communicate directly
|
||||
|
||||
Users behind certain types of firewalls and "symmetric" NAT devices may not able able to connect to external peers directly at all. ZeroTier has limited support for port prediction and will *attempt* to traverse symmetric NATs, but this doesn't always work. If P2P connectivity fails you'll be bouncing UDP packets off our relay servers resulting in slower performance. Some NAT router(s) have a configurable NAT mode, and setting this to "full cone" will eliminate this problem. If you do this you may also see a magical improvement for things like VoIP phones, Skype, BitTorrent, WebRTC, certain games, etc., since all of these use NAT traversal techniques similar to ours.
|
||||
|
||||
If you're interested, there's a [technical deep dive about NAT traversal on our blog](https://www.zerotier.com/blog/?p=226). 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).
|
||||
|
270
RELEASE-NOTES.md
Normal file
270
RELEASE-NOTES.md
Normal file
@ -0,0 +1,270 @@
|
||||
ZeroTier Release Notes
|
||||
======
|
||||
|
||||
# Version 1.9.0 (2.0 beta)
|
||||
|
||||
Version 2.0 is a very significant release with many changes. It remains backward compatibility to version 1.4.0 (and possibly earlier versions but this is not guaranteed) but makes numerous local and behavioral changes that should be reviewed before upgrading production systems.
|
||||
|
||||
After this release we're going to be working to get to a more frequent, less extreme, more "agile" release cadence.
|
||||
|
||||
Protocol changes:
|
||||
|
||||
* Trusted paths have been completely removed. The new AES mode is so fast on CPUs with AES acceleration that much of the rationale for this is gone, and this feature was never used much to begin with due to inconvenience and obvious security concerns. Environments using trusted paths will need to upgrade all nodes at once.
|
||||
* The symmetric encryption algorithm and mode is now AES-GMAC-SIV, a variation of AES-GCM using the same primitives but offering superior security bounds and behavior under non-ideal conditions. It's also a lot faster than Salsa20/12 and Poly1305 on CPUs with AES acceleration (almost all desktops, laptops, and newer routers and phones). Salsa20/12 with Poly1305 is still supported for communication with older versions and small devices that lack AES acceleration.
|
||||
* A new identity type (1) has been introduced that contains both Curve25519 and NIST P-384 public key types, but classic type 0 remains the default for new identities for now. ECDH key agreement between V1 identities uses both keys and hashes the resulting secrets to yield security equal to the best of the two, but V1 identities can also agree with V0 identities using only their Curve25519 component.
|
||||
* Roots can now be joined and left like networks in a much more convenient way, and the old "moon" and "planet" terminology is deprecated.
|
||||
* A new peer to peer multicast algorithm has been introduced that offers much better scalability and better performance, especially when the physical network itself is hub-and-spoke with many low latency peers connected by higher latency WAN links.
|
||||
* Forward secrecy is finally supported via periodic re-keying using ephemeral asymmetric keys. Both Curve25519 and NIST P-384 keys are used with secrets being hashed to provide security equal to the stronger of the two curves.
|
||||
* As part of forward secrecy implementation peers now always exchange HELLO messages even if they don't have a direct path.
|
||||
* Compression is only enabled for control packets as almost all data packets are largely un-compressable.
|
||||
* New NAT traversal tricks have been added, such as (ab)use of port 500.
|
||||
|
||||
Code changes:
|
||||
|
||||
* Migrated from GNU make to cmake for easier cross platform builds and simplified build files.
|
||||
* The core network hypervisor has been significantly refactored, almost amounting to a partial rewrite.
|
||||
* Critical packet handling paths have been streamlined with unnecessary memcpy() steps removed.
|
||||
* Host service code has been completely rewritten in Go. Packet handling code remains in C++, but Go offers superior developer productivity when it comes to implementing more complex local service and local API features. Go imposes a little bit more memory overhead but not much and has been tuned to minimize memory use.
|
||||
|
||||
User interface:
|
||||
|
||||
* Command line interface has been redesigned and rewritten. Old commands names are supported but their output will be different.
|
||||
|
||||
Other things:
|
||||
|
||||
* The V2 design, protocol, and cryptographic primitives (AES-GMAC-SIV) have been security audited by [Trail of Bits](https://www.trailofbits.com), and the code is being audited as well prior to full 2.0 release.
|
||||
|
||||
---
|
||||
|
||||
# Older version release notes
|
||||
|
||||
# 2019-08-30 -- Version 1.4.6
|
||||
|
||||
* Update default root list to latest
|
||||
* ARM32 platform build and flag fixes
|
||||
* Add a clarification line to LICENSE.txt
|
||||
* Fix license message in CLI
|
||||
* Windows service now looks for service command line arguments
|
||||
* Fixed a bug that could cause excessive queued multicasts
|
||||
|
||||
# 2019-08-23 -- Version 1.4.4
|
||||
|
||||
* Change license from GPL3 to BSL 1.1, see LICENSE.txt
|
||||
* Fix an issue with the "ipauth" rule and auto-generated unforgeable IPv6 addresses
|
||||
* Fix socket/bind errors setting IPs and routes on Linux
|
||||
|
||||
# 2019-08-12 -- Version 1.4.2
|
||||
|
||||
* Fix high CPU use bug on some platforms
|
||||
* Fix issues with PostgreSQL controller DB (only affects Central)
|
||||
* Restore backward compatibility with MacOS versions prior to 10.13
|
||||
|
||||
# 2019-07-29 -- Version 1.4.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
* Mac version no longer requires a kernel extension, instead making use of the [feth interfaces](https://apple.stackexchange.com/questions/337715/fake-ethernet-interfaces-feth-if-fake-anyone-ever-seen-this).
|
||||
* Added support for concurrent multipath (multiple paths at once) with traffic weighting by link quality and faster recovery from lost links.
|
||||
* Added under-the-hood support for QoS (not yet exposed) that will eventually be configurable via our rules engine.
|
||||
|
||||
### Minor Changes and Bug Fixes
|
||||
|
||||
* Experimental controller DB driver for [LF](https://github.com/zerotier/lf) to store network controller data (LFDB.cpp / LFDB.hpp).
|
||||
* Modified credential push and direct path push timings and algorithms to somewhat reduce "chattiness" of the protocol when idle. More radical background overhead reductions will have to wait for the 2.x line.
|
||||
* Removed our beta/half-baked integration of Central with the Windows UI. We're going to do a whole new UI of some kind in the future at least for Windows and Mac.
|
||||
* Fixed stack overflow issues on Linux versions using musl libc.
|
||||
* Fixed some alignment problems reported on ARM and ARM64, but some reports we could not reproduce so please report any issues with exact chip, OS/distro, and ZeroTier version in use.
|
||||
* Fixed numerous other small issues and bugs such as ARM alignment issues causing crashes on some devices.
|
||||
* Windows now sets the adapter name such that it is consistent in both the Windows UI and command line utilities.
|
||||
|
||||
# 2018-07-27 -- Version 1.2.12
|
||||
|
||||
* Fixed a bug that caused exits to take a long time on Mac due to huge numbers of redundant attempts to delete managed routes.
|
||||
* Fixed a socket limit problem on Windows that caused the ZeroTier service to run out of sockets, causing the UI and CLI to be unable to access the API.
|
||||
* Fixed a threading bug in the ZeroTier Core, albeit one that never manifested on the regular ZeroTier One service/client.
|
||||
* Fixed a bug that could cause the service to crash if an authorized local client accessed an invalid URL via the control API. (Not exploitable since you needed admin access anyway.)
|
||||
|
||||
# 2018-05-08 -- Version 1.2.10
|
||||
|
||||
* Fix bug loading `moons.d/` files for federated root operation.
|
||||
* Fix compile problem with ZT_DEBUG on some versions of `clang`
|
||||
* Fix slow network startup bug related to loading of `networks.d/` cache files
|
||||
|
||||
# 2018-04-27 -- Version 1.2.8
|
||||
|
||||
* Linux version once again builds with PIE (position independent executable) flags
|
||||
* Fixed bug in zerotier-idtool file sign and verify
|
||||
* Fixed minor OSX app typo
|
||||
* Merged alpha NetBSD support (mostly untested, so YMMV)
|
||||
* Merged several minor typo and one-liner bug fixes
|
||||
|
||||
# 2018-04-17 -- Version 1.2.6
|
||||
|
||||
* Features and Core Improvements
|
||||
* Path selection has been overhauled to improve path stability, simplify code, and prepare for multi-path and trunking in the next major release.
|
||||
* This version introduces remote tracing for remote diagnostics. Network controllers can set a node (usually the controller itself) to receive remote tracing events from all members of the network or from select members. Events are only sent if they pertain to a given network for security reasons.
|
||||
* Multicast replication can now be done by designated multicast replicators on a network (flagged as such at the controller) rather than by the sender. Most users won't want this, but it's useful for specialized use cases on hub-and-spoke networks and for low-power devices.
|
||||
* Cryptographic performance improvements on several platforms.
|
||||
* Multithreaded performance improvements throughout the code base, including the use of an inline lightweight spinlock for low-contention resources.
|
||||
* Bugs fixed
|
||||
* Disappearing routes on Mac (GitHub issue #600)
|
||||
* Route flapping and path instability in some dual-stack V4/V6 networks
|
||||
* Blacklist (in local.conf) doesn't work reliably (GitHub issue #656)
|
||||
* Connection instabilities due to unsigned integer overflows in timing comparisons (use int64_t instead of uint64_t)
|
||||
* Binaries don't run on some older or lower-end 32-bit ARM chips (build problem)
|
||||
* ARM NEON crypto code crashes (build problem)
|
||||
* Fixed some lock ordering issues revealed by "valgrind" tool
|
||||
* The "zerotier-idtool" command could not be accessed from "zerotier-one" via command line switch
|
||||
* Leaking sockets on some platforms when uPnP/NAT-PMP is enabled
|
||||
* 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 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).
|
||||
* The Windows UI can now log into ZeroTier Central and join networks via the Central API.
|
||||
* The `zerotier-idtool` command should now work on Windows without ugly hacks.
|
||||
* Upgraded the installer version.
|
||||
* Made a few changes to hopefully fix sporadic "will not uninstall" problems, though we cannot duplicate these issues ourselves.
|
||||
* Linux
|
||||
* Device names are now generated deterministically based on network IDs for all newly joined networks.
|
||||
* Android
|
||||
* Multicast now works on Android in most cases! Android apps can send and receive multicast and subscribe to multicast group IPs. Note that in some cases the app must bind to the specific correct interface for this to work.
|
||||
* IPv6 can be disabled in UI for cases where it causes problems.
|
||||
|
||||
# 2017-04-20 -- Version 1.2.4
|
||||
|
||||
* Managed routes are now only bifurcated for the default route. This is a change in behavior, though few people will probably notice. Bifurcating all managed routes was causing more trouble than it was worth for most users.
|
||||
* Up to 2X crypto speedup on x86-64 (except Windows, which will take some porting) and 32-bit ARM platforms due to integration of fast assembly language implementations of Salsa20/12 from the [supercop](http://bench.cr.yp.to/supercop.html) code base. These were written by Daniel J. Bernstein and are in the public domain. My Macbook Pro (Core i5 2.8ghz) now does almost 1.5GiB/sec Salsa20/12 per core and a Raspberry Pi got a 2X boost. 64-bit ARM support and Windows support will take some work but should not be too hard.
|
||||
* Refactored code that manages credentials to greatly reduce memory use in most cases. This may also result in a small performance improvement.
|
||||
* Reworked and simplified path selection and priority logic to fix path instability and dead path persistence edge cases. There have been some sporadic reports of persistent path instabilities and dead paths hanging around that take minutes to resolve. These have proven difficult to reproduce in house, but hopefully this will fix them. In any case it seems to speed up path establishment in our tests and it makes the code simpler and more readable.
|
||||
* Eliminated some unused cruft from the code around path management and in the peer class.
|
||||
* Fixed an issue causing build problems on some MIPS architecture systems.
|
||||
* Fixed Windows forgetting routes on sleep/wake or in some other circumstances. (GitHub issue #465)
|
||||
|
||||
# 2017-03-17 -- Version 1.2.2
|
||||
|
||||
* A bug causing unreliable multicast propagation (GitHub issue #461).
|
||||
* A crash in ARM binaries due to a build chain and flags problem.
|
||||
* A bug in the network controller preventing members from being listed (GitHub issue #460).
|
||||
|
||||
# 2017-03-14 -- Version 1.2.0
|
||||
|
||||
Version 1.2.0 is a major milestone release representing almost nine months of work. It includes our rules engine for distributed network packet filtering and security monitoring, federated roots, and many other architectural and UI improvements and bug fixes.
|
||||
|
||||
## New Features in 1.2.0
|
||||
|
||||
### The ZeroTier Rules Engine
|
||||
|
||||
The largest new feature in 1.2.0, and the product of many months of work, is our advanced network rules engine. With this release we achieve traffic control, security monitoring, and micro-segmentation capability on par with many enterprise SDN solutions designed for use in advanced data centers and corporate networks.
|
||||
|
||||
Rules allow you to filter packets on your network and vector traffic to security observers. Security observation can be performed in-band using REDIRECT or out of band using TEE.
|
||||
|
||||
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/).)
|
||||
|
||||
### Root Server Federation
|
||||
|
||||
It's now possible to create your own root servers and add them to the root server pool on your nodes. This is done by creating what's called a "moon," which is a signed enumeration of root servers and their stable points on the network. Refer to the [manual](https://www.zerotier.com/manual.shtml) for instructions.
|
||||
|
||||
Federated roots achieve a number of things:
|
||||
|
||||
* You can deploy your own infrastructure to reduce dependency on ours.
|
||||
* You can deploy roots *inside your LAN* to ensure that network connectivity inside your facility still works if the Internet goes down. This is the first step toward making ZeroTier viable as an in-house SDN solution.
|
||||
* Roots can be deployed inside national boundaries for countries with data residency laws or "great firewalls." (As of 1.2.0 there is still no way to force all traffic to use these roots, but that will be easy to do in a later version.)
|
||||
* Last but not least this makes ZeroTier somewhat less centralized by eliminating any hard dependency on ZeroTier, Inc.'s infrastructure.
|
||||
|
||||
Our roots will of course remain and continue to provide zero-configuration instant-on deployment, a secure global authority for identities, and free traffic relaying for those who can't establish peer to peer connections.
|
||||
|
||||
### Local Configuration
|
||||
|
||||
An element of our design philosophy is "features are bugs." This isn't an absolute dogma but more of a guiding principle. We try as hard as we can to avoid adding features, especially "knobs" that must be tweaked by a user.
|
||||
|
||||
As of 1.2.0 we've decided that certain knobs are unavoidable, and so there is now a `local.conf` file that can be used to configure them. See the ZeroTier One documentation for these. They include:
|
||||
|
||||
* Blacklisting interfaces you want to make sure ZeroTier doesn't use for network traffic, such as VPNs, slow links, or backplanes designated for only certain kinds of traffic.
|
||||
* Turning uPnP/NAT-PMP on or off.
|
||||
* Configuring software updates on Windows and Mac platforms.
|
||||
* Defining trusted paths (the old trusted paths file is now deprecated)
|
||||
* Setting the ZeroTier main port so it doesn't have to be changed on the command line, which is very inconvenient in many cases.
|
||||
|
||||
### Improved In-Band Software Updates
|
||||
|
||||
A good software update system for Windows and Mac clients has been a missing feature in previous versions. It does exist but we've been shy about using it so far due to its fragility in some environments.
|
||||
|
||||
We've greatly improved this mechanism in 1.2.0. Not only does it now do a better job of actually invoking the update, but it also transfers updates in-band using the ZeroTier protocol. This means it can work in environments that do not allows http/https traffic or that force it through proxies. There's also now an update channel setting: `beta` or `release` (the default).
|
||||
|
||||
Software updates are authenticated three ways:
|
||||
|
||||
1. ZeroTier's own signing key is used to sign all updates and this signature is checked prior to installation. ZeroTier, Inc.'s signatures are performed on an air-gapped machine.
|
||||
|
||||
2. Updates for Mac and Windows are signed using Apple and Microsoft (DigiCert EV) keys and will not install unless these signatures are also valid.
|
||||
|
||||
3. The new in-band update mechanism also authenticates the source of the update via ZeroTier's built-in security features. This provides transport security, while 1 and 2 provide security of the update at rest.
|
||||
|
||||
Updates are now configurable via `local.conf`. There are three options: `disable`, `download`, and `apply`. The third (apply) is the default for official builds on Windows and Mac, making updates happen silently and automatically as they do for popular browsers like Chrome and Firefox. Updates are disabled by default on Linux and other Unix-type systems as these are typically updated through package managers.
|
||||
|
||||
### Path Link Quality Awareness
|
||||
|
||||
Version 1.2.0 is now aware of the link quality of direct paths with other 1.2.0 nodes. This information isn't used yet but is visible through the JSON API. (Quality always shows as 100% with pre-1.2.0 nodes.) Quality is measured passively with no additional overhead using a counter based packet loss detection algorithm.
|
||||
|
||||
This information is visible from the command line via `listpeers`:
|
||||
|
||||
200 listpeers XXXXXXXXXX 199.XXX.XXX.XXX/9993;10574;15250;1.00 48 1.2.0 LEAF
|
||||
200 listpeers XXXXXXXXXX 195.XXX.XXX.XXX/45584;467;7608;0.44 290 1.2.0 LEAF
|
||||
|
||||
The first peer's path is at 100% (1.00), while the second peer's path is suffering quite a bit of packet loss (0.44).
|
||||
|
||||
Link quality awareness is a precursor to intelligent multi-path and QoS support, which will in future versions bring us to feature parity with SD-WAN products like Cisco iWAN.
|
||||
|
||||
### Security Improvements
|
||||
|
||||
Version 1.2.0 adds anti-DOS (denial of service) rate limits and other hardening for improved resiliency against a number of denial of service attack scenarios.
|
||||
|
||||
It also adds a mechanism for instantaneous credential revocation. This can be used to revoke certificates of membership instantly to kick a node off a network (for private networks) and also to revoke capabilities and tags. The new controller sends revocations by default when a peer is de-authorized.
|
||||
|
||||
Revocations propagate using a "rumor mill" peer to peer algorithm. This means that a controller need only successfully send a revocation to at least one member of a network with connections to other active members. At this point the revocation will flood through the network peer to peer very quickly. This helps make revocations more robust in the face of poor connectivity with the controller or attempts to incapacitate the controller with denial of service attacks, as well as making revocations faster on huge networks.
|
||||
|
||||
### Windows and Macintosh UI Improvements (ZeroTier One)
|
||||
|
||||
The Mac has a whole new UI built natively in Objective-C. It provides a pulldown similar in appearance and operation to the Mac WiFi task bar menu.
|
||||
|
||||
The Windows UI has also been improved and now provides a task bar icon that can be right-clicked to manage networks. Both now expose managed route and IP permissions, allowing nodes to easily opt in to full tunnel operation if you have a router configured on your network.
|
||||
|
||||
### Ad-Hoc Networks
|
||||
|
||||
A special kind of public network called an ad-hoc network may be accessed by joining a network ID with the format:
|
||||
|
||||
ffSSSSEEEE000000
|
||||
| | | |
|
||||
| | | Reserved for future use, must be 0
|
||||
| | End of port range (hex)
|
||||
| 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 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.
|
||||
|
||||
Keep in mind that these networks are public and anyone in the entire world can join them. Care must be taken to avoid exposing vulnerable services or sharing unwanted files or other resources.
|
||||
|
||||
### Network Controller (Partial) Rewrite
|
||||
|
||||
The network controller has been largely rewritten to use a simple in-filesystem JSON data store in place of SQLite, and it is now included by default in all Windows, Mac, Linux, and BSD builds. This means any desktop or server node running ZeroTier One can now be a controller with no recompilation needed.
|
||||
|
||||
If you have data in an old SQLite3 controller we've included a NodeJS script in `controller/migrate-sqlite` to migrate data to the new format. If you don't migrate, members will start getting `NOT_FOUND` when they attempt to query for updates.
|
||||
|
||||
## 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.
|
||||
* **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.
|
||||
|
||||
## Other Improvements in 1.2.0
|
||||
|
||||
* **Improved dead path detection**: ZeroTier is now more aggressive about expiring paths that do not seem to be active. If a path seems marginal it is re-confirmed before re-use.
|
||||
* **Minor performance improvements**: We've reduced unnecessary memcpy's and made a few other performance improvements in the core.
|
||||
* **Linux static binaries**: For our official packages (the ones in the download.zerotier.com apt and yum repositories) we now build Linux binaries with static linking. Hopefully this will stop all the bug reports relating to library inconsistencies, as well as allowing our deb packages to run on a wider variety of Debian-based distributions. (There are far too many of these to support officially!) The overhead for this is very small, especially since we built our static versions against musl-libc. Distribution maintainers are of course free to build dynamically linked versions for inclusion into distributions; this only affects our official binaries.
|
BIN
artwork/AppIcon_1024x1024.png
Normal file
BIN
artwork/AppIcon_1024x1024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
artwork/AppIcon_20x20.png
Normal file
BIN
artwork/AppIcon_20x20.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 621 B |
BIN
artwork/AppIcon_60x60.png
Normal file
BIN
artwork/AppIcon_60x60.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
artwork/AppIcon_90x90.png
Normal file
BIN
artwork/AppIcon_90x90.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
artwork/ZeroTierIcon32x32.png
Normal file
BIN
artwork/ZeroTierIcon32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
408
attic/Filter.cpp
408
attic/Filter.cpp
@ -1,408 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2015 ZeroTier, Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "RuntimeEnvironment.hpp"
|
||||
#include "Logger.hpp"
|
||||
#include "Filter.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
const char *const Filter::UNKNOWN_NAME = "(unknown)";
|
||||
const Range<unsigned int> Filter::ANY;
|
||||
|
||||
static inline Range<unsigned int> __parseRange(char *r)
|
||||
throw(std::invalid_argument)
|
||||
{
|
||||
char *saveptr = (char *)0;
|
||||
unsigned int a = 0;
|
||||
unsigned int b = 0;
|
||||
unsigned int fn = 0;
|
||||
for(char *f=Utils::stok(r,"-",&saveptr);(f);f=Utils::stok((char *)0,"-",&saveptr)) {
|
||||
if (*f) {
|
||||
switch(fn++) {
|
||||
case 0:
|
||||
if (*f != '*')
|
||||
a = b = (unsigned int)strtoul(f,(char **)0,10);
|
||||
break;
|
||||
case 1:
|
||||
if (*f != '*')
|
||||
b = (unsigned int)strtoul(f,(char **)0,10);
|
||||
break;
|
||||
default:
|
||||
throw std::invalid_argument("rule range must be <int>, <int>-<int>, or *");
|
||||
}
|
||||
}
|
||||
}
|
||||
return Range<unsigned int>(a,b);
|
||||
}
|
||||
|
||||
Filter::Rule::Rule(const char *s)
|
||||
throw(std::invalid_argument)
|
||||
{
|
||||
char *saveptr = (char *)0;
|
||||
char tmp[256];
|
||||
if (!Utils::scopy(tmp,sizeof(tmp),s))
|
||||
throw std::invalid_argument("rule string too long");
|
||||
unsigned int fn = 0;
|
||||
for(char *f=Utils::stok(tmp,";",&saveptr);(f);f=Utils::stok((char *)0,";",&saveptr)) {
|
||||
if (*f) {
|
||||
switch(fn++) {
|
||||
case 0:
|
||||
_etherType = __parseRange(f);
|
||||
break;
|
||||
case 1:
|
||||
_protocol = __parseRange(f);
|
||||
break;
|
||||
case 2:
|
||||
_port = __parseRange(f);
|
||||
break;
|
||||
default:
|
||||
throw std::invalid_argument("rule string has unknown extra fields");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fn != 3)
|
||||
throw std::invalid_argument("rule string must contain 3 fields");
|
||||
}
|
||||
|
||||
bool Filter::Rule::operator()(unsigned int etype,const void *data,unsigned int len) const
|
||||
throw(std::invalid_argument)
|
||||
{
|
||||
if ((!_etherType)||(_etherType(etype))) { // ethertype is ANY, or matches
|
||||
// Ethertype determines meaning of protocol and port
|
||||
switch(etype) {
|
||||
case ZT_ETHERTYPE_IPV4:
|
||||
if (len > 20) {
|
||||
if ((!_protocol)||(_protocol(((const uint8_t *)data)[9]))) { // protocol is ANY or match
|
||||
if (!_port) // port is ANY
|
||||
return true;
|
||||
|
||||
// Don't match on fragments beyond fragment 0. If we've blocked
|
||||
// fragment 0, further fragments will fall on deaf ears anyway.
|
||||
if ((Utils::ntoh(((const uint16_t *)data)[3]) & 0x1fff))
|
||||
return false;
|
||||
|
||||
// Internet header length determines where data begins, in multiples of 32 bits
|
||||
unsigned int ihl = 4 * (((const uint8_t *)data)[0] & 0x0f);
|
||||
|
||||
switch(((const uint8_t *)data)[9]) { // port's meaning depends on IP protocol
|
||||
case ZT_IPPROTO_ICMP:
|
||||
// For ICMP, port is ICMP type
|
||||
return _port(((const uint8_t *)data)[ihl]);
|
||||
case ZT_IPPROTO_TCP:
|
||||
case ZT_IPPROTO_UDP:
|
||||
case ZT_IPPROTO_SCTP:
|
||||
case ZT_IPPROTO_UDPLITE:
|
||||
// For these, port is destination port. Protocol designers were
|
||||
// nice enough to put the field in the same place.
|
||||
return _port(((const uint16_t *)data)[(ihl / 2) + 1]);
|
||||
default:
|
||||
// port has no meaning for other IP types, so ignore it
|
||||
return true;
|
||||
}
|
||||
|
||||
return false; // no match on port
|
||||
}
|
||||
} else throw std::invalid_argument("undersized IPv4 packet");
|
||||
break;
|
||||
|
||||
case ZT_ETHERTYPE_IPV6:
|
||||
if (len > 40) {
|
||||
int nextHeader = ((const uint8_t *)data)[6];
|
||||
unsigned int pos = 40;
|
||||
while ((pos < len)&&(nextHeader >= 0)&&(nextHeader != 59)) { // 59 == no next header
|
||||
fprintf(stderr,"[rule] V6: start header parse, header %.2x pos %d\n",nextHeader,pos);
|
||||
|
||||
switch(nextHeader) {
|
||||
case 0: // hop-by-hop options
|
||||
case 60: // destination options
|
||||
case 43: // routing
|
||||
case 135: // mobility (mobile IPv6 options)
|
||||
if (_protocol((unsigned int)nextHeader))
|
||||
return true; // match if our goal was to match any of these
|
||||
nextHeader = ((const uint8_t *)data)[pos];
|
||||
pos += 8 + (8 * ((const uint8_t *)data)[pos + 1]);
|
||||
break;
|
||||
case 44: // fragment
|
||||
if (_protocol(44))
|
||||
return true; // match if our goal was to match fragments
|
||||
nextHeader = ((const uint8_t *)data)[pos];
|
||||
pos += 8;
|
||||
break;
|
||||
case ZT_IPPROTO_AH: // AH
|
||||
return _protocol(ZT_IPPROTO_AH); // true if AH is matched protocol, otherwise false since packet will be IPsec
|
||||
case ZT_IPPROTO_ESP: // ESP
|
||||
return _protocol(ZT_IPPROTO_ESP); // true if ESP is matched protocol, otherwise false since packet will be IPsec
|
||||
case ZT_IPPROTO_ICMPV6:
|
||||
// Only match ICMPv6 if we've selected it specifically
|
||||
if (_protocol(ZT_IPPROTO_ICMPV6)) {
|
||||
// Port is interpreted as ICMPv6 type
|
||||
if ((!_port)||(_port(((const uint8_t *)data)[pos])))
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case ZT_IPPROTO_TCP:
|
||||
case ZT_IPPROTO_UDP:
|
||||
case ZT_IPPROTO_SCTP:
|
||||
case ZT_IPPROTO_UDPLITE:
|
||||
// If we encounter any of these, match if protocol matches or is wildcard as
|
||||
// we'll consider these the "real payload" if present.
|
||||
if ((!_protocol)||(_protocol(nextHeader))) {
|
||||
if ((!_port)||(_port(((const uint16_t *)data)[(pos / 2) + 1])))
|
||||
return true; // protocol matches or is ANY, port is ANY or matches
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
char foo[128];
|
||||
Utils::snprintf(foo,sizeof(foo),"unrecognized IPv6 header type %d",(int)nextHeader);
|
||||
throw std::invalid_argument(foo);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr,"[rule] V6: end header parse, next header %.2x, new pos %d\n",nextHeader,pos);
|
||||
}
|
||||
} else throw std::invalid_argument("undersized IPv6 packet");
|
||||
break;
|
||||
|
||||
default:
|
||||
// For other ethertypes, protocol and port are ignored. What would they mean?
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string Filter::Rule::toString() const
|
||||
{
|
||||
char buf[128];
|
||||
std::string s;
|
||||
|
||||
switch(_etherType.magnitude()) {
|
||||
case 0:
|
||||
s.push_back('*');
|
||||
break;
|
||||
case 1:
|
||||
Utils::snprintf(buf,sizeof(buf),"%u",_etherType.start);
|
||||
s.append(buf);
|
||||
break;
|
||||
default:
|
||||
Utils::snprintf(buf,sizeof(buf),"%u-%u",_etherType.start,_etherType.end);
|
||||
s.append(buf);
|
||||
break;
|
||||
}
|
||||
s.push_back(';');
|
||||
switch(_protocol.magnitude()) {
|
||||
case 0:
|
||||
s.push_back('*');
|
||||
break;
|
||||
case 1:
|
||||
Utils::snprintf(buf,sizeof(buf),"%u",_protocol.start);
|
||||
s.append(buf);
|
||||
break;
|
||||
default:
|
||||
Utils::snprintf(buf,sizeof(buf),"%u-%u",_protocol.start,_protocol.end);
|
||||
s.append(buf);
|
||||
break;
|
||||
}
|
||||
s.push_back(';');
|
||||
switch(_port.magnitude()) {
|
||||
case 0:
|
||||
s.push_back('*');
|
||||
break;
|
||||
case 1:
|
||||
Utils::snprintf(buf,sizeof(buf),"%u",_port.start);
|
||||
s.append(buf);
|
||||
break;
|
||||
default:
|
||||
Utils::snprintf(buf,sizeof(buf),"%u-%u",_port.start,_port.end);
|
||||
s.append(buf);
|
||||
break;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
Filter::Filter(const char *s)
|
||||
throw(std::invalid_argument)
|
||||
{
|
||||
char tmp[16384];
|
||||
if (!Utils::scopy(tmp,sizeof(tmp),s))
|
||||
throw std::invalid_argument("filter string too long");
|
||||
char *saveptr = (char *)0;
|
||||
unsigned int fn = 0;
|
||||
for(char *f=Utils::stok(tmp,",",&saveptr);(f);f=Utils::stok((char *)0,",",&saveptr)) {
|
||||
try {
|
||||
_rules.push_back(Rule(f));
|
||||
++fn;
|
||||
} catch (std::invalid_argument &exc) {
|
||||
char tmp[256];
|
||||
Utils::snprintf(tmp,sizeof(tmp),"invalid rule at index %u: %s",fn,exc.what());
|
||||
throw std::invalid_argument(tmp);
|
||||
}
|
||||
}
|
||||
std::sort(_rules.begin(),_rules.end());
|
||||
}
|
||||
|
||||
std::string Filter::toString() const
|
||||
{
|
||||
std::string s;
|
||||
|
||||
for(std::vector<Rule>::const_iterator r(_rules.begin());r!=_rules.end();++r) {
|
||||
if (s.length() > 0)
|
||||
s.push_back(',');
|
||||
s.append(r->toString());
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void Filter::add(const Rule &r)
|
||||
{
|
||||
for(std::vector<Rule>::iterator rr(_rules.begin());rr!=_rules.end();++rr) {
|
||||
if (r == *rr)
|
||||
return;
|
||||
}
|
||||
_rules.push_back(r);
|
||||
std::sort(_rules.begin(),_rules.end());
|
||||
}
|
||||
|
||||
const char *Filter::etherTypeName(const unsigned int etherType)
|
||||
throw()
|
||||
{
|
||||
switch(etherType) {
|
||||
case ZT_ETHERTYPE_IPV4: return "ETHERTYPE_IPV4";
|
||||
case ZT_ETHERTYPE_ARP: return "ETHERTYPE_ARP";
|
||||
case ZT_ETHERTYPE_RARP: return "ETHERTYPE_RARP";
|
||||
case ZT_ETHERTYPE_ATALK: return "ETHERTYPE_ATALK";
|
||||
case ZT_ETHERTYPE_AARP: return "ETHERTYPE_AARP";
|
||||
case ZT_ETHERTYPE_IPX_A: return "ETHERTYPE_IPX_A";
|
||||
case ZT_ETHERTYPE_IPX_B: return "ETHERTYPE_IPX_B";
|
||||
case ZT_ETHERTYPE_IPV6: return "ETHERTYPE_IPV6";
|
||||
}
|
||||
return UNKNOWN_NAME;
|
||||
}
|
||||
|
||||
const char *Filter::ipProtocolName(const unsigned int ipp)
|
||||
throw()
|
||||
{
|
||||
switch(ipp) {
|
||||
case ZT_IPPROTO_ICMP: return "IPPROTO_ICMP";
|
||||
case ZT_IPPROTO_IGMP: return "IPPROTO_IGMP";
|
||||
case ZT_IPPROTO_TCP: return "IPPROTO_TCP";
|
||||
case ZT_IPPROTO_UDP: return "IPPROTO_UDP";
|
||||
case ZT_IPPROTO_GRE: return "IPPROTO_GRE";
|
||||
case ZT_IPPROTO_ESP: return "IPPROTO_ESP";
|
||||
case ZT_IPPROTO_AH: return "IPPROTO_AH";
|
||||
case ZT_IPPROTO_ICMPV6: return "IPPROTO_ICMPV6";
|
||||
case ZT_IPPROTO_OSPF: return "IPPROTO_OSPF";
|
||||
case ZT_IPPROTO_IPIP: return "IPPROTO_IPIP";
|
||||
case ZT_IPPROTO_IPCOMP: return "IPPROTO_IPCOMP";
|
||||
case ZT_IPPROTO_L2TP: return "IPPROTO_L2TP";
|
||||
case ZT_IPPROTO_SCTP: return "IPPROTO_SCTP";
|
||||
case ZT_IPPROTO_FC: return "IPPROTO_FC";
|
||||
case ZT_IPPROTO_UDPLITE: return "IPPROTO_UDPLITE";
|
||||
case ZT_IPPROTO_HIP: return "IPPROTO_HIP";
|
||||
}
|
||||
return UNKNOWN_NAME;
|
||||
}
|
||||
|
||||
const char *Filter::icmpTypeName(const unsigned int icmpType)
|
||||
throw()
|
||||
{
|
||||
switch(icmpType) {
|
||||
case ZT_ICMP_ECHO_REPLY: return "ICMP_ECHO_REPLY";
|
||||
case ZT_ICMP_DESTINATION_UNREACHABLE: return "ICMP_DESTINATION_UNREACHABLE";
|
||||
case ZT_ICMP_SOURCE_QUENCH: return "ICMP_SOURCE_QUENCH";
|
||||
case ZT_ICMP_REDIRECT: return "ICMP_REDIRECT";
|
||||
case ZT_ICMP_ALTERNATE_HOST_ADDRESS: return "ICMP_ALTERNATE_HOST_ADDRESS";
|
||||
case ZT_ICMP_ECHO_REQUEST: return "ICMP_ECHO_REQUEST";
|
||||
case ZT_ICMP_ROUTER_ADVERTISEMENT: return "ICMP_ROUTER_ADVERTISEMENT";
|
||||
case ZT_ICMP_ROUTER_SOLICITATION: return "ICMP_ROUTER_SOLICITATION";
|
||||
case ZT_ICMP_TIME_EXCEEDED: return "ICMP_TIME_EXCEEDED";
|
||||
case ZT_ICMP_BAD_IP_HEADER: return "ICMP_BAD_IP_HEADER";
|
||||
case ZT_ICMP_TIMESTAMP: return "ICMP_TIMESTAMP";
|
||||
case ZT_ICMP_TIMESTAMP_REPLY: return "ICMP_TIMESTAMP_REPLY";
|
||||
case ZT_ICMP_INFORMATION_REQUEST: return "ICMP_INFORMATION_REQUEST";
|
||||
case ZT_ICMP_INFORMATION_REPLY: return "ICMP_INFORMATION_REPLY";
|
||||
case ZT_ICMP_ADDRESS_MASK_REQUEST: return "ICMP_ADDRESS_MASK_REQUEST";
|
||||
case ZT_ICMP_ADDRESS_MASK_REPLY: return "ICMP_ADDRESS_MASK_REPLY";
|
||||
case ZT_ICMP_TRACEROUTE: return "ICMP_TRACEROUTE";
|
||||
case ZT_ICMP_MOBILE_HOST_REDIRECT: return "ICMP_MOBILE_HOST_REDIRECT";
|
||||
case ZT_ICMP_MOBILE_REGISTRATION_REQUEST: return "ICMP_MOBILE_REGISTRATION_REQUEST";
|
||||
case ZT_ICMP_MOBILE_REGISTRATION_REPLY: return "ICMP_MOBILE_REGISTRATION_REPLY";
|
||||
}
|
||||
return UNKNOWN_NAME;
|
||||
}
|
||||
|
||||
const char *Filter::icmp6TypeName(const unsigned int icmp6Type)
|
||||
throw()
|
||||
{
|
||||
switch(icmp6Type) {
|
||||
case ZT_ICMP6_DESTINATION_UNREACHABLE: return "ICMP6_DESTINATION_UNREACHABLE";
|
||||
case ZT_ICMP6_PACKET_TOO_BIG: return "ICMP6_PACKET_TOO_BIG";
|
||||
case ZT_ICMP6_TIME_EXCEEDED: return "ICMP6_TIME_EXCEEDED";
|
||||
case ZT_ICMP6_PARAMETER_PROBLEM: return "ICMP6_PARAMETER_PROBLEM";
|
||||
case ZT_ICMP6_ECHO_REQUEST: return "ICMP6_ECHO_REQUEST";
|
||||
case ZT_ICMP6_ECHO_REPLY: return "ICMP6_ECHO_REPLY";
|
||||
case ZT_ICMP6_MULTICAST_LISTENER_QUERY: return "ICMP6_MULTICAST_LISTENER_QUERY";
|
||||
case ZT_ICMP6_MULTICAST_LISTENER_REPORT: return "ICMP6_MULTICAST_LISTENER_REPORT";
|
||||
case ZT_ICMP6_MULTICAST_LISTENER_DONE: return "ICMP6_MULTICAST_LISTENER_DONE";
|
||||
case ZT_ICMP6_ROUTER_SOLICITATION: return "ICMP6_ROUTER_SOLICITATION";
|
||||
case ZT_ICMP6_ROUTER_ADVERTISEMENT: return "ICMP6_ROUTER_ADVERTISEMENT";
|
||||
case ZT_ICMP6_NEIGHBOR_SOLICITATION: return "ICMP6_NEIGHBOR_SOLICITATION";
|
||||
case ZT_ICMP6_NEIGHBOR_ADVERTISEMENT: return "ICMP6_NEIGHBOR_ADVERTISEMENT";
|
||||
case ZT_ICMP6_REDIRECT_MESSAGE: return "ICMP6_REDIRECT_MESSAGE";
|
||||
case ZT_ICMP6_ROUTER_RENUMBERING: return "ICMP6_ROUTER_RENUMBERING";
|
||||
case ZT_ICMP6_NODE_INFORMATION_QUERY: return "ICMP6_NODE_INFORMATION_QUERY";
|
||||
case ZT_ICMP6_NODE_INFORMATION_RESPONSE: return "ICMP6_NODE_INFORMATION_RESPONSE";
|
||||
case ZT_ICMP6_INV_NEIGHBOR_SOLICITATION: return "ICMP6_INV_NEIGHBOR_SOLICITATION";
|
||||
case ZT_ICMP6_INV_NEIGHBOR_ADVERTISEMENT: return "ICMP6_INV_NEIGHBOR_ADVERTISEMENT";
|
||||
case ZT_ICMP6_MLDV2: return "ICMP6_MLDV2";
|
||||
case ZT_ICMP6_HOME_AGENT_ADDRESS_DISCOVERY_REQUEST: return "ICMP6_HOME_AGENT_ADDRESS_DISCOVERY_REQUEST";
|
||||
case ZT_ICMP6_HOME_AGENT_ADDRESS_DISCOVERY_REPLY: return "ICMP6_HOME_AGENT_ADDRESS_DISCOVERY_REPLY";
|
||||
case ZT_ICMP6_MOBILE_PREFIX_SOLICITATION: return "ICMP6_MOBILE_PREFIX_SOLICITATION";
|
||||
case ZT_ICMP6_MOBILE_PREFIX_ADVERTISEMENT: return "ICMP6_MOBILE_PREFIX_ADVERTISEMENT";
|
||||
case ZT_ICMP6_CERTIFICATION_PATH_SOLICITATION: return "ICMP6_CERTIFICATION_PATH_SOLICITATION";
|
||||
case ZT_ICMP6_CERTIFICATION_PATH_ADVERTISEMENT: return "ICMP6_CERTIFICATION_PATH_ADVERTISEMENT";
|
||||
case ZT_ICMP6_MULTICAST_ROUTER_ADVERTISEMENT: return "ICMP6_MULTICAST_ROUTER_ADVERTISEMENT";
|
||||
case ZT_ICMP6_MULTICAST_ROUTER_SOLICITATION: return "ICMP6_MULTICAST_ROUTER_SOLICITATION";
|
||||
case ZT_ICMP6_MULTICAST_ROUTER_TERMINATION: return "ICMP6_MULTICAST_ROUTER_TERMINATION";
|
||||
case ZT_ICMP6_RPL_CONTROL_MESSAGE: return "ICMP6_RPL_CONTROL_MESSAGE";
|
||||
}
|
||||
return UNKNOWN_NAME;
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
284
attic/Filter.hpp
284
attic/Filter.hpp
@ -1,284 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2015 ZeroTier, Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#ifndef _ZT_FILTER_HPP
|
||||
#define _ZT_FILTER_HPP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "Range.hpp"
|
||||
|
||||
/* Ethernet frame types that might be relevant to us */
|
||||
#define ZT_ETHERTYPE_IPV4 0x0800
|
||||
#define ZT_ETHERTYPE_ARP 0x0806
|
||||
#define ZT_ETHERTYPE_RARP 0x8035
|
||||
#define ZT_ETHERTYPE_ATALK 0x809b
|
||||
#define ZT_ETHERTYPE_AARP 0x80f3
|
||||
#define ZT_ETHERTYPE_IPX_A 0x8137
|
||||
#define ZT_ETHERTYPE_IPX_B 0x8138
|
||||
#define ZT_ETHERTYPE_IPV6 0x86dd
|
||||
|
||||
/* IP protocols we might care about */
|
||||
#define ZT_IPPROTO_ICMP 0x01
|
||||
#define ZT_IPPROTO_IGMP 0x02
|
||||
#define ZT_IPPROTO_TCP 0x06
|
||||
#define ZT_IPPROTO_UDP 0x11
|
||||
#define ZT_IPPROTO_GRE 0x2f
|
||||
#define ZT_IPPROTO_ESP 0x32
|
||||
#define ZT_IPPROTO_AH 0x33
|
||||
#define ZT_IPPROTO_ICMPV6 0x3a
|
||||
#define ZT_IPPROTO_OSPF 0x59
|
||||
#define ZT_IPPROTO_IPIP 0x5e
|
||||
#define ZT_IPPROTO_IPCOMP 0x6c
|
||||
#define ZT_IPPROTO_L2TP 0x73
|
||||
#define ZT_IPPROTO_SCTP 0x84
|
||||
#define ZT_IPPROTO_FC 0x85
|
||||
#define ZT_IPPROTO_UDPLITE 0x88
|
||||
#define ZT_IPPROTO_HIP 0x8b
|
||||
|
||||
/* IPv4 ICMP types */
|
||||
#define ZT_ICMP_ECHO_REPLY 0
|
||||
#define ZT_ICMP_DESTINATION_UNREACHABLE 3
|
||||
#define ZT_ICMP_SOURCE_QUENCH 4
|
||||
#define ZT_ICMP_REDIRECT 5
|
||||
#define ZT_ICMP_ALTERNATE_HOST_ADDRESS 6
|
||||
#define ZT_ICMP_ECHO_REQUEST 8
|
||||
#define ZT_ICMP_ROUTER_ADVERTISEMENT 9
|
||||
#define ZT_ICMP_ROUTER_SOLICITATION 10
|
||||
#define ZT_ICMP_TIME_EXCEEDED 11
|
||||
#define ZT_ICMP_BAD_IP_HEADER 12
|
||||
#define ZT_ICMP_TIMESTAMP 13
|
||||
#define ZT_ICMP_TIMESTAMP_REPLY 14
|
||||
#define ZT_ICMP_INFORMATION_REQUEST 15
|
||||
#define ZT_ICMP_INFORMATION_REPLY 16
|
||||
#define ZT_ICMP_ADDRESS_MASK_REQUEST 17
|
||||
#define ZT_ICMP_ADDRESS_MASK_REPLY 18
|
||||
#define ZT_ICMP_TRACEROUTE 30
|
||||
#define ZT_ICMP_MOBILE_HOST_REDIRECT 32
|
||||
#define ZT_ICMP_MOBILE_REGISTRATION_REQUEST 35
|
||||
#define ZT_ICMP_MOBILE_REGISTRATION_REPLY 36
|
||||
|
||||
/* IPv6 ICMP types */
|
||||
#define ZT_ICMP6_DESTINATION_UNREACHABLE 1
|
||||
#define ZT_ICMP6_PACKET_TOO_BIG 2
|
||||
#define ZT_ICMP6_TIME_EXCEEDED 3
|
||||
#define ZT_ICMP6_PARAMETER_PROBLEM 4
|
||||
#define ZT_ICMP6_ECHO_REQUEST 128
|
||||
#define ZT_ICMP6_ECHO_REPLY 129
|
||||
#define ZT_ICMP6_MULTICAST_LISTENER_QUERY 130
|
||||
#define ZT_ICMP6_MULTICAST_LISTENER_REPORT 131
|
||||
#define ZT_ICMP6_MULTICAST_LISTENER_DONE 132
|
||||
#define ZT_ICMP6_ROUTER_SOLICITATION 133
|
||||
#define ZT_ICMP6_ROUTER_ADVERTISEMENT 134
|
||||
#define ZT_ICMP6_NEIGHBOR_SOLICITATION 135
|
||||
#define ZT_ICMP6_NEIGHBOR_ADVERTISEMENT 136
|
||||
#define ZT_ICMP6_REDIRECT_MESSAGE 137
|
||||
#define ZT_ICMP6_ROUTER_RENUMBERING 138
|
||||
#define ZT_ICMP6_NODE_INFORMATION_QUERY 139
|
||||
#define ZT_ICMP6_NODE_INFORMATION_RESPONSE 140
|
||||
#define ZT_ICMP6_INV_NEIGHBOR_SOLICITATION 141
|
||||
#define ZT_ICMP6_INV_NEIGHBOR_ADVERTISEMENT 142
|
||||
#define ZT_ICMP6_MLDV2 143
|
||||
#define ZT_ICMP6_HOME_AGENT_ADDRESS_DISCOVERY_REQUEST 144
|
||||
#define ZT_ICMP6_HOME_AGENT_ADDRESS_DISCOVERY_REPLY 145
|
||||
#define ZT_ICMP6_MOBILE_PREFIX_SOLICITATION 146
|
||||
#define ZT_ICMP6_MOBILE_PREFIX_ADVERTISEMENT 147
|
||||
#define ZT_ICMP6_CERTIFICATION_PATH_SOLICITATION 148
|
||||
#define ZT_ICMP6_CERTIFICATION_PATH_ADVERTISEMENT 149
|
||||
#define ZT_ICMP6_MULTICAST_ROUTER_ADVERTISEMENT 151
|
||||
#define ZT_ICMP6_MULTICAST_ROUTER_SOLICITATION 152
|
||||
#define ZT_ICMP6_MULTICAST_ROUTER_TERMINATION 153
|
||||
#define ZT_ICMP6_RPL_CONTROL_MESSAGE 155
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
class RuntimeEnvironment;
|
||||
|
||||
/**
|
||||
* A simple Ethernet frame level filter
|
||||
*
|
||||
* This doesn't specify actions, since it's used as a deny filter. The rule
|
||||
* in ZT1 is "that which is not explicitly prohibited is allowed." (Except for
|
||||
* ethertypes, which are handled by a whitelist.)
|
||||
*/
|
||||
class Filter
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Value returned by etherTypeName, etc. on unknown
|
||||
*
|
||||
* These static methods return precisely this, so a pointer equality
|
||||
* check will work.
|
||||
*/
|
||||
static const char *const UNKNOWN_NAME;
|
||||
|
||||
/**
|
||||
* An empty range as a more idiomatic way of specifying a wildcard match
|
||||
*/
|
||||
static const Range<unsigned int> ANY;
|
||||
|
||||
/**
|
||||
* A filter rule
|
||||
*/
|
||||
class Rule
|
||||
{
|
||||
public:
|
||||
Rule()
|
||||
throw() :
|
||||
_etherType(),
|
||||
_protocol(),
|
||||
_port()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a rule from a string-serialized value
|
||||
*
|
||||
* @param s String formatted rule, such as returned by toString()
|
||||
* @throws std::invalid_argument String formatted rule is not valid
|
||||
*/
|
||||
Rule(const char *s)
|
||||
throw(std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Construct a new rule
|
||||
*
|
||||
* @param etype Ethernet type or empty range for ANY
|
||||
* @param prot Protocol or empty range for ANY (meaning depends on ethertype, e.g. IP protocol numbers)
|
||||
* @param prt Port or empty range for ANY (only applies to some protocols)
|
||||
*/
|
||||
Rule(const Range<unsigned int> &etype,const Range<unsigned int> &prot,const Range<unsigned int> &prt)
|
||||
throw() :
|
||||
_etherType(etype),
|
||||
_protocol(prot),
|
||||
_port(prt)
|
||||
{
|
||||
}
|
||||
|
||||
inline const Range<unsigned int> ðerType() const throw() { return _etherType; }
|
||||
inline const Range<unsigned int> &protocol() const throw() { return _protocol; }
|
||||
inline const Range<unsigned int> &port() const throw() { return _port; }
|
||||
|
||||
/**
|
||||
* Test this rule against a frame
|
||||
*
|
||||
* @param etype Type of ethernet frame
|
||||
* @param data Ethernet frame data
|
||||
* @param len Length of ethernet frame
|
||||
* @return True if rule matches
|
||||
* @throws std::invalid_argument Frame invalid or not parseable
|
||||
*/
|
||||
bool operator()(unsigned int etype,const void *data,unsigned int len) const
|
||||
throw(std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Serialize rule as string
|
||||
*
|
||||
* @return Human readable representation of rule
|
||||
*/
|
||||
std::string toString() const;
|
||||
|
||||
inline bool operator==(const Rule &r) const throw() { return ((_etherType == r._etherType)&&(_protocol == r._protocol)&&(_port == r._port)); }
|
||||
inline bool operator!=(const Rule &r) const throw() { return !(*this == r); }
|
||||
inline bool operator<(const Rule &r) const
|
||||
throw()
|
||||
{
|
||||
if (_etherType < r._etherType)
|
||||
return true;
|
||||
else if (_etherType == r._etherType) {
|
||||
if (_protocol < r._protocol)
|
||||
return true;
|
||||
else if (_protocol == r._protocol) {
|
||||
if (_port < r._port)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
inline bool operator>(const Rule &r) const throw() { return (r < *this); }
|
||||
inline bool operator<=(const Rule &r) const throw() { return !(r < *this); }
|
||||
inline bool operator>=(const Rule &r) const throw() { return !(*this < r); }
|
||||
|
||||
private:
|
||||
Range<unsigned int> _etherType;
|
||||
Range<unsigned int> _protocol;
|
||||
Range<unsigned int> _port;
|
||||
};
|
||||
|
||||
Filter() {}
|
||||
|
||||
/**
|
||||
* @param s String-serialized filter representation
|
||||
*/
|
||||
Filter(const char *s)
|
||||
throw(std::invalid_argument);
|
||||
|
||||
/**
|
||||
* @return Comma-delimited list of string-format rules
|
||||
*/
|
||||
std::string toString() const;
|
||||
|
||||
/**
|
||||
* Add a rule to this filter
|
||||
*
|
||||
* @param r Rule to add to filter
|
||||
*/
|
||||
void add(const Rule &r);
|
||||
|
||||
inline bool operator()(unsigned int etype,const void *data,unsigned int len) const
|
||||
throw(std::invalid_argument)
|
||||
{
|
||||
for(std::vector<Rule>::const_iterator r(_rules.begin());r!=_rules.end();++r) {
|
||||
if ((*r)(etype,data,len))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static const char *etherTypeName(const unsigned int etherType)
|
||||
throw();
|
||||
static const char *ipProtocolName(const unsigned int ipp)
|
||||
throw();
|
||||
static const char *icmpTypeName(const unsigned int icmpType)
|
||||
throw();
|
||||
static const char *icmp6TypeName(const unsigned int icmp6Type)
|
||||
throw();
|
||||
|
||||
private:
|
||||
std::vector<Rule> _rules;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
33
attic/OFFICIAL-RELEASE-STEPS.md
Normal file
33
attic/OFFICIAL-RELEASE-STEPS.md
Normal file
@ -0,0 +1,33 @@
|
||||
ZeroTier Official Release Steps
|
||||
======
|
||||
|
||||
This is mostly for ZeroTier internal use, but others who want to do builds might find it helpful.
|
||||
|
||||
Note: Many of these steps will require GPG and other signing keys that are kept in cold storage and must be mounted.
|
||||
|
||||
# Bumping the Version and Preparing Installers
|
||||
|
||||
The version must be incremented in all of the following files:
|
||||
|
||||
/version.h
|
||||
/zerotier-one.spec
|
||||
/debian/changelog
|
||||
/ext/installfiles/mac/ZeroTier One.pkgproj
|
||||
/ext/installfiles/windows/ZeroTier One.aip
|
||||
/windows/WinUI/AboutView.xaml
|
||||
|
||||
The final .AIP file can only be edited on Windows with [Advanced Installer Enterprise](http://www.advancedinstaller.com/). In addition to incrementing the version be sure that a new product code is generated. (The "upgrade code" GUID on the other hand must never change.)
|
||||
|
||||
# Building for Supported Platforms
|
||||
|
||||
## Macintosh
|
||||
|
||||
Mac's easy. Just type:
|
||||
|
||||
make official
|
||||
|
||||
You will need [Packages](http://s.sudre.free.fr/Software/Packages/about.html) and our release signing key in the keychain.
|
||||
|
||||
## 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.
|
@ -1,651 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2015 ZeroTier, Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/route.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_media.h>
|
||||
#include <netinet6/in6_var.h>
|
||||
#include <netinet/in_var.h>
|
||||
#include <netinet/icmp6.h>
|
||||
|
||||
#include <pcap/pcap.h>
|
||||
|
||||
// OSX compile fix... in6_var defines this in a struct which namespaces it for C++ ... why?!?
|
||||
struct prf_ra {
|
||||
u_char onlink : 1;
|
||||
u_char autonomous : 1;
|
||||
u_char reserved : 6;
|
||||
} prf_ra;
|
||||
|
||||
#include <netinet6/nd6.h>
|
||||
#include <ifaddrs.h>
|
||||
|
||||
// These are KERNEL_PRIVATE... why?
|
||||
#ifndef SIOCAUTOCONF_START
|
||||
#define SIOCAUTOCONF_START _IOWR('i', 132, struct in6_ifreq) /* accept rtadvd on this interface */
|
||||
#endif
|
||||
#ifndef SIOCAUTOCONF_STOP
|
||||
#define SIOCAUTOCONF_STOP _IOWR('i', 133, struct in6_ifreq) /* stop accepting rtadv for this interface */
|
||||
#endif
|
||||
|
||||
#ifndef ETH_ALEN
|
||||
#define ETH_ALEN 6
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// This source is from:
|
||||
// http://www.opensource.apple.com/source/Libinfo/Libinfo-406.17/gen.subproj/getifmaddrs.c?txt
|
||||
// It's here because OSX 10.6 does not have this convenience function.
|
||||
|
||||
#define SALIGN (sizeof(uint32_t) - 1)
|
||||
#define SA_RLEN(sa) ((sa)->sa_len ? (((sa)->sa_len + SALIGN) & ~SALIGN) : \
|
||||
(SALIGN + 1))
|
||||
#define MAX_SYSCTL_TRY 5
|
||||
#define RTA_MASKS (RTA_GATEWAY | RTA_IFP | RTA_IFA)
|
||||
|
||||
/* FreeBSD uses NET_RT_IFMALIST and RTM_NEWMADDR from <sys/socket.h> */
|
||||
/* We can use NET_RT_IFLIST2 and RTM_NEWMADDR2 on Darwin */
|
||||
//#define DARWIN_COMPAT
|
||||
|
||||
//#ifdef DARWIN_COMPAT
|
||||
#define GIM_SYSCTL_MIB NET_RT_IFLIST2
|
||||
#define GIM_RTM_ADDR RTM_NEWMADDR2
|
||||
//#else
|
||||
//#define GIM_SYSCTL_MIB NET_RT_IFMALIST
|
||||
//#define GIM_RTM_ADDR RTM_NEWMADDR
|
||||
//#endif
|
||||
|
||||
// Not in 10.6 includes so use our own
|
||||
struct _intl_ifmaddrs {
|
||||
struct _intl_ifmaddrs *ifma_next;
|
||||
struct sockaddr *ifma_name;
|
||||
struct sockaddr *ifma_addr;
|
||||
struct sockaddr *ifma_lladdr;
|
||||
};
|
||||
|
||||
static inline int _intl_getifmaddrs(struct _intl_ifmaddrs **pif)
|
||||
{
|
||||
int icnt = 1;
|
||||
int dcnt = 0;
|
||||
int ntry = 0;
|
||||
size_t len;
|
||||
size_t needed;
|
||||
int mib[6];
|
||||
int i;
|
||||
char *buf;
|
||||
char *data;
|
||||
char *next;
|
||||
char *p;
|
||||
struct ifma_msghdr2 *ifmam;
|
||||
struct _intl_ifmaddrs *ifa, *ift;
|
||||
struct rt_msghdr *rtm;
|
||||
struct sockaddr *sa;
|
||||
|
||||
mib[0] = CTL_NET;
|
||||
mib[1] = PF_ROUTE;
|
||||
mib[2] = 0; /* protocol */
|
||||
mib[3] = 0; /* wildcard address family */
|
||||
mib[4] = GIM_SYSCTL_MIB;
|
||||
mib[5] = 0; /* no flags */
|
||||
do {
|
||||
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
|
||||
return (-1);
|
||||
if ((buf = (char *)malloc(needed)) == NULL)
|
||||
return (-1);
|
||||
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
|
||||
if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
|
||||
free(buf);
|
||||
return (-1);
|
||||
}
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
} while (buf == NULL);
|
||||
|
||||
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
|
||||
rtm = (struct rt_msghdr *)(void *)next;
|
||||
if (rtm->rtm_version != RTM_VERSION)
|
||||
continue;
|
||||
switch (rtm->rtm_type) {
|
||||
case GIM_RTM_ADDR:
|
||||
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
|
||||
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
|
||||
break;
|
||||
icnt++;
|
||||
p = (char *)(ifmam + 1);
|
||||
for (i = 0; i < RTAX_MAX; i++) {
|
||||
if ((RTA_MASKS & ifmam->ifmam_addrs &
|
||||
(1 << i)) == 0)
|
||||
continue;
|
||||
sa = (struct sockaddr *)(void *)p;
|
||||
len = SA_RLEN(sa);
|
||||
dcnt += len;
|
||||
p += len;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
data = (char *)malloc(sizeof(struct _intl_ifmaddrs) * icnt + dcnt);
|
||||
if (data == NULL) {
|
||||
free(buf);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
ifa = (struct _intl_ifmaddrs *)(void *)data;
|
||||
data += sizeof(struct _intl_ifmaddrs) * icnt;
|
||||
|
||||
memset(ifa, 0, sizeof(struct _intl_ifmaddrs) * icnt);
|
||||
ift = ifa;
|
||||
|
||||
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
|
||||
rtm = (struct rt_msghdr *)(void *)next;
|
||||
if (rtm->rtm_version != RTM_VERSION)
|
||||
continue;
|
||||
|
||||
switch (rtm->rtm_type) {
|
||||
case GIM_RTM_ADDR:
|
||||
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
|
||||
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
|
||||
break;
|
||||
|
||||
p = (char *)(ifmam + 1);
|
||||
for (i = 0; i < RTAX_MAX; i++) {
|
||||
if ((RTA_MASKS & ifmam->ifmam_addrs &
|
||||
(1 << i)) == 0)
|
||||
continue;
|
||||
sa = (struct sockaddr *)(void *)p;
|
||||
len = SA_RLEN(sa);
|
||||
switch (i) {
|
||||
case RTAX_GATEWAY:
|
||||
ift->ifma_lladdr =
|
||||
(struct sockaddr *)(void *)data;
|
||||
memcpy(data, p, len);
|
||||
data += len;
|
||||
break;
|
||||
|
||||
case RTAX_IFP:
|
||||
ift->ifma_name =
|
||||
(struct sockaddr *)(void *)data;
|
||||
memcpy(data, p, len);
|
||||
data += len;
|
||||
break;
|
||||
|
||||
case RTAX_IFA:
|
||||
ift->ifma_addr =
|
||||
(struct sockaddr *)(void *)data;
|
||||
memcpy(data, p, len);
|
||||
data += len;
|
||||
break;
|
||||
|
||||
default:
|
||||
data += len;
|
||||
break;
|
||||
}
|
||||
p += len;
|
||||
}
|
||||
ift->ifma_next = ift + 1;
|
||||
ift = ift->ifma_next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
free(buf);
|
||||
|
||||
if (ift > ifa) {
|
||||
ift--;
|
||||
ift->ifma_next = NULL;
|
||||
*pif = ifa;
|
||||
} else {
|
||||
*pif = NULL;
|
||||
free(ifa);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
|
||||
{
|
||||
free(ifmp);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
#include "../node/Dictionary.hpp"
|
||||
#include "OSUtils.hpp"
|
||||
#include "OSXEthernetTap.hpp"
|
||||
|
||||
// ff:ff:ff:ff:ff:ff with no ADI
|
||||
static const ZeroTier::MulticastGroup _blindWildcardMulticastGroup(ZeroTier::MAC(0xff),0);
|
||||
|
||||
static inline bool _setIpv6Stuff(const char *ifname,bool performNUD,bool acceptRouterAdverts)
|
||||
{
|
||||
struct in6_ndireq nd;
|
||||
struct in6_ifreq ifr;
|
||||
|
||||
int s = socket(AF_INET6,SOCK_DGRAM,0);
|
||||
if (s <= 0)
|
||||
return false;
|
||||
|
||||
memset(&nd,0,sizeof(nd));
|
||||
strncpy(nd.ifname,ifname,sizeof(nd.ifname));
|
||||
|
||||
if (ioctl(s,SIOCGIFINFO_IN6,&nd)) {
|
||||
close(s);
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long oldFlags = (unsigned long)nd.ndi.flags;
|
||||
|
||||
if (performNUD)
|
||||
nd.ndi.flags |= ND6_IFF_PERFORMNUD;
|
||||
else nd.ndi.flags &= ~ND6_IFF_PERFORMNUD;
|
||||
|
||||
if (oldFlags != (unsigned long)nd.ndi.flags) {
|
||||
if (ioctl(s,SIOCSIFINFO_FLAGS,&nd)) {
|
||||
close(s);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&ifr,0,sizeof(ifr));
|
||||
strncpy(ifr.ifr_name,ifname,sizeof(ifr.ifr_name));
|
||||
if (ioctl(s,acceptRouterAdverts ? SIOCAUTOCONF_START : SIOCAUTOCONF_STOP,&ifr)) {
|
||||
close(s);
|
||||
return false;
|
||||
}
|
||||
|
||||
close(s);
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
static std::set<std::string> globalDeviceNames;
|
||||
static Mutex globalTapCreateLock;
|
||||
|
||||
OSXEthernetTap::OSXEthernetTap(
|
||||
const char *homePath,
|
||||
const MAC &mac,
|
||||
unsigned int mtu,
|
||||
unsigned int metric,
|
||||
uint64_t nwid,
|
||||
const char *friendlyName,
|
||||
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *data,unsigned int len),
|
||||
void *arg) :
|
||||
_handler(handler),
|
||||
_arg(arg),
|
||||
_pcap((void *)0),
|
||||
_nwid(nwid),
|
||||
_mac(mac),
|
||||
_homePath(homePath),
|
||||
_mtu(mtu),
|
||||
_metric(metric),
|
||||
_enabled(true)
|
||||
{
|
||||
char errbuf[PCAP_ERRBUF_SIZE];
|
||||
char devname[64],ethaddr[64],mtustr[32],metstr[32],nwids[32];
|
||||
|
||||
Utils::snprintf(nwids,sizeof(nwids),"%.16llx",nwid);
|
||||
|
||||
if (mtu > 2800)
|
||||
throw std::runtime_error("max tap MTU is 2800");
|
||||
|
||||
Mutex::Lock _gl(globalTapCreateLock);
|
||||
|
||||
std::string desiredDevice;
|
||||
Dictionary devmap;
|
||||
{
|
||||
std::string devmapbuf;
|
||||
if (OSUtils::readFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmapbuf)) {
|
||||
devmap.fromString(devmapbuf);
|
||||
desiredDevice = devmap.get(nwids,"");
|
||||
}
|
||||
}
|
||||
|
||||
if ((desiredDevice.length() >= 9)&&(desiredDevice.substr(0,6) == "bridge")) {
|
||||
// length() >= 9 matches bridge### or bridge####
|
||||
_dev = desiredDevice;
|
||||
} else {
|
||||
if (globalDeviceNames.size() >= (10000 - 128)) // sanity check... this would be nuts
|
||||
throw std::runtime_error("too many devices!");
|
||||
unsigned int pseudoBridgeNo = (unsigned int)((nwid ^ (nwid >> 32)) % (10000 - 128)) + 128; // range: bridge128 to bridge9999
|
||||
sprintf(devname,"bridge%u",pseudoBridgeNo);
|
||||
while (globalDeviceNames.count(std::string(devname)) > 0) {
|
||||
++pseudoBridgeNo;
|
||||
if (pseudoBridgeNo > 9999)
|
||||
pseudoBridgeNo = 64;
|
||||
sprintf(devname,"bridge%u",pseudoBridgeNo);
|
||||
}
|
||||
_dev = devname;
|
||||
}
|
||||
|
||||
// Configure MAC address and MTU, bring interface up
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"create",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
if (exitcode != 0)
|
||||
throw std::runtime_error("ifconfig failure setting link-layer address and activating tap interface");
|
||||
} else throw std::runtime_error("unable to fork()");
|
||||
Utils::snprintf(ethaddr,sizeof(ethaddr),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(int)mac[0],(int)mac[1],(int)mac[2],(int)mac[3],(int)mac[4],(int)mac[5]);
|
||||
Utils::snprintf(mtustr,sizeof(mtustr),"%u",_mtu);
|
||||
Utils::snprintf(metstr,sizeof(metstr),"%u",_metric);
|
||||
cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"lladdr",ethaddr,"mtu",mtustr,"metric",metstr,"up",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
if (exitcode != 0)
|
||||
throw std::runtime_error("ifconfig failure setting link-layer address and activating tap interface");
|
||||
} else throw std::runtime_error("unable to fork()");
|
||||
|
||||
_setIpv6Stuff(_dev.c_str(),true,false);
|
||||
|
||||
_pcap = (void *)pcap_create(_dev.c_str(),errbuf);
|
||||
if (!_pcap) {
|
||||
cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"destroy",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
}
|
||||
throw std::runtime_error((std::string("pcap_create() on new bridge device failed: ") + errbuf).c_str());
|
||||
}
|
||||
pcap_set_promisc(reinterpret_cast<pcap_t *>(_pcap),1);
|
||||
pcap_set_timeout(reinterpret_cast<pcap_t *>(_pcap),120000);
|
||||
pcap_set_immediate_mode(reinterpret_cast<pcap_t *>(_pcap),1);
|
||||
if (pcap_set_buffer_size(reinterpret_cast<pcap_t *>(_pcap),1024 * 1024 * 16) != 0) // 16MB
|
||||
fprintf(stderr,"WARNING: pcap_set_buffer_size() failed!\n");
|
||||
if (pcap_set_snaplen(reinterpret_cast<pcap_t *>(_pcap),4096) != 0)
|
||||
fprintf(stderr,"WARNING: pcap_set_snaplen() failed!\n");
|
||||
if (pcap_activate(reinterpret_cast<pcap_t *>(_pcap)) != 0) {
|
||||
pcap_close(reinterpret_cast<pcap_t *>(_pcap));
|
||||
cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"destroy",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
}
|
||||
throw std::runtime_error("pcap_activate() on new bridge device failed.");
|
||||
}
|
||||
|
||||
globalDeviceNames.insert(_dev);
|
||||
|
||||
devmap[nwids] = _dev;
|
||||
OSUtils::writeFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmap.toString());
|
||||
|
||||
_thread = Thread::start(this);
|
||||
}
|
||||
|
||||
OSXEthernetTap::~OSXEthernetTap()
|
||||
{
|
||||
_enabled = false;
|
||||
|
||||
Mutex::Lock _gl(globalTapCreateLock);
|
||||
globalDeviceNames.erase(_dev);
|
||||
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"destroy",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
if (exitcode == 0) {
|
||||
// Destroying the interface nukes pcap and terminates the thread.
|
||||
Thread::join(_thread);
|
||||
}
|
||||
}
|
||||
|
||||
pcap_close(reinterpret_cast<pcap_t *>(_pcap));
|
||||
}
|
||||
|
||||
static bool ___removeIp(const std::string &_dev,const InetAddress &ip)
|
||||
{
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"inet",ip.toIpString().c_str(),"-alias",(const char *)0);
|
||||
_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
waitpid(cpid,&exitcode,0);
|
||||
return (exitcode == 0);
|
||||
}
|
||||
return false; // never reached, make compiler shut up about return value
|
||||
}
|
||||
|
||||
bool OSXEthernetTap::addIp(const InetAddress &ip)
|
||||
{
|
||||
if (!ip)
|
||||
return false;
|
||||
|
||||
std::vector<InetAddress> allIps(ips());
|
||||
if (std::binary_search(allIps.begin(),allIps.end(),ip))
|
||||
return true;
|
||||
|
||||
// Remove and reconfigure if address is the same but netmask is different
|
||||
for(std::vector<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) {
|
||||
if ((i->ipsEqual(ip))&&(i->netmaskBits() != ip.netmaskBits())) {
|
||||
if (___removeIp(_dev,*i))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),ip.isV4() ? "inet" : "inet6",ip.toString().c_str(),"alias",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
return (exitcode == 0);
|
||||
} // else return false...
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OSXEthernetTap::removeIp(const InetAddress &ip)
|
||||
{
|
||||
if (!ip)
|
||||
return true;
|
||||
std::vector<InetAddress> allIps(ips());
|
||||
if (!std::binary_search(allIps.begin(),allIps.end(),ip)) {
|
||||
if (___removeIp(_dev,ip))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<InetAddress> OSXEthernetTap::ips() const
|
||||
{
|
||||
struct ifaddrs *ifa = (struct ifaddrs *)0;
|
||||
if (getifaddrs(&ifa))
|
||||
return std::vector<InetAddress>();
|
||||
|
||||
std::vector<InetAddress> r;
|
||||
|
||||
struct ifaddrs *p = ifa;
|
||||
while (p) {
|
||||
if ((!strcmp(p->ifa_name,_dev.c_str()))&&(p->ifa_addr)&&(p->ifa_netmask)&&(p->ifa_addr->sa_family == p->ifa_netmask->sa_family)) {
|
||||
switch(p->ifa_addr->sa_family) {
|
||||
case AF_INET: {
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)p->ifa_addr;
|
||||
struct sockaddr_in *nm = (struct sockaddr_in *)p->ifa_netmask;
|
||||
r.push_back(InetAddress(&(sin->sin_addr.s_addr),4,Utils::countBits((uint32_t)nm->sin_addr.s_addr)));
|
||||
} break;
|
||||
case AF_INET6: {
|
||||
struct sockaddr_in6 *sin = (struct sockaddr_in6 *)p->ifa_addr;
|
||||
struct sockaddr_in6 *nm = (struct sockaddr_in6 *)p->ifa_netmask;
|
||||
uint32_t b[4];
|
||||
memcpy(b,nm->sin6_addr.s6_addr,sizeof(b));
|
||||
r.push_back(InetAddress(sin->sin6_addr.s6_addr,16,Utils::countBits(b[0]) + Utils::countBits(b[1]) + Utils::countBits(b[2]) + Utils::countBits(b[3])));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
p = p->ifa_next;
|
||||
}
|
||||
|
||||
if (ifa)
|
||||
freeifaddrs(ifa);
|
||||
|
||||
std::sort(r.begin(),r.end());
|
||||
std::unique(r.begin(),r.end());
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void OSXEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
|
||||
{
|
||||
char putBuf[4096];
|
||||
if ((len <= _mtu)&&(_enabled)) {
|
||||
to.copyTo(putBuf,6);
|
||||
from.copyTo(putBuf + 6,6);
|
||||
*((uint16_t *)(putBuf + 12)) = htons((uint16_t)etherType);
|
||||
memcpy(putBuf + 14,data,len);
|
||||
len += 14;
|
||||
int r = pcap_inject(reinterpret_cast<pcap_t *>(_pcap),putBuf,len);
|
||||
if (r <= 0) {
|
||||
printf("%s: pcap_inject() failed\n",_dev.c_str());
|
||||
return;
|
||||
}
|
||||
printf("%s: inject %s -> %s etherType==%u len=%u r==%d\n",_dev.c_str(),from.toString().c_str(),to.toString().c_str(),etherType,len,r);
|
||||
}
|
||||
}
|
||||
|
||||
std::string OSXEthernetTap::deviceName() const
|
||||
{
|
||||
return _dev;
|
||||
}
|
||||
|
||||
void OSXEthernetTap::setFriendlyName(const char *friendlyName)
|
||||
{
|
||||
}
|
||||
|
||||
void OSXEthernetTap::scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed)
|
||||
{
|
||||
std::vector<MulticastGroup> newGroups;
|
||||
|
||||
struct _intl_ifmaddrs *ifmap = (struct _intl_ifmaddrs *)0;
|
||||
if (!_intl_getifmaddrs(&ifmap)) {
|
||||
struct _intl_ifmaddrs *p = ifmap;
|
||||
while (p) {
|
||||
if (p->ifma_addr->sa_family == AF_LINK) {
|
||||
struct sockaddr_dl *in = (struct sockaddr_dl *)p->ifma_name;
|
||||
struct sockaddr_dl *la = (struct sockaddr_dl *)p->ifma_addr;
|
||||
if ((la->sdl_alen == 6)&&(in->sdl_nlen <= _dev.length())&&(!memcmp(_dev.data(),in->sdl_data,in->sdl_nlen)))
|
||||
newGroups.push_back(MulticastGroup(MAC(la->sdl_data + la->sdl_nlen,6),0));
|
||||
}
|
||||
p = p->ifma_next;
|
||||
}
|
||||
_intl_freeifmaddrs(ifmap);
|
||||
}
|
||||
|
||||
std::vector<InetAddress> allIps(ips());
|
||||
for(std::vector<InetAddress>::iterator ip(allIps.begin());ip!=allIps.end();++ip)
|
||||
newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip));
|
||||
|
||||
std::sort(newGroups.begin(),newGroups.end());
|
||||
std::unique(newGroups.begin(),newGroups.end());
|
||||
|
||||
for(std::vector<MulticastGroup>::iterator m(newGroups.begin());m!=newGroups.end();++m) {
|
||||
if (!std::binary_search(_multicastGroups.begin(),_multicastGroups.end(),*m))
|
||||
added.push_back(*m);
|
||||
}
|
||||
for(std::vector<MulticastGroup>::iterator m(_multicastGroups.begin());m!=_multicastGroups.end();++m) {
|
||||
if (!std::binary_search(newGroups.begin(),newGroups.end(),*m))
|
||||
removed.push_back(*m);
|
||||
}
|
||||
|
||||
_multicastGroups.swap(newGroups);
|
||||
}
|
||||
|
||||
static void _pcapHandler(u_char *ptr,const struct pcap_pkthdr *hdr,const u_char *data)
|
||||
{
|
||||
OSXEthernetTap *tap = reinterpret_cast<OSXEthernetTap *>(ptr);
|
||||
if (hdr->caplen > 14) {
|
||||
MAC to(data,6);
|
||||
MAC from(data + 6,6);
|
||||
if (from == tap->_mac) {
|
||||
unsigned int etherType = ntohs(((const uint16_t *)data)[6]);
|
||||
printf("%s: %s -> %s etherType==%u len==%u\n",tap->_dev.c_str(),from.toString().c_str(),to.toString().c_str(),etherType,(unsigned int)hdr->caplen);
|
||||
// TODO: VLAN support
|
||||
tap->_handler(tap->_arg,tap->_nwid,from,to,etherType,0,(const void *)(data + 14),hdr->len - 14);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OSXEthernetTap::threadMain()
|
||||
throw()
|
||||
{
|
||||
pcap_loop(reinterpret_cast<pcap_t *>(_pcap),-1,&_pcapHandler,reinterpret_cast<u_char *>(this));
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
@ -1,832 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2015 ZeroTier, Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sys_domain.h>
|
||||
#include <sys/kern_control.h>
|
||||
#include <net/if_utun.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/route.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_media.h>
|
||||
#include <netinet6/in6_var.h>
|
||||
#include <netinet/in_var.h>
|
||||
#include <netinet/icmp6.h>
|
||||
|
||||
// OSX compile fix... in6_var defines this in a struct which namespaces it for C++ ... why?!?
|
||||
struct prf_ra {
|
||||
u_char onlink : 1;
|
||||
u_char autonomous : 1;
|
||||
u_char reserved : 6;
|
||||
} prf_ra;
|
||||
|
||||
#include <netinet6/nd6.h>
|
||||
#include <ifaddrs.h>
|
||||
|
||||
// These are KERNEL_PRIVATE... why?
|
||||
#ifndef SIOCAUTOCONF_START
|
||||
#define SIOCAUTOCONF_START _IOWR('i', 132, struct in6_ifreq) /* accept rtadvd on this interface */
|
||||
#endif
|
||||
#ifndef SIOCAUTOCONF_STOP
|
||||
#define SIOCAUTOCONF_STOP _IOWR('i', 133, struct in6_ifreq) /* stop accepting rtadv for this interface */
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// This source is from:
|
||||
// http://www.opensource.apple.com/source/Libinfo/Libinfo-406.17/gen.subproj/getifmaddrs.c?txt
|
||||
// It's here because OSX 10.6 does not have this convenience function.
|
||||
|
||||
#define SALIGN (sizeof(uint32_t) - 1)
|
||||
#define SA_RLEN(sa) ((sa)->sa_len ? (((sa)->sa_len + SALIGN) & ~SALIGN) : \
|
||||
(SALIGN + 1))
|
||||
#define MAX_SYSCTL_TRY 5
|
||||
#define RTA_MASKS (RTA_GATEWAY | RTA_IFP | RTA_IFA)
|
||||
|
||||
/* FreeBSD uses NET_RT_IFMALIST and RTM_NEWMADDR from <sys/socket.h> */
|
||||
/* We can use NET_RT_IFLIST2 and RTM_NEWMADDR2 on Darwin */
|
||||
//#define DARWIN_COMPAT
|
||||
|
||||
//#ifdef DARWIN_COMPAT
|
||||
#define GIM_SYSCTL_MIB NET_RT_IFLIST2
|
||||
#define GIM_RTM_ADDR RTM_NEWMADDR2
|
||||
//#else
|
||||
//#define GIM_SYSCTL_MIB NET_RT_IFMALIST
|
||||
//#define GIM_RTM_ADDR RTM_NEWMADDR
|
||||
//#endif
|
||||
|
||||
// Not in 10.6 includes so use our own
|
||||
struct _intl_ifmaddrs {
|
||||
struct _intl_ifmaddrs *ifma_next;
|
||||
struct sockaddr *ifma_name;
|
||||
struct sockaddr *ifma_addr;
|
||||
struct sockaddr *ifma_lladdr;
|
||||
};
|
||||
|
||||
static inline int _intl_getifmaddrs(struct _intl_ifmaddrs **pif)
|
||||
{
|
||||
int icnt = 1;
|
||||
int dcnt = 0;
|
||||
int ntry = 0;
|
||||
size_t len;
|
||||
size_t needed;
|
||||
int mib[6];
|
||||
int i;
|
||||
char *buf;
|
||||
char *data;
|
||||
char *next;
|
||||
char *p;
|
||||
struct ifma_msghdr2 *ifmam;
|
||||
struct _intl_ifmaddrs *ifa, *ift;
|
||||
struct rt_msghdr *rtm;
|
||||
struct sockaddr *sa;
|
||||
|
||||
mib[0] = CTL_NET;
|
||||
mib[1] = PF_ROUTE;
|
||||
mib[2] = 0; /* protocol */
|
||||
mib[3] = 0; /* wildcard address family */
|
||||
mib[4] = GIM_SYSCTL_MIB;
|
||||
mib[5] = 0; /* no flags */
|
||||
do {
|
||||
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
|
||||
return (-1);
|
||||
if ((buf = (char *)malloc(needed)) == NULL)
|
||||
return (-1);
|
||||
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
|
||||
if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
|
||||
free(buf);
|
||||
return (-1);
|
||||
}
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
} while (buf == NULL);
|
||||
|
||||
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
|
||||
rtm = (struct rt_msghdr *)(void *)next;
|
||||
if (rtm->rtm_version != RTM_VERSION)
|
||||
continue;
|
||||
switch (rtm->rtm_type) {
|
||||
case GIM_RTM_ADDR:
|
||||
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
|
||||
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
|
||||
break;
|
||||
icnt++;
|
||||
p = (char *)(ifmam + 1);
|
||||
for (i = 0; i < RTAX_MAX; i++) {
|
||||
if ((RTA_MASKS & ifmam->ifmam_addrs &
|
||||
(1 << i)) == 0)
|
||||
continue;
|
||||
sa = (struct sockaddr *)(void *)p;
|
||||
len = SA_RLEN(sa);
|
||||
dcnt += len;
|
||||
p += len;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
data = (char *)malloc(sizeof(struct _intl_ifmaddrs) * icnt + dcnt);
|
||||
if (data == NULL) {
|
||||
free(buf);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
ifa = (struct _intl_ifmaddrs *)(void *)data;
|
||||
data += sizeof(struct _intl_ifmaddrs) * icnt;
|
||||
|
||||
memset(ifa, 0, sizeof(struct _intl_ifmaddrs) * icnt);
|
||||
ift = ifa;
|
||||
|
||||
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
|
||||
rtm = (struct rt_msghdr *)(void *)next;
|
||||
if (rtm->rtm_version != RTM_VERSION)
|
||||
continue;
|
||||
|
||||
switch (rtm->rtm_type) {
|
||||
case GIM_RTM_ADDR:
|
||||
ifmam = (struct ifma_msghdr2 *)(void *)rtm;
|
||||
if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
|
||||
break;
|
||||
|
||||
p = (char *)(ifmam + 1);
|
||||
for (i = 0; i < RTAX_MAX; i++) {
|
||||
if ((RTA_MASKS & ifmam->ifmam_addrs &
|
||||
(1 << i)) == 0)
|
||||
continue;
|
||||
sa = (struct sockaddr *)(void *)p;
|
||||
len = SA_RLEN(sa);
|
||||
switch (i) {
|
||||
case RTAX_GATEWAY:
|
||||
ift->ifma_lladdr =
|
||||
(struct sockaddr *)(void *)data;
|
||||
memcpy(data, p, len);
|
||||
data += len;
|
||||
break;
|
||||
|
||||
case RTAX_IFP:
|
||||
ift->ifma_name =
|
||||
(struct sockaddr *)(void *)data;
|
||||
memcpy(data, p, len);
|
||||
data += len;
|
||||
break;
|
||||
|
||||
case RTAX_IFA:
|
||||
ift->ifma_addr =
|
||||
(struct sockaddr *)(void *)data;
|
||||
memcpy(data, p, len);
|
||||
data += len;
|
||||
break;
|
||||
|
||||
default:
|
||||
data += len;
|
||||
break;
|
||||
}
|
||||
p += len;
|
||||
}
|
||||
ift->ifma_next = ift + 1;
|
||||
ift = ift->ifma_next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
free(buf);
|
||||
|
||||
if (ift > ifa) {
|
||||
ift--;
|
||||
ift->ifma_next = NULL;
|
||||
*pif = ifa;
|
||||
} else {
|
||||
*pif = NULL;
|
||||
free(ifa);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
|
||||
{
|
||||
free(ifmp);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
#include "../node/Dictionary.hpp"
|
||||
#include "Arp.hpp"
|
||||
#include "OSUtils.hpp"
|
||||
#include "OSXEthernetTap.hpp"
|
||||
|
||||
// ff:ff:ff:ff:ff:ff with no ADI
|
||||
static const ZeroTier::MulticastGroup _blindWildcardMulticastGroup(ZeroTier::MAC(0xff),0);
|
||||
|
||||
static inline bool _setIpv6Stuff(const char *ifname,bool performNUD,bool acceptRouterAdverts)
|
||||
{
|
||||
struct in6_ndireq nd;
|
||||
struct in6_ifreq ifr;
|
||||
|
||||
int s = socket(AF_INET6,SOCK_DGRAM,0);
|
||||
if (s <= 0)
|
||||
return false;
|
||||
|
||||
memset(&nd,0,sizeof(nd));
|
||||
strncpy(nd.ifname,ifname,sizeof(nd.ifname));
|
||||
|
||||
if (ioctl(s,SIOCGIFINFO_IN6,&nd)) {
|
||||
close(s);
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long oldFlags = (unsigned long)nd.ndi.flags;
|
||||
|
||||
if (performNUD)
|
||||
nd.ndi.flags |= ND6_IFF_PERFORMNUD;
|
||||
else nd.ndi.flags &= ~ND6_IFF_PERFORMNUD;
|
||||
|
||||
if (oldFlags != (unsigned long)nd.ndi.flags) {
|
||||
if (ioctl(s,SIOCSIFINFO_FLAGS,&nd)) {
|
||||
close(s);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&ifr,0,sizeof(ifr));
|
||||
strncpy(ifr.ifr_name,ifname,sizeof(ifr.ifr_name));
|
||||
if (ioctl(s,acceptRouterAdverts ? SIOCAUTOCONF_START : SIOCAUTOCONF_STOP,&ifr)) {
|
||||
close(s);
|
||||
return false;
|
||||
}
|
||||
|
||||
close(s);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Create an OSX-native utun device (utun# where # is desiredNumber)
|
||||
// Adapted from public domain utun example code by Jonathan Levin
|
||||
static int _make_utun(int desiredNumber)
|
||||
{
|
||||
struct sockaddr_ctl sc;
|
||||
struct ctl_info ctlInfo;
|
||||
struct ifreq ifr;
|
||||
|
||||
memset(&ctlInfo, 0, sizeof(ctlInfo));
|
||||
if (strlcpy(ctlInfo.ctl_name, UTUN_CONTROL_NAME, sizeof(ctlInfo.ctl_name)) >= sizeof(ctlInfo.ctl_name)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fd = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
|
||||
if (fd == -1)
|
||||
return -1;
|
||||
if (ioctl(fd, CTLIOCGINFO, &ctlInfo) == -1) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sc.sc_id = ctlInfo.ctl_id;
|
||||
sc.sc_len = sizeof(sc);
|
||||
sc.sc_family = AF_SYSTEM;
|
||||
sc.ss_sysaddr = AF_SYS_CONTROL;
|
||||
sc.sc_unit = desiredNumber + 1;
|
||||
|
||||
if (connect(fd, (struct sockaddr *)&sc, sizeof(sc)) == -1) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&ifr,0,sizeof(ifr));
|
||||
sprintf(ifr.ifr_name,"utun%d",desiredNumber);
|
||||
if (ioctl(fd,SIOCGIFFLAGS,(void *)&ifr) < 0) {
|
||||
printf("SIOCGIFFLAGS failed\n");
|
||||
}
|
||||
ifr.ifr_flags &= ~IFF_POINTOPOINT;
|
||||
if (ioctl(fd,SIOCSIFFLAGS,(void *)&ifr) < 0) {
|
||||
printf("clear IFF_POINTOPOINT failed\n");
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
static long globalTapsRunning = 0;
|
||||
static Mutex globalTapCreateLock;
|
||||
|
||||
OSXEthernetTap::OSXEthernetTap(
|
||||
const char *homePath,
|
||||
const MAC &mac,
|
||||
unsigned int mtu,
|
||||
unsigned int metric,
|
||||
uint64_t nwid,
|
||||
const char *friendlyName,
|
||||
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *data,unsigned int len),
|
||||
void *arg) :
|
||||
_handler(handler),
|
||||
_arg(arg),
|
||||
_arp((Arp *)0),
|
||||
_nwid(nwid),
|
||||
_homePath(homePath),
|
||||
_mtu(mtu),
|
||||
_metric(metric),
|
||||
_fd(0),
|
||||
_utun(false),
|
||||
_enabled(true)
|
||||
{
|
||||
char devpath[64],ethaddr[64],mtustr[32],metstr[32],nwids[32];
|
||||
struct stat stattmp;
|
||||
|
||||
Utils::snprintf(nwids,sizeof(nwids),"%.16llx",nwid);
|
||||
|
||||
if (mtu > 2800)
|
||||
throw std::runtime_error("max tap MTU is 2800");
|
||||
|
||||
Mutex::Lock _gl(globalTapCreateLock);
|
||||
|
||||
// Read remembered previous device name, if any -- we'll try to reuse
|
||||
Dictionary devmap;
|
||||
std::string desiredDevice;
|
||||
{
|
||||
std::string devmapbuf;
|
||||
if (OSUtils::readFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmapbuf)) {
|
||||
devmap.fromString(devmapbuf);
|
||||
desiredDevice = devmap.get(nwids,"");
|
||||
}
|
||||
}
|
||||
|
||||
if (::stat((_homePath + ZT_PATH_SEPARATOR_S + "tap.kext").c_str(),&stattmp) == 0) {
|
||||
// Try to init kext if it's there, otherwise revert to utun mode
|
||||
|
||||
if (::stat("/dev/zt0",&stattmp)) {
|
||||
long kextpid = (long)vfork();
|
||||
if (kextpid == 0) {
|
||||
::chdir(homePath);
|
||||
OSUtils::redirectUnixOutputs("/dev/null",(const char *)0);
|
||||
::execl("/sbin/kextload","/sbin/kextload","-q","-repository",homePath,"tap.kext",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (kextpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(kextpid,&exitcode,0);
|
||||
}
|
||||
::usleep(500); // give tap device driver time to start up and try again
|
||||
if (::stat("/dev/zt0",&stattmp))
|
||||
_utun = true;
|
||||
}
|
||||
|
||||
if (!_utun) {
|
||||
// See if we can re-use the last device we had.
|
||||
bool recalledDevice = false;
|
||||
if (desiredDevice.length() > 2) {
|
||||
Utils::snprintf(devpath,sizeof(devpath),"/dev/%s",desiredDevice.c_str());
|
||||
if (stat(devpath,&stattmp) == 0) {
|
||||
_fd = ::open(devpath,O_RDWR);
|
||||
if (_fd > 0) {
|
||||
_dev = desiredDevice;
|
||||
recalledDevice = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Open the first unused tap device if we didn't recall a previous one.
|
||||
if (!recalledDevice) {
|
||||
for(int i=0;i<64;++i) {
|
||||
Utils::snprintf(devpath,sizeof(devpath),"/dev/zt%d",i);
|
||||
if (stat(devpath,&stattmp)) {
|
||||
_utun = true;
|
||||
break;
|
||||
}
|
||||
_fd = ::open(devpath,O_RDWR);
|
||||
if (_fd > 0) {
|
||||
char foo[16];
|
||||
Utils::snprintf(foo,sizeof(foo),"zt%d",i);
|
||||
_dev = foo;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_fd <= 0)
|
||||
_utun = true;
|
||||
}
|
||||
} else {
|
||||
_utun = true;
|
||||
}
|
||||
|
||||
if (_utun) {
|
||||
// Use OSX built-in utun device if kext is not available or doesn't work
|
||||
|
||||
int utunNo = 0;
|
||||
|
||||
if ((desiredDevice.length() > 4)&&(desiredDevice.substr(0,4) == "utun")) {
|
||||
utunNo = Utils::strToInt(desiredDevice.substr(4).c_str());
|
||||
if (utunNo >= 0)
|
||||
_fd = _make_utun(utunNo);
|
||||
}
|
||||
|
||||
if (_fd <= 0) {
|
||||
// Start at utun8 to leave lower utuns unused since other stuff might
|
||||
// want them -- OpenVPN, cjdns, etc. I'm not sure if those are smart
|
||||
// enough to scan upward like this.
|
||||
for(utunNo=8;utunNo<=256;++utunNo) {
|
||||
if ((_fd = _make_utun(utunNo)) > 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_fd <= 0)
|
||||
throw std::runtime_error("unable to find/load ZeroTier tap driver OR use built-in utun driver in OSX; permission or system problem or too many open devices?");
|
||||
|
||||
Utils::snprintf(devpath,sizeof(devpath),"utun%d",utunNo);
|
||||
_dev = devpath;
|
||||
|
||||
// Configure address and bring it up
|
||||
Utils::snprintf(mtustr,sizeof(mtustr),"%u",_mtu);
|
||||
Utils::snprintf(metstr,sizeof(metstr),"%u",_metric);
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"mtu",mtustr,"metric",metstr,"up",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
if (exitcode) {
|
||||
::close(_fd);
|
||||
throw std::runtime_error("ifconfig failure activating utun interface");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Use our ZeroTier OSX tun/tap driver for zt# Ethernet tap device
|
||||
|
||||
if (fcntl(_fd,F_SETFL,fcntl(_fd,F_GETFL) & ~O_NONBLOCK) == -1) {
|
||||
::close(_fd);
|
||||
throw std::runtime_error("unable to set flags on file descriptor for TAP device");
|
||||
}
|
||||
|
||||
// Configure MAC address and MTU, bring interface up
|
||||
Utils::snprintf(ethaddr,sizeof(ethaddr),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(int)mac[0],(int)mac[1],(int)mac[2],(int)mac[3],(int)mac[4],(int)mac[5]);
|
||||
Utils::snprintf(mtustr,sizeof(mtustr),"%u",_mtu);
|
||||
Utils::snprintf(metstr,sizeof(metstr),"%u",_metric);
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"lladdr",ethaddr,"mtu",mtustr,"metric",metstr,"up",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
if (exitcode) {
|
||||
::close(_fd);
|
||||
throw std::runtime_error("ifconfig failure setting link-layer address and activating tap interface");
|
||||
}
|
||||
}
|
||||
|
||||
_setIpv6Stuff(_dev.c_str(),true,false);
|
||||
}
|
||||
|
||||
// Set close-on-exec so that devices cannot persist if we fork/exec for update
|
||||
fcntl(_fd,F_SETFD,fcntl(_fd,F_GETFD) | FD_CLOEXEC);
|
||||
|
||||
::pipe(_shutdownSignalPipe);
|
||||
|
||||
++globalTapsRunning;
|
||||
|
||||
devmap[nwids] = _dev;
|
||||
OSUtils::writeFile((_homePath + ZT_PATH_SEPARATOR_S + "devicemap").c_str(),devmap.toString());
|
||||
|
||||
_thread = Thread::start(this);
|
||||
}
|
||||
|
||||
OSXEthernetTap::~OSXEthernetTap()
|
||||
{
|
||||
Mutex::Lock _gl(globalTapCreateLock);
|
||||
|
||||
::write(_shutdownSignalPipe[1],(const void *)this,1); // writing a byte causes thread to exit
|
||||
Thread::join(_thread);
|
||||
|
||||
::close(_fd);
|
||||
::close(_shutdownSignalPipe[0]);
|
||||
::close(_shutdownSignalPipe[1]);
|
||||
|
||||
if (_utun) {
|
||||
delete _arp;
|
||||
} else {
|
||||
if (--globalTapsRunning <= 0) {
|
||||
globalTapsRunning = 0; // sanity check -- should not be possible
|
||||
|
||||
char tmp[16384];
|
||||
sprintf(tmp,"%s/%s",_homePath.c_str(),"tap.kext");
|
||||
long kextpid = (long)vfork();
|
||||
if (kextpid == 0) {
|
||||
OSUtils::redirectUnixOutputs("/dev/null",(const char *)0);
|
||||
::execl("/sbin/kextunload","/sbin/kextunload",tmp,(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (kextpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(kextpid,&exitcode,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OSXEthernetTap::setEnabled(bool en)
|
||||
{
|
||||
_enabled = en;
|
||||
// TODO: interface status change
|
||||
}
|
||||
|
||||
bool OSXEthernetTap::enabled() const
|
||||
{
|
||||
return _enabled;
|
||||
}
|
||||
|
||||
static bool ___removeIp(const std::string &_dev,const InetAddress &ip)
|
||||
{
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"inet",ip.toIpString().c_str(),"-alias",(const char *)0);
|
||||
_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
waitpid(cpid,&exitcode,0);
|
||||
return (exitcode == 0);
|
||||
}
|
||||
return false; // never reached, make compiler shut up about return value
|
||||
}
|
||||
|
||||
bool OSXEthernetTap::addIp(const InetAddress &ip)
|
||||
{
|
||||
if (!ip)
|
||||
return false;
|
||||
|
||||
std::vector<InetAddress> allIps(ips());
|
||||
if (std::binary_search(allIps.begin(),allIps.end(),ip))
|
||||
return true;
|
||||
|
||||
// Remove and reconfigure if address is the same but netmask is different
|
||||
for(std::vector<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) {
|
||||
if ((i->ipsEqual(ip))&&(i->netmaskBits() != ip.netmaskBits())) {
|
||||
if (___removeIp(_dev,*i))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_utun) {
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
if (ip.ss_family == AF_INET6) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"inet6",ip.toString().c_str(),"alias",(const char *)0);
|
||||
} else {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),ip.toString().c_str(),ip.toIpString().c_str(),"alias",(const char *)0);
|
||||
}
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
|
||||
if (exitcode == 0) {
|
||||
if (ip.ss_family == AF_INET) {
|
||||
// Add route to network over tun for IPv4 -- otherwise it behaves
|
||||
// as a simple point to point tunnel instead of a true route.
|
||||
cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::close(STDERR_FILENO);
|
||||
::close(STDOUT_FILENO);
|
||||
::execl("/sbin/route","/sbin/route","add",ip.network().toString().c_str(),ip.toIpString().c_str(),(const char *)0);
|
||||
::exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
return (exitcode == 0);
|
||||
}
|
||||
} else return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
long cpid = (long)vfork();
|
||||
if (cpid == 0) {
|
||||
::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),ip.isV4() ? "inet" : "inet6",ip.toString().c_str(),"alias",(const char *)0);
|
||||
::_exit(-1);
|
||||
} else if (cpid > 0) {
|
||||
int exitcode = -1;
|
||||
::waitpid(cpid,&exitcode,0);
|
||||
return (exitcode == 0);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OSXEthernetTap::removeIp(const InetAddress &ip)
|
||||
{
|
||||
if (!ip)
|
||||
return true;
|
||||
std::vector<InetAddress> allIps(ips());
|
||||
if (!std::binary_search(allIps.begin(),allIps.end(),ip)) {
|
||||
if (___removeIp(_dev,ip))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<InetAddress> OSXEthernetTap::ips() const
|
||||
{
|
||||
struct ifaddrs *ifa = (struct ifaddrs *)0;
|
||||
if (getifaddrs(&ifa))
|
||||
return std::vector<InetAddress>();
|
||||
|
||||
std::vector<InetAddress> r;
|
||||
|
||||
struct ifaddrs *p = ifa;
|
||||
while (p) {
|
||||
if ((!strcmp(p->ifa_name,_dev.c_str()))&&(p->ifa_addr)&&(p->ifa_netmask)&&(p->ifa_addr->sa_family == p->ifa_netmask->sa_family)) {
|
||||
switch(p->ifa_addr->sa_family) {
|
||||
case AF_INET: {
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)p->ifa_addr;
|
||||
struct sockaddr_in *nm = (struct sockaddr_in *)p->ifa_netmask;
|
||||
r.push_back(InetAddress(&(sin->sin_addr.s_addr),4,Utils::countBits((uint32_t)nm->sin_addr.s_addr)));
|
||||
} break;
|
||||
case AF_INET6: {
|
||||
struct sockaddr_in6 *sin = (struct sockaddr_in6 *)p->ifa_addr;
|
||||
struct sockaddr_in6 *nm = (struct sockaddr_in6 *)p->ifa_netmask;
|
||||
uint32_t b[4];
|
||||
memcpy(b,nm->sin6_addr.s6_addr,sizeof(b));
|
||||
r.push_back(InetAddress(sin->sin6_addr.s6_addr,16,Utils::countBits(b[0]) + Utils::countBits(b[1]) + Utils::countBits(b[2]) + Utils::countBits(b[3])));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
p = p->ifa_next;
|
||||
}
|
||||
|
||||
if (ifa)
|
||||
freeifaddrs(ifa);
|
||||
|
||||
std::sort(r.begin(),r.end());
|
||||
std::unique(r.begin(),r.end());
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void OSXEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
|
||||
{
|
||||
char putBuf[4096];
|
||||
if ((_fd > 0)&&(len <= _mtu)&&(_enabled)) {
|
||||
to.copyTo(putBuf,6);
|
||||
from.copyTo(putBuf + 6,6);
|
||||
*((uint16_t *)(putBuf + 12)) = htons((uint16_t)etherType);
|
||||
memcpy(putBuf + 14,data,len);
|
||||
len += 14;
|
||||
::write(_fd,putBuf,len);
|
||||
}
|
||||
}
|
||||
|
||||
std::string OSXEthernetTap::deviceName() const
|
||||
{
|
||||
return _dev;
|
||||
}
|
||||
|
||||
void OSXEthernetTap::setFriendlyName(const char *friendlyName)
|
||||
{
|
||||
}
|
||||
|
||||
void OSXEthernetTap::scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed)
|
||||
{
|
||||
std::vector<MulticastGroup> newGroups;
|
||||
|
||||
struct _intl_ifmaddrs *ifmap = (struct _intl_ifmaddrs *)0;
|
||||
if (!_intl_getifmaddrs(&ifmap)) {
|
||||
struct _intl_ifmaddrs *p = ifmap;
|
||||
while (p) {
|
||||
if (p->ifma_addr->sa_family == AF_LINK) {
|
||||
struct sockaddr_dl *in = (struct sockaddr_dl *)p->ifma_name;
|
||||
struct sockaddr_dl *la = (struct sockaddr_dl *)p->ifma_addr;
|
||||
if ((la->sdl_alen == 6)&&(in->sdl_nlen <= _dev.length())&&(!memcmp(_dev.data(),in->sdl_data,in->sdl_nlen)))
|
||||
newGroups.push_back(MulticastGroup(MAC(la->sdl_data + la->sdl_nlen,6),0));
|
||||
}
|
||||
p = p->ifma_next;
|
||||
}
|
||||
_intl_freeifmaddrs(ifmap);
|
||||
}
|
||||
|
||||
std::vector<InetAddress> allIps(ips());
|
||||
for(std::vector<InetAddress>::iterator ip(allIps.begin());ip!=allIps.end();++ip)
|
||||
newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip));
|
||||
|
||||
std::sort(newGroups.begin(),newGroups.end());
|
||||
std::unique(newGroups.begin(),newGroups.end());
|
||||
|
||||
for(std::vector<MulticastGroup>::iterator m(newGroups.begin());m!=newGroups.end();++m) {
|
||||
if (!std::binary_search(_multicastGroups.begin(),_multicastGroups.end(),*m))
|
||||
added.push_back(*m);
|
||||
}
|
||||
for(std::vector<MulticastGroup>::iterator m(_multicastGroups.begin());m!=_multicastGroups.end();++m) {
|
||||
if (!std::binary_search(newGroups.begin(),newGroups.end(),*m))
|
||||
removed.push_back(*m);
|
||||
}
|
||||
|
||||
_multicastGroups.swap(newGroups);
|
||||
}
|
||||
|
||||
void OSXEthernetTap::threadMain()
|
||||
throw()
|
||||
{
|
||||
fd_set readfds,nullfds;
|
||||
MAC to,from;
|
||||
int n,nfds,r;
|
||||
char getBuf[8194];
|
||||
|
||||
Thread::sleep(500);
|
||||
|
||||
FD_ZERO(&readfds);
|
||||
FD_ZERO(&nullfds);
|
||||
nfds = (int)std::max(_shutdownSignalPipe[0],_fd) + 1;
|
||||
|
||||
r = 0;
|
||||
for(;;) {
|
||||
FD_SET(_shutdownSignalPipe[0],&readfds);
|
||||
FD_SET(_fd,&readfds);
|
||||
select(nfds,&readfds,&nullfds,&nullfds,(struct timeval *)0);
|
||||
|
||||
if (FD_ISSET(_shutdownSignalPipe[0],&readfds)) // writes to shutdown pipe terminate thread
|
||||
break;
|
||||
|
||||
if (FD_ISSET(_fd,&readfds)) {
|
||||
n = (int)::read(_fd,getBuf + r,sizeof(getBuf) - r);
|
||||
if (n < 0) {
|
||||
if ((errno != EINTR)&&(errno != ETIMEDOUT))
|
||||
break;
|
||||
} else {
|
||||
// Some tap drivers like to send the ethernet frame and the
|
||||
// payload in two chunks, so handle that by accumulating
|
||||
// data until we have at least a frame.
|
||||
r += n;
|
||||
if (r > 14) {
|
||||
if (r > ((int)_mtu + 14)) // sanity check for weird TAP behavior on some platforms
|
||||
r = _mtu + 14;
|
||||
|
||||
if (_enabled) {
|
||||
to.setTo(getBuf,6);
|
||||
from.setTo(getBuf + 6,6);
|
||||
unsigned int etherType = ntohs(((const uint16_t *)getBuf)[6]);
|
||||
// TODO: VLAN support
|
||||
_handler(_arg,_nwid,from,to,etherType,0,(const void *)(getBuf + 14),r - 14);
|
||||
}
|
||||
|
||||
r = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
@ -1,96 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2015 ZeroTier, Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#ifndef ZT_OSXETHERNETTAP_HPP
|
||||
#define ZT_OSXETHERNETTAP_HPP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/MAC.hpp"
|
||||
#include "../node/InetAddress.hpp"
|
||||
#include "../node/MulticastGroup.hpp"
|
||||
|
||||
#include "Thread.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
/**
|
||||
* OSX Ethernet tap using ZeroTier kernel extension zt# devices
|
||||
*/
|
||||
class OSXEthernetTap
|
||||
{
|
||||
public:
|
||||
OSXEthernetTap(
|
||||
const char *homePath,
|
||||
const MAC &mac,
|
||||
unsigned int mtu,
|
||||
unsigned int metric,
|
||||
uint64_t nwid,
|
||||
const char *friendlyName,
|
||||
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int),
|
||||
void *arg);
|
||||
|
||||
~OSXEthernetTap();
|
||||
|
||||
inline void setEnabled(bool en) { _enabled = en; }
|
||||
inline bool enabled() const { return _enabled; }
|
||||
bool addIp(const InetAddress &ip);
|
||||
bool removeIp(const InetAddress &ip);
|
||||
std::vector<InetAddress> ips() const;
|
||||
void put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len);
|
||||
std::string deviceName() const;
|
||||
void setFriendlyName(const char *friendlyName);
|
||||
void scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed);
|
||||
|
||||
void threadMain()
|
||||
throw();
|
||||
|
||||
// Private members of OSXEthernetTap have public visibility to be accessable
|
||||
// from an internal bounce function; don't modify directly.
|
||||
void (*_handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int);
|
||||
void *_arg;
|
||||
void *_pcap; // pcap_t *
|
||||
uint64_t _nwid;
|
||||
MAC _mac;
|
||||
Thread _thread;
|
||||
std::string _homePath;
|
||||
std::string _dev;
|
||||
std::vector<MulticastGroup> _multicastGroups;
|
||||
unsigned int _mtu;
|
||||
unsigned int _metric;
|
||||
volatile bool _enabled;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
@ -1,101 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2015 ZeroTier, Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#ifndef ZT_OSXETHERNETTAP_HPP
|
||||
#define ZT_OSXETHERNETTAP_HPP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/MAC.hpp"
|
||||
#include "../node/InetAddress.hpp"
|
||||
#include "../node/MulticastGroup.hpp"
|
||||
|
||||
#include "Thread.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
class Arp;
|
||||
|
||||
/**
|
||||
* OSX Ethernet tap supporting either ZeroTier tun/tap kext or OSX-native utun
|
||||
*/
|
||||
class OSXEthernetTap
|
||||
{
|
||||
public:
|
||||
OSXEthernetTap(
|
||||
const char *homePath,
|
||||
const MAC &mac,
|
||||
unsigned int mtu,
|
||||
unsigned int metric,
|
||||
uint64_t nwid,
|
||||
const char *friendlyName,
|
||||
void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int),
|
||||
void *arg);
|
||||
|
||||
~OSXEthernetTap();
|
||||
|
||||
void setEnabled(bool en);
|
||||
bool enabled() const;
|
||||
bool addIp(const InetAddress &ip);
|
||||
bool removeIp(const InetAddress &ip);
|
||||
std::vector<InetAddress> ips() const;
|
||||
void put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len);
|
||||
std::string deviceName() const;
|
||||
void setFriendlyName(const char *friendlyName);
|
||||
void scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed);
|
||||
|
||||
inline bool isNativeUtun() const { return _utun; }
|
||||
|
||||
void threadMain()
|
||||
throw();
|
||||
|
||||
private:
|
||||
void (*_handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int);
|
||||
void *_arg;
|
||||
Arp *_arp; // created and used if utun is enabled
|
||||
uint64_t _nwid;
|
||||
Thread _thread;
|
||||
std::string _homePath;
|
||||
std::string _dev;
|
||||
std::vector<MulticastGroup> _multicastGroups;
|
||||
unsigned int _mtu;
|
||||
unsigned int _metric;
|
||||
int _fd;
|
||||
int _shutdownSignalPipe[2];
|
||||
bool _utun;
|
||||
volatile bool _enabled;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
119
attic/PeerList.hpp
Normal file
119
attic/PeerList.hpp
Normal file
@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c)2013-2020 ZeroTier, Inc.
|
||||
*
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file in the project's root directory.
|
||||
*
|
||||
* Change Date: 2025-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2.0 of the Apache License.
|
||||
*/
|
||||
/****/
|
||||
|
||||
#ifndef ZT_PEERLIST_HPP
|
||||
#define ZT_PEERLIST_HPP
|
||||
|
||||
#include "Constants.hpp"
|
||||
#include "SharedPtr.hpp"
|
||||
#include "Peer.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
/**
|
||||
* A list of peers
|
||||
*
|
||||
* This is a simple vector optimized for the case where there will almost always
|
||||
* be zero or one element. In that case it doesn't allocate. If there's more than
|
||||
* one element, it will grow to include all elements.
|
||||
*
|
||||
* It's used to return lookups in Topology where there will almost always be zero
|
||||
* or one peers returned but where there technically (but very rarely) can be more.
|
||||
*/
|
||||
class PeerList
|
||||
{
|
||||
public:
|
||||
ZT_INLINE PeerList() noexcept:
|
||||
m_onePeer(),
|
||||
m_peers(&m_onePeer),
|
||||
m_peerCount(0)
|
||||
{}
|
||||
|
||||
ZT_INLINE PeerList(const PeerList &pl)
|
||||
{
|
||||
const unsigned int pc = pl.m_peerCount;
|
||||
if (likely(pc <= 1)) {
|
||||
m_onePeer = pl.m_onePeer;
|
||||
m_peers = &m_onePeer;
|
||||
} else {
|
||||
m_peers = new SharedPtr<Peer>[pc];
|
||||
for (unsigned int i = 0;i < pc;++i)
|
||||
m_peers[i] = pl.m_peers[i];
|
||||
}
|
||||
m_peerCount = pc;
|
||||
}
|
||||
|
||||
ZT_INLINE ~PeerList()
|
||||
{
|
||||
if (unlikely(m_peers != &m_onePeer))
|
||||
delete[] m_peers;
|
||||
}
|
||||
|
||||
ZT_INLINE PeerList &operator=(const PeerList &pl)
|
||||
{
|
||||
if (&pl != this) {
|
||||
if (unlikely(m_peers != &m_onePeer))
|
||||
delete[] m_peers;
|
||||
if (likely(pl.m_peerCount <= 1)) {
|
||||
m_onePeer = pl.m_onePeer;
|
||||
m_peers = &m_onePeer;
|
||||
} else {
|
||||
m_onePeer.zero();
|
||||
m_peers = new SharedPtr<Peer>[pl.m_peerCount];
|
||||
for (unsigned int i = 0;i < pl.m_peerCount;++i)
|
||||
m_peers[i] = pl.m_peers[i];
|
||||
}
|
||||
m_peerCount = pl.m_peerCount;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize the peer list to store a given number of members
|
||||
*
|
||||
* To populate the list, this must be called first followed by each member
|
||||
* being set with the [] operator. List content after this call is undefined
|
||||
* and may contain old data if the object is being re-used.
|
||||
*
|
||||
* @param s New size of list
|
||||
*/
|
||||
ZT_INLINE void resize(const unsigned int s)
|
||||
{
|
||||
if (unlikely(m_peers != &m_onePeer))
|
||||
delete[] m_peers;
|
||||
m_peerCount = s;
|
||||
if (likely(s <= 1)) {
|
||||
m_peers = &m_onePeer;
|
||||
} else {
|
||||
m_peers = new SharedPtr<Peer>[s];
|
||||
}
|
||||
}
|
||||
|
||||
ZT_INLINE SharedPtr <Peer> &operator[](const unsigned int i) noexcept
|
||||
{ return m_peers[i]; }
|
||||
|
||||
ZT_INLINE const SharedPtr <Peer> &operator[](const unsigned int i) const noexcept
|
||||
{ return m_peers[i]; }
|
||||
|
||||
ZT_INLINE unsigned int size() const noexcept
|
||||
{ return m_peerCount; }
|
||||
|
||||
private:
|
||||
SharedPtr <Peer> m_onePeer;
|
||||
SharedPtr <Peer> *m_peers;
|
||||
unsigned int m_peerCount;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
@ -1,4 +0,0 @@
|
||||
Retired Code and Miscellaneous Junk
|
||||
======
|
||||
|
||||
This directory is for old code that isn't used but we don't want to lose track of, and for anything else random like debug scripts.
|
@ -1,84 +0,0 @@
|
||||
ZeroTier Security
|
||||
======
|
||||
|
||||
## Summary
|
||||
|
||||
|
||||
## Using ZeroTier Securely
|
||||
|
||||
### Overall Recommendations
|
||||
|
||||
*TL;DR: same as anything else: defense in depth defense in depth defense in depth.*
|
||||
|
||||
We encourage our users to treat private ZeroTier networks as being rougly equivalent in security to WPA2-enterprise securied WiFi or on-premise wired Ethernet. (Public networks on the other hand are open by design.) That means they're networks with perimeters, but like all networks the compromise of any participating device or network controller allows an attacker to breach this perimeter.
|
||||
|
||||
**Never trust the network.** Many modern security professionals discourage reliance on network perimeters as major components in any security strategy, and we strongly agree regardless of whether your network is physical or virtual.
|
||||
|
||||
As part of a defense in depth approach **we specifically encourage the use of other secure protocols and authentication systems over ZeroTier networks**. While the use of secure encrypted protocols like SSH and SSL over ZeroTier adds a bit more overhead, it greatly reduces the chance of total compromise.
|
||||
|
||||
Imagine that the per-day probability of a major "0-day" security flaw in ZeroTier and OpenSSH are both roughly 0.001 or one per thousand days. Using both at the same time gives you a cumulative 0-day risk of roughly 0.000001 or one per one million days.
|
||||
|
||||
Those are made-up numbers. In reality these probabilities can't be known ahead of time. History shows that a 0-day could be found in anything tomorrow, next week, or never. But layers of security give you an overall posture that is the product -- more than the sum -- of its parts. That's how defense in depth works.
|
||||
|
||||
### ZeroTier Specifics
|
||||
|
||||
#### Protect Your Identity
|
||||
|
||||
Each ZeroTier device has an identity. The secret portion of this identity is stored in a file called "identity.secret." *Protect this file.* If it's stolen your device's identity (as represented by its 10-digit ZeroTier address) can easily be stolen or impersonated and your traffic can be decrypted or man-in-the-middle'd.
|
||||
|
||||
#### Protect Your Controller
|
||||
|
||||
The second major component of ZeroTier network security is the network controller. It's responsible for issuing certificates and configuration information to all network members. That makes it a certificate authority. Compromise of the controller allows an attacker to join or disrupt any network the controller controls. It does *not*, however, allow an attacker to decrypt peer to peer unicast traffic.
|
||||
|
||||
If you are using our controller-as-a-service at [my.zerotier.com](https://my.zerotier.com), you are delegating this responsibility to us.
|
||||
|
||||
## Security Priorities
|
||||
|
||||
These are our security "must-haves." If the system fails in any of these objectives it is broken.
|
||||
|
||||
* ZeroTier must be secure against remote vulnerabilities. This includes things like unauthorized remote control, remote penetration of the device using ZeroTier as a vector, or remote injection of malware.
|
||||
|
||||
* The content (but not meta-data) of communication must be secure against eavesdropping on the wire by any known means. (We can't warrant against secret vulnerabilities against ciphers, etc., or anything else we don't know about.)
|
||||
|
||||
* Communication must be secure against man-in-the-middle attacks and remote device impersonation.
|
||||
|
||||
## Security Non-Priorities
|
||||
|
||||
There are a few aspects of security we knowingly do not address, since doing so would be beyond scope or would conflict too greatly with other priorities.
|
||||
|
||||
* ZeroTier makes no effort to conceal communication meta-data such as source and destination addresses and the amount of information transferred between peers. To do this more or less requires onion routing or other "heavy" approaches to anonymity, and this is beyond scope.
|
||||
|
||||
* ZeroTier does not implement complex certificate chains, X.509, or other feature-rich (some would say feature-laden) cryptographic stuff. We only implement the crypto we need to get the job done.
|
||||
|
||||
* We don't take extraordinary measures to preserve security under conditions in which an endpoint device has been penetrated by other means (e.g. "rooted" by third party malware) or physicall compromised. If someone steals your keys they've stolen your keys, and if they've "pwned" your device they can easily eavesdrop on everything directly.
|
||||
|
||||
## Insecurities and Areas for Improvement
|
||||
|
||||
The only perfectly secure system is one that is off. All real world systems have potential security weaknesses. If possible, we like to know what these are and acknowledge their existence.
|
||||
|
||||
In some cases we plan to improve these. In other cases we have deliberately decided to "punt" on them in favor of some other priority (see philosophy). We may or may not revisit this decision in the future.
|
||||
|
||||
* We don't implement forward secrecy / ephemeral keys. A [discussion of this can be found at the closed GitHub issue for this feature](https://github.com/zerotier/ZeroTierOne/issues/204). In short: we've decided to "punt" on this feature because it introduces complexity and state negotiation. One of the design goals of ZeroTier is "reliability convergence" -- the reliability of ZeroTier virtual networks should rapidly converge with that of the underlying physical wire. Any state that must be negotiated prior to communication multiplies the probability of delay or failure due to packet loss. We *may* revisit this decision at a later date.
|
||||
|
||||
## Secure Coding Practices
|
||||
|
||||
The first line of defense employed against remote vulnerabilities and other major security flaws is the use of secure coding practices. These are, in no particular order:
|
||||
|
||||
* All parsing of remote messages is performed via higher level safe bounds-checked data structures and interfaces. See node/Buffer.hpp for one of the core elements of this.
|
||||
|
||||
* C++ exceptions are used to ensure that any unhandled failure or error condition (such as a bounds checking violation) results in the safe and complete termination of message processing. Invalid messages are dropped and ignored.
|
||||
|
||||
* Minimalism is a secure coding practice. There is an exponential relationship between complexity and the probability of bugs, and complex designs are much harder to audit and reason about.
|
||||
|
||||
* Our build scripts try to enable any OS and compiler level security features such as ASLR and "stack canaries" on non-debug builds.
|
||||
|
||||
## Cryptographic Security Practices
|
||||
|
||||
* We use [boring crypto](https://cr.yp.to/talks/2015.10.05/slides-djb-20151005-a4.pdf). A single symmetric algorithm (Salsa20/12), a single asymmetric algorithm (Curve25519 ECDH-256), and a single MAC (Poly1305). The way these algorithms are used is identical to how they're used in the NaCl reference implementation. The protocol supports selection of alternative algorithms but only for "future proofing" in the case that a serious flaw is discovered in any of these. Avoding algorithm bloat and cryptographic state negotiation helps guard against down-grade, "oracle," and other protocol level attacks.
|
||||
|
||||
* Authenticated encryption is employed with authentication being performed prior to any other operations on received messages. See also: [the cryptographic doom principle](https://moxie.org/blog/the-cryptographic-doom-principle/).
|
||||
|
||||
* "Never branch on anything secret" -- deterministic-time comparisons and other operations are used in cryptographic operations. See Utils::secureEq() in node/Utils.hpp.
|
||||
|
||||
* OS-derived crypographic random numbers (/dev/urandom or Windows CryptGenRandom) are further randomized using encryption by a secondary key with a secondary source of entropy to guard against CSPRNG bugs. Such OS-level CSPRNG bugs have been found in the past. See Utils::getSecureRandom() in node/Utils.hpp.
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,24 +0,0 @@
|
||||
FROM centos:latest
|
||||
|
||||
MAINTAINER https://www.zerotier.com/
|
||||
|
||||
EXPOSE 9993/udp
|
||||
|
||||
ADD nodesource-el.repo /etc/yum.repos.d/nodesource-el.repo
|
||||
RUN yum -y update && yum install -y nodejs && yum clean all
|
||||
|
||||
RUN mkdir -p /var/lib/zerotier-one
|
||||
RUN mkdir -p /var/lib/zerotier-one/networks.d
|
||||
RUN touch /var/lib/zerotier-one/networks.d/ffffffffffffffff.conf
|
||||
|
||||
ADD package.json /
|
||||
RUN npm install
|
||||
|
||||
ADD zerotier-one /
|
||||
RUN chmod a+x /zerotier-one
|
||||
|
||||
ADD agent.js /
|
||||
ADD docker-main.sh /
|
||||
RUN chmod a+x /docker-main.sh
|
||||
|
||||
CMD ["./docker-main.sh"]
|
@ -1,12 +0,0 @@
|
||||
HTTP one-to-all test
|
||||
======
|
||||
|
||||
*This is really internal use code. You're free to test it out but expect to do some editing/tweaking to make it work. We used this to run some massive scale tests of our new geo-cluster-based root server infrastructure prior to taking it live.*
|
||||
|
||||
Before using this code you will want to edit agent.js to change SERVER_HOST to the IP address of where you will run server.js. This should typically be an open Internet IP, since this makes reporting not dependent upon the thing being tested. Also note that this thing does no security of any kind. It's designed for one-off tests run over a short period of time, not to be anything that runs permanently. You will also want to edit the Dockerfile if you want to build containers and change the network ID to the network you want to run tests over.
|
||||
|
||||
This code can be deployed across a large number of VMs or containers to test and benchmark HTTP traffic within a virtual network at scale. The agent acts as a server and can query other agents, while the server collects agent data and tells agents about each other. It's designed to use RFC4193-based ZeroTier IPv6 addresses within the cluster, which allows the easy provisioning of a large cluster without IP conflicts.
|
||||
|
||||
The Dockerfile builds an image that launches the agent. The image must be "docker run" with "--device=/dev/net/tun --privileged" to permit it to open a tun/tap device within the container. (Unfortunately CAP_NET_ADMIN may not work due to a bug in Docker and/or Linux.) You can run a bunch with a command like:
|
||||
|
||||
for ((n=0;n<10;n++)); do docker run --device=/dev/net/tun --privileged -d zerotier/http-test; done
|
@ -1,196 +0,0 @@
|
||||
// ZeroTier distributed HTTP test agent
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Customizable parameters:
|
||||
|
||||
// Time between startup and first test attempt
|
||||
var TEST_STARTUP_LAG = 10000;
|
||||
|
||||
// Maximum interval between test attempts (actual timing is random % this)
|
||||
var TEST_INTERVAL_MAX = (60000 * 10);
|
||||
|
||||
// Test timeout in ms
|
||||
var TEST_TIMEOUT = 30000;
|
||||
|
||||
// Where should I get other agents' IDs and POST results?
|
||||
var SERVER_HOST = '52.26.196.147';
|
||||
var SERVER_PORT = 18080;
|
||||
|
||||
// Which port do agents use to serve up test data to each other?
|
||||
var AGENT_PORT = 18888;
|
||||
|
||||
// Payload size in bytes
|
||||
var PAYLOAD_SIZE = 5000;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
var ipaddr = require('ipaddr.js');
|
||||
var os = require('os');
|
||||
var http = require('http');
|
||||
var async = require('async');
|
||||
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
|
||||
// Find our ZeroTier-assigned RFC4193 IPv6 address
|
||||
var thisAgentId = null;
|
||||
var interfaces = os.networkInterfaces();
|
||||
if (!interfaces) {
|
||||
console.error('FATAL: os.networkInterfaces() failed.');
|
||||
process.exit(1);
|
||||
}
|
||||
for(var ifname in interfaces) {
|
||||
var ifaddrs = interfaces[ifname];
|
||||
if (Array.isArray(ifaddrs)) {
|
||||
for(var i=0;i<ifaddrs.length;++i) {
|
||||
if (ifaddrs[i].family == 'IPv6') {
|
||||
try {
|
||||
var ipbytes = ipaddr.parse(ifaddrs[i].address).toByteArray();
|
||||
if ((ipbytes.length === 16)&&(ipbytes[0] == 0xfd)&&(ipbytes[9] == 0x99)&&(ipbytes[10] == 0x93)) {
|
||||
thisAgentId = '';
|
||||
for(var j=0;j<16;++j) {
|
||||
var tmp = ipbytes[j].toString(16);
|
||||
if (tmp.length === 1)
|
||||
thisAgentId += '0';
|
||||
thisAgentId += tmp;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (thisAgentId === null) {
|
||||
console.error('FATAL: no ZeroTier-assigned RFC4193 IPv6 addresses found on any local interface!');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
//console.log(thisAgentId);
|
||||
|
||||
// Create a random (and therefore not very compressable) payload
|
||||
var payload = new Buffer(PAYLOAD_SIZE);
|
||||
for(var xx=0;xx<PAYLOAD_SIZE;++xx) {
|
||||
payload.writeUInt8(Math.round(Math.random() * 255.0),xx);
|
||||
}
|
||||
|
||||
function agentIdToIp(agentId)
|
||||
{
|
||||
var ip = '';
|
||||
ip += agentId.substr(0,4);
|
||||
ip += ':';
|
||||
ip += agentId.substr(4,4);
|
||||
ip += ':';
|
||||
ip += agentId.substr(8,4);
|
||||
ip += ':';
|
||||
ip += agentId.substr(12,4);
|
||||
ip += ':';
|
||||
ip += agentId.substr(16,4);
|
||||
ip += ':';
|
||||
ip += agentId.substr(20,4);
|
||||
ip += ':';
|
||||
ip += agentId.substr(24,4);
|
||||
ip += ':';
|
||||
ip += agentId.substr(28,4);
|
||||
return ip;
|
||||
};
|
||||
|
||||
var lastTestResult = null;
|
||||
var allOtherAgents = {};
|
||||
|
||||
function doTest()
|
||||
{
|
||||
var submit = http.request({
|
||||
host: SERVER_HOST,
|
||||
port: SERVER_PORT,
|
||||
path: '/'+thisAgentId,
|
||||
method: 'POST'
|
||||
},function(res) {
|
||||
var body = '';
|
||||
res.on('data',function(chunk) { body += chunk.toString(); });
|
||||
res.on('end',function() {
|
||||
|
||||
if (body) {
|
||||
try {
|
||||
var peers = JSON.parse(body);
|
||||
if (Array.isArray(peers)) {
|
||||
for(var xx=0;xx<peers.length;++xx)
|
||||
allOtherAgents[peers[xx]] = true;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
var agents = Object.keys(allOtherAgents);
|
||||
if (agents.length > 1) {
|
||||
|
||||
var target = agents[Math.floor(Math.random() * agents.length)];
|
||||
while (target === thisAgentId)
|
||||
target = agents[Math.floor(Math.random() * agents.length)];
|
||||
|
||||
var testRequest = null;
|
||||
var timeoutId = null;
|
||||
timeoutId = setTimeout(function() {
|
||||
if (testRequest !== null)
|
||||
testRequest.abort();
|
||||
timeoutId = null;
|
||||
},TEST_TIMEOUT);
|
||||
var startTime = Date.now();
|
||||
|
||||
testRequest = http.get({
|
||||
host: agentIdToIp(target),
|
||||
port: AGENT_PORT,
|
||||
path: '/'
|
||||
},function(res) {
|
||||
var bytes = 0;
|
||||
res.on('data',function(chunk) { bytes += chunk.length; });
|
||||
res.on('end',function() {
|
||||
lastTestResult = {
|
||||
source: thisAgentId,
|
||||
target: target,
|
||||
time: (Date.now() - startTime),
|
||||
bytes: bytes,
|
||||
timedOut: (timeoutId === null),
|
||||
error: null
|
||||
};
|
||||
if (timeoutId !== null)
|
||||
clearTimeout(timeoutId);
|
||||
return setTimeout(doTest,Math.round(Math.random() * TEST_INTERVAL_MAX) + 1);
|
||||
});
|
||||
}).on('error',function(e) {
|
||||
lastTestResult = {
|
||||
source: thisAgentId,
|
||||
target: target,
|
||||
time: (Date.now() - startTime),
|
||||
bytes: 0,
|
||||
timedOut: (timeoutId === null),
|
||||
error: e.toString()
|
||||
};
|
||||
if (timeoutId !== null)
|
||||
clearTimeout(timeoutId);
|
||||
return setTimeout(doTest,Math.round(Math.random() * TEST_INTERVAL_MAX) + 1);
|
||||
});
|
||||
|
||||
} else {
|
||||
return setTimeout(doTest,1000);
|
||||
}
|
||||
|
||||
});
|
||||
}).on('error',function(e) {
|
||||
console.log('POST failed: '+e.toString());
|
||||
return setTimeout(doTest,1000);
|
||||
});
|
||||
if (lastTestResult !== null) {
|
||||
submit.write(JSON.stringify(lastTestResult));
|
||||
lastTestResult = null;
|
||||
}
|
||||
submit.end();
|
||||
};
|
||||
|
||||
// Agents just serve up a test payload
|
||||
app.get('/',function(req,res) { return res.status(200).send(payload); });
|
||||
|
||||
var expressServer = app.listen(AGENT_PORT,function () {
|
||||
// Start timeout-based loop
|
||||
setTimeout(doTest(),TEST_STARTUP_LAG);
|
||||
});
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Kills all running Docker containers on all big-test-hosts
|
||||
|
||||
export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:/sbin
|
||||
|
||||
pssh -h big-test-hosts -x '-t -t' -i -OUserKnownHostsFile=/dev/null -OStrictHostKeyChecking=no -t 0 -p 256 "sudo docker ps -aq | xargs -r sudo docker rm -f"
|
||||
|
||||
exit 0
|
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# More than 500 container seems to result in a lot of sporadic failures, probably due to Linux kernel scaling issues with virtual network ports
|
||||
# 250 with a 16GB RAM VM like Amazon m4.xlarge seems good
|
||||
NUM_CONTAINERS=250
|
||||
CONTAINER_IMAGE=zerotier/http-test
|
||||
SCALE_UP_DELAY=10
|
||||
|
||||
export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:/sbin
|
||||
|
||||
pssh -h big-test-hosts -x '-t -t' -i -OUserKnownHostsFile=/dev/null -OStrictHostKeyChecking=no -t 0 -p 256 "sudo sysctl -w net.netfilter.nf_conntrack_max=262144 ; for ((n=0;n<$NUM_CONTAINERS;n++)); do sudo docker run --device=/dev/net/tun --privileged -d $CONTAINER_IMAGE; sleep $SCALE_UP_DELAY; done"
|
||||
|
||||
exit 0
|
@ -1,65 +0,0 @@
|
||||
//
|
||||
// Pipe the output of server.js into this to convert raw test results into bracketed statistics
|
||||
// suitable for graphing.
|
||||
//
|
||||
|
||||
// Time duration per statistical bracket
|
||||
var BRACKET_SIZE = 10000;
|
||||
|
||||
// Number of bytes expected from each test
|
||||
var EXPECTED_BYTES = 5000;
|
||||
|
||||
var readline = require('readline');
|
||||
var rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
terminal: false
|
||||
});
|
||||
|
||||
var count = 0.0;
|
||||
var overallCount = 0.0;
|
||||
var totalFailures = 0.0;
|
||||
var totalOverallFailures = 0.0;
|
||||
var totalMs = 0;
|
||||
var totalData = 0;
|
||||
var devices = {};
|
||||
var lastBracketTs = 0;
|
||||
|
||||
rl.on('line',function(line) {
|
||||
line = line.trim();
|
||||
var ls = line.split(',');
|
||||
if (ls.length == 7) {
|
||||
var ts = parseInt(ls[0]);
|
||||
var fromId = ls[1];
|
||||
var toId = ls[2];
|
||||
var ms = parseFloat(ls[3]);
|
||||
var bytes = parseInt(ls[4]);
|
||||
var timedOut = (ls[5] == 'true') ? true : false;
|
||||
var errMsg = ls[6];
|
||||
|
||||
count += 1.0;
|
||||
overallCount += 1.0;
|
||||
if ((bytes !== EXPECTED_BYTES)||(timedOut)) {
|
||||
totalFailures += 1.0;
|
||||
totalOverallFailures += 1.0;
|
||||
}
|
||||
totalMs += ms;
|
||||
totalData += bytes;
|
||||
|
||||
devices[fromId] = true;
|
||||
devices[toId] = true;
|
||||
|
||||
if (lastBracketTs === 0)
|
||||
lastBracketTs = ts;
|
||||
|
||||
if (((ts - lastBracketTs) >= BRACKET_SIZE)&&(count > 0.0)) {
|
||||
console.log(count.toString()+','+overallCount.toString()+','+(totalMs / count)+','+(totalFailures / count)+','+(totalOverallFailures / overallCount)+','+totalData+','+Object.keys(devices).length);
|
||||
|
||||
count = 0.0;
|
||||
totalFailures = 0.0;
|
||||
totalMs = 0;
|
||||
totalData = 0;
|
||||
lastBracketTs = ts;
|
||||
}
|
||||
} // else ignore junk
|
||||
});
|
@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
|
||||
|
||||
/zerotier-one -d >>zerotier-one.out 2>&1
|
||||
|
||||
# Wait for ZeroTier to start and join the network
|
||||
while [ ! -d "/proc/sys/net/ipv6/conf/zt0" ]; do
|
||||
sleep 0.25
|
||||
done
|
||||
|
||||
# Wait just a bit longer for stuff to settle
|
||||
sleep 5
|
||||
|
||||
exec node --harmony /agent.js >>agent.out 2>&1
|
||||
#exec node --harmony /agent.js
|
@ -1,6 +0,0 @@
|
||||
[nodesource]
|
||||
name=Node.js Packages for Enterprise Linux 7 - $basearch
|
||||
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/$basearch
|
||||
failovermethod=priority
|
||||
enabled=1
|
||||
gpgcheck=0
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "zerotier-test-http",
|
||||
"version": "1.0.0",
|
||||
"description": "ZeroTier in-network HTTP test",
|
||||
"main": "agent.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "ZeroTier, Inc.",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"async": "^1.5.0",
|
||||
"express": "^4.13.3",
|
||||
"ipaddr.js": "^1.0.3"
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
// ZeroTier distributed HTTP test coordinator and result-reporting server
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Customizable parameters:
|
||||
|
||||
var SERVER_PORT = 18080;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
var fs = require('fs');
|
||||
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
|
||||
app.use(function(req,res,next) {
|
||||
req.rawBody = '';
|
||||
req.on('data', function(chunk) { req.rawBody += chunk.toString(); });
|
||||
req.on('end', function() { return next(); });
|
||||
});
|
||||
|
||||
var knownAgents = {};
|
||||
|
||||
app.post('/:agentId',function(req,res) {
|
||||
var agentId = req.params.agentId;
|
||||
if ((!agentId)||(agentId.length !== 32))
|
||||
return res.status(404).send('');
|
||||
|
||||
if (req.rawBody) {
|
||||
var receiveTime = Date.now();
|
||||
var resultData = null;
|
||||
try {
|
||||
resultData = JSON.parse(req.rawBody);
|
||||
console.log(Date.now().toString()+','+resultData.source+','+resultData.target+','+resultData.time+','+resultData.bytes+','+resultData.timedOut+',"'+((resultData.error) ? resultData.error : '')+'"');
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
knownAgents[agentId] = true;
|
||||
var thisUpdate = [];
|
||||
var agents = Object.keys(knownAgents);
|
||||
if (agents.length < 100)
|
||||
thisUpdate = agents;
|
||||
else {
|
||||
for(var xx=0;xx<100;++xx)
|
||||
thisUpdate.push(agents[Math.floor(Math.random() * agents.length)]);
|
||||
}
|
||||
|
||||
return res.status(200).send(JSON.stringify(thisUpdate));
|
||||
});
|
||||
|
||||
var expressServer = app.listen(SERVER_PORT,function () {
|
||||
console.log('LISTENING ON '+SERVER_PORT);
|
||||
console.log('');
|
||||
});
|
26
attic/central-controller-docker/Dockerfile
Normal file
26
attic/central-controller-docker/Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
# Dockerfile for ZeroTier Central Controllers
|
||||
FROM centos:7 as builder
|
||||
MAINTAINER Adam Ierymekno <adam.ierymenko@zerotier.com>, Grant Limberg <grant.limberg@zerotier.com>
|
||||
|
||||
ARG git_branch=master
|
||||
|
||||
RUN yum update -y
|
||||
RUN yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
|
||||
RUN yum -y install epel-release && yum -y update && yum clean all
|
||||
RUN yum groupinstall -y "Development Tools"
|
||||
RUN yum install -y bash postgresql10 postgresql10-devel libpqxx-devel glibc-static libstdc++-static clang jemalloc jemalloc-devel
|
||||
|
||||
RUN git clone http://git.int.zerotier.com/zerotier/ZeroTierOne.git
|
||||
RUN if [ "$git_branch" != "master" ]; then cd ZeroTierOne && git checkout -b $git_branch origin/$git_branch; fi
|
||||
RUN ldconfig
|
||||
RUN cd ZeroTierOne && make central-controller
|
||||
|
||||
FROM centos:7
|
||||
|
||||
COPY --from=builder /ZeroTierOne/zerotier-one /usr/local/bin/zerotier-one
|
||||
RUN chmod a+x /usr/local/bin/zerotier-one
|
||||
|
||||
ADD ext/central-controller-docker/main.sh /
|
||||
RUN chmod a+x /main.sh
|
||||
|
||||
ENTRYPOINT /main.sh
|
3
attic/central-controller-docker/README.md
Normal file
3
attic/central-controller-docker/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# ZeroTier Central Controller Docker Image
|
||||
|
||||
Dockerfile & startup script for use with [ZeroTier Central](https://my.zerotier.com). Not intended for public use.
|
80
attic/central-controller-docker/main.sh
Executable file
80
attic/central-controller-docker/main.sh
Executable file
@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$ZT_IDENTITY_PATH" ]; then
|
||||
echo '*** FAILED: ZT_IDENTITY_PATH environment variable is not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$ZT_DB_HOST" ]; then
|
||||
echo '*** FAILED: ZT_DB_HOST environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$ZT_DB_PORT" ]; then
|
||||
echo '*** FAILED: ZT_DB_PORT environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$ZT_DB_NAME" ]; then
|
||||
echo '*** FAILED: ZT_DB_NAME environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$ZT_DB_USER" ]; then
|
||||
echo '*** FAILED: ZT_DB_USER environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$ZT_DB_PASSWORD" ]; then
|
||||
echo '*** FAILED: ZT_DB_PASSWORD environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RMQ=""
|
||||
if [ "$ZT_USE_RABBITMQ" == "true" ]; then
|
||||
if [ -z "$RABBITMQ_HOST" ]; then
|
||||
echo '*** FAILED: RABBITMQ_HOST environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$RABBITMQ_PORT" ]; then
|
||||
echo '*** FAILED: RABBITMQ_PORT environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$RABBITMQ_USERNAME" ]; then
|
||||
echo '*** FAILED: RABBITMQ_USERNAME environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$RABBITMQ_PASSWORD" ]; then
|
||||
echo '*** FAILED: RABBITMQ_PASSWORD environment variable not defined'
|
||||
exit 1
|
||||
fi
|
||||
RMQ=", \"rabbitmq\": {
|
||||
\"host\": \"${RABBITMQ_HOST}\",
|
||||
\"port\": ${RABBITMQ_PORT},
|
||||
\"username\": \"${RABBITMQ_USERNAME}\",
|
||||
\"password\": \"${RABBITMQ_PASSWORD}\"
|
||||
}"
|
||||
fi
|
||||
|
||||
mkdir -p /var/lib/zerotier-one
|
||||
|
||||
pushd /var/lib/zerotier-one
|
||||
ln -s $ZT_IDENTITY_PATH/identity.public identity.public
|
||||
ln -s $ZT_IDENTITY_PATH/identity.secret identity.secret
|
||||
popd
|
||||
|
||||
DEFAULT_PORT=9993
|
||||
|
||||
echo "{
|
||||
\"settings\": {
|
||||
\"portMappingEnabled\": true,
|
||||
\"softwareUpdate\": \"disable\",
|
||||
\"interfacePrefixBlacklist\": [
|
||||
\"inot\",
|
||||
\"nat64\"
|
||||
],
|
||||
\"controllerDbPath\": \"postgres:host=${ZT_DB_HOST} port=${ZT_DB_PORT} dbname=${ZT_DB_NAME} user=${ZT_DB_USER} password=${ZT_DB_PASSWORD} sslmode=prefer sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}\"
|
||||
${RMQ}
|
||||
}
|
||||
}
|
||||
" > /var/lib/zerotier-one/local.conf
|
||||
|
||||
export GLIBCXX_FORCE_NEW=1
|
||||
export GLIBCPP_FORCE_NEW=1
|
||||
export LD_PRELOAD="/usr/lib64/libjemalloc.so"
|
||||
exec /usr/local/bin/zerotier-one -p${ZT_CONTROLLER_PORT:-$DEFAULT_PORT} /var/lib/zerotier-one
|
9
attic/cycle_controllers.sh
Executable file
9
attic/cycle_controllers.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CONTROLLERS=`kubectl get pods -o=name | grep controller | sed "s/^.\{4\}//"`
|
||||
|
||||
for c in ${CONTROLLERS[@]}
|
||||
do
|
||||
kubectl delete pod ${c}
|
||||
sleep 30
|
||||
done
|
116
attic/debian/changelog
Normal file
116
attic/debian/changelog
Normal file
@ -0,0 +1,116 @@
|
||||
zerotier-one (1.4.6) unstable; urgency=medium
|
||||
|
||||
* Update default root server list
|
||||
* Fix build flags on "armhf" (32-bit ARM) platforms for better
|
||||
compatibility with Pi Zero and other devices.
|
||||
* Fix license text in one.cpp.
|
||||
* Add a clarification to LICENSE.txt.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 30 Aug 2019 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.4.4) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
* License changed to BSL 1.1
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 23 Aug 2019 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.4.2-2) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
* This is a new build that fixes a binary build issue with containers and SELinux
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 04 Aug 2019 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.4.2) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 04 Aug 2019 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.4.0) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 29 Jul 2019 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.2.12) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 25 Jul 2018 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.2.10) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 08 May 2018 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.2.8) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 27 Apr 2018 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.2.6) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 17 Apr 2018 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.2.4) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Mon, 24 Mar 2017 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.2.2) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 17 Mar 2017 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.2.0) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 14 Mar 2017 09:08:00 -0700
|
||||
|
||||
zerotier-one (1.1.14) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 21 Jul 2016 07:14:12 -0700
|
||||
|
||||
zerotier-one (1.1.12) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 12 Jul 2016 03:02:22 -0700
|
||||
|
||||
zerotier-one (1.1.10) unstable; urgency=medium
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
* ZeroTier Debian packages no longer depend on http-parser since its ABI is too unstable.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 12 Jul 2016 12:29:00 -0700
|
||||
|
||||
zerotier-one (1.1.8) unstable; urgency=low
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 08 Jul 2016 01:56:00 -0700
|
||||
|
||||
zerotier-one (1.1.6) unstable; urgency=medium
|
||||
|
||||
* First Debian release on ZeroTier, Inc. private apt repository.
|
||||
|
||||
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 24 Jun 2016 10:00:00 -0700
|
||||
|
||||
zerotier-one (1.1.5) UNRELEASED; urgency=medium
|
||||
|
||||
* Development package -- first clean Debian packaging test.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Wed, 08 Jun 2016 10:05:01 -0700
|
1
attic/debian/compat
Normal file
1
attic/debian/compat
Normal file
@ -0,0 +1 @@
|
||||
8
|
@ -3,14 +3,14 @@ Maintainer: Adam Ierymenko <adam.ierymenko@zerotier.com>
|
||||
Section: net
|
||||
Priority: optional
|
||||
Standards-Version: 3.9.6
|
||||
Build-Depends: debhelper (>= 9), libhttp-parser-dev (>= 2.1), liblz4-dev, libnatpmp-dev, dh-systemd, ruby-ronn
|
||||
Build-Depends: debhelper (>= 9)
|
||||
Vcs-Git: git://github.com/zerotier/ZeroTierOne
|
||||
Vcs-Browser: https://github.com/zerotier/ZeroTierOne
|
||||
Homepage: https://www.zerotier.com/
|
||||
|
||||
Package: zerotier-one
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libhttp-parser2.1, liblz4-1, libnatpmp1, iproute2
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, iproute2, adduser, libstdc++6
|
||||
Homepage: https://www.zerotier.com/
|
||||
Description: ZeroTier network virtualization service
|
||||
ZeroTier One lets you join ZeroTier virtual networks and
|
19
attic/debian/control.wheezy
Normal file
19
attic/debian/control.wheezy
Normal file
@ -0,0 +1,19 @@
|
||||
Source: zerotier-one
|
||||
Maintainer: Adam Ierymenko <adam.ierymenko@zerotier.com>
|
||||
Section: net
|
||||
Priority: optional
|
||||
Standards-Version: 3.9.4
|
||||
Build-Depends: debhelper
|
||||
Vcs-Git: git://github.com/zerotier/ZeroTierOne
|
||||
Vcs-Browser: https://github.com/zerotier/ZeroTierOne
|
||||
Homepage: https://www.zerotier.com/
|
||||
|
||||
Package: zerotier-one
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, iproute, libstdc++6
|
||||
Homepage: https://www.zerotier.com/
|
||||
Description: ZeroTier network virtualization service
|
||||
ZeroTier One lets you join ZeroTier virtual networks and
|
||||
have them appear as tun/tap ports on your system. See
|
||||
https://www.zerotier.com/ for instructions and
|
||||
documentation.
|
18
attic/debian/copyright
Normal file
18
attic/debian/copyright
Normal file
@ -0,0 +1,18 @@
|
||||
Format: http://dep.debian.net/deps/dep5
|
||||
Upstream-Name: zerotier-one
|
||||
Source: https://github.com/zerotier/ZeroTierOne
|
||||
|
||||
Files: *
|
||||
Copyright: 2011-2016 ZeroTier, Inc.
|
||||
License: ZeroTier BSL 1.1
|
||||
|
||||
License: ZeroTier BSL 1.1
|
||||
Copyright (c)2019 ZeroTier, Inc.
|
||||
|
||||
Use of this software is governed by the Business Source License included
|
||||
in the LICENSE.TXT file in the project's root directory.
|
||||
|
||||
Change Date: 2023-01-01
|
||||
|
||||
On the date above, in accordance with the Business Source License, use
|
||||
of this software will be governed by version 2.0 of the Apache License.
|
11
attic/debian/postinst
Normal file
11
attic/debian/postinst
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if ! id zerotier-one >>/dev/null 2>&1; then
|
||||
useradd --system --user-group --home-dir /var/lib/zerotier-one --no-create-home zerotier-one
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
@ -7,7 +7,7 @@ CXXFLAGS=-O3 -fstack-protector-strong
|
||||
dh $@ --with systemd
|
||||
|
||||
override_dh_auto_build:
|
||||
make ZT_USE_MINIUPNPC=1 -j 2
|
||||
make -j 4
|
||||
|
||||
override_dh_systemd_start:
|
||||
dh_systemd_start --restart-after-upgrade
|
16
attic/debian/rules.static
Normal file
16
attic/debian/rules.static
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
CFLAGS=-O3 -fstack-protector-strong
|
||||
CXXFLAGS=-O3 -fstack-protector-strong
|
||||
|
||||
%:
|
||||
dh $@ --with systemd
|
||||
|
||||
override_dh_auto_build:
|
||||
# make -j 2
|
||||
|
||||
override_dh_systemd_start:
|
||||
dh_systemd_start --restart-after-upgrade
|
||||
|
||||
override_dh_installinit:
|
||||
dh_installinit --name=zerotier-one -- defaults
|
11
attic/debian/rules.wheezy
Executable file
11
attic/debian/rules.wheezy
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
CFLAGS=-O3 -fstack-protector
|
||||
CXXFLAGS=-O3 -fstack-protector
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_build:
|
||||
make -j 2
|
||||
|
11
attic/debian/rules.wheezy.static
Normal file
11
attic/debian/rules.wheezy.static
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
CFLAGS=-O3 -fstack-protector
|
||||
CXXFLAGS=-O3 -fstack-protector
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_build:
|
||||
# make -j 2
|
||||
|
4
attic/debian/ufw-zerotier-one
Normal file
4
attic/debian/ufw-zerotier-one
Normal file
@ -0,0 +1,4 @@
|
||||
[zerotier-one]
|
||||
title=ZeroTier One
|
||||
description=A planetary Ethernet switch
|
||||
ports=9993/udp
|
@ -1,6 +1,7 @@
|
||||
[Unit]
|
||||
Description=ZeroTier One
|
||||
After=network.target
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/zerotier-one
|
BIN
attic/doc/2015-GCM-SIV.pdf
Normal file
BIN
attic/doc/2015-GCM-SIV.pdf
Normal file
Binary file not shown.
BIN
attic/doc/AES-GMAC-SIV.png
Normal file
BIN
attic/doc/AES-GMAC-SIV.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
149
attic/doc/SECURITY.md
Normal file
149
attic/doc/SECURITY.md
Normal file
@ -0,0 +1,149 @@
|
||||
ZeroTier security and cryptographic design
|
||||
=======
|
||||
|
||||
(c)2020 ZeroTier, Inc.
|
||||
Author(s): Adam Ierymenko <adam@zerotier.com>
|
||||
|
||||
# Introduction
|
||||
|
||||
This document describes the core components of ZeroTier's cryptographic and security architecture. It focuses primarily on version 2.0 and only briefly touches on v1.x constructions that are being phased out.
|
||||
|
||||
The intended audience for this document is developers, auditors, and security professionals wishing to understand ZeroTier's design from a security posture point of view. It's also written to serve as the basis for professional security audits of the ZeroTier protocol and code base.
|
||||
|
||||
## High-Level Protocol Design
|
||||
|
||||
ZeroTier's protocol is split into two conceptual layers that we term **VL1** and **VL2**.
|
||||
|
||||
VL1 stands for *virtual layer 1* and is a cryptographically addressed secure global peer-to-peer network responsible for moving packets between ZeroTier nodes. It's a virtual analogue of the physical wire or radio transciever in an Ethernet or WiFi network respectively. Think of it as a gigantic wire closet for planet Earth.
|
||||
|
||||
VL2 stands for *virtual layer 2* and is a full Ethernet emulation layer incorporating cryptographic certificate and token based access control. It is similar (but not identical) to other Ethernet virtualization protocols like VXLAN. VL2 is conceptually separate from VL1 but for the sake of simplicity and ease of use leverages VL1's cryptographic infrastructure for its own authentication needs.
|
||||
|
||||
## VL1 Asymmetric Cryptography: Identities, and Addressing
|
||||
|
||||
VL1 peers are cryptographically addressed, meaning addresses are strongly bound to public keys. Cryptographic addressing is extremely convenient in peer-to-peer networks as it leverages authenticated (AEAD) encryption to implicity authenticate endpoint addresses.
|
||||
|
||||
A ZeroTier identity is comprised of one or more cryptographic public keys and a short **ZeroTier address** derived from a hash of those keys. In addition to this short address there also exists a longer fingerprint in the form of a SHA-384 hash of identity public key(s).
|
||||
|
||||
#### Identity Types and Corresponding Algorithms
|
||||
|
||||
* **Type 0** (v1.x and v2.x): one Curve25519 key for elliptic curve Diffie-Hellman and one Ed25519 key for Ed25519 signatures, with the address and fingerprint computed from a hash of both.
|
||||
* **Type 1** (v2.x only): Curve25519, Ed25519, and NIST P-384 public keys, with the latter being used for signatures (the Ed25519 key is still there but is presently unused) and with *both* Curve25519 and NIST P-384 being used for elliptic curve Diffie-Hellman key agreement. In key agreement the resulting raw secret keys are hashed together using SHA-384 to combine them and yield a single session key.
|
||||
|
||||
Session keys resulting from identity key exchange and agreement are *long-lived keys* that remain static for the lifetime of a particular pair of identities. A different mechanism is used for ephemeral key negotiation.
|
||||
|
||||
#### ZeroTier Addresses and Identity Fingerprints
|
||||
|
||||
In the simplest form of cryptographic addressing, keys are used directly as addresses throughout the system. Unfortunately even public key cryptosystems with short keys like Curve25519 still result in string representations that are prohibitively long for human beings to type. ZeroTier mitigates this usability problem by using a short hash of the public key termed a **ZeroTier address** to refer to a peer's full identity. This short address is also used at the wire level to reduce the size of the packet header. Peers may request full identities based on addresses from from root servers.
|
||||
|
||||
ZeroTier addresses are very short: only 40 bits or 10 hexadecimal digits, e.g. `89e92ceee5.` This makes them convenient to type, but such a short hash would in a naive implementation introduce a significant risk that an attacker could create a duplicate identity with a different key pair but the same address. With 40 bits an intentional collision would require only an average of about 549,755,813,888 attempts for a 50% chance of colliding. If an attempt requires 0.5ms of CPU time on a typical contemporary desktop or server CPU, this would require about 3,000 CPU-days. Since this type of search is easy to parallelize, it would take only a few days for someone with access to a few thousand CPU cores.
|
||||
|
||||
To provide this short hash with a larger security margin, an intentionally slow one-way "hashcash" or "proof of work" function is required during identity generation. This work function is slow to compute but fast to verify, and an address is not valid unless its work checks out. This gives identity address derivation the following costs:
|
||||
|
||||
* Type 1 identities: an average of about 500ms per key pair per typical 2.4ghz CPU core, requiring around 3 million CPU-days to reach a 50% collision probability.
|
||||
* Type 2 identities: an average of about one second per key pair per typical 2.4ghz CPU core, requiring around 6.3 million CPU-days to reach a 50% collision probability.
|
||||
|
||||
While too costly for the vast majority of attackers, this cost may not be prohibitive to a nation-state level attacker or to a criminal with significant funds and/or access to a very large "botnet." It's also possible that FPGA, GPU, or ASIC acceleration could be leveraged to decrease this time in a manner similar to what's been accomplished in the area of cryptocurrency mining.
|
||||
|
||||
Fingerprints are full SHA-384 hashes of identity public keys. In base32-encoding they look like this:
|
||||
|
||||
```
|
||||
bzg7fc3sn46fzyxcxw2ev4c4m2u5fyisb3o4wz5hfmvexbzwk6et3fsglkdcn6nnjobxi3bq7hgxqox3n4u4k
|
||||
```
|
||||
|
||||
These are too large to type but not to copy/paste, store in databases, or use in scripts and APIs.
|
||||
|
||||
Once a device has joined a network, network controllers will remember and check its full identity or identity fingerprint (depending on implementation) rather than just the device's ZeroTier address.
|
||||
|
||||
## VL1 Wire Protocol
|
||||
|
||||
ZeroTier's wire protocol is packet based with packets having the following format:
|
||||
|
||||
```
|
||||
[0:8] 64-bit packet ID and cryptographic nonce
|
||||
[8:13] 40-bit destination ZeroTier address
|
||||
[13:18] 40-bit source ZeroTier address
|
||||
[18:19] 8-bit cleartext flags, cipher, and hop count (bits: FFCCCHHH)
|
||||
[19:27] 64-bit message authentication code (MAC)
|
||||
-- BEGIN ENCRYPTED SECTION --
|
||||
[27:28] 8-bit inner flags and 5-bit protocol verb (bits: FFFVVVVV)
|
||||
[28:...] Verb-specific packet payload
|
||||
```
|
||||
|
||||
All fields (both those that remain cleartext and those that are encrypted) in a packet are authenticated except for the last three "hops" bits of the combined flags/cipher/hops field. These are masked to zero during MAC computation and verification. This is because the hops field is the only field that can be modified by third party peers in transit. It's incremented whenever a packet is forwarded by a root server or connectivity-assisting peer and is checked against a limit to prevent infinite forwarding loops.
|
||||
|
||||
Packets can be up to 16,384 bytes in size. Since the most common transport is UDP and this transport does not reliably support fragmentation, ZeroTier implements its own packet fragmentation and re-assembly scheme using fragments with the following wire format:
|
||||
|
||||
```
|
||||
[0:8] 64-bit packet ID of packet of which this is a fragment
|
||||
[8:13] 40-bit destination ZeroTier address
|
||||
[13:14] 0xff here indicates a fragment since addresses cannot start with this byte
|
||||
[14:15] 4-bit total fragments and 4-bit fragment number (bits: TTTTNNNN)
|
||||
[15:16] 5 reserved bits, 3-bit hop count (bits: rrrrrHHH)
|
||||
[16:...] Fragment data
|
||||
```
|
||||
|
||||
A fragmented packet is indicated by the presence of the flag 0x40 in its cleartext flags field. If this flag is present the receiver must expect the receipt of one or more fragments in addition to the packet's header and first fragment. The total number of fragments expected is not contained in the header but will be contained within each subsequent fragment. If a fragment is received prior to its head, it's held in the event that its head arrives as the protocol does support out of order receipt of fragments.
|
||||
|
||||
Fragmentation can be effectively ignored from a security point of view (with the exception of denial of service concerns, which are mitigated by way of limits and heuristics in the code) since packet message authentication codes are checked at the packet level. Any improperly fragmented packet will fail cryptographic MAC check and be discarded.
|
||||
|
||||
*Legacy: In v1.x the packet ID and nonce field was assigned from a counter maintained to avoid duplicate nonce assignment and the MAC field was the first 64 bits of a Poly1305 MAC of the packet. The overall construction was identical in form to the NaCl Salsa20/Poly1305 "secret box" construction in which the first 32 bytes of Salsa20 output are used as a one-time Poly1305 key for each packet.*
|
||||
|
||||
In v2.x the packet ID and MAC field are in reality a single split 128-bit encrypted nonce and MAC field. See AES-GMAC-SIV below.
|
||||
|
||||
## Symmetric Encryption: AES-GMAC-SIV
|
||||
|
||||
**This is a draft and may change based on peer review and feedback.**
|
||||
|
||||
In v1.x there is a risk of nonce re-use due in part to the small size of the MAC and in part to the way ZeroTier is used. More specifically the risk arises when ZeroTier VMs are cloned or ZeroTier is used on small devices that have the potential to lack both accurate timekeeping and native strong random sources.
|
||||
|
||||
Salsa20 was used in v1.x since at the time the protocol was initially designed AES acceleration was not available on most mobile phones, embedded chips, and small ARM processors such as those use on Raspberry Pi and similar devices. This is no longer the case.
|
||||
|
||||
For v2.x our design has three objectives:
|
||||
|
||||
- Make use of FIPS140-compliant cryptographic primitives that would be available in a FIPS140-ceritified library (e.g. a FIPS build of crypto++ or openssl libcrypto), and use them in a way that could pass FIPS/NIST/NSA review.
|
||||
- Use AES with hardware acceleration for extremely high performance processors with AES hardware acceleration, which is most non-trivial CPUs today.
|
||||
- Incorporate some form of nonce-reuse-resistance to reduce the risk of duplicate nonces when virtual machines are cloned or on small devices, and to mitigate the short MAC.
|
||||
|
||||
The proposed AES-GMAC-SIV construction attempts to achieve all these objectives by using GMAC combined with AES-CTR (both FIPS140 primitives) in a way that achieves the security bounds and characteristics of AES-GCM-SIV but could be certified as FIPS compliant. The design is almost identical to another proposed mode called AES-GCM-SIV except that GMAC is used "as-is" for FIPS-certifiability reasons.
|
||||
|
||||
#### AES-GMAC-SIV Session Setup
|
||||
|
||||
For each new session key, derive two sub-keys **K0** and **K1** using a key derivation function such as KBKDF-HMAC-SHA384.
|
||||
|
||||
#### AES-GMAC-SIV Encryption
|
||||
|
||||
<img src="AES-GMAC-SIV.png">
|
||||
|
||||
As with all other SIV (synthetic IV) modes of operation, encryption requires two passes. Since messages are small in our system it's very likely that the second pass would be operating on data already in CPU L0 cache, reducing the additional overhead of this two-pass requirement.
|
||||
|
||||
1. Generate a new unique 64-bit packet ID in the same manner as v1.x.
|
||||
2. Expand this 64-bit ID to a 96-bit AES-GMAC nonce by padding the remainder with the size of the packet in bytes and the direction of communication (sender > recipient or recipient > sender). This adds a small amount of additional entropy taken from characteristics of the packet.
|
||||
3. Using session sub-key **K0** compute AES-GMAC(K0, plaintext) to yield a 128-bit GMAC tag.
|
||||
4. Take the first 64 bits of this 128-bit GMAC tag and append it to the 64-bit packet ID generated in step 1 to yield a 128-bit combined nonce+MAC field.
|
||||
5. Obtain a 128-bit AES-CTR nonce by encrypting this 128-bit combined nonce+MAC field as a single AES block using **K1**. This is done because GMAC alone is not a cryptographic PRF (pseudo-random function) and we want to ensure that we destroy any algebraic structure before using it with AES-CTR.
|
||||
6. Using the encrypted nonce+MAC field as a 128-bit nonce, encrypt the encrypted section of the packet with AES-CTR. This is also done using **K1**, meaning that the first block of CTR padding data is actually AES(K1,AES(K1,nonce+MAC)).
|
||||
7. Encrypt the 128-bit AES-CTR nonce again as a single AES block using **K0** to yield a final encrypted 128-bit combined nonce and MAC. *(Question for peer review: does this step have any attack-mitigating value? AES-CTR does not require that its nonce/IV be a secret.)*
|
||||
8. Split this final encrypted nonce+IV into two 64-bit chunks, replacing the packet ID with one and placing the other in the packet MAC field.
|
||||
|
||||
#### AES-GMAC-SIV Decryption
|
||||
|
||||
Unlike encryption, SIV decryption can be performed in a single pass if there is a performance benefit to doing so.
|
||||
|
||||
1. Re-combine the packet ID and MAC fields into a single 128-bit block.
|
||||
2. Decrypt this block with AES using **K0** to yield the AES-CTR nonce.
|
||||
3. Decrypt the packet using AES-CTR with **K1**.
|
||||
4. Decrypt the 128-bit AES-CTR nonce field *again* as a single AES block using **K1** to obtain the original packet nonce and 64-bit truncated GMAC tag.
|
||||
5. Expand the 64-bit packet ID / nonce into a 96-bit GMAC nonce as in encryption step 2.
|
||||
6. Compute AES-GMAC(K0,plaintext) as in encryption step 3.
|
||||
7. Verify that the first 64 bytes of the resulting GMAC tag equals the tag (last 64 bits) obtained in decryption step 4 and discard the packet if they do not match.
|
||||
|
||||
#### Discussion
|
||||
|
||||
Most standard stream cipher modes such as AES-GCM or Salsa20/Poly1305 require that message nonce/IV values are never duplicated for the same session key. Since these stream modes generate key streams that are simply XORed with message plaintext, nonce duplication reveals the plaintext of both messages for which the nonce is duplicated due to the commutativity of the XOR operation. It may also allow the MAC (GMAC or Poly1305) itself to be attacked in such a way as to enable message forgery.
|
||||
|
||||
SIV modes mitigate these attacks by making the actual cryptographic nonce used for stream encryption dependent on the content of the message. If a nonce is repeated when two messages differ, ciphertext will still be unique unless a MAC collision also occurs. The chance of this is quite small, only 1/2^64 in our system for any given pair of repeated nonce values. If a repeated nonce occurs and both messages are the same, the protocol will leak only the fact that a message was repeated. The actual plaintext and MAC are not compromised.
|
||||
|
||||
Our AES-GMAC-SIV mode is almost identical to a proposed mode called [AES-GCM-SIV](https://cyber.biu.ac.il/aes-gcm-siv/). The proposed AES-GCM-SIV mode uses a variant of GMAC called POLYVAL with very minor performance improvements while ours retains standard GMAC for compatibility with existing standards and libraries. We call our mode AES-GMAC-SIV to distinguish it.
|
||||
|
||||
*Question for peer review: both GMAC and AES-CTR are FIPS140 approved primitives, and the use of AES-CTR with an approved MAC is permitted. Is it actually feasible that this could be FIPS certified if it were documented in a correct and "strategic" way? It would be described as GMAC authenticated AES-CTR with the CTR IV being constructed via keyed hash (AES) from an initial plaintext IV and a "salt" taken from the MAC, or some similar description.*
|
||||
|
83
attic/doc/zerotier-cli.1
Normal file
83
attic/doc/zerotier-cli.1
Normal file
@ -0,0 +1,83 @@
|
||||
.TH "ZEROTIER\-CLI" "1" "December 2016" "" ""
|
||||
.SH "NAME"
|
||||
\fBzerotier-cli\fR \- control local ZeroTier virtual network service
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
\fBzerotier\-cli\fP [\-switches] <command> [arguments]
|
||||
.SH DESCRIPTION
|
||||
.P
|
||||
\fBzerotier\-cli\fR provides a simple command line interface to the local JSON API of the ZeroTier virtual network endpoint service zerotier\-one(8)\.
|
||||
.P
|
||||
By default \fBzerotier\-cli\fR must be run as root or with \fBsudo\fP\|\. If you want to allow an unprivileged user to use \fBzerotier\-cli\fR to control the system ZeroTier service, you can create a local copy of the ZeroTier service authorization token in the user's home directory:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
sudo cp /var/lib/zerotier\-one/authtoken\.secret /home/user/\.zeroTierOneAuthToken
|
||||
chown user /home/user/\.zeroTierOneAuthToken
|
||||
chmod 0600 /home/user/\.zeroTierOneAuthToken
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
(The location of ZeroTier's service home may differ by platform\. See zerotier\-one(8)\.)
|
||||
.P
|
||||
Note that this gives the user the power to connect or disconnect the system to or from any virtual network, which is a significant permission\.
|
||||
.P
|
||||
\fBzerotier\-cli\fR has several command line arguments that are visible in \fBhelp\fP output\. The two most commonly used are \fB\-j\fP for raw JSON output and \fB\-D<path>\fP to specify an alternative ZeroTier service working directory\. Raw JSON output is easier to parse in scripts and also contains verbose details not present in the tabular output\. The \fB\-D<path>\fP option specifies where the service's zerotier\-one\.port and authtoken\.secret files are located if the service is not running at the default location for your system\.
|
||||
.SH COMMANDS
|
||||
.RS 0
|
||||
.IP \(bu 2
|
||||
\fBhelp\fP:
|
||||
Displays \fBzerotier\-cli\fR help\.
|
||||
.IP \(bu 2
|
||||
\fBinfo\fP:
|
||||
Shows information about this device including its 10\-digit ZeroTier address and apparent connection status\. Use \fB\-j\fP for more verbose output\.
|
||||
.IP \(bu 2
|
||||
\fBlistpeers\fP:
|
||||
This command lists the ZeroTier VL1 (virtual layer 1, the peer to peer network) peers this service knows about and has recently (within the past 30 minutes or so) communicated with\. These are not necessarily all the devices on your virtual network(s), and may also include a few devices not on any virtual network you've joined\. These are typically either root servers or network controllers\.
|
||||
.IP \(bu 2
|
||||
\fBlistnetworks\fP:
|
||||
This lists the networks your system belongs to and some information about them, such as any ZeroTier\-managed IP addresses you have been assigned\. (IP addresses assigned manually to ZeroTier interfaces will not be listed here\. Use the standard network interface commands to see these\.)
|
||||
.IP \(bu 2
|
||||
\fBjoin\fP:
|
||||
To join a network just use \fBjoin\fP and its 16\-digit hex network ID\. That's it\. Then use \fBlistnetworks\fP to see the status\. You'll either get a reply from the network controller with a certificate and other info such as IP assignments, or you'll get "access denied\." In this case you'll need the administrator of this network to authorize your device by its 10\-digit device ID (visible with \fBinfo\fP) on the network's controller\.
|
||||
.IP \(bu 2
|
||||
\fBleave\fP:
|
||||
Leaving a network is as easy as joining it\. This disconnects from the network and deletes its interface from the system\. Note that peers on the network may hang around in \fBlistpeers\fP for up to 30 minutes until they time out due to lack of traffic\. But if they no longer share a network with you, they can't actually communicate with you in any meaningful way\.
|
||||
|
||||
.RE
|
||||
.SH EXAMPLES
|
||||
.P
|
||||
Join "Earth," ZeroTier's big public party line network:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ sudo zerotier\-cli join 8056c2e21c000001
|
||||
$ sudo zerotier\-cli listnetworks
|
||||
( wait until you get an Earth IP )
|
||||
$ ping earth\.zerotier\.net
|
||||
( you should now be able to ping our Earth test IP )
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Leave "Earth":
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ sudo zerotier\-cli leave 8056c2e21c000001
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
List VL1 peers:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ sudo zerotier\-cli listpeers
|
||||
.fi
|
||||
.RE
|
||||
.SH COPYRIGHT
|
||||
.P
|
||||
(c)2011\-2016 ZeroTier, Inc\. \-\- https://www\.zerotier\.com/ \-\- https://github\.com/zerotier
|
||||
.SH SEE ALSO
|
||||
.P
|
||||
zerotier\-one(8), zerotier\-idtool(1)
|
||||
|
84
attic/doc/zerotier-idtool.1
Normal file
84
attic/doc/zerotier-idtool.1
Normal file
@ -0,0 +1,84 @@
|
||||
.TH "ZEROTIER\-IDTOOL" "1" "December 2016" "" ""
|
||||
.SH "NAME"
|
||||
\fBzerotier-idtool\fR \- tool for creating and manipulating ZeroTier identities
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
\fBzerotier\-idtool\fP <command> [args]
|
||||
.SH DESCRIPTION
|
||||
.P
|
||||
\fBzerotier\-idtool\fR is a command line utility for doing things with ZeroTier identities\. A ZeroTier identity consists of a public/private key pair (or just the public if it's only an identity\.public) and a 10\-digit hexadecimal ZeroTier address derived from the public key by way of a proof of work based hash function\.
|
||||
.SH COMMANDS
|
||||
.P
|
||||
When command arguments call for a public or secret (full) identity, the identity can be specified as a path to a file or directly on the command line\.
|
||||
.RS 0
|
||||
.IP \(bu 2
|
||||
\fBhelp\fP:
|
||||
Display help\. (Also running with no command does this\.)
|
||||
.IP \(bu 2
|
||||
\fBgenerate\fP [secret file] [public file] [vanity]:
|
||||
Generate a new ZeroTier identity\. If a secret file is specified, the full identity including the private key will be written to this file\. If the public file is specified, the public portion will be written there\. If no file paths are specified the full secret identity is output to STDOUT\. The vanity prefix is a series of hexadecimal digits that the generated identity's address should start with\. Typically this isn't used, and if it's specified generation can take a very long time due to the intrinsic cost of generating identities with their proof of work function\. Generating an identity with a known 16\-bit (4 digit) prefix on a 2\.8ghz Core i5 (using one core) takes an average of two hours\.
|
||||
.IP \(bu 2
|
||||
\fBvalidate\fP <identity, only public part required>:
|
||||
Locally validate an identity's key and proof of work function correspondence\.
|
||||
.IP \(bu 2
|
||||
\fBgetpublic\fP <full identity with secret>:
|
||||
Extract the public portion of an identity\.secret and print to STDOUT\.
|
||||
.IP \(bu 2
|
||||
\fBsign\fP <full identity with secret> <file to sign>:
|
||||
Sign a file's contents with SHA512+ECC\-256 (ed25519)\. The signature is output in hex to STDOUT\.
|
||||
.IP \(bu 2
|
||||
\fBverify\fP <identity, only public part required> <file to check> <signature in hex>:
|
||||
Verify a signature created with \fBsign\fP\|\.
|
||||
.IP \(bu 2
|
||||
\fBmkcom\fP <full identity with secret> [id,value,maxdelta] [\|\.\.\.]:
|
||||
Create and sign a network membership certificate\. This is not generally useful since network controllers do this automatically and is included mostly for testing purposes\.
|
||||
|
||||
.RE
|
||||
.SH EXAMPLES
|
||||
.P
|
||||
Generate and dump a new identity:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ zerotier\-idtool generate
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Generate and write a new identity, both secret and public parts:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ zerotier\-idtool generate identity\.secret identity\.public
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Generate a vanity address that begins with the hex digits "beef" (this will take a while!):
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ zerotier\-idtool generate beef\.secret beef\.public beef
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Sign a file with an identity's secret key:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ zerotier\-idtool sign identity\.secret last_will_and_testament\.txt
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Verify a file's signature with a public key:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ zerotier\-idtool verify identity\.public last_will_and_testament\.txt
|
||||
.fi
|
||||
.RE
|
||||
.SH COPYRIGHT
|
||||
.P
|
||||
(c)2011\-2016 ZeroTier, Inc\. \-\- https://www\.zerotier\.com/ \-\- https://github\.com/zerotier
|
||||
.SH SEE ALSO
|
||||
.P
|
||||
zerotier\-one(8), zerotier\-cli(1)
|
||||
|
104
attic/doc/zerotier-one.8
Normal file
104
attic/doc/zerotier-one.8
Normal file
@ -0,0 +1,104 @@
|
||||
.TH "ZEROTIER\-ONE" "8" "December 2016" "" ""
|
||||
.SH "NAME"
|
||||
\fBzerotier-one\fR \- ZeroTier virtual network endpoint service
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
\fBzerotier\-one\fP [\-switches] [working directory]
|
||||
.SH DESCRIPTION
|
||||
.P
|
||||
\fBzerotier\-one\fR is the service/daemon responsible for connecting a Unix (Linux/BSD/OSX) system to one or more ZeroTier virtual networks and presenting those networks to the system as virtual network ports\. You can think of it as a peer to peer VPN client\.
|
||||
.P
|
||||
It's typically run by init systems like systemd (Linux) or launchd (Mac) rather than directly by the user, and it must be run as root unless you give it the \fB\-U\fP switch and don't plan on actually joining networks (e\.g\. to run a network controller microservice only)\.
|
||||
.P
|
||||
The \fBzerotier\-one\fR service keeps its state and other files in a working directory\. If this directory is not specified at launch it defaults to "/var/lib/zerotier\-one" on Linux, "/Library/Application Support/ZeroTier/One" on Mac, and "/var/db/zerotier\-one" on FreeBSD and other similar BSDs\. The working directory should persist\. It shouldn't be automatically cleaned by system cleanup daemons or stored in a volatile location\. Loss of its identity\.secret file results in loss of this system's unique 10\-digit ZeroTier address and key\.
|
||||
.P
|
||||
Multiple instances of \fBzerotier\-one\fR can be run on the same system as long as they are run with different primary ports (see switches) and a different working directory\. But since a single service can join any number of networks, typically there's no point in doing this\.
|
||||
.P
|
||||
The \fBzerotier\-one\fR service is controlled via a JSON API available at 127\.0\.0\.1:<primary port> with the default primary port being 9993\. Access to this API requires an authorization token normally found in the authtoken\.secret file in the service's working directory\. On some platforms access may be guarded by other measures such as socket peer UID/GID lookup if additional security options are enabled (this is not the default)\.
|
||||
.P
|
||||
The first time the service is started in a fresh working directory, it generates a ZeroTier identity\. On slow systems this process can take ten seconds or more due to an anti\-DDOS/anti\-counterfeit proof of work function used by ZeroTier in address generation\. This only happens once, and once generated the result is saved in identity\.secret in the working directory\. This file represents and defines/claims your ZeroTier address and associated ECC\-256 key pair\.
|
||||
.SH SWITCHES
|
||||
.RS 0
|
||||
.IP \(bu 2
|
||||
\fB\-h\fP:
|
||||
Display help\.
|
||||
.IP \(bu 2
|
||||
\fB\-v\fP:
|
||||
Display ZeroTier One version\.
|
||||
.IP \(bu 2
|
||||
\fB\-U\fP:
|
||||
Skip privilege check and allow to be run by non\-privileged user\. This is typically used when \fBzerotier\-one\fR is built with the network controller option included\. In this case the ZeroTier service might only be acting as a network controller and might never actually join networks, in which case it does not require elevated system permissions\.
|
||||
.IP \(bu 2
|
||||
\fB\-p<port>\fP:
|
||||
Specify a different primary port\. If this is not given the default is 9993\. If zero is given a random port is chosen each time\.
|
||||
.IP \(bu 2
|
||||
\fB\-d\fP:
|
||||
Fork and run as a daemon\.
|
||||
.IP \(bu 2
|
||||
\fB\-i\fP:
|
||||
Invoke the \fBzerotier\-idtool\fR personality, in which case the binary behaves like zerotier\-idtool(1)\. This happens automatically if the name of the binary (or a symlink to it) is zerotier\-idtool\.
|
||||
.IP \(bu 2
|
||||
\fB\-q\fP:
|
||||
Invoke the \fBzerotier\-cli\fR personality, in which case the binary behaves like zerotier\-cli(1)\. This happens automatically if the name of the binary (or a symlink to it) is zerotier\-cli\.
|
||||
|
||||
.RE
|
||||
.SH EXAMPLES
|
||||
.P
|
||||
Run as daemon with OS default working directory and default port:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ sudo zerotier\-one \-d
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Run as daemon with a different working directory and port:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ sudo zerotier\-one \-d \-p12345 /tmp/zerotier\-working\-directory\-test
|
||||
.fi
|
||||
.RE
|
||||
.SH FILES
|
||||
.P
|
||||
These are found in the service's working directory\.
|
||||
.RS 0
|
||||
.IP \(bu 2
|
||||
\fBidentity\.public\fP:
|
||||
The public portion of your ZeroTier identity, which is your 10\-digit hex address and the associated public key\.
|
||||
.IP \(bu 2
|
||||
\fBidentity\.secret\fP:
|
||||
Your full ZeroTier identity including its private key\. This file identifies the system on the network, which means you can move a ZeroTier address around by copying this file and you should back up this file if you want to save your system's static ZeroTier address\. This file must be protected, since theft of its secret key will allow anyone to impersonate your device on any network and decrypt traffic\. For network controllers this file is particularly sensitive since it constitutes the private key for a certificate authority for the controller's networks\.
|
||||
.IP \(bu 2
|
||||
\fBauthtoken\.secret\fP:
|
||||
The secret token used to authenticate requests to the service's local JSON API\. If it does not exist it is generated from a secure random source on service start\. To use, send it in the "X\-ZT1\-Auth" header with HTTP requests to 127\.0\.0\.1:<primary port>\|\.
|
||||
.IP \(bu 2
|
||||
\fBdevicemap\fP:
|
||||
Remembers mappings of zt# interface numbers to ZeroTier networks so they'll persist across restarts\. On some systems that support longer interface names that can encode the network ID (such as FreeBSD) this file may not be present\.
|
||||
.IP \(bu 2
|
||||
\fBzerotier\-one\.pid\fP:
|
||||
ZeroTier's PID\. This file is deleted on normal shutdown\.
|
||||
.IP \(bu 2
|
||||
\fBzerotier\-one\.port\fP:
|
||||
ZeroTier's primary port, which is also where its JSON API is found at 127\.0\.0\.1:<this port>\|\. This file is created on startup and is read by zerotier\-cli(1) to determine where it should find the control API\.
|
||||
.IP \(bu 2
|
||||
\fBcontroller\.db\fP:
|
||||
If the ZeroTier One service is built with the network controller enabled, this file contains the controller's SQLite3 database\.
|
||||
.IP \(bu 2
|
||||
\fBcontroller\.db\.backup\fP:
|
||||
If the ZeroTier One service is built with the network controller enabled, it periodically backs up its controller\.db database in this file (currently every 5 minutes if there have been changes)\. Since this file is not a currently in use SQLite3 database it's safer to back up without corruption\. On new backups the file is rotated out rather than being rewritten in place\.
|
||||
.IP \(bu 2
|
||||
\fBiddb\.d/\fP (directory):
|
||||
Caches the public identity of every peer ZeroTier has spoken with in the last 60 days\. This directory and its contents can be deleted, but this may result in slower connection initations since it will require that we go out and re\-fetch full identities for peers we're speaking to\.
|
||||
.IP \(bu 2
|
||||
\fBnetworks\.d\fP (directory):
|
||||
This caches network configurations and certificate information for networks you belong to\. ZeroTier scans this directory for <network ID>\|\.conf files on startup to recall its networks, so "touch"ing an empty <network ID>\|\.conf file in this directory is a way of pre\-configuring ZeroTier to join a specific network on startup without using the API\. If the config file is empty ZeroTIer will just fetch it from the network's controller\.
|
||||
|
||||
.RE
|
||||
.SH COPYRIGHT
|
||||
.P
|
||||
(c)2011\-2016 ZeroTier, Inc\. \-\- https://www\.zerotier\.com/ \-\- https://github\.com/zerotier
|
||||
.SH SEE ALSO
|
||||
.P
|
||||
zerotier\-cli(1), zerotier\-idtool(1)
|
||||
|
23
attic/dockerbuild/Dockerfile.alpine
Normal file
23
attic/dockerbuild/Dockerfile.alpine
Normal file
@ -0,0 +1,23 @@
|
||||
FROM alpine:3.11.3
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apk add --update alpine-sdk linux-headers cmake openssh curl
|
||||
|
||||
|
||||
RUN adduser -D -s /bin/ash jenkins && \
|
||||
passwd -u jenkins && \
|
||||
ssh-keygen -A && \
|
||||
mkdir /home/jenkins/.ssh && \
|
||||
chown -R jenkins:jenkins /home/jenkins
|
||||
|
||||
RUN curl -s $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz
|
||||
|
||||
COPY authorized_keys /home/jenkins/.ssh/authorized_keys
|
||||
RUN chown -R jenkins:jenkins /home/jenkins/.ssh && \
|
||||
chmod 600 /home/jenkins/.ssh/authorized_keys
|
||||
|
||||
EXPOSE 22
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
|
20
attic/dockerbuild/Dockerfile.centos6
Normal file
20
attic/dockerbuild/Dockerfile.centos6
Normal file
@ -0,0 +1,20 @@
|
||||
FROM centos:6
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN yum update -y
|
||||
RUN yum install -y curl git wget openssh-server sudo make rpmdevtools && yum clean all
|
||||
|
||||
RUN curl -s $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
|
||||
RUN echo $'\n\
|
||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
|
||||
>> ~/.bash_profile
|
||||
|
||||
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
21
attic/dockerbuild/Dockerfile.centos6-i386
Normal file
21
attic/dockerbuild/Dockerfile.centos6-i386
Normal file
@ -0,0 +1,21 @@
|
||||
FROM i386/centos:6
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN echo i386 > /etc/yum/vars/basearch && echo i686 > /etc/yum/vars/arch
|
||||
|
||||
RUN yum install -y curl git wget openssh-server sudo make rpmdevtools && yum clean all
|
||||
|
||||
RUN curl -s $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
|
||||
RUN echo $'\n\
|
||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
|
||||
>> ~/.bash_profile
|
||||
|
||||
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
32
attic/dockerbuild/Dockerfile.centos7
Normal file
32
attic/dockerbuild/Dockerfile.centos7
Normal file
@ -0,0 +1,32 @@
|
||||
FROM centos:7
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN yum install -y epel-release
|
||||
RUN yum install -y curl git wget openssh-server sudo make development-tools rpmdevtools clang gcc-c++ ruby ruby-devel centos-release-scl devtoolset-8 llvm-toolset-7 openssl-devel && yum clean all
|
||||
|
||||
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
|
||||
tar -xzf cmake.tar.gz && \
|
||||
cd cmake-3.16.3 && \
|
||||
./bootstrap && \
|
||||
make -j4 && \
|
||||
make install
|
||||
|
||||
RUN curl -s $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN wget -qO- "https://cmake.org/files/v3.15/cmake-3.15.1-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
|
||||
|
||||
RUN /usr/bin/ssh-keygen -A
|
||||
RUN useradd jenkins-build
|
||||
|
||||
RUN echo $'\n\
|
||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n\
|
||||
source scl_source enable devtoolset-8 llvm-toolset-7\n'\
|
||||
>> ~/.bash_profile
|
||||
|
||||
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
|
29
attic/dockerbuild/Dockerfile.centos7-i386
Normal file
29
attic/dockerbuild/Dockerfile.centos7-i386
Normal file
@ -0,0 +1,29 @@
|
||||
FROM centos:7
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN yum install -y curl git wget openssh-server sudo make development-tools rpmdevtools clang gcc-c++ ruby ruby-devel openssl-devel && yum clean all
|
||||
|
||||
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
|
||||
tar -xzf cmake.tar.gz && \
|
||||
cd cmake-3.16.3 && \
|
||||
./bootstrap && \
|
||||
make -j4 && \
|
||||
make install
|
||||
|
||||
RUN curl -s $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN /usr/bin/ssh-keygen -A
|
||||
|
||||
RUN useradd jenkins-build
|
||||
|
||||
RUN echo $'\n\
|
||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
|
||||
>> ~/.bash_profile
|
||||
|
||||
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
|
25
attic/dockerbuild/Dockerfile.centos8
Normal file
25
attic/dockerbuild/Dockerfile.centos8
Normal file
@ -0,0 +1,25 @@
|
||||
FROM centos:8
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN yum install -y epel-release
|
||||
RUN yum install -y curl git wget openssh-server sudo make rpmdevtools clang gcc-c++ ruby ruby-devel cmake && yum clean all
|
||||
|
||||
RUN curl -s $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN wget -qO- "https://cmake.org/files/v3.15/cmake-3.15.1-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
|
||||
|
||||
RUN /usr/bin/ssh-keygen -A
|
||||
RUN useradd jenkins-build
|
||||
|
||||
RUN echo $'\n\
|
||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n\
|
||||
source scl_source enable devtoolset-8 llvm-toolset-7\n'\
|
||||
>> ~/.bash_profile
|
||||
|
||||
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
|
26
attic/dockerbuild/Dockerfile.clefos-s390x
Normal file
26
attic/dockerbuild/Dockerfile.clefos-s390x
Normal file
@ -0,0 +1,26 @@
|
||||
FROM s390x/clefos:7
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN yum install -y curl git wget openssh-server sudo make development-tools rpmdevtools clang gcc-c++ ruby ruby-devel openssl-devel && yum clean all
|
||||
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
|
||||
tar -xzf cmake.tar.gz && \
|
||||
cd cmake-3.16.3 && \
|
||||
./bootstrap && \
|
||||
make -j4 && \
|
||||
make install
|
||||
|
||||
RUN curl -s $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN /usr/bin/ssh-keygen -A
|
||||
|
||||
RUN echo $'\n\
|
||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n'\
|
||||
>> ~/.bash_profile
|
||||
|
||||
RUN mkdir /rpmbuild && chmod 777 /rpmbuild
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
|
15
attic/dockerbuild/Dockerfile.debian-bullseye
Normal file
15
attic/dockerbuild/Dockerfile.debian-bullseye
Normal file
@ -0,0 +1,15 @@
|
||||
FROM debian:bullseye-20191224
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
15
attic/dockerbuild/Dockerfile.debian-buster
Normal file
15
attic/dockerbuild/Dockerfile.debian-buster
Normal file
@ -0,0 +1,15 @@
|
||||
FROM debian:buster-20191224
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
22
attic/dockerbuild/Dockerfile.debian-jessie
Normal file
22
attic/dockerbuild/Dockerfile.debian-jessie
Normal file
@ -0,0 +1,22 @@
|
||||
FROM debian:jessie-20191224
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd libssl-dev
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
|
||||
tar -xzf cmake.tar.gz && \
|
||||
cd cmake-3.16.3 && \
|
||||
./bootstrap && \
|
||||
make -j4 && \
|
||||
make install
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
15
attic/dockerbuild/Dockerfile.debian-sid
Normal file
15
attic/dockerbuild/Dockerfile.debian-sid
Normal file
@ -0,0 +1,15 @@
|
||||
FROM debian:sid-20191224
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
22
attic/dockerbuild/Dockerfile.debian-stretch
Normal file
22
attic/dockerbuild/Dockerfile.debian-stretch
Normal file
@ -0,0 +1,22 @@
|
||||
FROM debian:stretch-20191224
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd libssl-dev
|
||||
|
||||
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
|
||||
tar -xzf cmake.tar.gz && \
|
||||
cd cmake-3.16.3 && \
|
||||
./bootstrap && \
|
||||
make -j4 && \
|
||||
make install
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
23
attic/dockerbuild/Dockerfile.debian-wheezy
Normal file
23
attic/dockerbuild/Dockerfile.debian-wheezy
Normal file
@ -0,0 +1,23 @@
|
||||
FROM debian:wheezy-20190228
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN echo "deb http://archive.debian.org/debian/ wheezy contrib main non-free" > /etc/apt/sources.list && \
|
||||
echo "deb-src http://archive.debian.org/debian/ wheezy contrib main non-free" >> /etc/apt/sources.list && \
|
||||
apt-get update && apt-get install -y apt-utils && \
|
||||
apt-get install -y --force-yes \
|
||||
curl gcc make sudo expect gnupg fakeroot perl-base=5.14.2-21+deb7u3 perl \
|
||||
libc-bin=2.13-38+deb7u10 libc6=2.13-38+deb7u10 libc6-dev build-essential \
|
||||
cdbs devscripts equivs automake autoconf libtool libaudit-dev selinux-basics \
|
||||
libdb5.1=5.1.29-5 libdb5.1-dev libssl1.0.0=1.0.1e-2+deb7u20 procps gawk libsigsegv2 \
|
||||
curl ca-certificates devscripts
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
15
attic/dockerbuild/Dockerfile.kali-rolling
Normal file
15
attic/dockerbuild/Dockerfile.kali-rolling
Normal file
@ -0,0 +1,15 @@
|
||||
FROM kalilinux/kali-rolling:latest
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
15
attic/dockerbuild/Dockerfile.ubuntu-bionic
Normal file
15
attic/dockerbuild/Dockerfile.ubuntu-bionic
Normal file
@ -0,0 +1,15 @@
|
||||
FROM ubuntu:bionic-20200112
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
15
attic/dockerbuild/Dockerfile.ubuntu-eoan
Normal file
15
attic/dockerbuild/Dockerfile.ubuntu-eoan
Normal file
@ -0,0 +1,15 @@
|
||||
FROM ubuntu:eoan-20200114
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd cmake
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
22
attic/dockerbuild/Dockerfile.ubuntu-trusty
Normal file
22
attic/dockerbuild/Dockerfile.ubuntu-trusty
Normal file
@ -0,0 +1,22 @@
|
||||
FROM ubuntu:trusty-20191217
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd libssl-dev
|
||||
|
||||
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
|
||||
tar -xzf cmake.tar.gz && \
|
||||
cd cmake-3.16.3 && \
|
||||
./bootstrap && \
|
||||
make -j4 && \
|
||||
make install
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
22
attic/dockerbuild/Dockerfile.ubuntu-xenial
Normal file
22
attic/dockerbuild/Dockerfile.ubuntu-xenial
Normal file
@ -0,0 +1,22 @@
|
||||
FROM ubuntu:xenial-20200114
|
||||
|
||||
ARG go_pkg_url
|
||||
|
||||
RUN apt-get update && apt-get -y install build-essential curl ca-certificates devscripts dh-systemd
|
||||
|
||||
RUN curl -sL https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz -o cmake.tar.gz && \
|
||||
tar -xzf cmake.tar.gz && \
|
||||
cd cmake-3.16.3 && \
|
||||
./bootstrap && \
|
||||
make -j4 && \
|
||||
make install
|
||||
|
||||
RUN curl -s -k $go_pkg_url -o go.tar.gz && \
|
||||
tar -C /usr/local -xzf go.tar.gz && \
|
||||
rm go.tar.gz
|
||||
|
||||
RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build
|
||||
RUN chmod 777 /home
|
||||
|
||||
CMD ["/usr/bin/sshd", "-D"]
|
||||
|
111
attic/dockerbuild/Makefile
Normal file
111
attic/dockerbuild/Makefile
Normal file
@ -0,0 +1,111 @@
|
||||
.PHONY: all
|
||||
|
||||
all: alpine centos clefos debian ubuntu kali-rolling
|
||||
|
||||
alpine:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.alpine . -t ztbuild/alpine-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.alpine . -t ztbuild/alpine-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.alpine . -t ztbuild/alpine-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.alpine . -t ztbuild/alpine-armel --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.alpine . -t ztbuild/alpine-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.alpine . -t ztbuild/alpine-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.alpine . -t ztbuild/alpine-s390x --load
|
||||
|
||||
centos:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.centos7 . -t ztbuild/centos7-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.centos7-i386 . -t ztbuild/centos7-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.centos6 . -t ztbuild/centos6-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.centos6-i386 . -t ztbuild/centos6-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.centos8 . -t ztbuild/centos8-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.centos8 . -t ztbuild/centos8-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.centos8 . -t ztbuild/centos8-ppc64le --load
|
||||
|
||||
clefos:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.clefos-s390x . -t ztbuild/clefos-s390x --load
|
||||
|
||||
debian: debian-wheezy debian-jessie debian-buster debian-stretch debian-bullseye debian-sid
|
||||
|
||||
debian-wheezy:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-armel --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-i386 --load
|
||||
|
||||
debian-jessie:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-armel --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-i386 --load
|
||||
|
||||
debian-buster:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-armel --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-buster . -t ztbuild/debian-buster-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-buster . -t ztbuild/debian-buster-s390x --load
|
||||
|
||||
debian-stretch:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-armel --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-s390x --load
|
||||
|
||||
debian-bullseye:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-armel --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-s390x --load
|
||||
|
||||
debian-sid:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-armel --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.debian-sid . -t ztbuild/debian-sid-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.debian-sid . -t ztbuild/debian-sid-s390x --load
|
||||
|
||||
ubuntu: ubuntu-trusty ubuntu-xenial ubuntu-bionic ubuntu-eoan
|
||||
|
||||
ubuntu-trusty:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-trusty . -t ztbuild/ubuntu-trusty-ppc64le --load
|
||||
|
||||
ubuntu-xenial:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.ubuntu-xenial . -t ztbuild/ubuntu-xenial-s390x --load
|
||||
|
||||
ubuntu-bionic:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.ubuntu-bionic . -t ztbuild/ubuntu-bionic-s390x --load
|
||||
|
||||
ubuntu-eoan:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-amd64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-arm64 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-armhf --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-i386 --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-ppc64le --load
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-s390x --load
|
||||
|
||||
kali-rolling:
|
||||
@docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.kali-rolling . -t ztbuild/kali-rolling-amd64 --load
|
||||
|
2
attic/dockerbuild/authorized_keys
Normal file
2
attic/dockerbuild/authorized_keys
Normal file
@ -0,0 +1,2 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8hgysbj2Luu3aN/Ya2wr4Y9LpUGqWWfn3k+UhIwOIE/Kd7/YpLjxHpseUA1hLnj9kHFShH8eiqoY0S6EDIYrTUwbXMMu8454lX/LcJOCJ9RlSeMMf7vpkxcI7cVRgOA430a3FR7M0Q8vKlyJzxxAEjMIxMyuVyinknfanNt+sQFiDUvOXoacqgZAHBWMlO7wOPyHWHNOzy7g8N0dHiJveKZqX/UUwuqJuS6UBq7MBMSU6TcMvJwHr+AbNvfyIUWCqlTByqFL9cmviRbIvQanxoRxi/5fVUGhtVBXUYvbCdFxDw5W2Svo9fDMm4Z5xWAD7rY1J3AM15RVyRTTtYvgD
|
||||
|
13
attic/dockerbuild/pipelint.sh
Normal file
13
attic/dockerbuild/pipelint.sh
Normal file
@ -0,0 +1,13 @@
|
||||
# curl (REST API)
|
||||
# User
|
||||
JENKINS_USER=grant
|
||||
|
||||
# Api key from "/me/configure" on my Jenkins instance
|
||||
JENKINS_USER_KEY=11edf2d49321321119712c46c6349eaad7
|
||||
|
||||
# Url for my local Jenkins instance.
|
||||
JENKINS_URL=http://$JENKINS_USER:$JENKINS_USER_KEY@jenkins.int.zerotier.com
|
||||
|
||||
# JENKINS_CRUMB is needed if your Jenkins master has CRSF protection enabled (which it should)
|
||||
JENKINS_CRUMB=`curl "$JENKINS_URL/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)"`
|
||||
curl -X POST -H $JENKINS_CRUMB -F "jenkinsfile=<Jenkinsfile" $JENKINS_URL/pipeline-model-converter/validate
|
17
attic/historic/anode/config.mk.Darwin
Normal file
17
attic/historic/anode/config.mk.Darwin
Normal file
@ -0,0 +1,17 @@
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
|
||||
#ARCH_FLAGS=-arch x86_64 -arch i386 -arch ppc
|
||||
|
||||
DEFS=-DHAS_DEV_URANDOM
|
||||
CXXDEFS=-DBOOST_DISABLE_ASSERTS -DBOOST_NO_TYPEID -DNDEBUG
|
||||
|
||||
CFLAGS=-mmacosx-version-min=10.4 -std=c99 -O6 -ftree-vectorize -Wall $(DEFS) $(ARCH_FLAGS)
|
||||
CXXFLAGS=-mmacosx-version-min=10.4 -Drestrict=__restrict__ -O6 -ftree-vectorize -Wall $(DEFS) $(CXXDEFS) $(ARCH_FLAGS)
|
||||
|
||||
LDFLAGS=-mmacosx-version-min=10.4 $(ARCH_FLAGS)
|
||||
DLLFLAGS=$(ARCH_FLAGS) -shared
|
||||
DLLEXT=dylib
|
||||
|
||||
LIBANODE_LIBS=-lcrypto -lpthread -lresolv
|
||||
LIBSPARK_LIBS=-lz
|
17
attic/historic/anode/config.mk.Linux
Normal file
17
attic/historic/anode/config.mk.Linux
Normal file
@ -0,0 +1,17 @@
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
|
||||
DEFS=-DHAS_DEV_URANDOM
|
||||
|
||||
CFLAGS=-std=c99 -O6 -fPIC -Wall $(DEFS)
|
||||
CXXFLAGS=-Drestrict=__restrict__ -O6 -Wall $(DEFS) -I..
|
||||
|
||||
#CFLAGS=-g -Wall $(DEFS)
|
||||
#CXXFLAGS=-g -Wall $(DEFS)
|
||||
|
||||
LDFLAGS=
|
||||
DLLFLAGS=-shared
|
||||
DLLEXT=so
|
||||
|
||||
LIBANODE_LIBS=-lcrypto -lresolv -pthread
|
||||
LIBSPARK_LIBS=-lz
|
764
attic/historic/anode/docs/anode_protocol.txt
Normal file
764
attic/historic/anode/docs/anode_protocol.txt
Normal file
@ -0,0 +1,764 @@
|
||||
*****************************************************************************
|
||||
Anode Protocol Specification Draft
|
||||
Version 0.8
|
||||
|
||||
(c)2009-2010 Adam Ierymenko
|
||||
*****************************************************************************
|
||||
|
||||
Table of Contents
|
||||
|
||||
*****************************************************************************
|
||||
|
||||
1. Introduction
|
||||
|
||||
Anode provides three components that work together to provide a global,
|
||||
secure, and mobile addressing system for computer networks:
|
||||
|
||||
1) An addressing system based on public key cryptography enabling network
|
||||
devices or applications to assign themselves secure, unique, and globally
|
||||
reachable network addresses in a flat address space.
|
||||
|
||||
2) A system enabling network participants holding global addresses to locate
|
||||
one another on local or global networks with "zero configuration."
|
||||
|
||||
3) A communications protocol for communication between addressed network
|
||||
participants that requires no special operating system support and no
|
||||
changes to existing network infrastructure.
|
||||
|
||||
Using Anode, both fixed and mobile applications and devices can communicate
|
||||
directly as if they were all connected to the same VPN. Anode restores the
|
||||
original vision of the Internet as a "flat" network where anything can talk
|
||||
to anything, and adds the added benefits of address mobility and strong
|
||||
protection against address spoofing and other protocol level attacks.
|
||||
|
||||
1.1. Design Philosophy
|
||||
|
||||
Anode's design philosophy is the classical "KISS" principle: "Keep It Simple
|
||||
Stupid." Anode's design principles are:
|
||||
|
||||
#1: Do not try to solve too many problems at once, and stay in scope.
|
||||
|
||||
Anode does not attempt to solve too many problems at once. It attempts to
|
||||
solve the problems of mobile addressing, address portability, and "flat"
|
||||
addressing in the presence of NAT or other barriers.
|
||||
|
||||
It does not attempt to duplicate the full functionality of SSL, X.509, SSH,
|
||||
XMPP, an enterprise service bus, a pub/sub architecture, BitTorrent, etc. All
|
||||
of those protocols and services can be used over Anode if their functionality
|
||||
is desired.
|
||||
|
||||
#2: Avoid state management.
|
||||
|
||||
State multiplies the complexity and failure modes of network protocols. State
|
||||
also tends to get in the way of the achievement of new features implicitly
|
||||
(see principle #4). Avoid state whenever possible.
|
||||
|
||||
#3: Avoid algorithm and dependency bloat.
|
||||
|
||||
Anode uses only elliptic curve Diffie-Hellman (EC-DH) and AES-256. No other
|
||||
cryptographic algorithms or hash functions are presently necessary. This
|
||||
yields implementations compact enough for embedded devices.
|
||||
|
||||
Anode also requires few or no dependencies, depending on whether the two
|
||||
needed cryptographic algorithms are obtained through a library or included.
|
||||
No other protocols or libraries are required in an implementation.
|
||||
|
||||
#4: Achieve features implicitly.
|
||||
|
||||
Use a simple stateless design that allows features to be achieved implicitly
|
||||
rather than specified explicitly. For example, Anode can do multi-homing and
|
||||
could be used to build a mesh network, but neither of these features is
|
||||
explicitly specified.
|
||||
|
||||
*****************************************************************************
|
||||
|
||||
2. Core Concepts and Algorithms
|
||||
|
||||
This section describes addresses, zones, common algorithms, and other core
|
||||
concepts.
|
||||
|
||||
2.1. Zones
|
||||
|
||||
A zone is a 32-bit integer encoded into every Anode address. Zones serve to
|
||||
assist in the location of peers by address on global IP networks. They are
|
||||
not presently significant for local communications, though they could be
|
||||
used to partition addresses into groups or link them with configuration
|
||||
options.
|
||||
|
||||
Each zone has a corresponding zone file which can be fetched in a number of
|
||||
ways (see below). A zone file is a flat text format dictionary of the format
|
||||
"key=value" separated by carriage returns. Line feeds are ignored, and any
|
||||
character may be escaped with a backslash (\) character. Blank lines are
|
||||
ignored.
|
||||
|
||||
The following entries must appear in a zone file:
|
||||
|
||||
n=<zone name>
|
||||
d=<zone description>
|
||||
c=<zone contact, e-mail address of zone administrator>
|
||||
r=<zone revision, monotonically increasing integer with each edit>
|
||||
ttl=<seconds before zone file should be re-checked for changes>
|
||||
|
||||
Additional fields may appear as well, including fields specific to special
|
||||
applications or protocols supported within the zone. Some of these are
|
||||
defined in this document.
|
||||
|
||||
Zone file fetching mechanisms are described below. Multiple mechanisms are
|
||||
specified to enable fallback in the event that one mechanism is not available.
|
||||
|
||||
2.1.1. Zone File Retrieval
|
||||
|
||||
Zone files are retrieved via HTTP, with the HTTP address being formed in one
|
||||
of two ways.
|
||||
|
||||
The preferred DNS method:
|
||||
|
||||
To fetch a zone file via DNS, use the zone ID to generate a host name and URI
|
||||
of the form:
|
||||
|
||||
http://a--XXXXXXXX.net/z
|
||||
|
||||
The XXXXXXXX field is the zone ID in hexadecimal.
|
||||
|
||||
The fallback IP method:
|
||||
|
||||
For fallback in the absence of DNS, the zone ID can be used directly as an
|
||||
IPv4 or IPv4-mapped-to-IPv6 IP address. A URI is generated of the form:
|
||||
|
||||
http://ip_address/z
|
||||
|
||||
Support for this method requires that a zone ID be chosen to correspond to a
|
||||
permanent IPv4 (preferably mappable to IPv6 space as well) IP address.
|
||||
|
||||
2.1.2. Zone ID Reservation
|
||||
|
||||
By convention, a zone ID is considered reserved when a domain of the form
|
||||
"a--XXXXXXXX.net" (where XXXXXXXX is the ID in hex) is registered.
|
||||
|
||||
It is recommended that this be done even for zone IDs not used for global
|
||||
address location in order to globally reserve them.
|
||||
|
||||
2.2. Addresses
|
||||
|
||||
Anode addresses are binary strings containing a 32-bit zone ID, a public key,
|
||||
and possibly other fields. Only one address type is presently defined:
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Name | Type ID | Elliptic Curve Parameters | Total Length |
|
||||
|---------------------------------------------------------------------------|
|
||||
| ANODE-256-40 | 1 | NIST-P-256 | 40 |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Name | Binary Layout |
|
||||
|---------------------------------------------------------------------------|
|
||||
| ANODE-256-40 | <type[1]><zone[4]><unused[2]><public key[33]> |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
The public key is a "compressed" form elliptic curve public key as described
|
||||
in RFC5480.
|
||||
|
||||
The unused section of the address must be zero. These bytes are reserved for
|
||||
future use.
|
||||
|
||||
2.2.1. ASCII Format For Addresses
|
||||
|
||||
Addresses are encoded in ASCII using base-32, which provides a quotable and
|
||||
printable encoding that is of manageable length and is case-insensitive. For
|
||||
example, an ANODE-256-40 address is 64 characters long in base-32 encoding.
|
||||
|
||||
2.3. Relaying
|
||||
|
||||
An Anode peer may optionally relay packets to any other reachable peer.
|
||||
Relaying is accomplished by sending a packet to a peer with the recipient set
|
||||
to the final recipient. The receiving peer will, if relaying is allowed and if
|
||||
it knows of or can reach the recipient, forward the packet.
|
||||
|
||||
No error is returned if relaying fails, so relay paths are treated as possible
|
||||
paths for communication until a return is received in the same way as direct
|
||||
paths.
|
||||
|
||||
Relaying can be used by peers to send messages indirectly, locate one
|
||||
another, and determine network location information to facilitate the
|
||||
establishment of direct communications.
|
||||
|
||||
Peers may refuse to relay or may limit the transmission rate at which packets
|
||||
can be relayed.
|
||||
|
||||
2.3.1. Zone Relays
|
||||
|
||||
If a zone's addresses are globally reachable on global IP networks, it must
|
||||
have one or more zone relays. These must have globally reachable public
|
||||
static IP addresses.
|
||||
|
||||
Zone relays are specified in the zone file in the following format:
|
||||
|
||||
zr.<address checksum>=<ip>[,<ip>]:<udp port>:<tcp port>:<anode addresses>
|
||||
|
||||
The address checksum is the sum of the bytes in the Anode address modulus
|
||||
the number of "zr" entries, in hexadecimal. For example, if a zone had four
|
||||
global relays its zone file could contain the lines:
|
||||
|
||||
zr.0=1.2.3.4:4343:4344:klj4j3...
|
||||
zr.1=2.3.4.5:4343:4344:00194j...
|
||||
zr.2=3.4.5.6:4343:4344:1j42zz...
|
||||
zr.3=4.5.6.7:4343:4344:z94j1q...
|
||||
|
||||
The relay would be chosen by taking the sum of the bytes in the address
|
||||
modulo 4. For example, if the bytes of an address sum to 5081 then relay
|
||||
zr.1 would be used to communicate with that address.
|
||||
|
||||
If more than one IP address is listed for a given relay, the peer must choose
|
||||
at random from among the addresses of the desired type (IPv4 or IPv6).
|
||||
|
||||
Each relay must have one Anode address for every address type supported within
|
||||
the zone. (At present there is only one address type defined.)
|
||||
|
||||
Peers should prefer UDP and fall back to TCP only if UDP is not available.
|
||||
|
||||
To make itself available, a peer must make itself known to its designated zone
|
||||
relay. This is accomplished by sending a PING message.
|
||||
|
||||
2.4. Key Agreement and Derivation
|
||||
|
||||
Key agreement is performed using elliptic curve Diffie-Hellman. This yields
|
||||
a raw key whose size depends on the elliptic curve parameters in use.
|
||||
|
||||
The following algorithm is used to derive a key of any length from a raw
|
||||
key generated through key agreement:
|
||||
|
||||
1) Zero the derived key buffer.
|
||||
2) Determine the largest of the original raw key or the derived key.
|
||||
3) Loop from 0 to the largest length determined in step 2, XOR each byte of
|
||||
the derived key buffer with the corresponding byte of the original key
|
||||
buffer with each index being modulus the length of the respective buffer.
|
||||
|
||||
2.5. Message Authentication
|
||||
|
||||
For message authentication, CMAC-AES (with AES-256) is used. This is also
|
||||
known in some literature as OMAC1-AES. The key is derived from key agreement
|
||||
between the key pair of the sending peer and the address of the recipient.
|
||||
|
||||
2.6. AES-DIGEST
|
||||
|
||||
To maintain cryptographic algorithm frugality, a cryptographic hash function
|
||||
is constructed from the AES-256 cipher. This hash function uses the common
|
||||
Davis-Meyer construction with Merkle-Damgård length padding.
|
||||
|
||||
It is described by the following pseudocode:
|
||||
|
||||
byte previous_digest[16]
|
||||
byte digest[16] = { 0,0,... }
|
||||
byte block[32] = { 0,0,... }
|
||||
integer block_counter = 0
|
||||
|
||||
; digest message
|
||||
for each byte b of message
|
||||
block[block_counter] = b
|
||||
block_counter = block_counter + 1
|
||||
if block_counter == 32 then
|
||||
block_counter = 0
|
||||
save digest[] in previous_digest[]
|
||||
encrypt digest[] with aes-256 using block[] as 256-bit aes-256 key
|
||||
xor digest[] with previous_digest[]
|
||||
end if
|
||||
next
|
||||
|
||||
; append end marker, do final block
|
||||
block[block_counter] = 0x80
|
||||
block_counter = block_counter + 1
|
||||
zero rest of block[] from block_counter to 15
|
||||
save digest[] in previous_digest[]
|
||||
encrypt digest[] with aes-256 using block[] as 256-bit aes-256 key
|
||||
xor digest[] with previous_digest[]
|
||||
|
||||
; Merkle-Damgård length padding
|
||||
zero first 8 bytes of block[]
|
||||
fill last 8 bytes of block[] w/64-bit length in big-endian order
|
||||
save digest[] in previous_digest[]
|
||||
encrypt digest[] with aes-256 using block[] as 256-bit aes-128 key
|
||||
xor digest[] with previous_digest[]
|
||||
|
||||
; digest[] now contains 128-bit message digest
|
||||
|
||||
2.7. Short Address Identifiers (Address IDs)
|
||||
|
||||
A short 8-byte version of the Anode address is used in the protocol to reduce
|
||||
transmission overhead when both sides are already aware of the other's full
|
||||
address.
|
||||
|
||||
The short address identifier is formed by computing the AES-DIGEST of the
|
||||
full address and then XORing the first 8 bytes of the digest with the last
|
||||
8 bytes to yield an 8-byte shortened digest.
|
||||
|
||||
2.8. DNS Resolution of Anode Addresses
|
||||
|
||||
Anode addresses can be saved in DNS TXT records in the following format:
|
||||
|
||||
anode:<address in base32 ASCII encoding>
|
||||
|
||||
This permits Anode addresses to be resolved from normal DNS host name.
|
||||
|
||||
2.9. Packet Transmission Mechanisms
|
||||
|
||||
2.9.1. UDP Transmission
|
||||
|
||||
The recommended method of sending Anode packets is UDP. Each packet is simply
|
||||
sent as a UDP packet.
|
||||
|
||||
2.9.2. TCP Transmission
|
||||
|
||||
To send packets over TCP, each packet is prefixed by its size as a 16-bit
|
||||
integer.
|
||||
|
||||
2.9.3. HTTP Transmission
|
||||
|
||||
Anode packets may be submitted in HTTP POST transactions for transport over
|
||||
networks where HTTP is the only available protocol.
|
||||
|
||||
Anode packets are simply prefixed with a 16-byte packet size and concatenated
|
||||
together just as they are in a TCP stream. One or more packets may be sent
|
||||
with each HTTP POST transaction for improved performance.
|
||||
|
||||
Since this method is intended for use in "hostile" or highly restricted
|
||||
circumstances, no additional details such as special headers or MIME types
|
||||
are specified to allow maximum flexibility. Peers should ignore anything
|
||||
other than the payload.
|
||||
|
||||
2.10. Endpoints
|
||||
|
||||
An endpoint indicates a place where Anode packets may be sent. The following
|
||||
endpoint types are specified:
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Endpoint Type | Description | Address Format |
|
||||
|---------------------------------------------------------------------------|
|
||||
| 0x00 | Unspecified | (none) |
|
||||
| 0x01 | Ethernet | <mac[6]> |
|
||||
| 0x02 | UDP/IPv4 | <ip[4]><port[2]> |
|
||||
| 0x03 | TCP/IPv4 | <ip[4]><port[2]> |
|
||||
| 0x04 | UDP/IPv6 | <ip[16]><port[2]> |
|
||||
| 0x05 | TCP/IPv6 | <ip[16]><port[2]> |
|
||||
| 0x06 | HTTP | <null-terminated full URI> |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
Endpoints are encoded by beginning with a single byte indicating the endpoint
|
||||
type followed by the address information required for the given type.
|
||||
|
||||
Note that IP ports bear no relationship to Anode protocol ports.
|
||||
|
||||
2.11. Notes
|
||||
|
||||
All integers in the protocol are transmitted in network (big endian) byte
|
||||
order.
|
||||
|
||||
*****************************************************************************
|
||||
|
||||
3. Common Packet Format
|
||||
|
||||
A common header is used for all Anode packets:
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Hop Count | 1 | 8-bit hop count (not included in MAC) |
|
||||
| Flags | 1 | 8-bit flags |
|
||||
| MAC | 8 | 8 byte shortened CMAC-AES of packet |
|
||||
| Sender Address | ? | Full address or short ID of sender |
|
||||
| Recipient Address | ? | Full address or short ID of recipient |
|
||||
| Peer IDs | 1 | Two 4-bit peer IDs: sender, recipient |
|
||||
| Message Type | 1 | 8-bit message type |
|
||||
| Message | ? | Message payload |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
3.1. Hop Count
|
||||
|
||||
The hop count begins at zero and must be incremented by each peer that relays
|
||||
the packet to another peer. The hop count must not wrap to zero at 255.
|
||||
|
||||
Because the hop count is modified in transit, it is not included in MAC
|
||||
calculation or authentication.
|
||||
|
||||
The hop count is used to prioritize endpoints that are direct over endpoints
|
||||
that involve relaying, or to prioritize closer routes over more distant
|
||||
ones.
|
||||
|
||||
3.2. Flags and Flag Behavior
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Flag | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| 0x01 | Sender address fully specified |
|
||||
| 0x02 | Recipient address fully specified |
|
||||
| 0x04 | Authentication error response |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
If flag 0x01 is set, then the sender address will be the full address rather
|
||||
than a short address identifier. The length of the address can be determined
|
||||
from the first byte of the address, which always specifies the address type.
|
||||
Flag 0x02 has the same meaning for the recipient address.
|
||||
|
||||
A peer must send fully specified sender addresses until it receives a response
|
||||
from the recipient. At this point the sender may assume that the recipient
|
||||
knows its address and use short a short sender address instead. This
|
||||
assumption should time out, with a recommended timeout of 60 seconds.
|
||||
|
||||
There is presently no need to send fully specified recipient addresses, but
|
||||
the flag is present in case it is needed and must be honored.
|
||||
|
||||
Flag 0x04 indicates that this is an error response containing a failed
|
||||
authentication error. Since authentication failed, this packet may not have
|
||||
a valid MAC. Packets with this flag must never have any effect other than
|
||||
to inform of an error. This error, since it is unauthenticated, must never
|
||||
have any side effects such as terminating a connection.
|
||||
|
||||
3.3. MAC
|
||||
|
||||
The MAC is calculated as follows:
|
||||
|
||||
1) Temporarily set the 64-bit/8-byte MAC field in the packet to the packet's
|
||||
size as a 64-bit big-endian integer.
|
||||
2) Calculate the MAC for the entire packet (excluding the first byte) using
|
||||
the key agreed upon between the sender and the recipient, resulting in a
|
||||
16 byte full CMAC-AES MAC.
|
||||
3) Derive the 8 byte packet MAC by XORing the first 8 bytes of the full 16
|
||||
byte CMAC-AES MAC with the last 8 bytes. Place this into the packet's MAC
|
||||
field.
|
||||
|
||||
3.4. Peer IDs
|
||||
|
||||
Peer IDs provide a method for up to 15 different peers to share an address,
|
||||
each with a unique ID allowing packets to be routed to them individually.
|
||||
|
||||
A peer ID of zero indicates "any" or "unspecified." Real peers must have a
|
||||
nonzero peer ID. In the normal single peer per address case, any peer ID may
|
||||
be used. If multiple peers are to share an address, some implementation-
|
||||
dependent method must be used to ensure that each peer has a unique peer ID.
|
||||
|
||||
Relaying peers must follow these rules based on the recipient peer ID when
|
||||
relaying messages:
|
||||
|
||||
- IF the peer ID is zero or if the peer ID is not known, the message must
|
||||
be forwarded to a random endpoint for the given recipient address.
|
||||
- IF the peer ID is nonzero and matches one or more known endpoints for the
|
||||
given recipient address and peer ID, the message must only be sent to
|
||||
a matching endpoint.
|
||||
|
||||
A receiving peer should process any message that it receives regardless of
|
||||
whether its recipient peer ID is correct. The peer ID is primarily for relays.
|
||||
|
||||
Peers should typically send messages with a nonzero recipient peer ID when
|
||||
responding to or involved in a conversation with a specific peer (e.g. a
|
||||
streaming connection), and send zero recipient peer IDs otherwise.
|
||||
|
||||
3.5. Short Address Conflict Disambiguation
|
||||
|
||||
In the unlikely event of two Anode addresses with the same short identifier,
|
||||
the recipient should use MAC validation to disambiguate. The peer ID must not
|
||||
be relied upon for this purpose.
|
||||
|
||||
*****************************************************************************
|
||||
|
||||
4. Basic Signaling and Transport Protocol
|
||||
|
||||
4.1. Message Types
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Type | ID | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| ERROR | 0x00 | Error response |
|
||||
| PING | 0x01 | Echo request |
|
||||
| PONG | 0x02 | Echo response |
|
||||
| EPC_REQ | 0x03 | Endpoint check request |
|
||||
| EPC | 0x04 | Endpoint check response |
|
||||
| EPI | 0x05 | Endpoint information |
|
||||
| NAT_T | 0x06 | NAT traversal message |
|
||||
| NETID_REQ | 0x07 | Request network address identification and/or test |
|
||||
| NETID | 0x08 | Response to network address identification request |
|
||||
| DGRAM | 0x09 | Simple UDP-like datagram |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
4.2. Message Details
|
||||
|
||||
4.2.1. ERROR
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Error Code | 2 | 16-bit error code |
|
||||
| Error Arguments | ? | Error arguments, depending on error type |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
Error arguments are empty unless otherwise stated below.
|
||||
|
||||
Error codes:
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Error Code | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| 0x01 | Message not valid |
|
||||
| 0x02 | Message authentication or decryption failed |
|
||||
| 0x03 | Relaying and related features not authorized |
|
||||
| 0x04 | Relay recipient not reachable |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
Generation of errors is optional. A peer may choose to ignore invalid
|
||||
messages or to throttle the sending of errors.
|
||||
|
||||
4.2.2. PING
|
||||
|
||||
(Payload unspecified.)
|
||||
|
||||
Request echo of payload as PONG message.
|
||||
|
||||
4.2.3. PONG
|
||||
|
||||
(Payload unspecified.)
|
||||
|
||||
Echoed payload of received PING message.
|
||||
|
||||
4.2.4. EPC_REQ
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Request ID | 4 | 32-bit request ID |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
Request echo of request ID in EPC message, used to check and learn endpoints.
|
||||
|
||||
To learn a network endpoint for a peer, CHECK_REQ is sent. If CHECK is
|
||||
returned with a valid request ID, the endpoint is considered valid.
|
||||
|
||||
4.2.5. EPC
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Request ID | 4 | 32-bit request ID echoed back |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
Response to EPC_REQ containing request ID.
|
||||
|
||||
4.2.6. EPI
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Flags | 1 | 8-bit flags |
|
||||
| Endpoint | ? | Endpoint type and address |
|
||||
| NAT-T mode | 1 | 8-bit NAT traversal mode |
|
||||
| NAT-T options | ? | Options related to specified NAT-T mode |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
EPI stands for EndPoint Identification, and is sent to notify another peer of
|
||||
a network endpoint where the sending peer is reachable.
|
||||
|
||||
If the receiving peer is interested in communicating with the sending peer,
|
||||
the receiving peer must send EPC_REQ to the sending peer at the specified
|
||||
endpoint to check the validity of that endpoint. The endpoint is learned if a
|
||||
valid EPC is returned.
|
||||
|
||||
If the endpoint in EPI is unspecified, the actual source of the EPI message
|
||||
is the endpoint. This allows EPI messages to be broadcast on a local LAN
|
||||
segment to advertise the presence of an address on a local network. EPI
|
||||
broadcasts on local IP networks must be made to UDP port 8737.
|
||||
|
||||
Usually EPI is sent via relays (usually zone relays) to inform a peer of an
|
||||
endpoint for direct communication.
|
||||
|
||||
There are presently no flags, so flags must be zero.
|
||||
|
||||
4.2.7. NAT_T
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| NAT-T mode | 1 | 8-bit NAT traversal mode |
|
||||
| NAT-T options | ? | Options related to specified NAT-T mode |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
NAT_T is used to send messages specific to certain NAT traversal modes.
|
||||
|
||||
4.2.8. NETID_REQ
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Request ID | 4 | 32-bit request ID |
|
||||
| Endpoint | ? | Endpoint type and address information |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
When a NETID_REQ message is received, the recipient attempts to echo it back
|
||||
as a NETID message to the specified endpoint address. If the endpoint is
|
||||
unspecified, the recipient must fill it in with the actual origin of the
|
||||
NETID_REQ message. This allows a peer to cooperate with another peer (usually
|
||||
a zone relay) to empirically determine its externally visible network
|
||||
address information.
|
||||
|
||||
A peer may ignore NETID_REQ or respond with an error if it does not allow
|
||||
relaying.
|
||||
|
||||
4.2.9. NETID
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Request ID | 4 | 32-bit request ID echoed back |
|
||||
| Endpoint Type | 1 | 8-bit endpoint type |
|
||||
| Endpoint Address | ? | Endpoint Address (size depends on type) |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
NETID is sent in response to NETID_REQ to the specified endpoint address. It
|
||||
always contains the endpoint address to which it was sent.
|
||||
|
||||
4.2.10. DGRAM
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Source Port | 2 | 16-bit source port |
|
||||
| Destination Port | 2 | 16-bit destination port |
|
||||
| Payload | ? | Datagram packet payload |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
A datagram is a UDP-like message without flow control or delivery assurance.
|
||||
|
||||
*****************************************************************************
|
||||
|
||||
5. Stream Protocol
|
||||
|
||||
The stream protocol is very similar to TCP, though it omits some features
|
||||
that are not required since they are taken care of by the encapsulating
|
||||
protocol. SCTP was also an inspiration in the design.
|
||||
|
||||
5.1. Message Types
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Type | ID | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| S_OPEN | 20 | Initiate a streaming connection (like TCP SYN) |
|
||||
| S_CLOSE | 21 | Terminate a streaming connection (like TCP RST/FIN) |
|
||||
| S_DATA | 22 | Data packet |
|
||||
| S_ACK | 23 | Acknowedge receipt of one or more data packets |
|
||||
| S_DACK | 24 | Combination of DATA and ACK |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
5.2. Message Details
|
||||
|
||||
5.2.1. S_OPEN
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Sender Link ID | 2 | 16-bit sender link ID |
|
||||
| Destination Port | 2 | 16-bit destination port |
|
||||
| Window Size | 2 | 16-bit window size in 1024-byte increments |
|
||||
| Init. Seq. Number | 4 | 32-bit initial sequence number |
|
||||
| Flags | 1 | 8-bit flags |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
The OPEN message corresponds to TCP SYN, and initiates a connection. It
|
||||
specifies the initial window size for the sender and the sender's initial
|
||||
sequence number, which should be randomly chosen to prevent replay attacks.
|
||||
|
||||
If OPEN is successful, the recipient sends its own OPEN to establish the
|
||||
connetion. If OPEN is unsuccessful, CLOSE is sent with its initial and current
|
||||
sequence numbers equal and an appropriate reason such as "connection refused."
|
||||
|
||||
The sender link ID must be unique for a given recipient.
|
||||
|
||||
If flag 01 is set, the sender link ID is actually a source port where the
|
||||
sender might be listening for connections as well. This exactly duplicates
|
||||
the behavior of standard TCP. Otherwise, the sender link ID is simply an
|
||||
arbitrary number that the sender uses to identify the connection with this
|
||||
recipient and there is no port of origin. Ports of origin are optional for
|
||||
Anode streaming connections to permit greater scalability.
|
||||
|
||||
5.2.2. S_CLOSE
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Sender Link ID | 2 | 16-bit sender link ID |
|
||||
| Destination Port | 2 | 16-bit destination port |
|
||||
| Flags | 1 | 8-bit flags |
|
||||
| Reason | 1 | 8-bit close reason |
|
||||
| Init. Seq. Number | 4 | 32-bit initial sequence number |
|
||||
| Sequence Number | 4 | 32-bit current sequence number |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
The CLOSE message serves a function similar to TCP FIN. The initial sequence
|
||||
number is the original starting sequence number sent with S_OPEN, while the
|
||||
current sequence number is the sequence number corresponding to the close
|
||||
and must be ACKed to complete the close operation. The use of the initial
|
||||
sequence number helps to serve as a key to prevent replay attacks.
|
||||
|
||||
CLOSE is also used to indicate a failed OPEN attempt. In this case the current
|
||||
sequence number will be equal to the initial sequence number and no ACK will
|
||||
be expected.
|
||||
|
||||
There are currently no flags, so flags must be zero.
|
||||
|
||||
The reason field describes the reason for the close:
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Reason Code | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| 00 | Application closed connection |
|
||||
| 01 | Connection refused |
|
||||
| 02 | Protocol error |
|
||||
| 03 | Timed out |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
Established connections will usually be closed with reason 00, while reason
|
||||
01 is usually provided if an OPEN is received but the port is not bound.
|
||||
|
||||
5.2.3. S_DATA
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Sender Link ID | 2 | 16-bit sender link ID |
|
||||
| Destination Port | 2 | 16-bit destination port |
|
||||
| Sequence Number | 4 | 32-bit sequence number |
|
||||
| Payload | ? | Data payload |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
The DATA message carries a packet of data, with the sequence number
|
||||
determining order. The sequence number is monotonically incremented with
|
||||
each data packet, and wraps at the maximum value of an unsigned 32-bit
|
||||
integer.
|
||||
|
||||
5.2.4. S_ACK
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Sender Link ID | 2 | 16-bit sender link ID |
|
||||
| Destination Port | 2 | 16-bit destination port |
|
||||
| Window Size | 2 | 16-bit window size in 1024-byte increments |
|
||||
| Acknowledgements | ? | One or more acknowledgements (see below) |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
Each acknowledgement is a 32-bit integer followed by an 8-bit integer (5 bytes
|
||||
total). The 32-bit integer is the first sequence number to acknowledge, and
|
||||
the 8-bit integer is the number of sequential following sequence numbers to
|
||||
acknowledge. For example "1, 4" would acknowledge sequence numbers 1, 2, 3,
|
||||
and 4.
|
||||
|
||||
5.2.5. S_DACK
|
||||
|
||||
|---------------------------------------------------------------------------|
|
||||
| Field | Length | Description |
|
||||
|---------------------------------------------------------------------------|
|
||||
| Sender Link ID | 2 | 16-bit sender link ID |
|
||||
| Destination Port | 2 | 16-bit destination port |
|
||||
| Window Size | 2 | 16-bit window size in 1024-byte increments |
|
||||
| Num. Acks | 1 | 8-bit number of acknowledgements |
|
||||
| Acknowledgements | ? | One or more acknowledgements |
|
||||
| Payload | ? | Data payload |
|
||||
|---------------------------------------------------------------------------|
|
||||
|
||||
The DACK message combines ACK and DATA, allowing two peers that are both
|
||||
transmitting data to efficiently ACK without a separate packet.
|
33
attic/historic/anode/libanode/Makefile
Normal file
33
attic/historic/anode/libanode/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
SYSNAME:=${shell uname}
|
||||
SYSNAME!=uname
|
||||
include ../config.mk.${SYSNAME}
|
||||
|
||||
LIBANODE_OBJS= \
|
||||
impl/aes.o \
|
||||
impl/dictionary.o \
|
||||
impl/dns_txt.o \
|
||||
impl/ec.o \
|
||||
impl/environment.o \
|
||||
impl/misc.o \
|
||||
impl/thread.o \
|
||||
address.o \
|
||||
aes_digest.o \
|
||||
errors.o \
|
||||
identity.o \
|
||||
network_address.o \
|
||||
secure_random.o \
|
||||
system_transport.o \
|
||||
uri.o
|
||||
# zone.o
|
||||
|
||||
all: $(LIBANODE_OBJS)
|
||||
ar rcs libanode.a $(LIBANODE_OBJS)
|
||||
ranlib libanode.a
|
||||
$(CC) $(CFLAGS) -o utils/anode-make-identity utils/anode-make-identity.c $(LIBANODE_OBJS) $(LIBANODE_LIBS)
|
||||
|
||||
clean: force
|
||||
rm -f $(LIBANODE_OBJS)
|
||||
rm -f libanode.$(DLLEXT) libanode.a
|
||||
rm -f utils/anode-make-identity
|
||||
|
||||
force: ;
|
98
attic/historic/anode/libanode/address.c
Normal file
98
attic/historic/anode/libanode/address.c
Normal file
@ -0,0 +1,98 @@
|
||||
/* libanode: the Anode C reference implementation
|
||||
* Copyright (C) 2009-2010 Adam Ierymenko <adam.ierymenko@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "impl/aes.h"
|
||||
#include "impl/ec.h"
|
||||
#include "impl/misc.h"
|
||||
#include "impl/types.h"
|
||||
#include "anode.h"
|
||||
|
||||
int AnodeAddress_calc_short_id(
|
||||
const AnodeAddress *address,
|
||||
AnodeAddressId *short_address_id)
|
||||
{
|
||||
unsigned char digest[16];
|
||||
|
||||
switch(AnodeAddress_get_type(address)) {
|
||||
case ANODE_ADDRESS_ANODE_256_40:
|
||||
Anode_aes_digest(address->bits,ANODE_ADDRESS_LENGTH_ANODE_256_40,digest);
|
||||
break;
|
||||
default:
|
||||
return ANODE_ERR_ADDRESS_INVALID;
|
||||
}
|
||||
|
||||
*((uint64_t *)short_address_id->bits) = ((uint64_t *)digest)[0] ^ ((uint64_t *)digest)[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AnodeAddress_get_zone(const AnodeAddress *address,AnodeZone *zone)
|
||||
{
|
||||
switch(AnodeAddress_get_type(address)) {
|
||||
case ANODE_ADDRESS_ANODE_256_40:
|
||||
*((uint32_t *)&(zone->bits[0])) = *((uint32_t *)&(address->bits[1]));
|
||||
return 0;
|
||||
}
|
||||
return ANODE_ERR_ADDRESS_INVALID;
|
||||
}
|
||||
|
||||
int AnodeAddress_to_string(const AnodeAddress *address,char *buf,int len)
|
||||
{
|
||||
const unsigned char *inptr;
|
||||
char *outptr;
|
||||
unsigned int i;
|
||||
|
||||
switch(AnodeAddress_get_type(address)) {
|
||||
case ANODE_ADDRESS_ANODE_256_40:
|
||||
if (len < (((ANODE_ADDRESS_LENGTH_ANODE_256_40 / 5) * 8) + 1))
|
||||
return ANODE_ERR_BUFFER_TOO_SMALL;
|
||||
inptr = (const unsigned char *)address->bits;
|
||||
outptr = buf;
|
||||
for(i=0;i<(ANODE_ADDRESS_LENGTH_ANODE_256_40 / 5);++i) {
|
||||
Anode_base32_5_to_8(inptr,outptr);
|
||||
inptr += 5;
|
||||
outptr += 8;
|
||||
}
|
||||
*outptr = (char)0;
|
||||
return ((ANODE_ADDRESS_LENGTH_ANODE_256_40 / 5) * 8);
|
||||
}
|
||||
return ANODE_ERR_ADDRESS_INVALID;
|
||||
}
|
||||
|
||||
int AnodeAddress_from_string(const char *str,AnodeAddress *address)
|
||||
{
|
||||
const char *blk_start = str;
|
||||
const char *ptr = str;
|
||||
unsigned int address_len = 0;
|
||||
|
||||
while (*ptr) {
|
||||
if ((unsigned long)(ptr - blk_start) == 8) {
|
||||
if ((address_len + 5) > sizeof(address->bits))
|
||||
return ANODE_ERR_ADDRESS_INVALID;
|
||||
Anode_base32_8_to_5(blk_start,(unsigned char *)&(address->bits[address_len]));
|
||||
address_len += 5;
|
||||
blk_start = ptr;
|
||||
}
|
||||
++ptr;
|
||||
}
|
||||
|
||||
if (ptr != blk_start)
|
||||
return ANODE_ERR_ADDRESS_INVALID;
|
||||
if (AnodeAddress_get_type(address) != ANODE_ADDRESS_ANODE_256_40)
|
||||
return ANODE_ERR_ADDRESS_INVALID;
|
||||
|
||||
return 0;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user