Compare commits

...
245 Commits
Author SHA1 Message Date
Adam Ierymenko 6f8364ba59 VERSION 0.9.2:
The primary focus of this version is better integration with the
Microsoft Windows operating system.

Virtual networks should now be detected as "real" networks. For
each network, a message box should pop up the first time the network
is detected and classified allowing the user to choose its services
and security designation. On Windows 7 this is "work," "home," or
"public." On Windows 8 it's a simple choice of whether or not to
enable file and printer sharing and other services.

Several bugs have been fixed. Among these are a Windows threading
issue, several minor threading deadlock issues that could manifest
if rapidly adding and removing networks, and a command line interface
issue. The network list now shows the network MAC address as well,
a UI oversight in previous versions. A vectorized SSE implementation
of Salsa20 is now included for improved encrypt/decrypt performance.

The sending of low-TTL "firewall opener" packets has been disabled
in this version, since they may not be necessary and may harm NAT
traversal in some configurations. We will measure the effectiveness
of NAT traversal and see if this change improves performance in the
field.

Finally, this version obsoletes both the Tokyo and Sydney supernodes
in favor of a single larger supernode in Singapore. This decision was
made on the basis of bandwidth costs-- both Tokyo and Sydney are
significantly more expensive. We'd like to keep the basic service free,
so keeping bandwidth costs for relaying low is important. Since NAT
traversal works well and is constantly being improved, most users will
not see a speed decrease from this. Some Chinese users may see
improved performance since Singapore may be closer than Tokyo to many
Chinese cities.

The next major releases will focus on better Macintosh platform integration,
further improvements to NAT traversal, and UI improvements.
2014-08-22 12:05:56 -07:00
Adam Ierymenko eadff71d37 Another fix to Network life cycle. 2014-08-21 18:07:27 -07:00
Adam Ierymenko af62a6cade Forgot to uncomment secret debug #define of death. 2014-08-21 17:49:46 -07:00
Adam Ierymenko de4e29288d Fix for crazy Windows threading bug... repeatedly adding and removing a network now doesn't leave networks in limbo. 2014-08-21 17:49:05 -07:00
Adam Ierymenko 44d58ee871 Change 1.1.1.1 pseudo-IP used for default route hack to 25.255.255.254, since 1.1.1.1 is from a now-in-use IPv4 block while 25.0.0.0/8 is still unrouted. It can be changed in the future without impacting anything, since Windows keys off the MAC not the IP to classify networks. 2014-08-21 08:26:39 -07:00
Adam Ierymenko 9d5819ff44 Version bump to 0.9.2 -- preparing for release... 2014-08-20 18:29:27 -07:00
Adam Ierymenko 08d7fe0432 Fix for GitHub issue #102 2014-08-20 12:36:11 -07:00
Adam Ierymenko 9f2571cc01 Some UI fixes for Windows. 2014-08-20 10:22:30 -07:00
Adam Ierymenko b4b2e2ed9f ... 2014-08-19 18:21:21 -07:00
Adam Ierymenko 17ebd0afc7 Disable service management in UI -- installer should automatically start service and this is annoying for testing purposes. 2014-08-19 18:14:50 -07:00
Adam Ierymenko 351b7f3a09 UI stuff and sign .dmg on build. 2014-08-19 17:42:17 -07:00
Adam Ierymenko 721625d512 Add MAC to listnetworks, and some other make stuff. 2014-08-19 14:11:02 -07:00
Adam Ierymenko 282114e96c Makefile changes, and make Topology::getBestSupernode() return the "next" supernode if I am a supernode. Also some comment cleanup. 2014-08-19 10:09:21 -07:00
Adam Ierymenko 95d123cfc2 Do HttpClient refactoring for Windows. 2014-08-18 14:34:04 -07:00
Adam Ierymenko f5cbb45ab9 Increase sleep/wake detection threshold... might want to switch to using native interfaces to really detect this in the future since this is not 100% reliable. 2014-08-18 10:13:25 -04:00
Adam Ierymenko b7b9b9c0b7 Add "make debug" to make building debug one-offs easier (Linux). 2014-08-18 10:07:03 -04:00
Adam Ierymenko 715afc0314 Default to built-in root topology if signature check fails (instead of exiting) 2014-08-16 14:01:25 -07:00
Adam Ierymenko f281886bfd Small thread safety fix in HttpClient. 2014-08-16 13:32:33 -07:00
Adam Ierymenko 4f0fcc582e Refactor HttpClient a bit. 2014-08-16 09:08:52 -07:00
Adam Ierymenko aa59cfd545 Web request part of supernode resync (not quite done, needs test) 2014-08-15 23:37:35 -04:00
Adam Ierymenko f696299cfc docs 2014-08-15 12:59:49 -04:00
Adam Ierymenko b0719eacf9 Add encrypt/decrypt to attic. 2014-08-15 12:59:07 -04:00
Adam Ierymenko c2187c8759 (1) distribute default root-topology in new dictionary format, (2) bump peer serialization version to force obsolescence of old supernodes, (3) stop outputting a log message every time we poll for software updates 2014-08-14 19:52:22 -04:00
Adam Ierymenko 56296f96db Regenerate root topology dictionary with field fix. 2014-08-14 18:54:53 -04:00
Adam Ierymenko be6b61b1bc Accept supernode dictionaries in Topology, also fix (unused) field name in one of these. 2014-08-14 18:06:18 -04:00
Adam Ierymenko f8d4611d15 (1) Tweak LAN locator beacon frequencies, (2) Windows virtual networks
now show up as *real* networks and prompt the user to set their
location and firewall status (public, private, home/work, etc.).

The hack used to achieve #2 should not be examined by children or those
suffering from epilepsy or heart conditions.
2014-08-12 17:20:34 -07:00
Adam Ierymenko f25bd41a03 Some fixes to firewall config code. 2014-08-08 15:53:27 -07:00
Adam Ierymenko fe3ad5e2cc Fix a Windows bug in refactored tap code, and always make sure we have a firewall exception rule on startup. 2014-08-08 14:57:13 -07:00
Adam Ierymenko 502ea66f15 Kill ugly old getSecureRandom() and replace with simple wrapper for Windows CAPI and *nix /dev/urandom, and some build fixes. 2014-08-08 11:53:55 -07:00
Adam Ierymenko 673aab5ba2 Fix an oversight in signed dictionaries: the timestamp and signing identity should themselves be part of the signature. Also include the raw dictionary in addition to the bin2c version in root-topology/ 2014-08-08 12:46:00 -04:00
Adam Ierymenko 77457cbff1 Windows compile fixes, compiler warning fix, unfreed memory fix in main.c (though it would not have mattered since program exits immediately after). 2014-08-07 19:08:41 -07:00
Adam Ierymenko db0d17cebb Change topology URL to something prettier. 2014-08-07 20:27:05 -04:00
Adam Ierymenko dd58006d65 Rename topology/ to be more descriptive, and some more updates. 2014-08-07 20:21:07 -04:00
Adam Ierymenko f0ebb0b0f1 More root topology stuff. 2014-08-07 20:14:24 -04:00
Adam Ierymenko 8c9d3146df make clean fix 2014-08-07 18:46:04 -04:00
Adam Ierymenko 117f977ce3 mktopology for making new signed topology root server dictionaries 2014-08-07 18:45:11 -04:00
Adam Ierymenko d8e5d9d6e8 Singapore supernode -- its baaaack 2014-08-07 21:19:34 +00:00
Adam Ierymenko 1f5feb75fb LinuxEthernetTap refactor. 2014-08-07 20:40:23 +00:00
Adam Ierymenko 05031ff938 Linux build stuff. 2014-08-07 13:05:17 -04:00
Adam Ierymenko adfb71fa6b Compile for for TRACE, remove old TESTNET cruft. 2014-08-07 08:49:43 -07:00
Adam Ierymenko 37341048a9 Silence kextload/kextunload output, error handling improvements. 2014-08-07 08:41:57 -07:00
Adam Ierymenko b3491f9de1 ifdef out Unix-only output redirect function on Windows 2014-08-07 06:36:46 -07:00
Adam Ierymenko 80fc584923 Fix for GitHub issue #97 2014-08-07 06:35:54 -07:00
Adam Ierymenko b7389995f4 Make install scripts also symlink zerotier-idtool script, and doc updates. 2014-08-07 06:25:01 -07:00
Adam Ierymenko 92d9ad4a7f Some tap interface changes and integration into main.cpp for *nix systems. 2014-08-06 16:24:30 -07:00
Adam Ierymenko 8a804b5257 (1) Disable firewall openers (its easy to re-enable), (2) Do some prep work for making supernode topology hot-updatable. 2014-08-05 14:05:50 -07:00
Adam Ierymenko e3c5ada3a7 Add signatures to Dictionary, and fix unhex() API in Utils to be a little safer. 2014-08-05 09:56:49 -07:00
Adam Ierymenko 7adf0eac7e Windows Ethernet tap refactoring complete. 2014-08-04 21:48:59 -07:00
Adam Ierymenko df0a8e8450 Linux routing table now works. 2014-07-31 20:13:29 -04:00
Adam Ierymenko 526435859f Newly broken out OSX tap driver builds now. 2014-07-31 15:13:48 -07:00
Adam Ierymenko 98d426e1d5 Path fixes in osnet/ stuff 2014-07-31 14:31:32 -07:00
Adam Ierymenko b80c229d87 Tons of code cleanup, refactor Network to use EthernetTapFactory, probably also fix GitHub issue #90 2014-07-31 14:09:32 -07:00
Adam Ierymenko 9b93141dd0 Upgrade LZ4 to latest version. 2014-07-30 15:34:15 -07:00
Adam Ierymenko 59ebc9d41e docs 2014-07-28 09:10:56 -07:00
Adam Ierymenko f0199d6770 Windows routing table interface (untested). 2014-07-28 09:08:56 -07:00
Adam Ierymenko f2d372545a Salsa20 SSE Windows build fix -- turns out you can't be as loose with SSE intrinsics in Visual Studio 2014-07-26 20:07:38 -07:00
Adam Ierymenko 9809511c4c Another rename... 2014-07-26 13:11:45 -07:00
Adam Ierymenko 538e8a86c8 Move node/osdep/ to sys/ 2014-07-26 13:10:41 -07:00
Adam Ierymenko 27aa6ea44e Linux routing table support work. 2014-07-25 16:16:05 -04:00
Adam Ierymenko 7475c4047e A bunch more osdep/ work... 2014-07-23 09:14:53 -07:00
Adam Ierymenko 5e58a7d54a Split UnixEthernetTap by platform to get rid of ifdef spaghetti. 2014-07-21 09:18:33 -07:00
Adam Ierymenko 6a174483d8 Ethernet tap factory interface. 2014-07-18 17:26:08 -07:00
Adam Ierymenko a76d9d4408 Move OS-dependent implementations of generic interfaces to osdep/ in preparation for TapFactory refactor. 2014-07-17 17:19:18 -07:00
Adam Ierymenko 1189f4a568 Set/delete functionality in BSD routing table. 2014-07-17 17:17:59 -07:00
Adam Ierymenko 51766e6549 BSD routing table works... that hurt much worse than it should have. 2014-07-17 13:08:37 -07:00
Adam Ierymenko d315156733 BSD routing table implementation work. 2014-07-16 15:13:53 -07:00
Adam Ierymenko 4c4675e3ac Cleanup, add __BSD__ 2014-07-15 20:49:13 -07:00
Adam Ierymenko 49ef980ecf Scale back Salsa20 benchmark a bit to not take too long on slow boxes. 2014-07-15 21:02:56 -04:00
Adam Ierymenko 12692c551e SSE optimized Salsa20 -- anywhere from 20% to 50% faster than plain C version 2014-07-15 17:56:09 -07:00
Adam Ierymenko 00f9305ad8 Routing table base class. 2014-07-15 13:48:42 -07:00
Adam Ierymenko 0097949ba9 . 2014-07-15 12:32:06 -07:00
Adam Ierymenko 1b33a9e807 . 2014-07-15 12:21:24 -07:00
Adam Ierymenko 4a0b33561c Starting to define system network stack interface. 2014-07-13 12:57:30 -07:00
Adam Ierymenko 96faaa85cf VERSION 0.9.1: bug fixes and experimental bridging support
This version fixes several bugs including an issue with networks that have
EtherType filtering disabled, a file permission issue that affected non-English
versions of Windows, a multicast propagation bug that caused multicasts to
be dropped more often than they should be, and an issue with IP auto-configuration.

It also introduces experimental support for bridging between physical and virtual
networks, a much-requested and powerful ability that's been planned from the start.
ZeroTier One can now replace the functionality of ordinary VPNs, link multiple
offices into a single LAN, and connect virtual machine backplanes in the cloud to
physical networks at home, among other things.

Bridging support isn't "officially" out yet, since the web UI part is still
in development. But when that is done, an official announcement will be
made on the blog and users can try it out. So far bridging has only
been tested under Linux with the Linux kernel's native bridging driver.
YMMV on other platforms. Try it out and let us know by filing bugs at GitHub
or e-mailing them to "contact@zerotier.com".
2014-07-03 13:32:53 -07:00
Adam Ierymenko f82c7006ea Leave IP addresses alone instead of deleting them from tap if they are not members of any of the networks under management. 2014-07-02 15:59:08 -07:00
Adam Ierymenko 681af253ef Fix for GitHub issue #88 - actually do in the code what the web UI expects it to do. 2014-07-01 09:27:33 -07:00
Adam Ierymenko 88bdb81791 Keep track of basic aliveness for peers regardless if direct or indirect connectivity and use this for multicast propagation. Also consolidate adding of active bridges via the same functor as regular multicast next hops. 2014-06-30 11:31:04 -07:00
Adam Ierymenko 458f6ae7c3 Only add active bridges to top of MC propagation list if they are alive. Otherwise a dead active bridge might kill multicast for us. 2014-06-26 18:13:48 -07:00
Adam Ierymenko 999e963533 Fix for network not found in netconf. 2014-06-27 00:47:07 +00:00
Adam Ierymenko 5336f2600a Send ACCESS_DENIED if network not found. 2014-06-26 17:38:33 -07:00
Adam Ierymenko 38433e85bf More little stuff in crypto code. 2014-06-26 17:23:10 -07:00
Adam Ierymenko c3cbc92757 Some crypto comment fixes. 2014-06-26 17:15:20 -07:00
Adam Ierymenko 45a1e048bb Add enabled/disabled status to network. 2014-06-26 17:05:07 -07:00
Adam Ierymenko 40bd460b1c Some comment revisions and additional sanity checks. 2014-06-23 08:19:41 -07:00
Adam Ierymenko ae7143d693 Comments and cleanup. 2014-06-21 12:19:10 -07:00
Adam Ierymenko aead1050fb Bridging (GitHub issue #68) does indeed work! Just needed to fix a packet size thinko. 2014-06-21 12:29:33 -04:00
Adam Ierymenko 6e485833ef . 2014-06-21 12:25:10 -04:00
Adam Ierymenko be0a8ec1f1 . 2014-06-21 12:16:25 -04:00
Adam Ierymenko 11e1f7a3fb . 2014-06-21 12:01:26 -04:00
Adam Ierymenko 0b0d5fabac Bridging #68 should work now! 2014-06-21 11:59:08 -04:00
Adam Ierymenko 35aa0921ee . 2014-06-21 11:47:26 -04:00
Adam Ierymenko 2f8936181c Debug code -- temporary. 2014-06-21 08:36:23 -07:00
Adam Ierymenko 4c3fb8cf10 Don't list node as an active bridge if it's not authorized. (Wouldn't work anyway.) 2014-06-20 16:04:53 -07:00
Adam Ierymenko c3cea55493 Some cleanup in PacketDecoder. 2014-06-18 09:00:53 -07:00
Adam Ierymenko 5d467f0f45 Some TRACE improvements and comment revs. 2014-06-18 08:25:30 -07:00
Adam Ierymenko 2162a419e3 Some logging fixes. 2014-06-17 13:52:55 -07:00
Adam Ierymenko f15271f31f Get rid of pointer type punning warning/issue on g++. 2014-06-17 15:54:35 -04:00
Adam Ierymenko 9d6488c31a Typo fix. 2014-06-16 20:41:23 +00:00
Adam Ierymenko adc922d7fb Support for bridging fields in netconf. 2014-06-16 13:26:46 -07:00
Adam Ierymenko cf4700bc26 Simplify network briding modes -- we only need passive toggle and active bridge list, not three mode types. Also change isOpen to isPublic for terminology consistency. 2014-06-14 20:24:19 +00:00
Adam Ierymenko 367b5439e1 Run icacls.exe twice, once for each change - GitHub issue #71 2014-06-14 12:52:06 -07:00
Adam Ierymenko 6802da457e Bridging pretty much ready to test! Got Switch all wired up. Also fix a latent probably-never-triggered bug in MULTICAST_FRAME handling. GitHub issue #68 2014-06-13 21:06:34 -07:00
Adam Ierymenko 5682f0b772 Some more bridging work... wiring up in Switch - GitHub issue #68 2014-06-13 17:49:33 -07:00
Adam Ierymenko 08b7bb3c7a Network memory for bridge-side multicast groups that we learn - GitHub issue #68 2014-06-13 14:06:34 -07:00
Adam Ierymenko d6a4f8d77b Add flags to EXT_FRAME for better future proofness. 2014-06-12 11:40:30 -07:00
Adam Ierymenko c30f9832b0 Packet decoder work for EXT_FRAME for bridging - GitHub issue #68 2014-06-10 21:41:34 -07:00
Adam Ierymenko d44e1349d8 Bridge routing table - GitHub issue #68 2014-06-10 17:18:59 -07:00
Adam Ierymenko 6f831d5370 Bridging fields in Redis schema for netconf master. 2014-06-10 15:51:54 -07:00
Adam Ierymenko 4e1f49258b Bridging in NetworkConfig - GitHub Issue #68 2014-06-10 15:47:20 -07:00
Adam Ierymenko fb31f93c52 Protocol messages for bridging. GitHub issue #68 2014-06-10 15:25:15 -07:00
Adam Ierymenko f720f04fa0 Installer updates from 0.9.0 release -- only useful to me. 2014-05-29 20:23:25 -07:00
Adam Ierymenko 7a56c3c396 VERSION 0.9.0: upgrade required!
Version 0.9.0 adds a network-wide toggle for blanket broadcast (ff:ff:ff:ff:ff:ff), contains changes for compatibility with the new web site and netconf server code, and most importantly introduces unique non-conflicting MAC address schemes on a per-virtual-network basis.

The MAC address change is necessary to support bridging, which is the next major feature to be added. It's not absolutely required, but it makes sure that things work properly in the (probably very rare) case that two virtual networks happen to be directly or indirectly bridged together.

The MAC change means that 0.9.0 is a required update. Clients not updating will find themselves unable to communicate with older versions. The underlying protocol is the same, but MAC address resolution and routing will not work properly. Those running binary releases will be updated automatically, while those running from source must download and rebuild.

This version also fixes two minor security issues, including one involving file permissions on non-English Windows versions.
2014-05-29 17:53:30 -07:00
Adam Ierymenko 994565bdeb Fix for GitHub issue #71 2014-05-29 15:06:05 -07:00
Adam Ierymenko 67498e576c Delete some obsolete stuff. 2014-05-29 18:36:17 +00:00
Adam Ierymenko eae130467b Build fix for Windows setsockopt(). 2014-05-29 11:22:35 -07:00
Adam Ierymenko f764cf8d31 Make UDP send and receive buffers as big as possible to reduce packet loss. 2014-05-28 12:17:43 -07:00
Adam Ierymenko 49247180dc Add lastSeen and identity to member record if not present. 2014-05-28 01:32:27 +00:00
Adam Ierymenko 914bebba31 Re-enable exit on stream close in netconf service. 2014-05-27 15:59:09 +00:00
Adam Ierymenko 4b773b61f5 Netconf fixes. 2014-05-24 00:10:23 +00:00
Adam Ierymenko 657f6ae342 Don't transmit broadcasts if enableBroadcast is false on a network. 2014-05-23 19:52:39 -04:00
Adam Ierymenko 2861229558 Windows build fixes for MAC changes (in tap driver), some comments and cleanup in MAC.hpp. 2014-05-23 16:21:57 -07:00
Adam Ierymenko f939d0ee62 Upgrade AIP for new version of Advanced Installer, bump to 0.9.0. 2014-05-23 16:08:05 -07:00
Adam Ierymenko 77c58e741d GitHub issue #58 - options after path on command line were ignored, fixed. 2014-05-23 15:21:28 -07:00
Adam Ierymenko 66a38a9e7c Default for private should be true. 2014-05-23 15:15:44 -07:00
Adam Ierymenko 31ddc49da2 GitHub issue #67 2014-05-23 15:13:34 -07:00
Adam Ierymenko 317995b921 Fixed for Linux tap for GitHub Issue #69 2014-05-23 17:35:35 -04:00
Adam Ierymenko beb7b5bbe5 GitHub Issue #69 - make MAC assignment schema differ between virtual networks. 2014-05-23 14:32:31 -07:00
Adam Ierymenko 05f5755bb1 Allow Redis DB# select. 2014-05-23 00:35:11 +00:00
Adam Ierymenko cfd92cb18d Remove old netconf code. 2014-05-22 21:05:49 +00:00
Adam Ierymenko 2456d3a197 Node redis module update. 2014-05-22 21:05:08 +00:00
Adam Ierymenko f0b821f880 . 2014-05-21 02:48:58 +00:00
Adam Ierymenko 319f9a9346 Netconf testing and fixes. 2014-05-20 20:05:11 +00:00
Adam Ierymenko 596e5dd583 Another sanity check on filename for GitHub issue #72 2014-05-19 16:16:34 +00:00
Adam Ierymenko b958a2d30c Redis schema updates and fix for GitHub issue #72 2014-05-19 16:13:42 +00:00
Adam Ierymenko e270887391 Some Redis schema changes. 2014-05-14 17:48:50 +00:00
Adam Ierymenko 986773cc9c ZT_USE_TESTNET define in makefiles. 2014-05-09 11:52:53 -07:00
Adam Ierymenko ecbcc9eb2c TESTNET supernodes need different addresses. 2014-05-09 11:45:38 -07:00
Adam Ierymenko 1ad29fe31f Merge branch 'adamierymenko-dev' of ssh://shub-niggurath.zerotier.com:222/git/ZeroTierOne into adamierymenko-dev 2014-05-09 15:40:08 +00:00
Adam Ierymenko 42f6aae259 More netconf work... set ZT_HOME and chdir there on service launch. 2014-05-09 15:39:51 +00:00
Adam Ierymenko de485ad900 Add testnet ports and ZT_USE_TESTNET define for contacting the test.zerotier.com net instead of the live net. 2014-05-08 17:53:22 -07:00
Adam Ierymenko 99c5fae9da Make Service communicate via empty-line-delimited Dictionary objects instead of the old size prefix way. 2014-05-08 21:27:59 +00:00
Adam Ierymenko 98f0418fb9 A little more cleanup in node code. 2014-05-08 00:47:46 +00:00
Adam Ierymenko d7977fa3e1 Make certificate of membership works in node code! 2014-05-08 00:22:20 +00:00
Adam Ierymenko 1e6475fad6 Clean out unused netconf fields, rename a few, work on new netconf server. 2014-05-08 00:11:50 +00:00
Adam Ierymenko d5f95b721d Yet more work on netconf master, add redis docs. 2014-05-07 02:45:15 +00:00
Adam Ierymenko ae2eeff5c6 . 2014-05-06 00:24:21 +00:00
Adam Ierymenko 08da4b8c7b Add mkcom functionality to zerotier-idtool for use by new NodeJS netconf-master code. 2014-05-06 00:15:21 +00:00
Adam Ierymenko 0ba0c6d04d New netconf... 2014-05-06 00:05:11 +00:00
Adam Ierymenko 93f24ea86a Some work on new netconf service... 2014-05-05 22:11:21 +00:00
Adam Ierymenko f8eae84e15 Retire old netconf mess. 2014-05-05 15:05:11 +00:00
Adam Ierymenko 7831c4bfef Cleanup, dead code removal, some pretty insignificant security stuff that's based on recommendations. 2014-04-18 00:14:12 -07:00
Adam Ierymenko 5f45977e3e Update GitHub README 2014-04-16 11:40:48 -07:00
Adam Ierymenko d187ec82d4 Adding supernode yig.zerotier.com (Sydney, Australia) and removing mi-go.zerotier.com (Singapore) due to real-world usage data. 2014-04-15 14:37:19 -07:00
Adam Ierymenko 42c3474223 VERSION 0.8.2
This version fixes a few more issues with TCP tunneling including GitHub issue #63.
It also adds automatic announcement and location of peers on physical LANs (GitHub
issue #56) which should greatly improve performance if you happen to be on the same
LAN or WiFi network as another peer. It can take 60 seconds or so for this to occur,
but it should.
2014-04-10 22:46:17 -07:00
Adam Ierymenko aee742e767 More toward GitHub issue #56 2014-04-10 16:30:15 -07:00
Adam Ierymenko c9294c1a78 Prevent recursive transit of ZeroTier packets, toward GitHub issue #56 2014-04-10 14:22:25 -07:00
Adam Ierymenko b117ff5435 Probable fix for GitHub issue #63 - do not unite() if either path is TCP, since doing so can result in asymmetric failed NAT-t over UDP if one side has a firewall that permits outgoing UDP but not incoming. 2014-04-10 11:17:54 -07:00
Adam Ierymenko 119ef5ecbf More logic cleanup and some documentation / comment improvements. 2014-04-10 10:00:20 -07:00
Adam Ierymenko 8fb442d81a Yet more cleanup to TCP logic, this time adding a master switch and adding UDP preference in send(). 2014-04-09 17:08:35 -07:00
Adam Ierymenko 73153b89b4 Some cleanup, and use best (not first) UDP addresses for NAT-t VERB_RENDEZVOUS computation. 2014-04-09 16:00:25 -07:00
Adam Ierymenko d9836adbf6 .... aaaaaand... GitHub issue #61 was caused by the fact that we were no longer deleting taps on Windows! 2014-04-09 15:34:03 -07:00
Adam Ierymenko 420edf23ad Was not closing _shutdownSignalPipe in UnixEthernetTap either... 2014-04-09 15:32:37 -07:00
Adam Ierymenko 6c5f6feb5e Set close-on-exec in attempt to head off GitHub issue #61 2014-04-09 15:22:08 -07:00
Adam Ierymenko a1c1c82b0d VERSION 0.8.1
This, quick on the heels of 0.8.0, fixes the fact that TCP tunneling was
broken. :)

There was a bug that only manifested in some cases, and not on my testnet.
I took the opportunity to clean up some of that logic generally. I need a
better testnet, but that will have to wait until we exit beta and hopefully
I can earn a little bit of money off this. A better testnet will require
a big beefy virtualization box or two to run hundreds to thousands of KVMs.

Also fixed a tiny cosmetic issue on Windows. Other than that no changes.
2014-04-09 13:03:33 -07:00
Adam Ierymenko 83a0d988ec Text point size readjustment not needed on child windows in Windows? 2014-04-09 12:19:46 -07:00
Adam Ierymenko a8c12369fd More tweaks to TCP logic for GitHub issue #60 2014-04-09 12:10:05 -07:00
Adam Ierymenko 28a6d328a5 Some adjustments to TCP logic for GitHub issue #60 2014-04-09 11:55:24 -07:00
Adam Ierymenko dd404b8ba3 VERSION 0.8.0
This version introduces a major new feature requested by several users,
both via the user survey and otherwise: TCP tunneling.

If you are not able to communicate over UDP/9993, ZeroTier One will switch to
TCP connections to ZeroTier's supernodes. This is always slower than UDP, but
will allow you to communicate behind all but the most extremely restrictive
firewalls. This TCP traffic travels over port 443 and looks like HTTPS (SSL)
traffic (though it isn't), since that port is almost always open.

This also fixes several minor bugs and attempts to improve the robustness of
Windows tap driver management. Several users have reported spurious issues
with the Windows tap device, though I was unable to reproduce any of these with
clean VMs. (Tried Windows 7 and 8.1, both x86 and x64. No luck.) But I tried
to beef up the tap code anyway in the hopes of catching it. It now tries a lot
harder to make sure the tap is up and running.

There was some significant under the hood refactoring in support of TCP, so
this was a non-trivial change.

I bumped the version to 0.8 to indicate that more and more features are being
crossed off the list as we approach 1.0 and exit from beta. After this, the next
major feature will be LAN announcement to find direct paths to peers on the
same physical LAN. But assuming that 0.8.0 goes smoothly, I am going to divert
attention to the web site. A new design is coming that is much cleaner, sharper,
and easier to use.

Thank you all for all your excellent feedback! We're well on the way to a killer
product that makes conventional VPNs and other kludges obsolete.
2014-04-08 22:38:51 -07:00
Adam Ierymenko 1c636afe3f Fix typo. 2014-04-08 16:43:36 -07:00
Adam Ierymenko 48a1799f49 More Windows tap cleanup... seems solid. We'll see. 2014-04-08 16:10:48 -07:00
Adam Ierymenko bf24de43fe Windows tap: be REAL REAL REAL PARANOID. Wake up sheeple. 2014-04-08 15:47:33 -07:00
Adam Ierymenko 76d9ea911d Another Qt build fix... need the right tap driver in build just to make symbols work even though UI doesn't use that code. 2014-04-08 14:16:45 -07:00
Adam Ierymenko ff773def26 Remove EthernetTap.cpp from UI build project. 2014-04-08 13:59:31 -07:00
Adam Ierymenko 5abfb11813 Some installer stuff, complete refactoring of Windows side of newly split tap driver. Seems to work. Now to see if the cleanup we did here gets rid of the zombie tap device issue on Windows. 2014-04-08 12:00:21 -07:00
Adam Ierymenko 0b8d6c7f4a Builds and runs on Unix with EthernetTap changes, now for Windows... and for what we did this for: a refactor of the Windows tap connector. 2014-04-07 15:39:33 -07:00
Adam Ierymenko 6c60305a96 Split EthernetTap into subclasses, work in progress... 2014-04-07 14:47:39 -07:00
Adam Ierymenko 19c4d82512 Intaller upgrade and stuff, fix to Windows service for new Node API changes. 2014-04-04 16:59:02 -07:00
Adam Ierymenko e11149bcae Fix network widget spacer issue on Windows. 2014-04-04 12:25:48 -07:00
Adam Ierymenko fe85426df6 A few more tweaks to TCP failover... seems to be switching back and forth pretty well now! 2014-04-03 17:12:34 -07:00
Adam Ierymenko 158002d2d1 Tweak some timings and stuff. 2014-04-03 16:19:41 -07:00
Adam Ierymenko c96d3ebf8c Such ping logic. So edge case. 2014-04-03 14:36:52 -07:00
Adam Ierymenko b1088a6bd7 Make Unix domain sockets mode 0777 so that properly authorized non-privileged users can access them (if they have auth token). 2014-04-02 17:21:26 -07:00
Adam Ierymenko f0223490be Make GUI work with new control client API, make control client look for user authtoken.secret if system unreadable. 2014-04-02 17:12:04 -07:00
Adam Ierymenko 81e5690410 More tweaks to TCP failover logic. Such edge case. 2014-04-02 17:32:47 -04:00
Adam Ierymenko 700a450806 More tweaks to algorithm for determining when to fail over to TCP, and stop supernodes from resynchronizing unless explicitly ordered. 2014-04-01 18:39:10 -07:00
Adam Ierymenko 0e1fc06a6f The remove paths on send fail thing in Peer.cpp was not well thought out, and there is no point in mallocing the TCP write buffer. 2014-04-01 15:55:05 -07:00
Adam Ierymenko c3b41c289d Resynchronize on startup. 2014-04-01 14:12:54 -07:00
Adam Ierymenko 6ab95e0391 Get : out of Path.toString() since this will conflict with : in IPv6 IPs. 2014-04-01 08:52:52 -07:00
Adam Ierymenko 67b3fa9311 Clean up main.o in Linux make clean. 2014-03-31 22:38:46 -07:00
Adam Ierymenko 316e8d1939 Build fix. 2014-03-31 22:30:08 -07:00
Adam Ierymenko f13493edb2 Oops... turns out we need to differentiate incoming from outgoing TCP and indeed learn incoming TCP paths. Otherwise the recipient of a TCP connection does not know to reply via TCP! Heh. 2014-03-31 22:23:55 -07:00
Adam Ierymenko 595b386afc Increase maximum packet fragments to make room for huge multicasts with certificates of membership tagged onto them. This likely will not actually increase the number of fragments in practice much, since these are then subsequently compressed. But the buffer needs to be allocated with room for them, otherwise these packets get dropped with a range_error exception internally. 2014-03-31 14:53:33 -07:00
Adam Ierymenko 8e587ae481 Clean dead paths from peers. 2014-03-31 11:41:14 -07:00
Adam Ierymenko acb056e3b1 Small readability fix. 2014-03-28 21:04:15 -07:00
Adam Ierymenko 5ef2c6fd6f Add TCP/443 to all supernodes in Defaults. 2014-03-28 15:51:19 -07:00
Adam Ierymenko 1a0572d7e7 Remove UDP-breaking debug code. 2014-03-28 13:58:18 -07:00
Adam Ierymenko 7957ab6b1d Windows uses exceptfds to report failed async connect() in select(). TCP now done on Windows (I think). 2014-03-28 13:37:21 -07:00
Adam Ierymenko e8b613e625 TCP connections work on Windows now. 2014-03-28 12:26:33 -07:00
Adam Ierymenko 9c68a343f6 Reduce some TRACE noise. 2014-03-27 18:57:20 -07:00
Adam Ierymenko 881ff08269 Make multiple attempts to open the tap device on Windows. 2014-03-27 18:50:10 -07:00
Adam Ierymenko e3239d23f4 Windows build fix. 2014-03-27 18:39:58 -07:00
Adam Ierymenko f9c92b0351 Build fix from merge. 2014-03-27 18:24:57 -07:00
Adam Ierymenko b73c36acbf Merge branch 'adamierymenko-dev' of ssh://shub-niggurath.zerotier.com:222/git/ZeroTierOne into adamierymenko-dev 2014-03-27 18:23:02 -07:00
Adam Ierymenko 181369964f Make TCP optional, rename port constant. 2014-03-27 18:22:53 -07:00
Adam Ierymenko d2c5d71502 Finally fixed TCP sockets. 2014-03-27 17:42:02 -07:00
Adam Ierymenko c231510f8b More TCP-related fixes and tweaks to ping timing, resynchronize, and startup. 2014-03-27 17:02:52 -07:00
Adam Ierymenko 2ac56fd120 Fix TCP connection accumulation problem, still having issues with TCP tunneling. 2014-03-26 17:59:45 -07:00
Adam Ierymenko e6b23059ac Change the way TCP failover is invoked. 2014-03-26 16:44:58 -07:00
Adam Ierymenko 04169b5150 If I want it to pick the first, actually picking the first is helpful. 2014-03-26 15:44:24 -07:00
Adam Ierymenko daaec84c6b Add TCP channel support for supernode list, make Peer pick the first path if all paths are equally dead. 2014-03-26 15:35:15 -07:00
Adam Ierymenko 73c1d43f2f Crank down default multicast preload and max balance just a little bit... should not impact non-lame protocols. 2014-03-25 21:48:16 -07:00
Adam Ierymenko ab5a460177 Apply multicast rate limits on a network to ourselves and do not send multicasts that would exceed limits, for GitHub issue #55 2014-03-25 21:38:54 -07:00
Adam Ierymenko 67a85221d5 WINDOWS IS SUFFERING 2014-03-25 17:31:03 -07:00
Adam Ierymenko 328be8f846 Make Windows build, add (untested) Windows named pipe based IPC code. 2014-03-25 08:37:08 -07:00
Adam Ierymenko d9b91758e0 Fix command line interface. 2014-03-21 14:58:35 -07:00
Adam Ierymenko 4e26ade2df Fix deadlock in refactored code. 2014-03-21 14:31:10 -07:00
Adam Ierymenko 8d3eb1a258 A few renamings to be consistent. 2014-03-21 14:18:35 -07:00
Adam Ierymenko 33ad3deaee Builds with new Path code. 2014-03-21 13:46:55 -07:00
Adam Ierymenko ba3f04deed Work in progress: refactoring paths, adding TCP fallback. 2014-03-20 20:07:35 -07:00
Adam Ierymenko 45e823d27c Reworking of paths in Peer work-in-progress, and TCP connect support in SocketManager. Also add FD_SETSIZE checking for the default select implementation of sockets. 2014-03-20 18:49:33 -07:00
Adam Ierymenko 70b736f440 Put mac back to release default build flags. 2014-03-20 14:44:13 -07:00
Adam Ierymenko 97e6b38144 MULTICAST_FRAME TRACE improvements. 2014-03-20 14:24:15 -07:00
Adam Ierymenko 7a45ff460d More deadlock fixes in new I/O. 2014-03-20 14:00:05 -07:00
Adam Ierymenko 6f5a4d7e29 Fix blocking socket issues in new socket I/O code. 2014-03-20 13:21:58 -07:00
Adam Ierymenko 4d0ad9abb6 Fix TRACE bug and new UDP socket code issue. 2014-03-19 23:10:34 -07:00
Adam Ierymenko 15e8c18106 Bug fixes. 2014-03-19 22:01:32 -07:00
Adam Ierymenko 1c555e4b96 command bus fix 2014-03-19 16:59:23 -07:00
Adam Ierymenko 6fdb360e2a More IPC work. 2014-03-19 16:05:03 -07:00
Adam Ierymenko 0d847d9410 More build fixes. 2014-03-19 15:29:00 -07:00
Adam Ierymenko abc82d6a52 IPC changes and SocketManager changes all build! 2014-03-19 13:56:48 -07:00
Adam Ierymenko acf7d70d24 Integrate IPC stuff into NodeConfig. 2014-03-19 08:20:09 -07:00
Adam Ierymenko 3be4c38946 IPC stuff for Unix. 2014-03-18 18:44:44 -07:00
Adam Ierymenko 6a1bd52854 New IPC work... 2014-03-18 17:19:32 -07:00
Adam Ierymenko 0b75992737 Everything but the local config bus... blech. 2014-03-18 14:33:57 -07:00
Adam Ierymenko 91fef21973 More ripping out of old condition stuff. 2014-03-18 12:21:22 -07:00
Adam Ierymenko dc0f3559be Rip out old condition and Demarc stuff... 2014-03-18 12:00:15 -07:00
Adam Ierymenko bb25128406 TCP socket. 2014-03-18 11:53:53 -07:00
Adam Ierymenko bf5d8de999 More new socket I/O work... 2014-03-17 16:29:53 -07:00
Adam Ierymenko 1a0a6755b1 UDP socket implementation. 2014-03-17 16:18:44 -07:00
Adam Ierymenko 8adbbe092d Drop old Demarc.cpp code. 2014-03-17 15:15:02 -07:00
Adam Ierymenko bd749e040d Compile fixes. 2014-03-17 15:14:22 -07:00
Adam Ierymenko 7e80d7e551 Bunch of work in progress on new socket multiplexer and plumbing for TCP jailbreaking... Don't try to build, won't yet. 2014-03-17 09:05:43 -07:00
Adam Ierymenko ce09d00679 Security improvements to Linux build flags mirroring OSX improvements. 2014-03-11 11:50:04 -07:00
Adam Ierymenko dbd7a06ea9 Enable PIE to allow ASLR (security) 2014-03-11 10:56:38 -07:00
Adam Ierymenko 74c2e644a9 Change -O4 to -O3 -flto on OSX for new clang (should work with older one too) 2014-03-11 10:18:39 -07:00
145 changed files with 13764 additions and 9207 deletions

No files matched your search

+2 -2
View File
@@ -6,8 +6,7 @@
.DS_Store
.Apple*
*.dSYM
/netconf-service/netconf-test
/netconf-service/netconf.service
/netconf-service/node_modules
/ipch
/windows/ZeroTierOne.sdf
/windows/ZeroTierOne.v11.suo
@@ -32,3 +31,4 @@
.qmake.stash
*.autosave
/ZeroTier One.dmg
/root-topology/*.secret
+11 -7
View File
@@ -1,14 +1,18 @@
ZeroTier One
ZeroTier One - Ethernet Virtualization
======
ZeroTier One creates flat virtual Ethernet networks of almost unlimited size. [Visit ZeroTier Networks on the web](https://www.zerotier.com/) for more information.
ZeroTier One is an ethernet virtualization engine. It creates virtual LANs of almost unlimited size that span physical network boundaries.
Follow the [ZeroTier blog](http://blog.zerotier.com/) and the [GitHub project](https://github.com/zerotier/ZeroTierOne) to stay up to date.
The underlying protocol is peer to peer with managed anchor points ("supernodes") for instant-on communication, assisted NAT traversal, and relaying for users who cannot make P2P connections. All unicast packets are encrypted end-to-end using private keys that only you control. Multicast and broadcast work as they would on a normal LAN, except that traffic is throttled and intelligently prioritized on large networks to stay within bandwidth limits while preserving essential functionality (multicast triage algorithm). Its behavior is not unlike some enterprise-grade intelligent ethernet switches designed for huge wired networks such as university LANs.
Auto-updating binary packages that install easily [can be found here.](https://www.zerotier.com/download.html) If you want to build from source, clone this repository and see BUILDING.txt and RUNNING.txt.
[Visit ZeroTier Networks on the web](https://www.zerotier.com/) for more information. Follow the [ZeroTier blog](https://www.zerotier.com/blog/) and the [GitHub project](https://github.com/zerotier/ZeroTierOne) to stay up to date. See the GitHub-hosted wiki (sidebar) for technical info and help for various platforms.
Once you are up and running, you can [create an account on the network control panel](https://www.zerotier.com/networks.html) if you want to create a private network or you can join [Earth](https://www.zerotier.com/earth.html) by running (on Linux and Mac) `sudo ./zerotier-cli join 8056c2e21c000001`.
Auto-updating binary packages that install easily [can be found here.](https://www.zerotier.com/download.html) Packages for popular Linux distributions that neatly wrap the Linux installer/uninstaller are coming soon. If you want to build from source, clone this repository and see BUILDING.txt and RUNNING.txt. If you build manually you'll have to update manually.
Note that this won't work if your firewall does not allow outbound UDP. It must allow two way UDP conversations on port 9993 at a minimum.
Once you are up and running, you can [create an account on the network control panel](https://www.zerotier.com/networks.html) if you want to create a private network or you can join [Earth](https://www.zerotier.com/earth.html) by running (on Linux and Mac) `sudo ./zerotier-cli join 8056c2e21c000001`. (Earth is a public virtual network, meaning that it has no access control and allows anyone to join. Make sure your system is up to date and you have no unprotected network services listening.)
ZeroTier One is licensed under the GNU General Public License version 3. You are free to use, modify, or redistribute it under the terms of that license. If you would like to embed ZeroTier One in a closed source product or create a closed source derivative product, contact ZeroTier Networks LLC.
Note: If UDP traffic over port 9993 (at a minimum) is not permitted by your local or network firewall(s), ZeroTier One will fall back to TCP tunneling to supernodes over port 443 and will not be able to make direct NAT-t connections to other peers. This fallback mode slows things down considerably. If you're getting very poor performance check your firewall settings. You can see if fallback mode is active by checking for outbound TCP connections from the zerotier-one process to port 443 on five or six hosts in the zerotier.com domain. (See Defaults.cpp for a list of these hosts.)
Most users will use IPv4 and/or IPv6 over ZeroTier One, but since it virtualizes at the ethernet (layer 2) level it can technically host almost any protocol. Users have made classic multiplayer games work over IPX, for example. Services like DHCP and IPv6 NDP for link-local addresses can work automatically.
The service is free for public networks and for managed private networks up to ten users. The 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, please e-mail [contact@zerotier.com](mailto:contact@zerotier.com) to discuss licensing.
+38 -32
View File
@@ -12,16 +12,20 @@ mac:QMAKE_INFO_PLIST = Info.plist
mac:LIBS += -framework Cocoa
SOURCES += main.cpp \
mainwindow.cpp \
aboutwindow.cpp \
mainwindow.cpp \
aboutwindow.cpp \
networkwidget.cpp \
installdialog.cpp \
licensedialog.cpp \
onetimedialog.cpp \
../node/C25519.cpp \
../node/CertificateOfMembership.cpp \
../node/Defaults.cpp \
../node/Demarc.cpp \
../node/EthernetTap.cpp \
../node/HttpClient.cpp \
../node/Identity.cpp \
../node/InetAddress.cpp \
../node/IpcConnection.cpp \
../node/IpcListener.cpp \
../node/Logger.cpp \
../node/Multicaster.cpp \
../node/Network.cpp \
@@ -32,27 +36,28 @@ SOURCES += main.cpp \
../node/PacketDecoder.cpp \
../node/Peer.cpp \
../node/Poly1305.cpp \
../node/RoutingTable.cpp \
../node/Salsa20.cpp \
../node/Service.cpp \
../node/SHA512.cpp \
../node/SocketManager.cpp \
../node/SoftwareUpdater.cpp \
../node/Switch.cpp \
../node/SysEnv.cpp \
../node/TcpSocket.cpp \
../node/Topology.cpp \
../node/UdpSocket.cpp \
../node/Utils.cpp \
../ext/lz4/lz4.c \
../ext/lz4/lz4hc.c \
networkwidget.cpp \
installdialog.cpp \
licensedialog.cpp \
onetimedialog.cpp
../node/Dictionary.cpp
HEADERS += mainwindow.h \
aboutwindow.h \
../node/Node.hpp \
../node/Utils.hpp \
../node/Defaults.hpp \
aboutwindow.h \
networkwidget.h \
installdialog.h \
mac_doprivileged.h \
licensedialog.h \
main.h \
onetimedialog.h \
../node/Address.hpp \
../node/Array.hpp \
../node/AtomicCounter.hpp \
@@ -61,14 +66,14 @@ HEADERS += mainwindow.h \
../node/C25519.hpp \
../node/CertificateOfMembership.hpp \
../node/CMWC4096.hpp \
../node/Condition.hpp \
../node/Constants.hpp \
../node/Demarc.hpp \
../node/Defaults.hpp \
../node/Dictionary.hpp \
../node/EthernetTap.hpp \
../node/HttpClient.hpp \
../node/Identity.hpp \
../node/InetAddress.hpp \
../node/IpcConnection.hpp \
../node/IpcListener.hpp \
../node/Logger.hpp \
../node/MAC.hpp \
../node/Multicaster.hpp \
@@ -76,10 +81,12 @@ HEADERS += mainwindow.h \
../node/Mutex.hpp \
../node/Network.hpp \
../node/NetworkConfig.hpp \
../node/Node.hpp \
../node/NodeConfig.hpp \
../node/NonCopyable.hpp \
../node/Packet.hpp \
../node/PacketDecoder.hpp \
../node/Path.hpp \
../node/Peer.hpp \
../node/Poly1305.hpp \
../node/RuntimeEnvironment.hpp \
@@ -87,28 +94,27 @@ HEADERS += mainwindow.h \
../node/Service.hpp \
../node/SHA512.hpp \
../node/SharedPtr.hpp \
../node/Socket.hpp \
../node/SocketManager.hpp \
../node/SoftwareUpdater.hpp \
../node/Switch.hpp \
../node/SysEnv.hpp \
../node/RoutingTable.hpp \
../node/TcpSocket.hpp \
../node/Thread.hpp \
../node/Topology.hpp \
../node/UdpSocket.hpp \
../node/Utils.hpp \
../ext/lz4/lz4.h \
../ext/lz4/lz4hc.h \
networkwidget.h \
installdialog.h \
mac_doprivileged.h \
licensedialog.h \
main.h \
onetimedialog.h
../node/EthernetTap.hpp \
../node/EthernetTapFactory.hpp
FORMS += mainwindow.ui \
aboutwindow.ui \
networkwidget.ui \
installdialog.ui \
licensedialog.ui \
quickstartdialog.ui \
onetimedialog.ui
aboutwindow.ui \
networkwidget.ui \
installdialog.ui \
licensedialog.ui \
quickstartdialog.ui \
onetimedialog.ui
RESOURCES += \
resources.qrc
@@ -117,4 +123,4 @@ mac:OBJECTIVE_SOURCES += \
mac_doprivileged.mm
OTHER_FILES += \
stylesheet.css
stylesheet.css
+13 -1
View File
@@ -39,7 +39,19 @@ AboutWindow::AboutWindow(QWidget *parent) :
ui(new Ui::AboutWindow)
{
ui->setupUi(this);
ui->aboutTextLabel->setText(QString("ZeroTier One\nVersion ")+ZeroTier::Node::versionString()+"\nQt Graphical User Interface\n\n(c)2011-2014 ZeroTier Networks LLC\n\nReleased under the terms of the GNU\nGeneral Public License v3.0, see: http://gplv3.fsf.org for terms.\n\nAuthor(s): Adam Ierymenko");
ui->aboutTextLabel->setText(QString("ZeroTier One\nVersion ")+ZeroTier::Node::versionString()+"\nDesktop Graphical User Interface\n\n(c)2011-2014 ZeroTier Networks LLC\n\nReleased under the terms of the GNU\nGeneral Public License v3.0, see: http://gplv3.fsf.org for terms.\n\nAuthor(s): Adam Ierymenko");
#ifdef __WINDOWS__
/*
QWidgetList widgets = this->findChildren<QWidget*>();
foreach(QWidget *widget, widgets) {
QFont font(widget->font());
font.setPointSizeF(font.pointSizeF() * 0.75);
widget->setFont(font);
}
*/
this->raise();
#endif
}
AboutWindow::~AboutWindow()
+1 -1
View File
@@ -43,7 +43,7 @@
#include "../node/Defaults.hpp"
// Uncomment for testing to disable making sure Windows service is running
//#define DISABLE_WINDOWS_SERVICE_MANAGEMENT
#define DISABLE_WINDOWS_SERVICE_MANAGEMENT
#ifdef __WINDOWS__
#include <WinSock2.h>
+90 -91
View File
@@ -63,32 +63,32 @@
#endif
// Globally visible
ZeroTier::Node::LocalClient *zeroTierClient = (ZeroTier::Node::LocalClient *)0;
ZeroTier::Node::NodeControlClient *zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
// Main window instance for app
QMainWindow *mainWindow = (MainWindow *)0;
// Handles message from ZeroTier One service
static void handleZTMessage(void *arg,unsigned long id,const char *line)
static void handleZTMessage(void *arg,const char *line)
{
static std::map< unsigned long,std::vector<std::string> > ztReplies;
static std::vector<std::string> ztReplies;
static QMutex ztReplies_m;
ztReplies_m.lock();
if (*line) {
ztReplies[id].push_back(std::string(line));
ztReplies_m.unlock();
} else { // empty lines conclude transmissions
std::map< unsigned long,std::vector<std::string> >::iterator r(ztReplies.find(id));
if (r != ztReplies.end()) {
if (line) {
if ((line[0] == '.')&&(line[1] == (char)0)) {
// The message is packed into an event and sent to the main window where
// the actual parsing code lives.
MainWindow::ZTMessageEvent *event = new MainWindow::ZTMessageEvent(r->second);
ztReplies.erase(r);
ztReplies_m.unlock();
MainWindow::ZTMessageEvent *event = new MainWindow::ZTMessageEvent(ztReplies);
ztReplies.clear();
QCoreApplication::postEvent(mainWindow,event); // must post since this may be another thread
} else ztReplies_m.unlock();
} else if (line[0]) {
ztReplies.push_back(std::string(line));
}
}
ztReplies_m.unlock();
}
MainWindow::MainWindow(QWidget *parent) :
@@ -136,7 +136,7 @@ MainWindow::~MainWindow()
{
delete ui;
delete zeroTierClient;
zeroTierClient = (ZeroTier::Node::LocalClient *)0;
zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
mainWindow = (MainWindow *)0;
}
@@ -147,89 +147,89 @@ void MainWindow::timerEvent(QTimerEvent *event) // event can be null since code
if (this->pollServiceTimerId < 0)
return;
// Show quick start dialog on first launch, then reset timer to normal rate
if (this->firstTimerTick) {
this->firstTimerTick = false;
this->killTimer(this->pollServiceTimerId);
if (!settings->value("shown_quickStart",false).toBool()) {
on_actionQuick_Start_triggered();
settings->setValue("shown_quickStart",true);
settings->sync();
}
this->pollServiceTimerId = this->startTimer(1500);
this->pollServiceTimerId = this->startTimer(2000);
}
if (!zeroTierClient) {
std::string authToken;
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
#ifdef __APPLE__
if (QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
// Authorize user by copying auth token into local home directory
QMessageBox::information(this,"Authorization Needed","Administrator privileges are required to allow the current user to control ZeroTier One on this computer. (You only have to do this once.)",QMessageBox::Ok,QMessageBox::NoButton);
if ((!QFile::exists(ZeroTier::Node::NodeControlClient::authTokenDefaultUserPath()))&&(QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one"))) {
// Authorize user by copying auth token into local home directory
QMessageBox::information(this,"Authorization Needed","Administrator privileges are required to allow the current user to control ZeroTier One on this computer. (You only have to do this once.)",QMessageBox::Ok,QMessageBox::NoButton);
std::string homePath(QDir::homePath().toStdString());
QString zt1Caches(QDir::homePath() + "/Library/Caches/ZeroTier/One");
QDir::root().mkpath(zt1Caches);
std::string tmpPath((zt1Caches + "/auth.sh").toStdString());
std::string homePath(QDir::homePath().toStdString());
QString zt1Caches(QDir::homePath() + "/Library/Caches/ZeroTier/One");
QDir::root().mkpath(zt1Caches);
std::string tmpPath((zt1Caches + "/auth.sh").toStdString());
FILE *scr = fopen(tmpPath.c_str(),"w");
if (!scr) {
QMessageBox::critical(this,"Cannot Authorize","Unable to authorize this user to administrate ZeroTier One. (Cannot write to temporary Library/Caches/ZeroTier/One folder.)",QMessageBox::Ok,QMessageBox::NoButton);
QApplication::exit(1);
return;
}
fprintf(scr,"#!/bin/bash\n");
fprintf(scr,"export PATH=\"/bin:/usr/bin:/sbin:/usr/sbin\"\n");
fprintf(scr,"if [ -f '/Library/Application Support/ZeroTier/One/authtoken.secret' ]; then\n");
fprintf(scr," mkdir -p '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier'\n",(int)getuid(),homePath.c_str());
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier'\n",(int)getgid(),homePath.c_str());
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier'\n",homePath.c_str());
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getuid(),homePath.c_str());
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getgid(),homePath.c_str());
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
fprintf(scr," cp -f '/Library/Application Support/ZeroTier/One/authtoken.secret' '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getuid(),homePath.c_str());
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getgid(),homePath.c_str());
fprintf(scr," chmod 0600 '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
fprintf(scr,"fi\n");
fprintf(scr,"exit 0\n");
fclose(scr);
chmod(tmpPath.c_str(),0755);
macExecutePrivilegedShellCommand((std::string("'")+tmpPath+"' >>/dev/null 2>&1").c_str());
unlink(tmpPath.c_str());
FILE *scr = fopen(tmpPath.c_str(),"w");
if (!scr) {
QMessageBox::critical(this,"Cannot Authorize","Unable to authorize this user to administrate ZeroTier One. (Cannot write to temporary Library/Caches/ZeroTier/One folder.)",QMessageBox::Ok,QMessageBox::NoButton);
QApplication::exit(1);
return;
}
#endif
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultSystemPath().c_str(),authToken)) {
QMessageBox::critical(this,"Cannot Authorize","Unable to authorize this user to administrate ZeroTier One. (Did you enter your password correctly?)",QMessageBox::Ok,QMessageBox::NoButton);
QApplication::exit(1);
return;
}
}
fprintf(scr,"#!/bin/bash\n");
fprintf(scr,"export PATH=\"/bin:/usr/bin:/sbin:/usr/sbin\"\n");
fprintf(scr,"if [ -f '/Library/Application Support/ZeroTier/One/authtoken.secret' ]; then\n");
fprintf(scr," mkdir -p '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier'\n",(int)getuid(),homePath.c_str());
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier'\n",(int)getgid(),homePath.c_str());
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier'\n",homePath.c_str());
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getuid(),homePath.c_str());
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getgid(),homePath.c_str());
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
fprintf(scr," cp -f '/Library/Application Support/ZeroTier/One/authtoken.secret' '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getuid(),homePath.c_str());
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getgid(),homePath.c_str());
fprintf(scr," chmod 0600 '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
fprintf(scr,"fi\n");
fprintf(scr,"exit 0\n");
fclose(scr);
chmod(tmpPath.c_str(),0755);
macExecutePrivilegedShellCommand((std::string("'")+tmpPath+"' >>/dev/null 2>&1").c_str());
unlink(tmpPath.c_str());
}
#endif // __APPLE__
zeroTierClient = new ZeroTier::Node::LocalClient(authToken.c_str(),0,&handleZTMessage,this);
try {
zeroTierClient = new ZeroTier::Node::NodeControlClient((const char *)0,&handleZTMessage,this);
const char *err = zeroTierClient->error();
if (err) {
delete zeroTierClient;
zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
}
} catch ( ... ) {
zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
}
}
if (++this->cyclesSinceResponseFromService >= 3) {
if (this->cyclesSinceResponseFromService == 3)
if (this->cyclesSinceResponseFromService == 3) {
QMessageBox::warning(this,"Service Not Running","Can't connect to the ZeroTier One service. Is it running?",QMessageBox::Ok);
}
ui->noNetworksLabel->setVisible(true);
ui->noNetworksLabel->setText("Connecting to Service...");
ui->bottomContainerWidget->setVisible(false);
ui->networkListWidget->setVisible(false);
}
zeroTierClient->send("info");
zeroTierClient->send("listnetworks");
zeroTierClient->send("listpeers");
if (zeroTierClient) {
zeroTierClient->send("info");
zeroTierClient->send("listnetworks");
zeroTierClient->send("listpeers");
}
}
void MainWindow::customEvent(QEvent *event)
@@ -237,15 +237,14 @@ void MainWindow::customEvent(QEvent *event)
ZTMessageEvent *m = (ZTMessageEvent *)event; // only one custom event type so far
if (m->ztMessage.size() == 0)
return;
this->cyclesSinceResponseFromService = 0;
std::vector<std::string> hdr(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[0]));
std::vector<std::string> hdr(ZeroTier::Node::NodeControlClient::splitLine(m->ztMessage[0]));
if (hdr.size() < 2)
return;
if (hdr[0] != "200")
return;
this->cyclesSinceResponseFromService = 0;
if (hdr[1] == "info") {
if (hdr.size() >= 3)
this->myAddress = hdr[2].c_str();
@@ -256,9 +255,9 @@ void MainWindow::customEvent(QEvent *event)
} else if (hdr[1] == "listnetworks") {
std::map< std::string,std::vector<std::string> > newNetworks;
for(unsigned long i=1;i<m->ztMessage.size();++i) {
std::vector<std::string> l(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[i]));
// 200 listnetworks <nwid> <name> <status> <config age> <type> <dev> <ips>
if ((l.size() == 9)&&(l[2].length() == 16))
std::vector<std::string> l(ZeroTier::Node::NodeControlClient::splitLine(m->ztMessage[i]));
// 200 listnetworks <nwid> <name> <mac> <status> <config age> <type> <dev> <ips>
if ((l.size() == 10)&&(l[2].length() == 16))
newNetworks[l[2]] = l;
}
@@ -285,10 +284,11 @@ void MainWindow::customEvent(QEvent *event)
alreadyDisplayed.insert(nw->networkId());
std::vector<std::string> &l = networks[nw->networkId()];
nw->setNetworkName(l[3]);
nw->setStatus(l[4],l[5]);
nw->setNetworkType(l[6]);
nw->setNetworkDeviceName(l[7]);
nw->setIps(l[8]);
nw->setMAC(l[4]);
nw->setStatus(l[5],l[6]);
nw->setNetworkType(l[7]);
nw->setNetworkDeviceName(l[8]);
nw->setIps(l[9]);
}
}
for(std::map< std::string,std::vector<std::string> >::iterator nwdata(networks.begin());nwdata!=networks.end();++nwdata) {
@@ -296,10 +296,11 @@ void MainWindow::customEvent(QEvent *event)
std::vector<std::string> &l = nwdata->second;
NetworkWidget *nw = new NetworkWidget((QWidget *)0,nwdata->first);
nw->setNetworkName(l[3]);
nw->setStatus(l[4],l[5]);
nw->setNetworkType(l[6]);
nw->setNetworkDeviceName(l[7]);
nw->setIps(l[8]);
nw->setMAC(l[4]);
nw->setStatus(l[5],l[6]);
nw->setNetworkType(l[7]);
nw->setNetworkDeviceName(l[8]);
nw->setIps(l[9]);
QListWidgetItem *item = new QListWidgetItem();
item->setSizeHint(nw->sizeHint());
ui->networkListWidget->addItem(item);
@@ -309,12 +310,10 @@ void MainWindow::customEvent(QEvent *event)
}
} else if (hdr[1] == "listpeers") {
this->numPeers = 0;
for(unsigned long i=1;i<m->ztMessage.size();++i) {
std::vector<std::string> l(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[i]));
if ((l.size() >= 5)&&((l[3] != "-")||(l[4] != "-")))
++this->numPeers; // number of direct peers online -- check for active IPv4 and/or IPv6 address
}
}
for(unsigned long i=1;i<m->ztMessage.size();++i)
++this->numPeers;
} else
return;
if (!ui->networkListWidget->count()) {
ui->noNetworksLabel->setText("You Have Not Joined Any Networks");
@@ -335,7 +334,7 @@ void MainWindow::customEvent(QEvent *event)
st += this->myVersion;
st += ", ";
st += QString::number(this->numPeers);
st += " direct links to peers";
st += " peers";
ui->statusLabel->setText(st);
}
+1 -1
View File
@@ -49,7 +49,7 @@ class MainWindow;
// Globally visible instance of local client for communicating with ZT1
// Can be null if not connected, or will point to current
extern ZeroTier::Node::LocalClient *zeroTierClient;
extern ZeroTier::Node::NodeControlClient *zeroTierClient;
// Globally visible pointer to main app window
extern QMainWindow *mainWindow;
+4 -4
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>720</width>
<height>300</height>
<width>850</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
@@ -229,8 +229,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>720</width>
<height>22</height>
<width>850</width>
<height>34</height>
</rect>
</property>
<property name="font">
+7 -5
View File
@@ -53,8 +53,8 @@ NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) :
QFontMetrics fm(ui->ipListWidget->font());
int lineHeight = ui->ipListWidget->spacing() + fm.height();
ui->ipListWidget->setMinimumHeight(lineHeight * 4);
ui->ipListWidget->setMaximumHeight(lineHeight * 4);
ui->ipListWidget->setMinimumHeight(lineHeight * 6);
ui->ipListWidget->setMaximumHeight(lineHeight * 6);
#ifdef __APPLE__
QWidgetList widgets = this->findChildren<QWidget*>();
@@ -80,9 +80,6 @@ NetworkWidget::~NetworkWidget()
void NetworkWidget::setStatus(const std::string &status,const std::string &age)
{
ui->statusLabel->setText(QString(status.c_str()));
if (status == "OK")
ui->ageLabel->setText(QString("[") + age.c_str() + "s ago]");
else ui->ageLabel->setText(QString());
}
void NetworkWidget::setNetworkName(const std::string &name)
@@ -148,6 +145,11 @@ void NetworkWidget::setIps(const std::string &commaSeparatedList)
}
}
void NetworkWidget::setMAC(const std::string &mac)
{
ui->macLabel->setText(QString(mac.c_str()));
}
const std::string &NetworkWidget::networkId()
{
return networkIdStr;
+1
View File
@@ -50,6 +50,7 @@ public:
void setNetworkType(const std::string &type);
void setNetworkDeviceName(const std::string &dev);
void setIps(const std::string &commaSeparatedList);
void setMAC(const std::string &mac);
const std::string &networkId();
+108 -94
View File
@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>580</width>
<width>689</width>
<height>253</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -40,6 +40,12 @@
</property>
<item>
<widget class="QWidget" name="leftWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
@@ -57,7 +63,13 @@
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<widget class="QWidget" name="networkInfoWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
@@ -179,7 +191,7 @@
<item>
<widget class="QWidget" name="networkStatsWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -232,6 +244,12 @@
</item>
<item row="2" column="1">
<widget class="QLabel" name="networkTypeLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
@@ -265,7 +283,33 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="1">
<widget class="QLabel" name="statusLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="statusTip">
<string>Status of this network.</string>
</property>
<property name="text">
<string>?</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
@@ -280,101 +324,14 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QWidget" name="widget" native="true">
<item row="5" column="1">
<widget class="QLabel" name="deviceLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>12</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="statusLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="statusTip">
<string>Status of this network.</string>
</property>
<property name="text">
<string>?</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="ageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="statusTip">
<string>How recently did this network refresh its settings?</string>
</property>
<property name="text">
<string>[0s ago]</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="deviceLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
@@ -393,9 +350,66 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>MAC:</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="macLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="statusTip">
<string>Your system's Ethernet MAC address.</string>
</property>
<property name="text">
<string>?</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
+7
View File
@@ -0,0 +1,7 @@
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.
#### Some stuff other than shelved code:
multicast-trace-receiver.rb: receives multicast trace UDP packets from ZT_TRACE_MULTICAST
encrypt, decrypt: useful shell scripts for AES-encrypting and decrypting files
-2
View File
@@ -1,2 +0,0 @@
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.
-123
View File
@@ -1,123 +0,0 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* 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_RANGE_HPP
#define _ZT_RANGE_HPP
namespace ZeroTier {
/**
* A range of numeric values
*
* @tparam T Type, can be any numeric value (int, float, double, etc.)
*/
template<typename T>
class Range
{
public:
/**
* Construct an empty range
*/
Range()
throw() :
start(0),
end(0)
{
}
/**
* @param s Starting value (inclusive)
* @param e Ending value (exclusive)
*/
Range(T s,T e)
throw() :
start(s),
end(e)
{
}
/**
* Construct a range containing from n to n+1 (thus only n for integers)
*
* @param n Number to contain
*/
Range(T n)
throw() :
start(n),
end(n+1)
{
}
/**
* @return end - start
*/
inline T magnitude() const
throw()
{
return (end - start);
}
/**
* @return True if range contains something (magnitude is nonzero)
*/
inline operator bool() const
throw()
{
return (end > start);
}
/**
* @param v Value to test
* @return True if value is between start (inclusive) and end (exclusive)
*/
inline bool operator()(const T &v) const
throw()
{
return ((v >= start)&&(v < end));
}
inline bool operator==(const Range &r) const throw() { return ((start == r.start)&&(end == r.end)); }
inline bool operator!=(const Range &r) const throw() { return (!(*this == r)); }
inline bool operator<(const Range &r) const throw() { return ((start < r.start) ? true : ((start == r.start) ? (end < r.end) : false)); }
inline bool operator>(const Range &r) const throw() { return (r < *this); }
inline bool operator<=(const Range &r) const throw() { return !(r < *this); }
inline bool operator>=(const Range &r) const throw() { return !(*this < r); }
/**
* Start of range (may be modified directly)
*/
T start;
/**
* End of range (may be modified directly)
*/
T end;
};
} // namespace ZeroTier
#endif
Executable
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
export PATH=/bin:/usr/bin
if [ ! -e /usr/bin/openssl ]; then
echo $0: requires /usr/bin/openssl, please install openssl tools
exit 1
fi
if [ "$#" -lt 1 ]; then
echo $0: Usage: $0 '<input>' '[output]'
exit 1
fi
if [ ! -r "$1" ]; then
echo $0: $1 does not exist or is not readable.
exit 1
fi
outpath=`echo "$1" | sed 's/[.]aes$//'`
if [ "$#" -ge 2 ]; then
outpath="$2"
fi
if [ -f "$outpath" ]; then
echo $0: $outpath already exists, delete or rename first.
exit 1
fi
openssl aes-256-cbc -d -salt -in "$1" -out "$outpath"
echo $0: wrote "$outpath"
Executable
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
export PATH=/bin:/usr/bin
if [ ! -e /usr/bin/openssl ]; then
echo $0: requires /usr/bin/openssl, please install openssl tools
exit 1
fi
if [ "$#" -lt 1 ]; then
echo $0: Usage: $0 '<input>' '[output]'
exit 1
fi
if [ ! -r "$1" ]; then
echo $0: $1 does not exist or is not readable.
exit 1
fi
outpath="$1.aes"
if [ "$#" -ge 2 ]; then
outpath="$2"
fi
if [ -f "$outpath" ]; then
echo $0: $outpath already exists, delete or rename first.
exit 1
fi
openssl aes-256-cbc -salt -in "$1" -out "$outpath"
echo $0: wrote "$outpath"
-3
View File
@@ -1,3 +0,0 @@
This is a do-nothing placebo software update for internal testing. It's a
shell script that just prints a simple message and an .NFO file that signs
it as official.
-6
View File
@@ -1,6 +0,0 @@
vMajor=999
vMinor=999
vRevision=999
signedBy=e9bc3707b5
ed25519=ca7b943ace5451f420f1f599822d7013534a7cb7997096141e6a1aa6398c5f260c19dc5eecb297c922950f26dee7f9db787f8dbf85bc422baf3bff94c1131e086a7fc85c26dbb8c1b0a9cae63acc34998d9e1ce553156ea5638f9c99a50f6e2e
url=http://download.zerotier.com/update/update-dummy.sh
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
echo "Dummy updater -- run with opts: $*"
exit 0
+2 -1
View File
@@ -77,8 +77,9 @@ fi
echo 'Installing zerotier-cli command line utility...'
rm -f /usr/bin/zerotier-cli
rm -f /usr/bin/zerotier-cli /usr/bin/zerotier-idtool
ln -sf /var/lib/zerotier-one/zerotier-one /usr/bin/zerotier-cli
ln -sf /var/lib/zerotier-one/zerotier-one /usr/bin/zerotier-idtool
echo 'Installing and (re-)starting zerotier-one daemon...'
Loaded 20 of 145 files, more files were not shown because too many files have changed in this diff. Show more