mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-09-22 15:29:03 -07:00
Compare commits
599
Commits
| 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 | ||
|
|
182561f7e6 | ||
|
|
41871c8b1e | ||
|
|
782b75a64e | ||
|
|
0c58901469 | ||
|
|
73b23f1b16 | ||
|
|
5a29f9ba2d | ||
|
|
03190c5a55 | ||
|
|
dab968ed96 | ||
|
|
b598263261 | ||
|
|
eef70e198b | ||
|
|
89c41f88a4 | ||
|
|
53b7c8f725 | ||
|
|
d471142908 | ||
|
|
3ff9ffd5d4 | ||
|
|
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 |
No files matched your search
@@ -0,0 +1,3 @@
|
||||
.git/
|
||||
build/
|
||||
!build/zerotier
|
||||
Executable → Regular
+10
-64
@@ -1,30 +1,23 @@
|
||||
build/
|
||||
/version.h
|
||||
/build
|
||||
/cmake-build-debug
|
||||
/cmake-build-release
|
||||
/core/version.h
|
||||
/.idea
|
||||
/.ide-*
|
||||
.DS_Store
|
||||
.Trashes
|
||||
*.swp
|
||||
._*
|
||||
*~
|
||||
*~.nib
|
||||
*.secret
|
||||
.Apple*
|
||||
Thumbs.db
|
||||
@eaDir
|
||||
DerivedData/
|
||||
*.pbxuser
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.perspectivev3
|
||||
!default.pbxuser
|
||||
!default.mode1v3
|
||||
!default.mode2v3
|
||||
!default.perspectivev3
|
||||
*.xccheckout
|
||||
xcuserdata/
|
||||
.vscode
|
||||
__pycache__
|
||||
attic/world/*.c25519
|
||||
attic/world/mkworld
|
||||
*.log
|
||||
*.bak
|
||||
*.opensdf
|
||||
*.user
|
||||
*.cache
|
||||
@@ -41,53 +34,6 @@ attic/world/mkworld
|
||||
*.tmp
|
||||
.depend
|
||||
node_modules
|
||||
debian/files
|
||||
debian/zerotier-one
|
||||
debian/zerotier-one*.debhelper
|
||||
debian/*.log
|
||||
debian/zerotier-one.substvars
|
||||
root/identity.*
|
||||
root/config.*
|
||||
/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg
|
||||
/go/zerotier
|
||||
|
||||
/windows/ZeroTierOne.sdf
|
||||
/windows/ZeroTierOne.v11.suo
|
||||
/windows/x64
|
||||
/windows/Win32
|
||||
/windows/*/x64
|
||||
/windows/*/Win32
|
||||
/windows/ZeroTierOne/Release
|
||||
/windows/ZeroTierOneService/obj
|
||||
/windows/ZeroTierOneService/bin
|
||||
/windows/Build
|
||||
/windows/Debug
|
||||
/windows/Release
|
||||
/windows/WebUIWrapper/bin
|
||||
/windows/WebUIWrapper/obj
|
||||
/windows/lib
|
||||
/ext/installfiles/windows/ZeroTier One-SetupFiles
|
||||
/ext/installfiles/windows/Prerequisites
|
||||
/ext/installfiles/windows/*-cache
|
||||
/*.msi
|
||||
/windows/.vs
|
||||
*.vcxproj.backup
|
||||
/windows/TapDriver6/Win7Debug
|
||||
/windows/TapDriver6/win7Release
|
||||
/windows/*.db
|
||||
/windows/*.opendb
|
||||
enc_temp_folder
|
||||
/windows/copyutil/bin
|
||||
/windows/copyutil/obj
|
||||
|
||||
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/
|
||||
/*.db
|
||||
/*.opendb
|
||||
Generated
-3
@@ -1,3 +0,0 @@
|
||||
|
||||
# Default ignored files
|
||||
/workspace.xml
|
||||
Generated
-9
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="Go" enabled="true" />
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
-5
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
Generated
-11
@@ -1,11 +0,0 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="api">
|
||||
<words>
|
||||
<w>apisocket</w>
|
||||
<w>nwid</w>
|
||||
<w>secrand</w>
|
||||
<w>sockaddr</w>
|
||||
<w>unmarshals</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
Generated
-6
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/ZeroTierOne.iml" filepath="$PROJECT_DIR$/.idea/ZeroTierOne.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-6
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-29
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectTasksOptions">
|
||||
<TaskOptions isEnabled="true">
|
||||
<option name="arguments" value="fmt $FilePath$" />
|
||||
<option name="checkSyntaxErrors" value="true" />
|
||||
<option name="description" />
|
||||
<option name="exitCodeBehavior" value="ERROR" />
|
||||
<option name="fileExtension" value="go" />
|
||||
<option name="immediateSync" value="false" />
|
||||
<option name="name" value="go fmt" />
|
||||
<option name="output" value="$FilePath$" />
|
||||
<option name="outputFilters">
|
||||
<array />
|
||||
</option>
|
||||
<option name="outputFromStdout" value="false" />
|
||||
<option name="program" value="$GoExecPath$" />
|
||||
<option name="runOnExternalChanges" value="false" />
|
||||
<option name="scopeName" value="Project Files" />
|
||||
<option name="trackOnlyRoot" value="true" />
|
||||
<option name="workingDir" value="$ProjectFileDir$" />
|
||||
<envs>
|
||||
<env name="GOROOT" value="$GOROOT$" />
|
||||
<env name="GOPATH" value="$GOPATH$" />
|
||||
<env name="PATH" value="$GoBinDirs$" />
|
||||
</envs>
|
||||
</TaskOptions>
|
||||
</component>
|
||||
</project>
|
||||
+7
-9
@@ -9,7 +9,7 @@
|
||||
* 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
|
||||
@@ -32,32 +32,30 @@ ZeroTier includes the following third party code, either in ext/ or incorporated
|
||||
|
||||
* LZ4 compression algorithm by Yann Collet
|
||||
|
||||
* Files: node/Packet.cpp (bundled within anonymous namespace)
|
||||
* Files: node/LZ4.cpp
|
||||
* Home page: http://code.google.com/p/lz4/
|
||||
* License grant: BSD 2-clause
|
||||
* License: BSD 2-clause
|
||||
|
||||
* C++11 json (nlohmann/json) by Niels Lohmann
|
||||
|
||||
* Files: ext/json/*
|
||||
* Home page: https://github.com/nlohmann/json
|
||||
* License grant: MIT
|
||||
* License: MIT
|
||||
|
||||
* tap-windows6 by the OpenVPN project
|
||||
|
||||
* Files: windows/TapDriver6/*
|
||||
* Home page: https://github.com/OpenVPN/tap-windows6/
|
||||
* License grant: GNU GPL v2
|
||||
* ZeroTier Modifications: change name of driver to ZeroTier, add ioctl() to get L2 multicast memberships (source is in ext/ and modifications inherit GPL)
|
||||
* License: GNU GPL v2
|
||||
|
||||
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519 digital signature algorithm, and Poly1305 MAC algorithm, all by Daniel J. Bernstein
|
||||
|
||||
* Files: node/Salsa20.* node/C25519.* node/Poly1305.*
|
||||
* Home page: http://cr.yp.to/
|
||||
* License grant: public domain
|
||||
* ZeroTier Modifications: slight cryptographically-irrelevant modifications for inclusion into ZeroTier core
|
||||
* License: public domain
|
||||
|
||||
* cpp-httplib by yhirose
|
||||
|
||||
* Files: ext/cpp-httplib/*
|
||||
* Home page: https://github.com/yhirose/cpp-httplib
|
||||
* License grant: MIT
|
||||
* License: MIT
|
||||
+316
-170
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,5 @@
|
||||
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
|
||||
Copyright © 2011–2019 ZeroTier, Inc.
|
||||
Copyright © 2013–2020 ZeroTier, Inc.
|
||||
|
||||
ZeroTier is released under the terms of the BSL version 1.1. See the
|
||||
file LICENSE.txt for details.
|
||||
|
||||
Vendored
+494
-82
File diff suppressed because it is too large.
Load diff
+4
-4
@@ -10,8 +10,8 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
||||
Parameters
|
||||
|
||||
Licensor: ZeroTier, Inc.
|
||||
Licensed Work: ZeroTier Network Virtualization Engine 1.4.4
|
||||
The Licensed Work is (c)2019 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:
|
||||
|
||||
@@ -26,7 +26,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided you
|
||||
ZeroTier behind the scenes to operate a service not
|
||||
related to ZeroTier network administration.
|
||||
|
||||
* Create Non-Open-Source Commercial Derviative Works
|
||||
* 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
|
||||
@@ -47,7 +47,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided you
|
||||
services, social welfare, senior care, child care, and
|
||||
the care of persons with disabilities.
|
||||
|
||||
Change Date: 2023-01-01
|
||||
Change Date: 2025-01-01
|
||||
|
||||
Change License: Apache License version 2.0 as published by the Apache
|
||||
Software Foundation
|
||||
|
||||
@@ -1,17 +1,28 @@
|
||||
# Common makefile -- loads make rules for each platform
|
||||
|
||||
BUILDDIR := build
|
||||
TIMESTAMP=$(shell date +"%Y%m%d%H%M")
|
||||
|
||||
.PHONY: all
|
||||
|
||||
all: setup
|
||||
cd ${BUILDDIR} && $(MAKE) -j$(shell getconf _NPROCESSORS_ONLN)
|
||||
cd ${BUILDDIR} && $(MAKE) -j4 VERBOSE=1
|
||||
|
||||
setup:
|
||||
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}
|
||||
|
||||
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 && $(MAKE)
|
||||
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}
|
||||
|
||||
@@ -1,6 +1,43 @@
|
||||
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
|
||||
|
||||
@@ -1,461 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/****/
|
||||
|
||||
#ifndef ZT_BINDER_HPP
|
||||
#define ZT_BINDER_HPP
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#include <WinSock2.h>
|
||||
#include <Windows.h>
|
||||
#include <ShlObj.h>
|
||||
#include <netioapi.h>
|
||||
#include <iphlpapi.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <ifaddrs.h>
|
||||
#ifdef __LINUX__
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <atomic>
|
||||
|
||||
#include "../node/InetAddress.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
|
||||
#include "Phy.hpp"
|
||||
#include "OSUtils.hpp"
|
||||
|
||||
#if (defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(__AMD64) || defined(__AMD64__))
|
||||
#define ZT_UDP_DESIRED_BUF_SIZE 1048576
|
||||
#else
|
||||
#define ZT_UDP_DESIRED_BUF_SIZE 131072
|
||||
#endif
|
||||
|
||||
// Period between refreshes of bindings
|
||||
#define ZT_BINDER_REFRESH_PERIOD 30000
|
||||
|
||||
// Max number of bindings
|
||||
#define ZT_BINDER_MAX_BINDINGS 256
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
/**
|
||||
* Enumerates local devices and binds to all potential ZeroTier path endpoints
|
||||
*
|
||||
* This replaces binding to wildcard (0.0.0.0 and ::0) with explicit binding
|
||||
* as part of the path to default gateway support. Under the hood it uses
|
||||
* different queries on different OSes to enumerate devices, and also exposes
|
||||
* device enumeration and endpoint IP data for use elsewhere.
|
||||
*
|
||||
* On OSes that do not support local port enumeration or where this is not
|
||||
* meaningful, this degrades to binding to wildcard.
|
||||
*/
|
||||
class Binder
|
||||
{
|
||||
private:
|
||||
struct _Binding
|
||||
{
|
||||
_Binding() : udpSock((PhySocket *)0),tcpListenSock((PhySocket *)0) {}
|
||||
PhySocket *udpSock;
|
||||
PhySocket *tcpListenSock;
|
||||
InetAddress address;
|
||||
};
|
||||
|
||||
public:
|
||||
Binder() : _bindingCount(0) {}
|
||||
|
||||
/**
|
||||
* Close all bound ports, should be called on shutdown
|
||||
*
|
||||
* @param phy Physical interface
|
||||
*/
|
||||
template<typename PHY_HANDLER_TYPE>
|
||||
void closeAll(Phy<PHY_HANDLER_TYPE> &phy)
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
for(unsigned int b=0,c=_bindingCount;b<c;++b) {
|
||||
phy.close(_bindings[b].udpSock,false);
|
||||
phy.close(_bindings[b].tcpListenSock,false);
|
||||
}
|
||||
_bindingCount = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan local devices and addresses and rebind TCP and UDP
|
||||
*
|
||||
* This should be called after wake from sleep, on detected network device
|
||||
* changes, on startup, or periodically (e.g. every 30-60s).
|
||||
*
|
||||
* @param phy Physical interface
|
||||
* @param ports Ports to bind on all interfaces
|
||||
* @param portCount Number of ports
|
||||
* @param explicitBind If present, override interface IP detection and bind to these (if possible)
|
||||
* @param ifChecker Interface checker function to see if an interface should be used
|
||||
* @tparam PHY_HANDLER_TYPE Type for Phy<> template
|
||||
* @tparam INTERFACE_CHECKER Type for class containing shouldBindInterface() method
|
||||
*/
|
||||
template<typename PHY_HANDLER_TYPE,typename INTERFACE_CHECKER>
|
||||
void refresh(Phy<PHY_HANDLER_TYPE> &phy,unsigned int *ports,unsigned int portCount,const std::vector<InetAddress> explicitBind,INTERFACE_CHECKER &ifChecker)
|
||||
{
|
||||
std::map<InetAddress,std::string> localIfAddrs;
|
||||
PhySocket *udps,*tcps;
|
||||
Mutex::Lock _l(_lock);
|
||||
bool interfacesEnumerated = true;
|
||||
|
||||
if (explicitBind.empty()) {
|
||||
#ifdef __WINDOWS__
|
||||
|
||||
char aabuf[32768];
|
||||
ULONG aalen = sizeof(aabuf);
|
||||
if (GetAdaptersAddresses(AF_UNSPEC,GAA_FLAG_SKIP_ANYCAST|GAA_FLAG_SKIP_MULTICAST|GAA_FLAG_SKIP_DNS_SERVER,(void *)0,reinterpret_cast<PIP_ADAPTER_ADDRESSES>(aabuf),&aalen) == NO_ERROR) {
|
||||
PIP_ADAPTER_ADDRESSES a = reinterpret_cast<PIP_ADAPTER_ADDRESSES>(aabuf);
|
||||
while (a) {
|
||||
PIP_ADAPTER_UNICAST_ADDRESS ua = a->FirstUnicastAddress;
|
||||
while (ua) {
|
||||
InetAddress ip(ua->Address.lpSockaddr);
|
||||
if (ifChecker.shouldBindInterface("",ip)) {
|
||||
switch(ip.ipScope()) {
|
||||
default: break;
|
||||
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
|
||||
case InetAddress::IP_SCOPE_GLOBAL:
|
||||
case InetAddress::IP_SCOPE_SHARED:
|
||||
case InetAddress::IP_SCOPE_PRIVATE:
|
||||
for(int x=0;x<(int)portCount;++x) {
|
||||
ip.setPort(ports[x]);
|
||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
ua = ua->Next;
|
||||
}
|
||||
a = a->Next;
|
||||
}
|
||||
}
|
||||
else {
|
||||
interfacesEnumerated = false;
|
||||
}
|
||||
|
||||
#else // not __WINDOWS__
|
||||
|
||||
/* On Linux we use an alternative method if available since getifaddrs()
|
||||
* gets very slow when there are lots of network namespaces. This won't
|
||||
* work unless /proc/PID/net/if_inet6 exists and it may not on some
|
||||
* embedded systems, so revert to getifaddrs() there. */
|
||||
|
||||
#ifdef __LINUX__
|
||||
char fn[256],tmp[256];
|
||||
std::set<std::string> ifnames;
|
||||
const unsigned long pid = (unsigned long)getpid();
|
||||
|
||||
// Get all device names
|
||||
OSUtils::ztsnprintf(fn,sizeof(fn),"/proc/%lu/net/dev",pid);
|
||||
FILE *procf = fopen(fn,"r");
|
||||
if (procf) {
|
||||
while (fgets(tmp,sizeof(tmp),procf)) {
|
||||
tmp[255] = 0;
|
||||
char *saveptr = (char *)0;
|
||||
for(char *f=Utils::stok(tmp," \t\r\n:|",&saveptr);(f);f=Utils::stok((char *)0," \t\r\n:|",&saveptr)) {
|
||||
if ((strcmp(f,"Inter-") != 0)&&(strcmp(f,"face") != 0)&&(f[0] != 0))
|
||||
ifnames.insert(f);
|
||||
break; // we only want the first field
|
||||
}
|
||||
}
|
||||
fclose(procf);
|
||||
}
|
||||
else {
|
||||
interfacesEnumerated = false;
|
||||
}
|
||||
|
||||
// Get IPv6 addresses (and any device names we don't already know)
|
||||
OSUtils::ztsnprintf(fn,sizeof(fn),"/proc/%lu/net/if_inet6",pid);
|
||||
procf = fopen(fn,"r");
|
||||
if (procf) {
|
||||
while (fgets(tmp,sizeof(tmp),procf)) {
|
||||
tmp[255] = 0;
|
||||
char *saveptr = (char *)0;
|
||||
unsigned char ipbits[16];
|
||||
memset(ipbits,0,sizeof(ipbits));
|
||||
char *devname = (char *)0;
|
||||
int n = 0;
|
||||
for(char *f=Utils::stok(tmp," \t\r\n",&saveptr);(f);f=Utils::stok((char *)0," \t\r\n",&saveptr)) {
|
||||
switch(n++) {
|
||||
case 0: // IP in hex
|
||||
Utils::unhex(f,32,ipbits,16);
|
||||
break;
|
||||
case 5: // device name
|
||||
devname = f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (devname) {
|
||||
ifnames.insert(devname);
|
||||
InetAddress ip(ipbits,16,0);
|
||||
if (ifChecker.shouldBindInterface(devname,ip)) {
|
||||
switch(ip.ipScope()) {
|
||||
default: break;
|
||||
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
|
||||
case InetAddress::IP_SCOPE_GLOBAL:
|
||||
case InetAddress::IP_SCOPE_SHARED:
|
||||
case InetAddress::IP_SCOPE_PRIVATE:
|
||||
for(int x=0;x<(int)portCount;++x) {
|
||||
ip.setPort(ports[x]);
|
||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(devname)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(procf);
|
||||
}
|
||||
|
||||
// Get IPv4 addresses for each device
|
||||
if (ifnames.size() > 0) {
|
||||
const int controlfd = (int)socket(AF_INET,SOCK_DGRAM,0);
|
||||
struct ifconf configuration;
|
||||
configuration.ifc_len = 0;
|
||||
configuration.ifc_buf = nullptr;
|
||||
|
||||
if (controlfd < 0) goto ip4_address_error;
|
||||
if (ioctl(controlfd, SIOCGIFCONF, &configuration) < 0) goto ip4_address_error;
|
||||
configuration.ifc_buf = (char*)malloc(configuration.ifc_len);
|
||||
if (ioctl(controlfd, SIOCGIFCONF, &configuration) < 0) goto ip4_address_error;
|
||||
|
||||
for (int i=0; i < (int)(configuration.ifc_len / sizeof(ifreq)); i ++) {
|
||||
struct ifreq& request = configuration.ifc_req[i];
|
||||
struct sockaddr* addr = &request.ifr_ifru.ifru_addr;
|
||||
if (addr->sa_family != AF_INET) continue;
|
||||
std::string ifname = request.ifr_ifrn.ifrn_name;
|
||||
// name can either be just interface name or interface name followed by ':' and arbitrary label
|
||||
if (ifname.find(':') != std::string::npos)
|
||||
ifname = ifname.substr(0, ifname.find(':'));
|
||||
|
||||
InetAddress ip(&(((struct sockaddr_in *)addr)->sin_addr),4,0);
|
||||
if (ifChecker.shouldBindInterface(ifname.c_str(), ip)) {
|
||||
switch(ip.ipScope()) {
|
||||
default: break;
|
||||
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
|
||||
case InetAddress::IP_SCOPE_GLOBAL:
|
||||
case InetAddress::IP_SCOPE_SHARED:
|
||||
case InetAddress::IP_SCOPE_PRIVATE:
|
||||
for(int x=0;x<(int)portCount;++x) {
|
||||
ip.setPort(ports[x]);
|
||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,ifname));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ip4_address_error:
|
||||
free(configuration.ifc_buf);
|
||||
if (controlfd > 0) close(controlfd);
|
||||
}
|
||||
|
||||
const bool gotViaProc = (localIfAddrs.size() > 0);
|
||||
#else
|
||||
const bool gotViaProc = false;
|
||||
#endif
|
||||
#if !defined(ZT_SDK) || !defined(__ANDROID__) // getifaddrs() freeifaddrs() not available on Android
|
||||
if (!gotViaProc) {
|
||||
struct ifaddrs *ifatbl = (struct ifaddrs *)0;
|
||||
struct ifaddrs *ifa;
|
||||
if ((getifaddrs(&ifatbl) == 0)&&(ifatbl)) {
|
||||
ifa = ifatbl;
|
||||
while (ifa) {
|
||||
if ((ifa->ifa_name)&&(ifa->ifa_addr)) {
|
||||
InetAddress ip = *(ifa->ifa_addr);
|
||||
if (ifChecker.shouldBindInterface(ifa->ifa_name,ip)) {
|
||||
switch(ip.ipScope()) {
|
||||
default: break;
|
||||
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
|
||||
case InetAddress::IP_SCOPE_GLOBAL:
|
||||
case InetAddress::IP_SCOPE_SHARED:
|
||||
case InetAddress::IP_SCOPE_PRIVATE:
|
||||
for(int x=0;x<(int)portCount;++x) {
|
||||
ip.setPort(ports[x]);
|
||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(ifa->ifa_name)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ifa = ifa->ifa_next;
|
||||
}
|
||||
freeifaddrs(ifatbl);
|
||||
}
|
||||
else {
|
||||
interfacesEnumerated = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
} else {
|
||||
for(std::vector<InetAddress>::const_iterator i(explicitBind.begin());i!=explicitBind.end();++i)
|
||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(*i,std::string()));
|
||||
}
|
||||
|
||||
// Default to binding to wildcard if we can't enumerate addresses
|
||||
if (!interfacesEnumerated && localIfAddrs.empty()) {
|
||||
for(int x=0;x<(int)portCount;++x) {
|
||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(InetAddress((uint32_t)0,ports[x]),std::string()));
|
||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(InetAddress((const void *)"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",16,ports[x]),std::string()));
|
||||
}
|
||||
}
|
||||
|
||||
const unsigned int oldBindingCount = _bindingCount;
|
||||
_bindingCount = 0;
|
||||
|
||||
// Save bindings that are still valid, close those that are not
|
||||
for(unsigned int b=0;b<oldBindingCount;++b) {
|
||||
if (localIfAddrs.find(_bindings[b].address) != localIfAddrs.end()) {
|
||||
if (_bindingCount != b)
|
||||
_bindings[(unsigned int)_bindingCount] = _bindings[b];
|
||||
++_bindingCount;
|
||||
} else {
|
||||
PhySocket *const udps = _bindings[b].udpSock;
|
||||
PhySocket *const tcps = _bindings[b].tcpListenSock;
|
||||
_bindings[b].udpSock = (PhySocket *)0;
|
||||
_bindings[b].tcpListenSock = (PhySocket *)0;
|
||||
phy.close(udps,false);
|
||||
phy.close(tcps,false);
|
||||
}
|
||||
}
|
||||
|
||||
// Create new bindings for those not already bound
|
||||
for(std::map<InetAddress,std::string>::const_iterator ii(localIfAddrs.begin());ii!=localIfAddrs.end();++ii) {
|
||||
unsigned int bi = 0;
|
||||
while (bi != _bindingCount) {
|
||||
if (_bindings[bi].address == ii->first)
|
||||
break;
|
||||
++bi;
|
||||
}
|
||||
if (bi == _bindingCount) {
|
||||
udps = phy.udpBind(reinterpret_cast<const struct sockaddr *>(&(ii->first)),(void *)0,ZT_UDP_DESIRED_BUF_SIZE);
|
||||
tcps = phy.tcpListen(reinterpret_cast<const struct sockaddr *>(&(ii->first)),(void *)0);
|
||||
if ((udps)&&(tcps)) {
|
||||
#ifdef __LINUX__
|
||||
// Bind Linux sockets to their device so routes that we manage do not override physical routes (wish all platforms had this!)
|
||||
if (ii->second.length() > 0) {
|
||||
char tmp[256];
|
||||
Utils::scopy(tmp,sizeof(tmp),ii->second.c_str());
|
||||
int fd = (int)Phy<PHY_HANDLER_TYPE>::getDescriptor(udps);
|
||||
if (fd >= 0)
|
||||
setsockopt(fd,SOL_SOCKET,SO_BINDTODEVICE,tmp,strlen(tmp));
|
||||
fd = (int)Phy<PHY_HANDLER_TYPE>::getDescriptor(tcps);
|
||||
if (fd >= 0)
|
||||
setsockopt(fd,SOL_SOCKET,SO_BINDTODEVICE,tmp,strlen(tmp));
|
||||
}
|
||||
#endif // __LINUX__
|
||||
if (_bindingCount < ZT_BINDER_MAX_BINDINGS) {
|
||||
_bindings[_bindingCount].udpSock = udps;
|
||||
_bindings[_bindingCount].tcpListenSock = tcps;
|
||||
_bindings[_bindingCount].address = ii->first;
|
||||
phy.setIfName(udps,(char*)ii->second.c_str(),(int)ii->second.length());
|
||||
++_bindingCount;
|
||||
}
|
||||
} else {
|
||||
phy.close(udps,false);
|
||||
phy.close(tcps,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return All currently bound local interface addresses
|
||||
*/
|
||||
inline std::vector<InetAddress> allBoundLocalInterfaceAddresses() const
|
||||
{
|
||||
std::vector<InetAddress> aa;
|
||||
Mutex::Lock _l(_lock);
|
||||
for(unsigned int b=0,c=_bindingCount;b<c;++b)
|
||||
aa.push_back(_bindings[b].address);
|
||||
return aa;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send from all bound UDP sockets
|
||||
*/
|
||||
template<typename PHY_HANDLER_TYPE>
|
||||
inline bool udpSendAll(Phy<PHY_HANDLER_TYPE> &phy,const struct sockaddr_storage *addr,const void *data,unsigned int len,unsigned int ttl)
|
||||
{
|
||||
bool r = false;
|
||||
Mutex::Lock _l(_lock);
|
||||
for(unsigned int b=0,c=_bindingCount;b<c;++b) {
|
||||
if (ttl) phy.setIp4UdpTtl(_bindings[b].udpSock,ttl);
|
||||
if (phy.udpSend(_bindings[b].udpSock,(const struct sockaddr *)addr,data,len)) r = true;
|
||||
if (ttl) phy.setIp4UdpTtl(_bindings[b].udpSock,255);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param addr Address to check
|
||||
* @return True if this is a bound local interface address
|
||||
*/
|
||||
inline bool isBoundLocalInterfaceAddress(const InetAddress &addr) const
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
for(unsigned int b=0;b<_bindingCount;++b) {
|
||||
if (_bindings[b].address == addr)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quickly check that a UDP socket is valid
|
||||
*
|
||||
* @param udpSock UDP socket to check
|
||||
* @return True if socket is currently bound/allocated
|
||||
*/
|
||||
inline bool isUdpSocketValid(PhySocket *const udpSock)
|
||||
{
|
||||
for(unsigned int b=0,c=_bindingCount;b<c;++b) {
|
||||
if (_bindings[b].udpSock == udpSock)
|
||||
return (b < _bindingCount); // double check atomic which may have changed
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
_Binding _bindings[ZT_BINDER_MAX_BINDINGS];
|
||||
std::atomic<unsigned int> _bindingCount;
|
||||
Mutex _lock;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
||||
-287
@@ -1,287 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/****/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "Http.hpp"
|
||||
#include "Phy.hpp"
|
||||
#include "OSUtils.hpp"
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
|
||||
#ifdef ZT_USE_SYSTEM_HTTP_PARSER
|
||||
#include <http_parser.h>
|
||||
#else
|
||||
#include "../ext/http-parser/http_parser.h"
|
||||
#endif
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
namespace {
|
||||
|
||||
static int ShttpOnMessageBegin(http_parser *parser);
|
||||
static int ShttpOnUrl(http_parser *parser,const char *ptr,size_t length);
|
||||
#if (HTTP_PARSER_VERSION_MAJOR >= 2) && (HTTP_PARSER_VERSION_MINOR >= 2)
|
||||
static int ShttpOnStatus(http_parser *parser,const char *ptr,size_t length);
|
||||
#else
|
||||
static int ShttpOnStatus(http_parser *parser);
|
||||
#endif
|
||||
static int ShttpOnHeaderField(http_parser *parser,const char *ptr,size_t length);
|
||||
static int ShttpOnValue(http_parser *parser,const char *ptr,size_t length);
|
||||
static int ShttpOnHeadersComplete(http_parser *parser);
|
||||
static int ShttpOnBody(http_parser *parser,const char *ptr,size_t length);
|
||||
static int ShttpOnMessageComplete(http_parser *parser);
|
||||
|
||||
#if (HTTP_PARSER_VERSION_MAJOR >= 2) && (HTTP_PARSER_VERSION_MINOR >= 1)
|
||||
static const struct http_parser_settings HTTP_PARSER_SETTINGS = {
|
||||
ShttpOnMessageBegin,
|
||||
ShttpOnUrl,
|
||||
ShttpOnStatus,
|
||||
ShttpOnHeaderField,
|
||||
ShttpOnValue,
|
||||
ShttpOnHeadersComplete,
|
||||
ShttpOnBody,
|
||||
ShttpOnMessageComplete
|
||||
};
|
||||
#else
|
||||
static const struct http_parser_settings HTTP_PARSER_SETTINGS = {
|
||||
ShttpOnMessageBegin,
|
||||
ShttpOnUrl,
|
||||
ShttpOnHeaderField,
|
||||
ShttpOnValue,
|
||||
ShttpOnHeadersComplete,
|
||||
ShttpOnBody,
|
||||
ShttpOnMessageComplete
|
||||
};
|
||||
#endif
|
||||
|
||||
struct HttpPhyHandler
|
||||
{
|
||||
// not used
|
||||
inline void phyOnDatagram(PhySocket *sock,void **uptr,const struct sockaddr *localAddr,const struct sockaddr *from,void *data,unsigned long len) {}
|
||||
inline void phyOnTcpAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN,const struct sockaddr *from) {}
|
||||
|
||||
inline void phyOnTcpConnect(PhySocket *sock,void **uptr,bool success)
|
||||
{
|
||||
if (success) {
|
||||
phy->setNotifyWritable(sock,true);
|
||||
} else {
|
||||
*responseBody = "connection failed";
|
||||
error = true;
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
inline void phyOnTcpClose(PhySocket *sock,void **uptr)
|
||||
{
|
||||
done = true;
|
||||
}
|
||||
|
||||
inline void phyOnTcpData(PhySocket *sock,void **uptr,void *data,unsigned long len)
|
||||
{
|
||||
lastActivity = OSUtils::now();
|
||||
http_parser_execute(&parser,&HTTP_PARSER_SETTINGS,(const char *)data,len);
|
||||
if ((parser.upgrade)||(parser.http_errno != HPE_OK))
|
||||
phy->close(sock);
|
||||
}
|
||||
|
||||
inline void phyOnTcpWritable(PhySocket *sock,void **uptr)
|
||||
{
|
||||
if (writePtr < (unsigned long)writeBuf.length()) {
|
||||
long n = phy->streamSend(sock,writeBuf.data() + writePtr,(unsigned long)writeBuf.length() - writePtr,true);
|
||||
if (n > 0)
|
||||
writePtr += n;
|
||||
}
|
||||
if (writePtr >= (unsigned long)writeBuf.length())
|
||||
phy->setNotifyWritable(sock,false);
|
||||
}
|
||||
|
||||
inline void phyOnFileDescriptorActivity(PhySocket *sock,void **uptr,bool readable,bool writable) {}
|
||||
#ifdef __UNIX_LIKE__
|
||||
inline void phyOnUnixAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN) {}
|
||||
inline void phyOnUnixClose(PhySocket *sock,void **uptr) {}
|
||||
inline void phyOnUnixData(PhySocket *sock,void **uptr,void *data,unsigned long len) {}
|
||||
inline void phyOnUnixWritable(PhySocket *sock,void **uptr) {}
|
||||
#endif // __UNIX_LIKE__
|
||||
|
||||
http_parser parser;
|
||||
std::string currentHeaderField;
|
||||
std::string currentHeaderValue;
|
||||
unsigned long messageSize;
|
||||
unsigned long writePtr;
|
||||
uint64_t lastActivity;
|
||||
std::string writeBuf;
|
||||
|
||||
unsigned long maxResponseSize;
|
||||
std::map<std::string,std::string> *responseHeaders;
|
||||
std::string *responseBody;
|
||||
bool error;
|
||||
bool done;
|
||||
|
||||
Phy<HttpPhyHandler *> *phy;
|
||||
PhySocket *sock;
|
||||
};
|
||||
|
||||
static int ShttpOnMessageBegin(http_parser *parser)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int ShttpOnUrl(http_parser *parser,const char *ptr,size_t length)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#if (HTTP_PARSER_VERSION_MAJOR >= 2) && (HTTP_PARSER_VERSION_MINOR >= 2)
|
||||
static int ShttpOnStatus(http_parser *parser,const char *ptr,size_t length)
|
||||
#else
|
||||
static int ShttpOnStatus(http_parser *parser)
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
|
||||
hh->messageSize += (unsigned long)length;
|
||||
if (hh->messageSize > hh->maxResponseSize)
|
||||
return -1;
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
static int ShttpOnHeaderField(http_parser *parser,const char *ptr,size_t length)
|
||||
{
|
||||
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
|
||||
hh->messageSize += (unsigned long)length;
|
||||
if (hh->messageSize > hh->maxResponseSize)
|
||||
return -1;
|
||||
if ((hh->currentHeaderField.length())&&(hh->currentHeaderValue.length())) {
|
||||
(*hh->responseHeaders)[hh->currentHeaderField] = hh->currentHeaderValue;
|
||||
hh->currentHeaderField = "";
|
||||
hh->currentHeaderValue = "";
|
||||
}
|
||||
for(size_t i=0;i<length;++i)
|
||||
hh->currentHeaderField.push_back(OSUtils::toLower(ptr[i]));
|
||||
return 0;
|
||||
}
|
||||
static int ShttpOnValue(http_parser *parser,const char *ptr,size_t length)
|
||||
{
|
||||
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
|
||||
hh->messageSize += (unsigned long)length;
|
||||
if (hh->messageSize > hh->maxResponseSize)
|
||||
return -1;
|
||||
hh->currentHeaderValue.append(ptr,length);
|
||||
return 0;
|
||||
}
|
||||
static int ShttpOnHeadersComplete(http_parser *parser)
|
||||
{
|
||||
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
|
||||
if ((hh->currentHeaderField.length())&&(hh->currentHeaderValue.length()))
|
||||
(*hh->responseHeaders)[hh->currentHeaderField] = hh->currentHeaderValue;
|
||||
return 0;
|
||||
}
|
||||
static int ShttpOnBody(http_parser *parser,const char *ptr,size_t length)
|
||||
{
|
||||
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
|
||||
hh->messageSize += (unsigned long)length;
|
||||
if (hh->messageSize > hh->maxResponseSize)
|
||||
return -1;
|
||||
hh->responseBody->append(ptr,length);
|
||||
return 0;
|
||||
}
|
||||
static int ShttpOnMessageComplete(http_parser *parser)
|
||||
{
|
||||
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
|
||||
hh->phy->close(hh->sock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
unsigned int Http::_do(
|
||||
const char *method,
|
||||
unsigned long maxResponseSize,
|
||||
unsigned long timeout,
|
||||
const struct sockaddr *remoteAddress,
|
||||
const char *path,
|
||||
const std::map<std::string,std::string> &requestHeaders,
|
||||
const void *requestBody,
|
||||
unsigned long requestBodyLength,
|
||||
std::map<std::string,std::string> &responseHeaders,
|
||||
std::string &responseBody)
|
||||
{
|
||||
try {
|
||||
responseHeaders.clear();
|
||||
responseBody = "";
|
||||
|
||||
HttpPhyHandler handler;
|
||||
|
||||
http_parser_init(&(handler.parser),HTTP_RESPONSE);
|
||||
handler.parser.data = (void *)&handler;
|
||||
handler.messageSize = 0;
|
||||
handler.writePtr = 0;
|
||||
handler.lastActivity = OSUtils::now();
|
||||
|
||||
try {
|
||||
char tmp[1024];
|
||||
OSUtils::ztsnprintf(tmp,sizeof(tmp),"%s %s HTTP/1.1\r\n",method,path);
|
||||
handler.writeBuf.append(tmp);
|
||||
for(std::map<std::string,std::string>::const_iterator h(requestHeaders.begin());h!=requestHeaders.end();++h) {
|
||||
OSUtils::ztsnprintf(tmp,sizeof(tmp),"%s: %s\r\n",h->first.c_str(),h->second.c_str());
|
||||
handler.writeBuf.append(tmp);
|
||||
}
|
||||
handler.writeBuf.append("\r\n");
|
||||
if ((requestBody)&&(requestBodyLength))
|
||||
handler.writeBuf.append((const char *)requestBody,requestBodyLength);
|
||||
} catch ( ... ) {
|
||||
responseBody = "request too large";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (maxResponseSize) {
|
||||
handler.maxResponseSize = maxResponseSize;
|
||||
} else {
|
||||
handler.maxResponseSize = 2147483647;
|
||||
}
|
||||
handler.responseHeaders = &responseHeaders;
|
||||
handler.responseBody = &responseBody;
|
||||
handler.error = false;
|
||||
handler.done = false;
|
||||
|
||||
Phy<HttpPhyHandler *> phy(&handler,true,true);
|
||||
|
||||
bool instantConnect = false;
|
||||
handler.phy = &phy;
|
||||
handler.sock = phy.tcpConnect((const struct sockaddr *)remoteAddress,instantConnect,(void *)0,true);
|
||||
if (!handler.sock) {
|
||||
responseBody = "connection failed (2)";
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (!handler.done) {
|
||||
phy.poll(timeout / 2);
|
||||
if ((timeout)&&((unsigned long)(OSUtils::now() - handler.lastActivity) > timeout)) {
|
||||
phy.close(handler.sock);
|
||||
responseBody = "timed out";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ((handler.error) ? 0 : ((handler.parser.http_errno != HPE_OK) ? 0 : handler.parser.status_code));
|
||||
} catch (std::exception &exc) {
|
||||
responseBody = exc.what();
|
||||
return 0;
|
||||
} catch ( ... ) {
|
||||
responseBody = "unknown exception";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
||||
Loaded 20 of 864 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user