diff --git a/.clangd b/.clangd
index cd9c5e1db..b4145667f 100644
--- a/.clangd
+++ b/.clangd
@@ -4,6 +4,8 @@ CompileFlags:
- "-I../ext"
- "-I../ext/prometheus-cpp-lite-1.0/core/include"
- "-I../ext/prometheus-cpp-lite-1.0/simpleapi/include"
+ - "-I../ext/opentelemetry-cpp-1.21.0/api/include"
- "-I./ext"
- "-I./ext/prometheus-cpp-lite-1.0/core/include"
- "-I./ext/prometheus-cpp-lite-1.0/simpleapi/include"
+ - "-I./ext/opentelemetry-cpp-1.21.0/api/include"
diff --git a/.gitignore b/.gitignore
index ec162c2f3..d52abee96 100755
--- a/.gitignore
+++ b/.gitignore
@@ -6,16 +6,19 @@
/zerotier
/nltest
-# IDE stuff
+# IDE and dev tool stuff
/.idea
/.nova
/compile_commands.json
+/.claude
+/.aider
# OS-created garbage files from various platforms
.DS_Store
.Apple*
Thumbs.db
@eaDir
+lost+found
._*
# Windows build droppings
@@ -58,6 +61,9 @@ zt1-src.tar.gz
/MacEthernetTapAgent
# Miscellaneous temporaries, build files, etc.
+ext/installfiles/windows/*.back*.aip
+tcp-proxy/tcp-proxy
+rustybits/target
*.log
*.opensdf
*.user
@@ -101,7 +107,6 @@ windows/ZeroTierOne/Debug/
/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg
# Miscellaneous mac/Xcode droppings
-.DS_Store
.Trashes
*.swp
*~.nib
@@ -126,19 +131,14 @@ workspace2/
zeroidc/target/
tcp-proxy/target
-#snapcraft specifics
+# Snapcraft Linux build stuff
/parts/
/stage/
/prime/
-
*.snap
-
.snapcraft
__pycache__
*.pyc
*_source.tar.bz2
snap/.snapcraft
-tcp-proxy/tcp-proxy
-rustybits/target
-ext/installfiles/windows/*.back*.aip
build/
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb6fe52b1..c705c2853 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,7 +91,7 @@ add_subdirectory(ext)
add_subdirectory(node)
add_subdirectory(osdep)
add_subdirectory(service)
-add_subdirectory(controller)
+add_subdirectory(nonfree)
set(LINKED_LIBRARIES
prometheus-cpp-lite
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 7f0801e20..000000000
--- a/COPYING
+++ /dev/null
@@ -1,12 +0,0 @@
-ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
-Copyright © 2011–2019 ZeroTier, Inc.
-
-ZeroTier is released under the terms of the BUSL version 1.1. See the
-file LICENSE.txt for details.
-
-..
- Local variables:
- coding: utf-8
- mode: text
- End:
- vim: fileencoding=utf-8 filetype=text :
diff --git a/LICENSE-MPL.txt b/LICENSE-MPL.txt
new file mode 100644
index 000000000..a612ad981
--- /dev/null
+++ b/LICENSE-MPL.txt
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
diff --git a/LICENSE.txt b/LICENSE.txt
index 06a3fad64..2c64b1820 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,149 +1,5 @@
------------------------------------------------------------------------------
+See LICENSE-MPL.txt for all code in node/, osdep/. service/, and everywhere else except ext/ and nonfree/.
-Business Source License 1.1
+See nonfree/LICENSE.md for all non-free ("source available") portions of this repository.
-License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
-"Business Source License" is a trademark of MariaDB Corporation Ab.
-
------------------------------------------------------------------------------
-
-Parameters
-
-Licensor: ZeroTier, Inc.
-Licensed Work: ZeroTier Network Virtualization Engine 1.4.4
- The Licensed Work is (c)2019 ZeroTier, Inc.
-Additional Use Grant: You may make use of the Licensed Work, provided you
- do not use it in any of the following ways:
-
- * Sell hosted ZeroTier services as a "SaaS" Product
-
- (1) Operate or sell access to ZeroTier root servers,
- network controllers, or authorization key or certificate
- generation components of the Licensed Work as a
- for-profit service, regardless of whether the use of
- these components is sold alone or is bundled with other
- services. Note that this does not apply to the use of
- ZeroTier behind the scenes to operate a service not
- related to ZeroTier network administration.
-
- * Create Non-Open-Source Commercial Derivative Works
-
- (2) Link or directly include the Licensed Work in a
- commercial or for-profit application or other product
- not distributed under an Open Source Initiative (OSI)
- compliant license. See: https://opensource.org/licenses
-
- (3) Remove the name, logo, copyright, or other branding
- material from the Licensed Work to create a "rebranded"
- or "white labeled" version to distribute as part of
- any commercial or for-profit product or service.
-
- * Certain Government Uses
-
- (4) Use or deploy the Licensed Work in a government
- setting in support of any active government function
- or operation with the exception of the following:
- physical or mental health care, family and social
- services, social welfare, senior care, child care, and
- the care of persons with disabilities.
-
-Change Date: 2026-01-01
-
-Change License: Apache License version 2.0 as published by the Apache
- Software Foundation
- https://www.apache.org/licenses/
-
-Alternative Licensing
-
-If you would like to use the Licensed Work in any way that conflicts with
-the stipulations of the Additional Use Grant, contact ZeroTier, Inc. to
-obtain an alternative commercial license.
-
-Visit us on the web at: https://www.zerotier.com/
-
-Notice
-
-The Business Source License (this document, or the "License") is not an Open
-Source license. However, the Licensed Work will eventually be made available
-under an Open Source License, as stated in this License.
-
-For more information on the use of the Business Source License for ZeroTier
-products, please visit our pricing page which contains license details and
-and license FAQ: https://zerotier.com/pricing
-
-For more information on the use of the Business Source License generally,
-please visit the Adopting and Developing Business Source License FAQ at
-https://mariadb.com/bsl-faq-adopting.
-
------------------------------------------------------------------------------
-
-Business Source License 1.1
-
-Terms
-
-The Licensor hereby grants you the right to copy, modify, create derivative
-works, redistribute, and make non-production use of the Licensed Work. The
-Licensor may make an Additional Use Grant, above, permitting limited
-production use.
-
-Effective on the Change Date, or the fourth anniversary of the first publicly
-available distribution of a specific version of the Licensed Work under this
-License, whichever comes first, the Licensor hereby grants you rights under
-the terms of the Change License, and the rights granted in the paragraph
-above terminate.
-
-If your use of the Licensed Work does not comply with the requirements
-currently in effect as described in this License, you must purchase a
-commercial license from the Licensor, its affiliated entities, or authorized
-resellers, or you must refrain from using the Licensed Work.
-
-All copies of the original and modified Licensed Work, and derivative works
-of the Licensed Work, are subject to this License. This License applies
-separately for each version of the Licensed Work and the Change Date may vary
-for each version of the Licensed Work released by Licensor.
-
-You must conspicuously display this License on each original or modified copy
-of the Licensed Work. If you receive the Licensed Work in original or
-modified form from a third party, the terms and conditions set forth in this
-License apply to your use of that work.
-
-Any use of the Licensed Work in violation of this License will automatically
-terminate your rights under this License for the current and all other
-versions of the Licensed Work.
-
-This License does not grant you any right in any trademark or logo of
-Licensor or its affiliates (provided that you may use a trademark or logo of
-Licensor as expressly required by this License).
-
-TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
-AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
-EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
-TITLE.
-
------------------------------------------------------------------------------
-
-MariaDB hereby grants you permission to use this License’s text to license
-your works, and to refer to it using the trademark "Business Source License",
-as long as you comply with the Covenants of Licensor below.
-
-Covenants of Licensor
-
-In consideration of the right to use this License’s text and the "Business
-Source License" name and trademark, Licensor covenants to MariaDB, and to all
-other recipients of the licensed work to be provided by Licensor:
-
-1. To specify as the Change License the GPL Version 2.0 or any later version,
- or a license that is compatible with GPL Version 2.0 or a later version,
- where "compatible" means that software provided under the Change License can
- be included in a program with software provided under GPL Version 2.0 or a
- later version. Licensor may specify additional Change Licenses without
- limitation.
-
-2. To either: (a) specify an additional grant of rights to use that does not
- impose any additional restriction on the right granted in this License, as
- the Additional Use Grant; or (b) insert the text "None".
-
-3. To specify a Change Date.
-
-4. Not to modify this License in any other way.
+Code in ext/ is external code included for build convenience or backward compatibility and retains its original license.
diff --git a/Makefile b/Makefile
index f77767fb8..51a9914bb 100644
--- a/Makefile
+++ b/Makefile
@@ -33,4 +33,4 @@ drone:
drone sign zerotier/ZeroTierOne --save
clang-format:
- find node osdep service tcp-proxy controller -iname '*.cpp' -o -iname '*.hpp' | xargs clang-format -i
+ find node osdep service tcp-proxy nonfree/controller -iname '*.cpp' -o -iname '*.hpp' | xargs clang-format -i
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index e6582207e..ecec6b984 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -1,14 +1,42 @@
ZeroTier Release Notes
======
-# 2024-10-23 -- Version 1.14.2
+## 2025-08-21 -- Version 1.16.0
+
+ * License Changes
+ * The core (`node/` and `include/`) and the service (`service/` and `osdep/`) are now under the Mozilla Public License (MPL).
+ * The network controller (`controller/`) is now under a commercial source-available license.
+ * Use `make ZT_NONFREE=1` to build non-MPL components.
+ * Building with `ZT_NONFREE=1` changes the license of the resulting executable to a proprietary commercial license vs. MPL.
+ * Default binary builds no longer contain the controller.
+ * Network-Specific Relays (preview / beta)
+ * It is now possible to designate one or more nodes as network-specific relays to be used in preference to roots for relayed traffic between members of a network. These nodes need not necessarily be members of the network.
+ * "Moons" are now considered even more extra *deprecated* and should not be used in new deployments.
+ * We will announce support for network-specific relays once we have worked with some users to test and performed more internal validation.
+ * HELLO packet encryption is now available by enabling the `encryptedHelloEnabled` settting in `local.conf`.
+ * HELLO packets contain no data, only public keys and very basic meta-data like protocol version information.
+ * Most users won't care about this, but if you require this for e.g. compliance reasons you can enable. This adds a small amount of CPU and bandwidth overhead to the HELLO sign-on process.
+ * Small Fixes
+ * Code has been reformatted using `clang-format` with a `.clang-format` definition in the repo. Typing `make clang-format` executes this against all main core and service C++ files.
+ * Bridges are no longer counted toward multicast limits.
+ * A flow designation issue in bridged traffic under multipath scenarios has been fixed.
+ * Library version updates for OIDC and other features.
+ * Antiquated and unused software update code removed for precautionary reasons.
+ * Compiler warnings removed through removing use of deprecated functions on some platforms.
+ * Other minor bug fixes.
+
+----
+
+# 1.14
+
+## 2024-10-23 -- Version 1.14.2
* Fix for missing entitlement on macOS Sequoia.
* Fix for a problem correctly parsing local.conf to enable low bandwidth mode.
* Increment versions of some dependent libraries.
* Other fixes.
-# 2024-09-12 -- Version 1.14.1
+## 2024-09-12 -- Version 1.14.1
* Multithreaded packet I/O support! Currently this is just for Linux and must
be enabled in local.conf. It will likely make the largest difference on small
@@ -24,7 +52,7 @@ ZeroTier Release Notes
to network controllers when networks are joined so it can be displayed to
network admins and in the future used in policy checking and inventory operations.
-# 2024-05-02 -- Version 1.14.0
+## 2024-05-02 -- Version 1.14.0
* Linux I/O performance improvements under heavy load
* Improvements to multipath
@@ -33,18 +61,22 @@ ZeroTier Release Notes
* Controller API enhancements: node names and other node meta-data
* Other bug fixes
-# 2023-09-12 -- Version 1.12.2
+----
+
+# 1.12 and Older
+
+## 2023-09-12 -- Version 1.12.2
* More improvements to macOS full tunnel mode.
* Faster recovery after changes to physical network settings.
-# 2023-08-25 -- Version 1.12.1
+## 2023-08-25 -- Version 1.12.1
* Minor release to fix a port binding issue in Linux.
* Update Debian dependencies.
* No changes for other platforms.
-# 2023-08-23 -- Version 1.12.0
+## 2023-08-23 -- Version 1.12.0
* Experimental Windows ARM64 support
* Fix numerous sleep/wake issues on macOS and other platforms
@@ -54,17 +86,17 @@ ZeroTier Release Notes
* Numerous macOS DNS fixes
* 10-30% speed improvement on Linux
-# 2023-03-23 -- Version 1.10.6
+## 2023-03-23 -- Version 1.10.6
* Prevent binding temporary ipv6 addresses on macos (#1910)
* Prevent path-learning loops (#1914)
* Prevent infinite loop of UAC prompts in tray app
-# 2023-03-10 -- Version 1.10.5
+## 2023-03-10 -- Version 1.10.5
* Fix for high CPU usage bug on Windows
-# 2023-03-07 -- Version 1.10.4
+## 2023-03-07 -- Version 1.10.4
* SECURITY FIX (Windows): this version fixes a file permission problem on
Windows that could allow non-privileged users on a Windows system to read
@@ -73,11 +105,10 @@ ZeroTier Release Notes
instance without appropriate local permissions. This issue is not remotely
exploitable unless a remote user can read arbitrary local files, and does
not impact other operating systems.
-
* Fix a bug in the handling of multiple IP address assignments to virtual
interfaces on macOS.
-# 2023-02-15 -- Version 1.10.3
+## 2023-02-15 -- Version 1.10.3
* Fix for duplicate paths in client. Could cause connectivity issues. Affects all platforms.
* Fix for Ethernet Tap MTU setting, would not properly apply on Linux.
@@ -89,7 +120,7 @@ ZeroTier Release Notes
* Fix bug that prevented setting of custom TCP relay address.
* Build script improvements and bug fixes.
-# 2022-11-01 -- Version 1.10.2
+## 2022-11-01 -- Version 1.10.2
* Fix another SSO "stuck client" issue in zeroidc.
* Expose root-reported external IP/port information via the local JSON API for better diagnostics.
@@ -100,12 +131,12 @@ ZeroTier Release Notes
Note that releases are coming few and far between because most of our dev effort is going into version 2.
-# 2022-06-27 -- Version 1.10.1
+## 2022-06-27 -- Version 1.10.1
* Fix an issue that could cause SSO clients to get "stuck" on stale auth URLs.
* A few other SSO related bug fixes.
-# 2022-06-07 -- Version 1.10.0
+## 2022-06-07 -- Version 1.10.0
* Fix formatting problem in `zerotier-cli` when using SSO networks.
* Fix a few other minor bugs in SSO signin to prepare for general availability.
@@ -114,11 +145,11 @@ Note that releases are coming few and far between because most of our dev effort
* Use system default browser for SSO login so all your plugins, MFA devices, password managers, etc. will work as you have them configured.
* Minor fix for bonding/multipath.
-# 2022-05-10 -- Version 1.8.10
+## 2022-05-10 -- Version 1.8.10
* Fixed a bug preventing SSO sign-on on Windows.
-# 2022-04-25 -- Version 1.8.9
+## 2022-04-25 -- Version 1.8.9
* Fixed a long-standing and strange bug that was causing sporadic "phantom" packet authentication failures. Not a security problem but could be behind sporadic reports of link failures under some conditions.
* Fixed a memory leak in SSO/OIDC support.
@@ -127,26 +158,26 @@ Note that releases are coming few and far between because most of our dev effort
* Fixed a deadlock bug on leaving SSO/OIDC managed networks.
* Added some new Linux distributions to the build subsystem.
-# 2022-04-11 -- Version 1.8.8
+## 2022-04-11 -- Version 1.8.8
* Fix a local privilege escalation bug in the Windows installer.
* Dependency fix for some Ubuntu versions.
* No changes for other platforms. Windows upgrade recommended, everyone else optional.
-# 2022-03-30 -- Version 1.8.7
+## 2022-03-30 -- Version 1.8.7
* Fix for dependency installations in Windows MSI package.
* Fix for desktop UI setup when run by a non-super-user.
* Bug fix in local OIDC / SSO support for auth0 and other providers.
* Other minor fixes for e.g. old Linux distributions.
-# 2022-03-04 -- Version 1.8.6
+## 2022-03-04 -- Version 1.8.6
* Fixed an issue that could cause the UI to be non-responsive if not joined to any networks.
* Fix dependency issues in Debian and RedHat packages for some distributions (Fedora, Mint).
* Bumped the peer cache serialization version to prevent "coma" issues on upgrade due to changes in path logic behaving badly with old values.
-# 2022-02-22 -- Version 1.8.5
+## 2022-02-22 -- Version 1.8.5
* Plumbing under the hood for endpoint device SSO support.
* Fix in LinuxEthernetTap to tap device support on very old (2.6) Linux kernels.
@@ -154,7 +185,7 @@ Note that releases are coming few and far between because most of our dev effort
* Merge a series of changes by Joseph Henry (of ZeroTier) that should fix some edge cases where ZeroTier would "forget" valid paths.
* Minor multipath improvements for automatic path negotiation.
-# 2021-11-30 -- Version 1.8.4
+## 2021-11-30 -- Version 1.8.4
* Fixed an ugly font problem on some older macOS versions.
* Fixed a bug that could cause the desktop tray app control panel to stop opening after a while on Windows.
@@ -162,7 +193,7 @@ Note that releases are coming few and far between because most of our dev effort
* Fixed installation on 32-bit Windows 10.
* Fixed a build flags issue that could cause ZeroTier to crash on older ARM32 CPUs.
-# 2021-11-15 -- Version 1.8.3
+## 2021-11-15 -- Version 1.8.3
* Remove problematic spinlock, which was only used on x86_64 anyway. Just use pthread always.
* Fix fd leak on MacOS that caused non-responsiveness after some time.
@@ -170,14 +201,14 @@ Note that releases are coming few and far between because most of our dev effort
* Fix regression that could prevent managed routes from being deleted.
* DesktopUI: Remove NSDate:now() call, now works on MacOS 10.13 or newer!
-# 2021-11-08 -- Version 1.8.2
+## 2021-11-08 -- Version 1.8.2
* Fix multicast on linux.
* Fix a bug that could cause the tap adapter to have the wrong MAC on Linux.
* Update build flags to possibly support MacOS older than 10.14, but more work needs to be done. It may not work yet.
* Fix path variable setting on Windows.
-# 2021-10-28 -- Version 1.8.1
+## 2021-10-28 -- Version 1.8.1
* Fix numerous UI issues from 1.8.0 (never fully released).
* Remove support for REALLY ancient 1.1.6 or earlier network controllers.
@@ -187,7 +218,7 @@ Note that releases are coming few and far between because most of our dev effort
* NOTE: Windows 7 is no longer supported! Windows 7 users will have to use version 1.6.5 or earlier.
-# 2021-09-15 -- Version 1.8.0 (preview release only)
+## 2021-09-15 -- Version 1.8.0 (preview release only)
* A *completely* rewritten desktop UI for Mac and Windows!
* Implement a workaround for one potential source of a "coma" bug, which can occur if buggy NATs/routers stop allowing the service to communicate on a given port. ZeroTier now reassigns a new secondary port if it's offline for a while unless a secondary port is manually specified in local.conf. Working around crummy buggy routers is an ongoing effort.
@@ -198,32 +229,32 @@ Note that releases are coming few and far between because most of our dev effort
* Check if DNS servers need to be applied on macOS
* Upgrade json.hpp dependency to version 3.10.2
-# 2021-09-21 -- Version 1.6.6
+## 2021-09-21 -- Version 1.6.6
* Backport COM hash check mitigation against network member impersonation.
-# 2021-04-13 -- Version 1.6.5
+## 2021-04-13 -- Version 1.6.5
* Fix a bug in potential network path filtering that could in some circumstances lead to "software laser" effects.
* Fix a printf overflow in zerotier-cli (not exploitable or a security risk)
* Windows now looks up the name of ZeroTier devices instead of relying on them having "ZeroTier" in them.
-# 2021-02-15 -- Version 1.6.4
+## 2021-02-15 -- Version 1.6.4
* The groundhog saw his shadow, which meant that the "connection coma" bug still wasn't gone. We think we found it this time.
-# 2021-02-02 -- Version 1.6.3
+## 2021-02-02 -- Version 1.6.3
* Likely fix for GitHub issue #1334, an issue that could cause ZeroTier to
go into a "coma" on some networks.
* Also groundhog day
-# 2020-11-30 -- Version 1.6.2
+## 2020-11-30 -- Version 1.6.2
* Fix an ARM hardware AES crypto issue (not an exploitable vulnerability).
* Fix a Linux network leave hang due to a mutex deadlock.
-# 2020-11-24 -- Version 1.6.1
+## 2020-11-24 -- Version 1.6.1
This release fixes some minor bugs and other issues in 1.6.0.
@@ -233,7 +264,7 @@ This release fixes some minor bugs and other issues in 1.6.0.
* Merged CLI options for controlling bonded devices into the beta multipath code.
* Updated Windows driver with Microsoft cross-signing to fix issues on some Windows systems.
-# 2020-11-19 -- Version 1.6.0
+## 2020-11-19 -- Version 1.6.0
Version 1.6.0 is a major release that incorporates back-ported features from the 2.0 branch, which is still under development. It also fixes a number of issues.
@@ -274,7 +305,7 @@ Known issues that are not yet fixed in this beta:
We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
-# 2019-08-30 -- Version 1.4.6
+## 2019-08-30 -- Version 1.4.6
* Update default root list to latest
* ARM32 platform build and flag fixes
@@ -283,19 +314,19 @@ We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
* Windows service now looks for service command line arguments
* Fixed a bug that could cause excessive queued multicasts
-# 2019-08-23 -- Version 1.4.4
+## 2019-08-23 -- Version 1.4.4
* Change license from GPL3 to BSL 1.1, see LICENSE.txt
* Fix an issue with the "ipauth" rule and auto-generated unforgeable IPv6 addresses
* Fix socket/bind errors setting IPs and routes on Linux
-# 2019-08-12 -- Version 1.4.2
+## 2019-08-12 -- Version 1.4.2
* Fix high CPU use bug on some platforms
* Fix issues with PostgreSQL controller DB (only affects Central)
* Restore backward compatibility with MacOS versions prior to 10.13
-# 2019-07-29 -- Version 1.4.0
+## 2019-07-29 -- Version 1.4.0
### Major Changes
@@ -313,20 +344,20 @@ We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
* Fixed numerous other small issues and bugs such as ARM alignment issues causing crashes on some devices.
* Windows now sets the adapter name such that it is consistent in both the Windows UI and command line utilities.
-# 2018-07-27 -- Version 1.2.12
+## 2018-07-27 -- Version 1.2.12
* Fixed a bug that caused exits to take a long time on Mac due to huge numbers of redundant attempts to delete managed routes.
* Fixed a socket limit problem on Windows that caused the ZeroTier service to run out of sockets, causing the UI and CLI to be unable to access the API.
* Fixed a threading bug in the ZeroTier Core, albeit one that never manifested on the regular ZeroTier One service/client.
* Fixed a bug that could cause the service to crash if an authorized local client accessed an invalid URL via the control API. (Not exploitable since you needed admin access anyway.)
-# 2018-05-08 -- Version 1.2.10
+## 2018-05-08 -- Version 1.2.10
* Fix bug loading `moons.d/` files for federated root operation.
* Fix compile problem with ZT_DEBUG on some versions of `clang`
* Fix slow network startup bug related to loading of `networks.d/` cache files
-# 2018-04-27 -- Version 1.2.8
+## 2018-04-27 -- Version 1.2.8
* Linux version once again builds with PIE (position independent executable) flags
* Fixed bug in zerotier-idtool file sign and verify
@@ -334,7 +365,7 @@ We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
* Merged alpha NetBSD support (mostly untested, so YMMV)
* Merged several minor typo and one-liner bug fixes
-# 2018-04-17 -- Version 1.2.6
+## 2018-04-17 -- Version 1.2.6
* Features and Core Improvements
* Path selection has been overhauled to improve path stability, simplify code, and prepare for multi-path and trunking in the next major release.
@@ -369,7 +400,7 @@ We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
* Multicast now works on Android in most cases! Android apps can send and receive multicast and subscribe to multicast group IPs. Note that in some cases the app must bind to the specific correct interface for this to work.
* IPv6 can be disabled in UI for cases where it causes problems.
-# 2017-04-20 -- Version 1.2.4
+## 2017-04-20 -- Version 1.2.4
* Managed routes are now only bifurcated for the default route. This is a change in behavior, though few people will probably notice. Bifurcating all managed routes was causing more trouble than it was worth for most users.
* Up to 2X crypto speedup on x86-64 (except Windows, which will take some porting) and 32-bit ARM platforms due to integration of fast assembly language implementations of Salsa20/12 from the [supercop](http://bench.cr.yp.to/supercop.html) code base. These were written by Daniel J. Bernstein and are in the public domain. My MacBook Pro (Core i5 2.8ghz) now does almost 1.5GiB/sec Salsa20/12 per core and a Raspberry Pi got a 2X boost. 64-bit ARM support and Windows support will take some work but should not be too hard.
@@ -379,128 +410,12 @@ We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
* Fixed an issue causing build problems on some MIPS architecture systems.
* Fixed Windows forgetting routes on sleep/wake or in some other circumstances. (GitHub issue #465)
-# 2017-03-17 -- Version 1.2.2
+## 2017-03-17 -- Version 1.2.2
* A bug causing unreliable multicast propagation (GitHub issue #461).
* A crash in ARM binaries due to a build chain and flags problem.
* A bug in the network controller preventing members from being listed (GitHub issue #460).
-# 2017-03-14 -- Version 1.2.0
+## 2017-03-14 -- Version 1.2.0
Version 1.2.0 is a major milestone release representing almost nine months of work. It includes our rules engine for distributed network packet filtering and security monitoring, federated roots, and many other architectural and UI improvements and bug fixes.
-
-## New Features in 1.2.0
-
-### The ZeroTier Rules Engine
-
-The largest new feature in 1.2.0, and the product of many months of work, is our advanced network rules engine. With this release we achieve traffic control, security monitoring, and micro-segmentation capability on par with many enterprise SDN solutions designed for use in advanced data centers and corporate networks.
-
-Rules allow you to filter packets on your network and vector traffic to security observers. Security observation can be performed in-band using REDIRECT or out of band using TEE.
-
-Tags and capabilities provide advanced methods for implementing fine grained permission structures and micro-segmentation schemes without bloating the size and complexity of your rules table.
-
-See the [rules engine announcement blog post](https://www.zerotier.com/blog/?p=927) for an in-depth discussion of theory and implementation. The [manual](https://www.zerotier.com/manual.shtml) contains detailed information on rule, tag, and capability use, and the `rule-compiler/` subfolder of the ZeroTier source tree contains a JavaScript function to compile rules in our human-readable rule definition language into rules suitable for import into a network controller. (ZeroTier Central uses this same script to compile rules on [my.zerotier.com](https://my.zerotier.com/).)
-
-### Root Server Federation
-
-It's now possible to create your own root servers and add them to the root server pool on your nodes. This is done by creating what's called a "moon," which is a signed enumeration of root servers and their stable points on the network. Refer to the [manual](https://www.zerotier.com/manual.shtml) for instructions.
-
-Federated roots achieve a number of things:
-
- * You can deploy your own infrastructure to reduce dependency on ours.
- * You can deploy roots *inside your LAN* to ensure that network connectivity inside your facility still works if the Internet goes down. This is the first step toward making ZeroTier viable as an in-house SDN solution.
- * Roots can be deployed inside national boundaries for countries with data residency laws or "great firewalls." (As of 1.2.0 there is still no way to force all traffic to use these roots, but that will be easy to do in a later version.)
- * Last but not least this makes ZeroTier somewhat less centralized by eliminating any hard dependency on ZeroTier, Inc.'s infrastructure.
-
-Our roots will of course remain and continue to provide zero-configuration instant-on deployment, a secure global authority for identities, and free traffic relaying for those who can't establish peer to peer connections.
-
-### Local Configuration
-
-An element of our design philosophy is "features are bugs." This isn't an absolute dogma but more of a guiding principle. We try as hard as we can to avoid adding features, especially "knobs" that must be tweaked by a user.
-
-As of 1.2.0 we've decided that certain knobs are unavoidable, and so there is now a `local.conf` file that can be used to configure them. See the ZeroTier One documentation for these. They include:
-
- * Blacklisting interfaces you want to make sure ZeroTier doesn't use for network traffic, such as VPNs, slow links, or backplanes designated for only certain kinds of traffic.
- * Turning uPnP/NAT-PMP on or off.
- * Configuring software updates on Windows and Mac platforms.
- * Defining trusted paths (the old trusted paths file is now deprecated)
- * Setting the ZeroTier main port so it doesn't have to be changed on the command line, which is very inconvenient in many cases.
-
-### Improved In-Band Software Updates
-
-A good software update system for Windows and Mac clients has been a missing feature in previous versions. It does exist but we've been shy about using it so far due to its fragility in some environments.
-
-We've greatly improved this mechanism in 1.2.0. Not only does it now do a better job of actually invoking the update, but it also transfers updates in-band using the ZeroTier protocol. This means it can work in environments that do not allows http/https traffic or that force it through proxies. There's also now an update channel setting: `beta` or `release` (the default).
-
-Software updates are authenticated three ways:
-
- 1. ZeroTier's own signing key is used to sign all updates and this signature is checked prior to installation. ZeroTier, Inc.'s signatures are performed on an air-gapped machine.
-
- 2. Updates for Mac and Windows are signed using Apple and Microsoft (DigiCert EV) keys and will not install unless these signatures are also valid.
-
- 3. The new in-band update mechanism also authenticates the source of the update via ZeroTier's built-in security features. This provides transport security, while 1 and 2 provide security of the update at rest.
-
-Updates are now configurable via `local.conf`. There are three options: `disable`, `download`, and `apply`. The third (apply) is the default for official builds on Windows and Mac, making updates happen silently and automatically as they do for popular browsers like Chrome and Firefox. Updates are disabled by default on Linux and other Unix-type systems as these are typically updated through package managers.
-
-### Path Link Quality Awareness
-
-Version 1.2.0 is now aware of the link quality of direct paths with other 1.2.0 nodes. This information isn't used yet but is visible through the JSON API. (Quality always shows as 100% with pre-1.2.0 nodes.) Quality is measured passively with no additional overhead using a counter based packet loss detection algorithm.
-
-This information is visible from the command line via `listpeers`:
-
- 200 listpeers XXXXXXXXXX 199.XXX.XXX.XXX/9993;10574;15250;1.00 48 1.2.0 LEAF
- 200 listpeers XXXXXXXXXX 195.XXX.XXX.XXX/45584;467;7608;0.44 290 1.2.0 LEAF
-
-The first peer's path is at 100% (1.00), while the second peer's path is suffering quite a bit of packet loss (0.44).
-
-Link quality awareness is a precursor to intelligent multi-path and QoS support, which will in future versions bring us to feature parity with SD-WAN products like Cisco iWAN.
-
-### Security Improvements
-
-Version 1.2.0 adds anti-DOS (denial of service) rate limits and other hardening for improved resiliency against a number of denial of service attack scenarios.
-
-It also adds a mechanism for instantaneous credential revocation. This can be used to revoke certificates of membership instantly to kick a node off a network (for private networks) and also to revoke capabilities and tags. The new controller sends revocations by default when a peer is de-authorized.
-
-Revocations propagate using a "rumor mill" peer to peer algorithm. This means that a controller need only successfully send a revocation to at least one member of a network with connections to other active members. At this point the revocation will flood through the network peer to peer very quickly. This helps make revocations more robust in the face of poor connectivity with the controller or attempts to incapacitate the controller with denial of service attacks, as well as making revocations faster on huge networks.
-
-### Windows and Macintosh UI Improvements (ZeroTier One)
-
-The Mac has a whole new UI built natively in Objective-C. It provides a pulldown similar in appearance and operation to the Mac WiFi task bar menu.
-
-The Windows UI has also been improved and now provides a task bar icon that can be right-clicked to manage networks. Both now expose managed route and IP permissions, allowing nodes to easily opt in to full tunnel operation if you have a router configured on your network.
-
-### Ad-Hoc Networks
-
-A special kind of public network called an ad-hoc network may be accessed by joining a network ID with the format:
-
- ffSSSSEEEE000000
- | | | |
- | | | Reserved for future use, must be 0
- | | End of port range (hex)
- | Start of port range (hex)
- Reserved ZeroTier address prefix indicating a controller-less network
-
-Ad-hoc networks are public (no access control) networks that have no network controller. Instead their configuration and other credentials are generated locally. Ad-hoc networks permit only IPv6 UDP and TCP unicast traffic (no multicast or broadcast) using 6plane format NDP-emulated IPv6 addresses. In addition an ad-hoc network ID encodes an IP port range. UDP packets and TCP SYN (connection open) packets are only allowed to destination ports within the encoded range.
-
-For example `ff00160016000000` is an ad-hoc network allowing only SSH, while `ff0000ffff000000` is an ad-hoc network allowing any UDP or TCP port.
-
-Keep in mind that these networks are public and anyone in the entire world can join them. Care must be taken to avoid exposing vulnerable services or sharing unwanted files or other resources.
-
-### Network Controller (Partial) Rewrite
-
-The network controller has been largely rewritten to use a simple in-filesystem JSON data store in place of SQLite, and it is now included by default in all Windows, Mac, Linux, and BSD builds. This means any desktop or server node running ZeroTier One can now be a controller with no recompilation needed.
-
-If you have data in an old SQLite3 controller we've included a NodeJS script in `controller/migrate-sqlite` to migrate data to the new format. If you don't migrate, members will start getting `NOT_FOUND` when they attempt to query for updates.
-
-## Major Bug Fixes in 1.2.0
-
- * **The Windows HyperV 100% CPU bug is FINALLY DEAD**: This long-running problem turns out to have been an issue with Windows itself, but one we were triggering by placing invalid data into the Windows registry. Microsoft is aware of the issue but we've also fixed the triggering problem on our side. ZeroTier should now co-exist quite well with HyperV and should now be able to be bridged with a HyperV virtual switch.
- * **Segmentation faults on musl-libc based Linux systems**: Alpine Linux and some embedded Linux systems that use musl libc (a minimal libc) experienced segmentation faults. These were due to a smaller default stack size. A work-around that sets the stack size for new threads has been added.
- * **Windows firewall blocks local JSON API**: On some Windows systems the firewall likes to block 127.0.0.1:9993 for mysterious reasons. This is now fixed in the installer via the addition of another firewall exemption rule.
- * **UI crash on embedded Windows due to missing fonts**: The MSI installer now ships fonts and will install them if they are not present, so this should be fixed.
-
-## Other Improvements in 1.2.0
-
- * **Improved dead path detection**: ZeroTier is now more aggressive about expiring paths that do not seem to be active. If a path seems marginal it is re-confirmed before re-use.
- * **Minor performance improvements**: We've reduced unnecessary memcpy's and made a few other performance improvements in the core.
- * **Linux static binaries**: For our official packages (the ones in the download.zerotier.com apt and yum repositories) we now build Linux binaries with static linking. Hopefully this will stop all the bug reports relating to library inconsistencies, as well as allowing our deb packages to run on a wider variety of Debian-based distributions. (There are far too many of these to support officially!) The overhead for this is very small, especially since we built our static versions against musl-libc. Distribution maintainers are of course free to build dynamically linked versions for inclusion into distributions; this only affects our official binaries.
diff --git a/SECURITY.md b/SECURITY.md
index c539ed6a2..ceecc3b5d 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,6 +1,6 @@
# Security
-ZeroTier takes the security of our software products and services seriously, which
+ZeroTier takes the security of our software products and services seriously, which
includes all source code repositories managed through our GitHub organization.
## Supported Versions
@@ -9,8 +9,9 @@ The following versions of ZeroTier One receive security updates
| Version | Supported |
| -------- | ------------------ |
+| 1.16.x | :white_check_mark: |
| 1.14.x | :white_check_mark: |
-| 1.12.x | :white_check_mark: |
+| 1.12.x | :x: |
| < 1.12.0 | :x: |
## Reporting a Vulnerability
@@ -20,7 +21,7 @@ The following versions of ZeroTier One receive security updates
Instead, please report vulnerabilities via email to security@zerotier.com. If possible,
please encrypt with our PGP key (see below).
-Please include the following information, or as much as you can provide to help us
+Please include the following information, or as much as you can provide to help us
understand the nature and scope of the issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
diff --git a/attic/world/README.md b/attic/world/README.md
deleted file mode 100644
index dda4920ae..000000000
--- a/attic/world/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-World Definitions and Generator Code
-======
-
-This little bit of code is used to generate world updates. Ordinary users probably will never need this unless they want to test or experiment.
-
-See mkworld.cpp for documentation. To build from this directory use 'source ./build.sh'.
-
diff --git a/attic/world/build.sh b/attic/world/build.sh
deleted file mode 100755
index f3bcfabc9..000000000
--- a/attic/world/build.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-c++ -std=c++11 -I../.. -I../../ext -I.. -g -o mkworld ../../node/C25519.cpp ../../node/Salsa20.cpp ../../node/SHA512.cpp ../../node/Identity.cpp ../../node/Utils.cpp ../../node/InetAddress.cpp ../../osdep/OSUtils.cpp mkworld.cpp -lm
diff --git a/attic/world/mkworld.cpp b/attic/world/mkworld.cpp
deleted file mode 100644
index ed2c499a0..000000000
--- a/attic/world/mkworld.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/*
- * This utility makes the World from the configuration specified below.
- * It probably won't be much use to anyone outside ZeroTier, Inc. except
- * for testing and experimentation purposes.
- *
- * If you want to make your own World you must edit this file.
- *
- * When run, it expects two files in the current directory:
- *
- * previous.c25519 - key pair to sign this world (key from previous world)
- * current.c25519 - key pair whose public key should be embedded in this world
- *
- * If these files do not exist, they are both created with the same key pair
- * and a self-signed initial World is born.
- */
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace ZeroTier;
-
-int main(int argc,char **argv)
-{
- std::string previous,current;
- if ((!OSUtils::readFile("previous.c25519",previous))||(!OSUtils::readFile("current.c25519",current))) {
- ECC::Pair np(ECC::generate());
- previous = std::string();
- previous.append((const char *)np.pub.data,ZT_C25519_PUBLIC_KEY_LEN);
- previous.append((const char *)np.priv.data,ZT_C25519_PRIVATE_KEY_LEN);
- current = previous;
- OSUtils::writeFile("previous.c25519",previous);
- OSUtils::writeFile("current.c25519",current);
- fprintf(stderr,"INFO: created initial world keys: previous.c25519 and current.c25519 (both initially the same)" ZT_EOL_S);
- }
-
- if ((previous.length() != (ZT_C25519_PUBLIC_KEY_LEN + ZT_C25519_PRIVATE_KEY_LEN))||(current.length() != (ZT_C25519_PUBLIC_KEY_LEN + ZT_C25519_PRIVATE_KEY_LEN))) {
- fprintf(stderr,"FATAL: previous.c25519 or current.c25519 empty or invalid" ZT_EOL_S);
- return 1;
- }
- ECC::Pair previousKP;
- memcpy(previousKP.pub.data,previous.data(),ZT_C25519_PUBLIC_KEY_LEN);
- memcpy(previousKP.priv.data,previous.data() + ZT_C25519_PUBLIC_KEY_LEN,ZT_C25519_PRIVATE_KEY_LEN);
- ECC::Pair currentKP;
- memcpy(currentKP.pub.data,current.data(),ZT_C25519_PUBLIC_KEY_LEN);
- memcpy(currentKP.priv.data,current.data() + ZT_C25519_PUBLIC_KEY_LEN,ZT_C25519_PRIVATE_KEY_LEN);
-
- // =========================================================================
- // EDIT BELOW HERE
-
- std::vector roots;
-
- const uint64_t id = ZT_WORLD_ID_EARTH;
- const uint64_t ts = 1567191349589ULL; // August 30th, 2019
-
- // Los Angeles
- roots.push_back(World::Root());
- roots.back().identity = Identity("3a46f1bf30:0:76e66fab33e28549a62ee2064d1843273c2c300ba45c3f20bef02dbad225723bb59a9bb4b13535730961aeecf5a163ace477cceb0727025b99ac14a5166a09a3");
- roots.back().stableEndpoints.push_back(InetAddress("185.180.13.82/9993"));
- roots.back().stableEndpoints.push_back(InetAddress("2a02:6ea0:c815::/9993"));
-
- // Miami
- roots.push_back(World::Root());
- roots.back().identity = Identity("de8950a8b2:0:1b3ada8251b91b6b6fa6535b8c7e2460918f4f729abdec97d3c7f3796868fb02f0de0b0ee554b2d59fc3524743eebfcf5315e790ed6d92db5bd10c28c09b40ef");
- roots.back().stableEndpoints.push_back(InetAddress("207.246.73.245/443"));
- roots.back().stableEndpoints.push_back(InetAddress("2001:19f0:9002:5cb:ec4:7aff:fe8f:69d9/443"));
-
- // Tokyo
- roots.push_back(World::Root());
- roots.back().identity = Identity("34e0a5e174:0:93efb50934788f856d5cfb9ca5be88e85b40965586b75befac900df77352c145a1ba7007569d37c77bfe52c0999f3bdc67a47a4a6000b720a883ce47aa2fb7f8");
- roots.back().stableEndpoints.push_back(InetAddress("147.75.92.2/443"));
- roots.back().stableEndpoints.push_back(InetAddress("2604:1380:3000:7100::1/443"));
-
- // Amsterdam
- roots.push_back(World::Root());
- roots.back().identity = Identity("992fcf1db7:0:206ed59350b31916f749a1f85dffb3a8787dcbf83b8c6e9448d4e3ea0e3369301be716c3609344a9d1533850fb4460c50af43322bcfc8e13d3301a1f1003ceb6");
- roots.back().stableEndpoints.push_back(InetAddress("195.181.173.159/443"));
- roots.back().stableEndpoints.push_back(InetAddress("2a02:6ea0:c024::/443"));
-
- // Alice
- //roots.push_back(World::Root());
- //roots.back().identity = Identity("9d219039f3:0:01f0922a98e3b34ebcbff333269dc265d7a020aab69d72be4d4acc9c8c9294785771256cd1d942a90d1bd1d2dca3ea84ef7d85afe6611fb43ff0b74126d90a6e");
- //roots.back().stableEndpoints.push_back(InetAddress("188.166.94.177/9993")); // Amsterdam
- //roots.back().stableEndpoints.push_back(InetAddress("2a03:b0c0:2:d0::7d:1/9993")); // Amsterdam
- //roots.back().stableEndpoints.push_back(InetAddress("154.66.197.33/9993")); // Johannesburg
- //roots.back().stableEndpoints.push_back(InetAddress("2c0f:f850:154:197::33/9993")); // Johannesburg
- //roots.back().stableEndpoints.push_back(InetAddress("159.203.97.171/9993")); // New York
- //roots.back().stableEndpoints.push_back(InetAddress("2604:a880:800:a1::54:6001/9993")); // New York
- //roots.back().stableEndpoints.push_back(InetAddress("131.255.6.16/9993")); // Buenos Aires
- //roots.back().stableEndpoints.push_back(InetAddress("2803:eb80:0:e::2/9993")); // Buenos Aires
- //roots.back().stableEndpoints.push_back(InetAddress("107.170.197.14/9993")); // San Francisco
- //roots.back().stableEndpoints.push_back(InetAddress("2604:a880:1:20::200:e001/9993")); // San Francisco
- //roots.back().stableEndpoints.push_back(InetAddress("128.199.197.217/9993")); // Singapore
- //roots.back().stableEndpoints.push_back(InetAddress("2400:6180:0:d0::b7:4001/9993")); // Singapore
-
- // Bob
- //roots.push_back(World::Root());
- //roots.back().identity = Identity("8841408a2e:0:bb1d31f2c323e264e9e64172c1a74f77899555ed10751cd56e86405cde118d02dffe555d462ccf6a85b5631c12350c8d5dc409ba10b9025d0f445cf449d92b1c");
- //roots.back().stableEndpoints.push_back(InetAddress("45.32.198.130/9993")); // Dallas
- //roots.back().stableEndpoints.push_back(InetAddress("2001:19f0:6400:81c3:5400:00ff:fe18:1d61/9993")); // Dallas
- //roots.back().stableEndpoints.push_back(InetAddress("46.101.160.249/9993")); // Frankfurt
- //roots.back().stableEndpoints.push_back(InetAddress("2a03:b0c0:3:d0::6a:3001/9993")); // Frankfurt
- //roots.back().stableEndpoints.push_back(InetAddress("107.191.46.210/9993")); // Paris
- //roots.back().stableEndpoints.push_back(InetAddress("2001:19f0:6800:83a4::64/9993")); // Paris
- //roots.back().stableEndpoints.push_back(InetAddress("45.32.246.179/9993")); // Sydney
- //roots.back().stableEndpoints.push_back(InetAddress("2001:19f0:5800:8bf8:5400:ff:fe15:b39a/9993")); // Sydney
- //roots.back().stableEndpoints.push_back(InetAddress("45.32.248.87/9993")); // Tokyo
- //roots.back().stableEndpoints.push_back(InetAddress("2001:19f0:7000:9bc9:5400:00ff:fe15:c4f5/9993")); // Tokyo
- //roots.back().stableEndpoints.push_back(InetAddress("159.203.2.154/9993")); // Toronto
- //roots.back().stableEndpoints.push_back(InetAddress("2604:a880:cad:d0::26:7001/9993")); // Toronto
-
- // END WORLD DEFINITION
- // =========================================================================
-
- fprintf(stderr,"INFO: generating and signing id==%llu ts==%llu" ZT_EOL_S,(unsigned long long)id,(unsigned long long)ts);
-
- World nw = World::make(World::TYPE_PLANET,id,ts,currentKP.pub,roots,previousKP);
-
- Buffer outtmp;
- nw.serialize(outtmp,false);
- World testw;
- testw.deserialize(outtmp,0);
- if (testw != nw) {
- fprintf(stderr,"FATAL: serialization test failed!" ZT_EOL_S);
- return 1;
- }
-
- OSUtils::writeFile("world.bin",std::string((const char *)outtmp.data(),outtmp.size()));
- fprintf(stderr,"INFO: world.bin written with %u bytes of binary world data." ZT_EOL_S,outtmp.size());
-
- fprintf(stdout,ZT_EOL_S);
- fprintf(stdout,"#define ZT_DEFAULT_WORLD_LENGTH %u" ZT_EOL_S,outtmp.size());
- fprintf(stdout,"static const unsigned char ZT_DEFAULT_WORLD[ZT_DEFAULT_WORLD_LENGTH] = {");
- for(unsigned int i=0;i 0)
- fprintf(stdout,",");
- fprintf(stdout,"0x%.2x",(unsigned int)d[i]);
- }
- fprintf(stdout,"};" ZT_EOL_S);
-
- return 0;
-}
diff --git a/attic/world/world.bin b/attic/world/world.bin
deleted file mode 100644
index 88049ccdc..000000000
Binary files a/attic/world/world.bin and /dev/null differ
diff --git a/attic/world/world.c b/attic/world/world.c
deleted file mode 100644
index ecf30e6f0..000000000
--- a/attic/world/world.c
+++ /dev/null
@@ -1,3 +0,0 @@
-
-#define ZT_DEFAULT_WORLD_LENGTH 732
-static const unsigned char ZT_DEFAULT_WORLD[ZT_DEFAULT_WORLD_LENGTH] = {0x01,0x00,0x00,0x00,0x00,0x08,0xea,0xc9,0x0a,0x00,0x00,0x01,0x6b,0xd4,0x16,0x08,0xc1,0xb8,0xb3,0x88,0xa4,0x69,0x22,0x14,0x91,0xaa,0x9a,0xcd,0x66,0xcc,0x76,0x4c,0xde,0xfd,0x56,0x03,0x9f,0x10,0x67,0xae,0x15,0xe6,0x9c,0x6f,0xb4,0x2d,0x7b,0x55,0x33,0x0e,0x3f,0xda,0xac,0x52,0x9c,0x07,0x92,0xfd,0x73,0x40,0xa6,0xaa,0x21,0xab,0xa8,0xa4,0x89,0xfd,0xae,0xa4,0x4a,0x39,0xbf,0x2d,0x00,0x65,0x9a,0xc9,0xc8,0x18,0xeb,0x16,0x93,0xf4,0xe5,0xbd,0x20,0xda,0x10,0xad,0xc7,0x05,0xf4,0x99,0xfe,0x04,0x08,0x9b,0xe0,0x9e,0x77,0x1d,0x9f,0x47,0x16,0xaa,0x92,0x4f,0x10,0x16,0x3d,0xc7,0xec,0xd3,0x90,0x9e,0xd1,0x74,0xfc,0xb3,0xb5,0x07,0x9c,0x4d,0x95,0xc5,0x17,0x8b,0x3d,0x0b,0x60,0x76,0xe8,0x51,0xbb,0xb6,0x3d,0x74,0xb5,0x21,0x83,0x7b,0x95,0x1d,0x02,0x9b,0xcd,0xaf,0x5c,0x3e,0x96,0xdf,0x37,0x2c,0x56,0x6d,0xfa,0x75,0x0f,0xda,0x55,0x85,0x13,0xf4,0x76,0x1a,0x66,0x4d,0x3b,0x8d,0xcf,0x12,0xc9,0x34,0xb9,0x0d,0x61,0x03,0x3a,0x46,0xf1,0xbf,0x30,0x00,0x76,0xe6,0x6f,0xab,0x33,0xe2,0x85,0x49,0xa6,0x2e,0xe2,0x06,0x4d,0x18,0x43,0x27,0x3c,0x2c,0x30,0x0b,0xa4,0x5c,0x3f,0x20,0xbe,0xf0,0x2d,0xba,0xd2,0x25,0x72,0x3b,0xb5,0x9a,0x9b,0xb4,0xb1,0x35,0x35,0x73,0x09,0x61,0xae,0xec,0xf5,0xa1,0x63,0xac,0xe4,0x77,0xcc,0xeb,0x07,0x27,0x02,0x5b,0x99,0xac,0x14,0xa5,0x16,0x6a,0x09,0xa3,0x00,0x02,0x04,0xb9,0xb4,0x0d,0x52,0x27,0x09,0x06,0x2a,0x02,0x6e,0xa0,0xc8,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0x09,0x9d,0x21,0x90,0x39,0xf3,0x00,0x01,0xf0,0x92,0x2a,0x98,0xe3,0xb3,0x4e,0xbc,0xbf,0xf3,0x33,0x26,0x9d,0xc2,0x65,0xd7,0xa0,0x20,0xaa,0xb6,0x9d,0x72,0xbe,0x4d,0x4a,0xcc,0x9c,0x8c,0x92,0x94,0x78,0x57,0x71,0x25,0x6c,0xd1,0xd9,0x42,0xa9,0x0d,0x1b,0xd1,0xd2,0xdc,0xa3,0xea,0x84,0xef,0x7d,0x85,0xaf,0xe6,0x61,0x1f,0xb4,0x3f,0xf0,0xb7,0x41,0x26,0xd9,0x0a,0x6e,0x00,0x0c,0x04,0xbc,0xa6,0x5e,0xb1,0x27,0x09,0x06,0x2a,0x03,0xb0,0xc0,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x00,0x7d,0x00,0x01,0x27,0x09,0x04,0x9a,0x42,0xc5,0x21,0x27,0x09,0x06,0x2c,0x0f,0xf8,0x50,0x01,0x54,0x01,0x97,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x27,0x09,0x04,0x9f,0xcb,0x61,0xab,0x27,0x09,0x06,0x26,0x04,0xa8,0x80,0x08,0x00,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,0x54,0x60,0x01,0x27,0x09,0x04,0x83,0xff,0x06,0x10,0x27,0x09,0x06,0x28,0x03,0xeb,0x80,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x27,0x09,0x04,0x6b,0xaa,0xc5,0x0e,0x27,0x09,0x06,0x26,0x04,0xa8,0x80,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x02,0x00,0xe0,0x01,0x27,0x09,0x04,0x80,0xc7,0xc5,0xd9,0x27,0x09,0x06,0x24,0x00,0x61,0x80,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x00,0xb7,0x40,0x01,0x27,0x09,0x88,0x41,0x40,0x8a,0x2e,0x00,0xbb,0x1d,0x31,0xf2,0xc3,0x23,0xe2,0x64,0xe9,0xe6,0x41,0x72,0xc1,0xa7,0x4f,0x77,0x89,0x95,0x55,0xed,0x10,0x75,0x1c,0xd5,0x6e,0x86,0x40,0x5c,0xde,0x11,0x8d,0x02,0xdf,0xfe,0x55,0x5d,0x46,0x2c,0xcf,0x6a,0x85,0xb5,0x63,0x1c,0x12,0x35,0x0c,0x8d,0x5d,0xc4,0x09,0xba,0x10,0xb9,0x02,0x5d,0x0f,0x44,0x5c,0xf4,0x49,0xd9,0x2b,0x1c,0x00,0x0c,0x04,0x2d,0x20,0xc6,0x82,0x27,0x09,0x06,0x20,0x01,0x19,0xf0,0x64,0x00,0x81,0xc3,0x54,0x00,0x00,0xff,0xfe,0x18,0x1d,0x61,0x27,0x09,0x04,0x2e,0x65,0xa0,0xf9,0x27,0x09,0x06,0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x00,0x6a,0x30,0x01,0x27,0x09,0x04,0x6b,0xbf,0x2e,0xd2,0x27,0x09,0x06,0x20,0x01,0x19,0xf0,0x68,0x00,0x83,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x27,0x09,0x04,0x2d,0x20,0xf6,0xb3,0x27,0x09,0x06,0x20,0x01,0x19,0xf0,0x58,0x00,0x8b,0xf8,0x54,0x00,0x00,0xff,0xfe,0x15,0xb3,0x9a,0x27,0x09,0x04,0x2d,0x20,0xf8,0x57,0x27,0x09,0x06,0x20,0x01,0x19,0xf0,0x70,0x00,0x9b,0xc9,0x54,0x00,0x00,0xff,0xfe,0x15,0xc4,0xf5,0x27,0x09,0x04,0x9f,0xcb,0x02,0x9a,0x27,0x09,0x06,0x26,0x04,0xa8,0x80,0x0c,0xad,0x00,0xd0,0x00,0x00,0x00,0x00,0x00,0x26,0x70,0x01,0x27,0x09};
diff --git a/controller/LFDB.cpp b/controller/LFDB.cpp
deleted file mode 100644
index 35532a7f5..000000000
--- a/controller/LFDB.cpp
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Copyright (c)2019 ZeroTier, Inc.
- *
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
- */
-/****/
-
-#include "LFDB.hpp"
-
-#ifdef CMAKE_BUILD
-#include "httplib.h"
-#else
-#include "../ext/cpp-httplib/httplib.h"
-#endif
-#include "../osdep/OSUtils.hpp"
-
-#include
-#include
-#include
-#include
-
-namespace ZeroTier {
-
-LFDB::LFDB(const Identity& myId, const char* path, const char* lfOwnerPrivate, const char* lfOwnerPublic, const char* lfNodeHost, int lfNodePort, bool storeOnlineState)
- : DB()
- , _myId(myId)
- , _lfOwnerPrivate((lfOwnerPrivate) ? lfOwnerPrivate : "")
- , _lfOwnerPublic((lfOwnerPublic) ? lfOwnerPublic : "")
- , _lfNodeHost((lfNodeHost) ? lfNodeHost : "127.0.0.1")
- , _lfNodePort(((lfNodePort > 0) && (lfNodePort < 65536)) ? lfNodePort : 9980)
- , _running(true)
- , _ready(false)
- , _storeOnlineState(storeOnlineState)
-{
- _syncThread = std::thread([this]() {
- char controllerAddress[24];
- const uint64_t controllerAddressInt = _myId.address().toInt();
- _myId.address().toString(controllerAddress);
- std::string networksSelectorName("com.zerotier.controller.lfdb:");
- networksSelectorName.append(controllerAddress);
- networksSelectorName.append("/network");
-
- // LF record masking key is the first 32 bytes of SHA512(controller private key) in hex,
- // hiding record values from anything but the controller or someone who has its key.
- uint8_t sha512pk[64];
- _myId.sha512PrivateKey(sha512pk);
- char maskingKey[128];
- Utils::hex(sha512pk, 32, maskingKey);
-
- httplib::Client htcli(_lfNodeHost.c_str(), _lfNodePort);
- int64_t timeRangeStart = 0;
- while (_running.load()) {
- {
- std::lock_guard sl(_state_l);
- for (auto ns = _state.begin(); ns != _state.end(); ++ns) {
- if (ns->second.dirty) {
- nlohmann::json network;
- if (get(ns->first, network)) {
- nlohmann::json newrec, selector0;
- selector0["Name"] = networksSelectorName;
- selector0["Ordinal"] = ns->first;
- newrec["Selectors"].push_back(selector0);
- newrec["Value"] = network.dump();
- newrec["OwnerPrivate"] = _lfOwnerPrivate;
- newrec["MaskingKey"] = maskingKey;
- newrec["PulseIfUnchanged"] = true;
- try {
- auto resp = htcli.Post("/makerecord", newrec.dump(), "application/json");
- if (resp) {
- if (resp->status == 200) {
- ns->second.dirty = false;
- // printf("SET network %.16llx %s\n",ns->first,resp->body.c_str());
- }
- else {
- fprintf(stderr, "ERROR: LFDB: %d from node (create/update network): %s" ZT_EOL_S, resp->status, resp->body.c_str());
- }
- }
- else {
- fprintf(stderr, "ERROR: LFDB: node is offline" ZT_EOL_S);
- }
- }
- catch (std::exception& e) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (create/update network): %s" ZT_EOL_S, e.what());
- }
- catch (...) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (create/update network): unknown exception" ZT_EOL_S);
- }
- }
- }
-
- for (auto ms = ns->second.members.begin(); ms != ns->second.members.end(); ++ms) {
- if ((_storeOnlineState) && (ms->second.lastOnlineDirty) && (ms->second.lastOnlineAddress)) {
- nlohmann::json newrec, selector0, selector1, selectors, ip;
- char tmp[1024], tmp2[128];
- OSUtils::ztsnprintf(tmp, sizeof(tmp), "com.zerotier.controller.lfdb:%s/network/%.16llx/online", controllerAddress, (unsigned long long)ns->first);
- ms->second.lastOnlineAddress.toIpString(tmp2);
- selector0["Name"] = tmp;
- selector0["Ordinal"] = ms->first;
- selector1["Name"] = tmp2;
- selector1["Ordinal"] = 0;
- selectors.push_back(selector0);
- selectors.push_back(selector1);
- newrec["Selectors"] = selectors;
- const uint8_t* const rawip = (const uint8_t*)ms->second.lastOnlineAddress.rawIpData();
- switch (ms->second.lastOnlineAddress.ss_family) {
- case AF_INET:
- for (int j = 0; j < 4; ++j)
- ip.push_back((unsigned int)rawip[j]);
- break;
- case AF_INET6:
- for (int j = 0; j < 16; ++j)
- ip.push_back((unsigned int)rawip[j]);
- break;
- default:
- ip = tmp2; // should never happen since only IP transport is currently supported
- break;
- }
- newrec["Value"] = ip;
- newrec["OwnerPrivate"] = _lfOwnerPrivate;
- newrec["MaskingKey"] = maskingKey;
- newrec["Timestamp"] = ms->second.lastOnlineTime;
- newrec["PulseIfUnchanged"] = true;
- try {
- auto resp = htcli.Post("/makerecord", newrec.dump(), "application/json");
- if (resp) {
- if (resp->status == 200) {
- ms->second.lastOnlineDirty = false;
- // printf("SET member online %.16llx %.10llx %s\n",ns->first,ms->first,resp->body.c_str());
- }
- else {
- fprintf(stderr, "ERROR: LFDB: %d from node (create/update member online status): %s" ZT_EOL_S, resp->status, resp->body.c_str());
- }
- }
- else {
- fprintf(stderr, "ERROR: LFDB: node is offline" ZT_EOL_S);
- }
- }
- catch (std::exception& e) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (create/update member online status): %s" ZT_EOL_S, e.what());
- }
- catch (...) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (create/update member online status): unknown exception" ZT_EOL_S);
- }
- }
-
- if (ms->second.dirty) {
- nlohmann::json network, member;
- if (get(ns->first, network, ms->first, member)) {
- nlohmann::json newrec, selector0, selector1, selectors;
- selector0["Name"] = networksSelectorName;
- selector0["Ordinal"] = ns->first;
- selector1["Name"] = "member";
- selector1["Ordinal"] = ms->first;
- selectors.push_back(selector0);
- selectors.push_back(selector1);
- newrec["Selectors"] = selectors;
- newrec["Value"] = member.dump();
- newrec["OwnerPrivate"] = _lfOwnerPrivate;
- newrec["MaskingKey"] = maskingKey;
- newrec["PulseIfUnchanged"] = true;
- try {
- auto resp = htcli.Post("/makerecord", newrec.dump(), "application/json");
- if (resp) {
- if (resp->status == 200) {
- ms->second.dirty = false;
- // printf("SET member %.16llx %.10llx %s\n",ns->first,ms->first,resp->body.c_str());
- }
- else {
- fprintf(stderr, "ERROR: LFDB: %d from node (create/update member): %s" ZT_EOL_S, resp->status, resp->body.c_str());
- }
- }
- else {
- fprintf(stderr, "ERROR: LFDB: node is offline" ZT_EOL_S);
- }
- }
- catch (std::exception& e) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (create/update member): %s" ZT_EOL_S, e.what());
- }
- catch (...) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (create/update member): unknown exception" ZT_EOL_S);
- }
- }
- }
- }
- }
- }
-
- try {
- std::ostringstream query;
- query << "{"
- "\"Ranges\":[{"
- "\"Name\":\""
- << networksSelectorName
- << "\","
- "\"Range\":[0,18446744073709551615]"
- "}],"
- "\"TimeRange\":["
- << timeRangeStart
- << ",9223372036854775807],"
- "\"MaskingKey\":\""
- << maskingKey
- << "\","
- "\"Owners\":[\""
- << _lfOwnerPublic
- << "\"]"
- "}";
- auto resp = htcli.Post("/query", query.str(), "application/json");
- if (resp) {
- if (resp->status == 200) {
- nlohmann::json results(OSUtils::jsonParse(resp->body));
- if ((results.is_array()) && (! results.empty())) {
- for (std::size_t ri = 0; ri < results.size(); ++ri) {
- nlohmann::json& rset = results[ri];
- if ((rset.is_array()) && (! rset.empty())) {
- nlohmann::json& result = rset[0];
- if (result.is_object()) {
- nlohmann::json& record = result["Record"];
- if (record.is_object()) {
- const std::string recordValue = result["Value"];
- // printf("GET network %s\n",recordValue.c_str());
- nlohmann::json network(OSUtils::jsonParse(recordValue));
- if (network.is_object()) {
- const std::string idstr = network["id"];
- const uint64_t id = Utils::hexStrToU64(idstr.c_str());
- if ((id >> 24) == controllerAddressInt) { // sanity check
-
- nlohmann::json oldNetwork;
- if ((timeRangeStart > 0) && (get(id, oldNetwork))) {
- const uint64_t revision = network["revision"];
- const uint64_t prevRevision = oldNetwork["revision"];
- if (prevRevision < revision) {
- _networkChanged(oldNetwork, network, timeRangeStart > 0);
- }
- }
- else {
- nlohmann::json nullJson;
- _networkChanged(nullJson, network, timeRangeStart > 0);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- else {
- fprintf(stderr, "ERROR: LFDB: %d from node (check for network updates): %s" ZT_EOL_S, resp->status, resp->body.c_str());
- }
- }
- else {
- fprintf(stderr, "ERROR: LFDB: node is offline" ZT_EOL_S);
- }
- }
- catch (std::exception& e) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (check for network updates): %s" ZT_EOL_S, e.what());
- }
- catch (...) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (check for network updates): unknown exception" ZT_EOL_S);
- }
-
- try {
- std::ostringstream query;
- query << "{"
- "\"Ranges\":[{"
- "\"Name\":\""
- << networksSelectorName
- << "\","
- "\"Range\":[0,18446744073709551615]"
- "},{"
- "\"Name\":\"member\","
- "\"Range\":[0,18446744073709551615]"
- "}],"
- "\"TimeRange\":["
- << timeRangeStart
- << ",9223372036854775807],"
- "\"MaskingKey\":\""
- << maskingKey
- << "\","
- "\"Owners\":[\""
- << _lfOwnerPublic
- << "\"]"
- "}";
- auto resp = htcli.Post("/query", query.str(), "application/json");
- if (resp) {
- if (resp->status == 200) {
- nlohmann::json results(OSUtils::jsonParse(resp->body));
- if ((results.is_array()) && (! results.empty())) {
- for (std::size_t ri = 0; ri < results.size(); ++ri) {
- nlohmann::json& rset = results[ri];
- if ((rset.is_array()) && (! rset.empty())) {
- nlohmann::json& result = rset[0];
- if (result.is_object()) {
- nlohmann::json& record = result["Record"];
- if (record.is_object()) {
- const std::string recordValue = result["Value"];
- // printf("GET member %s\n",recordValue.c_str());
- nlohmann::json member(OSUtils::jsonParse(recordValue));
- if (member.is_object()) {
- const std::string nwidstr = member["nwid"];
- const std::string idstr = member["id"];
- const uint64_t nwid = Utils::hexStrToU64(nwidstr.c_str());
- const uint64_t id = Utils::hexStrToU64(idstr.c_str());
- if ((id) && ((nwid >> 24) == controllerAddressInt)) { // sanity check
-
- nlohmann::json network, oldMember;
- if ((timeRangeStart > 0) && (get(nwid, network, id, oldMember))) {
- const uint64_t revision = member["revision"];
- const uint64_t prevRevision = oldMember["revision"];
- if (prevRevision < revision)
- _memberChanged(oldMember, member, timeRangeStart > 0);
- }
- else if (hasNetwork(nwid)) {
- nlohmann::json nullJson;
- _memberChanged(nullJson, member, timeRangeStart > 0);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- else {
- fprintf(stderr, "ERROR: LFDB: %d from node (check for member updates): %s" ZT_EOL_S, resp->status, resp->body.c_str());
- }
- }
- else {
- fprintf(stderr, "ERROR: LFDB: node is offline" ZT_EOL_S);
- }
- }
- catch (std::exception& e) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (check for member updates): %s" ZT_EOL_S, e.what());
- }
- catch (...) {
- fprintf(stderr, "ERROR: LFDB: unexpected exception querying node (check for member updates): unknown exception" ZT_EOL_S);
- }
-
- timeRangeStart = time(nullptr) - 120; // start next query 2m before now to avoid losing updates
- _ready.store(true);
-
- for (int k = 0; k < 4; ++k) { // 2s delay between queries for remotely modified networks or members
- if (! _running.load())
- return;
- std::this_thread::sleep_for(std::chrono::milliseconds(500));
- }
- }
- });
-}
-
-LFDB::~LFDB()
-{
- _running.store(false);
- _syncThread.join();
-}
-
-bool LFDB::waitForReady()
-{
- while (! _ready.load()) {
- std::this_thread::sleep_for(std::chrono::milliseconds(500));
- }
- return true;
-}
-
-bool LFDB::isReady()
-{
- return (_ready.load());
-}
-
-bool LFDB::save(nlohmann::json& record, bool notifyListeners)
-{
- bool modified = false;
- const std::string objtype = record["objtype"];
- if (objtype == "network") {
- const uint64_t nwid = OSUtils::jsonIntHex(record["id"], 0ULL);
- if (nwid) {
- nlohmann::json old;
- get(nwid, old);
- if ((! old.is_object()) || (! _compareRecords(old, record))) {
- record["revision"] = OSUtils::jsonInt(record["revision"], 0ULL) + 1ULL;
- _networkChanged(old, record, notifyListeners);
- {
- std::lock_guard l(_state_l);
- _state[nwid].dirty = true;
- }
- modified = true;
- }
- }
- }
- else if (objtype == "member") {
- const uint64_t nwid = OSUtils::jsonIntHex(record["nwid"], 0ULL);
- const uint64_t id = OSUtils::jsonIntHex(record["id"], 0ULL);
- if ((id) && (nwid)) {
- nlohmann::json network, old;
- get(nwid, network, id, old);
- if ((! old.is_object()) || (! _compareRecords(old, record))) {
- record["revision"] = OSUtils::jsonInt(record["revision"], 0ULL) + 1ULL;
- _memberChanged(old, record, notifyListeners);
- {
- std::lock_guard l(_state_l);
- _state[nwid].members[id].dirty = true;
- }
- modified = true;
- }
- }
- }
- return modified;
-}
-
-void LFDB::eraseNetwork(const uint64_t networkId)
-{
- // TODO
-}
-
-void LFDB::eraseMember(const uint64_t networkId, const uint64_t memberId)
-{
- // TODO
-}
-
-void LFDB::nodeIsOnline(const uint64_t networkId, const uint64_t memberId, const InetAddress& physicalAddress, const char* osArch)
-{
- std::lock_guard l(_state_l);
- auto nw = _state.find(networkId);
- if (nw != _state.end()) {
- auto m = nw->second.members.find(memberId);
- if (m != nw->second.members.end()) {
- m->second.lastOnlineTime = OSUtils::now();
- if (physicalAddress)
- m->second.lastOnlineAddress = physicalAddress;
- m->second.lastOnlineDirty = true;
- }
- }
-}
-
-void LFDB::nodeIsOnline(const uint64_t networkId, const uint64_t memberId, const InetAddress& physicalAddress)
-{
- this->nodeIsOnline(networkId, memberId, physicalAddress, "unknown/unknown");
-}
-
-} // namespace ZeroTier
diff --git a/controller/LFDB.hpp b/controller/LFDB.hpp
deleted file mode 100644
index 3632e483f..000000000
--- a/controller/LFDB.hpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c)2019 ZeroTier, Inc.
- *
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
- */
-/****/
-
-#ifndef ZT_CONTROLLER_LFDB_HPP
-#define ZT_CONTROLLER_LFDB_HPP
-
-#include "DB.hpp"
-
-#include
-#include
-#include
-#include
-
-namespace ZeroTier {
-
-/**
- * DB implementation for controller that stores data in LF
- */
-class LFDB : public DB {
- public:
- /**
- * @param myId This controller's identity
- * @param path Base path for ZeroTier node itself
- * @param lfOwnerPrivate LF owner private in PEM format
- * @param lfOwnerPublic LF owner public in @base62 format
- * @param lfNodeHost LF node host
- * @param lfNodePort LF node http (not https) port
- * @param storeOnlineState If true, store online/offline state and IP info in LF (a lot of data, only for private networks!)
- */
- LFDB(const Identity& myId, const char* path, const char* lfOwnerPrivate, const char* lfOwnerPublic, const char* lfNodeHost, int lfNodePort, bool storeOnlineState);
- virtual ~LFDB();
-
- virtual bool waitForReady();
- virtual bool isReady();
- virtual bool save(nlohmann::json& record, bool notifyListeners);
- virtual void eraseNetwork(const uint64_t networkId);
- virtual void eraseMember(const uint64_t networkId, const uint64_t memberId);
- virtual void nodeIsOnline(const uint64_t networkId, const uint64_t memberId, const InetAddress& physicalAddress);
- virtual void nodeIsOnline(const uint64_t networkId, const uint64_t memberId, const InetAddress& physicalAddress, const char* osArch);
-
- protected:
- const Identity _myId;
-
- std::string _lfOwnerPrivate, _lfOwnerPublic;
- std::string _lfNodeHost;
- int _lfNodePort;
-
- struct _MemberState {
- _MemberState() : lastOnlineAddress(), lastOnlineTime(0), dirty(false), lastOnlineDirty(false)
- {
- }
- InetAddress lastOnlineAddress;
- int64_t lastOnlineTime;
- bool dirty;
- bool lastOnlineDirty;
- };
- struct _NetworkState {
- _NetworkState() : members(), dirty(false)
- {
- }
- std::unordered_map members;
- bool dirty;
- };
- std::unordered_map _state;
- std::mutex _state_l;
-
- std::atomic_bool _running;
- std::atomic_bool _ready;
- std::thread _syncThread;
- bool _storeOnlineState;
-};
-
-} // namespace ZeroTier
-
-#endif
diff --git a/debian/changelog b/debian/changelog
index fdc85f860..01ef8cf65 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+zerotier-one (1.16.0) unstable; urgency=medium
+
+ * See RELEASE-NOTES.md for release notes.
+
+ -- Adam Ierymenko Thu, 21 Aug 2025 01:00:00 -0700
+
zerotier-one (1.14.2) unstable; urgency=medium
* See RELEASE-NOTES.md for release notes.
diff --git a/ext/installfiles/mac/ZeroTier One.pkgproj b/ext/installfiles/mac/ZeroTier One.pkgproj
index 70cedf9f9..56ae6ea28 100755
--- a/ext/installfiles/mac/ZeroTier One.pkgproj
+++ b/ext/installfiles/mac/ZeroTier One.pkgproj
@@ -1,14 +1,15 @@
-
-
+
+
PACKAGES
MUST-CLOSE-APPLICATION-ITEMS
-
+
MUST-CLOSE-APPLICATIONS
-
+
PACKAGE_FILES
DEFAULT_INSTALL_LOCATION
@@ -22,7 +23,7 @@
CHILDREN
-
+
GID
80
PATH
@@ -38,7 +39,7 @@
BUNDLE_CAN_DOWNGRADE
-
+
BUNDLE_POSTINSTALL_PATH
PATH_TYPE
@@ -50,7 +51,7 @@
0
CHILDREN
-
+
GID
80
PATH
@@ -92,7 +93,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -108,7 +109,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -124,7 +125,7 @@
CHILDREN
-
+
GID
80
PATH
@@ -140,7 +141,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -156,7 +157,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -214,7 +215,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -230,7 +231,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -246,7 +247,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -262,7 +263,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -278,7 +279,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -294,7 +295,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -310,7 +311,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -329,7 +330,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -359,7 +360,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -375,7 +376,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -391,7 +392,7 @@
CHILDREN
-
+
GID
80
PATH
@@ -407,7 +408,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -423,7 +424,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -439,7 +440,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -455,7 +456,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -471,7 +472,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -487,7 +488,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -503,7 +504,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -519,7 +520,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -555,7 +556,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -602,7 +603,7 @@
CHILDREN
-
+
GID
0
PATH
@@ -647,13 +648,13 @@
PAYLOAD_TYPE
0
PRESERVE_EXTENDED_ATTRIBUTES
-
+
SHOW_INVISIBLE
-
+
SPLIT_FORKS
-
+
TREAT_MISSING_FILES_AS_WARNING
-
+
VERSION
5
@@ -674,7 +675,7 @@
1
RESOURCES
-
+
PACKAGE_SETTINGS
@@ -683,7 +684,7 @@
CONCLUSION_ACTION
0
FOLLOW_SYMBOLIC_LINKS
-
+
IDENTIFIER
com.zerotier.pkg.ZeroTierOne
LOCATION
@@ -691,17 +692,17 @@
NAME
ZeroTier One
OVERWRITE_PERMISSIONS
-
+
PAYLOAD_SIZE
-1
REFERENCE_PATH
-
+
RELOCATABLE
-
+
USE_HFS+_COMPRESSION
-
+
VERSION
- 1.14.2
+ 1.16.0
TYPE
0
@@ -753,12 +754,12 @@
APPAREANCES
DARK_AQUA
-
+
LIGHT_AQUA
-
+
SHARED_SETTINGS_FOR_ALL_APPAREANCES
-
+
INSTALLATION TYPE
@@ -770,20 +771,20 @@
CHILDREN
-
+
DESCRIPTION
-
+
OPTIONS
HIDDEN
-
+
STATE
1
PACKAGE_UUID
1B6AFC3A-9EA5-4401-83D4-37F06CD13CD6
TITLE
-
+
TYPE
0
UUID
@@ -791,7 +792,7 @@
REMOVED
-
+
MODE
@@ -859,24 +860,24 @@
INTRODUCTION
LOCALIZATIONS
-
+
LICENSE
LOCALIZATIONS
-
+
MODE
0
README
LOCALIZATIONS
-
+
TITLE
LOCALIZATIONS
-
+
PROJECT_REQUIREMENTS
@@ -900,17 +901,17 @@
IDENTIFIER
fr.whitebox.Packages.requirement.os
MESSAGE
-
+
NAME
Operating System
STATE
-
+
RESOURCES
-
+
ROOT_VOLUME_ONLY
-
+
PROJECT_SETTINGS
@@ -937,7 +938,7 @@
REGULAR_EXPRESSION
-
+
STRING
.DS_Store
TYPE
@@ -945,20 +946,20 @@
PROTECTED
-
+
PROXY_NAME
Remove .DS_Store files
PROXY_TOOLTIP
Remove ".DS_Store" files created by the Finder.
STATE
-
+
PATTERNS_ARRAY
REGULAR_EXPRESSION
-
+
STRING
.pbdevelopment
TYPE
@@ -966,20 +967,21 @@
PROTECTED
-
+
PROXY_NAME
Remove .pbdevelopment files
PROXY_TOOLTIP
- Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.
+ Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.
STATE
-
+
PATTERNS_ARRAY
REGULAR_EXPRESSION
-
+
STRING
CVS
TYPE
@@ -987,7 +989,7 @@
REGULAR_EXPRESSION
-
+
STRING
.cvsignore
TYPE
@@ -995,7 +997,7 @@
REGULAR_EXPRESSION
-
+
STRING
.cvspass
TYPE
@@ -1003,7 +1005,7 @@
REGULAR_EXPRESSION
-
+
STRING
.svn
TYPE
@@ -1011,7 +1013,7 @@
REGULAR_EXPRESSION
-
+
STRING
.git
TYPE
@@ -1019,7 +1021,7 @@
REGULAR_EXPRESSION
-
+
STRING
.gitignore
TYPE
@@ -1027,20 +1029,21 @@
PROTECTED
-
+
PROXY_NAME
Remove SCM metadata
PROXY_TOOLTIP
- Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.
+ Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.
STATE
-
+
PATTERNS_ARRAY
REGULAR_EXPRESSION
-
+
STRING
classes.nib
TYPE
@@ -1048,7 +1051,7 @@
REGULAR_EXPRESSION
-
+
STRING
designable.db
TYPE
@@ -1056,7 +1059,7 @@
REGULAR_EXPRESSION
-
+
STRING
info.nib
TYPE
@@ -1064,20 +1067,21 @@
PROTECTED
-
+
PROXY_NAME
Optimize nib files
PROXY_TOOLTIP
- Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.
+ Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.
STATE
-
+
PATTERNS_ARRAY
REGULAR_EXPRESSION
-
+
STRING
Resources Disabled
TYPE
@@ -1085,31 +1089,31 @@
PROTECTED
-
+
PROXY_NAME
Remove Resources Disabled folders
PROXY_TOOLTIP
Remove "Resources Disabled" folders.
STATE
-
+
SEPARATOR
-
+
NAME
ZeroTier One
PAYLOAD_ONLY
-
+
TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING
-
+
SHARED_GLOBAL_DATA
IC_REQUIREMENT_JAVASCRIPT_SHARED_SOURCE_CODE
-
+
TYPE
0
diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip
index 3066eb788..5eb6c639c 100644
--- a/ext/installfiles/windows/ZeroTier One.aip
+++ b/ext/installfiles/windows/ZeroTier One.aip
@@ -1,5 +1,5 @@
-
+
@@ -21,10 +21,10 @@
-
+
-
+
@@ -62,7 +62,7 @@
-
+
@@ -515,10 +515,10 @@
-
+
-
+
diff --git a/include/ZeroTierDebug.h b/include/ZeroTierDebug.h
index 2e9cc2c5a..22ac0cdd5 100644
--- a/include/ZeroTierDebug.h
+++ b/include/ZeroTierDebug.h
@@ -1,15 +1,10 @@
-/*
- * Copyright (c)2019 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
/**
* @file
@@ -29,20 +24,20 @@
#include
#define ZT_MSG_INFO true
-#define ZT_COLOR true
+#define ZT_COLOR true
// Debug output colors
#if defined(__APPLE__)
#include "TargetConditionals.h"
#endif
#if defined(ZT_COLOR) && ! defined(_WIN32) && ! defined(__ANDROID__) && ! defined(TARGET_OS_IPHONE) && ! defined(TARGET_IPHONE_SIMULATOR) && ! defined(__APP_FRAMEWORK__)
-#define ZT_RED "\x1B[31m"
-#define ZT_GRN "\x1B[32m"
-#define ZT_YEL "\x1B[33m"
-#define ZT_BLU "\x1B[34m"
-#define ZT_MAG "\x1B[35m"
-#define ZT_CYN "\x1B[36m"
-#define ZT_WHT "\x1B[37m"
+#define ZT_RED "\x1B[31m"
+#define ZT_GRN "\x1B[32m"
+#define ZT_YEL "\x1B[33m"
+#define ZT_BLU "\x1B[34m"
+#define ZT_MAG "\x1B[35m"
+#define ZT_CYN "\x1B[36m"
+#define ZT_WHT "\x1B[37m"
#define ZT_RESET "\x1B[0m"
#else
#define ZT_RED
@@ -90,7 +85,7 @@
#else
#define DEBUG_INFO(fmt, args...)
#endif
-#else // blank
+#else // blank
#if defined(_WIN32)
#define DEBUG_INFO(...)
#else
@@ -98,4 +93,4 @@
#endif
#endif
-#endif // _H
+#endif // _H
diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h
index 8aa701a8f..1f09c99c7 100644
--- a/include/ZeroTierOne.h
+++ b/include/ZeroTierOne.h
@@ -1,15 +1,10 @@
-/*
- * Copyright (c)2019 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
/*
* This defines the external C API for ZeroTier's core network virtualization
@@ -293,74 +288,74 @@ extern "C" {
#define ZT_RULE_PACKET_CHARACTERISTICS_TCP_FIN 0x0000000000000001ULL
// Fields in remote trace dictionaries
-#define ZT_REMOTE_TRACE_FIELD__EVENT "event"
-#define ZT_REMOTE_TRACE_FIELD__NODE_ID "nodeId"
-#define ZT_REMOTE_TRACE_FIELD__PACKET_ID "packetId"
-#define ZT_REMOTE_TRACE_FIELD__PACKET_VERB "packetVerb"
-#define ZT_REMOTE_TRACE_FIELD__PACKET_TRUSTED_PATH_ID "packetTrustedPathId"
+#define ZT_REMOTE_TRACE_FIELD__EVENT "event"
+#define ZT_REMOTE_TRACE_FIELD__NODE_ID "nodeId"
+#define ZT_REMOTE_TRACE_FIELD__PACKET_ID "packetId"
+#define ZT_REMOTE_TRACE_FIELD__PACKET_VERB "packetVerb"
+#define ZT_REMOTE_TRACE_FIELD__PACKET_TRUSTED_PATH_ID "packetTrustedPathId"
#define ZT_REMOTE_TRACE_FIELD__PACKET_TRUSTED_PATH_APPROVED "packetTrustedPathApproved"
-#define ZT_REMOTE_TRACE_FIELD__PACKET_HOPS "packetHops"
-#define ZT_REMOTE_TRACE_FIELD__REMOTE_ZTADDR "remoteZtAddr"
-#define ZT_REMOTE_TRACE_FIELD__REMOTE_PHYADDR "remotePhyAddr"
-#define ZT_REMOTE_TRACE_FIELD__LOCAL_ZTADDR "localZtAddr"
-#define ZT_REMOTE_TRACE_FIELD__LOCAL_PHYADDR "localPhyAddr"
-#define ZT_REMOTE_TRACE_FIELD__LOCAL_SOCKET "localSocket"
-#define ZT_REMOTE_TRACE_FIELD__IP_SCOPE "phyAddrIpScope"
-#define ZT_REMOTE_TRACE_FIELD__NETWORK_ID "networkId"
-#define ZT_REMOTE_TRACE_FIELD__SOURCE_ZTADDR "sourceZtAddr"
-#define ZT_REMOTE_TRACE_FIELD__DEST_ZTADDR "destZtAddr"
-#define ZT_REMOTE_TRACE_FIELD__SOURCE_MAC "sourceMac"
-#define ZT_REMOTE_TRACE_FIELD__DEST_MAC "destMac"
-#define ZT_REMOTE_TRACE_FIELD__ETHERTYPE "etherType"
-#define ZT_REMOTE_TRACE_FIELD__VLAN_ID "vlanId"
-#define ZT_REMOTE_TRACE_FIELD__FRAME_LENGTH "frameLength"
-#define ZT_REMOTE_TRACE_FIELD__FRAME_DATA "frameData"
-#define ZT_REMOTE_TRACE_FIELD__FILTER_FLAG_NOTEE "filterNoTee"
-#define ZT_REMOTE_TRACE_FIELD__FILTER_FLAG_INBOUND "filterInbound"
-#define ZT_REMOTE_TRACE_FIELD__FILTER_RESULT "filterResult"
-#define ZT_REMOTE_TRACE_FIELD__FILTER_BASE_RULE_LOG "filterBaseRuleLog"
-#define ZT_REMOTE_TRACE_FIELD__FILTER_CAP_RULE_LOG "filterCapRuleLog"
-#define ZT_REMOTE_TRACE_FIELD__FILTER_CAP_ID "filterMatchingCapId"
-#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_TYPE "credType"
-#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_ID "credId"
-#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_TIMESTAMP "credTs"
-#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_INFO "credInfo"
-#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_ISSUED_TO "credIssuedTo"
+#define ZT_REMOTE_TRACE_FIELD__PACKET_HOPS "packetHops"
+#define ZT_REMOTE_TRACE_FIELD__REMOTE_ZTADDR "remoteZtAddr"
+#define ZT_REMOTE_TRACE_FIELD__REMOTE_PHYADDR "remotePhyAddr"
+#define ZT_REMOTE_TRACE_FIELD__LOCAL_ZTADDR "localZtAddr"
+#define ZT_REMOTE_TRACE_FIELD__LOCAL_PHYADDR "localPhyAddr"
+#define ZT_REMOTE_TRACE_FIELD__LOCAL_SOCKET "localSocket"
+#define ZT_REMOTE_TRACE_FIELD__IP_SCOPE "phyAddrIpScope"
+#define ZT_REMOTE_TRACE_FIELD__NETWORK_ID "networkId"
+#define ZT_REMOTE_TRACE_FIELD__SOURCE_ZTADDR "sourceZtAddr"
+#define ZT_REMOTE_TRACE_FIELD__DEST_ZTADDR "destZtAddr"
+#define ZT_REMOTE_TRACE_FIELD__SOURCE_MAC "sourceMac"
+#define ZT_REMOTE_TRACE_FIELD__DEST_MAC "destMac"
+#define ZT_REMOTE_TRACE_FIELD__ETHERTYPE "etherType"
+#define ZT_REMOTE_TRACE_FIELD__VLAN_ID "vlanId"
+#define ZT_REMOTE_TRACE_FIELD__FRAME_LENGTH "frameLength"
+#define ZT_REMOTE_TRACE_FIELD__FRAME_DATA "frameData"
+#define ZT_REMOTE_TRACE_FIELD__FILTER_FLAG_NOTEE "filterNoTee"
+#define ZT_REMOTE_TRACE_FIELD__FILTER_FLAG_INBOUND "filterInbound"
+#define ZT_REMOTE_TRACE_FIELD__FILTER_RESULT "filterResult"
+#define ZT_REMOTE_TRACE_FIELD__FILTER_BASE_RULE_LOG "filterBaseRuleLog"
+#define ZT_REMOTE_TRACE_FIELD__FILTER_CAP_RULE_LOG "filterCapRuleLog"
+#define ZT_REMOTE_TRACE_FIELD__FILTER_CAP_ID "filterMatchingCapId"
+#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_TYPE "credType"
+#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_ID "credId"
+#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_TIMESTAMP "credTs"
+#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_INFO "credInfo"
+#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_ISSUED_TO "credIssuedTo"
#define ZT_REMOTE_TRACE_FIELD__CREDENTIAL_REVOCATION_TARGET "credRevocationTarget"
-#define ZT_REMOTE_TRACE_FIELD__REASON "reason"
-#define ZT_REMOTE_TRACE_FIELD__NETWORK_CONTROLLER_ID "networkControllerId"
+#define ZT_REMOTE_TRACE_FIELD__REASON "reason"
+#define ZT_REMOTE_TRACE_FIELD__NETWORK_CONTROLLER_ID "networkControllerId"
// Event types in remote traces
-#define ZT_REMOTE_TRACE_EVENT__RESETTING_PATHS_IN_SCOPE 0x1000
-#define ZT_REMOTE_TRACE_EVENT__PEER_CONFIRMING_UNKNOWN_PATH 0x1001
-#define ZT_REMOTE_TRACE_EVENT__PEER_LEARNED_NEW_PATH 0x1002
-#define ZT_REMOTE_TRACE_EVENT__PEER_REDIRECTED 0x1003
-#define ZT_REMOTE_TRACE_EVENT__PACKET_MAC_FAILURE 0x1004
-#define ZT_REMOTE_TRACE_EVENT__PACKET_INVALID 0x1005
-#define ZT_REMOTE_TRACE_EVENT__DROPPED_HELLO 0x1006
+#define ZT_REMOTE_TRACE_EVENT__RESETTING_PATHS_IN_SCOPE 0x1000
+#define ZT_REMOTE_TRACE_EVENT__PEER_CONFIRMING_UNKNOWN_PATH 0x1001
+#define ZT_REMOTE_TRACE_EVENT__PEER_LEARNED_NEW_PATH 0x1002
+#define ZT_REMOTE_TRACE_EVENT__PEER_REDIRECTED 0x1003
+#define ZT_REMOTE_TRACE_EVENT__PACKET_MAC_FAILURE 0x1004
+#define ZT_REMOTE_TRACE_EVENT__PACKET_INVALID 0x1005
+#define ZT_REMOTE_TRACE_EVENT__DROPPED_HELLO 0x1006
#define ZT_REMOTE_TRACE_EVENT__OUTGOING_NETWORK_FRAME_DROPPED 0x2000
#define ZT_REMOTE_TRACE_EVENT__INCOMING_NETWORK_ACCESS_DENIED 0x2001
#define ZT_REMOTE_TRACE_EVENT__INCOMING_NETWORK_FRAME_DROPPED 0x2002
-#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_REJECTED 0x2003
-#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_ACCEPTED 0x2004
-#define ZT_REMOTE_TRACE_EVENT__NETWORK_CONFIG_REQUEST_SENT 0x2005
-#define ZT_REMOTE_TRACE_EVENT__NETWORK_FILTER_TRACE 0x2006
+#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_REJECTED 0x2003
+#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_ACCEPTED 0x2004
+#define ZT_REMOTE_TRACE_EVENT__NETWORK_CONFIG_REQUEST_SENT 0x2005
+#define ZT_REMOTE_TRACE_EVENT__NETWORK_FILTER_TRACE 0x2006
// Event types in remote traces in hex string form
-#define ZT_REMOTE_TRACE_EVENT__RESETTING_PATHS_IN_SCOPE_S "1000"
-#define ZT_REMOTE_TRACE_EVENT__PEER_CONFIRMING_UNKNOWN_PATH_S "1001"
-#define ZT_REMOTE_TRACE_EVENT__PEER_LEARNED_NEW_PATH_S "1002"
-#define ZT_REMOTE_TRACE_EVENT__PEER_REDIRECTED_S "1003"
-#define ZT_REMOTE_TRACE_EVENT__PACKET_MAC_FAILURE_S "1004"
-#define ZT_REMOTE_TRACE_EVENT__PACKET_INVALID_S "1005"
-#define ZT_REMOTE_TRACE_EVENT__DROPPED_HELLO_S "1006"
+#define ZT_REMOTE_TRACE_EVENT__RESETTING_PATHS_IN_SCOPE_S "1000"
+#define ZT_REMOTE_TRACE_EVENT__PEER_CONFIRMING_UNKNOWN_PATH_S "1001"
+#define ZT_REMOTE_TRACE_EVENT__PEER_LEARNED_NEW_PATH_S "1002"
+#define ZT_REMOTE_TRACE_EVENT__PEER_REDIRECTED_S "1003"
+#define ZT_REMOTE_TRACE_EVENT__PACKET_MAC_FAILURE_S "1004"
+#define ZT_REMOTE_TRACE_EVENT__PACKET_INVALID_S "1005"
+#define ZT_REMOTE_TRACE_EVENT__DROPPED_HELLO_S "1006"
#define ZT_REMOTE_TRACE_EVENT__OUTGOING_NETWORK_FRAME_DROPPED_S "2000"
#define ZT_REMOTE_TRACE_EVENT__INCOMING_NETWORK_ACCESS_DENIED_S "2001"
#define ZT_REMOTE_TRACE_EVENT__INCOMING_NETWORK_FRAME_DROPPED_S "2002"
-#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_REJECTED_S "2003"
-#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_ACCEPTED_S "2004"
-#define ZT_REMOTE_TRACE_EVENT__NETWORK_CONFIG_REQUEST_SENT_S "2005"
-#define ZT_REMOTE_TRACE_EVENT__NETWORK_FILTER_TRACE_S "2006"
+#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_REJECTED_S "2003"
+#define ZT_REMOTE_TRACE_EVENT__CREDENTIAL_ACCEPTED_S "2004"
+#define ZT_REMOTE_TRACE_EVENT__NETWORK_CONFIG_REQUEST_SENT_S "2005"
+#define ZT_REMOTE_TRACE_EVENT__NETWORK_FILTER_TRACE_S "2006"
/****************************************************************************/
/* Structures and other types */
@@ -375,49 +370,49 @@ extern "C" {
* problem.
*/
enum ZT_ResultCode {
- /**
- * Operation completed normally
- */
- ZT_RESULT_OK = 0,
+ /**
+ * Operation completed normally
+ */
+ ZT_RESULT_OK = 0,
- /**
- * Call produced no error but no action was taken
- */
- ZT_RESULT_OK_IGNORED = 1,
+ /**
+ * Call produced no error but no action was taken
+ */
+ ZT_RESULT_OK_IGNORED = 1,
- // Fatal errors (>=100, <1000)
+ // Fatal errors (>=100, <1000)
- /**
- * Ran out of memory
- */
- ZT_RESULT_FATAL_ERROR_OUT_OF_MEMORY = 100,
+ /**
+ * Ran out of memory
+ */
+ ZT_RESULT_FATAL_ERROR_OUT_OF_MEMORY = 100,
- /**
- * Data store is not writable or has failed
- */
- ZT_RESULT_FATAL_ERROR_DATA_STORE_FAILED = 101,
+ /**
+ * Data store is not writable or has failed
+ */
+ ZT_RESULT_FATAL_ERROR_DATA_STORE_FAILED = 101,
- /**
- * Internal error (e.g. unexpected exception indicating bug or build problem)
- */
- ZT_RESULT_FATAL_ERROR_INTERNAL = 102,
+ /**
+ * Internal error (e.g. unexpected exception indicating bug or build problem)
+ */
+ ZT_RESULT_FATAL_ERROR_INTERNAL = 102,
- // Non-fatal errors (>1000)
+ // Non-fatal errors (>1000)
- /**
- * Network ID not valid
- */
- ZT_RESULT_ERROR_NETWORK_NOT_FOUND = 1000,
+ /**
+ * Network ID not valid
+ */
+ ZT_RESULT_ERROR_NETWORK_NOT_FOUND = 1000,
- /**
- * The requested operation is not supported on this version or build
- */
- ZT_RESULT_ERROR_UNSUPPORTED_OPERATION = 1001,
+ /**
+ * The requested operation is not supported on this version or build
+ */
+ ZT_RESULT_ERROR_UNSUPPORTED_OPERATION = 1001,
- /**
- * The requested operation was given a bad parameter or was called in an invalid state
- */
- ZT_RESULT_ERROR_BAD_PARAMETER = 1002
+ /**
+ * The requested operation was given a bad parameter or was called in an invalid state
+ */
+ ZT_RESULT_ERROR_BAD_PARAMETER = 1002
};
/**
@@ -430,133 +425,133 @@ enum ZT_ResultCode {
* Status codes sent to status update callback when things happen
*/
enum ZT_Event {
- /**
- * Node has been initialized
- *
- * This is the first event generated, and is always sent. It may occur
- * before Node's constructor returns.
- *
- * Meta-data: none
- */
- ZT_EVENT_UP = 0,
+ /**
+ * Node has been initialized
+ *
+ * This is the first event generated, and is always sent. It may occur
+ * before Node's constructor returns.
+ *
+ * Meta-data: none
+ */
+ ZT_EVENT_UP = 0,
- /**
- * Node is offline -- network does not seem to be reachable by any available strategy
- *
- * Meta-data: none
- */
- ZT_EVENT_OFFLINE = 1,
+ /**
+ * Node is offline -- network does not seem to be reachable by any available strategy
+ *
+ * Meta-data: none
+ */
+ ZT_EVENT_OFFLINE = 1,
- /**
- * Node is online -- at least one upstream node appears reachable
- *
- * Meta-data: none
- */
- ZT_EVENT_ONLINE = 2,
+ /**
+ * Node is online -- at least one upstream node appears reachable
+ *
+ * Meta-data: none
+ */
+ ZT_EVENT_ONLINE = 2,
- /**
- * Node is shutting down
- *
- * This is generated within Node's destructor when it is being shut down.
- * It's done for convenience, since cleaning up other state in the event
- * handler may appear more idiomatic.
- *
- * Meta-data: none
- */
- ZT_EVENT_DOWN = 3,
+ /**
+ * Node is shutting down
+ *
+ * This is generated within Node's destructor when it is being shut down.
+ * It's done for convenience, since cleaning up other state in the event
+ * handler may appear more idiomatic.
+ *
+ * Meta-data: none
+ */
+ ZT_EVENT_DOWN = 3,
- /**
- * Your identity has collided with another node's ZeroTier address
- *
- * This happens if two different public keys both hash (via the algorithm
- * in Identity::generate()) to the same 40-bit ZeroTier address.
- *
- * This is something you should "never" see, where "never" is defined as
- * once per 2^39 new node initializations / identity creations. If you do
- * see it, you're going to see it very soon after a node is first
- * initialized.
- *
- * This is reported as an event rather than a return code since it's
- * detected asynchronously via error messages from authoritative nodes.
- *
- * If this occurs, you must shut down and delete the node, delete the
- * identity.secret record/file from the data store, and restart to generate
- * a new identity. If you don't do this, you will not be able to communicate
- * with other nodes.
- *
- * We'd automate this process, but we don't think silently deleting
- * private keys or changing our address without telling the calling code
- * is good form. It violates the principle of least surprise.
- *
- * You can technically get away with not handling this, but we recommend
- * doing so in a mature reliable application. Besides, handling this
- * condition is a good way to make sure it never arises. It's like how
- * umbrellas prevent rain and smoke detectors prevent fires. They do, right?
- *
- * Meta-data: none
- */
- ZT_EVENT_FATAL_ERROR_IDENTITY_COLLISION = 4,
+ /**
+ * Your identity has collided with another node's ZeroTier address
+ *
+ * This happens if two different public keys both hash (via the algorithm
+ * in Identity::generate()) to the same 40-bit ZeroTier address.
+ *
+ * This is something you should "never" see, where "never" is defined as
+ * once per 2^39 new node initializations / identity creations. If you do
+ * see it, you're going to see it very soon after a node is first
+ * initialized.
+ *
+ * This is reported as an event rather than a return code since it's
+ * detected asynchronously via error messages from authoritative nodes.
+ *
+ * If this occurs, you must shut down and delete the node, delete the
+ * identity.secret record/file from the data store, and restart to generate
+ * a new identity. If you don't do this, you will not be able to communicate
+ * with other nodes.
+ *
+ * We'd automate this process, but we don't think silently deleting
+ * private keys or changing our address without telling the calling code
+ * is good form. It violates the principle of least surprise.
+ *
+ * You can technically get away with not handling this, but we recommend
+ * doing so in a mature reliable application. Besides, handling this
+ * condition is a good way to make sure it never arises. It's like how
+ * umbrellas prevent rain and smoke detectors prevent fires. They do, right?
+ *
+ * Meta-data: none
+ */
+ ZT_EVENT_FATAL_ERROR_IDENTITY_COLLISION = 4,
- /**
- * Trace (debugging) message
- *
- * These events are only generated if this is a TRACE-enabled build.
- *
- * Meta-data: C string, TRACE message
- */
- ZT_EVENT_TRACE = 5,
+ /**
+ * Trace (debugging) message
+ *
+ * These events are only generated if this is a TRACE-enabled build.
+ *
+ * Meta-data: C string, TRACE message
+ */
+ ZT_EVENT_TRACE = 5,
- /**
- * VERB_USER_MESSAGE received
- *
- * These are generated when a VERB_USER_MESSAGE packet is received via
- * ZeroTier VL1.
- *
- * Meta-data: ZT_UserMessage structure
- */
- ZT_EVENT_USER_MESSAGE = 6,
+ /**
+ * VERB_USER_MESSAGE received
+ *
+ * These are generated when a VERB_USER_MESSAGE packet is received via
+ * ZeroTier VL1.
+ *
+ * Meta-data: ZT_UserMessage structure
+ */
+ ZT_EVENT_USER_MESSAGE = 6,
- /**
- * Remote trace received
- *
- * These are generated when a VERB_REMOTE_TRACE is received. Note
- * that any node can fling one of these at us. It is your responsibility
- * to filter and determine if it's worth paying attention to. If it's
- * not just drop it. Most nodes that are not active controllers ignore
- * these, and controllers only save them if they pertain to networks
- * with remote tracing enabled.
- *
- * Meta-data: ZT_RemoteTrace structure
- */
- ZT_EVENT_REMOTE_TRACE = 7
+ /**
+ * Remote trace received
+ *
+ * These are generated when a VERB_REMOTE_TRACE is received. Note
+ * that any node can fling one of these at us. It is your responsibility
+ * to filter and determine if it's worth paying attention to. If it's
+ * not just drop it. Most nodes that are not active controllers ignore
+ * these, and controllers only save them if they pertain to networks
+ * with remote tracing enabled.
+ *
+ * Meta-data: ZT_RemoteTrace structure
+ */
+ ZT_EVENT_REMOTE_TRACE = 7
};
/**
* Payload of REMOTE_TRACE event
*/
typedef struct {
- /**
- * ZeroTier address of sender
- */
- uint64_t origin;
+ /**
+ * ZeroTier address of sender
+ */
+ uint64_t origin;
- /**
- * Null-terminated Dictionary containing key/value pairs sent by origin
- *
- * This *should* be a dictionary, but the implementation only checks
- * that it is a valid non-empty C-style null-terminated string. Be very
- * careful to use a well-tested parser to parse this as it represents
- * data received from a potentially un-trusted peer on the network.
- * Invalid payloads should be dropped.
- *
- * The contents of data[] may be modified.
- */
- char* data;
+ /**
+ * Null-terminated Dictionary containing key/value pairs sent by origin
+ *
+ * This *should* be a dictionary, but the implementation only checks
+ * that it is a valid non-empty C-style null-terminated string. Be very
+ * careful to use a well-tested parser to parse this as it represents
+ * data received from a potentially un-trusted peer on the network.
+ * Invalid payloads should be dropped.
+ *
+ * The contents of data[] may be modified.
+ */
+ char* data;
- /**
- * Length of dict[] in bytes, including terminating null
- */
- unsigned int len;
+ /**
+ * Length of dict[] in bytes, including terminating null
+ */
+ unsigned int len;
} ZT_RemoteTrace;
/**
@@ -570,54 +565,54 @@ typedef struct {
* gapped.)
*/
typedef struct {
- /**
- * ZeroTier address of sender (least significant 40 bits)
- */
- uint64_t origin;
+ /**
+ * ZeroTier address of sender (least significant 40 bits)
+ */
+ uint64_t origin;
- /**
- * User message type ID
- */
- uint64_t typeId;
+ /**
+ * User message type ID
+ */
+ uint64_t typeId;
- /**
- * User message data (not including type ID)
- */
- const void* data;
+ /**
+ * User message data (not including type ID)
+ */
+ const void* data;
- /**
- * Length of data in bytes
- */
- unsigned int length;
+ /**
+ * Length of data in bytes
+ */
+ unsigned int length;
} ZT_UserMessage;
/**
* Current node status
*/
typedef struct {
- /**
- * 40-bit ZeroTier address of this node
- */
- uint64_t address;
+ /**
+ * 40-bit ZeroTier address of this node
+ */
+ uint64_t address;
- /**
- * Public identity in string-serialized form (safe to send to others)
- *
- * This pointer will remain valid as long as the node exists.
- */
- const char* publicIdentity;
+ /**
+ * Public identity in string-serialized form (safe to send to others)
+ *
+ * This pointer will remain valid as long as the node exists.
+ */
+ const char* publicIdentity;
- /**
- * Full identity including secret key in string-serialized form
- *
- * This pointer will remain valid as long as the node exists.
- */
- const char* secretIdentity;
+ /**
+ * Full identity including secret key in string-serialized form
+ *
+ * This pointer will remain valid as long as the node exists.
+ */
+ const char* secretIdentity;
- /**
- * True if some kind of connectivity appears available
- */
- int online;
+ /**
+ * True if some kind of connectivity appears available
+ */
+ int online;
} ZT_NodeStatus;
/**
@@ -626,70 +621,70 @@ typedef struct {
* This structure is subject to change between versions.
*/
typedef struct {
- /**
- * Number of each protocol verb (possible verbs 0..31) received
- */
- uint64_t inVerbCounts[32];
+ /**
+ * Number of each protocol verb (possible verbs 0..31) received
+ */
+ uint64_t inVerbCounts[32];
- /**
- * Number of bytes for each protocol verb received
- */
- uint64_t inVerbBytes[32];
+ /**
+ * Number of bytes for each protocol verb received
+ */
+ uint64_t inVerbBytes[32];
} ZT_NodeStatistics;
/**
* Virtual network status codes
*/
enum ZT_VirtualNetworkStatus {
- /**
- * Waiting for network configuration (also means revision == 0)
- */
- ZT_NETWORK_STATUS_REQUESTING_CONFIGURATION = 0,
+ /**
+ * Waiting for network configuration (also means revision == 0)
+ */
+ ZT_NETWORK_STATUS_REQUESTING_CONFIGURATION = 0,
- /**
- * Configuration received and we are authorized
- */
- ZT_NETWORK_STATUS_OK = 1,
+ /**
+ * Configuration received and we are authorized
+ */
+ ZT_NETWORK_STATUS_OK = 1,
- /**
- * Netconf master told us 'nope'
- */
- ZT_NETWORK_STATUS_ACCESS_DENIED = 2,
+ /**
+ * Netconf master told us 'nope'
+ */
+ ZT_NETWORK_STATUS_ACCESS_DENIED = 2,
- /**
- * Netconf master exists, but this virtual network does not
- */
- ZT_NETWORK_STATUS_NOT_FOUND = 3,
+ /**
+ * Netconf master exists, but this virtual network does not
+ */
+ ZT_NETWORK_STATUS_NOT_FOUND = 3,
- /**
- * Initialization of network failed or other internal error
- */
- ZT_NETWORK_STATUS_PORT_ERROR = 4,
+ /**
+ * Initialization of network failed or other internal error
+ */
+ ZT_NETWORK_STATUS_PORT_ERROR = 4,
- /**
- * ZeroTier core version too old
- */
- ZT_NETWORK_STATUS_CLIENT_TOO_OLD = 5,
+ /**
+ * ZeroTier core version too old
+ */
+ ZT_NETWORK_STATUS_CLIENT_TOO_OLD = 5,
- /**
- * External authentication is required (e.g. SSO)
- */
- ZT_NETWORK_STATUS_AUTHENTICATION_REQUIRED = 6
+ /**
+ * External authentication is required (e.g. SSO)
+ */
+ ZT_NETWORK_STATUS_AUTHENTICATION_REQUIRED = 6
};
/**
* Virtual network type codes
*/
enum ZT_VirtualNetworkType {
- /**
- * Private networks are authorized via certificates of membership
- */
- ZT_NETWORK_TYPE_PRIVATE = 0,
+ /**
+ * Private networks are authorized via certificates of membership
+ */
+ ZT_NETWORK_TYPE_PRIVATE = 0,
- /**
- * Public networks have no access control -- they'll always be AUTHORIZED
- */
- ZT_NETWORK_TYPE_PUBLIC = 1
+ /**
+ * Public networks have no access control -- they'll always be AUTHORIZED
+ */
+ ZT_NETWORK_TYPE_PUBLIC = 1
};
/**
@@ -702,83 +697,83 @@ enum ZT_VirtualNetworkType {
* An ACTION with no MATCHes is always taken.
*/
enum ZT_VirtualNetworkRuleType {
- // 0 to 15 reserved for actions
+ // 0 to 15 reserved for actions
- /**
- * Drop frame
- */
- ZT_NETWORK_RULE_ACTION_DROP = 0,
+ /**
+ * Drop frame
+ */
+ ZT_NETWORK_RULE_ACTION_DROP = 0,
- /**
- * Accept and pass frame
- */
- ZT_NETWORK_RULE_ACTION_ACCEPT = 1,
+ /**
+ * Accept and pass frame
+ */
+ ZT_NETWORK_RULE_ACTION_ACCEPT = 1,
- /**
- * Forward a copy of this frame to an observer (by ZT address)
- */
- ZT_NETWORK_RULE_ACTION_TEE = 2,
+ /**
+ * Forward a copy of this frame to an observer (by ZT address)
+ */
+ ZT_NETWORK_RULE_ACTION_TEE = 2,
- /**
- * Exactly like TEE but mandates ACKs from observer
- */
- ZT_NETWORK_RULE_ACTION_WATCH = 3,
+ /**
+ * Exactly like TEE but mandates ACKs from observer
+ */
+ ZT_NETWORK_RULE_ACTION_WATCH = 3,
- /**
- * Drop and redirect this frame to another node (by ZT address)
- */
- ZT_NETWORK_RULE_ACTION_REDIRECT = 4,
+ /**
+ * Drop and redirect this frame to another node (by ZT address)
+ */
+ ZT_NETWORK_RULE_ACTION_REDIRECT = 4,
- /**
- * Stop evaluating rule set (drops unless there are capabilities, etc.)
- */
- ZT_NETWORK_RULE_ACTION_BREAK = 5,
+ /**
+ * Stop evaluating rule set (drops unless there are capabilities, etc.)
+ */
+ ZT_NETWORK_RULE_ACTION_BREAK = 5,
- /**
- * Place a matching frame in the specified QoS bucket
- */
- ZT_NETWORK_RULE_ACTION_PRIORITY = 6,
+ /**
+ * Place a matching frame in the specified QoS bucket
+ */
+ ZT_NETWORK_RULE_ACTION_PRIORITY = 6,
- /**
- * Maximum ID for an ACTION, anything higher is a MATCH
- */
- ZT_NETWORK_RULE_ACTION__MAX_ID = 15,
+ /**
+ * Maximum ID for an ACTION, anything higher is a MATCH
+ */
+ ZT_NETWORK_RULE_ACTION__MAX_ID = 15,
- // 16 to 63 reserved for match criteria
+ // 16 to 63 reserved for match criteria
- ZT_NETWORK_RULE_MATCH_SOURCE_ZEROTIER_ADDRESS = 24,
- ZT_NETWORK_RULE_MATCH_DEST_ZEROTIER_ADDRESS = 25,
- ZT_NETWORK_RULE_MATCH_VLAN_ID = 26,
- ZT_NETWORK_RULE_MATCH_VLAN_PCP = 27,
- ZT_NETWORK_RULE_MATCH_VLAN_DEI = 28,
- ZT_NETWORK_RULE_MATCH_MAC_SOURCE = 29,
- ZT_NETWORK_RULE_MATCH_MAC_DEST = 30,
- ZT_NETWORK_RULE_MATCH_IPV4_SOURCE = 31,
- ZT_NETWORK_RULE_MATCH_IPV4_DEST = 32,
- ZT_NETWORK_RULE_MATCH_IPV6_SOURCE = 33,
- ZT_NETWORK_RULE_MATCH_IPV6_DEST = 34,
- ZT_NETWORK_RULE_MATCH_IP_TOS = 35,
- ZT_NETWORK_RULE_MATCH_IP_PROTOCOL = 36,
- ZT_NETWORK_RULE_MATCH_ETHERTYPE = 37,
- ZT_NETWORK_RULE_MATCH_ICMP = 38,
- ZT_NETWORK_RULE_MATCH_IP_SOURCE_PORT_RANGE = 39,
- ZT_NETWORK_RULE_MATCH_IP_DEST_PORT_RANGE = 40,
- ZT_NETWORK_RULE_MATCH_CHARACTERISTICS = 41,
- ZT_NETWORK_RULE_MATCH_FRAME_SIZE_RANGE = 42,
- ZT_NETWORK_RULE_MATCH_RANDOM = 43,
- ZT_NETWORK_RULE_MATCH_TAGS_DIFFERENCE = 44,
- ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_AND = 45,
- ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_OR = 46,
- ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_XOR = 47,
- ZT_NETWORK_RULE_MATCH_TAGS_EQUAL = 48,
- ZT_NETWORK_RULE_MATCH_TAG_SENDER = 49,
- ZT_NETWORK_RULE_MATCH_TAG_RECEIVER = 50,
- ZT_NETWORK_RULE_MATCH_INTEGER_RANGE = 51,
+ ZT_NETWORK_RULE_MATCH_SOURCE_ZEROTIER_ADDRESS = 24,
+ ZT_NETWORK_RULE_MATCH_DEST_ZEROTIER_ADDRESS = 25,
+ ZT_NETWORK_RULE_MATCH_VLAN_ID = 26,
+ ZT_NETWORK_RULE_MATCH_VLAN_PCP = 27,
+ ZT_NETWORK_RULE_MATCH_VLAN_DEI = 28,
+ ZT_NETWORK_RULE_MATCH_MAC_SOURCE = 29,
+ ZT_NETWORK_RULE_MATCH_MAC_DEST = 30,
+ ZT_NETWORK_RULE_MATCH_IPV4_SOURCE = 31,
+ ZT_NETWORK_RULE_MATCH_IPV4_DEST = 32,
+ ZT_NETWORK_RULE_MATCH_IPV6_SOURCE = 33,
+ ZT_NETWORK_RULE_MATCH_IPV6_DEST = 34,
+ ZT_NETWORK_RULE_MATCH_IP_TOS = 35,
+ ZT_NETWORK_RULE_MATCH_IP_PROTOCOL = 36,
+ ZT_NETWORK_RULE_MATCH_ETHERTYPE = 37,
+ ZT_NETWORK_RULE_MATCH_ICMP = 38,
+ ZT_NETWORK_RULE_MATCH_IP_SOURCE_PORT_RANGE = 39,
+ ZT_NETWORK_RULE_MATCH_IP_DEST_PORT_RANGE = 40,
+ ZT_NETWORK_RULE_MATCH_CHARACTERISTICS = 41,
+ ZT_NETWORK_RULE_MATCH_FRAME_SIZE_RANGE = 42,
+ ZT_NETWORK_RULE_MATCH_RANDOM = 43,
+ ZT_NETWORK_RULE_MATCH_TAGS_DIFFERENCE = 44,
+ ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_AND = 45,
+ ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_OR = 46,
+ ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_XOR = 47,
+ ZT_NETWORK_RULE_MATCH_TAGS_EQUAL = 48,
+ ZT_NETWORK_RULE_MATCH_TAG_SENDER = 49,
+ ZT_NETWORK_RULE_MATCH_TAG_RECEIVER = 50,
+ ZT_NETWORK_RULE_MATCH_INTEGER_RANGE = 51,
- /**
- * Maximum ID allowed for a MATCH entry in the rules table
- */
- ZT_NETWORK_RULE_MATCH__MAX_ID = 63
+ /**
+ * Maximum ID allowed for a MATCH entry in the rules table
+ */
+ ZT_NETWORK_RULE_MATCH__MAX_ID = 63
};
/**
@@ -793,229 +788,229 @@ enum ZT_VirtualNetworkRuleType {
* a wide table, yet still fast and simple to access in code.
*/
typedef struct {
- /**
- * Type and flags
- *
- * Bits are: NOTTTTTT
- *
- * N - If true, sense of match is inverted (no effect on actions)
- * O - If true, result is ORed with previous instead of ANDed (no effect on actions)
- * T - Rule or action type
- *
- * AND with 0x3f to get type, 0x80 to get NOT bit, and 0x40 to get OR bit.
- */
- uint8_t t;
+ /**
+ * Type and flags
+ *
+ * Bits are: NOTTTTTT
+ *
+ * N - If true, sense of match is inverted (no effect on actions)
+ * O - If true, result is ORed with previous instead of ANDed (no effect on actions)
+ * T - Rule or action type
+ *
+ * AND with 0x3f to get type, 0x80 to get NOT bit, and 0x40 to get OR bit.
+ */
+ uint8_t t;
- /**
- * Union containing the value of this rule -- which field is used depends on 't'
- */
- union {
- /**
- * IPv6 address in big-endian / network byte order and netmask bits
- */
- struct {
- uint8_t ip[16];
- uint8_t mask;
- } ipv6;
+ /**
+ * Union containing the value of this rule -- which field is used depends on 't'
+ */
+ union {
+ /**
+ * IPv6 address in big-endian / network byte order and netmask bits
+ */
+ struct {
+ uint8_t ip[16];
+ uint8_t mask;
+ } ipv6;
- /**
- * IPv4 address in big-endian / network byte order
- */
- struct {
- uint32_t ip;
- uint8_t mask;
- } ipv4;
+ /**
+ * IPv4 address in big-endian / network byte order
+ */
+ struct {
+ uint32_t ip;
+ uint8_t mask;
+ } ipv4;
- /**
- * Integer range match in packet payload
- *
- * This allows matching of ranges of integers up to 64 bits wide where
- * the range is +/- INT32_MAX. It's packed this way so it fits in 16
- * bytes and doesn't enlarge the overall size of this union.
- */
- struct {
- uint64_t start; // integer range start
- uint32_t end; // end of integer range (relative to start, inclusive, 0 for equality w/start)
- uint16_t idx; // index in packet of integer
- uint8_t format; // bits in integer (range 1-64, ((format&63)+1)) and endianness (MSB 1 for little, 0 for big)
- } intRange;
+ /**
+ * Integer range match in packet payload
+ *
+ * This allows matching of ranges of integers up to 64 bits wide where
+ * the range is +/- INT32_MAX. It's packed this way so it fits in 16
+ * bytes and doesn't enlarge the overall size of this union.
+ */
+ struct {
+ uint64_t start; // integer range start
+ uint32_t end; // end of integer range (relative to start, inclusive, 0 for equality w/start)
+ uint16_t idx; // index in packet of integer
+ uint8_t format; // bits in integer (range 1-64, ((format&63)+1)) and endianness (MSB 1 for little, 0 for big)
+ } intRange;
- /**
- * Packet characteristic flags being matched
- */
- uint64_t characteristics;
+ /**
+ * Packet characteristic flags being matched
+ */
+ uint64_t characteristics;
- /**
- * IP port range -- start-end inclusive -- host byte order
- */
- uint16_t port[2];
+ /**
+ * IP port range -- start-end inclusive -- host byte order
+ */
+ uint16_t port[2];
- /**
- * 40-bit ZeroTier address (in least significant bits, host byte order)
- */
- uint64_t zt;
+ /**
+ * 40-bit ZeroTier address (in least significant bits, host byte order)
+ */
+ uint64_t zt;
- /**
- * 0 = never, UINT32_MAX = always
- */
- uint32_t randomProbability;
+ /**
+ * 0 = never, UINT32_MAX = always
+ */
+ uint32_t randomProbability;
- /**
- * 48-bit Ethernet MAC address in big-endian order
- */
- uint8_t mac[6];
+ /**
+ * 48-bit Ethernet MAC address in big-endian order
+ */
+ uint8_t mac[6];
- /**
- * VLAN ID in host byte order
- */
- uint16_t vlanId;
+ /**
+ * VLAN ID in host byte order
+ */
+ uint16_t vlanId;
- /**
- * VLAN PCP (least significant 3 bits)
- */
- uint8_t vlanPcp;
+ /**
+ * VLAN PCP (least significant 3 bits)
+ */
+ uint8_t vlanPcp;
- /**
- * VLAN DEI (single bit / boolean)
- */
- uint8_t vlanDei;
+ /**
+ * VLAN DEI (single bit / boolean)
+ */
+ uint8_t vlanDei;
- /**
- * Ethernet type in host byte order
- */
- uint16_t etherType;
+ /**
+ * Ethernet type in host byte order
+ */
+ uint16_t etherType;
- /**
- * IP protocol
- */
- uint8_t ipProtocol;
+ /**
+ * IP protocol
+ */
+ uint8_t ipProtocol;
- /**
- * IP type of service a.k.a. DSCP field
- */
- struct {
- uint8_t mask;
- uint8_t value[2];
- } ipTos;
+ /**
+ * IP type of service a.k.a. DSCP field
+ */
+ struct {
+ uint8_t mask;
+ uint8_t value[2];
+ } ipTos;
- /**
- * Ethernet packet size in host byte order (start-end, inclusive)
- */
- uint16_t frameSize[2];
+ /**
+ * Ethernet packet size in host byte order (start-end, inclusive)
+ */
+ uint16_t frameSize[2];
- /**
- * ICMP type and code
- */
- struct {
- uint8_t type; // ICMP type, always matched
- uint8_t code; // ICMP code if matched
- uint8_t flags; // flag 0x01 means also match code, otherwise only match type
- } icmp;
+ /**
+ * ICMP type and code
+ */
+ struct {
+ uint8_t type; // ICMP type, always matched
+ uint8_t code; // ICMP code if matched
+ uint8_t flags; // flag 0x01 means also match code, otherwise only match type
+ } icmp;
- /**
- * For tag-related rules
- */
- struct {
- uint32_t id;
- uint32_t value;
- } tag;
+ /**
+ * For tag-related rules
+ */
+ struct {
+ uint32_t id;
+ uint32_t value;
+ } tag;
- /**
- * Destinations for TEE and REDIRECT
- */
- struct {
- uint64_t address;
- uint32_t flags;
- uint16_t length;
- } fwd;
+ /**
+ * Destinations for TEE and REDIRECT
+ */
+ struct {
+ uint64_t address;
+ uint32_t flags;
+ uint16_t length;
+ } fwd;
- /**
- * Quality of Service (QoS) bucket we want a frame to be placed in
- */
- uint8_t qosBucket;
- } v;
+ /**
+ * Quality of Service (QoS) bucket we want a frame to be placed in
+ */
+ uint8_t qosBucket;
+ } v;
} ZT_VirtualNetworkRule;
/**
* A route to be pushed on a virtual network
*/
typedef struct {
- /**
- * Target network / netmask bits (in port field) or NULL or 0.0.0.0/0 for default
- */
- struct sockaddr_storage target;
+ /**
+ * Target network / netmask bits (in port field) or NULL or 0.0.0.0/0 for default
+ */
+ struct sockaddr_storage target;
- /**
- * Gateway IP address (port ignored) or NULL (family == 0) for LAN-local (no gateway)
- */
- struct sockaddr_storage via;
+ /**
+ * Gateway IP address (port ignored) or NULL (family == 0) for LAN-local (no gateway)
+ */
+ struct sockaddr_storage via;
- /**
- * Route flags
- */
- uint16_t flags;
+ /**
+ * Route flags
+ */
+ uint16_t flags;
- /**
- * Route metric (not currently used)
- */
- uint16_t metric;
+ /**
+ * Route metric (not currently used)
+ */
+ uint16_t metric;
} ZT_VirtualNetworkRoute;
/**
* DNS configuration to be pushed on a virtual network
*/
typedef struct {
- char domain[128];
- struct sockaddr_storage server_addr[ZT_MAX_DNS_SERVERS];
+ char domain[128];
+ struct sockaddr_storage server_addr[ZT_MAX_DNS_SERVERS];
} ZT_VirtualNetworkDNS;
/**
* An Ethernet multicast group
*/
typedef struct {
- /**
- * MAC address (least significant 48 bits)
- */
- uint64_t mac;
+ /**
+ * MAC address (least significant 48 bits)
+ */
+ uint64_t mac;
- /**
- * Additional distinguishing information (usually zero)
- */
- unsigned long adi;
+ /**
+ * Additional distinguishing information (usually zero)
+ */
+ unsigned long adi;
} ZT_MulticastGroup;
/**
* Virtual network configuration update type
*/
enum ZT_VirtualNetworkConfigOperation {
- /**
- * Network is coming up (either for the first time or after service restart)
- */
- ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_UP = 1,
+ /**
+ * Network is coming up (either for the first time or after service restart)
+ */
+ ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_UP = 1,
- /**
- * Network configuration has been updated
- */
- ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE = 2,
+ /**
+ * Network configuration has been updated
+ */
+ ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE = 2,
- /**
- * Network is going down (not permanently)
- */
- ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DOWN = 3,
+ /**
+ * Network is going down (not permanently)
+ */
+ ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DOWN = 3,
- /**
- * Network is going down permanently (leave/delete)
- */
- ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY = 4
+ /**
+ * Network is going down permanently (leave/delete)
+ */
+ ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY = 4
};
/**
* What trust hierarchy role does this peer have?
*/
enum ZT_PeerRole {
- ZT_PEER_ROLE_LEAF = 0, // ordinary node
- ZT_PEER_ROLE_MOON = 1, // moon root
- ZT_PEER_ROLE_PLANET = 2 // planetary root
+ ZT_PEER_ROLE_LEAF = 0, // ordinary node
+ ZT_PEER_ROLE_MOON = 1, // moon root
+ ZT_PEER_ROLE_PLANET = 2 // planetary root
};
/**
@@ -1027,478 +1022,478 @@ enum ZT_Vendor { ZT_VENDOR_UNSPECIFIED = 0, ZT_VENDOR_ZEROTIER = 1 };
* Platform type
*/
enum ZT_Platform {
- ZT_PLATFORM_UNSPECIFIED = 0,
- ZT_PLATFORM_LINUX = 1,
- ZT_PLATFORM_WINDOWS = 2,
- ZT_PLATFORM_MACOS = 3,
- ZT_PLATFORM_ANDROID = 4,
- ZT_PLATFORM_IOS = 5,
- ZT_PLATFORM_SOLARIS_SMARTOS = 6,
- ZT_PLATFORM_FREEBSD = 7,
- ZT_PLATFORM_NETBSD = 8,
- ZT_PLATFORM_OPENBSD = 9,
- ZT_PLATFORM_RISCOS = 10,
- ZT_PLATFORM_VXWORKS = 11,
- ZT_PLATFORM_FREERTOS = 12,
- ZT_PLATFORM_SYSBIOS = 13,
- ZT_PLATFORM_HURD = 14,
- ZT_PLATFORM_WEB = 15
+ ZT_PLATFORM_UNSPECIFIED = 0,
+ ZT_PLATFORM_LINUX = 1,
+ ZT_PLATFORM_WINDOWS = 2,
+ ZT_PLATFORM_MACOS = 3,
+ ZT_PLATFORM_ANDROID = 4,
+ ZT_PLATFORM_IOS = 5,
+ ZT_PLATFORM_SOLARIS_SMARTOS = 6,
+ ZT_PLATFORM_FREEBSD = 7,
+ ZT_PLATFORM_NETBSD = 8,
+ ZT_PLATFORM_OPENBSD = 9,
+ ZT_PLATFORM_RISCOS = 10,
+ ZT_PLATFORM_VXWORKS = 11,
+ ZT_PLATFORM_FREERTOS = 12,
+ ZT_PLATFORM_SYSBIOS = 13,
+ ZT_PLATFORM_HURD = 14,
+ ZT_PLATFORM_WEB = 15
};
/**
* Architecture type
*/
enum ZT_Architecture {
- ZT_ARCHITECTURE_UNSPECIFIED = 0,
- ZT_ARCHITECTURE_X86 = 1,
- ZT_ARCHITECTURE_X64 = 2,
- ZT_ARCHITECTURE_ARM32 = 3,
- ZT_ARCHITECTURE_ARM64 = 4,
- ZT_ARCHITECTURE_MIPS32 = 5,
- ZT_ARCHITECTURE_MIPS64 = 6,
- ZT_ARCHITECTURE_POWER32 = 7,
- ZT_ARCHITECTURE_POWER64 = 8,
- ZT_ARCHITECTURE_OPENRISC32 = 9,
- ZT_ARCHITECTURE_OPENRISC64 = 10,
- ZT_ARCHITECTURE_SPARC32 = 11,
- ZT_ARCHITECTURE_SPARC64 = 12,
- ZT_ARCHITECTURE_DOTNET_CLR = 13,
- ZT_ARCHITECTURE_JAVA_JVM = 14,
- ZT_ARCHITECTURE_WEB = 15,
- ZT_ARCHITECTURE_S390X = 16,
- ZT_ARCHITECTURE_LOONGARCH64 = 17
+ ZT_ARCHITECTURE_UNSPECIFIED = 0,
+ ZT_ARCHITECTURE_X86 = 1,
+ ZT_ARCHITECTURE_X64 = 2,
+ ZT_ARCHITECTURE_ARM32 = 3,
+ ZT_ARCHITECTURE_ARM64 = 4,
+ ZT_ARCHITECTURE_MIPS32 = 5,
+ ZT_ARCHITECTURE_MIPS64 = 6,
+ ZT_ARCHITECTURE_POWER32 = 7,
+ ZT_ARCHITECTURE_POWER64 = 8,
+ ZT_ARCHITECTURE_OPENRISC32 = 9,
+ ZT_ARCHITECTURE_OPENRISC64 = 10,
+ ZT_ARCHITECTURE_SPARC32 = 11,
+ ZT_ARCHITECTURE_SPARC64 = 12,
+ ZT_ARCHITECTURE_DOTNET_CLR = 13,
+ ZT_ARCHITECTURE_JAVA_JVM = 14,
+ ZT_ARCHITECTURE_WEB = 15,
+ ZT_ARCHITECTURE_S390X = 16,
+ ZT_ARCHITECTURE_LOONGARCH64 = 17
};
/**
* Virtual network configuration
*/
typedef struct {
- /**
- * 64-bit ZeroTier network ID
- */
- uint64_t nwid;
+ /**
+ * 64-bit ZeroTier network ID
+ */
+ uint64_t nwid;
- /**
- * Ethernet MAC (48 bits) that should be assigned to port
- */
- uint64_t mac;
+ /**
+ * Ethernet MAC (48 bits) that should be assigned to port
+ */
+ uint64_t mac;
- /**
- * Network name (from network configuration master)
- */
- char name[ZT_MAX_NETWORK_SHORT_NAME_LENGTH + 1];
+ /**
+ * Network name (from network configuration master)
+ */
+ char name[ZT_MAX_NETWORK_SHORT_NAME_LENGTH + 1];
- /**
- * Network configuration request status
- */
- enum ZT_VirtualNetworkStatus status;
+ /**
+ * Network configuration request status
+ */
+ enum ZT_VirtualNetworkStatus status;
- /**
- * Network type
- */
- enum ZT_VirtualNetworkType type;
+ /**
+ * Network type
+ */
+ enum ZT_VirtualNetworkType type;
- /**
- * Maximum interface MTU
- */
- unsigned int mtu;
+ /**
+ * Maximum interface MTU
+ */
+ unsigned int mtu;
- /**
- * If nonzero, the network this port belongs to indicates DHCP availability
- *
- * This is a suggestion. The underlying implementation is free to ignore it
- * for security or other reasons. This is simply a netconf parameter that
- * means 'DHCP is available on this network.'
- */
- int dhcp;
+ /**
+ * If nonzero, the network this port belongs to indicates DHCP availability
+ *
+ * This is a suggestion. The underlying implementation is free to ignore it
+ * for security or other reasons. This is simply a netconf parameter that
+ * means 'DHCP is available on this network.'
+ */
+ int dhcp;
- /**
- * If nonzero, this port is allowed to bridge to other networks
- *
- * This is informational. If this is false (0), bridged packets will simply
- * be dropped and bridging won't work.
- */
- int bridge;
+ /**
+ * If nonzero, this port is allowed to bridge to other networks
+ *
+ * This is informational. If this is false (0), bridged packets will simply
+ * be dropped and bridging won't work.
+ */
+ int bridge;
- /**
- * If nonzero, this network supports and allows broadcast (ff:ff:ff:ff:ff:ff) traffic
- */
- int broadcastEnabled;
+ /**
+ * If nonzero, this network supports and allows broadcast (ff:ff:ff:ff:ff:ff) traffic
+ */
+ int broadcastEnabled;
- /**
- * If the network is in PORT_ERROR state, this is the (negative) error code most recently reported
- */
- int portError;
+ /**
+ * If the network is in PORT_ERROR state, this is the (negative) error code most recently reported
+ */
+ int portError;
- /**
- * Revision number as reported by controller or 0 if still waiting for config
- */
- unsigned long netconfRevision;
+ /**
+ * Revision number as reported by controller or 0 if still waiting for config
+ */
+ unsigned long netconfRevision;
- /**
- * Number of assigned addresses
- */
- unsigned int assignedAddressCount;
+ /**
+ * Number of assigned addresses
+ */
+ unsigned int assignedAddressCount;
- /**
- * ZeroTier-assigned addresses (in sockaddr_storage structures)
- *
- * For IP, the port number of the sockaddr_XX structure contains the number
- * of bits in the address netmask. Only the IP address and port are used.
- * Other fields like interface number can be ignored.
- *
- * This is only used for ZeroTier-managed address assignments sent by the
- * virtual network's configuration master.
- */
- struct sockaddr_storage assignedAddresses[ZT_MAX_ZT_ASSIGNED_ADDRESSES];
+ /**
+ * ZeroTier-assigned addresses (in sockaddr_storage structures)
+ *
+ * For IP, the port number of the sockaddr_XX structure contains the number
+ * of bits in the address netmask. Only the IP address and port are used.
+ * Other fields like interface number can be ignored.
+ *
+ * This is only used for ZeroTier-managed address assignments sent by the
+ * virtual network's configuration master.
+ */
+ struct sockaddr_storage assignedAddresses[ZT_MAX_ZT_ASSIGNED_ADDRESSES];
- /**
- * Number of ZT-pushed routes
- */
- unsigned int routeCount;
+ /**
+ * Number of ZT-pushed routes
+ */
+ unsigned int routeCount;
- /**
- * Routes (excluding those implied by assigned addresses and their masks)
- */
- ZT_VirtualNetworkRoute routes[ZT_MAX_NETWORK_ROUTES];
+ /**
+ * Routes (excluding those implied by assigned addresses and their masks)
+ */
+ ZT_VirtualNetworkRoute routes[ZT_MAX_NETWORK_ROUTES];
- /**
- * Number of multicast groups subscribed
- */
- unsigned int multicastSubscriptionCount;
+ /**
+ * Number of multicast groups subscribed
+ */
+ unsigned int multicastSubscriptionCount;
- /**
- * Multicast groups to which this network's device is subscribed
- */
- struct {
- uint64_t mac; /* MAC in lower 48 bits */
- uint32_t adi; /* Additional distinguishing information, usually zero except for IPv4 ARP groups */
- } multicastSubscriptions[ZT_MAX_MULTICAST_SUBSCRIPTIONS];
+ /**
+ * Multicast groups to which this network's device is subscribed
+ */
+ struct {
+ uint64_t mac; /* MAC in lower 48 bits */
+ uint32_t adi; /* Additional distinguishing information, usually zero except for IPv4 ARP groups */
+ } multicastSubscriptions[ZT_MAX_MULTICAST_SUBSCRIPTIONS];
- /**
- * Network specific DNS configuration
- */
- ZT_VirtualNetworkDNS dns;
+ /**
+ * Network specific DNS configuration
+ */
+ ZT_VirtualNetworkDNS dns;
- /**
- * sso enabled
- */
- bool ssoEnabled;
+ /**
+ * sso enabled
+ */
+ bool ssoEnabled;
- /**
- * SSO version
- */
- uint64_t ssoVersion;
+ /**
+ * SSO version
+ */
+ uint64_t ssoVersion;
- /**
- * If the status us AUTHENTICATION_REQUIRED, this may contain a URL for authentication.
- */
- char authenticationURL[2048];
+ /**
+ * If the status us AUTHENTICATION_REQUIRED, this may contain a URL for authentication.
+ */
+ char authenticationURL[2048];
- /**
- * Time that current authentication expires. only valid if ssoEnabled is true
- */
- uint64_t authenticationExpiryTime;
+ /**
+ * Time that current authentication expires. only valid if ssoEnabled is true
+ */
+ uint64_t authenticationExpiryTime;
- /**
- * OIDC issuer URL.
- */
- char issuerURL[2048];
+ /**
+ * OIDC issuer URL.
+ */
+ char issuerURL[2048];
- /**
- * central base URL.
- */
- char centralAuthURL[2048];
+ /**
+ * central base URL.
+ */
+ char centralAuthURL[2048];
- /**
- * sso nonce
- */
- char ssoNonce[128];
+ /**
+ * sso nonce
+ */
+ char ssoNonce[128];
- /**
- * sso state
- */
- char ssoState[256];
+ /**
+ * sso state
+ */
+ char ssoState[256];
- /**
- * oidc client id
- */
- char ssoClientID[256];
+ /**
+ * oidc client id
+ */
+ char ssoClientID[256];
- /**
- * sso provider
- **/
- char ssoProvider[64];
+ /**
+ * sso provider
+ **/
+ char ssoProvider[64];
} ZT_VirtualNetworkConfig;
/**
* A list of networks
*/
typedef struct {
- ZT_VirtualNetworkConfig* networks;
- unsigned long networkCount;
+ ZT_VirtualNetworkConfig* networks;
+ unsigned long networkCount;
} ZT_VirtualNetworkList;
/**
* Physical path configuration
*/
typedef struct {
- /**
- * If non-zero set this physical network path to be trusted to disable encryption and authentication
- */
- uint64_t trustedPathId;
+ /**
+ * If non-zero set this physical network path to be trusted to disable encryption and authentication
+ */
+ uint64_t trustedPathId;
- /**
- * Physical path MTU from ZT_MIN_PHYSMTU and ZT_MAX_PHYSMTU or <= 0 to use default
- */
- int mtu;
+ /**
+ * Physical path MTU from ZT_MIN_PHYSMTU and ZT_MAX_PHYSMTU or <= 0 to use default
+ */
+ int mtu;
} ZT_PhysicalPathConfiguration;
/**
* Physical network path to a peer
*/
typedef struct {
- /**
- * Address of endpoint
- */
- struct sockaddr_storage address;
+ /**
+ * Address of endpoint
+ */
+ struct sockaddr_storage address;
- /**
- * Time of last send in milliseconds or 0 for never
- */
- uint64_t lastSend;
+ /**
+ * Time of last send in milliseconds or 0 for never
+ */
+ uint64_t lastSend;
- /**
- * Time of last receive in milliseconds or 0 for never
- */
- uint64_t lastReceive;
+ /**
+ * Time of last receive in milliseconds or 0 for never
+ */
+ uint64_t lastReceive;
- /**
- * Is this a trusted path? If so this will be its nonzero ID.
- */
- uint64_t trustedPathId;
+ /**
+ * Is this a trusted path? If so this will be its nonzero ID.
+ */
+ uint64_t trustedPathId;
- /**
- * Mean latency
- */
- float latencyMean;
+ /**
+ * Mean latency
+ */
+ float latencyMean;
- /**
- * Maximum observed latency
- */
- float latencyMax;
+ /**
+ * Maximum observed latency
+ */
+ float latencyMax;
- /**
- * Variance of latency
- */
- float latencyVariance;
+ /**
+ * Variance of latency
+ */
+ float latencyVariance;
- /**
- * Packet loss ratio
- */
- float packetLossRatio;
+ /**
+ * Packet loss ratio
+ */
+ float packetLossRatio;
- /**
- * Packet error ratio
- */
- float packetErrorRatio;
+ /**
+ * Packet error ratio
+ */
+ float packetErrorRatio;
- /**
- * Number of flows assigned to this path
- */
- uint16_t assignedFlowCount;
+ /**
+ * Number of flows assigned to this path
+ */
+ uint16_t assignedFlowCount;
- /**
- * Address scope
- */
- uint8_t scope;
+ /**
+ * Address scope
+ */
+ uint8_t scope;
- /**
- * Relative quality value
- */
- float relativeQuality;
+ /**
+ * Relative quality value
+ */
+ float relativeQuality;
- /**
- * Name of physical interface this path resides on
- */
- char ifname[ZT_MAX_PHYSIFNAME];
+ /**
+ * Name of physical interface this path resides on
+ */
+ char ifname[ZT_MAX_PHYSIFNAME];
- /**
- * Pointer to PhySocket object for this path
- */
- uint64_t localSocket;
+ /**
+ * Pointer to PhySocket object for this path
+ */
+ uint64_t localSocket;
- /**
- * Local port corresponding to this path's localSocket
- */
- uint16_t localPort;
+ /**
+ * Local port corresponding to this path's localSocket
+ */
+ uint16_t localPort;
- /**
- * Is path expired?
- */
- int expired;
+ /**
+ * Is path expired?
+ */
+ int expired;
- /**
- * Whether this path is currently included in the bond
- */
- uint8_t bonded;
+ /**
+ * Whether this path is currently included in the bond
+ */
+ uint8_t bonded;
- /**
- * Whether this path is currently eligible to be used in a bond
- */
- uint8_t eligible;
+ /**
+ * Whether this path is currently eligible to be used in a bond
+ */
+ uint8_t eligible;
- /**
- * The capacity of this link (as given to bonding layer)
- */
- uint32_t linkSpeed;
+ /**
+ * The capacity of this link (as given to bonding layer)
+ */
+ uint32_t linkSpeed;
- /**
- * Is path preferred?
- */
- int preferred;
+ /**
+ * Is path preferred?
+ */
+ int preferred;
} ZT_PeerPhysicalPath;
/**
* Peer status result buffer
*/
typedef struct {
- /**
- * ZeroTier address (40 bits)
- */
- uint64_t address;
+ /**
+ * ZeroTier address (40 bits)
+ */
+ uint64_t address;
- /**
- * Remote major version or -1 if not known
- */
- int versionMajor;
+ /**
+ * Remote major version or -1 if not known
+ */
+ int versionMajor;
- /**
- * Remote minor version or -1 if not known
- */
- int versionMinor;
+ /**
+ * Remote minor version or -1 if not known
+ */
+ int versionMinor;
- /**
- * Remote revision or -1 if not known
- */
- int versionRev;
+ /**
+ * Remote revision or -1 if not known
+ */
+ int versionRev;
- /**
- * Last measured latency in milliseconds or -1 if unknown
- */
- int latency;
+ /**
+ * Last measured latency in milliseconds or -1 if unknown
+ */
+ int latency;
- /**
- * What trust hierarchy role does this device have?
- */
- enum ZT_PeerRole role;
+ /**
+ * What trust hierarchy role does this device have?
+ */
+ enum ZT_PeerRole role;
- /**
- * Whether a multi-link bond has formed
- */
- bool isBonded;
+ /**
+ * Whether a multi-link bond has formed
+ */
+ bool isBonded;
- /**
- * The bonding policy used to bond to this peer
- */
- int bondingPolicy;
+ /**
+ * The bonding policy used to bond to this peer
+ */
+ int bondingPolicy;
- /**
- * The number of links that comprise the bond to this peer that are considered alive
- */
- int numAliveLinks;
+ /**
+ * The number of links that comprise the bond to this peer that are considered alive
+ */
+ int numAliveLinks;
- /**
- * The number of links that comprise the bond to this peer
- */
- int numTotalLinks;
+ /**
+ * The number of links that comprise the bond to this peer
+ */
+ int numTotalLinks;
- /**
- * The user-specified bond template name
- */
- char customBondName[32];
+ /**
+ * The user-specified bond template name
+ */
+ char customBondName[32];
- /**
- * Number of paths (size of paths[])
- */
- unsigned int pathCount;
+ /**
+ * Number of paths (size of paths[])
+ */
+ unsigned int pathCount;
- /**
- * Known network paths to peer
- */
- ZT_PeerPhysicalPath paths[ZT_MAX_PEER_NETWORK_PATHS];
+ /**
+ * Known network paths to peer
+ */
+ ZT_PeerPhysicalPath paths[ZT_MAX_PEER_NETWORK_PATHS];
} ZT_Peer;
/**
* List of peers
*/
typedef struct {
- ZT_Peer* peers;
- unsigned long peerCount;
+ ZT_Peer* peers;
+ unsigned long peerCount;
} ZT_PeerList;
/**
* ZeroTier core state objects
*/
enum ZT_StateObjectType {
- /**
- * Null object -- ignored
- */
- ZT_STATE_OBJECT_NULL = 0,
+ /**
+ * Null object -- ignored
+ */
+ ZT_STATE_OBJECT_NULL = 0,
- /**
- * Public address and public key
- *
- * Object ID: this node's address if known, or 0 if unknown (first query)
- * Canonical path: /identity.public
- * Persistence: required
- */
- ZT_STATE_OBJECT_IDENTITY_PUBLIC = 1,
+ /**
+ * Public address and public key
+ *
+ * Object ID: this node's address if known, or 0 if unknown (first query)
+ * Canonical path: /identity.public
+ * Persistence: required
+ */
+ ZT_STATE_OBJECT_IDENTITY_PUBLIC = 1,
- /**
- * Full identity with secret key
- *
- * Object ID: this node's address if known, or 0 if unknown (first query)
- * Canonical path: /identity.secret
- * Persistence: required, should be stored with restricted permissions e.g. mode 0600 on *nix
- */
- ZT_STATE_OBJECT_IDENTITY_SECRET = 2,
+ /**
+ * Full identity with secret key
+ *
+ * Object ID: this node's address if known, or 0 if unknown (first query)
+ * Canonical path: /identity.secret
+ * Persistence: required, should be stored with restricted permissions e.g. mode 0600 on *nix
+ */
+ ZT_STATE_OBJECT_IDENTITY_SECRET = 2,
- /**
- * The planet (there is only one per... well... planet!)
- *
- * Object ID: world ID of planet, or 0 if unknown (first query)
- * Canonical path: /planet
- * Persistence: recommended
- */
- ZT_STATE_OBJECT_PLANET = 3,
+ /**
+ * The planet (there is only one per... well... planet!)
+ *
+ * Object ID: world ID of planet, or 0 if unknown (first query)
+ * Canonical path: /planet
+ * Persistence: recommended
+ */
+ ZT_STATE_OBJECT_PLANET = 3,
- /**
- * A moon (federated root set)
- *
- * Object ID: world ID of moon
- * Canonical path: /moons.d/.moon (16-digit hex ID)
- * Persistence: required if moon memberships should persist
- */
- ZT_STATE_OBJECT_MOON = 4,
+ /**
+ * A moon (federated root set)
+ *
+ * Object ID: world ID of moon
+ * Canonical path: /moons.d/.moon (16-digit hex ID)
+ * Persistence: required if moon memberships should persist
+ */
+ ZT_STATE_OBJECT_MOON = 4,
- /**
- * Peer and related state
- *
- * Object ID: peer address
- * Canonical path: /peers.d/ (10-digit address
- * Persistence: optional, can be cleared at any time
- */
- ZT_STATE_OBJECT_PEER = 5,
+ /**
+ * Peer and related state
+ *
+ * Object ID: peer address
+ * Canonical path: /peers.d/ (10-digit address
+ * Persistence: optional, can be cleared at any time
+ */
+ ZT_STATE_OBJECT_PEER = 5,
- /**
- * Network configuration
- *
- * Object ID: peer address
- * Canonical path: /networks.d/.conf (16-digit hex ID)
- * Persistence: required if network memberships should persist
- */
- ZT_STATE_OBJECT_NETWORK_CONFIG = 6
+ /**
+ * Network configuration
+ *
+ * Object ID: peer address
+ * Canonical path: /networks.d/.conf (16-digit hex ID)
+ * Persistence: required if network memberships should persist
+ */
+ ZT_STATE_OBJECT_NETWORK_CONFIG = 6
};
/**
@@ -1532,13 +1527,13 @@ typedef void ZT_Node;
* PORT_ERROR state.
*/
typedef int (*ZT_VirtualNetworkConfigFunction)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- uint64_t, /* Network ID */
- void**, /* Modifiable network user PTR */
- enum ZT_VirtualNetworkConfigOperation, /* Config operation */
- const ZT_VirtualNetworkConfig*); /* Network configuration */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ uint64_t, /* Network ID */
+ void**, /* Modifiable network user PTR */
+ enum ZT_VirtualNetworkConfigOperation, /* Config operation */
+ const ZT_VirtualNetworkConfig*); /* Network configuration */
/**
* Function to send a frame out to a virtual network port
@@ -1548,17 +1543,17 @@ typedef int (*ZT_VirtualNetworkConfigFunction)(
* (9) frame length.
*/
typedef void (*ZT_VirtualNetworkFrameFunction)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- uint64_t, /* Network ID */
- void**, /* Modifiable network user PTR */
- uint64_t, /* Source MAC */
- uint64_t, /* Destination MAC */
- unsigned int, /* Ethernet type */
- unsigned int, /* VLAN ID (0 for none) */
- const void*, /* Frame data */
- unsigned int); /* Frame length */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ uint64_t, /* Network ID */
+ void**, /* Modifiable network user PTR */
+ uint64_t, /* Source MAC */
+ uint64_t, /* Destination MAC */
+ unsigned int, /* Ethernet type */
+ unsigned int, /* VLAN ID (0 for none) */
+ const void*, /* Frame data */
+ unsigned int); /* Frame length */
/**
* Callback for events
@@ -1570,11 +1565,11 @@ typedef void (*ZT_VirtualNetworkFrameFunction)(
* in the definition of ZT_Event.
*/
typedef void (*ZT_EventCallback)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- enum ZT_Event, /* Event type */
- const void*); /* Event payload (if applicable) */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ enum ZT_Event, /* Event type */
+ const void*); /* Event payload (if applicable) */
/**
* Callback for storing and/or publishing state information
@@ -1586,13 +1581,13 @@ typedef void (*ZT_EventCallback)(
* deleted.
*/
typedef void (*ZT_StatePutFunction)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- enum ZT_StateObjectType, /* State object type */
- const uint64_t[2], /* State object ID (if applicable) */
- const void*, /* State object data */
- int); /* Length of data or -1 to delete */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ enum ZT_StateObjectType, /* State object type */
+ const uint64_t[2], /* State object ID (if applicable) */
+ const void*, /* State object data */
+ int); /* Length of data or -1 to delete */
/**
* Callback for retrieving stored state information
@@ -1602,13 +1597,13 @@ typedef void (*ZT_StatePutFunction)(
* small to store it.
*/
typedef int (*ZT_StateGetFunction)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- enum ZT_StateObjectType, /* State object type */
- const uint64_t[2], /* State object ID (if applicable) */
- void*, /* Buffer to store state object data */
- unsigned int); /* Length of data buffer in bytes */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ enum ZT_StateObjectType, /* State object type */
+ const uint64_t[2], /* State object ID (if applicable) */
+ void*, /* Buffer to store state object data */
+ unsigned int); /* Length of data buffer in bytes */
/**
* Function to send a ZeroTier packet out over the physical wire (L2/L3)
@@ -1635,14 +1630,14 @@ typedef int (*ZT_StateGetFunction)(
* delivery. It only means that the packet appears to have been sent.
*/
typedef int (*ZT_WirePacketSendFunction)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- int64_t, /* Local socket */
- const struct sockaddr_storage*, /* Remote address */
- const void*, /* Packet data */
- unsigned int, /* Packet length */
- unsigned int); /* TTL or 0 to use default */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ int64_t, /* Local socket */
+ const struct sockaddr_storage*, /* Remote address */
+ const void*, /* Packet data */
+ unsigned int, /* Packet length */
+ unsigned int); /* TTL or 0 to use default */
/**
* Function to check whether a path should be used for ZeroTier traffic
@@ -1666,12 +1661,12 @@ typedef int (*ZT_WirePacketSendFunction)(
* interface (recursion).
*/
typedef int (*ZT_PathCheckFunction)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- uint64_t, /* ZeroTier address */
- int64_t, /* Local socket or -1 if unknown */
- const struct sockaddr_storage*); /* Remote address */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ uint64_t, /* ZeroTier address */
+ int64_t, /* Local socket or -1 if unknown */
+ const struct sockaddr_storage*); /* Remote address */
/**
* Function to get physical addresses for ZeroTier peers
@@ -1689,12 +1684,12 @@ typedef int (*ZT_PathCheckFunction)(
* with an address.
*/
typedef int (*ZT_PathLookupFunction)(
- ZT_Node*, /* Node */
- void*, /* User ptr */
- void*, /* Thread ptr */
- uint64_t, /* ZeroTier address (40 bits) */
- int, /* Desired ss_family or -1 for any */
- struct sockaddr_storage*); /* Result buffer */
+ ZT_Node*, /* Node */
+ void*, /* User ptr */
+ void*, /* Thread ptr */
+ uint64_t, /* ZeroTier address (40 bits) */
+ int, /* Desired ss_family or -1 for any */
+ struct sockaddr_storage*); /* Result buffer */
/****************************************************************************/
/* C Node API */
@@ -1704,50 +1699,77 @@ typedef int (*ZT_PathLookupFunction)(
* Structure for configuring ZeroTier core callback functions
*/
struct ZT_Node_Callbacks {
- /**
- * Struct version -- must currently be 0
- */
- long version;
+ /**
+ * Struct version -- must currently be 0
+ */
+ long version;
- /**
- * REQUIRED: Function to store and/or replicate state objects
- */
- ZT_StatePutFunction statePutFunction;
+ /**
+ * REQUIRED: Function to store and/or replicate state objects
+ */
+ ZT_StatePutFunction statePutFunction;
- /**
- * REQUIRED: Function to retrieve state objects from an object store
- */
- ZT_StateGetFunction stateGetFunction;
+ /**
+ * REQUIRED: Function to retrieve state objects from an object store
+ */
+ ZT_StateGetFunction stateGetFunction;
- /**
- * REQUIRED: Function to send packets over the physical wire
- */
- ZT_WirePacketSendFunction wirePacketSendFunction;
+ /**
+ * REQUIRED: Function to send packets over the physical wire
+ */
+ ZT_WirePacketSendFunction wirePacketSendFunction;
- /**
- * REQUIRED: Function to inject frames into a virtual network's TAP
- */
- ZT_VirtualNetworkFrameFunction virtualNetworkFrameFunction;
+ /**
+ * REQUIRED: Function to inject frames into a virtual network's TAP
+ */
+ ZT_VirtualNetworkFrameFunction virtualNetworkFrameFunction;
- /**
- * REQUIRED: Function to be called when virtual networks are configured or changed
- */
- ZT_VirtualNetworkConfigFunction virtualNetworkConfigFunction;
+ /**
+ * REQUIRED: Function to be called when virtual networks are configured or changed
+ */
+ ZT_VirtualNetworkConfigFunction virtualNetworkConfigFunction;
- /**
- * REQUIRED: Function to be called to notify external code of important events
- */
- ZT_EventCallback eventCallback;
+ /**
+ * REQUIRED: Function to be called to notify external code of important events
+ */
+ ZT_EventCallback eventCallback;
- /**
- * OPTIONAL: Function to check whether a given physical path should be used
- */
- ZT_PathCheckFunction pathCheckFunction;
+ /**
+ * OPTIONAL: Function to check whether a given physical path should be used
+ */
+ ZT_PathCheckFunction pathCheckFunction;
- /**
- * OPTIONAL: Function to get hints to physical paths to ZeroTier addresses
- */
- ZT_PathLookupFunction pathLookupFunction;
+ /**
+ * OPTIONAL: Function to get hints to physical paths to ZeroTier addresses
+ */
+ ZT_PathLookupFunction pathLookupFunction;
+};
+
+/**
+ * Node configuration options
+ */
+struct ZT_Node_Config {
+ /**
+ * If non-zero enable encrypted HELLO packets.
+ *
+ * This attaches an ephemeral key to HELLO packets and encrypts them. It
+ * increases CPU usage slightly, which can matter at scale for nodes that
+ * handle huge numbers of clients like controllers. HELLO packets only
+ * contain keys and a small amount of meta-data like node version, never
+ * user data or information about things like network membership, so the
+ * security impact of this is negligable. ZT1 does not and never has
+ * guaranteed meta-data privacy, only data privacy. Enable only if you
+ * need it for compliance reasons.
+ */
+ int enableEncryptedHello;
+
+ /**
+ * If non-zero enable low bandwidth mode.
+ *
+ * This reduces keepalive and path sensing traffic, which can slow fail-
+ * over but reduces idle bandwidth. Enable in low bandwidth environments.
+ */
+ int lowBandwidthMode;
};
/**
@@ -1759,13 +1781,14 @@ struct ZT_Node_Callbacks {
* to a few seconds depending on your CPU speed.
*
* @param node Result: pointer is set to new node instance on success
+ * @param config Node-wide configuration options set on startup
* @param uptr User pointer to pass to functions/callbacks
* @param tptr Thread pointer to pass to functions/callbacks resulting from this call
* @param callbacks Callback function configuration
* @param now Current clock in milliseconds
* @return OK (0) or error code if a fatal error condition has occurred
*/
-ZT_SDK_API enum ZT_ResultCode ZT_Node_new(ZT_Node** node, void* uptr, void* tptr, const struct ZT_Node_Callbacks* callbacks, int64_t now);
+ZT_SDK_API enum ZT_ResultCode ZT_Node_new(ZT_Node** node, const struct ZT_Node_Config* config, void* uptr, void* tptr, const struct ZT_Node_Callbacks* callbacks, int64_t now);
/**
* Delete a node and free all resources it consumes
@@ -1810,17 +1833,17 @@ ZT_Node_processWirePacket(ZT_Node* node, void* tptr, int64_t now, int64_t localS
* @return OK (0) or error code if a fatal error condition has occurred
*/
ZT_SDK_API enum ZT_ResultCode ZT_Node_processVirtualNetworkFrame(
- ZT_Node* node,
- void* tptr,
- int64_t now,
- uint64_t nwid,
- uint64_t sourceMac,
- uint64_t destMac,
- unsigned int etherType,
- unsigned int vlanId,
- const void* frameData,
- unsigned int frameLength,
- volatile int64_t* nextBackgroundTaskDeadline);
+ ZT_Node* node,
+ void* tptr,
+ int64_t now,
+ uint64_t nwid,
+ uint64_t sourceMac,
+ uint64_t destMac,
+ unsigned int etherType,
+ unsigned int vlanId,
+ const void* frameData,
+ unsigned int frameLength,
+ volatile int64_t* nextBackgroundTaskDeadline);
/**
* Perform periodic background operations
diff --git a/make-bsd.mk b/make-bsd.mk
index ce0b4dde1..cf4c22c8b 100644
--- a/make-bsd.mk
+++ b/make-bsd.mk
@@ -1,12 +1,21 @@
# This requires GNU make, which is typically "gmake" on BSD systems
-INCLUDES=-isystem ext -Iext/prometheus-cpp-lite-1.0/core/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include
+INCLUDES=-isystem ext -Iext/prometheus-cpp-lite-1.0/core/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include -Iext/opentelemetry-cpp-api-only/include
DEFS=
LIBS=
include objects.mk
ONE_OBJS+=osdep/BSDEthernetTap.o ext/http-parser/http_parser.o
+ifeq ($(ZT_CONTROLLER),1)
+ ZT_NONFREE=1
+endif
+ifeq ($(ZT_NONFREE),1)
+ include objects-nonfree.mk
+ ONE_OBJS+=$(CONTROLLER_OBJS)
+ override DEFS += -DZT_NONFREE_CONTROLLER
+endif
+
ifeq ($(OSTYPE),FreeBSD)
# Auto-detect miniupnpc and nat-pmp as well and use ports libs if present,
# otherwise build into binary as done on Mac and Windows.
@@ -181,7 +190,7 @@ selftest: $(CORE_OBJS) $(ONE_OBJS) selftest.o
zerotier-selftest: selftest
clean:
- rm -rf *.a *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli $(ONE_OBJS) $(CORE_OBJS)
+ rm -rf *.a *.o node/*.o nonfree/controller/*.o osdep/*.o service/*.o ext/http-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli $(ONE_OBJS) $(CORE_OBJS)
debug: FORCE
$(MAKE) -j ZT_DEBUG=1
diff --git a/make-linux.mk b/make-linux.mk
index eab6dee5e..ff94cdd81 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -17,6 +17,16 @@ EXTRA_DEPS?=
ZT_CARGO_FLAGS?=
include objects.mk
+
+ifeq ($(ZT_CONTROLLER),1)
+ ZT_NONFREE=1
+endif
+ifeq ($(ZT_NONFREE),1)
+ include objects-nonfree.mk
+ ONE_OBJS+=$(CONTROLLER_OBJS)
+ override DEFS += -DZT_NONFREE_CONTROLLER
+endif
+
ifeq ($(ZT_EXTOSDEP),1)
ONE_OBJS+=osdep/ExtOsdep.o
override DEFS += -DZT_EXTOSDEP
@@ -57,7 +67,7 @@ ifeq ($(ZT_RULES_ENGINE_DEBUGGING),1)
endif
ifeq ($(ZT_DEBUG_TRACE),1)
- DEFS+=-DZT_DEBUG_TRACE
+ override DEFS+=-DZT_DEBUG_TRACE
endif
# Build with address sanitization library for advanced debugging (clang)
@@ -94,10 +104,6 @@ ifeq ($(ZT_SYNOLOGY), 1)
ZT_EMBEDDED=1
endif
-ifeq ($(ZT_DISABLE_COMPRESSION), 1)
- override DEFS+=-DZT_DISABLE_COMPRESSION
-endif
-
ifeq ($(ZT_TRACE),1)
override DEFS+=-DZT_TRACE
endif
@@ -115,7 +121,7 @@ ifeq ($(ZT_VAULT_SUPPORT),1)
override LDLIBS+=-lcurl
endif
-# Determine system build architecture from compiler target
+# Determine system build architecture from compiler target. This is hairy due to "ARM wrestling."
CC_MACH=$(shell $(CC) -dumpmachine | cut -d '-' -f 1)
ZT_ARCHITECTURE=999
ifeq ($(CC_MACH),x86_64)
@@ -441,7 +447,7 @@ endif
ext/${OTEL_INSTALL_DIR}/include/opentelemetry/version.h: otel
clean: FORCE
- rm -rf *.a *.so *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/miniupnpc/*.o ext/libnatpmp/*.o $(CORE_OBJS) $(ONE_OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest build-* ZeroTierOneInstaller-* *.deb *.rpm .depend debian/files debian/zerotier-one*.debhelper debian/zerotier-one.substvars debian/*.log debian/zerotier-one doc/node_modules ext/misc/*.o debian/.debhelper debian/debhelper-build-stamp docker/zerotier-one rustybits/target ext/opentelemetry-cpp-${OTEL_VERSION}/localinstall ext/opentelemetry-cpp-${OTEL_VERSION}/build
+ rm -rf *.a *.so *.o node/*.o nonfree/controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/miniupnpc/*.o ext/libnatpmp/*.o $(CORE_OBJS) $(ONE_OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest build-* ZeroTierOneInstaller-* *.deb *.rpm .depend debian/files debian/zerotier-one*.debhelper debian/zerotier-one.substvars debian/*.log debian/zerotier-one doc/node_modules ext/misc/*.o debian/.debhelper debian/debhelper-build-stamp docker/zerotier-one rustybits/target ext/opentelemetry-cpp-${OTEL_VERSION}/localinstall ext/opentelemetry-cpp-${OTEL_VERSION}/build
distclean: clean
diff --git a/make-mac.mk b/make-mac.mk
index 280211b02..d16616fa3 100644
--- a/make-mac.mk
+++ b/make-mac.mk
@@ -5,7 +5,7 @@ TOPDIR=$(shell pwd)
INCLUDES=-I$(shell pwd)/rustybits/target -isystem $(TOPDIR)/ext -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/core/include -I$(TOPDIR)/ext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/simpleapi/include
DEFS=
LIBS=
-ARCH_FLAGS=-arch x86_64 -arch arm64
+ARCH_FLAGS=-arch x86_64 -arch arm64
CODESIGN=echo
PRODUCTSIGN=echo
@@ -33,9 +33,7 @@ LIBS+=-framework CoreServices -framework SystemConfiguration -framework CoreFoun
EXTRA_CARGO_FLAGS?=
-# Official releases are signed with our Apple cert and apply software updates by default
ifeq ($(ZT_OFFICIAL_RELEASE),1)
- DEFS+=-DZT_SOFTWARE_UPDATE_DEFAULT="\"apply\""
ZT_USE_MINIUPNPC=1
CODESIGN=codesign
PRODUCTSIGN=productsign
@@ -44,23 +42,21 @@ ifeq ($(ZT_OFFICIAL_RELEASE),1)
NOTARIZE=xcrun notarytool
NOTARIZE_APPLE_ID="adam.ierymenko@gmail.com"
NOTARIZE_TEAM_ID="8ZD9JUCZ4V"
-else
- DEFS+=-DZT_SOFTWARE_UPDATE_DEFAULT="\"download\""
endif
# Use fast ASM Salsa20/12 for x64 processors
-DEFS+=-DZT_USE_X64_ASM_SALSA2012
+override DEFS+=-DZT_USE_X64_ASM_SALSA2012
CORE_OBJS+=ext/x64-salsa2012-asm/salsa2012.o
CXXFLAGS=$(CFLAGS) -std=c++17 -stdlib=libc++
# Build miniupnpc and nat-pmp as included libraries -- extra defs are required for these sources
-DEFS+=-DMACOSX -DZT_SSO_SUPPORTED -DZT_USE_MINIUPNPC -DMINIUPNP_STATICLIB -D_DARWIN_C_SOURCE -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -DOS_STRING=\"Darwin/15.0.0\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
+override DEFS+=-DMACOSX -DZT_SSO_SUPPORTED -DZT_USE_MINIUPNPC -DMINIUPNP_STATICLIB -D_DARWIN_C_SOURCE -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -DOS_STRING=\"Darwin/15.0.0\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o osdep/PortMapper.o
ifeq ($(ZT_CONTROLLER),1)
MACOS_VERSION_MIN=10.15
override CXXFLAGS=$(CFLAGS) -std=c++17 -stdlib=libc++
LIBS+=-L/opt/homebrew/lib -L/usr/local/opt/libpqxx/lib -L/usr/local/opt/libpq/lib -L/usr/local/opt/openssl/lib/ -lpqxx -lpq -lssl -lcrypto -lgssapi_krb5 ext/redis-plus-plus-1.1.1/install/macos/lib/libredis++.a ext/hiredis-0.14.1/lib/macos/libhiredis.a rustybits/target/librustybits.a
- DEFS+=-DZT_CONTROLLER_USE_LIBPQ -DZT_CONTROLLER_USE_REDIS -DZT_CONTROLLER
+ override DEFS+=-DZT_CONTROLLER_USE_LIBPQ -DZT_CONTROLLER_USE_REDIS -DZT_CONTROLLER
INCLUDES+=-I/opt/homebrew/include -I/opt/homebrew/opt/libpq/include -I/usr/local/opt/libpq/include -I/usr/local/opt/libpqxx/include -Iext/hiredis-0.14.1/include/ -Iext/redis-plus-plus-1.1.1/install/macos/include/sw/ -Irustybits/target/
EXTRA_CARGO_FLAGS+=-F ztcontroller
else
@@ -69,10 +65,10 @@ endif
# Build with address sanitization library for advanced debugging (clang)
ifeq ($(ZT_SANITIZE),1)
- DEFS+=-fsanitize=address -DASAN_OPTIONS=symbolize=1
+ override DEFS+=-fsanitize=address -DASAN_OPTIONS=symbolize=1
endif
ifeq ($(ZT_DEBUG_TRACE),1)
- DEFS+=-DZT_DEBUG_TRACE
+ override DEFS+=-DZT_DEBUG_TRACE
endif
# Debug mode -- dump trace output, build binary with -g
ifeq ($(ZT_DEBUG),1)
@@ -93,22 +89,22 @@ else
endif
ifeq ($(ZT_TRACE),1)
- DEFS+=-DZT_TRACE
+ override DEFS+=-DZT_TRACE
endif
ifeq ($(ZT_DEBUG),1)
- DEFS+=-DZT_DEBUG
+ override DEFS+=-DZT_DEBUG
endif
ifeq ($(ZT_VAULT_SUPPORT),1)
- DEFS+=-DZT_VAULT_SUPPORT=1
+ override DEFS+=-DZT_VAULT_SUPPORT=1
LIBS+=-lcurl
endif
OTEL_VERSION=1.21.0
ifeq (${ZT_OTEL},1)
OTEL_INSTALL_DIR=ext/opentelemetry-cpp-${OTEL_VERSION}/localinstall
- DEFS+=-DZT_OTEL
+ override DEFS+=-DZT_OTEL
INCLUDES+=-I${OTEL_INSTALL_DIR}/include
LIBS+=-L${OTEL_INSTALL_DIR}/lib -lopentelemetry_exporter_in_memory_metric -lopentelemetry_exporter_in_memory -lopentelemetry_exporter_ostream_logs -lopentelemetry_exporter_ostream_metrics -lopentelemetry_exporter_ostream_span -lopentelemetry_trace -lopentelemetry_common -lopentelemetry_resources -lopentelemetry_logs -lopentelemetry_metrics -lopentelemetry_version
else
@@ -126,7 +122,7 @@ mac-agent: FORCE
$(CODESIGN) -f --options=runtime -s $(CODESIGN_APP_CERT) MacEthernetTapAgent
osdep/MacDNSHelper.o: osdep/MacDNSHelper.mm
- $(CXX) $(CXXFLAGS) -c osdep/MacDNSHelper.mm -o osdep/MacDNSHelper.o
+ $(CXX) $(CXXFLAGS) -c osdep/MacDNSHelper.mm -o osdep/MacDNSHelper.o
ifeq ($(ZT_CONTROLLER),1)
one: otel rustybits $(CORE_OBJS) $(ONE_OBJS) one.o mac-agent
@@ -163,10 +159,6 @@ libzerotiercore.a: $(CORE_OBJS)
core: libzerotiercore.a
-#cli: FORCE
-# $(CXX) $(CXXFLAGS) -o zerotier cli/zerotier.cpp osdep/OSUtils.cpp node/InetAddress.cpp node/Utils.cpp node/Salsa20.cpp node/Identity.cpp node/SHA512.cpp node/C25519.cpp -lcurl
-# $(STRIP) zerotier
-
selftest: $(CORE_OBJS) $(ONE_OBJS) selftest.o
$(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.o $(CORE_OBJS) $(ONE_OBJS) $(LIBS) rustybits/target/librustybits.a
$(STRIP) zerotier-selftest
@@ -183,8 +175,8 @@ mac-dist-pkg: FORCE
rm -f "ZeroTier One Signed.pkg"
$(PRODUCTSIGN) --sign $(CODESIGN_INSTALLER_CERT) "ZeroTier One.pkg" "ZeroTier One Signed.pkg"
if [ -f "ZeroTier One Signed.pkg" ]; then mv -f "ZeroTier One Signed.pkg" "ZeroTier One.pkg"; fi
- rm -f zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_*
- cat ext/installfiles/mac-update/updater.tmpl.sh "ZeroTier One.pkg" >zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_$(ZT_VERSION_MAJOR).$(ZT_VERSION_MINOR).$(ZT_VERSION_REV)_$(ZT_VERSION_BUILD).exe
+ #rm -f zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_*
+ #cat ext/installfiles/mac-update/updater.tmpl.sh "ZeroTier One.pkg" >zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_$(ZT_VERSION_MAJOR).$(ZT_VERSION_MINOR).$(ZT_VERSION_REV)_$(ZT_VERSION_BUILD).exe
$(NOTARIZE) submit --apple-id "adam.ierymenko@gmail.com" --team-id "8ZD9JUCZ4V" --wait "ZeroTier One.pkg"
echo '*** When Apple notifies that the app is notarized, run: xcrun stapler staple "ZeroTier One.pkg"'
@@ -214,13 +206,13 @@ central-controller-docker: _buildx FORCE
centralv2-controller-docker: _buildx FORCE
docker buildx build --platform linux/amd64,linux/arm64 --no-cache -t us-central1-docker.pkg.dev/zerotier-d648c7/central-v2/ztcentral-controller:${TIMESTAMP} -f ext/central-controller-docker/Dockerfile --build-arg git_branch=`git name-rev --name-only HEAD` . --push
- @echo Image: us-central1-docker.pkg.dev/zerotier-d648c7/central-v2/ztcentral-controller:${TIMESTAMP}
+ @echo Image: us-central1-docker.pkg.dev/zerotier-d648c7/central-v2/ztcentral-controller:${TIMESTAMP}
docker-release: _buildx
docker buildx build --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64,linux/mips64le,linux/ppc64le,linux/s390x -t zerotier/zerotier:${RELEASE_DOCKER_TAG} -t zerotier/zerotier:latest --build-arg VERSION=${RELEASE_VERSION} -f Dockerfile.release . --push
-
+
clean:
- rm -rf MacEthernetTapAgent *.dSYM build-* *.a *.pkg *.dmg *.o node/*.o controller/*.o service/*.o osdep/*.o ext/http-parser/*.o $(CORE_OBJS) $(ONE_OBJS) zerotier-one zerotier-idtool zerotier-selftest zerotier-cli zerotier doc/node_modules zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_* rustybits/target/ ext/opentelemetry-cpp-${OTEL_VERSION}/localinstall ext/opentelemetry-cpp-${OTEL_VERSION}/build
+ rm -rf MacEthernetTapAgent *.dSYM build-* *.a *.pkg *.dmg *.o node/*.o nonfree/controller/*.o service/*.o osdep/*.o ext/http-parser/*.o $(CORE_OBJS) $(ONE_OBJS) zerotier-one zerotier-idtool zerotier-selftest zerotier-cli zerotier doc/node_modules zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_* rustybits/target/ ext/opentelemetry-cpp-${OTEL_VERSION}/localinstall ext/opentelemetry-cpp-${OTEL_VERSION}/build
ifeq (${ZT_OTEL},1)
otel:
diff --git a/make-netbsd.mk b/make-netbsd.mk
index f2490038b..6ee32ccd9 100644
--- a/make-netbsd.mk
+++ b/make-netbsd.mk
@@ -1,13 +1,22 @@
CC=gcc
CXX=g++
-INCLUDES=
+INCLUDES=-Iext/opentelemetry-cpp-api-only/include
DEFS=
LIBS=
include objects.mk
OBJS+=osdep/NetBSDEthernetTap.o ext/lz4/lz4.o ext/json-parser/json.o ext/http-parser/http_parser.o
+ifeq ($(ZT_CONTROLLER),1)
+ ZT_NONFREE=1
+endif
+ifeq ($(ZT_NONFREE),1)
+ include objects-nonfree.mk
+ ONE_OBJS+=$(CONTROLLER_OBJS)
+ override DEFS += -DZT_NONFREE_CONTROLLER
+endif
+
# "make official" is a shortcut for this
ifeq ($(ZT_OFFICIAL_RELEASE),1)
DEFS+=-DZT_OFFICIAL_RELEASE
@@ -53,7 +62,7 @@ selftest: $(OBJS) selftest.o
# ./buildinstaller.sh
clean:
- rm -rf *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-*
+ rm -rf *.o node/*.o nonfree/controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-*
debug: FORCE
make -j 4 ZT_DEBUG=1
diff --git a/node/AES.cpp b/node/AES.cpp
index 1ba6aeeb7..6bc308836 100644
--- a/node/AES.cpp
+++ b/node/AES.cpp
@@ -1,15 +1,10 @@
-/*
- * Copyright (c)2013-2020 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#include "AES.hpp"
diff --git a/node/AES.hpp b/node/AES.hpp
index cb4ca23f5..230915211 100644
--- a/node/AES.hpp
+++ b/node/AES.hpp
@@ -1,21 +1,15 @@
-/*
- * Copyright (c)2013-2020 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#ifndef ZT_AES_HPP
#define ZT_AES_HPP
#include "Constants.hpp"
-#include "SHA512.hpp"
#include "Utils.hpp"
// Uncomment to disable all hardware acceleration (usually for testing)
diff --git a/node/AES_aesni.cpp b/node/AES_aesni.cpp
index e4509425a..1eecbfae8 100644
--- a/node/AES_aesni.cpp
+++ b/node/AES_aesni.cpp
@@ -1,15 +1,10 @@
-/*
- * Copyright (c)2013-2020 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#include "AES.hpp"
#include "Constants.hpp"
diff --git a/node/AES_armcrypto.cpp b/node/AES_armcrypto.cpp
index a1be0b003..8e1cce30a 100644
--- a/node/AES_armcrypto.cpp
+++ b/node/AES_armcrypto.cpp
@@ -1,15 +1,10 @@
-/*
- * Copyright (c)2013-2020 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#include "AES.hpp"
#include "Constants.hpp"
diff --git a/node/Address.hpp b/node/Address.hpp
index 182ccb7bb..6c376747c 100644
--- a/node/Address.hpp
+++ b/node/Address.hpp
@@ -1,15 +1,10 @@
-/*
- * Copyright (c)2019 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#ifndef ZT_ADDRESS_HPP
#define ZT_ADDRESS_HPP
@@ -21,8 +16,6 @@
#include
#include
#include
-#include
-#include
namespace ZeroTier {
diff --git a/node/AtomicCounter.hpp b/node/AtomicCounter.hpp
index 1e75d6e9f..b70b3dd98 100644
--- a/node/AtomicCounter.hpp
+++ b/node/AtomicCounter.hpp
@@ -1,21 +1,14 @@
-/*
- * Copyright (c)2019 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#ifndef ZT_ATOMICCOUNTER_HPP
#define ZT_ATOMICCOUNTER_HPP
-#include "Constants.hpp"
-
#ifndef __GNUC__
#include
#endif
diff --git a/node/Bond.cpp b/node/Bond.cpp
index 647633342..8f9130462 100644
--- a/node/Bond.cpp
+++ b/node/Bond.cpp
@@ -1,23 +1,19 @@
-/*
- * Copyright (c)2013-2021 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#include "Bond.hpp"
+#include "Constants.hpp"
+#include "Node.hpp"
#include "Switch.hpp"
#include // for PRId64, etc. macros
#include
-#include
#include
// FIXME: remove this suppression and actually fix warnings
@@ -899,7 +895,7 @@ void Bond::sendQOS_MEASUREMENT(void* tPtr, int pathIdx, int64_t localSocket, con
RR->node->putPacket(tPtr, localSocket, atAddress, outp.data(), outp.size());
}
else {
- RR->sw->send(tPtr, outp, false);
+ RR->sw->send(tPtr, outp, false, 0, ZT_QOS_NO_FLOW);
}
Metrics::pkt_qos_out++;
_paths[pathIdx].packetsReceivedSinceLastQoS = 0;
diff --git a/node/Bond.hpp b/node/Bond.hpp
index f7d1f05a2..5c7396d2c 100644
--- a/node/Bond.hpp
+++ b/node/Bond.hpp
@@ -1,15 +1,10 @@
-/*
- * Copyright (c)2013-2021 ZeroTier, Inc.
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
- * Use of this software is governed by the Business Source License included
- * in the LICENSE.TXT file in the project's root directory.
- *
- * Change Date: 2026-01-01
- *
- * On the date above, in accordance with the Business Source License, use
- * of this software will be governed by version 2.0 of the Apache License.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
*/
-/****/
#ifndef ZT_BOND_HPP
#define ZT_BOND_HPP
@@ -23,7 +18,6 @@
#include
#include
-#include
#include