Compare commits

...
183 Commits
Author SHA1 Message Date
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
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
Adam Ierymenko bf193dd3cf VERSION 1.0.4: Stability, LAN, and NAT traversal improvements
ZeroTier One version 1.0.4 brings several improvements to stability,
connectivity between hosts on the same LAN, and NAT traversal.

Direct connectivity improvements:

 - ZeroTier One now opens port mappings using uPnP and/or NAT-PMP
   if they are available on your network. These are then made
   available to other (1.0.4 or newer) nodes. This should greatly
   improve direct connectivity success rates for users on networks
   that support port mapping. To build with this option, you must
   include ZT_USE_MINIUPNPC=1 on the make path. Pre-build binaries
   are included for many common architectures to make this easier.

 - A new message has been introduced whereby nodes can "push" IP
   address suggestions to other nodes. This is only done to nodes
   with whom you have a trust relationship, which right now means
   they are members of a network you've joined. The IP addresses
   sent include local interface addresses and possibly uPnP mappings
   if any are available. When nodes receive pushed IPs, they can
   attempt connectivity at these addresses. This greatly improves
   connectivity on local LANs, since the old broadcast mechanism
   proved too unreliable under many real world scenarios.

 - IPv6 addresses are also "pushed" via the aforementioned message,
   allowing direct connectivity over IPv6 if both hosts have an
   IPv6 address.

 - Some of the aggressive port-scanning NAT-t behavior has been
   removed, since this occasionally triggered intrusion alarms on
   some networks and proved ineffective in the field. uPnP will be
   a much bigger win, and is less "hacky."

 - The rate of (tiny) UDP keepalive packet generation was slightly
   increased. We were as surprised as you to learn that there are
   many NAT routers in the wild with timeouts as short as 20 seconds
   even though the RFC stipulates that they should be no shorter
   than two minutes (120 seconds).

All of these connectivity improvements rely upon a new message
introduced with 1.0.4, so they'll only work between 1.0.4 nodes.
Older methods of connectivity establishment will continue to work
with earlier versions.

Platform-specific improvements:

 - Many improvements have been made to Windows support and stability.
   The NDIS6 driver is now used exclusively. If you have ports that
   use NDIS5, these will automatically be re-created using the NDIS6
   driver. You may see a "select this network's type" notification
   after 1.0.4 upgrade for this reason.

 - The dependency on the external "devcon.exe" binary on Windows has
   been completely removed in favor of internal direct calls to the
   Windows setup API to add and remove network ports. These are done
   via dynamically loaded instances of the system setup DLLs to use
   the most recent setup API code on your system for improved
   compatibility.

 - This version is tested with Windows 10 release, and was confirmed
   to work on a clean install.

 - The ARM32/Raspbian build is now back to using Debian Wheezy for
   library backward compatibility (binary build only).

 - The Mac icon is now a bit smaller to look better in the dock.

 - The ui/ subfolder is now distributed with the Linux binary installer
   and packages. This means Linux users can navigate to the UI at
   http://127.0.0.1:9993/ and enter their authtoken.secret to use
   the GUI locally. (This port could also be accessed via SSH port
   forwarding or other mechanisms to administrate graphically from a
   remote system.)

Other improvements:

 - The new beta SQLite-backed controller microservice found in
   controller/ and built with the ZT_ENABLE_NETWORK_CONTROLLER=1 make
   option is now in a much more "working" state. Feel free to give
   it a try! If you tried it before, delete controller.db before
   starting the new version.

 - A few tweaks were made to the path selection logic in the hope of
   eliminating some flaky network behavior reported by users.

The next version of ZeroTier One will focus on performance and memory
footprint reduction, and may also include perfect forward security/secrecy
(a.k.a. PFS) once our design is finalized and reviewed.
2015-07-31 11:33:52 -07:00
Adam Ierymenko facb009a1d Add security notice to auto-update info in -h output, and fix a missing paren. 2015-07-31 09:50:55 -07:00
Adam Ierymenko 8d09c37140 Remove a bit of redundant logic, and also announce MULTICAST_LIKEs to controllers (for future use). 2015-07-31 09:37:13 -07:00
Adam Ierymenko f6ced547be Dead code removal. 2015-07-31 08:56:31 -07:00
Adam Ierymenko c826cec1d4 Bring back _winPokeAHole() to dynamically allocate firewall exception. Shouldn't be needed but seems to help on Windows 8. 2015-07-30 17:52:35 -07:00
Adam Ierymenko 620562f7cf Because Windows, because Windows. Now it upgrades correctly from 1.0.1, including automatic driver update from NDIS5 to NDIS6. Also a bit more robust on creating new ports, just in case. 2015-07-30 17:00:57 -07:00
Adam Ierymenko 922d9657b9 Save enumeration of statically assigned IPs so they will always be reassigned on device "power cycle." 2015-07-30 14:10:32 -07:00
Adam Ierymenko 499b2dccad 1.0.4 installer GUID 2015-07-30 13:30:10 -07:00
Adam Ierymenko 1e3d5c4d87 Suppress icacls output on lockDownFile(). 2015-07-30 12:05:56 -07:00
Adam Ierymenko 6f46f0e0e1 Because Windows. 2015-07-30 11:57:48 -07:00
Adam Ierymenko 8169b35482 Kill the devcon.exe dependency by dynamically loading cfgmgr32, newdev, and setupapi and using these functions directly. 2015-07-30 11:31:38 -07:00
Adam Ierymenko 7cd3c419ee 1.0.4 release installer changes 2015-07-29 16:17:52 -07:00
Adam Ierymenko fa03d50e90 Rebuild Mac UI wrapper with smaller icon and a small UI fix. 2015-07-29 15:58:16 -07:00
Adam Ierymenko 0dff741310 Add border around Mac icon so it looks better in Finder. 2015-07-29 15:53:05 -07:00
Adam Ierymenko fcc5bf1e66 Go ahead and spec out controller DB support for AuthToken -- GitHub issue #211 -- even though full implementation won't make it into 1.0.4. 2015-07-29 15:09:23 -07:00
Adam Ierymenko 7578b56298 docs 2015-07-28 17:22:59 -07:00
Adam Ierymenko 2599b1bacc Add CLI support for /explicit/urls (automatically outputs JSON in this case), and some cleanup. 2015-07-28 17:10:56 -07:00
Adam Ierymenko e3983f8a57 Get rid of -I on Mac and Linux since we include miniupnpc headers by direct path reference. 2015-07-28 16:51:46 -07:00
Adam Ierymenko 14264c2d6f Add miniupnpc builds for Windows, fix some Windows build warnings. 2015-07-28 16:50:18 -07:00
Adam Ierymenko 3c54187c40 Linux x86 libminiupnpc.a 2015-07-28 15:56:37 -07:00
Adam Ierymenko 7df4eb69b5 Linux x64 libminiupnpc.a 2015-07-24 17:49:56 -07:00
Adam Ierymenko 559e384130 Linux make support for libminiupnpc. 2015-07-28 15:37:18 -07:00
Adam Ierymenko ebe5c526bb libminiupnpc.a for arm6l 2015-07-28 15:05:04 -07:00
Adam Ierymenko 5097aae716 Add miniupnpc to third party libs. 2015-07-28 14:50:24 -07:00
Adam Ierymenko 569c5e77fd Add binary build of libminiupnpc for Mac x64. 2015-07-28 14:48:26 -07:00
Adam Ierymenko 9c87decba6 Merge branch 'adamierymenko-dev' of http://git.int.zerotier.com/zerotier/zerotierone into adamierymenko-dev 2015-07-28 14:32:46 -07:00
Adam Ierymenko fe6d5b1402 UPNP/NAT-PMP support with libminiupnpc (if built with it) -- GitHub issue #64 2015-07-28 14:32:02 -07:00
Adam Ierymenko eea8d58afa docs,cleanup 2015-07-28 12:39:03 -07:00
Adam Ierymenko 21e6850722 Cancel NAT-t attempts if peer is no longer "alive" 2015-07-28 12:18:59 -07:00
Adam Ierymenko 5986d83738 Kill more kittens. 2015-07-28 12:04:14 -07:00
Adam Ierymenko 4564dd95ff Revert... no luck with any of that. 2015-07-28 12:00:50 -07:00
Adam Ierymenko d2bfdfa6e7 Play with NAT-t tweaks some more. 2015-07-28 11:57:18 -07:00
Adam Ierymenko b69afa010e Disable type punning on ARM by ifdef. 2015-07-28 11:50:01 -07:00
Adam Ierymenko 708aac1ea7 Remove some left over debug code, and fix attempt to send to self if we are an active bridge. 2015-07-28 11:43:09 -07:00
Adam Ierymenko 17bfd4d55e Add TRACE for NAT-t debugging. 2015-07-28 11:32:34 -07:00
Adam Ierymenko b31071463c Try another NAT traversal improvement. 2015-07-28 11:28:47 -07:00
Adam Ierymenko dda376c9eb Nuke some abandoned code. 2015-07-28 11:16:43 -07:00
Adam Ierymenko 40d5c79b62 Enable SO_NO_CHECK if available to skip UDP checksum on packet send for slight performance improvement. We do our own cryptographically secure authentication so UDP checksum is worthless. 2015-07-28 10:29:25 -07:00
Adam Ierymenko 1537109514 Merge branch 'master' into adamierymenko-dev 2015-07-28 09:40:54 -07:00
Adam Ierymenko 66c74f0ad9 Merge pull request #215 from nelsonjchen/patch-2
Update Application Mac Menu. Small MacGap leftover.
2015-07-28 09:39:42 -07:00
Adam Ierymenko 821f1f366e Fix to NAT escalation sequence. 2015-07-27 17:34:58 -07:00
Adam Ierymenko e99eda4a4a Fix IP scoping bug, and disable remotely reported surface push... not helping. :( 2015-07-27 17:28:13 -07:00
Adam Ierymenko fadb291962 Fix infinite loop typo. 2015-07-27 17:14:49 -07:00
Adam Ierymenko f0003ea922 Push remote surface as reported by peers along with known interface direct paths to assist with (some) NAT traversal. (trying this, may back out if not effective) 2015-07-27 17:02:43 -07:00
Adam Ierymenko e30ba3e138 Eliminate some aggressive port scanning NAT-t behavior that has proven ineffective. 2015-07-27 16:43:27 -07:00
Adam Ierymenko 7a15d8a7e3 Fix leaving of networks to actually call Network::destroy(). 2015-07-24 14:50:44 -07:00
Adam Ierymenko dba91eaa09 Apply same Linux compiler-picker logic to Mac. 2015-07-24 13:17:41 -07:00
Adam Ierymenko d57ea671d7 Add version to log. 2015-07-24 09:59:17 -07:00
Adam Ierymenko d647a587a1 (1) Fix updating of network revision counter on member change.
(2) Go back to timestamp as certificate revision number. This is simpler
    and more robust than using the network revision number for this and
    forcing network revision fast-forward, which could cause some peers
    to fall off the horizon when you don't want them to.
2015-07-23 17:18:20 -07:00
Adam Ierymenko a493fc23f4 Fix for make-linux: detect whether CC/CXX were explicitly overridden, and if not then use the gcc/clang selection logic. Otherwise ?= breaks this. 2015-07-23 13:05:18 -07:00
Adam Ierymenko b3516c599b Add a rate limiting circuit breaker to the network controller to prevent flooding attacks and race conditions. 2015-07-23 10:10:17 -07:00
Adam Ierymenko 3ba54c7e35 Eliminate some poorly thought out optimizations from the netconf/controller interaction,
and go ahead and bump version to 1.0.4.

For a while in 1.0.3 -dev I was trying to optimize out repeated network controller
requests by using a ratcheting mechanism. If the client received a network config
that was indeed different from the one it had, it would respond by instantlly
requesting it again.

Not sure what I was thinking. It's fundamentally unsafe to respond to a message
with another message of the same type -- it risks a race condition. In this case
that's exactly what could happen.

It just isn't worth the added complexity to avoid a tiny, tiny amount of network
overhead, so I've taken this whole path out.

A few extra bytes every two minutes isn't worth fretting about, but as I recall
the reason for this optimization was to save CPU on the controller. This can be
achieved by just caching responses in memory *there* and serving those same
responses back out if they haven't changed.

I think I developed that 'ratcheting' stuff before I went full time on this. It's
hard to develop stuff like this without hours of sustained focus.
2015-07-23 09:50:10 -07:00
Nelson Chen b41079ddf9 Update Application Mac Menu. Small MacGap leftover.
Hide ZeroTier One, not MacGap. 

Just a papercut.
2015-07-22 22:40:43 -07:00
Adam Ierymenko e2a2993b18 Add a Log table to log queries for debugging and security logging. No JSON API support for querying the log yet, but will probably come via /network/###/member/###/log/... or something. 2015-07-22 14:01:49 -07:00
Adam Ierymenko 8ca885d27c Merge pull request #212 from keesbos/fix
Fix for output of empty (no members) network
2015-07-22 09:34:17 -07:00
Adam Ierymenko 7c761dea72 Fix to member listing: I wanted an object with member IDs as keys and member revisions as values, not an array. 2015-07-21 14:12:22 -07:00
Adam Ierymenko 3f8a5b8b76 List members in the form of a hash of member ID and member revision so code can quickly detect which members have changed. 2015-07-21 13:38:59 -07:00
Adam Ierymenko a061aa3d87 Remove "members" from Network record and instead enumerate members via specific query to /network/nwid/member sub-path. More RESTful, scalable, and compatible with how OnePoint code works. 2015-07-21 12:57:01 -07:00
Adam Ierymenko b343eac10d Fix IP auto-assign bug due to missing subnet routes. 2015-07-21 12:42:43 -07:00
Adam Ierymenko 649a12472b Report controllerInstanceId in all objects so that controller resets can be easily detected by whatever is using the service. 2015-07-21 10:39:29 -07:00
Adam Ierymenko cac6be87ba Fix bug in rules JSON output. 2015-07-20 16:31:37 -07:00
Adam Ierymenko 38d34a7495 Proper handling of NULL entry for etherType in rules table. 2015-07-20 15:11:53 -07:00
Adam Ierymenko fb4c3dd8d4 Fix string overwrite bug. 2015-07-20 14:31:33 -07:00
Adam Ierymenko 1ffd67e014 Get rid of false foreign key in Relay. 2015-07-20 14:28:30 -07:00
Adam Ierymenko 8c18c60c00 sp. 2015-07-17 15:30:13 -07:00
Adam Ierymenko bca8886ff8 IP assignment pool range bug fix. 2015-07-17 15:09:28 -07:00
Adam Ierymenko 1f7bb67069 Fix some SQL and make instanceId more robustly random. 2015-07-17 13:09:53 -07:00
Adam Ierymenko 712e2785f2 Fix bad JSON in response. 2015-07-17 12:24:42 -07:00
Adam Ierymenko 5515909c1e Add a concept of an "instanceId" to the controller, which the OnePoint can use to determine whether it is the same running database instance it already knows. 2015-07-17 10:47:21 -07:00
Grant Limberg 5ef806c43c Fix addLocalInterfaceAddress call in OneService on Windows 2015-07-16 19:20:43 -07:00
Adam Ierymenko 0db7c94c90 Add memberRevision stuff to JSON output, and update docs. 2015-07-16 17:42:47 -07:00
Adam Ierymenko 99969b186b Add a concept of a member revision counter to networks. This can be used to select all members that have been added or changed since a given point. 2015-07-16 17:34:03 -07:00
Adam Ierymenko f9f7de0ec7 Networks don't need their ID as a default name. 2015-07-14 15:54:56 -07:00
Adam Ierymenko d27c14af48 Don't allow zero as a network number. 2015-07-14 12:32:57 -07:00
Adam Ierymenko 88949a750f Workaround for uclibc missing map::operator==() 2015-07-13 11:39:55 -07:00
Adam Ierymenko 547b1c6157 Add additional TRACE output in pushDirectPaths. 2015-07-13 10:35:33 -07:00
Adam Ierymenko 0b354803f3 Clean up some YAGNI issues with implementation of GitHub issue #180, and make best path choice aware of path rank. 2015-07-13 10:03:04 -07:00
Adam Ierymenko 0b9524f23d Merge branch 'adamierymenko-dev' of http://git.int.zerotier.com/zerotier/zerotierone into adamierymenko-dev 2015-07-13 09:30:02 -07:00
Adam Ierymenko 4bf3bcbd55 Fixes to PUSH_DIRECT_PATHS. 2015-07-13 09:29:51 -07:00
Adam Ierymenko 3f0eca72f7 ZT_TRACE build fix. 2015-07-13 08:36:22 -07:00
Adam Ierymenko fe20f0d7cd Put back legacy code to listen for LAN announcements to support same network location with pre-1.0.4 clients. 2015-07-13 08:33:02 -07:00
Adam Ierymenko d78e3bb307 Disable HTTP test in selftest since it works, and GitHub issue #207. 2015-07-13 07:42:20 -07:00
Adam Ierymenko a297e4a5bf Add build def ZT_NO_TYPE_PUNNING, which when defined disables type punning code that might cause unaligned access errors on architectures that care (e.g. Android/ARM) 2015-07-08 09:12:51 -07:00
Adam Ierymenko 412389ec75 Implement ERROR_UNWATNED_MULTICAST 2015-07-07 11:49:38 -07:00
Adam Ierymenko cf6f30963c Kill a potential source of type punning BUS errors on Android, and besides that hack probably did not improve performance at all given the short lenghts of things compared with secureEq() 2015-07-07 10:59:59 -07:00
Adam Ierymenko 3f567a07ca Save a little bit of RAM by getting rid of overkill CMWC4096 non-crypto PRNG and replacing it with a simple non-crypto PRNG that just uses Salsa20. 2015-07-07 10:49:50 -07:00
Adam Ierymenko 41fc08b330 etherTypeName() is only used in Switch and only with ZT_TRACE 2015-07-07 10:06:05 -07:00
Adam Ierymenko 07ea4fd4f9 Fix potential bug in controller config request. 2015-07-07 10:02:48 -07:00
Adam Ierymenko 778c7e6e70 More cleanup to direct path push, comment fixes, etc. 2015-07-07 10:00:34 -07:00
Adam Ierymenko c863ff3f02 A bunch of comments and cleanup, including some to yesterday's direct path pushing changes. Move path viability check to one place, and stop trying to use link-local addresses since they are not reliable. 2015-07-07 08:54:48 -07:00
Adam Ierymenko f398952a6c Revert some bad docs in Packet -- I think we will still use that. Also rename addMembershipCertificate to more security-descriptive validateAndAddMembershipCertificate, give it a return value, and drop unused force parameter. 2015-07-07 08:14:41 -07:00
Adam Ierymenko 56285ec0d4 Another attempt at a fix for all the Windows driver coma issues. 2015-07-06 17:58:04 -07:00
Adam Ierymenko 25a067c8c3 Eliminate debug printf(). 2015-07-06 17:37:32 -07:00
Adam Ierymenko 91fa643131 Minor fix to Windows local adapter address enumeration. 2015-07-06 17:36:58 -07:00
Adam Ierymenko 6da9d2d36f Remove debug printf(). 2015-07-06 17:23:22 -07:00
Adam Ierymenko f881cdd767 Add new .h file to VS build, and Windows side of local interface address enumeration. 2015-07-06 17:22:37 -07:00
Adam Ierymenko 84ba365c77 Fix bug in direct path push send. 2015-07-06 17:20:41 -07:00
Adam Ierymenko f9f4dd5276 Fix FreeBSD regression -- gmake defaults g++ which does not exist. 2015-07-06 16:47:41 -07:00
Adam Ierymenko cac55105c3 Fix a regression. 2015-07-06 16:40:23 -07:00
Adam Ierymenko a87cd2d094 Unix side of local interface address awareness for GitHub issue #180. 2015-07-06 16:32:34 -07:00
Adam Ierymenko 235f4762b7 Plumbing for local interface addresses -- GitHub issue #180 2015-07-06 15:51:04 -07:00
Adam Ierymenko 79e9a8bcc2 Almost everything for GitHub issue #180 except direct path map setup. 2015-07-06 15:28:48 -07:00
Adam Ierymenko fad9dff2db Almost all of GitHub issue #180 2015-07-06 15:05:04 -07:00
Adam Ierymenko 1632aec102 Check Network::isAllowed() always on multicast send. 2015-07-06 14:53:27 -07:00
Adam Ierymenko 255320e2a6 pushDirectPaths() implementation 2015-07-06 14:39:28 -07:00
Adam Ierymenko 93bb934d4e Some cleanup, docs, and Path -> Path > RemotePath refactor. 2015-07-06 14:08:13 -07:00
Adam Ierymenko feddd946f9 For curiosity add Salsa20/8 to benchmarks. 2015-07-06 13:51:25 -07:00
Adam Ierymenko 6bfbc43e3c Include COM with EXT_FRAME in bridged case. 2015-07-06 12:46:27 -07:00
Adam Ierymenko 35b5dcf89d Kill debug line. 2015-07-06 12:39:20 -07:00
Adam Ierymenko 9743db3538 docs 2015-07-06 12:37:37 -07:00
Adam Ierymenko e5f7c55c54 Documentation in Packet, more work on path push, and clean up ancient legacy support code in Switch. 2015-07-06 12:34:35 -07:00
Adam Ierymenko df08c2cfab Merge pull request #203 from mwarning/loadlibs
rename LIBS to LDLIBS and make it accessible from outside
2015-07-06 09:01:38 -07:00
Moritz Warning 21cdfb96de rename LIBS to LDLIBS and make it accessible from outside 2015-07-06 00:09:03 +02:00
Kees Bos 53c7f61f98 Fix for output of empty (no members) network 2015-07-05 13:27:27 +02:00
Adam Ierymenko 532f413472 Merge pull request #202 from mwarning/openwrt
allow environment variables to set/extend build variables
2015-07-03 14:28:53 -07:00
Moritz Warning 235d4aba9a allow environment variables to set/extend CC, CXX, CFLAGS and LDFLAGS 2015-07-03 23:21:23 +02:00
Adam Ierymenko cfdf4e3a49 GitHub issue #171 -- separate CFLAGS and CXXFLAGS in Linux makefile 2015-07-02 09:13:56 -07:00
Adam Ierymenko f19c3c51d3 Revert slow non-SSE Salsa20 modification since it did not fix Android/ARM issue. Also update Salsa20 comments and clean up a bit. 2015-07-02 09:00:00 -07:00
Adam Ierymenko 7c9949eea3 For @glimberg -- a *possible* fix to the alignment headaches on Android/ARM. If this works we should find a define that can be used to enable it there since it will slow things down on non-x86 other architectures. 2015-07-01 12:29:23 -07:00
Adam Ierymenko 0cbbcf2884 Rename VERB_CMA to the more descriptive VERB_PHYSICAL_ADDRESS_PUSH 2015-06-29 16:01:01 -07:00
Adam Ierymenko 30e4a188d0 ipLocalRoutes now exposed via network objects in JSON controller API, and documentation changes. 2015-06-29 15:34:26 -07:00
Adam Ierymenko 5c9411a671 Untested -- modifications to support IP ranges instead of ip/mask for IP assignment pools, also add portId to Rule for future use. 2015-06-29 14:52:09 -07:00
Adam Ierymenko 48a2ad032a (1) Both nodeId and portId in Rule can be NULL, (2) remove on delete cascade since rules should never mysteriously disappear from the rules table. If it let you delete a node with rules, that would be a UI or cleanup function bug. 2015-06-29 10:47:47 -07:00
Adam Ierymenko f05e62deae DB schema changes: separate portId in rules, ranges in IP assignment pools. (No code changes yet so code is broken.) 2015-06-29 10:40:31 -07:00
Adam Ierymenko dbee1b38b3 Fix semantics of std::unique() to actually remove duplicates (hidden memory leak?) 2015-06-29 10:21:28 -07:00
Adam Ierymenko 3f71afd0fb Put multicast txQueue back to list. 2015-06-26 14:26:35 -07:00
Adam Ierymenko 221df51875 Add Kees Bos to AUTHORS :) 2015-06-26 13:04:52 -07:00
Adam Ierymenko f33f3fcb72 Merge pull request #196 from keesbos/fixes
Fixes for controller
2015-06-26 13:02:33 -07:00
Adam Ierymenko 57c7992c78 GitHub issue #191 - kill intra-network multicast rate limits (which were not well supported or easily configurable anyway) -- this is really left over from the old collaborative multicast propagation algorithm. New algorithm (in for a while) has been sender-side replication in which sender "pays" all bandwidth, which intrinsically limits multicast. 2015-06-26 12:36:45 -07:00
Adam Ierymenko c287ae4d1d Redo conversion of _networks to a vector. Just use a simple linear search and put the nwid in a pair with the pointer so linear search can be done without pointer chasing. This should be the fastest option for anything less than dozens of networks, and should save memory over the old map. 2015-06-26 11:38:31 -07:00
Kees Bos 3eca5d9c29 Fix reporting of ipAssignments for ipv4 2015-06-26 07:22:30 +02:00
Kees Bos 8a68624dae Fix cert verification check for self signed signatures 2015-06-26 07:22:13 +02:00
Adam Ierymenko daebce4994 Merge pull request #192 from mwarning/replace_erase
replace vector::erase, was missed in a previous commit (ref #186)
2015-06-23 11:13:20 -07:00
Moritz Warning def9cf2a6a replace vector::erase, was missed in a previous commit (ref #186) 2015-06-23 00:09:15 +02:00
Adam Ierymenko 4aa8449fe1 Merge branch '_networks_vector' of https://github.com/mwarning/ZeroTierOne into adamierymenko-dev 2015-06-22 10:34:55 -07:00
Adam Ierymenko 53aad7f6bd Merge pull request #189 from keesbos/bugfix-auth-member
Fixed member authorization bug and minor cleanup
2015-06-22 10:17:14 -07:00
Moritz Warning 787608b568 use _network function to reduce source code complexity 2015-06-20 16:34:19 +02:00
Moritz Warning 2b04ac5e9b replace _networks map by vector
_networks is usually quite small, using binary search on a vector might be faster comapred to std::map.
This is especially true when using uClibc++, which uses a list.
2015-06-20 16:25:21 +02:00
Kees Bos 50d4f66d73 Fixed member authorization bug and minor cleanup 2015-06-19 21:19:42 +02:00
Adam Ierymenko 7bae95836c Root server terminology cleanup, and tighten up a security check by checking full identity of peers instead of just address. 2015-06-19 10:23:25 -07:00
Adam Ierymenko 07f84a99b4 Rebuild properly signed root topology after supernode -> rootserver name change. 2015-06-19 09:52:45 -07:00
Adam Ierymenko f89f02ce9e Merge pull request #187 from keesbos/fix-ipv4-assignment
Fix for ipv4 assignment
2015-06-19 09:08:06 -07:00
Adam Ierymenko be4f08a548 Merge pull request #186 from mwarning/txQueue_vector
replace txQueue list by vector for faster memory access and less allo…
2015-06-18 15:42:12 -07:00
Moritz Warning 0073d0f694 replace txQueue list by vector for faster memory access and less allocations 2015-06-19 00:28:51 +02:00
Kees Bos 16eae132fa Fix for ipv4 assignment 2015-06-18 19:14:52 +02:00
Adam Ierymenko 6fc150bddb Move js/ to ZeroTierIntegrations project. 2015-06-18 08:01:28 -07:00
Adam Ierymenko 87bb0086de Almost certain fix for GitHub issue #184 on -dev 2015-06-17 12:46:12 -07:00
Adam Ierymenko 1d0654bd14 Merge pull request #182 from keesbos/rootserver
Renamed supernode to rootserver
2015-06-16 13:50:29 -07:00
Adam Ierymenko 463442eb6f Merge pull request #181 from keesbos/bugfix
Bugfixes
2015-06-16 13:50:13 -07:00
Kees Bos 4affa10ca0 Fix 404 on creation of new network 2015-06-15 10:29:12 +02:00
Kees Bos 2e1d363a86 Removed a superfluous cross join 2015-06-15 03:19:25 +02:00
Kees Bos 1cbdae65fe Fix controller/network/*/member/*
Cross join works other than expected or something changed. The
_sGetMember2 returned too many rows. Replaced it with an explicit
join statement.
2015-06-15 03:19:25 +02:00
Kees Bos dcbae5f313 Bugfix controller get member info 2015-06-15 03:19:25 +02:00
Adam Ierymenko 845955dea5 Add definition for VERB_CMA -- GitHub issue #180 2015-06-13 18:08:00 +02:00
Adam Ierymenko 8aa68cd5f1 Add new fields in operator== 2015-06-13 13:13:19 +02:00
Adam Ierymenko edbc5d3588 Gateways support in NetworkConfig object. 2015-06-13 13:06:49 +02:00
Adam Ierymenko 96a58becf8 Gateways support in network controller schema and database (not implemented yet in client) toward GitHub issue #178 2015-06-13 11:34:31 +02:00
Adam Ierymenko 8a9715f183 Rename ruleId to ruleNo and optimize some indexes in Sqlite3 schema. 2015-06-13 10:05:34 +02:00
Adam Ierymenko 1b122cddbd Merge pull request #179 from keesbos/bugfix
Pickup return code from handleControlPlaneHttpGET and handleControlPlaneHttpPOST
2015-06-13 09:37:00 +02:00
Kees Bos 42390e662b Pickup return code from handleControlPlaneHttpGET and handleControlPlaneHttpPOST 2015-06-13 03:14:06 +02:00
Adam Ierymenko 494681a482 This might be a final fix for GitHub issue #173 and possibly others: ACTIVELY detect borked port status on Windows and if any "cable unplugged" or other wacky states are detected whack the adapter (close and reopen). Tested adding a whole bunch of windows networks, removing, adding more, etc. and it seems to work very well! 2015-06-12 16:02:04 +02:00
Adam Ierymenko dbf40f30f9 Merge pull request #177 from keesbos/linux-ui
Linux ui
2015-06-12 13:49:45 +02:00
Kees Bos dc50e8ae5b Add ui to /var/lib/zerotier (linux installer) 2015-06-11 17:56:54 +02:00
Kees Bos 7a55c6b388 Return 404 on delete if network member is missing (controller) 2015-06-11 12:20:52 +02:00
Kees Bos c2ce018202 Return 404 on delete if network doesn't exist (controller) 2015-06-11 12:10:25 +02:00
Kees Bos 0d0af07ce9 Get deletion of networks in controller going
Multiple statements in a sqlite3_prepare_v2 is not usable. Only
the first statement will be executed.

Since the schema now uses 'ON DELETE CASCADE', there's only
one statement needed.

If multiple statements are needed, there should be either multiple
sqlite3_prepare_v2 calls be used or the sqlite3_exec function.
2015-06-11 11:49:13 +02:00
Kees Bos de697a1c45 Change schema to enforce foreing keys
The foreign keys have 'ON DELETE CASCADE' to simplify the removal
of networks etc. (controller code)

Some unique constraints are replaced with a multi column primary
key.

To update an existing database:
 * install updated binaries
 * stop service
 * sqlite3 controller.db .dump | \
    egrep '((^PRAGMA)|(^BEGIN)|(^INSERT)|(^COMMIT))' | \
    grep -v 'schemaVersion' > data.sql
 * mv controller.db controller.db.backup
 * start service
 * stop service
 * sqlite3 controller.db < data.sql
 * start service
2015-06-11 11:35:25 +02:00
Adam Ierymenko 00aa115898 Allow double-close just in case in Phy<> 2015-06-09 16:30:44 +02:00
Adam Ierymenko 17ca5be4c1 Rework Phy<> to clean up _socks entries only in poll() to fix instability in proxy. 2015-06-09 16:27:11 +02:00
Adam Ierymenko ab720a6f1e Fix for poll() in Phy<> with no sockets open. Only affects tcp-proxy. 2015-06-05 13:48:33 -07:00
Adam Ierymenko e5e11c1b24 Update AUTHORS, change to MarkDown. 2015-06-04 11:58:49 -07:00
Kees Bos a425bbc673 Renamed supernode to rootserver 2015-05-06 12:05:20 +02:00
135 changed files with 5573 additions and 2489 deletions

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
## Authors
* ZeroTier protocol design and core network virtualization engine, ZeroTier One service, React web UI, packaging for most platforms, kitchen sink...<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
* A number of fixes and improvements to the new controller, other stuff.<br>
Kees Bos / https://github.com/keesbos
* Debugging and testing, OpenWRT support fixes.<br>
Moritz Warning / moritzwarning@web.de
* Several others made smaller contributions, which GitHub tracks here:<br>
https://github.com/zerotier/ZeroTierOne/graphs/contributors
## Third Party Code
* LZ4 compression algorithm by Yann Collet (BSD license)<br>
http://code.google.com/p/lz4/
* http-parser by many authors (MIT license)<br>
https://github.com/joyent/http-parser
* json-parser by James McLaughlin (BSD license)<br>
https://github.com/udp/json-parser
* TunTapOSX by Mattias Nissler (BSD license)<br>
http://tuntaposx.sourceforge.net
* tap-windows and tap-windows6 by the OpenVPN project (GPL)<br>
https://github.com/OpenVPN/tap-windows<br>
https://github.com/OpenVPN/tap-windows6
* 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/
* MiniUPNPC by Thomas Bernard [BSD]
http://miniupnp.free.fr
-27
View File
@@ -1,27 +0,0 @@
ZeroTier One is designed and written by Adam Ierymenko, with a few bug
fixes and other contributions from other users. Information about all
contributors can be found on the GitHub home page at:
https://github.com/zerotier/ZeroTierOne
ZeroTier One includes the following third party code:
* LZ4 compression algorithm by Yann Collet (BSD license)
http://code.google.com/p/lz4/
* http-parser by many authors (MIT license)
https://github.com/joyent/http-parser
* json-parser by James McLaughlin (BSD license)
https://github.com/udp/json-parser
* TunTapOSX by Mattias Nissler (forked for ZT1) (BSD license)
http://tuntaposx.sourceforge.net
* tap-windows by the OpenVPN project (forked for ZT1) (GPL)
https://github.com/OpenVPN/tap-windows
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519
digital signature algorithm, and Poly1305 MAC algorithm, all by
Daniel J. Bernstein (public domain)
http://cr.yp.to/
+1 -1
View File
@@ -164,7 +164,7 @@ Users behind certain types of firewalls and "symmetric" NAT devices may not able
If you're interested, there's a [technical deep dive about NAT traversal on our blog](https://www.zerotier.com/blog/?p=226). A troubleshooting tool to help you diagnose NAT issues is planned for the future as are uPnP/IGD/NAT-PMP and IPv6 transport.
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to supernodes over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
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.
### License
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.
File renamed without changes.
File diff suppressed because it is too large. Load diff
+25 -2
View File
@@ -80,6 +80,13 @@ public:
std::string &responseContentType);
private:
enum IpAssignmentType {
// IP assignment is a static IP address
ZT_IP_ASSIGNMENT_TYPE_ADDRESS = 0,
// IP assignment is a network -- a route via this interface, not an address
ZT_IP_ASSIGNMENT_TYPE_NETWORK = 1
};
unsigned int _doCPGet(
const std::vector<std::string> &path,
const std::map<std::string,std::string> &urlArgs,
@@ -89,6 +96,10 @@ private:
std::string &responseContentType);
std::string _dbPath;
std::string _instanceId;
std::map< std::pair<Address,uint64_t>,uint64_t > _lastRequestTime;
sqlite3 *_db;
sqlite3_stmt *_sGetNetworkById;
@@ -99,13 +110,14 @@ private:
sqlite3_stmt *_sUpdateNode;
sqlite3_stmt *_sUpdateNode2;
sqlite3_stmt *_sGetEtherTypesFromRuleTable;
sqlite3_stmt *_sGetMulticastRates;
sqlite3_stmt *_sGetActiveBridges;
sqlite3_stmt *_sGetIpAssignmentsForNode;
sqlite3_stmt *_sGetIpAssignmentPools;
sqlite3_stmt *_sGetLocalRoutes;
sqlite3_stmt *_sCheckIfIpIsAllocated;
sqlite3_stmt *_sAllocateIp;
sqlite3_stmt *_sDeleteIpAllocations;
sqlite3_stmt *_sDeleteLocalRoutes;
sqlite3_stmt *_sGetRelays;
sqlite3_stmt *_sListNetworks;
sqlite3_stmt *_sListNetworkMembers;
@@ -122,8 +134,19 @@ private:
sqlite3_stmt *_sDeleteIpAssignmentPoolsForNetwork;
sqlite3_stmt *_sDeleteRulesForNetwork;
sqlite3_stmt *_sCreateIpAssignmentPool;
sqlite3_stmt *_sUpdateMemberAuthorized;
sqlite3_stmt *_sUpdateMemberActiveBridge;
sqlite3_stmt *_sDeleteMember;
sqlite3_stmt *_sDeleteNetworkAndRelated;
sqlite3_stmt *_sDeleteNetwork;
sqlite3_stmt *_sGetGateways;
sqlite3_stmt *_sDeleteGateways;
sqlite3_stmt *_sCreateGateway;
sqlite3_stmt *_sIncrementMemberRevisionCounter;
sqlite3_stmt *_sGetConfig;
sqlite3_stmt *_sSetConfig;
sqlite3_stmt *_sPutLog;
sqlite3_stmt *_sGetMemberLog;
sqlite3_stmt *_sGetRecentMemberLog;
Mutex _lock;
};
+82 -63
View File
@@ -3,53 +3,6 @@ CREATE TABLE Config (
v varchar(1024) NOT NULL
);
CREATE TABLE IpAssignment (
networkId char(16) NOT NULL,
nodeId char(10) NOT NULL,
ip blob(16) NOT NULL,
ipNetmaskBits integer NOT NULL DEFAULT(0),
ipVersion integer NOT NULL DEFAULT(4)
);
CREATE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);
CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);
CREATE TABLE IpAssignmentPool (
networkId char(16) NOT NULL,
ipNetwork blob(16) NOT NULL,
ipNetmaskBits integer NOT NULL,
ipVersion integer NOT NULL DEFAULT(4)
);
CREATE INDEX IpAssignmentPool_networkId ON IpAssignmentPool (networkId);
CREATE TABLE Member (
networkId char(16) NOT NULL,
nodeId char(10) NOT NULL,
authorized integer NOT NULL DEFAULT(0),
activeBridge integer NOT NULL DEFAULT(0)
);
CREATE INDEX Member_networkId ON Member (networkId);
CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);
CREATE UNIQUE INDEX Member_networkId_nodeId ON Member (networkId, nodeId);
CREATE TABLE MulticastRate (
networkId char(16) NOT NULL,
mgMac char(12) NOT NULL,
mgAdi integer NOT NULL DEFAULT(0),
preload integer NOT NULL,
maxBalance integer NOT NULL,
accrual integer NOT NULL
);
CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);
CREATE TABLE Network (
id char(16) PRIMARY KEY NOT NULL,
name varchar(128) NOT NULL,
@@ -60,31 +13,97 @@ CREATE TABLE Network (
v6AssignMode varchar(8) NOT NULL DEFAULT('none'),
multicastLimit integer NOT NULL DEFAULT(32),
creationTime integer NOT NULL DEFAULT(0),
revision integer NOT NULL DEFAULT(1)
revision integer NOT NULL DEFAULT(1),
memberRevisionCounter integer NOT NULL DEFAULT(1)
);
CREATE TABLE Relay (
networkId char(16) NOT NULL,
nodeId char(10) NOT NULL,
phyAddress varchar(64) NOT NULL
CREATE TABLE AuthToken (
id integer PRIMARY KEY NOT NULL,
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
authMode integer NOT NULL DEFAULT(1),
useCount integer NOT NULL DEFAULT(0),
maxUses integer NOT NULL DEFAULT(0),
expiresAt integer NOT NULL DEFAULT(0),
token varchar(256) NOT NULL
);
CREATE INDEX Relay_networkId ON Relay (networkId);
CREATE UNIQUE INDEX Relay_networkId_nodeId ON Relay (networkId, nodeId);
CREATE INDEX AuthToken_networkId_token ON AuthToken(networkId,token);
CREATE TABLE Node (
id char(10) PRIMARY KEY NOT NULL,
identity varchar(4096) NOT NULL,
lastAt varchar(64),
lastSeen integer NOT NULL DEFAULT(0),
firstSeen integer NOT NULL DEFAULT(0)
identity varchar(4096) NOT NULL
);
CREATE TABLE Rule (
CREATE TABLE Gateway (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
ip blob(16) NOT NULL,
ipVersion integer NOT NULL DEFAULT(4),
metric integer NOT NULL DEFAULT(0)
);
CREATE UNIQUE INDEX Gateway_networkId_ip ON Gateway (networkId, ip);
CREATE TABLE IpAssignment (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
nodeId char(10) REFERENCES Node(id) ON DELETE CASCADE,
type integer NOT NULL DEFAULT(0),
ip blob(16) NOT NULL,
ipNetmaskBits integer NOT NULL DEFAULT(0),
ipVersion integer NOT NULL DEFAULT(4)
);
CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);
CREATE TABLE IpAssignmentPool (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
ipRangeStart blob(16) NOT NULL,
ipRangeEnd blob(16) NOT NULL,
ipVersion integer NOT NULL DEFAULT(4)
);
CREATE UNIQUE INDEX IpAssignmentPool_networkId_ipRangeStart ON IpAssignmentPool (networkId,ipRangeStart);
CREATE TABLE Member (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,
authorized integer NOT NULL DEFAULT(0),
activeBridge integer NOT NULL DEFAULT(0),
memberRevision integer NOT NULL DEFAULT(0),
PRIMARY KEY (networkId, nodeId)
);
CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);
CREATE INDEX Member_networkId_memberRevision ON Member(networkId, memberRevision);
CREATE TABLE Log (
networkId char(16) NOT NULL,
ruleId integer NOT NULL,
nodeId char(10),
nodeId char(10) NOT NULL,
ts integer NOT NULL,
authorized integer NOT NULL,
authTokenId integer,
version varchar(16),
fromAddr varchar(64)
);
CREATE INDEX Log_networkId_nodeId ON Log(networkId, nodeId);
CREATE INDEX Log_ts ON Log(ts);
CREATE TABLE Relay (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
address char(10) NOT NULL,
phyAddress varchar(64) NOT NULL
);
CREATE UNIQUE INDEX Relay_networkId_address ON Relay (networkId,address);
CREATE TABLE Rule (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
ruleNo integer NOT NULL,
nodeId char(10) REFERENCES Node(id),
sourcePort char(10),
destPort char(10),
vlanId integer,
vlanPcp integer,
etherType integer,
@@ -101,4 +120,4 @@ CREATE TABLE Rule (
"action" varchar(4096) NOT NULL DEFAULT('accept')
);
CREATE INDEX Rule_networkId ON Rule (networkId);
CREATE UNIQUE INDEX Rule_networkId_ruleNo ON Rule (networkId, ruleNo);
+82 -63
View File
@@ -4,53 +4,6 @@
" v varchar(1024) NOT NULL\n"\
");\n"\
"\n"\
"CREATE TABLE IpAssignment (\n"\
" networkId char(16) NOT NULL,\n"\
" nodeId char(10) NOT NULL,\n"\
" ip blob(16) NOT NULL,\n"\
" ipNetmaskBits integer NOT NULL DEFAULT(0),\n"\
" ipVersion integer NOT NULL DEFAULT(4)\n"\
");\n"\
"\n"\
"CREATE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);\n"\
"\n"\
"CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);\n"\
"\n"\
"CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);\n"\
"\n"\
"CREATE TABLE IpAssignmentPool (\n"\
" networkId char(16) NOT NULL,\n"\
" ipNetwork blob(16) NOT NULL,\n"\
" ipNetmaskBits integer NOT NULL,\n"\
" ipVersion integer NOT NULL DEFAULT(4)\n"\
");\n"\
"\n"\
"CREATE INDEX IpAssignmentPool_networkId ON IpAssignmentPool (networkId);\n"\
"\n"\
"CREATE TABLE Member (\n"\
" networkId char(16) NOT NULL,\n"\
" nodeId char(10) NOT NULL,\n"\
" authorized integer NOT NULL DEFAULT(0),\n"\
" activeBridge integer NOT NULL DEFAULT(0)\n"\
");\n"\
"\n"\
"CREATE INDEX Member_networkId ON Member (networkId);\n"\
"\n"\
"CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);\n"\
"\n"\
"CREATE UNIQUE INDEX Member_networkId_nodeId ON Member (networkId, nodeId);\n"\
"\n"\
"CREATE TABLE MulticastRate (\n"\
" networkId char(16) NOT NULL,\n"\
" mgMac char(12) NOT NULL,\n"\
" mgAdi integer NOT NULL DEFAULT(0),\n"\
" preload integer NOT NULL,\n"\
" maxBalance integer NOT NULL,\n"\
" accrual integer NOT NULL\n"\
");\n"\
"\n"\
"CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);\n"\
"\n"\
"CREATE TABLE Network (\n"\
" id char(16) PRIMARY KEY NOT NULL,\n"\
" name varchar(128) NOT NULL,\n"\
@@ -61,31 +14,97 @@
" v6AssignMode varchar(8) NOT NULL DEFAULT('none'),\n"\
" multicastLimit integer NOT NULL DEFAULT(32),\n"\
" creationTime integer NOT NULL DEFAULT(0),\n"\
" revision integer NOT NULL DEFAULT(1)\n"\
" revision integer NOT NULL DEFAULT(1),\n"\
" memberRevisionCounter integer NOT NULL DEFAULT(1)\n"\
");\n"\
"\n"\
"CREATE TABLE Relay (\n"\
" networkId char(16) NOT NULL,\n"\
" nodeId char(10) NOT NULL,\n"\
" phyAddress varchar(64) NOT NULL\n"\
"CREATE TABLE AuthToken (\n"\
" id integer PRIMARY KEY NOT NULL,\n"\
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
" authMode integer NOT NULL DEFAULT(1),\n"\
" useCount integer NOT NULL DEFAULT(0),\n"\
" maxUses integer NOT NULL DEFAULT(0),\n"\
" expiresAt integer NOT NULL DEFAULT(0),\n"\
" token varchar(256) NOT NULL\n"\
");\n"\
"\n"\
"CREATE INDEX Relay_networkId ON Relay (networkId);\n"\
"\n"\
"CREATE UNIQUE INDEX Relay_networkId_nodeId ON Relay (networkId, nodeId);\n"\
"CREATE INDEX AuthToken_networkId_token ON AuthToken(networkId,token);\n"\
"\n"\
"CREATE TABLE Node (\n"\
" id char(10) PRIMARY KEY NOT NULL,\n"\
" identity varchar(4096) NOT NULL,\n"\
" lastAt varchar(64),\n"\
" lastSeen integer NOT NULL DEFAULT(0),\n"\
" firstSeen integer NOT NULL DEFAULT(0)\n"\
" identity varchar(4096) NOT NULL\n"\
");\n"\
"\n"\
"CREATE TABLE Rule (\n"\
"CREATE TABLE Gateway (\n"\
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
" ip blob(16) NOT NULL,\n"\
" ipVersion integer NOT NULL DEFAULT(4),\n"\
" metric integer NOT NULL DEFAULT(0)\n"\
");\n"\
"\n"\
"CREATE UNIQUE INDEX Gateway_networkId_ip ON Gateway (networkId, ip);\n"\
"\n"\
"CREATE TABLE IpAssignment (\n"\
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
" nodeId char(10) REFERENCES Node(id) ON DELETE CASCADE,\n"\
" type integer NOT NULL DEFAULT(0),\n"\
" ip blob(16) NOT NULL,\n"\
" ipNetmaskBits integer NOT NULL DEFAULT(0),\n"\
" ipVersion integer NOT NULL DEFAULT(4)\n"\
");\n"\
"\n"\
"CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);\n"\
"\n"\
"CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);\n"\
"\n"\
"CREATE TABLE IpAssignmentPool (\n"\
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
" ipRangeStart blob(16) NOT NULL,\n"\
" ipRangeEnd blob(16) NOT NULL,\n"\
" ipVersion integer NOT NULL DEFAULT(4)\n"\
");\n"\
"\n"\
"CREATE UNIQUE INDEX IpAssignmentPool_networkId_ipRangeStart ON IpAssignmentPool (networkId,ipRangeStart);\n"\
"\n"\
"CREATE TABLE Member (\n"\
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
" nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,\n"\
" authorized integer NOT NULL DEFAULT(0),\n"\
" activeBridge integer NOT NULL DEFAULT(0),\n"\
" memberRevision integer NOT NULL DEFAULT(0),\n"\
" PRIMARY KEY (networkId, nodeId)\n"\
");\n"\
"\n"\
"CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);\n"\
"CREATE INDEX Member_networkId_memberRevision ON Member(networkId, memberRevision);\n"\
"\n"\
"CREATE TABLE Log (\n"\
" networkId char(16) NOT NULL,\n"\
" ruleId integer NOT NULL,\n"\
" nodeId char(10),\n"\
" nodeId char(10) NOT NULL,\n"\
" ts integer NOT NULL,\n"\
" authorized integer NOT NULL,\n"\
" authTokenId integer,\n"\
" version varchar(16),\n"\
" fromAddr varchar(64)\n"\
");\n"\
"\n"\
"CREATE INDEX Log_networkId_nodeId ON Log(networkId, nodeId);\n"\
"CREATE INDEX Log_ts ON Log(ts);\n"\
"\n"\
"CREATE TABLE Relay (\n"\
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
" address char(10) NOT NULL,\n"\
" phyAddress varchar(64) NOT NULL\n"\
");\n"\
"\n"\
"CREATE UNIQUE INDEX Relay_networkId_address ON Relay (networkId,address);\n"\
"\n"\
"CREATE TABLE Rule (\n"\
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
" ruleNo integer NOT NULL,\n"\
" nodeId char(10) REFERENCES Node(id),\n"\
" sourcePort char(10),\n"\
" destPort char(10),\n"\
" vlanId integer,\n"\
" vlanPcp integer,\n"\
" etherType integer,\n"\
@@ -102,5 +121,5 @@
" \"action\" varchar(4096) NOT NULL DEFAULT('accept')\n"\
");\n"\
"\n"\
"CREATE INDEX Rule_networkId ON Rule (networkId);\n"\
"CREATE UNIQUE INDEX Rule_networkId_ruleNo ON Rule (networkId, ruleNo);\n"\
""
-7
View File
@@ -1,7 +0,0 @@
This is the Microsoft "devcon" utility, which as far as I know is
fair game to redistribute. It's packaged with OpenVPN and several
other things and also distributed in source code form as an example
program by Microsoft.
It's called by zerotier-one.exe to automagically install and remove
instances of the tap device.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large. Load diff
+27
View File
@@ -0,0 +1,27 @@
MiniUPnPc
Copyright (c) 2005-2015, Thomas BERNARD
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+4
View File
@@ -0,0 +1,4 @@
libminiupnpc binaries
======
This is a binary build of [libminiupnpc](http://miniupnp.free.fr) for certain architectures to faciliate easy building. Where possible the build flags were set for improved security by enabling options like stack protector (a.k.a. stack canary), ASLR support, etc.
+1
View File
@@ -0,0 +1 @@
1.9
@@ -0,0 +1,54 @@
/* $Id: codelength.h,v 1.5 2015/07/09 12:40:18 nanard Exp $ */
/* Project : miniupnp
* Author : Thomas BERNARD
* copyright (c) 2005-2015 Thomas Bernard
* This software is subjet to the conditions detailed in the
* provided LICENCE file. */
#ifndef CODELENGTH_H_INCLUDED
#define CODELENGTH_H_INCLUDED
/* Encode length by using 7bit per Byte :
* Most significant bit of each byte specifies that the
* following byte is part of the code */
/* n : unsigned
* p : unsigned char *
*/
#define DECODELENGTH(n, p) n = 0; \
do { n = (n << 7) | (*p & 0x7f); } \
while((*(p++)&0x80) && (n<(1<<25)));
/* n : unsigned
* READ : function/macro to read one byte (unsigned char)
*/
#define DECODELENGTH_READ(n, READ) \
n = 0; \
do { \
unsigned char c; \
READ(c); \
n = (n << 7) | (c & 0x07f); \
if(!(c&0x80)) break; \
} while(n<(1<<25));
/* n : unsigned
* p : unsigned char *
* p_limit : unsigned char *
*/
#define DECODELENGTH_CHECKLIMIT(n, p, p_limit) \
n = 0; \
do { \
if((p) >= (p_limit)) break; \
n = (n << 7) | (*(p) & 0x7f); \
} while((*((p)++)&0x80) && (n<(1<<25)));
/* n : unsigned
* p : unsigned char *
*/
#define CODELENGTH(n, p) if(n>=268435456) *(p++) = (n >> 28) | 0x80; \
if(n>=2097152) *(p++) = (n >> 21) | 0x80; \
if(n>=16384) *(p++) = (n >> 14) | 0x80; \
if(n>=128) *(p++) = (n >> 7) | 0x80; \
*(p++) = n & 0x7f;
#endif /* CODELENGTH_H_INCLUDED */
@@ -0,0 +1,18 @@
/* $Id: connecthostport.h,v 1.3 2012/09/27 15:42:10 nanard Exp $ */
/* Project: miniupnp
* http://miniupnp.free.fr/
* Author: Thomas Bernard
* Copyright (c) 2010-2012 Thomas Bernard
* This software is subjects to the conditions detailed
* in the LICENCE file provided within this distribution */
#ifndef CONNECTHOSTPORT_H_INCLUDED
#define CONNECTHOSTPORT_H_INCLUDED
/* connecthostport()
* return a socket connected (TCP) to the host and port
* or -1 in case of error */
int connecthostport(const char * host, unsigned short port,
unsigned int scope_id);
#endif
@@ -0,0 +1,49 @@
/* $Id: igd_desc_parse.h,v 1.12 2014/11/17 17:19:13 nanard Exp $ */
/* Project : miniupnp
* http://miniupnp.free.fr/
* Author : Thomas Bernard
* Copyright (c) 2005-2014 Thomas Bernard
* This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution.
* */
#ifndef IGD_DESC_PARSE_H_INCLUDED
#define IGD_DESC_PARSE_H_INCLUDED
/* Structure to store the result of the parsing of UPnP
* descriptions of Internet Gateway Devices */
#define MINIUPNPC_URL_MAXSIZE (128)
struct IGDdatas_service {
char controlurl[MINIUPNPC_URL_MAXSIZE];
char eventsuburl[MINIUPNPC_URL_MAXSIZE];
char scpdurl[MINIUPNPC_URL_MAXSIZE];
char servicetype[MINIUPNPC_URL_MAXSIZE];
/*char devicetype[MINIUPNPC_URL_MAXSIZE];*/
};
struct IGDdatas {
char cureltname[MINIUPNPC_URL_MAXSIZE];
char urlbase[MINIUPNPC_URL_MAXSIZE];
char presentationurl[MINIUPNPC_URL_MAXSIZE];
int level;
/*int state;*/
/* "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" */
struct IGDdatas_service CIF;
/* "urn:schemas-upnp-org:service:WANIPConnection:1"
* "urn:schemas-upnp-org:service:WANPPPConnection:1" */
struct IGDdatas_service first;
/* if both WANIPConnection and WANPPPConnection are present */
struct IGDdatas_service second;
/* "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1" */
struct IGDdatas_service IPv6FC;
/* tmp */
struct IGDdatas_service tmp;
};
void IGDstartelt(void *, const char *, int);
void IGDendelt(void *, const char *, int);
void IGDdata(void *, const char *, int);
#ifdef DEBUG
void printIGD(struct IGDdatas *);
#endif /* DEBUG */
#endif /* IGD_DESC_PARSE_H_INCLUDED */
Loaded 20 of 135 files, more files were not shown because too many files have changed in this diff. Show more