Compare commits

...
1133 Commits
Author SHA1 Message Date
Adam Ierymenko 4218cd13d5 VERSION 1.1.6: route management, default route override, new IPv6 mode for Docker, and more!
(Retagged due to silly one-line bug and left over debug line... doh!)

Version 1.1.6 contains several significant improvements for use in complex network
environments along with some minor bug fixes and improvements to path stability and
dead path detection.

ROUTE MANAGEMENT AND FULL TUNNEL SUPPORT

1.1.6 is the first version of ZeroTier One to permit "full tunnel" (default route
override) operation on Linux, Mac, and Windows. This allows all Internet traffic
to be tunneled through ZeroTier while allowing ZeroTier peer-to-peer traffic to
continue to use the physical interface. 1.1.6 also brings route management support
and permissions settings for local networks to control whether networks are allowed
to modify the routing table or override default routing.

This is currently considered a beta/experimental feature and must be enabled via
the command line interface.

Route management and default route override requires support at the network controller.
When my.zerotier.com is updated and ready, we will post more information and testing
instructions at: https://www.zerotier.com/community

HIGHLY SCALABLE CONTAINER NETWORKING

1.1.6 also brings a new multicast-free (NDP emulated) IPv6 private addressing scheme
called "6plane." 6plane provides each host with a private IPv6 /80 and routes *all*
IPv6 traffic for this subnet to the host via transparent NDP emulation. This /80 can
then be assigned to Docker or other container/VM managers to assign a network-wide
IPv6 /128 to every container. Since NDP is emulated and multicast isn't needed, this
system can scale to millions of containers or more on a single backplane network with
a high degree of efficiency and reliability.

6plane also requires controller support. Look for it at my.zerotier.com once we have
upgraded our core infrastructure and web UIs.

(All hosts must be running 1.1.6 for 6plane to work properly. Other IPv6 addresses
or addressing modes are not affected and normal IPv6 NDP will continue to work
alongside 6plane in the same network.)

OTHER CHANGES

 * Upgraded bundled miniupnpc, libnatpmp, and http-parser.
 * New Debian and RPM packaging that is closer to compliance with distribution
   guidelines, and a new Dockerized Linux package build system in linux-build-farm/
   that can build every package on actual images of the correct distribution.
 * Improvements to dead path detection.
 * IPv6 now uses keepalive because a significant number of stateful IPv6 edge
   routers have very short timeouts (30 seconds or less!).
 * Significant performance improvements to network controllers under high load.
 * Enable -fstack-protector-strong for better stack canary (security) support
   in binaries. Note that this may require newer gcc/g++ or clang.

COMING SOON

The next version of ZeroTier One should have a new Mac UI. It's a system tray app
that looks and behaves a lot like the Mac WiFi pulldown menu. We'll also be adding
GUI support for default route and route management options and other new features.

Shortly after that we plan on adding full OpenFlow-like SDN rules engine support
to the ZeroTier core, making our planetary Ethernet switch a fully manageable smart
switch and enabling sophisticated security and flow rule management.
2016-06-29 18:16:58 -07:00
Adam Ierymenko 030dfde38e Unused printf removal while we are at it. 2016-06-29 18:14:49 -07:00
Adam Ierymenko 901e2fd692 Fix silly one-liner bug... retag time. 2016-06-29 18:12:35 -07:00
Adam Ierymenko c03ca3c278 VERSION 1.1.6: route management, default route override, new IPv6 mode for Docker, and more!
Version 1.1.6 contains several significant improvements for use in complex network
environments along with some minor bug fixes and improvements to path stability and
dead path detection.

ROUTE MANAGEMENT AND FULL TUNNEL SUPPORT

1.1.6 is the first version of ZeroTier One to permit "full tunnel" (default route
override) operation on Linux, Mac, and Windows. This allows all Internet traffic
to be tunneled through ZeroTier while allowing ZeroTier peer-to-peer traffic to
continue to use the physical interface. 1.1.6 also brings route management support
and permissions settings for local networks to control whether networks are allowed
to modify the routing table or override default routing.

This is currently considered a beta/experimental feature and must be enabled via
the command line interface.

Route management and default route override requires support at the network controller.
When my.zerotier.com is updated and ready, we will post more information and testing
instructions at: https://www.zerotier.com/community

HIGHLY SCALABLE CONTAINER NETWORKING

1.1.6 also brings a new multicast-free (NDP emulated) IPv6 private addressing scheme
called "6plane." 6plane provides each host with a private IPv6 /80 and routes *all*
IPv6 traffic for this subnet to the host via transparent NDP emulation. This /80 can
then be assigned to Docker or other container/VM managers to assign a network-wide
IPv6 /128 to every container. Since NDP is emulated and multicast isn't needed, this
system can scale to millions of containers or more on a single backplane network with
a high degree of efficiency and reliability.

6plane also requires controller support. Look for it at my.zerotier.com once we have
upgraded our core infrastructure and web UIs.

(All hosts must be running 1.1.6 for 6plane to work properly. Other IPv6 addresses
or addressing modes are not affected and normal IPv6 NDP will continue to work
alongside 6plane in the same network.)

OTHER CHANGES

 * Upgraded bundled miniupnpc, libnatpmp, and http-parser.
 * New Debian and RPM packaging that is closer to compliance with distribution
   guidelines, and a new Dockerized Linux package build system in linux-build-farm/
   that can build every package on actual images of the correct distribution.
 * Improvements to dead path detection.
 * IPv6 now uses keepalive because a significant number of stateful IPv6 edge
   routers have very short timeouts (30 seconds or less!).
 * Significant performance improvements to network controllers under high load.
 * Enable -fstack-protector-strong for better stack canary (security) support
   in binaries. Note that this may require newer gcc/g++ or clang.

COMING SOON

The next version of ZeroTier One should have a new Mac UI. It's a system tray app
that looks and behaves a lot like the Mac WiFi pulldown menu. We'll also be adding
GUI support for default route and route management options and other new features.

Shortly after that we plan on adding full OpenFlow-like SDN rules engine support
to the ZeroTier core, making our planetary Ethernet switch a fully manageable smart
switch and enabling sophisticated security and flow rule management.
2016-06-29 15:53:46 -07:00
Adam Ierymenko af2268ebd7 docs 2016-06-29 15:33:18 -07:00
Adam Ierymenko b9876d1809 docs 2016-06-29 15:30:49 -07:00
Adam Ierymenko e64909cdcd docs 2016-06-29 15:24:45 -07:00
Adam Ierymenko ce2ad69e5f Get rid of aptly script. 2016-06-29 14:44:29 -07:00
Adam Ierymenko 56fb08621e amazon-2016.03 docker image 2016-06-29 14:35:53 -07:00
Adam Ierymenko 4457c8218d Auto-detect miniupnpc 2.0 and use it on Linux if present. 2016-06-29 13:27:10 -07:00
Adam Ierymenko c862f199e3 Windows: ship it! 2016-06-29 13:22:04 -07:00
Adam Ierymenko 7918b26f65 Hack settings into old CLI. 2016-06-29 12:22:37 -07:00
Adam Ierymenko df00d3b046 Going to have to continue to use the old MAC web-container-based UI on Macs prior to 10.10 even when the new UI comes out, and the new UI is not ready yet anyway, so resurrect this. 2016-06-29 12:00:16 -07:00
Adam Ierymenko 19735e7050 Revert backgrounding of controller requests hack. Controller code is not really parallel anyway and we fixed the perf problem. 2016-06-29 11:43:22 -07:00
Adam Ierymenko bb63646682 Fix broken SQL in controller. 2016-06-29 11:37:28 -07:00
Adam Ierymenko b4fcf2ee60 Fix a valgrind warning. 2016-06-29 11:11:16 -07:00
Adam Ierymenko d9eacd1616 Controller fixes... 2016-06-29 17:02:03 +00:00
Adam Ierymenko 5309c7e082 Merge branch 'dev' of https://github.com/zerotier/ZeroTierOne into dev 2016-06-29 16:47:57 +00:00
Adam Ierymenko dbe57742e6 Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev 2016-06-29 09:45:05 -07:00
Adam Ierymenko 928c625e2c docs 2016-06-29 09:45:02 -07:00
Adam Ierymenko 1e00603241 Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev 2016-06-28 16:09:41 -07:00
Adam Ierymenko f6442f2752 fedora-22 2016-06-28 16:09:36 -07:00
Adam Ierymenko 7b7ab823b0 Fix getPeer(self) bug if I am the controller. 2016-06-28 22:49:01 +00:00
Adam Ierymenko 0410fd4824 Refactor recent member request history to fix performance problem in controller. 2016-06-28 12:44:47 -07:00
Adam Ierymenko 02fa32422a Dockerfile ordering 2016-06-27 20:07:35 -07:00
Adam Ierymenko 12037961ff small perf improvement in sqlite db. 2016-06-27 18:48:02 -07:00
Adam Ierymenko 8c572dead1 Query optimization. 2016-06-27 18:28:18 -07:00
Adam Ierymenko 3ddfebe742 dead code removal 2016-06-27 17:15:39 -07:00
Adam Ierymenko 972bbb7e06 Allow further concurrency on network controller. 2016-06-27 17:14:47 -07:00
Adam Ierymenko 45f315e603 Defer NETWORK_CONFIG_REQUEST packets and allow multithreaded processing. 2016-06-27 17:09:04 -07:00
Adam Ierymenko b9e86103cf Docker build farm seems to work! 2016-06-27 16:38:08 -07:00
Adam Ierymenko 0588589d57 . 2016-06-27 16:21:55 -07:00
Adam Ierymenko 4d30f60bbe . 2016-06-27 16:12:17 -07:00
Adam Ierymenko d58dcf29cc For now go back to bundling http-parser etc. in our official RPM builds since this introduces an EPEL dependency for CentOS which would only make sense if we are actually in EPEL. Probably will eventually have two spec files: one for official and one for our own. 2016-06-27 15:46:54 -07:00
Adam Ierymenko 809457599a CentOS7 fixes. 2016-06-27 15:21:24 -07:00
Adam Ierymenko 2d19fb7f8c More RPM fixes. 2016-06-27 15:08:51 -07:00
Adam Ierymenko 2c9401ed74 CentOS6 fix. 2016-06-27 14:56:40 -07:00
Adam Ierymenko af23596c34 Put everything in /usr/sbin on Linux. 2016-06-27 14:45:38 -07:00
Adam Ierymenko 233945e60f More Dockerfile fixes, and do not use "ln -r" since it is not supported on older Linux distributions. 2016-06-27 14:36:58 -07:00
Adam Ierymenko 147f735333 More build fixes. 2016-06-27 14:21:54 -07:00
Adam Ierymenko 8de5b2beda RPM build fixes -- use RPM cflags, spec fixes, etc. 2016-06-27 09:25:34 -07:00
Adam Ierymenko b02c3dfe8d Debian dependency for iproute2 2016-06-27 08:48:09 -07:00
Adam Ierymenko c5d3895313 ZeroTier One requires /sbin/ip (RPM-based distros) 2016-06-27 08:47:09 -07:00
Adam Ierymenko d20bcdae12 CentOS 6 Docker build. 2016-06-25 16:27:28 -07:00
Adam Ierymenko 81cd68b60d . 2016-06-25 14:07:02 -07:00
Adam Ierymenko 0582b3daba . 2016-06-25 14:06:40 -07:00
Adam Ierymenko af0a205594 Build and spec file updates for CentOS6 2016-06-25 14:04:08 -07:00
Adam Ierymenko 06e2e8119e Script to create Debian repos (requires aptly) 2016-06-24 16:23:10 -07:00
Adam Ierymenko 8b78f19335 More build targets. 2016-06-24 14:57:20 -07:00
Adam Ierymenko 9784393b15 More Linux Docker build farm targets. 2016-06-24 14:45:09 -07:00
Adam Ierymenko 65da797112 Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev 2016-06-24 14:19:01 -07:00
Adam Ierymenko 75fe981b9d Bump version. 2016-06-24 14:18:28 -07:00
Adam Ierymenko caaf33e4cf Bump version. 2016-06-24 10:20:35 -07:00
Adam Ierymenko d642db6f66 Changes for Debian packaging to prep for 1.1.6 interim. 2016-06-24 10:19:41 -07:00
Adam Ierymenko 3740b83f63 Don't back up sqlite db if it hasn't changed to prevent constant thrashing on inactive controllers. 2016-06-24 06:53:23 -07:00
Adam Ierymenko 90cdef8400 Forgot NDP emulation flag. 2016-06-24 06:43:23 -07:00
Adam Ierymenko ee649ae69a Add 6plane assignment support to network controller, and cleanup. 2016-06-24 06:40:50 -07:00
Adam Ierymenko 20d155e630 . 2016-06-24 05:21:25 -07:00
Adam Ierymenko be5996daca Cleanup of 6plane stuff. 2016-06-24 04:54:05 -07:00
Adam Ierymenko 38dfebad8c IPv6 NDP emulation flag in NetworkConfig, and implement Docker-friendly
(and other host friendly) IPv6 /80 magic subnetting to allow massive
multicast-free NDP emulated IPv6 networks where each host can have a
/48 worth of IPv6 IPs for internal containers, VMs, etc.

Alan Kay, thou art avenged.

https://ivanovivan.wordpress.com/2010/09/13/alan-kay-quotes/
2016-06-23 22:41:14 -07:00
Adam Ierymenko a5a05e454e cli work... 2016-06-23 17:00:33 -07:00
Adam Ierymenko 32d9850263 More new CLI work. 2016-06-23 12:37:15 -07:00
Adam Ierymenko a5ea8cc5cb . 2016-06-22 17:56:36 -07:00
Adam Ierymenko 0ad6b4105a Outline of new CLI with ability to control controllers/central as well as service. 2016-06-22 17:54:07 -07:00
Adam Ierymenko f765597526 Add network local.conf stuff to save network permission settings and wire it all through via the JSON API. Default route and route management stuff just about done. 2016-06-21 16:52:49 -07:00
Adam Ierymenko 8ca4f22f1d cleanup 2016-06-21 15:53:38 -07:00
Adam Ierymenko 674b84d908 Plumbing for network setting control, and GitHub issue #330 2016-06-21 14:58:30 -07:00
Adam Ierymenko e2ca239be0 Comment cleanup. 2016-06-21 14:38:15 -07:00
Adam Ierymenko 4f237687ce Route management now works on Windows, including default route override! 1.1.6 very close! 2016-06-21 13:54:03 -07:00
Adam Ierymenko 5b2d2efb45 Windows builds again. And there was much rejoicing. 2016-06-21 12:55:43 -07:00
Adam Ierymenko 82473c85e0 Default route override and route management in general now works in Linux. 2016-06-21 12:32:58 -07:00
Adam Ierymenko 51ced0cf41 GitHub issue #338 2016-06-21 09:41:55 -07:00
Adam Ierymenko 6c4a444f29 GitHub issue #339 2016-06-21 09:40:53 -07:00
Adam Ierymenko 330c80f3f5 Add rule type to match a COM field of the peer by ID and value because this will be powerful. 2016-06-21 08:09:20 -07:00
Adam Ierymenko eee59ec9ce Fix Buffer<> version of Dictionary.get(). 2016-06-21 08:00:40 -07:00
Adam Ierymenko 0959d33ba0 Add a few technically unnecessary but feel-good paranoia bounds checks in Dictionary.get(). 2016-06-21 07:59:42 -07:00
Adam Ierymenko ca82715bfa Another fuzzing code fix. 2016-06-21 07:52:32 -07:00
Adam Ierymenko 0c05b2cb50 Comment cleanup and fuzzing improvements. 2016-06-21 07:49:46 -07:00
Adam Ierymenko b2d048aa0e Make Dictionary templatable so it can be used where we want a higher capacity. 2016-06-21 07:32:58 -07:00
Adam Ierymenko 3ee15e65aa Tying up default route and route mgmt loose ends. It now periodically updates shadow routes so hopefully your link will stay up as you move around. 2016-06-17 13:14:48 -07:00
Adam Ierymenko 1bf1c38b30 Default route population works on Mac! 2016-06-16 18:23:33 -07:00
Adam Ierymenko eb4a78bcc3 Report routes in locally joined network JSON. 2016-06-16 17:40:32 -07:00
Adam Ierymenko 37afa876a7 Linux bug fixes, small controller fix. 2016-06-17 00:21:58 +00:00
Adam Ierymenko 601c51b351 Bug fix. 2016-06-16 23:18:20 +00:00
Adam Ierymenko 20d4dada40 Refactor controller for new merged format. 2016-06-16 16:05:57 -07:00
Adam Ierymenko 901b75e756 New format now integrated, and it works. 2016-06-16 15:48:58 -07:00
Adam Ierymenko bc3d7d11fe Remove netcon from dev branch. This is moving to its own new ZeroTierSDK repo for future release under the SDK name. 2016-06-16 14:50:08 -07:00
Adam Ierymenko 490d20e8fb Self test for dictionary, and fixes. 2016-06-16 14:45:36 -07:00
Adam Ierymenko 2113c21fdc devicemap now works again in OSXEthernetTap 2016-06-16 14:09:09 -07:00
Adam Ierymenko e09c1a1c11 Big refactor mostly builds. We now have a uniform backward compatible netconf. 2016-06-16 12:28:43 -07:00
Adam Ierymenko b104bb4762 New super-packed dictionary -- we are going back to a backward compatibile format with the old netconf but in an embedded-friendly way. This is simpler. 2016-06-15 18:47:35 -07:00
Adam Ierymenko f41ea24e97 Build fixes. 2016-06-16 00:11:46 +00:00
Adam Ierymenko 3c655a4b84 Default route ready to test on Mac. 2016-06-15 15:46:57 -07:00
Adam Ierymenko b90e66f7c7 ManagedRoute, which applies C++ RAII to injected routes. Move RoutingTable to attic. 2016-06-15 15:02:40 -07:00
Adam Ierymenko 4446dbde5e Big refactor in service code to prep for plumbing through route management. 2016-06-14 10:09:26 -07:00
Adam Ierymenko 769351b30f Fix to routes config in controller API. 2016-06-13 15:58:00 -07:00
Adam Ierymenko 734cbb2f1e Controller modifications for default route are ready to test. Will require slight changes in ZeroTier Central when it goes live. 2016-06-10 15:58:35 -07:00
Adam Ierymenko acbe8ad398 More controller work, and some RedHat fixes. 2016-06-10 08:26:27 -07:00
Adam Ierymenko 9898066b47 Remove some deprecated stuff in controller -- not done yet. 2016-06-09 11:02:42 -07:00
Adam Ierymenko 82635ce606 Add flags and metric to ZT-managed routes. 2016-06-09 09:43:09 -07:00
Adam Ierymenko 8c7433a525 . 2016-06-08 17:45:25 -07:00
Adam Ierymenko 56ef9e0643 Add rpm target. 2016-06-08 16:29:30 -07:00
Adam Ierymenko e6328dfe82 Add RPM spec conditionals to include json-parser or bundle it depending on whether we are fedora or rhel/centos/epel. 2016-06-08 16:19:38 -07:00
Adam Ierymenko 3a48e3781b bundle miniupnpc for now... might change later. 2016-06-08 15:37:37 -07:00
Adam Ierymenko f9056da6be rpmbuild -ba zerotier-one.spec basically works 2016-06-08 15:33:59 -07:00
Adam Ierymenko 536feb632c Support yet another old version of http-parser for CentOS/EPEL. 2016-06-08 15:09:09 -07:00
Adam Ierymenko cafa41ba4d RedHat stuff and cleanup. 2016-06-08 14:46:42 -07:00
Adam Ierymenko 196d96cfa7 Fix ronn convert problem in man page. 2016-06-08 14:08:56 -07:00
Adam Ierymenko 4e6f95e152 Build man pages with ruby-ronn on Debian. 2016-06-08 14:06:19 -07:00
Adam Ierymenko de9fa6a334 All three init systems now covered in debian. 2016-06-08 13:30:29 -07:00
Adam Ierymenko abd7071eaa systemd stuff for debian 2016-06-08 13:19:08 -07:00
Adam Ierymenko 7e68791bee Fix include for system json-parser. 2016-06-08 12:57:22 -07:00
Adam Ierymenko 6c6b18d003 Fix include for system lz4. 2016-06-08 12:50:56 -07:00
Adam Ierymenko 4da9d4e53a Fix build against Debian version of libhttp-parser -- its old but it will work. 2016-06-08 12:49:07 -07:00
Adam Ierymenko 0ca764968a Remove warnings, more Debian stuff, remove obsolete ui/ stuff. 2016-06-08 11:21:01 -07:00
Adam Ierymenko 62b64d39ab Minimal debian is working. 2016-06-08 10:30:54 -07:00
Adam Ierymenko ae87fbf8e3 make install installs man pages 2016-06-08 10:19:46 -07:00
Adam Ierymenko 2e890580fc Stop shipping pre-build man pages since it violates Debian arcane rule #134931e+26 and add manpages build target. 2016-06-08 10:13:31 -07:00
Adam Ierymenko afda5e684b Make install/uninstall for Linux 2016-06-07 17:11:09 -07:00
Adam Ierymenko 9161eebc68 Carry virtual network routes through to API. 2016-06-07 12:15:19 -07:00
Adam Ierymenko 683254a0db Don't bother signing if we are not using the legacy netconf. 2016-06-07 11:17:38 -07:00
Adam Ierymenko 2885aea65c Only send new format netconf for PV>=6 2016-06-07 11:13:18 -07:00
Adam Ierymenko 523ea68ae2 Increment protocol version to indicate support for binary network config and config request meta-data. 2016-06-07 11:08:36 -07:00
Adam Ierymenko ca88e1f1cf fix size 2016-06-07 10:47:22 -07:00
Adam Ierymenko be37d025b8 Make flags 64-bit in both network request and config. 2016-06-07 10:46:29 -07:00
Adam Ierymenko 4342b71d7a Upgrade miniupnpc to 2.0 2016-06-02 17:04:15 -07:00
Adam Ierymenko f20602a7b1 docs 2016-06-02 15:57:18 -07:00
Adam Ierymenko f311b4111b docs 2016-06-02 15:56:58 -07:00
Adam Ierymenko 61d6ada88d . 2016-06-02 15:26:00 -07:00
Adam Ierymenko 506c74270c Stash old Linux binary installer stuff in attic. This is going away. 2016-06-02 15:20:43 -07:00
Adam Ierymenko 4d13ddd48c GPG public key for signing GitHub releases, etc. 2016-06-02 15:04:56 -07:00
Adam Ierymenko cc89290eb6 last man page! 2016-06-02 14:50:38 -07:00
Adam Ierymenko 5bce3e37ee clean doc node_modules on clean 2016-06-02 13:58:34 -07:00
Adam Ierymenko 6671d5553b More man pages. 2016-06-02 13:56:24 -07:00
Adam Ierymenko 41b3b54bf8 man stuff 2016-06-02 13:04:46 -07:00
Adam Ierymenko 096db53822 Switch manual pages to "ronn," a program that converts MarkDown to roff man pages, and pre-build them. Also have the zerotier-cli(1) man page ready to go! 2016-06-02 12:33:28 -07:00
Adam Ierymenko f9148bf9cb Finally json-parser. Skip miniupnpc since some Linux distros (even newer ones) ship with an old unsafe crummy version. 2016-06-01 22:26:58 -07:00
Adam Ierymenko a880f93166 also libnatpmp 2016-06-01 22:06:43 -07:00
Adam Ierymenko fd81a7fe63 On Linux auto-detect presence of http-parser and lz4 and link against system libs instead of ext/ builtins (for RPM and DEB packaging effort) 2016-06-01 21:55:48 -07:00
Adam Ierymenko 65b7893a8a add full docs to ext/json-parser (no upgrade available) 2016-06-01 18:51:22 -07:00
Adam Ierymenko 597dee40fd upgrade ext/http-parser 2016-06-01 18:49:36 -07:00
Adam Ierymenko 2c995f1f91 IPv6 links are unfortunately not "reliable." Many IPv6 gateways, while not
implementing NAT, do implement stateful firewalling with absurdly short
timeouts (<60s). Keepalives are still required in IPv6.

Network engineers continue to mindlessly carry forward cruft and baggage
from IPv4 to IPv6.
2016-05-31 10:30:00 -07:00
Adam Ierymenko 68d950c344 Hack in zerotier-idtool to allow generation of vanity addresses. 2016-05-26 09:26:03 -07:00
Adam Ierymenko 0bcc7d46a3 Disable debug code. 2016-05-16 18:39:34 -07:00
Adam Ierymenko 93b673043c Fix new binary meta-data deserialization and add some debug code (will disable later). 2016-05-16 18:37:37 -07:00
Grant Limberg de1b745988 comment out a few TRACE messages that don't compile 2016-05-14 13:29:31 -07:00
Grant Limberg efdbd6326f compiling with C++11 requires a space between string literals 2016-05-14 13:25:40 -07:00
Adam Ierymenko 25c3d3a452 cleanup 2016-05-11 13:24:55 -07:00
Adam Ierymenko 548730660b Ready to test whole new netconf refactor. 2016-05-11 10:19:14 -07:00
Adam Ierymenko 7ee3743c3d Refactor controller to send both old and new format netconf. 2016-05-11 08:49:15 -07:00
Adam Ierymenko 37b89b3944 Add TCP relative sequence number criterion for documentation/posterity. 2016-05-09 17:00:17 -07:00
Adam Ierymenko 8b9519f0af Simplify a bunch of NetworkConfig stuff by eliminating accessors, also makes network controller easier to refactor. 2016-05-06 16:13:11 -07:00
Adam Ierymenko 529515d1d1 Changes to how new-style binary network configs are detected, and a new-style binary serialized meta-data representation. 2016-05-06 13:29:10 -07:00
Adam Ierymenko 69d0562e2c docs 2016-05-06 11:41:11 -07:00
Adam Ierymenko 7913fa7bbd Dead code removal. 2016-05-06 11:13:34 -07:00
Adam Ierymenko b543868351 Missing deserialize stuff. 2016-05-06 11:00:19 -07:00
Adam Ierymenko 0f17077b3d Merge gateways and routes in netconf since they are the same thing. 2016-05-06 10:57:53 -07:00
Adam Ierymenko 9da8bf37d7 docs 2016-04-28 21:31:10 +02:00
Adam Ierymenko e5cc487b95 Beginning of security doc and kill some obsolete defines in main include file. 2016-04-28 14:58:16 +02:00
Adam Ierymenko 726136beda Ifdef fix. 2016-04-27 09:30:34 +02:00
Adam Ierymenko 59eb09d063 Deserialize new style netconf. 2016-04-26 17:20:31 -07:00
Adam Ierymenko b9dba97fdb Bunch more refactoring for an even more compact NetworkConfig representation, especially rules. 2016-04-26 17:11:25 -07:00
Adam Ierymenko 25a5275921 . 2016-04-26 08:53:49 -07:00
Adam Ierymenko e731fc1a3a Replace two bools in NetworkConfig with a flags field. 2016-04-26 08:40:26 -07:00
Adam Ierymenko 90e1262a8b More refactoring to remove old Dictionary dependencies. 2016-04-26 08:20:03 -07:00
Adam Ierymenko 246f86dad3 Define an "anchor" as a statically defined device that serves as a network lookup point. 2016-04-26 07:56:41 -07:00
Adam Ierymenko d736074301 Refactor rules table in-memory structure in new NetworkConfig to permit far more rules with better space efficiency. 2016-04-22 15:40:53 -07:00
Adam Ierymenko 368efaa2ba Kill some old debug code. 2016-04-19 12:55:48 -07:00
Adam Ierymenko 2f18a92e20 Cleanup in numerous places, reduce network chattiness around MULTICAST_LIKE, and fix a "how was that working" latent bug causing some control traffic to take the scenic route. 2016-04-19 12:09:35 -07:00
Adam Ierymenko affbca74b4 Clean up Linux makefile and remove doc target from default since it requires rst2man. Add doc target to official instead. 2016-04-19 09:35:32 -07:00
Adam Ierymenko 4c455876f9 Revise peer path weighting to always prioritize cluster-optimal paths. 2016-04-19 09:22:51 -07:00
Adam Ierymenko cecfa99b7b (1) cluster members send a flag indicating that a PUSH_DIRECT_PATHS is a cluster redirect, (2) 1.1.5 uses this to avoid a bug (this bug does not exist in 1.1.4) 2016-04-18 16:44:23 -07:00
Adam Ierymenko b3cac538cc Store lat/lon too for testing and future display use. 2016-04-18 15:48:33 -07:00
Adam Ierymenko 587b1e05d1 Replace cluster-geo subprocess with in-memory loaded CSV of GeoIP data. This is faster, cheaper, more reliable. We use https://db-ip.com/ but others would work too. 2016-04-18 11:33:54 -07:00
Adam Ierymenko 02c3727ccd . 2016-04-18 10:21:38 -07:00
Adam Ierymenko af471af8ef Shrink NetworkConfig slightly. 2016-04-12 13:32:41 -07:00
Adam Ierymenko e28838805f Brace fix... 2016-04-12 13:17:16 -07:00
Adam Ierymenko 8a9762331f Fix one more old NetworkConfig bit of code. 2016-04-12 12:54:14 -07:00
Adam Ierymenko 31db6f8f36 NetworkConfig refactor almost done. 2016-04-12 12:49:46 -07:00
Adam Ierymenko ad1e83d8b9 Refactor IncomingPacket for new NetworkConfig 2016-04-12 12:32:33 -07:00
Adam Ierymenko bbd9915056 Refactor Node for new NetworkConfig 2016-04-12 12:26:10 -07:00
Adam Ierymenko 51fecc0be9 Refactor Network for new NetworkConfig. 2016-04-12 12:16:29 -07:00
Adam Ierymenko 6f854c8391 NetworkConfig refactor part 1 2016-04-12 12:11:34 -07:00
Adam Ierymenko 9b8444fff1 Merge of bignose/manual-pages (Linux man pages) 2016-04-07 12:28:43 -07:00
Adam Ierymenko 43e317f0b7 Authorship stuff. 2016-04-07 12:24:15 -07:00
Adam Ierymenko 0e40181d8f Merge branch 'license-clarification' into dev 2016-04-07 12:18:46 -07:00
Adam Ierymenko 63b62ebf4c Boost local interface check interval a bit to speed direct link provisioning on startup. 2016-04-07 12:13:18 -07:00
Adam Ierymenko 569de22481 Make port mapper names even more unique, and trial bind before binding TCP now which should work on Linux and others. 2016-04-07 09:51:14 -07:00
Adam Ierymenko 9085a04b16 Merge branch 'dev' of http://git.int.zerotier.com:/zerotier/ZeroTierOne into dev 2016-04-07 16:41:28 +00:00
Adam Ierymenko c7df61a3c3 dev branch now works again on Linux 2016-04-07 16:41:07 +00:00
Adam Ierymenko c278f05181 RoutingTable build fixes. 2016-04-06 17:29:38 -07:00
Adam Ierymenko 61a9c27af0 Consolidate routing table code. 2016-04-06 17:14:05 -07:00
Adam Ierymenko e9b2613d5f Put routing table code back in osdep/ 2016-04-06 16:57:37 -07:00
Adam Ierymenko 24469a7f43 . 2016-04-06 16:47:11 -07:00
Adam Ierymenko 56096be8b6 Tweak new RX queue algorithm to "expire" old entries to prevent always needing to traverse the whole queue array. 2016-04-06 16:28:40 -07:00
Adam Ierymenko 8ef78e7e7d Preserve add local interface address add order and send in that order since this is a priority. 2016-04-06 11:50:00 -07:00
Adam Ierymenko 504738b183 Binder for Windows, and use Binder to get local interface addresses to advertise. 2016-04-05 15:53:19 -07:00
Adam Ierymenko 32cd2a02c9 OneService now binds all ports to specific local interfaces instead of wildcard and rebinds on changes. (default route) 2016-04-05 15:44:08 -07:00
Adam Ierymenko 4a109658ab More refactoring and prep for explicit interface bindings (for default route support). 2016-04-05 11:59:46 -07:00
Adam Ierymenko 52d9612301 Reduce symmetric prediction fuzz just a bit. 2016-04-05 10:49:14 -07:00
Adam Ierymenko d8b89b0c86 Fix Cluster to send from a designated endpoint address instead of wildcard. 2016-04-05 10:47:13 -07:00
Adam Ierymenko e0ad854d19 Beginning of local binding manager for default gateway support. 2016-04-04 18:46:41 -07:00
Adam Ierymenko 0e26917c72 Tweak metric and clean out attic a bit. 2016-04-01 11:07:44 -07:00
Adam Ierymenko 3df60995e1 nit pick... might this matter? 2016-03-30 16:49:21 -07:00
Adam Ierymenko 1a5e7cb0cb More tweaks to OS determination stuff. 2016-03-28 12:26:49 -07:00
Adam Ierymenko 8035afae87 Try to define ZT_NO_TYPE_PUNNING on iOS in case it wasn't. 2016-03-28 12:22:05 -07:00
Adam Ierymenko 284e5d83b5 Fix some broken TRACEs and a tiny reorder in a few ifs. 2016-03-28 12:15:24 -07:00
Adam Ierymenko 2b3e1d5c10 Ignore IP assignment pool ranges that begin with 0.0.0.0 or that contain no IPs. 2016-03-24 13:34:01 -07:00
Adam Ierymenko 2c328d61ad Do not auto-assign IP addresses on bridges. IPs can still be assigned manually. 2016-03-24 13:32:01 -07:00
Adam Ierymenko 76f9b4c582 A few other little formatting things. 2016-03-18 15:06:45 -07:00
Adam Ierymenko c589bc4c57 Indentation 2016-03-18 14:32:48 -07:00
Adam Ierymenko d6a1868d0a Refactor incoming packet (rxQueue/fragmentQueue) to eliminate variable length queues and merge queues. This is both faster and saves memory. 2016-03-18 14:16:07 -07:00
Adam Ierymenko 9f31cbd8b8 Make /network/???/active return more info. 2016-03-17 13:05:51 -07:00
Ben Finney c0262d8f76 Add “doc” to the dependencies for the “all” build target. 2016-03-04 17:01:31 +11:00
Ben Finney 92702615a7 Add an overall “doc” build target. 2016-03-04 17:01:14 +11:00
Ben Finney c9d3f3ab96 Correct license grant to match “GPL v3 or later” grant in source. 2016-03-04 16:45:15 +11:00
Ben Finney 72797c25d5 Update copyright notice. 2016-03-04 16:44:23 +11:00
Ben Finney ea6ce47345 Refactor the program name to a pre-processor directive. 2016-03-04 16:42:30 +11:00
Ben Finney 10855b451d Refactor the copyright notice text to a pre-processor directive. 2016-03-04 16:40:09 +11:00
Ben Finney 3265b3594b Refactor the license grant text to a pre-processor directive. 2016-03-04 16:37:36 +11:00
Ben Finney cafc46a8e9 Add Makefile module for building documentation. 2016-03-04 16:06:17 +11:00
Ben Finney 5993b178c5 Ignore generated man page files. 2016-03-04 16:05:55 +11:00
Ben Finney 24e286b5ec Add a stub for an encoding declaration on a man page. 2016-03-04 16:04:57 +11:00
Ben Finney c63de27633 Add references to other tools for ‘zerotier-one’. 2016-03-04 15:41:06 +11:00
Ben Finney a84a256df4 Add incomplete man pages for ‘zerotier-idtool’ and ‘zerotier-cli’. 2016-03-04 15:40:08 +11:00
Ben Finney 88dfa860f4 Document how the home directory is used, and its default value. 2016-03-04 15:08:17 +11:00
Ben Finney 83bc5d95aa Document remaining options explicitly. 2016-03-04 14:57:10 +11:00
Ben Finney 09c61d5cb1 More explicit specification of how to use ‘-i’ and ‘-q’. 2016-03-04 14:53:50 +11:00
Ben Finney 71c84aee60 Add “see also” section referring to ZeroTier documentation online. 2016-03-04 11:36:19 +11:00
Ben Finney cee09b0d2e Refine description of ZeroTier One. 2016-03-04 11:36:04 +11:00
Ben Finney fdb8ea93ef Add a reStructuredText document for a ‘zerotier-one(8)’ man page. 2016-03-04 11:35:16 +11:00
Adam Ierymenko 60ab565185 Fix cluster-geo code to cache IPv6 by first 64 bits to prevent cache fillup due to IPv6 privacy extensions. 2016-03-03 15:33:38 -08:00
Adam Ierymenko 1fe251d0a0 stupid bug is stupid 2016-03-03 14:50:47 -08:00
Adam Ierymenko ff931e53b5 more makefile stuff 2016-03-03 14:31:43 -08:00
Adam Ierymenko ef376a7919 Linux make clean fix. 2016-03-03 14:24:52 -08:00
Adam Ierymenko 09fc9e4d0c indent fix 2016-03-03 14:21:13 -08:00
Adam Ierymenko fe3a84a422 Fix problems with previous commit. 2016-03-03 14:15:09 -08:00
Adam Ierymenko ba56a5b9d1 Another NAT-t improvement:
Many NATs revert to symmetric behavior from friendlier modes if they cannot
preserve ports. This can occur if there is, for example, more than one ZT
device behind the NAT using port 9993.

Others (Airport Extreme?) seem to have bugs in which they completely freak
out if more than one device tries to do a lot of mappings using the same
internal local port.

Mostly to fix the latter case and somewhat to fix the former, we introduce
a secondary port. ZeroTier now binds 9993 (or whatever port you specify)
plus another port computed deterministically from your ZeroTier address.
This port is used for new links 1/4 of the time.

This mostly addresses the second problem above and partly helps to address
the first.

If uPnP/NAT-PMP is enabled we also still open a tertiary port because some
routers freak out if NAT-t is attempted using the same port as uPnP.

All of this is IPv4 only of course. IPv6 is sane.
2016-03-03 13:52:27 -08:00
Adam Ierymenko a27d8b2910 Windows cleanup. 2016-03-02 19:20:04 -08:00
Adam Ierymenko b6f6ed35fc More Windows tweaks and a compile fix. 2016-03-02 19:06:29 -08:00
Adam Ierymenko d3cb063d13 Tweaks to WindowsEthernetTap to attempt to address GitHub issue #308 and/or GitHub issue #277 -- we can't reproduce yet but I found one area where a spin was possible under certain failure conditions. Maybe. 2016-03-02 18:37:24 -08:00
Ben Finney b9125e4256 Document myself as a contributor. 2016-03-02 10:38:30 +11:00
Adam Ierymenko 0aae86be2e Merge branch 'dev' of https://github.com/krisek/ZeroTierOne into dev 2016-03-01 12:29:29 -08:00
Adam Ierymenko d9fa07399e Fix GitHub issue #311 2016-03-01 09:49:33 -08:00
Ben Finney d570adf021 State grant of license in each third-party component. 2016-02-29 18:11:54 +11:00
Ben Finney dcb91c043f State which exact files constitute third-party works. 2016-02-29 18:04:20 +11:00
Ben Finney f613930dee Explicitly mark home page URLs of third-party code. 2016-02-29 18:03:16 +11:00
Ben Finney 667048310d Remove text that paraphrases GPLv3 conditions. 2016-02-29 17:44:47 +11:00
Ben Finney 642aa3313d Explicitly grant GPLv3-or-later terms to the overall code base. 2016-02-29 17:44:47 +11:00
Ben Finney f6e98df8da Refer directly to the accompanying GPL-3 license document. 2016-02-29 17:44:47 +11:00
Ben Finney d37e44225f Add explicit copyright statement in same file as license grant. 2016-02-29 17:44:47 +11:00
Ben Finney 5c172d1a15 Rename file that is not a license text. 2016-02-29 17:44:10 +11:00
Ben Finney 0bf2060a7d Add verbatim text of GNU General Public License version 2. 2016-02-29 15:16:19 +11:00
Ben Finney 22883b3eeb Add verbatim text of GNU General Public License version 3. 2016-02-29 15:13:37 +11:00
Kristof Imre Szabo 6d1dc47368 Typo fix. 2016-02-28 17:06:46 +01:00
Kristof Imre Szabo f8d05eb625 Spec description rephrased. 2016-02-28 17:05:43 +01:00
Kristof Imre Szabo 45c233c0e7 Formatting change 2016-02-28 00:04:18 +01:00
Kristof Imre Szabo b836228465 Formatting change 2016-02-28 00:02:48 +01:00
Kristof Imre Szabo 8118630861 Formatting change 2016-02-28 00:00:55 +01:00
Kristof Imre Szabo bf3e31ece7 Initial commit of the standard zerotier RPM specification 2016-02-27 23:55:14 +01:00
Adam Ierymenko f217ce7ff7 Upgrade http-parser. 2016-02-25 18:13:42 -08:00
Adam Ierymenko 039790cf26 Upgrade LZ4 to hopefully fix wacky sporadic crash when built with g++ 5.3.1 on Debian/testing. 2016-02-25 15:39:15 -08:00
Adam Ierymenko e5f82f5457 cleanup 2016-02-25 10:08:30 -08:00
Adam Ierymenko a5e4e3fcac Remove ui/ on Linux uninstall. 2016-02-24 17:24:36 -08:00
Adam Ierymenko 3fe60615df Make installers silent when run inside packages. 2016-02-24 15:23:49 -08:00
Adam Ierymenko 7b5c1696eb Fix a CIRCUIT_TEST bug in forwarding of tests along hop paths on private networks. Unfortunately this means full circuit testing for private nets will need an upgrade. :( 2016-02-23 14:56:51 -08:00
Adam Ierymenko c7c61b4ac0 Fix checking of path address validity. 2016-02-22 16:01:35 -08:00
Adam Ierymenko 92f24d1988 Make maximum size of a circuit test structure sane. 2016-02-22 15:54:18 -08:00
Adam Ierymenko 9b59bcd995 Clean controller circuit test memory. 2016-02-22 15:48:27 -08:00
Adam Ierymenko 43fff1a87e Deprecate reporting of local clock in circuit tests since a small number of users might have security problems with this. 2016-02-22 12:59:26 -08:00
Adam Ierymenko 2aa7138373 Reduce direct ping delay back to 1m and make SelfAwareness aware of local received-on address to eliminate false symmetric classification. 2016-02-22 09:47:50 -08:00
Adam Ierymenko 69a438d64d Small tweak to active threshold. 2016-02-19 09:10:31 -08:00
Adam Ierymenko 772551c45d Try +1 and +2 existing surfaces for symmetric NATs. 2016-02-11 10:39:39 -08:00
Adam Ierymenko 0c951b6e56 More tweaks to new symmetric NAT buster, and stop using old iterative method since this supersedes it. 2016-02-10 18:41:39 -08:00
Adam Ierymenko eadafd8de7 Little fix to NAT-t alg 2016-02-10 17:51:42 -08:00
Adam Ierymenko f9230eb970 Widen max delta for TS/revision just a bit more for now. 2016-02-10 16:18:45 -08:00
Adam Ierymenko 82348e1537 Temporarily blacklist he.net IPv6 tunnel addresses for paths: these usually have a very low MTU which causes packet loss and other issues. 2016-02-10 11:06:26 -08:00
Adam Ierymenko 10bb9919f1 Tweak certificate of membership revision/time tolerance to eliminate boundary packet loss issues occasionally seen in the wild. 2016-02-10 09:32:42 -08:00
Adam Ierymenko 4769dacf61 Tweak needsOurMembershipCertificate timing to resolve a possible source of occasional dropped packets. 2016-02-09 16:54:47 -08:00
Adam Ierymenko 63ec7e58d4 Make activity no longer a function of ping frequency, since this causes compatibility bugs when the latter was modified due to timer interactions with other versions. 2016-02-08 10:03:01 -08:00
Adam Ierymenko a963810e02 Tweak a few cluster params for higher perf / lower initial setup latency. 2016-02-08 09:57:46 -08:00
Adam Ierymenko 69b1da2e1d return 200 instead of 404 when test is fetched 2016-02-04 16:27:25 -08:00
Adam Ierymenko dc3d899e70 Return test ID when we post a test. 2016-02-04 16:09:26 -08:00
Adam Ierymenko 78c1d9006a flood protection fix 2016-02-04 14:39:43 -08:00
Adam Ierymenko 5dad73647d Lengthen backup period again 2016-02-04 14:22:54 -08:00
Adam Ierymenko 13b39a0c3e SQLite perf tuning 2016-02-04 14:03:37 -08:00
Adam Ierymenko 90801a94d3 Track client version and tell whether active nodes support circuit test. 2016-02-04 13:38:42 -08:00
Adam Ierymenko fab6f4450d /active subpath off networks 2016-02-04 12:17:55 -08:00
Adam Ierymenko 2e04dc03f2 Logging to NodeHistory, SQL queries. 2016-02-03 18:10:56 -08:00
Adam Ierymenko f8eb6b0067 Add NodeHistory table on sqlite controller. 2016-02-03 13:56:35 -08:00
Adam Ierymenko 7a63fdc447 Fix for GitHub issue #298 and hopefully #297 2016-02-01 14:41:54 -08:00
Adam Ierymenko 4655a59912 typo 2016-01-28 17:59:31 -08:00
Adam Ierymenko c0668dcdf2 Merge branch 'edge' into dev 2016-01-26 14:20:25 -08:00
Adam Ierymenko 9cb4bbe2b8 Save test results for circuit tests in memory and then cancel the test and send the results when the test is queried later. This way you can POST a test and then come GET the result at the appointed time. 2016-01-26 12:42:44 -08:00
Joseph Henry 95d28494f6 Mac OSX Port - Lightly tested 2016-01-25 12:55:29 -08:00
Grant Limberg 67f678d60a Merge branch 'master' into dev 2016-01-22 18:07:20 -08:00
Grant Limberg 3993dfa2a5 Fix JNI for API changes in 1.1.4 2016-01-22 18:06:58 -08:00
Adam Ierymenko 935f00ad4c Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2016-01-21 16:03:14 -08:00
Adam Ierymenko bafdb54752 New dev version: 1.1.5 2016-01-21 16:02:16 -08:00
Adam Ierymenko 7526ed705c Check for /dev/tun as well as /dev/net/tun since some Linux devices put it there. 2016-01-21 16:01:24 -08:00
Joseph Henry bccd60125b Added python, python3, darkhttpd unit tests 2016-01-21 15:52:54 -08:00
Joseph Henry 7127d2b811 Updated unit tests + README 2016-01-21 15:10:26 -08:00
Adam Ierymenko 9cc2733ed8 VERSION 1.1.4: Improved path detection, improved anti-recursion code, and Network Containers BETA
ZeroTier One version 1.1.4 has several improvements to path stability and
path learning logic. It also contains the BETA version of Network Containers!

See netcon/README.md and https://www.zerotier.com/product-netcon.shtml for more
information.

Improvements in 1.1.4:

 - Paths are now confirmed more aggressively on inactivity. This version can
   usually detect a dead direct path in under 10 seconds vs 1-2 minutes in
   previous versions.
 - Logic to prevent recursion has been overhauled. The old versions had code
   that explicitly checked packet contents (AntiRecursion.hpp). This is now
   gone in favor of a function that checks IP addresses of ZeroTier devices
   when paths are learned or probed. This is both more efficient and less
   prone to edge case failures. Testing in several complex environments has
   shown that this eliminates a few edge cases where inappropriate paths would
   be used.
2016-01-20 18:10:40 -08:00
Adam Ierymenko 3b10fd7557 Windows build fixes. 2016-01-20 18:06:20 -08:00
Adam Ierymenko f782797dc7 readme 2016-01-20 17:44:17 -08:00
Adam Ierymenko 227b8bfbf6 Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2016-01-20 16:59:59 -08:00
Adam Ierymenko 385770dcc8 1.1.4 bump 2016-01-20 16:59:54 -08:00
Janjaap Bos 4f6ca14d4f typo 2016-01-20 16:52:46 -08:00
Janjaap Bos c3fc5340b6 Added check for identiy
Needed if you just copy & paste the whole block.
2016-01-20 16:43:37 -08:00
Adam Ierymenko 4f30b06930 Merge branch 'dev' into edge 2016-01-20 16:28:14 -08:00
Joseph Henry 398e0b7c63 Removed debug line 2016-01-20 15:04:02 -08:00
Joseph Henry b7b014298b Bad connection reference fix + RX lock fix 2016-01-20 14:43:49 -08:00
Joseph Henry bcaf42e075 Transfer speed increate + stability fixes 2016-01-20 13:38:14 -08:00
Joseph Henry 357cb92f2e Stability fix + introduction of connection probation 2016-01-18 23:41:28 -08:00
Joseph Henry 31ed86740c Added some safety + unregister callbacks on close 2016-01-18 16:04:29 -08:00
Joseph Henry f2cc144811 Fixed nc_sent possible bad ptr on close issue 2016-01-18 12:26:40 -08:00
Joseph Henry 1783867f96 Print path for user. Removed unused stub Phy methods 2016-01-17 15:13:32 -08:00
Joseph Henry a73638b214 Fixed memory leak 2016-01-17 14:32:34 -08:00
Grant Limberg bd1884e48f yay more icons 2016-01-15 18:39:16 -08:00
Grant Limberg 5cd20c0009 Adding app icons for iOS 2016-01-15 18:22:53 -08:00
Joseph Henry 58ebfdffcb Debugs off by default 2016-01-15 13:03:37 -08:00
Joseph Henry 1e2c434ae8 nc_recved() connection closure change 2016-01-15 13:02:48 -08:00
Joseph Henry 7107297c25 Merge branch 'edge' of http://10.6.6.2/zerotier/zerotierone into edge 2016-01-15 11:19:25 -08:00
Joseph Henry 35fb602dff Fixed pcb->state == CLOSE_WAIT bug 2016-01-15 11:18:26 -08:00
Adam Ierymenko 8af3d35234 Merge branch 'dev' into edge 2016-01-15 11:18:23 -08:00
Joseph Henry 323d40a560 Small formatting changes 2016-01-15 10:27:27 -08:00
Joseph Henry 321bca4bf7 Adjusted formatting/conventions to conform to rest of ZT codebase 2016-01-15 10:09:31 -08:00
Joseph Henry 7cb08630d0 Fixed RX race condition 2016-01-14 18:59:08 -08:00
Joseph Henry 45f0737a00 Naming convention update 2016-01-14 14:15:50 -08:00
Joseph Henry 6cf478c1b2 RX buffer update 2016-01-14 14:03:03 -08:00
Joseph Henry f52a82d9f2 Updated RX buffer code 2016-01-14 13:23:01 -08:00
Grant Limberg 6dac0c8c4f C doesn't support default arguments 2016-01-13 17:47:34 -08:00
Joseph Henry 5e30eabd30 Updated getsockopt/setsockopt, removed unused code 2016-01-13 15:52:15 -08:00
Joseph Henry 7bba867ce8 Fixed double-close bug 2016-01-13 13:55:11 -08:00
Adam Ierymenko e8e6a4702b Merge branch 'dev' into edge 2016-01-13 13:15:47 -08:00
Joseph Henry c3e2cb9b8e Modified PCB/state management logic 2016-01-13 12:19:48 -08:00
Adam Ierymenko 2e5caa335a Old SF root is dead. Now we are just on Alice and Bob. (world update for 1.1.4) 2016-01-13 10:18:41 -08:00
Joseph Henry bdabe40c65 Updated error reporting for sock_fd_read() 2016-01-12 14:25:30 -08:00
Adam Ierymenko 7991a7c50a Merge branch 'dev' into edge 2016-01-12 14:05:40 -08:00
Adam Ierymenko 4e4fd51117 boring doc stuff 2016-01-12 14:04:55 -08:00
Joseph Henry e91322bd10 README update and example server port change 2016-01-12 14:04:55 -08:00
Joseph Henry 23cdb3aed5 Removed ztnc network config file 2016-01-12 13:58:15 -08:00
Joseph Henry bd3d9ee356 Removed terminology changes 2016-01-12 13:55:46 -08:00
Adam Ierymenko 76f1ab33f0 Make clean rm .depend 2016-01-12 13:44:59 -08:00
Adam Ierymenko 61fd8463f8 Merge branch 'dev' into edge 2016-01-12 13:19:53 -08:00
Adam Ierymenko 3883ac08c7 Docs and cleanup. 2016-01-12 13:17:30 -08:00
Joseph Henry dd233fdb8d Updated terminology. No functional change 2016-01-12 13:00:31 -08:00
Joseph Henry 18aea2d3d3 Removed unused code 2016-01-12 12:56:51 -08:00
Joseph Henry 74e22368b5 Fixed sketchy memcpy logic, also added checks for service RPC ACK 2016-01-12 12:42:46 -08:00
Adam Ierymenko d03a63e055 Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2016-01-12 12:25:19 -08:00
Adam Ierymenko 93ab8d46b9 Merge branch 'dev' into edge 2016-01-12 12:25:15 -08:00
Adam Ierymenko 740eb6ebc4 Simplify Peer locking to eliminate deadlock with new path recursion check code (and also probably improve performance). 2016-01-12 12:12:25 -08:00
Adam Ierymenko d6f0f1a82a Use network user ptr in lookup for Ethernet frame handling to eliminate map lookup. 2016-01-12 11:34:22 -08:00
Adam Ierymenko 83ef98a9dc Add a network-associated user ptr in API. 2016-01-12 11:04:35 -08:00
Adam Ierymenko 3edfbfec93 Merge branch 'master' into dev 2016-01-12 09:50:19 -08:00
Adam Ierymenko 68c004ef68 Merge pull request #291 from JackyRen/patch-1
Update controller README.md
2016-01-12 09:49:54 -08:00
Joseph Henry e2ae9165c6 RPC update 2016-01-12 09:46:49 -08:00
Adam Ierymenko 704205c5f7 Dead code removal. 2016-01-12 09:33:14 -08:00
Ren Jie 21656ba015 Update controller README.md
Sync make parameter with code.
2016-01-12 22:51:08 +08:00
Adam Ierymenko bbcc3304a0 Check shouldUsePathForZeroTierTraffic in legacy beacon responder. 2016-01-11 15:57:58 -08:00
Adam Ierymenko c6571073fe Get rid of constructor/destructor in libzerotierintercept, and simplify a few things. 2016-01-11 15:27:22 -08:00
Adam Ierymenko ba9fcb31d0 Merge branch 'dev' into edge 2016-01-11 14:30:24 -08:00
Joseph Henry 78c0f0a443 RPC detection fix 2016-01-11 13:23:43 -08:00
Joseph Henry 7656e6b9f8 Transfer tune-up 2016-01-11 11:37:04 -08:00
Joseph Henry 39d79f34ab Added RPC ACK 2016-01-11 10:35:02 -08:00
Adam Ierymenko b3e3d4cacc Instead of using binary packet comparison, add a callback to the API to explicitly check whether paths should be used. Check in with this callback (if present) when learning new paths or sending initial packets. 2016-01-11 10:17:44 -08:00
Joseph Henry 3e65ecb93d Stateless RPC rework 2016-01-11 10:12:59 -08:00
Adam Ierymenko ba2a89c760 docs 2016-01-11 09:13:41 -08:00
Adam Ierymenko eea634a432 Refactor to eliminate copypasta. 2016-01-11 09:11:35 -08:00
Adam Ierymenko ab19e19f00 Fix a bug that we visually found in Windows code -- it was not advertising uPnP addresses?!? 2016-01-11 09:09:24 -08:00
Adam Ierymenko 1023ef23b7 Remove somewhat ugly and costly anti-recursion hack -- we will switch to more explicit methods. 2016-01-11 09:06:10 -08:00
Adam Ierymenko a56fbc1929 Close another potential anti-recursion loophole. 2016-01-06 15:35:27 -08:00
Adam Ierymenko 47ce52228b Roots should probably not do this since it would likely be a waste of packets. 2016-01-06 12:54:51 -08:00
Adam Ierymenko ff9317365a Merge branch 'dev' into edge 2016-01-06 11:38:11 -08:00
Adam Ierymenko 0a3ef38cad Put old test code in attic. 2016-01-06 11:06:47 -08:00
Adam Ierymenko 9aee72099e AntiRecursion cleanup and some other minor things. 2016-01-06 10:59:39 -08:00
Adam Ierymenko 05b2c0743f Tighten up dead path detection. Should now auto-detect dead paths in less than 10 seconds at a very small cost in ECHO requests (or HELLOs for older peers). GitHib issue #272 2016-01-06 10:00:03 -08:00
Adam Ierymenko 4d94ae77b4 simplify if 2016-01-05 16:48:35 -08:00
Adam Ierymenko d8143a5e18 Implement first pass on rapid dead path detection, and increment version to 1.1.3 (dev) 2016-01-05 16:41:54 -08:00
Adam Ierymenko cba739fd6b more dead code 2016-01-05 14:46:26 -08:00
Adam Ierymenko fb5237d5b6 Outline dead path detection mechanism. 2016-01-05 14:42:56 -08:00
Adam Ierymenko 258f95b2cd dead code removal 2016-01-05 14:19:16 -08:00
Janjaap Bos b8059d5c87 typo 2015-12-23 22:54:36 +01:00
Adam Ierymenko 66894eb473 Merge branch 'dev' into edge 2015-12-21 16:56:13 -08:00
Adam Ierymenko 61becbb7e5 . 2015-12-21 16:56:11 -08:00
Adam Ierymenko 42e453872c VERSION 1.1.2: bug fixes and NAT-PMP support
ZeroTier One version 1.1.2 is mostly a bug fix release, but also includes support
for NAT-PMP as a method of mapping external ports from behind supported routers.

Bugs fixed include:

 - Refactored path selection code to eliminate a change that might have introduced
   a reliability regression from earlier versions.
 - Reworked UPnP code for improved reliability and also added NAT-PMP support.
 - Fixed a crash on network preferred relays. (Not exploitable or security critical
   since only network controllers can send that config option and there was no
   buffer overflow or other exploitable issue.)
 - Fix GUI problem on OSX where window could be larger than screen on some Macbooks.
 - Fix a potential rate limit problem on PUSH_DIRECT_PATHS that could negatively
   impact same-network connectivity.
 - Update zerotier-cli to show preferred vs. active paths and hide inactive ones.
 - Fix an issue on shutdown with thread delete order and thread synchronization.
2015-12-21 16:48:33 -08:00
Adam Ierymenko 2f42a7c010 Windows 1.1.2 build. 2015-12-21 16:36:56 -08:00
Adam Ierymenko 436c1fac1d Selectively move over changes from "edge" to "dev" excluding netcon. 2015-12-21 16:15:39 -08:00
Adam Ierymenko 16bc9533ed Fix a problem that made valgrind complain on shutdown (not otherwise an issue). 2015-12-21 15:23:14 -08:00
Adam Ierymenko 63a51e2890 Fix a small potential uninitialized variable issue. 2015-12-21 14:55:11 -08:00
Adam Ierymenko 23eaafc4eb Remove stray file that is instead found in netcon. 2015-12-21 14:01:48 -08:00
Adam Ierymenko 536b7000bc Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2015-12-21 13:15:09 -08:00
Adam Ierymenko 24cc0904fa 1.1.2 Windows build fixes, tweaks, etc. 2015-12-21 13:14:48 -08:00
Janjaap Bos 5a65463b92 typo 2015-12-21 22:11:39 +01:00
Janjaap Bos c8056452b8 fix / workaround for ubuntu
Otherwise, if started with -d as daemon, the netcon service dies after
intercept listen registers.
2015-12-21 21:20:22 +01:00
Janjaap Bos 64e273e9c0 updated netcon readme 2015-12-21 19:49:22 +01:00
Joseph Henry 6f62d6bb34 Removed straggler debug prints 2015-12-21 07:36:44 -08:00
Joseph Henry d430457f1e Updated readme, removed test network keys 2015-12-21 07:26:45 -08:00
Joseph Henry 4267cc138e Readme changes, turned off debug 2015-12-21 07:17:37 -08:00
Joseph Henry de2ba8d0f7 Fixed typo 2015-12-21 05:36:27 -08:00
Joseph Henry c488fa8461 Tightening of RPC code 2015-12-21 05:03:26 -08:00
Joseph Henry 608e059b18 single updated test file 2015-12-18 15:19:34 -08:00
Joseph Henry 81203b20b8 Merge branch 'edge' of http://10.6.6.2/zerotier/zerotierone into edge 2015-12-18 15:09:18 -08:00
Joseph Henry 91bc32fe51 Re-added keys for testing 2015-12-18 15:09:08 -08:00
Adam Ierymenko d3dacf5c2a Tiny bit of dead code cleanup. 2015-12-18 14:51:24 -08:00
Adam Ierymenko 13036a1085 . 2015-12-18 14:30:47 -08:00
Adam Ierymenko 942ab6fd95 . 2015-12-18 14:29:23 -08:00
Adam Ierymenko fd9b2e931f Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2015-12-18 14:26:37 -08:00
Adam Ierymenko 6de67e828d Fix accept4() semantics. 2015-12-18 14:26:31 -08:00
Joseph Henry 2d9f1f7857 Added install script for debugging with strace 2015-12-18 13:13:47 -08:00
Joseph Henry fde8af9483 getsockopt() tweak 2015-12-18 11:37:11 -08:00
Joseph Henry c22c0a20f6 Merge branch 'edge' of http://10.6.6.2/zerotier/zerotierone into edge 2015-12-18 10:31:24 -08:00
Joseph Henry 9063209124 getsockname() fix 2015-12-18 10:31:11 -08:00
Adam Ierymenko 61dc13a6e1 Cache query in progress to reduce redundant GeoIP2 queries. 2015-12-18 09:38:34 -08:00
Joseph Henry e3eea6fcbd RPC Reliability improvements and partial getsockname() fix 2015-12-16 18:05:47 -08:00
Adam Ierymenko 7d001458cb Update World to drop an old legacy root. 2015-12-17 11:52:05 -08:00
Adam Ierymenko 823c9979c0 Erase more debug junk. 2015-12-17 11:45:55 -08:00
Adam Ierymenko 9ebcbc94e4 Remove some stray debug stuff. 2015-12-17 11:44:48 -08:00
Adam Ierymenko aa39b0dc24 Show paths as active or preferred in listpeers. 2015-12-17 11:03:39 -08:00
Adam Ierymenko 2160164e8c (1) Get rid of path sorting and just scan them, since sorting may have been a premature optimization that introduced a regression and path instability in a few edge cases, and (2) do not attempt to contact remote paths received via PUSH_DIRECT_PATH if we already have that path and it is already active (dumb, should have done this originally) 2015-12-17 10:53:07 -08:00
Adam Ierymenko 3137f43da9 Fix for getsockname() crash and other address size issues. 2015-12-16 10:30:02 -08:00
Adam Ierymenko efc2a74df1 Some final README revs. 2015-12-16 10:07:04 -08:00
Joseph Henry 9638889614 Removed docker-test keys/config for netcon network 2015-12-16 08:33:39 -08:00
Joseph Henry 0df639f8f5 readme update 2015-12-15 16:20:31 -08:00
Joseph Henry 011ce35ede Merge branch 'edge' of http://10.6.6.2/zerotier/zerotierone into edge 2015-12-15 15:57:02 -08:00
Joseph Henry a9802eff02 readme update 2015-12-15 15:56:47 -08:00
Adam Ierymenko f9837163d3 docs 2015-12-15 15:43:07 -08:00
Adam Ierymenko 6bc93d2050 Docs, and change ZT_NC_NWID to ZT_NC_NETWORK and use full path in local ZT home dir to enable multiple instances. 2015-12-15 15:35:21 -08:00
Adam Ierymenko 37a7e9e275 Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2015-12-15 15:00:05 -08:00
Adam Ierymenko 531e5f9923 . 2015-12-15 15:00:03 -08:00
Joseph Henry 617845a7da readme and makefile updates 2015-12-15 14:59:17 -08:00
Joseph Henry 9dc59eff76 Cleaned up, tests updated, readme updated 2015-12-15 14:50:54 -08:00
Adam Ierymenko a6c5596782 Patch controller to not send relays to 1.1.0 to avoid triggering 1.1.0 network preferred relays bug. 2015-12-15 10:53:15 -08:00
Adam Ierymenko 022d3857cc Fix should use ECHO check. 2015-12-15 10:37:32 -08:00
Adam Ierymenko 82aa3f59d6 Fix bug in ECHO handling (OK was invalid!), and use ECHO on newer peers for path confirmation. Also get rid of path confirmation circuit breaker since this causes issues with some peers and should be done more intelligently anyway. 2015-12-15 10:30:40 -08:00
Adam Ierymenko 04d6b03733 Make auto backups slightly less frequent. 2015-12-15 09:22:10 -08:00
Adam Ierymenko 3b22ecc80c Make hex device address in UPnP name the right length. 2015-12-14 17:35:45 -08:00
Adam Ierymenko 53fe576028 Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2015-12-14 17:04:36 -08:00
Adam Ierymenko f6dc99f345 Old NYC is dead. 2015-12-14 17:04:27 -08:00
Adam Ierymenko c0df1169ee Remove unimplemented SET_EPHEMERAL_KEY for now. 2015-12-14 14:53:43 -08:00
Joseph Henry b92884a0ad Merge branch 'edge' of http://10.6.6.2/zerotier/zerotierone into edge 2015-12-14 14:45:40 -08:00
Joseph Henry a421e31dd5 send_cmd() retrun value bugfix + minor debug changes 2015-12-14 14:45:25 -08:00
Adam Ierymenko 7b1c0c4013 Cache null results from Maxmind. 2015-12-14 14:40:00 -08:00
Joseph Henry f558b088e6 Library functions are now static, RPC return value tuning, and cleanup 2015-12-14 09:06:58 -08:00
Joseph Henry 99afc74021 FDs transferred over listen socket + other fixes 2015-12-12 01:28:59 -08:00
Joseph Henry 761bb4fdd0 Stability fix 2015-12-11 12:19:54 -08:00
Joseph Henry 663a336b83 RPC cleanup + Temporary timing fix 2015-12-10 09:24:56 -08:00
Adam Ierymenko e506fda3e4 Only set SO_NO_CHECK on IPv4 UDP sockets for now due to broken V6 stacks that drop zero checksum UDP packets. 2015-12-09 15:02:42 -08:00
Joseph Henry 42da36ba81 Fixed addrlen assignment in getsockname() 2015-12-09 12:22:08 -08:00
Joseph Henry a730c86907 getsockname() implemented 2015-12-09 12:20:38 -08:00
Adam Ierymenko b8cba90d85 . 2015-12-09 09:01:09 -08:00
Adam Ierymenko 9090edebb0 . 2015-12-08 18:17:03 -08:00
Adam Ierymenko 49d76c6311 Stub out getsockname() 2015-12-08 18:07:46 -08:00
Adam Ierymenko 5717dfe3b9 . 2015-12-08 17:45:51 -08:00
Adam Ierymenko c576cd68cb . 2015-12-08 17:44:13 -08:00
Adam Ierymenko f2078bf986 (WIP) more netcon work 2015-12-08 17:35:37 -08:00
Adam Ierymenko c2c37f3a63 Merge with fixes of netcon to edge. 2015-12-08 15:15:44 -08:00
Joseph Henry b1eb16d5fb Updated README, tests, and Intercept 2015-12-08 07:47:20 -08:00
Joseph Henry f2db82940b Nginx patch. Verified to work in fc23 and ub14 2015-12-08 05:09:12 -08:00
Joseph Henry a2837ccaa7 Fixed typo 2015-12-07 08:36:13 -08:00
Joseph Henry 284b37ccc0 Updated compatibility section 2015-12-07 08:35:26 -08:00
Joseph Henry 48d9708abe Combined make-linux.mk and make-intercept.mk's installer section 2015-12-07 06:54:13 -08:00
Joseph Henry b141026fc7 Replaced darkhttpd with httpd since darkhttpd is not currently supported and does not work 2015-12-07 06:41:20 -08:00
Joseph Henry c9bd0b3bf1 More concise unit test section 2015-12-07 06:30:54 -08:00
Joseph Henry 21b158cc48 Added unit test info to README.md 2015-12-07 06:21:40 -08:00
Joseph Henry dab13f59e5 Test updates 2015-12-07 05:37:14 -08:00
root 036bbfaff9 Modified test scripts to match new naming conventions 2015-12-07 03:21:46 -08:00
Joseph Henry afafde2571 Modified Nginx test scripts 2015-12-06 22:37:23 -08:00
Joseph Henry 1dec034f77 Added application-specific test arguments to test script 2015-12-06 17:55:48 -08:00
Adam Ierymenko 0df33485ca Merge remote-tracking branch 'origin/netcon' into edge 2015-12-04 15:41:56 -08:00
Joseph Henry 7ea53dd21b (WIP) Additional test script changes 2015-12-04 15:39:35 -08:00
Adam Ierymenko 3869d6257b Always Salsa20 encrypt the result of the system CSPRNG as a mitigation against various low-entropy bugs such as the recent Raspberry Pi one. 2015-12-04 14:50:24 -08:00
Adam Ierymenko 4e12899a8e docs 2015-12-04 14:17:33 -08:00
Adam Ierymenko cebced259e docs 2015-12-04 13:48:53 -08:00
Adam Ierymenko 425d311ce8 Merge of netcon with edge and unification of make processes. 2015-12-04 13:19:31 -08:00
Adam Ierymenko ac8918992b Merge dev. 2015-12-04 12:45:21 -08:00
Adam Ierymenko cbf8d9c45b . 2015-12-04 12:43:48 -08:00
Adam Ierymenko 905253b4f5 First draft (unfinished) of new README for netcon (original in README.orig.md). 2015-12-04 12:43:21 -08:00
Joseph Henry d9b12be697 ZT_NC_NWID patch + (WIP) test script modifications 2015-12-04 12:39:54 -08:00
Joseph Henry 2196d982c3 (fixed) nwid detection in test script 2015-12-03 18:50:20 -08:00
Joseph Henry 5c5943a00c (fixed) test script liblwip.so placement, also streamlined test logic 2015-12-03 07:11:33 -08:00
Adam Ierymenko a4cfe4cd16 Fix Linux init script to properly specify runlevels. 2015-12-01 10:19:10 -08:00
Adam Ierymenko ceaef19fb7 Fix for GitHub issue #260 -- fix for (non-exploitable) crash in network preferred relay code 2015-11-30 17:20:12 -08:00
Adam Ierymenko 944fdfb65e Low-impact sanity check against GitHub issue #247 -- will likely prevent other weird recursions too. 2015-11-30 16:44:32 -08:00
Adam Ierymenko be44b15eac Fix for GitHub issue #252 2015-11-30 16:15:23 -08:00
Adam Ierymenko d73edfea56 GitHub issue #257 2015-11-30 16:12:03 -08:00
Adam Ierymenko c21882da9c Put selftest back and turn off tracing in PortMapper. 2015-11-30 16:07:02 -08:00
Adam Ierymenko f260250580 Simplify IP assignment logic in OSXEthernetTap, also fix for GitHub issue #249 2015-11-30 15:39:34 -08:00
Adam Ierymenko 40a4ba6e39 indentation 2015-11-30 15:15:43 -08:00
Adam Ierymenko d862d2868c ... and here. 2015-11-30 14:57:28 -08:00
Adam Ierymenko 1e213b4d4c Need to close on premature abort too or resources are leaked. 2015-11-30 14:56:36 -08:00
Adam Ierymenko 3d66492828 Also add a timeout for the actual NAT-PMP port mapping step. 2015-11-30 14:17:58 -08:00
Adam Ierymenko 838fdf4d11 ifdef naming fix. 2015-11-30 13:32:30 -08:00
Adam Ierymenko 685c5e9ad1 Fix for uPnP 2015-11-30 13:25:34 -08:00
Adam Ierymenko 66a29a00ee Merge miniupnpc/libnatpmp build into main build by just adding flags, defs, and objs. 2015-11-30 13:17:43 -08:00
Adam Ierymenko 6768521330 Ton of uPnP work and adding NAT-PMP support, still testing... 2015-11-30 13:10:22 -08:00
Adam Ierymenko 6c0de526e8 Merge pull request #261 from janjaapbos/synology
Fix for cross compiling
2015-11-30 11:07:20 -08:00
Adam Ierymenko 4c812e3796 Merge pull request #259 from janjaapbos/jb-dev
Increase maximum number of paths per IP scope to 4
2015-11-30 10:53:22 -08:00
Janjaap Bos e6808c69f8 Increase maximum number of paths per IP scope to 4
Otherwise, local discovered routes are ignored.
Don't know what the best value would be. Taking 4 for now.
2015-11-30 19:48:38 +01:00
Adam Ierymenko 75637f68b3 Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev 2015-11-24 14:11:31 -08:00
Adam Ierymenko 56cb2f43fa Merge pull request #254 from bonki/fix_iproute2_ip_handling
Fix for GitHub issue #253.
2015-11-24 14:11:14 -08:00
Adrian Frühwirth 038476c412 Fix for GitHub issue #253.
Make 'ip' detection more robust (some distros don't ship the binary in /sbin or /usr/sbin).
Add error handling for cases where an ip add/remove fails.
2015-11-24 22:56:02 +01:00
Joseph Henry 201109a7a0 (fixed) make-linux.mk conflicts, updated clean logic 2015-11-23 16:02:39 -08:00
Adam Ierymenko 7e28161638 Merge dev 2015-11-30 15:17:31 -08:00
Adam Ierymenko ef4472e185 Intercept now checks ZT_NC_NWID environment variable for 16-digit network ID and does not initialize if not present. 2015-11-23 13:59:38 -08:00
Adam Ierymenko 4acb3d81f3 Rename Common to common.inc.c to indicate that this is an included C file not a primary build C file. 2015-11-23 13:25:46 -08:00
Adam Ierymenko bee44ae731 Merge Sendfd into Common.c 2015-11-23 13:24:28 -08:00
Adam Ierymenko 95106e2e30 Mare make-self-contained code cleanup. 2015-11-23 13:18:46 -08:00
Adam Ierymenko 2a6ea38718 More code cleanup, just moving some stuff into NetconEthernetTap that is not used elsewhere. 2015-11-23 13:02:50 -08:00
Adam Ierymenko d8d4cfbf01 Eliminate a few warnings and some small code reorg. 2015-11-23 12:43:42 -08:00
Adam Ierymenko 34404eb300 Ignore more DLL patterns. 2015-11-23 12:34:46 -08:00
Adam Ierymenko 7a84805824 Uncommit binary... :P 2015-11-23 12:34:23 -08:00
Adam Ierymenko 1d4563ac31 A few very tiny bits of dead code removal, etc. 2015-11-23 12:32:20 -08:00
Adam Ierymenko a18336fa18 MERGE current "dev" into "netcon" -- should not affect netcon itself but will retest -- brings ZeroTier core up to 1.1.0 2015-11-23 10:46:52 -08:00
Adam Ierymenko 1e4a40e772 Reformat table. 2015-11-23 10:11:46 -08:00
Joseph Henry 6e5feaba3a Updated test files 2015-11-23 07:08:07 -08:00
Joseph Henry 71b38a48ac Replaced README 2015-11-23 06:22:09 -08:00
Joseph Henry 6a3f230555 Unit test info added to README 2015-11-23 06:20:01 -08:00
Joseph Henry a952ff2c61 Removed odd file 2015-11-23 06:11:19 -08:00
Joseph Henry 05e51f40b4 README formatting update. Removed odd files 2015-11-23 06:07:48 -08:00
Joseph Henry b83aefcf8f Updated README, fixed node.js test bug 2015-11-23 05:59:05 -08:00
Joseph Henry 8b9b593256 Removed old READMEs and OS files 2015-11-23 05:21:20 -08:00
Joseph Henry 275a76ff5c Test update 2015-11-23 05:15:19 -08:00
Joseph Henry 3d163f7044 Patch for Node.js -- accept() bug 2015-11-23 01:14:17 -08:00
Grant Limberg 764dd1c3d9 ARP packets do need the source IP address in them, as well as the MAC address.
Packets wouldn't even show up in WireShark without the source IP in it.
2015-11-21 19:14:59 -08:00
Grant Limberg ac09c3569a ARP packet lengths are 28 bytes. This condition required the packet to be 29 or more bytes. 2015-11-21 19:14:06 -08:00
Adam Ierymenko ce5b7f0305 The World as of 2015-11-20 2015-11-20 12:49:23 -08:00
Adam Ierymenko 1fde17bacb Update World to reflect Alice and Bob in their final glory. Will hot-push this soon. 2015-11-20 11:46:10 -08:00
Joseph Henry d472c59b8d Additional test files 2015-11-20 02:41:27 -08:00
Joseph Henry 126fc46dc4 Updated makefile, removed old results directory 2015-11-20 01:22:15 -08:00
Joseph Henry d2e624f301 Updated makefile, removed old results directory 2015-11-20 01:19:16 -08:00
Joseph Henry 7173b0124b Removed old test directory 2015-11-20 01:13:04 -08:00
Joseph Henry 1f27022fa7 Test/Code Refactor in preparation for merge 2015-11-20 01:08:38 -08:00
Joseph Henry 9a25a627bb WIP: Unit tests -- more generalization 2015-11-19 17:34:56 -08:00
Adam Ierymenko 375aae44e4 . 2015-11-19 16:36:15 -08:00
Joseph Henry 31bc5e1559 WIP: Unit tests 2015-11-19 16:21:59 -08:00
Joseph Henry b1100b3d13 WIP: Automated tests 2015-11-19 16:14:27 -08:00
Grant Limberg 399b2e9e26 forgot to submit this. Add DeferredPackets.cpp to the android makefile 2015-11-17 19:16:10 -08:00
Adam Ierymenko 6f16f44438 VERSION 1.1.0: Win/Mac UI improvements, improved NAT-t, CIRCUIT_TEST, and more!
ZeroTier 1.1.0 introduces a number of fixes and improvements in several areas.
We incremented the secondary version to indicate the significance of this release.

Version numbering has been a bit ad-hoc in the past. In future versions we will
adopt the following scheme: odd-numbered revision numbers like 1.1.1 will indicate
development versions, while even numbered ones like 1.1.2 will indicate tagged
releases. The public git repo branching has also been revised: master will always
be the latest tagged release, dev will be usually-working development, and edge
will host maybe-broken "bleeding edge" development. Pull requests on GitHub should
generally be made against dev, not master or edge. Other branches that may appear
from time to time may be feature or experimental branches. Only master is confirmed
good, with dev usually being okay but not guaranteed to be such. (To the extent
that any software is ever guaranteed to be anything.)

Change summary:

User-facing changes and improvements:

 - Windows now has a new .NET-based native UI, which replaces the old WebControl
   wrapper around the React UI. This just didn't work well on older Windows systems,
   and we did not want to bundle 40+ megabytes of web browser with our app just for
   its very simple UI.
 - The web UI (still used for Mac and usable in Linux as well) is updated with
   improved look and simplifications.
 - Both UIs no longer have the "Peers" tab, since several users reported that non-
   technical users found this confusing and even alarming (does this mean people
   can access my system?). This information is visibile with "listpeers" from the
   command line (zerotier-cli).

New features:

 - Virtual networks that use our RFC4193-based IPv6 numbering scheme now emulate
   IPv6 NDP for queries that target these addresses within the same network. This
   allows for faster multicast-free connection init and improved security since
   the address is now hard-wired to the device ID (which is a crypto token). This
   does not affect IPv6 NDP for other IPv6 addresses or link-local, which will
   continue to work normally. This also opens the potential for a reduced footprint
   multicast-free build for embedded applications.
 - This version includes beta support for a feature called CIRCUIT_TEST. Network
   controllers for networks you have joined can now send a special message called
   CIRCUIT_TEST which allows for ZeroTier-layer link testing and remote diagnosis
   of link issues. Any operator of a network controller can do this; more
   documentation will be forthcoming. The only information that may be gathered
   in this way is IP addressing info and very basic system info (OS, 32/64 bit,
   ZeroTier version). No personal information, hard drive data, location, or other
   private info is available. This can only be ordered by a controller of a network
   you have joined and is secured using cryptographic signatures.
 - This version includes an alpha version of clustering a.k.a. multi-homing! This
   powerful feature allows for a single ZeroTier device to be run from multiple
   endpoints, with connecting peers being handed off to endpoints that are closer
   via GeoIP lookup and/or are more lightly loaded. Currently this is only suitable
   for use in our soon-to-be-upgraded root server infrastructure (details will be
   blogged soon), but in the future it will be capable of hosting multi-homed
   devices on user networks. This will allow things like (for example) a geo-
   clustered Cassandra server that appears behind a single IP on a virtual LAN.
   This feature must be enabled with the ZT_ENABLE_CLUSTER=1 build option.

Bug fixes and other improvements (including performance!):

 - A faster version of the Poly1305 cryptographic MAC function was substituted
   for sometimes greatly improved performance.
 - C++ STL std::map was replaced throughout the entire core with a hand-rolled
   Hashtable implementation for improved performance and in some cases a reduced
   memory footprint. Some maps are still used in peripheral code that is not
   performance critical or where ordered keys are needed.
 - The zerotier-cli and zerotier-idtool symbolic links are now created in
   /usr/local/bin on OSX to comply with El Capitan file security restrictions.
 - The OSX tap device driver has been updated. This update may fix issues that
   some users have reported with bridging on OSX. This new tap device driver
   drops 32-bit support, but if you have a 32-bit system you can manually install
   the old driver from ext/bin/tap-mac.
 - Mac users could experience a problem with the UI if they installed ZeroTier,
   then uninstalled it, then installed again. This is now fixed.
 - UPnP port mappings should work better on some routers, and a different local
   port is now used for UPnP mapped traffic vs. NAT-t'd traffic to get around
   a bug in several popular mid-tier routers where using UPnP mapping alongside
   traditional NAT traversal made a port unreachable.
 - Debian package now builds with the right arch label on armv7l systems (Pi 2)
 - The old "root topology" has been replaced with a similar but better thought
   out concept called a World. The World defines the root servers and possibly
   in the future other things, and can be updated in-band from trusted peers
   allowing for software-upgrade-free network upgrades to keep up with growing
   demand. See node/World.hpp for details.
 - A fix was made to "self-awareness," which keeps track of your external IP
   info and adapts to changes, to eliminate a problem that could cause "link
   thrashing" behind some symmetric NATs.
 - Escalating UDP TTLs was re-introduced to better transit some port-restricted
   cone NATs such as Linux IP MASQ (used for Docker).
 - An otherwise harmless crash-on-exit bug in the network controller was fixed.
 - All new direct links are now confirmed in both directions. This adds a very
   small amount of initial HELLO/OK traffic but fixes some edge cases where an
   incomplete or unidirectional path might be used.
 - [SECURITY] Better rate limiting was put in place for VERB_PUSH_DIRECT_PATHS
   to prevent potential abuse for amplification attacks.
 - [SECURITY] Build flags were tweaked on OSX to ensure that all code including
   dependency libraries are built with full stack canary protection and ASLR
   support.

Visit https://www.zerotier.com/blog or follow @ZeroTier on Twitter for updates
and announcements!
2015-11-17 12:18:45 -08:00
Adam Ierymenko 1c0c3e62dc Just add a launch prerequisite for .NET 4.5 -- it's usually there, and if not it can be easily installed. This is mostly an issue on old Windows Server systems, and in that case the admin will likely want to decide how to proceed. 2015-11-17 11:13:44 -08:00
Adam Ierymenko 9169b6c999 Fix crash on exit in Windows (does not affect other OSes) and revert debugging tweak in Windows version that prevented service from starting after real install. 2015-11-17 09:56:19 -08:00
Joseph Henry a660ec490e Started work on automated unit test scripts 2015-11-17 02:28:23 -08:00
Joseph Henry f5c2600ca4 Added symbol checks in intercept. This seems wise after all 2015-11-16 23:57:19 -08:00
Adam Ierymenko 48745eca57 Fix ARM dpkg build. 2015-11-16 19:54:58 -08:00
Joseph Henry b0f6dc43b4 Revised fd RX logic 2015-11-16 19:53:59 -08:00
Adam Ierymenko 456bfea58d Real World -- edge now talks to real net. 2015-11-16 19:27:36 -08:00
Adam Ierymenko 0f5fb48a0b Turns out it wasn't hard to add miniupnpc to the VS2012 project and just have it build with the rest of the code. 2015-11-16 19:04:04 -08:00
Adam Ierymenko dc8edea0c6 Linux make rules to make libminiupnpc from source. 2015-11-16 18:33:52 -08:00
Adam Ierymenko cf6164e847 Build libminiupnpc from source now, and update version. 2015-11-16 18:28:55 -08:00
Adam Ierymenko a13a21377c Delete pre-build miniupnpc for Linux and Mac -- will add Make rules to build from source and include source in ext/ 2015-11-16 18:18:08 -08:00
Adam Ierymenko 37acd375d6 Fix 64-bit int warning. 2015-11-16 18:10:40 -08:00
Joseph Henry f2289544b7 Check for fork/clone and re-initialize in close() -- for nginx 2015-11-16 17:44:11 -08:00
Adam Ierymenko 7a53ecac86 UI stuff. 2015-11-16 17:18:44 -08:00
Adam Ierymenko 906e49ff72 Add make option ZT_ENABLE_CLUSTER and disable it in default Linux build. 2015-11-16 16:22:41 -08:00
Adam Ierymenko e4d1aba3f8 Use new OSX tap version, and update OSX install scripts. 2015-11-16 16:19:24 -08:00
Adam Ierymenko 38fe77ecf2 WebUIWrapper is dead. 2015-11-16 15:44:07 -08:00
Adam Ierymenko 8fde33d87c . 2015-11-16 14:45:17 -08:00
Adam Ierymenko 220552af62 GitHub issue #241 -- and also some appearance updates. Eventually this might get replaced by a native Mac app. 2015-11-16 14:30:25 -08:00
Adam Ierymenko 637d50a9de Write binary of world too. 2015-11-16 13:11:16 -08:00
Adam Ierymenko f5b465c0e1 Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2015-11-16 11:13:02 -08:00
Adam Ierymenko 6ac70ba808 . 2015-11-16 11:01:19 -08:00
Adam Ierymenko 08cd603623 Code to generate real World for edge. 2015-11-16 10:58:40 -08:00
Adam Ierymenko ddf0cb0278 Docs and tweak some caching values. 2015-11-16 09:54:08 -08:00
Grant Limberg 75f8ee1b9c get the compiler to stop complaining about two string literals (one a macro) next to each other without an intervening space 2015-11-14 18:19:33 -08:00
Grant Limberg 0508a41afd added ttl parameter to WirePacketSendFunction 2015-11-14 17:40:17 -08:00
Adam Ierymenko 0d9f33dc4f Fix: (1) Windows stack overflow due to buffer too large in peer deserialize, (2) clean up some other stuff seen during debugging and reduce the sizes of some buffers due to Windows small stack size, (3) remove a redundant try/catch. 2015-11-13 12:14:28 -08:00
Adam Ierymenko 90f9415107 Update installer to drag along a net-install binary for .NET 4.5 that it runs if .NET 4.5 is not present... because yes we have to install Microsoft's own flagship runtime under some conditions. (Rare, but present.) 2015-11-13 09:11:12 -08:00
Adam Ierymenko 2ec638a23d New Windows UI tweaks: get rid of networks tab (only one tab!), make networks full width and make window narrower and a bit taller, colors, fixed-width fonts in several places, make network IDs selectable. 2015-11-12 17:38:30 -08:00
Joseph Henry a6cffefa6d Updated compatibility 2015-11-12 17:15:44 -08:00
Joseph Henry a818c622d9 Updated throughput_httpd docker test files 2015-11-12 16:57:45 -08:00
Adam Ierymenko ccae473783 Eliminate Windows warnings. 2015-11-12 16:51:33 -08:00
Adam Ierymenko 54f68280bd Minor Windows build fixes. Builds on VS2012 again. 2015-11-12 16:48:42 -08:00
Joseph Henry 7d8084262a Fixed rpc_st command alignment bug for RPC_SOCKET 2015-11-12 16:48:08 -08:00
Adam Ierymenko bacb53fe8f Remove old Windows NDIS5 tap driver -- I think this is dead. 2015-11-12 16:40:50 -08:00
Adam Ierymenko 33c132968e GitHub issue #219 -- make Linux makefile cross-compiler aware. 2015-11-12 15:37:32 -08:00
Adam Ierymenko 73e314cc1a Shelve pcap-with-bridge OSX experiment -- apparently pcap_inject does not work with bridge devices. Still have to use a kext. 2015-11-12 15:28:55 -08:00
Joseph Henry 6af54c5943 Minor debug updates 2015-11-12 14:49:20 -08:00
Joseph Henry fa7220ec0e Removed old Common.h 2015-11-12 14:35:58 -08:00
Joseph Henry d1a22a0878 Streamlined debug output code 2015-11-12 14:32:27 -08:00
Adam Ierymenko 8ac411a9e4 Stashing utun work for OSX -- abandoning for now since utun excludes mDNS among other issues. 2015-11-12 10:47:50 -08:00
Joseph Henry e5fad005a9 Updated RPC handling 2015-11-12 08:21:05 -08:00
Adam Ierymenko 0940d673db Always advertise to the cluster when we have a peer even if we have also initiated handoff. This might be the cause of the warmup problem -- will test later. At the very least it should not hurt anything due to pick-latest logic and the fact that cluster members with only suboptimal paths do not respond to WANT_PEER. 2015-11-11 14:36:22 -08:00
Adam Ierymenko b94335f115 Increase WHOIS retry delay slightly to allow for global cluster latency (e.g. 300+ms from New York to Johhannesburg) 2015-11-11 11:07:08 -08:00
Adam Ierymenko a13ba7102a GitHub issue #242 -- crappy uPnP protocol demands infinite lease time or else 2015-11-10 17:45:05 -08:00
Adam Ierymenko 451b8aa7b2 Query both root and network controller for multicast last resort GATHER. 2015-11-10 17:37:38 -08:00
Adam Ierymenko 53731acf51 Bracket by time in result cruncher script. 2015-11-10 17:15:06 -08:00
Adam Ierymenko 3b9411044f Patch tap-mac to latest tuntaposx upstream changes, and add updated build for 10.8 or later (keep old one for 10.7). 2015-11-10 16:00:21 -08:00
Adam Ierymenko 141e2db38c More results. 2015-11-10 15:47:18 -08:00
Adam Ierymenko 0cf4ddda4a Some more test results, and fix OSX installer to put symlinks in /usr/local as per El Capitan requirements. 2015-11-10 15:11:15 -08:00
Adam Ierymenko 0e4a2c378f Fix a sporadic warning in cluster-geo, and fix test to not overload the test-watcher. 2015-11-10 13:09:58 -08:00
Adam Ierymenko 2854f14966 Some cluster parameter tweaks, and change the test code in tests/http to dramatically reduce the amount of data transfer to/from the test master. Also add results of first successful 50k test. 2015-11-10 11:59:03 -08:00
Adam Ierymenko 4328c6c3bc Fix delete oldest logic. 2015-11-10 09:46:14 -08:00
Adam Ierymenko b171c9a0db Replace slow std::list<> with an O(log(N)) data structure for the cluster relaying send queue. 2015-11-10 09:05:01 -08:00
Joseph Henry 82a60b1e28 Fixed throughput build script 2015-11-09 20:16:27 -08:00
Joseph Henry 19f09e46fa Moved/Renamed Docker test dirs 2015-11-09 19:37:19 -08:00
root 134ad8ac21 Changed httpd version in throughput-test Dockerfile 2015-11-09 19:13:53 -08:00
Adam Ierymenko 32ec378e3b Announce that we have peers on the cluster when we first see them to improve startup times, and add a result crunching script to tests/http. 2015-11-09 18:01:23 -08:00
Adam Ierymenko 2cc50bdb10 Try bringing back TTL escalation -- may help with Docker (IP-MASQ) type NAT 2015-11-09 15:44:13 -08:00
Adam Ierymenko 94f4316a0e Fix for possible high CPU usage on multicast queries. 2015-11-09 14:54:05 -08:00
Adam Ierymenko 35c4e28f31 Mark geo-redirected paths as suboptimal and do not report that we have a peer if all we have is one of these. Also a few other small fixes. 2015-11-09 14:25:28 -08:00
Adam Ierymenko 47424df417 Fix (1) a deadlock bug and (2) a bug that prevented distributed rendezvous messages from being sent. 2015-11-09 13:39:06 -08:00
Adam Ierymenko 73e2c6e511 How did that ever work? 2015-11-09 12:24:49 -08:00
Adam Ierymenko 12cd9df059 . 2015-11-09 11:30:17 -08:00
Adam Ierymenko 4ad2ff2f71 . 2015-11-09 11:08:52 -08:00
Adam Ierymenko b57c855a8c PROXY_SEND fix. 2015-11-09 10:25:20 -08:00
Adam Ierymenko ed954c5ca2 . 2015-11-09 10:09:16 -08:00
Adam Ierymenko 21341ab15c Ready to test. 2015-11-09 09:45:43 -08:00
Adam Ierymenko f4d12603e0 Tweak how Switch passes off to Cluster on relay to fit new paradigm. 2015-11-09 09:19:03 -08:00
Adam Ierymenko ff81415ffe Build fixes... 2015-11-09 09:14:26 -08:00
Adam Ierymenko 5371195c80 Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2015-11-09 09:01:58 -08:00
Adam Ierymenko 473ce82040 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2015-11-09 09:01:41 -08:00
Adam Ierymenko ab013d831c . 2015-11-09 09:01:38 -08:00
Adam Ierymenko 57b71bfff0 Cluster simplification and refactor work in progress... 2015-11-08 13:57:02 -08:00
Adam Ierymenko 6bc8c9d8ef Clustering cleanup, still a work in progress. 2015-11-06 16:12:41 -08:00
Adam Ierymenko 5f39d5b7ea Further pare down Cluster messaging and rename some stuff. 2015-11-06 14:37:17 -08:00
Adam Ierymenko 9490b1f136 Try prioritizing cluster-send over direct send in cluster mode -- may improve cluster relaying reliability. 2015-11-06 13:38:56 -08:00
Adam Ierymenko badec136fc New agent master IP. 2015-11-06 11:55:06 -08:00
Adam Ierymenko 8ea5f424fd Small amount of cleanup. 2015-11-06 11:15:06 -08:00
Grant Limberg 3cafa60284 fix up some borders & colors 2015-11-05 19:44:19 -08:00
Grant Limberg 2415ae45c1 remove the peers page 2015-11-05 19:44:19 -08:00
Adam Ierymenko aa169b54de Add conntrack tweak to nf for testing. 2015-11-05 18:06:04 -08:00
Adam Ierymenko 83c6b7ab3d Use bigger UDP buffer on bigger x64 machines. Keep old value elsewhere since these are likely to be smaller boxes. 2015-11-05 17:41:07 -08:00
Adam Ierymenko ba5008c370 Now make cluster announcements slightly more frequent. 2015-11-05 17:28:55 -08:00
Adam Ierymenko 3fa1b5a89d Make cluster HAVE_PEER a little lighter by removing full identity. Technically this is not necessary and they will propagate over time in any case. Might restore it in some form in the future. 2015-11-05 17:22:22 -08:00
Adam Ierymenko 7603d8cee8 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2015-11-05 16:46:42 -08:00
Adam Ierymenko 869eff49bc . 2015-11-05 16:46:33 -08:00
Adam Ierymenko d9abc28fe3 . 2015-11-05 14:54:54 -08:00
Adam Ierymenko 3e22fee842 Integrate deferred background processing into main OneService implementation. 2015-11-05 12:41:14 -08:00
Adam Ierymenko 5ec5911e1b Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge 2015-11-05 12:23:06 -08:00
Adam Ierymenko 8ef4edebbf Deferred decode for HELLO to prevent HELLOcalypse under high load of new peers. 2015-11-05 12:22:58 -08:00
Grant Limberg 86c74d8a65 set manifest to require administrator privileges and read the authtoken and port from disk 2015-11-04 20:34:49 -08:00
Grant Limberg 49086e4556 just a little xaml cleanup 2015-11-04 20:31:41 -08:00
Grant Limberg 4c7bb06894 make the main window width a bit smaller 2015-11-04 20:19:14 -08:00
Grant Limberg f3e527e130 update the peer list in place rather than replacing it 2015-11-04 20:17:58 -08:00
Grant Limberg df74dd6e41 make the peers page prettier 2015-11-04 20:03:25 -08:00
Grant Limberg 5e9166cec7 setting width/height isn't necessary 2015-11-04 19:30:26 -08:00
Grant Limberg d2c288b13f Fix vertical scrolllbar on networks view 2015-11-04 19:12:12 -08:00
Grant Limberg fc32dc11a6 make the networks view a bit prettier 2015-11-04 19:08:13 -08:00
Grant Limberg 2721804ebf make the tabs a little prettier 2015-11-04 18:41:08 -08:00
Grant Limberg 7b86176d0e Don't go kaboom when the ZeroTier service isn't running. 2015-11-04 18:28:07 -08:00
Adam Ierymenko a95ff21aaf test stuff 2015-11-04 15:09:19 -08:00
Joseph Henry 3e84e8b8c3 Performance tweaks to lwipopts.h (TX=12MB/s) 2015-11-04 14:45:26 -08:00
Adam Ierymenko 9ec32e7926 Agent settings for big test. 2015-11-04 13:28:43 -08:00
Grant Limberg 7756b5bf1c Merge branch 'android-jni-dev' into edge 2015-11-03 19:15:00 -08:00
Grant Limberg eadeac0a42 logging of events 2015-11-03 19:14:11 -08:00
Joseph Henry 4b07987210 Added throughput-test Docker files 2015-11-03 18:10:39 -08:00
Adam Ierymenko 172fc1052b Merge windows-ui into edge. 2015-11-03 17:38:36 -08:00
Adam Ierymenko 523412edfb Abort backup in progress if thread is told to shut down. 2015-11-03 16:03:00 -08:00
Adam Ierymenko f7a407ffa0 Tweak timings and use lock in backup to make it a bit faster and still permit main thread to work. 2015-11-03 15:56:24 -08:00
Adam Ierymenko 7903f24a8f Create periodic backup copies of controller.db in network controller from the main process itself to facilitate easier and safer backups of controller.db. 2015-11-03 15:52:10 -08:00
Adam Ierymenko 4b655ab22c tests 2015-11-03 14:39:44 -08:00
Adam Ierymenko d9d11042ca . 2015-11-03 12:56:34 -08:00
Adam Ierymenko 0b245b031e Allow ZT_TRACE without debug. 2015-11-03 11:20:12 -08:00
Adam Ierymenko a42d714a87 . 2015-11-03 11:18:45 -08:00
Adam Ierymenko c9e6e60c09 Handle ZeroTier-RFC4193 IPv6 address NDP queries inline by spoofing responses if the addressing scheme matches -- this allows multicast-free instant lookup of local IPv6 for better performance and reliability. 2015-11-03 10:46:41 -08:00
Joseph Henry df391c8413 Added debug statements for transfer test 2015-11-03 10:30:18 -08:00
Joseph Henry 4c20fa4874 Added debug statements for transfer test 2015-11-03 10:26:10 -08:00
Grant Limberg b7df177f33 updates for origin/edge 2015-11-02 19:18:55 -08:00
Grant Limberg 179b064b05 Merge branch 'edge' into android-jni-dev 2015-11-02 18:32:21 -08:00
Grant Limberg a19e82fcbc Merge branch 'edge' into windows-ui 2015-11-02 18:30:54 -08:00
Joseph Henry ccbdb1a3a1 RPC command index fix 2015-11-02 16:09:28 -08:00
Adam Ierymenko 4e9d430476 Make root and relay selection somewhat more robust. 2015-11-02 16:03:28 -08:00
Joseph Henry 8d7b2cd486 Removed serv. conn. checks. 2015-11-02 15:52:12 -08:00
Adam Ierymenko 00dcb0f22c . 2015-11-02 15:39:09 -08:00
Adam Ierymenko 7fbe2f7adf Tweak some more timings for better reliability. 2015-11-02 15:38:53 -08:00
Joseph Henry fd33e0812c Added checks for bad service connection. 2015-11-02 15:31:57 -08:00
Adam Ierymenko 60ce886605 Tweak some timings for better reliability. 2015-11-02 15:15:20 -08:00
Adam Ierymenko ab27a91b07 . 2015-11-02 13:53:27 -08:00
Joseph Henry 24ffb22fa6 Changed default debug level 2015-11-02 13:26:59 -08:00
Joseph Henry da462bbd55 Removed curses dependency 2015-11-02 13:21:40 -08:00
Adam Ierymenko fd3916a49e More test stuff... make it more granular and less batch based. 2015-11-02 13:17:11 -08:00
Joseph Henry bb912cff30 More appropriate phyOnUnixClose handling 2015-11-02 12:50:32 -08:00
Adam Ierymenko e53ef9642e test stuff. 2015-11-02 12:31:34 -08:00
Joseph Henry 6338a4933b Fixed another closure bug. Updated debug levels 2015-11-02 12:30:18 -08:00
Adam Ierymenko 29249db5d2 Big test stuff. 2015-11-02 11:37:32 -08:00
Joseph Henry 4dbb84cea1 Fixed connection closure bug (ERR_ABRT from nc_recved) 2015-11-02 10:59:46 -08:00
Adam Ierymenko f1b6427e63 Decided to make this 1.1.0 (semantic versioning increment is warranted), and add a legacy hack for older clients working with clusters. 2015-11-02 09:32:56 -08:00
Joseph Henry db473beb48 Fixed accept return value / errno bug, also fdret_sock return bug 2015-10-30 17:00:30 -07:00
Adam Ierymenko 1b4cc4af5c Fix evil bug, and instrument/assert on some other stuff, and a bit of cleanup. 2015-10-30 15:54:40 -07:00
Adam Ierymenko 7382c328da Null pointer bug appears fixed... testing again at large scale. 2015-10-30 14:23:28 -07:00
Adam Ierymenko 641b0dec44 . 2015-10-30 14:12:20 -07:00
Adam Ierymenko 2fbb5d0bbf . 2015-10-30 14:11:45 -07:00
Adam Ierymenko d8dbbf7484 Add some debug code in TRACE mode to catch a bug. 2015-10-30 14:11:10 -07:00
Adam Ierymenko 377ccff600 getPeer() had a small potential to be unsafe. 2015-10-30 13:39:28 -07:00
Adam Ierymenko f974517f64 Save zerotier output in containers. 2015-10-30 13:06:30 -07:00
Adam Ierymenko f808138a94 docs and stuff 2015-10-30 13:05:34 -07:00
Adam Ierymenko b845dd1b88 Set contact IP for real test. 2015-10-30 12:38:12 -07:00
Adam Ierymenko b6725c4415 Optimize AntiRecursion. 2015-10-30 11:48:33 -07:00
Adam Ierymenko 5bfa29dded Make antirec tail len slightly shorter, better performance and still plenty long enough. 2015-10-30 11:09:40 -07:00
Adam Ierymenko 80e62ad291 docs 2015-10-30 10:55:05 -07:00
Adam Ierymenko e2fc20876d docs 2015-10-29 18:23:41 -07:00
Joseph Henry 96eb0ce492 Added state dump, fixed numerous RPC related bugs 2015-10-29 17:57:59 -07:00
Adam Ierymenko d6c0d176ee Periodically re-announce peers that we have. 2015-10-29 10:10:09 -07:00
Adam Ierymenko 9f0f0197fe More dead code removal. 2015-10-29 09:44:25 -07:00
Adam Ierymenko a994573a43 Eliminate some more dead code. We may do path trust, but not like that. 2015-10-29 09:42:15 -07:00
Adam Ierymenko 883c84bdb9 Tweak some timings, and remove some dead code. 2015-10-29 09:39:36 -07:00
Joseph Henry f6e0bdb2f2 Fixed PCB state issue when closing connection 2015-10-28 16:18:08 -07:00
Adam Ierymenko e3d811b04b docs 2015-10-28 15:55:40 -07:00
Adam Ierymenko cabb8752cb docs 2015-10-28 15:28:05 -07:00
Adam Ierymenko 1f5ef968cf Test need a more recent version of NodeJS so update Dockerfile. 2015-10-28 15:08:00 -07:00
Joseph Henry c8f27da294 Added support for MongoDB (server side) 2015-10-28 14:37:46 -07:00
Adam Ierymenko 68d6d3c4ff Fix bug in peer count. 2015-10-28 14:29:08 -07:00
Adam Ierymenko 4c24e0cfb0 More tweaks to tests... just about ready to run at scale. 2015-10-28 14:24:54 -07:00
Adam Ierymenko 9653531242 . 2015-10-28 14:18:58 -07:00
Adam Ierymenko 07c1b4ddee test stuff 2015-10-28 14:16:58 -07:00
Adam Ierymenko 1cae7327ae Basic Dockerfile for building test agents. 2015-10-28 13:35:52 -07:00
Adam Ierymenko c03550de35 HTTP test works! 2015-10-28 13:14:53 -07:00
Adam Ierymenko c6a918d996 HTTP test code. 2015-10-28 12:50:48 -07:00
Adam Ierymenko 0034efafe4 On semi-undocumented test net, assign a RFC4193 IPv6 address too. Will be useful for our at-scale tests. 2015-10-28 11:08:15 -07:00
Adam Ierymenko 0fd15d9cf3 Fix inverted sense bug. 2015-10-28 10:38:37 -07:00
Adam Ierymenko 938d0a970b TRACE build fixes. 2015-10-28 10:01:32 -07:00
Adam Ierymenko fdc3e103cc Cleanup and docs. 2015-10-28 09:38:33 -07:00
Adam Ierymenko c1b0329969 Only check IP equality to detect external surface changes (should prevent some spurious resets under symmetric NATs), and simplify some logic. 2015-10-28 09:32:07 -07:00
Adam Ierymenko da93712846 Clean up PUSH_DIRECT_PATH limits a bit more and make them a bit smarter. 2015-10-28 09:11:30 -07:00
Adam Ierymenko cdc99bfee1 Add a circuit breaker for VERB_PUSH_DIRECT_PATHS. 2015-10-27 18:18:26 -07:00
Adam Ierymenko 88b100e5d0 More cleanup. 2015-10-27 17:59:17 -07:00
Joseph Henry 21889305e0 Updated README.md 2015-10-27 17:41:51 -07:00
Joseph Henry 18db95d0e9 Updated README.md 2015-10-27 17:38:56 -07:00
Adam Ierymenko 51fcc75354 Some cleanup, and use getPeerNoCache() exclusively in Cluster. 2015-10-27 17:36:47 -07:00
Joseph Henry 721d58b464 Added support for Redis 2015-10-27 17:12:32 -07:00
Adam Ierymenko 4221552c0b Use getPeerNoCache() in Cluster to avoid keeping all peers cached everywhere. 2015-10-27 16:52:44 -07:00
Adam Ierymenko cc1b275ad9 Replicate peer endpoints and forget paths if we have them -- this allows two clusters to talk to each other, whereas forgetting all paths does not. 2015-10-27 16:47:13 -07:00
Adam Ierymenko cc6080fe38 (1) No need to confirm if we are a root (small optimization), (2) Refactor peer affinity tracking. 2015-10-27 15:57:26 -07:00
Adam Ierymenko 6399f6f094 This no longer has to be quite so fast. 2015-10-27 15:02:15 -07:00
Adam Ierymenko 218ef07d8e Build fix in TRACE mode. 2015-10-27 15:01:11 -07:00
Adam Ierymenko 16bc3e0398 Factor out RemotePath subclass of Path -- no longer needed, just cruft. 2015-10-27 15:00:16 -07:00
Adam Ierymenko 40976c02a4 Forget paths to peers if we are handing them off. 2015-10-27 14:37:38 -07:00
Adam Ierymenko f692cec763 Change how cluster relays packets -- just PROXY_UNITE and then send packet via normal ZeroTier front plane -- more efficient and eliminates fragmentation issues. 2015-10-27 14:04:12 -07:00
Adam Ierymenko 40e0a34a5c Add set buffer sizes code to Phy<> 2015-10-27 13:04:08 -07:00
Adam Ierymenko 7295fcfa86 Merge Phy<> from netcon. 2015-10-27 12:50:23 -07:00
Adam Ierymenko cfe166ef35 Tweak some size limits. 2015-10-27 12:29:01 -07:00
Adam Ierymenko 0ffbd05c0e --wtf; prevent roots from TCP fallback 2015-10-27 12:21:57 -07:00
Adam Ierymenko a1a0ee4edb Fix infinite loop in Cluster, clean up some stuff elsewhere, and back out rate limiting in PUSH_DIRECT_PATHS for now (but we will do something else to mitigate amplification attacks) 2015-10-27 12:01:00 -07:00
Adam Ierymenko 54a99d8e32 Well that was broken. 2015-10-27 11:14:07 -07:00
Adam Ierymenko 62db18b6dd Lessen this limit just a bit to make cluster settle faster. 2015-10-27 11:01:58 -07:00
Adam Ierymenko f32e9d07dd Don't include COM if not necessary (fix). 2015-10-27 10:58:01 -07:00
Adam Ierymenko 700c3166b7 Fix inverted sense bug. 2015-10-27 10:51:11 -07:00
Adam Ierymenko 17e7528e2c More root cleanup. 2015-10-27 10:40:31 -07:00
Adam Ierymenko 8a7a0b6b88 Cleanup, including simplification of root server picking algorithm since we no longer need all that craziness. 2015-10-27 10:37:39 -07:00
Adam Ierymenko 9617208e40 Some cleanup, and use VERB_PUSH_DIRECT_PATHS to redirect newer peers. 2015-10-27 09:53:43 -07:00
Adam Ierymenko fb3b7a3baa Take -DZT_ENABLE_CLUSTER out of Mac defaults. 2015-10-27 09:41:12 -07:00
Adam Ierymenko 69857b4ba8 Refactor cluster redirects to move code to push peers out of the actual Cluster function that checks for redirect, and clean up Peer::received() to be a bit more logical. 2015-10-27 09:36:48 -07:00
Grant Limberg 0ffcfa307e another build setting 2015-10-26 20:26:19 -07:00
Grant Limberg 16c812ec80 set the app icon for release 2015-10-26 20:24:08 -07:00
Grant Limberg 268fbdabce disable sorting of peers 2015-10-26 20:06:53 -07:00
Grant Limberg 87496e9f4a can now leave networks 2015-10-26 19:53:03 -07:00
Grant Limberg 300a951730 Figured out how to expand controls to fill parent. yay 2015-10-26 19:39:54 -07:00
Grant Limberg 095539de29 Initial peers page 2015-10-26 19:21:21 -07:00
Grant Limberg c4c67e591b add error handling for JSON serialization 2015-10-26 19:02:19 -07:00
Grant Limberg 502aa68bb7 change int to UInt64 for these properties 2015-10-26 19:01:59 -07:00
Grant Limberg 81cb4bc8d6 set up a timer to update the UI from a background thread 2015-10-26 18:31:10 -07:00
Adam Ierymenko e713f7a54c Can redirect in response to a few more verbs, just not these. 2015-10-26 18:20:40 -07:00
Grant Limberg 352b83252f Merge branch 'adamierymenko-dev' into windows-ui 2015-10-26 18:10:27 -07:00
Grant Limberg a0c3083af0 disallow paste of non hex characters 2015-10-26 18:08:44 -07:00
Adam Ierymenko 98d856daa2 Only send redirects to the sending InetAddress and only in response to a set of certain frame types to avoid potential race conditions. 2015-10-26 17:58:51 -07:00
Adam Ierymenko 8bfb02ba3c Only send redirects for the same address class, and elminiate some TRACE noise. 2015-10-26 16:55:55 -07:00
Adam Ierymenko 0b82c9ebad Fix infinite loop if there are no live roots (never happened before?!? wow!) 2015-10-26 16:09:56 -07:00
Adam Ierymenko de761c5a82 Fix test world def. 2015-10-26 15:47:32 -07:00
Adam Ierymenko 6cf1da166f Add the whole new World, though with test identities at this point. 2015-10-26 15:12:28 -07:00
Adam Ierymenko 6625d79296 Fix if cluster compiled in but not enabled. 2015-10-26 13:07:00 -07:00
Adam Ierymenko debed1ac2d Expose cluster status in /status JSON response. 2015-10-26 13:06:10 -07:00
Adam Ierymenko 5ff7733f84 More plumbing of cluster status. 2015-10-26 12:49:17 -07:00
Adam Ierymenko 865acfa40f Cluster status plumbing. 2015-10-26 12:41:08 -07:00
Adam Ierymenko 3ce5ad9e2c For forward compatibility, add minimal parse for some future physical address types. 2015-10-26 10:42:30 -07:00
Adam Ierymenko d2b1dfe424 Fully specify new network in alice-test, this will (with different identities) eventually become the World. 2015-10-23 15:51:50 -07:00
Grant Limberg 55dcf4c65f wire up the join network button 2015-10-23 15:50:49 -07:00
Grant Limberg 7e635d37ad only accept hex characters for network id 2015-10-23 15:49:04 -07:00
Grant Limberg b7b973624a add methods for joining/leaving networks, and getting peers 2015-10-23 15:37:36 -07:00
Grant Limberg 62059a91aa C#-ifying stuff 2015-10-23 15:36:42 -07:00
Adam Ierymenko 35676217e8 Refactor multicast group announcement to work directly or indirectly. 2015-10-23 14:50:07 -07:00
Joseph Henry 8cfee8a38c Changed to more appropriate APP_POLL_FREQ 2015-10-23 14:31:06 -07:00
Joseph Henry 80a73cb14b Minor cleanup 2015-10-23 14:23:04 -07:00
Adam Ierymenko e9648a6cdf Clarify logic in pinging, and prevent roots from pinging "down." 2015-10-23 14:05:12 -07:00
Adam Ierymenko e6a63f5547 Fix bug in setWorld that might have caused a peer entry for myself (which would never be used) 2015-10-23 13:57:02 -07:00
Joseph Henry b48ed824e6 Improved RPC connection closure logic 2015-10-23 13:37:41 -07:00
Adam Ierymenko 29b966894c (1) Fix bug in geo-ip service that prevented cache lookup, (2) fix problem in SelfAwareness (will need to test ALL versions in the wild with this), and (3) add more TRACE instrumentation to Cluster. 2015-10-23 13:03:34 -07:00
Adam Ierymenko f0160635a2 Add --harmony for older nodeJS. 2015-10-23 12:05:17 -07:00
Adam Ierymenko 964b30902a Cluster fix: was accumulating remote endpoints endlessly. 2015-10-23 11:51:18 -07:00
Adam Ierymenko 2a3dd53952 . 2015-10-22 17:50:00 -07:00
Joseph Henry 236e474553 Unload lwipstack->_libref upon exit 2015-10-22 16:26:29 -07:00
Adam Ierymenko dee6e7e3c1 . 2015-10-22 16:11:48 -07:00
Adam Ierymenko 7711eba297 More cluster wiring... 2015-10-22 16:02:01 -07:00
Joseph Henry 2f4628520b Improved RPC connection cleanup logic 2015-10-22 13:20:50 -07:00
Joseph Henry b203d25656 PhySocket NULL check added to handle_write. Fixed after-close handle_write segfault 2015-10-22 12:40:01 -07:00
Adam Ierymenko 1bc451ed10 GeoIP cluster service works. 2015-10-22 10:41:15 -07:00
Adam Ierymenko e07bae2525 Run geoip cluster service sub-process. 2015-10-22 10:18:05 -07:00
Adam Ierymenko 5304b0d8d1 Rename index.js so process is distinguishable. 2015-10-22 09:09:15 -07:00
Grant Limberg fe6960888a add a scroll bar to the network info view 2015-10-21 20:40:43 -07:00
Grant Limberg 5b6ddaa2d7 Base windows UI is working.
* No joining/leaving networks yet, but they do display.
* Nothing is updated yet after first load of the app.  Need to set up a background task to run updates.
2015-10-21 20:29:03 -07:00
Grant Limberg 6471c1f4e2 Merge branch 'adamierymenko-dev' into windows-ui 2015-10-21 17:35:38 -07:00
Joseph Henry 8e7e409fce Updated netcon README 2015-10-21 16:56:39 -07:00
Joseph Henry 1458dc8347 set O_NONBLOCK default in accept() 2015-10-21 16:32:27 -07:00
Joseph Henry 303579cb42 Added Node.js support 2015-10-21 16:27:17 -07:00
Adam Ierymenko a46514b397 Cluster-geo launcher. 2015-10-21 12:47:02 -07:00
Adam Ierymenko 25a84e30fc Code for cluster-geo service. 2015-10-21 12:41:46 -07:00
Adam Ierymenko 978b056a01 Wire in redirectPeer(), now about ready to test clustering! 2015-10-20 17:36:10 -07:00
Adam Ierymenko 6a7b47e5e1 Forgot a return true. 2015-10-20 17:27:57 -07:00
Adam Ierymenko d6dee7bb5c Clustered handling of relaying. 2015-10-20 17:22:53 -07:00
Adam Ierymenko 35a12b94ea Outfit Cluster with TRACE for debugging. 2015-10-20 16:48:49 -07:00
Adam Ierymenko 2258e36a59 Move replication of COMs to avoid race condition. 2015-10-20 16:34:21 -07:00
Adam Ierymenko 59e1444b27 Finish wiring up Cluster, fix some issues with other recent changes. 2015-10-20 16:31:41 -07:00
Adam Ierymenko eb79d4a2f3 Wire up peer announcement in cluster. 2015-10-20 16:24:21 -07:00
Adam Ierymenko 57e29857cf Cluster work -- integrating with the rest of the code. 2015-10-20 15:27:53 -07:00
Grant Limberg 21ae423feb . 2015-10-19 21:19:23 -07:00
Grant Limberg 9ba5c91d4a initial layout for network info 2015-10-19 21:17:18 -07:00
Grant Limberg 80d02d189a set the main window icon 2015-10-19 20:30:21 -07:00
Grant Limberg 56267b2aed setting icon and a few other settings 2015-10-19 20:29:06 -07:00
Grant Limberg 6040574d8d set up project and base UI for a native windows UI for ZeroTier 2015-10-19 20:20:42 -07:00
Adam Ierymenko 5e6eae620b Make _members dynamically allocated due to static array limit on ARM. 2015-10-19 16:18:57 -07:00
Adam Ierymenko 69dad37d8f Restore default World for commit to upstream 2015-10-19 15:23:43 -07:00
Adam Ierymenko cfdcce6d12 Fix very obscure IP scope classification logic bug. 2015-10-19 15:19:04 -07:00
Adam Ierymenko 0b2e5ed499 Fix some broken logic in Path::reliable() 2015-10-19 15:11:43 -07:00
Adam Ierymenko 9150778757 . 2015-10-19 15:04:26 -07:00
Adam Ierymenko 50f3ccd3c9 . 2015-10-19 15:03:58 -07:00
Adam Ierymenko 584072fa6a Fix for V4/V6 stable addressing. 2015-10-19 14:04:36 -07:00
Adam Ierymenko 3adb183c5f Fix bad COM attachment bug and eliminate an unnecessary redundant check. 2015-10-19 13:38:27 -07:00
Adam Ierymenko 95953b48f9 Do not allow VERB_RENDEZVOUS from non-upstream peers to block potential DOS vector. 2015-10-19 12:56:29 -07:00
Adam Ierymenko aa6e3c79a0 Some test stuff that will not be pushed elsewhere. 2015-10-19 10:49:31 -07:00
Adam Ierymenko 0c43d34ce3 World test stuff... some of this will be yanked before release. 2015-10-19 10:00:35 -07:00
Joseph Henry 8b03965912 Added status debugs 2015-10-16 19:30:01 -04:00
Janjaap Bos 82e0abc4be Fix for cross compiling 2015-10-17 00:15:10 +02:00
Joseph Henry 0405ba1ccf Misc changes 2015-10-16 18:02:07 -04:00
Adam Ierymenko 738fa5a5e5 . 2015-10-16 12:10:57 -07:00
Joseph Henry b96c08f35c Fixed nginx listen() bug 2015-10-16 14:43:38 -04:00
Adam Ierymenko cc4d0199e7 Fix vProto init. 2015-10-16 10:58:59 -07:00
Adam Ierymenko 781f06ef82 Accept OK for confirm of HELLO or ECHO. 2015-10-16 10:48:38 -07:00
Adam Ierymenko f9f60f89d9 Peer save/restore fix. 2015-10-16 10:45:58 -07:00
Adam Ierymenko 5ce3aac929 Add rate limit on receive of DIRECT_PATH_PUSH to prevent DOS exploitation. 2015-10-16 10:28:09 -07:00
Adam Ierymenko 2229e91b57 IPv6 support fixes. 2015-10-16 10:10:12 -07:00
Adam Ierymenko 2debde3451 GitHub issue #235, and I also see no reason not to communicate with people from other Worlds. 2015-10-15 07:22:17 -07:00
Joseph Henry 3e8e025704 Minor cleanup items 2015-10-14 19:55:21 -04:00
Adam Ierymenko a775ee7d31 . 2015-10-14 16:21:39 -07:00
Adam Ierymenko 9ece8c465e decrypt fix 2015-10-14 15:49:41 -07:00
Joseph Henry 499d1628c7 Improved error coverage 2015-10-14 17:59:11 -04:00
Adam Ierymenko 59389b3dce Untested cluster code, not enabled. 2015-10-14 14:17:55 -07:00
Adam Ierymenko 619e113748 Work in progress on Cluster for new root infrastructure, multi-homing. 2015-10-14 14:12:12 -07:00
Joseph Henry e722eab892 Disabled TCP listen backlog, must be enabled in lwipopts.h 2015-10-14 17:03:32 -04:00
Joseph Henry 9ca699c86d Added support for listen backlogs 2015-10-14 16:04:26 -04:00
Joseph Henry d45db0f5af Fixed premature connection close bug 2015-10-14 15:46:22 -04:00
Joseph Henry 0b5a2a7594 Removed character from NEtconEthernetTap.cpp 2015-10-14 13:49:13 -04:00
Joseph Henry 831a513b2d Normalized cases 2015-10-14 13:47:35 -04:00
Adam Ierymenko c312ae221f Fix for world size in OK(HELLO) 2015-10-14 10:45:33 -07:00
Joseph Henry a35b6589d2 Removed lowercase intercept.h conflicting file 2015-10-14 13:43:12 -04:00
Adam Ierymenko 719233617c Add uint16_t key to Hashtable, and make Salsa20 zero its keyspace on destruction. 2015-10-14 10:14:07 -07:00
Joseph Henry 3c8e74023f Inconsequential. Updated commends, added debug statements 2015-10-13 20:20:45 -04:00
Joseph Henry 71c6ec71e5 connect() now checks socket family 2015-10-13 19:27:19 -04:00
Joseph Henry 1fd04557c7 Refactored connect(), added checks to socket(), updated checklists 2015-10-13 19:12:12 -04:00
Joseph Henry aa6ff039c4 Improved bind() logic, added more error handling to accept() 2015-10-13 18:33:56 -04:00
Joseph Henry 8a05efa365 EBADF, EOPNOTSUPP, EMFILE error repoarting for accept() 2015-10-13 17:57:17 -04:00
Joseph Henry da536cc311 Improved error reporting 2015-10-13 17:37:54 -04:00
Joseph Henry 0912d4be59 Fixed socket protocol check logic in socket() 2015-10-13 17:05:11 -04:00
Adam Ierymenko 489e1a5b83 Don't keep connections up longer than the alive timeout (unless they are relays or roots) 2015-10-13 13:51:54 -07:00
Adam Ierymenko 824ed99160 . 2015-10-13 12:42:54 -07:00
Adam Ierymenko 385f1410d2 Expose world info in JSON. 2015-10-13 12:33:15 -07:00
Adam Ierymenko 70d8e3ad94 Expose world ID and world timestamp in ZT_NodeStatus 2015-10-13 12:31:38 -07:00
Adam Ierymenko 71348f3ebb docs 2015-10-13 12:29:01 -07:00
Adam Ierymenko e268d9492a cleanup 2015-10-13 12:18:47 -07:00
Adam Ierymenko 123c466843 Full integration of World and World updates. 2015-10-13 12:17:47 -07:00
Adam Ierymenko 5d2f523e81 World stuff... 2015-10-13 12:10:44 -07:00
Joseph Henry 73145de618 Added some parameter checks from linux kernel syscall source 2015-10-13 14:27:30 -04:00
Adam Ierymenko 05677f57e2 Add C output to mkworld. 2015-10-13 08:55:21 -07:00
Adam Ierymenko cae58f43f1 More World stuff, and mkworld. 2015-10-13 08:49:36 -07:00
Joseph Henry 82052459a2 Odds and ends 2015-10-12 21:50:41 -04:00
Joseph Henry 4e1e857949 Minor bug fixes 2015-10-12 21:26:32 -04:00
Adam Ierymenko 1b1945c63e Work in progress on refactoring root-topology into World and adding in-band updates. 2015-10-12 18:25:29 -07:00
Joseph Henry 8d1b01cb5b Bug fix: Connection fd lookup in service 2015-10-12 20:46:59 -04:00
Adam Ierymenko 70fe7dd1fd cleanup 2015-10-12 16:40:57 -07:00
Joseph Henry 5dffa43201 Additional retval+errno handling 2015-10-12 19:29:27 -04:00
Joseph Henry 6b1a38f14c Better retval+errno handling 2015-10-12 16:38:08 -04:00
Joseph Henry fe8e7ded8c retval+errno return test 2015-10-09 20:27:38 -04:00
Adam Ierymenko eff1fe3c61 Create files for each hop (more convenient) and fix a packet parse bug. 2015-10-09 16:22:34 -07:00
Adam Ierymenko 7d01fab132 Reorg fields to be in same order as FS scheme. 2015-10-09 15:18:01 -07:00
Adam Ierymenko c9295a5883 . 2015-10-09 15:12:05 -07:00
Adam Ierymenko aec13b50fd Be a bit more verbose in circuit test reports to more clearly track current and upstream hop in graph traversal history. 2015-10-09 15:05:26 -07:00
Adam Ierymenko a95fa379cc Circuit tests basically work but need some tweaks, and fix some issues found with valgrind. 2015-10-09 14:51:38 -07:00
Joseph Henry 07536216c2 Removed netcon/.depend 2015-10-09 17:36:27 -04:00
Joseph Henry 3bcb6bf321 Minor cleanup 2015-10-09 17:31:22 -04:00
Joseph Henry 7f56678d84 Added liblwip.so and libintercept build files 2015-10-09 17:06:09 -04:00
Adam Ierymenko 97dee9de36 Add more helpful example stuff. 2015-10-09 12:50:52 -07:00
Joseph Henry e3ec000e93 Added intercept build file and sources 2015-10-09 15:41:16 -04:00
Adam Ierymenko 6b5bb0b278 Eliminate format string warnings. 2015-10-09 12:22:13 -07:00
Adam Ierymenko e33adad8f5 Script to quickly generate test docker env files. 2015-10-09 12:15:42 -07:00
Joseph Henry 769bad3320 Test: Added handle_write call to nc_poll 2015-10-09 15:05:45 -04:00
Adam Ierymenko 9a25651151 . 2015-10-09 10:14:45 -07:00
Adam Ierymenko c2bbec2f05 Docker example (and useful for testing) 2015-10-09 10:14:20 -07:00
Adam Ierymenko 0c498556d5 Unroll Salsa20 fully for a little more speed (non-SSE now almost as fast as SSE) 2015-10-09 09:39:27 -07:00
Adam Ierymenko 3fa6dd377f docs 2015-10-09 08:51:57 -07:00
Joseph Henry 6600b005b6 No Whack! 2015-10-08 21:24:51 -04:00
Joseph Henry b5b57aca02 Whack! 2015-10-08 21:04:47 -04:00
Adam Ierymenko 160278c489 Little bit of reorg in Salsa20 which seems to speed things up very slightly. 2015-10-08 17:42:53 -07:00
Joseph Henry d868a234da Refactored write logic 2015-10-08 19:38:29 -04:00
Adam Ierymenko 59da8b2a4b Logging of circuit test results to disk. 2015-10-08 15:44:06 -07:00
Joseph Henry 41dfbe544f Removed exit(0) for debugging 2015-10-08 18:10:10 -04:00
Joseph Henry bbfc9359e9 Minor timer changes (~21 Mb/s local) 2015-10-08 17:55:58 -04:00
Adam Ierymenko 558775d544 Merge branch 'adamierymenko-dev' of http://10.6.6.2/zerotier/ZeroTierOne into adamierymenko-dev 2015-10-08 13:26:43 -07:00
Adam Ierymenko a3876353ca Abiltiy to post a test via the controller web API, and parsing of CIRCUIT_TEST_REPORT messages. 2015-10-08 13:25:38 -07:00
Adam Ierymenko 273f0d18b0 docs 2015-10-08 09:05:25 -07:00
Grant Limberg 9347d6c866 Make it so ZeroTierOne.h can be used with a C compiler again. 2015-10-07 18:04:40 -07:00
Adam Ierymenko fea1b6b2c3 docs 2015-10-07 16:25:08 -07:00
Adam Ierymenko 0ce0bc00d2 Make sure received() gets called for some new messages, and docs. 2015-10-07 16:20:54 -07:00
Adam Ierymenko 69b44bf9a5 Finally add an ECHO. 2015-10-07 16:11:50 -07:00
Adam Ierymenko 73cafbe0ec Limit proof of work difficulty to something sane. 2015-10-07 13:46:44 -07:00
Adam Ierymenko e5f168f599 Add proof of work request for future DDOS mitigation use. 2015-10-07 13:35:46 -07:00
Adam Ierymenko 7d62dbe9f7 Tune NAT-t keepalives so that timing is better obeyed, clean up a build warning, and fix a potential source of network recursion (though harmless). 2015-10-07 11:57:59 -07:00
Adam Ierymenko 13f14c2f4c Kill debug line. 2015-10-07 10:56:47 -07:00
Adam Ierymenko c952fbbd8d Only enable 128-bit Poly1305 on X86_64 right now. Has compilation issues on ARM, but the 64-bit version should be fine. 2015-10-07 10:40:59 -07:00
Adam Ierymenko ab0228f626 More cleanup and simple refactoring, consolidate InetAddres serialize/deserialize into the class. 2015-10-07 10:30:47 -07:00
Adam Ierymenko 6c7ce79c89 Be consistent in how enums are defined in the main .h file. 2015-10-07 09:51:35 -07:00
Adam Ierymenko 1b2cac0cc5 Trim some cruft that is not used and probably never would be. 2015-10-07 09:38:33 -07:00
Joseph Henry 1bc33ae8d7 Minor debug output changes 2015-10-06 21:22:08 -04:00
Adam Ierymenko 598a1d8dd7 Try reopening /dev/urandom if there is a problem. 2015-10-06 18:10:40 -07:00
Adam Ierymenko 64aaea3978 Cleanup, and add an even faster Poly1305 on systems that support it. 2015-10-06 18:04:53 -07:00
Adam Ierymenko 876aa0883d Merge branch 'adamierymenko-dev' into netcon 2015-10-06 17:56:47 -07:00
Adam Ierymenko 477feee8a3 Some work on CIRCUIT_TEST, and a significant speedup to Poly1305. 2015-10-06 17:55:57 -07:00
Joseph Henry 36db5865e7 Refactored tcp_write code - Reduced CPU usage to respectable levels 2015-10-06 20:32:48 -04:00
Adam Ierymenko 7394ec6f6a Prep in controller code to run tests. 2015-10-06 15:56:18 -07:00
Adam Ierymenko 3593fb3462 Send initial CIRCUIT_TEST packet. 2015-10-06 15:16:41 -07:00
Adam Ierymenko d3f29d09e8 Plumbing through circuit test stuff. 2015-10-06 14:42:51 -07:00
Adam Ierymenko 5341afcdcd Handling of CIRCUIT_TEST, should be ready to test. 2015-10-06 11:47:16 -07:00
Adam Ierymenko 57c857e89a Fix TRACE output. 2015-10-06 06:57:00 -07:00
Grant Limberg c16ad053b6 no toString() method on peer. Commenting out for now. 2015-10-02 19:39:46 -07:00
Grant Limberg 6080a45c9c change cert to com. no variable named cert. 2015-10-02 19:39:13 -07:00
Adam Ierymenko 5384f185ae Simplify Dictionary and reduce memory usage, now no more std::maps in core. 2015-10-01 18:12:16 -07:00
Adam Ierymenko 76a95dc58f The return of peer peristence. 2015-10-01 17:09:01 -07:00
Adam Ierymenko 5076c49210 Peer serialization and related changes. 2015-10-01 15:40:54 -07:00
Adam Ierymenko 72e7e36a5b No reason to randomly pick uPnP secondary port. In fact it would likely cause problems on restarts and uPnP rule bloat. 2015-10-01 14:40:28 -07:00
Adam Ierymenko 2fa21aa676 . 2015-10-01 13:43:57 -07:00
Adam Ierymenko 3999e468b7 Need to hold nconf so *com does not die while being used. 2015-10-01 13:43:15 -07:00
Adam Ierymenko 6693149f3e Send COM with MULTICAST_GATHER for future use. 2015-10-01 13:34:12 -07:00
Adam Ierymenko 2c196307ee --bugs; 2015-10-01 13:01:18 -07:00
Adam Ierymenko d6676a9d6c Always announce multicast groups, not just to peers with direct links, and push network COMs to any MULTICAST_LIKE recipient for future use. 2015-10-01 12:50:19 -07:00
Adam Ierymenko a7409850d6 Get trim() out of core where it is not needed. 2015-10-01 12:37:18 -07:00
Adam Ierymenko 53e5f94b99 . 2015-10-01 12:25:43 -07:00
Adam Ierymenko 64bf3ffe6c Mutex cleanup. 2015-10-01 11:44:09 -07:00
Adam Ierymenko 9405150b11 Restore group announcement on Peer::receive() but centralize packet composition in one place. 2015-10-01 11:37:02 -07:00
Adam Ierymenko a3db7d0728 Refactor: move network COMs out of Network and into Peer in prep for tightening up multicast lookup and other things. 2015-10-01 11:11:52 -07:00
Adam Ierymenko 11ff96ba1d Consider IPv6 paths reliable (no constant keepalives needed) 2015-09-30 15:20:08 -07:00
Adam Ierymenko 0d0039674f Add new verb names, and fix some Mac compiler flags. 2015-09-30 14:48:07 -07:00
Adam Ierymenko 789046ca57 Speed up Salsa20 just a bit. 2015-09-30 14:35:05 -07:00
Adam Ierymenko 1a4f16e0ed More work on circuit testing... 2015-09-30 13:59:05 -07:00
Joseph Henry 4983fd3776 Recompiled ZTO binary with fix + moves index.html to var/www 2015-09-29 14:32:07 -04:00
Adam Ierymenko cc10d4f310 Speed up multicast group checking/registration. 2015-09-29 10:31:41 -07:00
Adam Ierymenko 167a5039d0 . 2015-09-28 23:40:20 -07:00
Adam Ierymenko 4b82171a95 . 2015-09-28 22:16:58 -07:00
Adam Ierymenko b4624237af . 2015-09-28 22:14:32 -07:00
Adam Ierymenko 49f93a57bf . 2015-09-28 17:07:46 -07:00
Adam Ierymenko ea71738c72 Entry point stuff... 2015-09-28 16:36:20 -07:00
Joseph Henry 49956ed63d Updated intercept library for Earth 2015-09-28 19:31:32 -04:00
Adam Ierymenko 280fcc3771 add cr after identity in demo script. 2015-09-28 16:15:17 -07:00
Adam Ierymenko 3a6346f560 More entry point work, and change network to 8056c2e21c000001 for demo. 2015-09-28 16:14:32 -07:00
Adam Ierymenko 980d145f48 Entry point changes to wait for ZT startup, print banners, log output debug messages and trace to files. 2015-09-28 15:31:47 -07:00
Adam Ierymenko a7bd1eaa40 Never assign v4 IPs ending in .255 even within range. 2015-09-28 15:28:30 -07:00
Joseph Henry 1773dca9dc Optimized Dockerfile arrangement 2015-09-28 17:59:54 -04:00
Joseph Henry 8e3e830e89 Working intercepted Apache 2015-09-28 17:47:38 -04:00
Joseph Henry 77b385fb12 Re-added Apache to Dockerfile 2015-09-28 17:30:18 -04:00
Joseph Henry 0b34d8e75e New Dockerfile 2015-09-28 16:56:14 -04:00
Joseph Henry 0c3dd2be96 Fixed apache script 2015-09-27 21:48:38 -04:00
Joseph Henry 444481f6d9 Modified Dockerfile 2015-09-27 21:26:57 -04:00
Joseph Henry 299ec12b39 Added docker-test folder 2015-09-27 21:16:02 -04:00
Joseph Henry b21c5d8e51 Added dockerfile 2015-09-27 20:51:32 -04:00
Adam Ierymenko 2d0adb562d Specify circuit test messages. 2015-09-27 11:37:39 -07:00
Joseph Henry 3bc9530db7 Object-Model refactor: Removed notion of Client 2015-09-27 06:08:39 -04:00
Grant Limberg 75a191a856 don't create an InetSocketAddress on local address if it's equal to ZT_SOCKADDR_NULL 2015-09-26 14:10:45 -07:00
Grant Limberg 7c3be2b5c1 fix function signature in lookup for onSendPacketRequested function 2015-09-26 14:10:16 -07:00
Grant Limberg 0b9e5928d3 update PacketSender interface 2015-09-26 13:53:38 -07:00
Grant Limberg e8cdff3eaf Merge branch 'adamierymenko-dev' into android-jni-dev
also update for changed function calls that now accept a local address

# Conflicts:
#	include/ZeroTierOne.h
#	java/CMakeLists.txt
#	java/jni/Android.mk
#	java/jni/ZT1_jnicache.cpp
#	java/jni/ZT1_jnilookup.h
#	java/jni/ZT1_jniutils.cpp
#	java/jni/com_zerotierone_sdk_Node.cpp
2015-09-26 13:47:55 -07:00
Joseph Henry fe78eb77d4 Fixed another closure bug 2015-09-24 19:22:56 -04:00
Adam Ierymenko f69454ec98 (1) Make ZT_ naming convention consistent (get rid of ZT1_), (2) Make local interface a full sockaddr_storage instead of an int identifier, which turns out to be better for multi-homing and other uses. 2015-09-24 16:21:36 -07:00
Joseph Henry 8a8264bc39 Fixed their_fd closure bug 2015-09-24 17:33:25 -04:00
Joseph Henry 1119f64a77 Fixed connection closure issue 2015-09-24 17:10:30 -04:00
Joseph Henry c25ceaf06b Fixed recursive lock problem in closeConnection 2015-09-24 16:15:14 -04:00
Adam Ierymenko b263926ea6 thread fixes. 2015-09-24 13:02:10 -07:00
Adam Ierymenko 84747b1a14 thread fixes... 2015-09-24 13:01:19 -07:00
Joseph Henry 9396b8d53c Minor debug changes 2015-09-24 15:56:48 -04:00
Joseph Henry 37497ec2a8 Minor changes 2015-09-24 15:31:11 -04:00
Joseph Henry 851e4c667f Minor changes 2015-09-24 15:30:07 -04:00
Adam Ierymenko 9feeafd757 Make LWIPStack thread safe. 2015-09-24 12:29:10 -07:00
Joseph Henry 0027a1e152 Merge branch 'netcon' of http://10.6.6.2/zerotier/zerotierone into netcon 2015-09-24 14:33:49 -04:00
Joseph Henry 65af5af138 Added debug statements 2015-09-24 14:33:15 -04:00
Adam Ierymenko 557d2b3b0d Make LWIPStack clean up properly. 2015-09-24 11:11:16 -07:00
Adam Ierymenko fbde40d1fc Merge branch 'adamierymenko-dev' into netcon 2015-09-24 11:00:22 -07:00
Joseph Henry 557c0c29b0 minor changes 2015-09-23 19:45:44 -04:00
Adam Ierymenko 0e5aac6a11 Prefer IPv6 paths if available. 2015-09-23 16:16:36 -07:00
Adam Ierymenko b242216674 Version bump, preparing for a likely 1.0.6 soon. 2015-09-23 16:10:06 -07:00
Adam Ierymenko 423412df98 Pick a random secondary UDP port for uPnP mapped traffic because of broken routers. 2015-09-23 15:16:20 -07:00
Joseph Henry c85dd262ed moved lib files to ext 2015-09-23 18:03:21 -04:00
Joseph Henry 02d5a31822 added lwip unix port lib files 2015-09-23 17:55:15 -04:00
Adam Ierymenko 7821d1cbdd . 2015-09-23 14:44:13 -07:00
Adam Ierymenko 80dc7fb675 Pick random port on -p0 2015-09-23 14:38:16 -07:00
Adam Ierymenko a3ed5277ef Make sure ZT_NO_TYPE_PUNNING also obeyed here. 2015-09-23 14:09:27 -07:00
Adam Ierymenko 2a527ea82e Fix for timer jitter problem. 2015-09-23 14:01:41 -07:00
Adam Ierymenko 367ffde00c Plumb through localInterfaceId to track local interfaces corresponding with remote addresses. 2015-09-23 13:49:56 -07:00
Joseph Henry bbdb8eb0de more commenting and cleaning 2015-09-23 15:23:26 -04:00
Joseph Henry b6a6346405 commenting and cleanup 2015-09-23 14:23:36 -04:00
Adam Ierymenko 4464fa5d39 Eliminate another warning. 2015-09-23 10:29:05 -07:00
Adam Ierymenko 86996d4315 Eliminate compiler warning. 2015-09-23 10:27:53 -07:00
Joseph Henry 07cef1bdb8 misc cleanup 2015-09-22 19:53:36 -04:00
Adam Ierymenko 69f006f641 . 2015-09-22 16:02:02 -07:00
Adam Ierymenko d656e87395 Send a random small payload for NAT keepalives, since zero byte packets seem to fail to keep associations alive behind some NATs. 2015-09-22 15:58:00 -07:00
Joseph Henry 3cb8070980 it's alive! -- hooked up new fd-handling code 2015-09-22 18:44:54 -04:00
Adam Ierymenko ff7ac0487b . 2015-09-22 15:16:38 -07:00
Adam Ierymenko 19c0923a86 Merge branch 'adamierymenko-dev' into netcon 2015-09-22 15:11:51 -07:00
Adam Ierymenko 6ce64c2557 Phy<> loses socketpair, gains raw FD monitoring. 2015-09-22 15:11:32 -07:00
Joseph Henry 3ed5edb295 fixed fd-transfer logic bug, needs new write-queue logic 2015-09-22 17:43:20 -04:00
Joseph Henry c3dbae8d5e more debugs 2015-09-22 13:35:37 -04:00
Joseph Henry b2494b53e6 adjusted output size for packets 2015-09-22 13:27:27 -04:00
Joseph Henry f091a074d4 output lengths 2015-09-22 13:25:24 -04:00
Joseph Henry f80d65286c more debug statements 2015-09-22 13:21:33 -04:00
Adam Ierymenko 0271e3d3ac . 2015-09-22 10:00:00 -07:00
Joseph Henry 00cb8dbda8 timer change 2015-09-22 12:48:53 -04:00
Joseph Henry 025069de7e timer change 2015-09-21 20:51:35 -04:00
Joseph Henry 86673bd6d6 fixed minor bugs and added debug outputs 2015-09-21 19:39:26 -04:00
Adam Ierymenko ddf3d1f949 Controller side support for IPv6 assignment. 2015-09-18 13:35:00 -07:00
Adam Ierymenko 3664966340 Generate local IPv6 addresses from network IDs and addresses. 2015-09-17 21:30:32 -07:00
Joseph Henry cb6864f04a updated nc_accept and lwip.so 2015-09-15 20:32:00 -04:00
Joseph Henry 701e1654a1 moved IP/netif allocation code 2015-09-15 19:06:16 -04:00
Joseph Henry 732de5bf7f some cleanup 2015-09-15 18:47:40 -04:00
Joseph Henry 11731af45a it's alive! 2015-09-15 18:27:52 -04:00
Joseph Henry 735ae9b369 debug changes 2015-09-15 15:41:57 -04:00
Joseph Henry cb277f52e8 Merge branch 'netcon' of http://10.6.6.2/zerotier/zerotierone into netcon 2015-09-15 14:16:28 -04:00
Joseph Henry 8ea83c9548 netif code hooked up 2015-09-15 14:15:59 -04:00
Adam Ierymenko 610ab0750c Drop Sqlite-based Log table for now and switch to an in-memory log for recent activity. Log table gets too big on busy nodes. Should probably support push of events to some kind of event system later. 2015-09-15 10:59:23 -07:00
Adam Ierymenko d06499a50c Merge branch 'adamierymenko-dev' of http://git.int.zerotier.com/zerotier/zerotierone into netcon 2015-09-14 12:00:03 -07:00
Adam Ierymenko ef316ced3b Fix JSON. 2015-09-14 11:59:43 -07:00
Adam Ierymenko 0617b17534 Merge branch 'netcon' of http://git.int.zerotier.com/zerotier/zerotierone into netcon 2015-09-14 11:36:01 -07:00
Grant Limberg f7d3e262a9 ifdef default assignments 2015-09-11 17:16:38 -07:00
Joseph Henry 8189b2ba91 retval fix 2015-09-11 19:29:35 -04:00
Joseph Henry e73868bc5a various segfault fixes 2015-09-11 19:02:44 -04:00
Joseph Henry 6f0bc1f676 added debugs, fixed linux makefile 2015-09-11 18:22:41 -04:00
Adam Ierymenko 88898c68d7 Merge branch 'adamierymenko-dev' of http://git.int.zerotier.com/zerotier/zerotierone into netcon 2015-09-11 15:02:38 -07:00
Adam Ierymenko cd005341c5 Extra statement to clean up Members -- cascade did not seem to work, possibly due to dual key. 2015-09-11 15:02:26 -07:00
Joseph Henry bc666d0ab7 added pbuf alloc block 2015-09-11 15:26:39 -04:00
Adam Ierymenko 933b47389d Add Arp to netcon build. 2015-09-11 12:19:48 -07:00
Adam Ierymenko a8d7a31327 Integrate arp into NetconEthernetTap. 2015-09-11 12:12:45 -07:00
Joseph Henry c2226cf0df added TRACEs 2015-09-11 14:47:16 -04:00
Adam Ierymenko 5f6eb2ce98 Merge branch 'adamierymenko-dev' into netcon 2015-09-11 11:46:44 -07:00
Adam Ierymenko c1a53a2653 ARP cache and responder agent code for use in netcon and iOS. 2015-09-11 11:45:04 -07:00
Joseph Henry 776f93e7be closeConnection / closeClient changes 2015-09-11 14:12:27 -04:00
Joseph Henry 5a5a513b18 small method changes 2015-09-11 14:00:42 -04:00
Joseph Henry cc4a2bb0c3 filled out hendlers 2015-09-10 20:34:48 -04:00
Joseph Henry e4dc46741f compiles, technically 2015-09-10 20:22:35 -04:00
Joseph Henry 20beafedc5 refactor almost complete 2015-09-10 20:02:13 -04:00
Adam Ierymenko 8d82ac5cc8 Merge branch 'adamierymenko-dev' into netcon 2015-09-10 15:56:15 -07:00
Adam Ierymenko 9dc2ef5549 Rename some stuff in Phy since it can be used with any stream socket. 2015-09-10 15:55:48 -07:00
Adam Ierymenko cd3d77987c . 2015-09-10 15:52:24 -07:00
Joseph Henry b11d429bc0 refactor in progress 2015-09-10 18:48:45 -04:00
Joseph Henry e391bc004b refactor in progress 2015-09-10 18:19:43 -04:00
Adam Ierymenko a35fa7ac93 Add expansion of netconf in _test field. 2015-09-10 15:14:10 -07:00
Adam Ierymenko bebe3d7cfa Fix deadlock in test mode. 2015-09-10 14:47:04 -07:00
Joseph Henry c1f1530d54 refactor in progress 2015-09-10 17:44:01 -04:00
Adam Ierymenko 1f7a41cff8 Fix to allowing identity to be populated if not present. 2015-09-10 14:37:34 -07:00
Joseph Henry f4d3c995bc refactor in progress 2015-09-10 16:52:18 -04:00
Adam Ierymenko 637da383f5 Remove unnecessary accessors. 2015-09-10 13:22:44 -07:00
Adam Ierymenko 389ea272a0 Merge adamierymenko-dev 2015-09-10 13:20:00 -07:00
Adam Ierymenko 9a723be263 Add socketpair support to Phy. 2015-09-10 13:18:57 -07:00
Joseph Henry 3802d37d29 started refactor 2015-09-10 15:46:37 -04:00
Joseph Henry 750352836f initial commit 2015-09-10 13:56:01 -04:00
Adam Ierymenko a43c3fbf2e Merge branch 'adamierymenko-dev' into netcon 2015-09-09 09:54:39 -07:00
Adam Ierymenko 4fbcad2468 Allow identity to be populated for newly inserted Member objects to permit transfer from old network controller and testing. 2015-09-08 13:02:42 -07:00
Adam Ierymenko 0d386f1c31 Add a bit of useful testing instrumentation to SqliteNetworkController. 2015-09-08 11:35:55 -07:00
Adam Ierymenko 85b90f122a Final std::map<> from Switch, and add some smallish default values for hash size. 2015-09-04 15:35:43 -07:00
Adam Ierymenko 3dba016a93 Almost done... very few std::map<>s remaining in any spot that matters. 2015-09-04 15:21:22 -07:00
Adam Ierymenko db0369e9b8 Remove way-overkill multimap from Switch. 2015-09-04 14:56:39 -07:00
Adam Ierymenko 0ab3e49be9 Starting in on Switch... kill map in defrag queue, which will probably improve performance pretty decently under high load with lots of peers. 2015-09-04 14:44:22 -07:00
Adam Ierymenko f116c4b9c0 ... and another ... 2015-09-04 14:24:31 -07:00
Adam Ierymenko 307e44f7c8 Two for one! (std::map removal) 2015-09-04 14:14:32 -07:00
Adam Ierymenko d1341578d8 ... and another one! 2015-09-04 13:53:48 -07:00
Adam Ierymenko 7b8ce16057 Another std::map<> dies. 2015-09-04 13:42:19 -07:00
Adam Ierymenko 3a959a7763 Swap out std::map<> for Hashtable<> for main peer database in Topology. (ongoing std::map-ectomy) 2015-09-04 12:14:21 -07:00
Adam Ierymenko cfd101c9b8 Add entries() to go with keys() for future use. 2015-09-04 11:50:12 -07:00
Adam Ierymenko ca6ec120a9 Merge branch 'netcon' of http://git.int.zerotier.com/zerotier/zerotierone into netcon 2015-09-03 18:45:07 -07:00
Adam Ierymenko 88ba39b162 Merge branch 'adamierymenko-dev' into netcon 2015-09-03 18:44:57 -07:00
Adam Ierymenko da9a720c3f Hash table bug fix, and add copy constructor and assignment operator for principle of least surprise. 2015-09-03 17:33:06 -07:00
Adam Ierymenko 10707c3673 build fix 2015-09-03 16:44:04 -07:00
Adam Ierymenko b9d4b42f93 A few more fixes, ready to integrate main payload. 2015-09-03 16:05:18 -07:00
Adam Ierymenko bf4cab5f2f Netcon build fixes. 2015-09-02 16:31:13 -07:00
Adam Ierymenko 1f4c667646 Netcon mode for Linux (in this branch, will make conditional later) 2015-09-02 16:15:22 -07:00
Adam Ierymenko dfb08ec753 More netcon stuff, and Phy build fix. 2015-09-02 15:51:28 -07:00
Adam Ierymenko 4626175d11 Stub of NetconEthernetTap 2015-09-02 15:17:38 -07:00
Adam Ierymenko 4838cbc350 Unix domain sockets in Phy<> 2015-09-02 14:32:01 -07:00
Grant Limberg 53d98343b7 Merge branch 'master' into android-jni 2015-08-31 19:53:39 -07:00
Grant Limberg 73bedfcc01 ifdef default assignments 2015-08-29 17:54:30 -07:00
Grant Limberg d5b48c90ed added a 512x512 app icon (for Play store) 2015-08-27 19:51:27 -07:00
Grant Limberg ebfbb7f452 Merge branch 'master' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into android-jni 2015-08-27 19:31:46 -07:00
Adam Ierymenko b11ffc9635 Integrate Hashtable into Multicaster, where @mwarning found heaviest std::map() overhead. 2015-08-27 16:17:21 -07:00
Adam Ierymenko 3947807b1f A simple and fast Hashtable, tested but not yet integrated with anything. 2015-08-27 15:36:13 -07:00
Adam Ierymenko 5db538d85e VERSION 1.0.5: Windows and Linux (upgrade) bug fixes
Version 1.0.5 is a very minor release. It includes a new build of the Windows
device driver that supports Windows Vista and 2008 Server, and a fix to prevent
an issue that could occur when updating Linux installations from old pre-1.0.3
versions to 1.0.3 or 1.0.4.

It also includes a few very minor fixes and improvements to the controller code,
which doesn't affect most users.

This second commit just bumps version.h. :)
2015-08-25 09:55:14 -07:00
Adam Ierymenko a9176d7b62 VERSION 1.0.5: Windows and Linux (upgrade) bug fixes
Version 1.0.5 is a very minor release. It includes a new build of the Windows
device driver that supports Windows Vista and 2008 Server, and a fix to prevent
an issue that could occur when updating Linux installations from old pre-1.0.3
versions to 1.0.3 or 1.0.4.

It also includes a few very minor fixes and improvements to the controller code,
which doesn't affect most users.
2015-08-25 09:47:37 -07:00
Adam Ierymenko b4487cefc9 Document rules requirement in controller. 2015-08-25 09:46:59 -07:00
Adam Ierymenko 867258de8b Document clock convenience field. 2015-08-25 09:44:21 -07:00
Adam Ierymenko 5fcef91278 Ignore old root-topology if present -- fix for upgrading on Linux and possibly elsewhere. 2015-08-25 09:42:37 -07:00
Adam Ierymenko 2aa1b5d9b7 Add clock helper field to both member and network to permit time duration calculation easily. 2015-08-24 12:44:07 -07:00
Adam Ierymenko 9a5be0a092 typo 2015-08-24 11:24:33 -07:00
Adam Ierymenko 4da794b389 Add authorizedMemberCount to controller network config records. 2015-08-19 11:43:56 -07:00
Adam Ierymenko 0a5429cab0 Lookup of member must be a left outer join in case the member is being manually inserted before we see the node. 2015-08-17 21:08:02 +00:00
Grant Limberg 7d676ad16a Merge branch 'adamierymenko-dev' into android-jni 2015-08-13 19:36:30 -07:00
Adam Ierymenko b75bdedaee Manually set DeviceInstanceID since this registry key is missing on Windows Vista and Server 2008. 2015-08-13 15:52:54 -07:00
Adam Ierymenko 085734aaba Windows driver (NDIS6) rebuild using earlier DDK revision to allow driver to load in Windows 2008 Server and Windows Vista. Still issues with those platforms, but driver loads -- and shouldn't hurt newer versions (will test). 2015-08-13 15:18:48 -07:00
Grant Limberg 0fd6808e21 Merge branch 'master' into android-jni 2015-08-01 11:52:47 -07:00
Grant Limberg c9b4028cd3 Merge branch 'adamierymenko-dev' into android-jni 2015-07-29 20:13:32 -07:00
Grant Limberg 508d31513a Merge branch 'adamierymenko-dev' into android-jni 2015-07-28 19:18:33 -07:00
Grant Limberg bc0954381c Merge branch 'adamierymenko-dev' into android-jni 2015-07-21 17:53:39 -07:00
Grant Limberg d05e8a9772 Merge branch 'adamierymenko-dev' into android-jni 2015-07-20 19:51:58 -07:00
Grant Limberg 1e8ead441c Merge branch 'adamierymenko-dev' into android-jni 2015-07-16 18:09:57 -07:00
Grant Limberg e45475c5b5 fixed a misspelling 2015-07-09 20:26:23 -07:00
Grant Limberg a408e5f685 set ZT_NO_TYPE_PUNNING and -O3 for Android builds 2015-07-08 18:00:13 -07:00
Grant Limberg f67ddb579d Merge branch 'adamierymenko-dev' into android-jni 2015-07-08 17:30:22 -07:00
Grant Limberg 1ad2cfeedf Merge branch 'adamierymenko-dev' into android-jni 2015-07-07 19:24:02 -07:00
Grant Limberg 6d398beefd Merge branch 'adamierymenko-dev' into android-jni 2015-07-03 18:15:56 -07:00
Grant Limberg ab34884e3e Set -O0
anything above that currently goes kaboom on ARM platforms
2015-07-03 18:14:50 -07:00
Grant Limberg 0b7cd2f40a change some build settings. add a lock 2015-07-01 20:26:14 -07:00
Grant Limberg 2a2e3b80b3 Merge branch 'adamierymenko-dev' into android-jni 2015-07-01 18:13:59 -07:00
Grant Limberg f803dd5ff4 ... 2015-07-01 18:13:39 -07:00
Grant Limberg d853dbf2d8 Merge branch 'adamierymenko-dev' into android-jni 2015-06-30 19:23:23 -07:00
Grant Limberg aee8e95d49 logging 2015-06-30 19:21:46 -07:00
Grant Limberg c9919cc5ba reflect changes to ZT1_PeerRole in JNI 2015-06-26 18:26:57 -07:00
Grant Limberg 9c26d10ea6 Merge branch 'adamierymenko-dev' into android-jni 2015-06-26 17:44:09 -07:00
Grant Limberg bfb152f53f configure the NDK to build all supported ABIs and package them up in the jar 2015-06-24 20:31:22 -07:00
Grant Limberg 759d71037e added Comparable interface to VirtualNetworkConfig so we can sort arrays containing it. 2015-06-23 23:03:02 -07:00
Grant Limberg adf89901c4 dont consider multicast groups in VirtualNetworkConfig.equals() 2015-06-19 19:00:06 -07:00
Grant Limberg dfdd46db80 Merge branch 'adamierymenko-dev' into android-jni 2015-06-17 18:42:23 -07:00
Grant Limberg c59c74ddda Merge branch 'adamierymenko-dev' into android-jni 2015-06-13 14:39:45 -07:00
Grant Limberg abbcb0a12c Modified ant build script so that it can be integrated with Android Studio's build system 2015-06-13 14:38:04 -07:00
Grant Limberg 472206dfb2 Rename JniCache to JniLookup
Removed caching capabilities as the cached methods, fields, and objects appears to be broken on Android
2015-06-10 20:16:13 -07:00
Grant Limberg 7e84f5a7db killing whitespace 2015-06-09 23:24:54 -07:00
Grant Limberg 6889fcfc28 Looks like it was the JNI cash causing the crash.
Forcing it to look up classes and methods instead of caching them stopped the crashes in the GC.  Will investigate more later.
2015-06-09 23:24:47 -07:00
Grant Limberg 4dc0ff8f13 Replace calls to Get<Type>ArrayElements with GetPrimitiveArrayCritical.
This puts code accessing the data in a critical section so that the GC cannot run while JNI has access to the array.  This helps with stability somewhat, but I'm still getting some crashes in the GC
2015-06-09 23:12:44 -07:00
Grant Limberg 3013d90f57 ignore windows binary output 2015-06-09 22:38:31 -07:00
Grant Limberg 60da0e6cae Merge branch 'adamierymenko-dev' into android-jni 2015-06-09 19:38:47 -07:00
Grant Limberg ced040c503 Logging and adding .equals() methods to MulticastGroup and VirtualNetworkCofnig 2015-06-09 19:38:05 -07:00
Grant Limberg 7cc64c5cb6 Might help to set the enabled field on a VirtualNetworkConfig object :) 2015-06-03 21:29:19 -07:00
Grant Limberg b84dba3ecb more logging 2015-06-03 21:29:07 -07:00
Grant Limberg 8fb9df9751 delete dead test code 2015-06-03 18:35:38 -07:00
540 changed files with 49598 additions and 22144 deletions

No files matched your search

+28 -17
View File
@@ -1,5 +1,9 @@
# Main binaries created in *nix builds
/zerotier-*
/zerotier-one
/zerotier-idtool
/zerotier-cli
/zerotier-selftest
/zerotier
# OS-created garbage files from various platforms
.DS_Store
@@ -29,8 +33,13 @@ Thumbs.db
# *nix/Mac build droppings
/build-*
/ZeroTierOneInstaller-*
/examples/docker/zerotier-one
/examples/docker/test-*.env
/world/mkworld
/world/*.c25519
zt1-src.tar.gz
# Miscellaneous file types that we don't want to check in
# Miscellaneous temporaries, build files, etc.
*.log
*.opensdf
*.user
@@ -40,27 +49,26 @@ Thumbs.db
*.pid
*.pkg
*.o
*.a
*.dylib
*.so
*.so.*
*.o-*
*.core
*.deb
*.rpm
*.autosave
*.tmp
# Root topology build files, temporaries, and never check in secrets
/root-topology/bin2c
/root-topology/mktopology
/root-topology/*.secret
/root-topology/test/supernodes
/root-topology/test/test-root-topology
# MacGap wrapper build files
/ext/mac-ui-macgap1-wrapper/src/MacGap.xcodeproj/project.xcworkspace/xcuserdata/*
/ext/mac-ui-macgap1-wrapper/src/MacGap.xcodeproj/xcuserdata/*
/ext/mac-ui-macgap1-wrapper/src/build
# Web UI dev temporaries
/ui/.module-cache
doc/*.1
doc/*.2
doc/*.8
.depend
node_modules
debian/files
debian/zerotier-one
debian/zerotier-one*.debhelper
debian/*.log
debian/zerotier-one.substvars
# Java/Android/JNI build droppings
java/obj/
@@ -71,3 +79,6 @@ java/doc/
java/build_win64/
java/build_win32/
/java/mac32_64/
windows/WinUI/obj/
windows/WinUI/bin/
windows/ZeroTierOne/Debug/
+57 -21
View File
@@ -1,44 +1,80 @@
## Authors
## Primary Authors
* ZeroTier protocol design and core network virtualization engine, ZeroTier One service, React web UI, packaging for most platforms, kitchen sink...<br>
* ZeroTier Core and ZeroTier One virtual networking service<br>
Adam Ierymenko / adam.ierymenko@zerotier.com
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)<br>
Grant Limberg / glimberg@gmail.com
## Contributors
* ZeroTier SDK (formerly known as Network Containers)<br>
Joseph Henry / joseph.henry@zerotier.com
## Third Party Contributors
* A number of fixes and improvements to the new controller, other stuff.<br>
Kees Bos / https://github.com/keesbos
Kees Bos / https://github.com/keesbos/
* Debugging and testing, OpenWRT support fixes.<br>
Moritz Warning / moritzwarning@web.de
* Debian GNU/Linux packaging, manual pages, and license compliance edits.<br>
Ben Finney <ben+zerotier@benfinney.id.au>
* Several others made smaller contributions, which GitHub tracks here:<br>
https://github.com/zerotier/ZeroTierOne/graphs/contributors
https://github.com/zerotier/ZeroTierOne/graphs/contributors/
## Third Party Code
## Third-Party Code
* LZ4 compression algorithm by Yann Collet (BSD license)<br>
http://code.google.com/p/lz4/
These are included in ext/ for platforms that do not have them available in common repositories. Otherwise they may be linked and the package may ship with them as dependencies.
* http-parser by many authors (MIT license)<br>
https://github.com/joyent/http-parser
* LZ4 compression algorithm by Yann Collet
* json-parser by James McLaughlin (BSD license)<br>
https://github.com/udp/json-parser
* Files: ext/lz4/*
* Home page: http://code.google.com/p/lz4/
* License grant: BSD attribution
* TunTapOSX by Mattias Nissler (BSD license)<br>
http://tuntaposx.sourceforge.net
* http-parser by Joyent, Inc. (many authors)
* tap-windows and tap-windows6 by the OpenVPN project (GPL)<br>
https://github.com/OpenVPN/tap-windows<br>
https://github.com/OpenVPN/tap-windows6
* Files: ext/http-parser/*
* Home page: https://github.com/joyent/http-parser/
* License grant: MIT/Expat
* json-parser by James McLaughlin
* Files: ext/json-parser/*
* Home page: https://github.com/udp/json-parser/
* License grant: BSD attribution
* TunTapOSX by Mattias Nissler
* Files: ext/tap-mac/tuntap/*
* Home page: http://tuntaposx.sourceforge.net/
* License grant: BSD attribution no-endorsement
* ZeroTier Modifications: change interface name to zt#, increase max MTU, increase max devices
* 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)
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519
digital signature algorithm, and Poly1305 MAC algorithm, all by
Daniel J. Bernstein (public domain)<br>
http://cr.yp.to/
Daniel J. Bernstein
* MiniUPNPC by Thomas Bernard [BSD]
http://miniupnp.free.fr
* Files:
node/Salsa20.hpp
node/C25519.hpp
node/Poly1305.hpp
* Home page: http://cr.yp.to/
* License grant: public domain
* MiniUPNPC and libnatpmp by Thomas Bernard
* Files:
ext/libnatpmp/*
ext/miniupnpc/*
* Home page: http://miniupnp.free.fr/
* License grant: BSD attribution no-endorsement
+17
View File
@@ -0,0 +1,17 @@
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
Copyright © 2011–2016 ZeroTier, Inc.
ZeroTier One is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at
your option) any later version.
See the file ‘LICENSE.GPL-3’ for the text of the GNU GPL version 3.
If that file is not present, see <http://www.gnu.org/licenses/>.
..
Local variables:
coding: utf-8
mode: text
End:
vim: fileencoding=utf-8 filetype=text :
+339
View File
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+674
View File
File diff suppressed because it is too large. Load diff
-13
View File
@@ -1,13 +0,0 @@
ZeroTier One is licensed under the terms of the GNU General Public License
version 3, which are available here:
http://gplv3.fsf.org/
Modification and redistribution of ZeroTier One is permitted in source form.
Binary distribution is permitted provided all copyright notices remain
intact and any modifications to the source code are also distributed.
ZeroTier One may not be embedded into any closed-source application (e.g. via
linking), nor may closed-source derivatives be created, without a separately
negotiated license from ZeroTier Networks LLC. See the terms of the GPLv3 for
details.
+43 -113
View File
@@ -1,35 +1,51 @@
ZeroTier One
ZeroTier - A Planetary Ethernet Switch
======
ZeroTier is a software defined networking layer for Earth.
ZeroTier is a software-based managed Ethernet switch for planet Earth.
It can be used for on-premise network virtualization, as a peer to peer VPN for mobile teams, for hybrid or multi-data-center cloud deployments, or just about anywhere else secure software defined virtual networking is useful.
It erases the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges arising from the inflexible nature of physical networks obsolete. Everything is encrypted end-to-end and traffic takes the most direct (peer to peer) path available.
ZeroTier One is our OS-level client service. It allows Mac, Linux, Windows, FreeBSD, and soon other types of clients to join ZeroTier virtual networks like conventional VPNs or VLANs. It can run on native systems, VMs, or containers (Docker, OpenVZ, etc.).
This repository contains ZeroTier One, a service that provides ZeroTier network connectivity to devices running Windows, Mac, Linux, iOS, Android, and FreeBSD and makes joining virtual networks as easy as joining IRC or Slack channels. It also contains the OS-independent core ZeroTier protocol implementation in [node/](node/).
Visit [ZeroTier's site](https://www.zerotier.com/) for more information. You can also download professionally packaged binary installers/packages for a variety of supported OSes there if you don't want to build ZeroTier One from source.
Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download.shtml). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
### Getting Started
ZeroTier's basic operation is easy to understand. Devices have 10-digit *ZeroTier addresses* like `89e92ceee5` and networks have 16-digit network IDs like `8056c2e21c000001`. All it takes for a device to join a network is its 16-digit ID, and all it takes for a network to authorize a device is its 10-digit address. Everything else is automatic.
A "device" can be anything really: desktops, laptops, phones, servers, VMs/VPSes, containers, and even (soon) apps.
For testing we provide a public virtual network called *Earth* with network ID `8056c2e21c000001`. On Linux and Mac you can do this with:
sudo zerotier-cli join 8056c2e21c000001
Now wait about 30 seconds and check your system with `ip addr list` or `ifconfig`. You'll see a new interface whose name starts with *zt* and it should quickly get an IPv4 and an IPv6 address. Once you see it get an IP, try pinging `earth.zerotier.net` at `29.209.112.93`. If you've joined Earth from more than one system, try pinging your other machine.
*(IPv4 addresses for Earth are assigned from the block 28.0.0.0/7, which is not a part of the public Internet but is non-standard for private networks. It's used to avoid IP conflicts during testing. Your networks can run any IP addressing scheme you want.)*
If you don't want to belong to a giant Ethernet party line anymore, just type:
sudo zerotier-cli leave 8056c2e21c000001
The *zt* interface will disappear. You're no longer on the network.
To create networks of your own you'll need a network controller. You can use [our hosted controller at my.zerotier.com](https://my.zerotier.com) which is free for up to 100 devices on an unlimited number of networks, or you can build your own controller and run it through its local JSON API. See [README.md in controller/](controller/) for more information.
### Building from Source
For Mac, Linux, and BSD, just type "make" (or "gmake" on BSD). You won't need much installed; here are the requirements for various platforms:
* Mac: Xcode command line tools, and [Packages](http://s.sudre.free.fr/Software/Packages/about.html) if you want to build an OSX .pkg installer ("make mac-dist-pkg"). It should build on OSX 10.7 or newer.
* Linux: gcc/g++ or clang/clang++ (Makefile will use clang by default if available.)
* FreeBSD (and other BSD): C++ compiler (G++ usually) and GNU make (gmake).
* **Mac**: Xcode command line tools. It should build on OSX 10.7 or newer.
* **Linux**: gcc/g++ (4.9 or newer recommended) or clang/clang++ (3.4 or newer recommended) Makefile will use clang by default if available. The Linux build will auto-detect the presence of development headers for *json-parser*, *http-parser*, *li8bnatpmp*, and *libminiupnpc* and will link against the system libraries for these if they are present and recent enough. Otherwise the bundled versions in [ext/](ext/) will be used. Type `make install` to install the binaries and other files on the system, though this will not create init.d or systemd links.
* **FreeBSD**: C++ compiler (G++ usually) and GNU make (gmake).
Each supported platform has its own *make-XXX.mk* file that contains the actual make rules for the platform. The right .mk file is included by the main Makefile based on the GNU make *OSTYPE* variable. Take a look at the .mk file for your platform for other targets, debug build rules, etc.
Windows, of course, is special. We build for Windows with Microsoft Visual Studio 2012 on Windows 7. A solution file is located in the *windows* subfolder. Newer versions of Visual Studio (and Windows) may work but haven't been tested. Older versions almost certainly will not, since they lack things like *stdint.h* and certain STL features. MinGW or other ports of gcc/clang to Windows should also work but haven't been tested. Build steps for Windows are a bit more complicated. For the moment you are on your own there.
Typing `make selftest` will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
Mobile versions are in progress. They don't work yet, and in any case only the glue code will be included in this repository. The full mobile apps are in private repositories on our own git server.
Windows, of course, is special. We build for Windows with Microsoft Visual Studio 2012 on Windows 7. A solution file is located in the *windows/* subfolder. Newer versions of Visual Studio (and Windows) may work but haven't been tested. Older versions almost certainly will not, since they lack things like *stdint.h* and certain STL features. MinGW or other ports of gcc/clang to Windows should also work but haven't been tested.
### Supported Platforms
CPU architecture shouldn't matter unless it's smaller than 32-bit or something really bizarre like a "middle-endian" processor. We have reports of ZeroTier One running on arm32, arm64, and MIPS. It builds and runs out of the box on Raspberry Pi, BeagleBone, BananaPi, and other ARM-based developer/hobbyist boards.
ZeroTier is written in C and C++ (C++03 / ISO/IEC 14882:2003) and uses data structures and algorithms from the C++03 STL. We do not use any C++11 features (yet), since we want to support a few old and embedded platforms that don't have C++11 compilers. You *will* require a compiler and headers new enough to support 64-bit integers (long long) and the *stdint.h* header. The latter could also be faked by adding defines for things like *uint32\_t*, *int64\_t*, etc.
Typing "make selftest" will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
32 and 64 bit X86 and ARM (e.g. Raspberry Pi, Android) are officially supported. Community members have built for MIPS and Sparc without issues.
### Running
@@ -45,10 +61,10 @@ The service is controlled via the JSON API, which by default is available at 127
Here's where home folders live (by default) on each OS:
* Linux: /var/lib/zerotier-one
* BSD: /var/db/zerotier-one
* Mac: /Library/Application Support/ZeroTier/One
* Windows: \\ProgramData\\ZeroTier\\One (That's for Windows 7. The base 'shared app data' folder might be different on different Windows versions.)
* **Linux**: `/var/lib/zerotier-one`
* **FreeBSD**: `/var/db/zerotier-one`
* **Mac**: `/Library/Application Support/ZeroTier/One`
* **Windows**: `\ProgramData\ZeroTier\One` (That's for Windows 7. The base 'shared app data' folder might be different on different Windows versions.)
Running ZeroTier One on a Mac is the same, but OSX requires a kernel extension. We ship a signed binary build of the ZeroTier tap device driver, which can be installed on Mac with:
@@ -56,107 +72,17 @@ Running ZeroTier One on a Mac is the same, but OSX requires a kernel extension.
This will create the home folder for Mac, place *tap.kext* there, and set its modes correctly to enable ZeroTier One to manage it with *kextload* and *kextunload*.
We recommend using our binary packages on Windows, since there are several prerequisites such as a tap driver that must be installed on the system *and* in the home folder.
### Joining A Network
ZeroTier virtual networks are identified by 16-digit hexadecimal network IDs, while devices are identified by 10-digit addresses. To get your address run:
sudo zerotier-cli status
(Use ./zerotier-cli if you're running it right from your build folder.)
You should see something like:
200 info ########## ONLINE #.#.#
That 10-digit hex code is you. It's derived via a one-way proof of work function from your cryptographic public key. Your public key can be found in *identity.public* in ZeroTier's home folder, while *identity.secret* contains your full identity including the secret portion of the key pair.
(The identity files define your device's *identity*. Moving them to another system will move that identity. Be careful when cloning virtual machines that have identities stored on them. If two devices have the same identity, they'll "fight" over it and you won't know which device will receive network packets.)
If you want to do a quick test, you can join [Earth](https://www.zerotier.com/earth.html). It's a global public network that anyone can join. Type:
sudo zerotier-cli join 8056c2e21c000001
Then:
sudo zerotier-cli listnetworks
At first it'll be in *REQUESTING\_CONFIGURATION* state. In a few seconds to a minute you should see something like:
200 listnetworks 8056c2e21c000001 earth.zerotier.net ##:##:##:##:##:## OK PUBLIC zt0 ##.##.##.##/##
Earth will assign you an IP address in the "unofficially available" globally unrouted 28.0.0.0/7 IP block so as to avoid conflicts with local networks. (Your networks can use any IP scheme, or can even leave IP addresses unmanaged.) Once you get an IP, you should be able to ping something:
ping earth.zerotier.net
Go to [http://earth.zerotier.net/](http://earth.zerotier.net/) to see a short little welcome page that will tell you your IP and Ethernet MAC address.
Earth is a public place. If you don't want to stick around run:
sudo zerotier-cli leave 8056c2e21c000001
The network (and associated interface) should be gone.
Networks are created and administrated by network controllers. Most users will want to use our hosted controllers. Visit [our web site](https://www.zerotier.com/) for more information. Later in this README there are brief instructions about building ZeroTier One with network controller support for those who want to try running their own.
Macintosh and Windows installers also install a GUI application.
### Installing
We don't have a "make install" rule quite yet. On Linux you can type:
make installer
This will build a binary that, when run, will install ZeroTier One on most current Linux distributions. We also have RPM and DEB build files in *ext/installfiles/linux* that wrap this installer in packages for RedHat/CentOS and Debian/Ubuntu derived distributions. If *rpmbuild* is present on the system, the RPM will be built. If *dpkg-deb* is present, the DEB package will be built.
On Mac the best way is to install [Packages](http://s.sudre.free.fr/Software/Packages/about.html) and use:
make mac-dist-pkg
This builds a .pkg file that can be installed.
BSD has no installer yet. We're working on it.
Linux/BSD and Mac installations have an *uninstall.sh* file in their ZeroTier home folder that cleanly removes ZeroTier One from the system. Run this with:
sudo /path/to/ZeroTier/home/folder/uninstall.sh
Windows installers are insane. We build our .MSI installers with [Advanced Installer Enterprise](http://www.advancedinstaller.com). The Advanced Installer project file is in *ext/installfiles/windows*. To avoid lasting psychological trauma we recommend leaving Windows installers alone and using the pre-built Windows binaries on our web site.
### Using ZeroTier One in Docker Containers
To run the ZeroTier One service in a Docker container, run it with "--device=/dev/net/tun --cap-add=NET_ADMIN". This will allow ZeroTier One to open a "tap" virtual network port inside the container.
Alternately, you can use Ethernet bridging to bridge the *docker0* device on your system to a ZeroTier virtual network. This allows you to run ZeroTier One on the host and bridge the entire Docker network backplane to a virtual network or other hosts.
We're working on better "official" Docker support. In the meantime there is a [user-contributed project here](https://github.com/davide/docker-zerotier).
### Building with Network Controller Support
**Warning: as of beta version 1.0.3 the new network controller is not heavily tested. We recommend waiting for 1.0.4 to deploy this in production.**
Network controllers are nodes responsible for issuing configurations and certificates to members of ZeroTier virtual networks. Most users won't need to run their own, so this code is by default not included in the ZeroTier One binary.
You can build a network controller on Linux or Mac with:
make ZT_ENABLE_NETWORK_CONTROLLER=1
This will build a version that contains the Sqlite-backed network controller and associated extensions to the JSON local service control API. You will need the development headers for sqlite3 installed. On Mac these ship as part of Xcode, while on Linux they'll be found in packages for the various distributions.
See the JSON API documentation in [service/](service/) for more information about how to control controllers.
### Troubleshooting
For most users, it just works.
If you are running a local system firewall, we recommend adding a rule permitting UDP port 9993 inbound and outbound. If you installed binaries for Windows this should be done automatically. Other platforms might require manual editing of local firewall rules depending on your configuration.
The Mac firewall can be founder under "Security" in System Preferences. Linux has a variety of firewall configuration systems and tools. If you're using Ubuntu's *ufw*, you can do this:
The Mac firewall can be found under "Security" in System Preferences. Linux has a variety of firewall configuration systems and tools. If you're using Ubuntu's *ufw*, you can do this:
sudo ufw allow 9993/udp
On CentOS check */etc/sysconfig/iptables* for IPTables rules. For other distributions consult your distribution's documentation. You'll also have to check the UIs or documentation for commercial third party firewall applications like Little Snitch (Mac), McAfee Firewall Enterprise (Windows), etc. if you are running any of those. Some corporate environments might have centrally managed firewall software, so you might also have to contact IT.
On CentOS check `/etc/sysconfig/iptables` for IPTables rules. For other distributions consult your distribution's documentation. You'll also have to check the UIs or documentation for commercial third party firewall applications like Little Snitch (Mac), McAfee Firewall Enterprise (Windows), etc. if you are running any of those. Some corporate environments might have centrally managed firewall software, so you might also have to contact IT.
ZeroTier One peers will automatically locate each other and communicate directly over a local wired LAN *if UDP port 9993 inbound is open*. If that port is filtered, they won't be able to see each others' LAN announcement packets. If you're experiencing poor performance between devices on the same physical network, check their firewall settings. Without LAN auto-location peers must attempt "loopback" NAT traversal, which sometimes fails and in any case requires that every packet traverse your external router twice.
@@ -166,6 +92,10 @@ If you're interested, there's a [technical deep dive about NAT traversal on our
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
### Contributing
Please make pull requests against the `dev` branch. The `master` branch is release, and `edge` is for unstable and work in progress changes and is not likely to work.
### License
The ZeroTier source code is open source and is licensed under the GNU GPL v3 (not LGPL). If you'd like to embed it in a closed-source commercial product or appliance, please e-mail [contact@zerotier.com](mailto:contact@zerotier.com) to discuss commercial licensing. Otherwise it can be used for free.
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

-153
View File
@@ -1,153 +0,0 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2015 ZeroTier, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --
*
* ZeroTier may be used and distributed under the terms of the GPLv3, which
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
*
* If you would like to embed ZeroTier into a commercial application or
* redistribute it in a modified binary form, please contact ZeroTier Networks
* LLC. Start here: http://www.zerotier.com/
*/
#ifndef ZT_BWACCOUNT_HPP
#define ZT_BWACCOUNT_HPP
#include "Constants.hpp"
#include <algorithm>
#include <stdint.h>
#include <math.h>
#include "Utils.hpp"
#ifdef __WINDOWS__
#define round(x) ((x-floor(x))>0.5 ? ceil(x) : floor(x))
#endif
namespace ZeroTier {
/**
* Bandwidth account used for rate limiting multicast groups
*
* This is used to apply a bank account model to multicast groups. Each
* multicast packet counts against a balance, which accrues at a given
* rate in bytes per second. Debt is possible. These parameters are
* configurable.
*
* A bank account model permits bursting behavior, which correctly models
* how OSes and apps typically use multicast. It's common for things to
* spew lots of multicast messages at once, wait a while, then do it
* again. A consistent bandwidth limit model doesn't fit.
*/
class BandwidthAccount
{
public:
/**
* Create an uninitialized account
*
* init() must be called before this is used.
*/
BandwidthAccount() throw() {}
/**
* Create and initialize
*
* @param preload Initial balance to place in account
* @param maxb Maximum allowed balance (> 0)
* @param acc Rate of accrual in bytes per second
* @param now Current time
*/
BandwidthAccount(uint32_t preload,uint32_t maxb,uint32_t acc,uint64_t now)
throw()
{
init(preload,maxb,acc,now);
}
/**
* Initialize or re-initialize account
*
* @param preload Initial balance to place in account
* @param maxb Maximum allowed balance (> 0)
* @param acc Rate of accrual in bytes per second
* @param now Current time
*/
inline void init(uint32_t preload,uint32_t maxb,uint32_t acc,uint64_t now)
throw()
{
_lastTime = ((double)now / 1000.0);
_balance = preload;
_maxBalance = maxb;
_accrual = acc;
}
/**
* Update and retrieve balance of this account
*
* @param now Current time
* @return New balance updated from current clock
*/
inline uint32_t update(uint64_t now)
throw()
{
double lt = _lastTime;
double nowf = ((double)now / 1000.0);
_lastTime = nowf;
return (_balance = std::min(_maxBalance,(uint32_t)round((double)_balance + ((double)_accrual * (nowf - lt)))));
}
/**
* Update balance and conditionally deduct
*
* If the deduction amount fits, it is deducted after update. Otherwise
* balance is updated and false is returned.
*
* @param amt Amount to deduct
* @param now Current time
* @return True if amount fit within balance and was deducted
*/
inline bool deduct(uint32_t amt,uint64_t now)
throw()
{
if (update(now) >= amt) {
_balance -= amt;
return true;
}
return false;
}
/**
* @return Most recent balance without update
*/
inline uint32_t balance() const
throw()
{
return _balance;
}
private:
double _lastTime;
uint32_t _balance;
uint32_t _maxBalance;
uint32_t _accrual;
};
} // namespace ZeroTier
#endif
File diff suppressed because it is too large. Load diff
Loaded 20 of 540 files, more files were not shown because too many files have changed in this diff. Show more