Browse Source

Rest -> MPL except controller.

Adam Ierymenko 1 month ago
parent
commit
f6d52dd96c
57 changed files with 1137 additions and 1339 deletions
  1. 15 20
      include/ZeroTierDebug.h
  2. 589 594
      include/ZeroTierOne.h
  3. 5 10
      osdep/Arp.cpp
  4. 5 10
      osdep/Arp.hpp
  5. 5 10
      osdep/BSDEthernetTap.cpp
  6. 5 10
      osdep/BSDEthernetTap.hpp
  7. 5 10
      osdep/Binder.hpp
  8. 5 10
      osdep/BlockingQueue.hpp
  9. 6 11
      osdep/EthernetTap.cpp
  10. 5 10
      osdep/EthernetTap.hpp
  11. 5 10
      osdep/ExtOsdep.cpp
  12. 5 10
      osdep/ExtOsdep.hpp
  13. 5 10
      osdep/Http.cpp
  14. 5 10
      osdep/Http.hpp
  15. 5 10
      osdep/LinuxEthernetTap.cpp
  16. 5 10
      osdep/LinuxEthernetTap.hpp
  17. 5 10
      osdep/LinuxNetLink.cpp
  18. 6 11
      osdep/LinuxNetLink.hpp
  19. 8 0
      osdep/MacDNSHelper.hpp
  20. 8 0
      osdep/MacDNSHelper.mm
  21. 5 10
      osdep/MacEthernetTap.cpp
  22. 5 10
      osdep/MacEthernetTap.hpp
  23. 5 10
      osdep/MacEthernetTapAgent.c
  24. 10 15
      osdep/MacEthernetTapAgent.h
  25. 5 10
      osdep/MacKextEthernetTap.cpp
  26. 5 10
      osdep/MacKextEthernetTap.hpp
  27. 5 10
      osdep/ManagedRoute.cpp
  28. 5 10
      osdep/ManagedRoute.hpp
  29. 5 10
      osdep/NeighborDiscovery.cpp
  30. 5 10
      osdep/NeighborDiscovery.hpp
  31. 5 10
      osdep/NetBSDEthernetTap.cpp
  32. 5 10
      osdep/NetBSDEthernetTap.hpp
  33. 5 10
      osdep/OSUtils.cpp
  34. 5 10
      osdep/OSUtils.hpp
  35. 5 10
      osdep/Phy.hpp
  36. 5 10
      osdep/PortMapper.cpp
  37. 5 10
      osdep/PortMapper.hpp
  38. 5 10
      osdep/Thread.hpp
  39. 9 1
      osdep/WinDNSHelper.cpp
  40. 9 1
      osdep/WinDNSHelper.hpp
  41. 9 1
      osdep/WinFWHelper.cpp
  42. 9 1
      osdep/WinFWHelper.hpp
  43. 5 10
      osdep/WindowsEthernetTap.cpp
  44. 5 10
      osdep/WindowsEthernetTap.hpp
  45. 170 175
      rule-compiler/rule-compiler.js
  46. 5 9
      rustybits/smeeclient/src/ext.rs
  47. 5 9
      rustybits/smeeclient/src/lib.rs
  48. 5 9
      rustybits/zeroidc/src/error.rs
  49. 5 9
      rustybits/zeroidc/src/ext.rs
  50. 5 9
      rustybits/zeroidc/src/lib.rs
  51. 5 10
      service/OneService.cpp
  52. 5 10
      service/OneService.hpp
  53. 5 10
      service/SoftwareUpdater.cpp
  54. 5 10
      service/SoftwareUpdater.hpp
  55. 5 15
      tcp-proxy/tcp-proxy.cpp
  56. 40 44
      windows/ZeroTierOne/ZeroTierOneService.cpp
  57. 34 35
      windows/ZeroTierOne/ZeroTierOneService.h

+ 15 - 20
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 <string.h>
 
 #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

File diff suppressed because it is too large
+ 589 - 594
include/ZeroTierOne.h


+ 5 - 10
osdep/Arp.cpp

@@ -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/
  */
-/****/
 
 #include "Arp.hpp"
 

+ 5 - 10
osdep/Arp.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_ARP_HPP
 #define ZT_ARP_HPP

+ 5 - 10
osdep/BSDEthernetTap.cpp

@@ -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/
  */
-/****/
 
 #include "BSDEthernetTap.hpp"
 

+ 5 - 10
osdep/BSDEthernetTap.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_BSDETHERNETTAP_HPP
 #define ZT_BSDETHERNETTAP_HPP

+ 5 - 10
osdep/Binder.hpp

@@ -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/
  */
-/****/
 
 #ifndef ZT_BINDER_HPP
 #define ZT_BINDER_HPP

+ 5 - 10
osdep/BlockingQueue.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_BLOCKINGQUEUE_HPP
 #define ZT_BLOCKINGQUEUE_HPP

+ 6 - 11
osdep/EthernetTap.cpp

@@ -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/
  */
-/****/
 
 #include "EthernetTap.hpp"
 
@@ -20,9 +15,9 @@
 
 #ifdef ZT_SDK
 
-#include "../nonfree/controller/EmbeddedNetworkController.hpp"
 #include "../include/VirtualTap.hpp"
 #include "../node/Node.hpp"
+#include "../nonfree/controller/EmbeddedNetworkController.hpp"
 
 #else
 

+ 5 - 10
osdep/EthernetTap.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_ETHERNETTAP_HPP
 #define ZT_ETHERNETTAP_HPP

+ 5 - 10
osdep/ExtOsdep.cpp

@@ -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/
  */
-/****/
 
 #include "ExtOsdep.hpp"
 

+ 5 - 10
osdep/ExtOsdep.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_EXTOSDEP_HPP
 #define ZT_EXTOSDEP_HPP

+ 5 - 10
osdep/Http.cpp

@@ -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/
  */
-/****/
 
 #include "Http.hpp"
 

+ 5 - 10
osdep/Http.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_HTTP_HPP
 #define ZT_HTTP_HPP

+ 5 - 10
osdep/LinuxEthernetTap.cpp

@@ -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/
  */
-/****/
 
 #ifdef __GNUC__
 #pragma GCC diagnostic ignored "-Wrestrict"

+ 5 - 10
osdep/LinuxEthernetTap.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_LINUXETHERNETTAP_HPP
 #define ZT_LINUXETHERNETTAP_HPP

+ 5 - 10
osdep/LinuxNetLink.cpp

@@ -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/
  */
-/****/
 
 #include "../node/Constants.hpp"
 

+ 6 - 11
osdep/LinuxNetLink.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_LINUX_NETLINK_HPP
 #define ZT_LINUX_NETLINK_HPP
@@ -160,4 +155,4 @@ class LinuxNetLink {
 
 #endif
 
-#endif	 // ZT_LINUX_NETLINK_HPPS
+#endif	 // ZT_LINUX_NETLINK_HPPS

+ 8 - 0
osdep/MacDNSHelper.hpp

@@ -1,3 +1,11 @@
+/* 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/.
+ *
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
+ */
+
 #ifndef MAC_DNS_HELPER
 #define MAC_DNS_HELPER
 

+ 8 - 0
osdep/MacDNSHelper.mm

@@ -1,3 +1,11 @@
+/* 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/.
+ *
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
+ */
+
 #include "MacDNSHelper.hpp"
 
 #include <stdio.h>

+ 5 - 10
osdep/MacEthernetTap.cpp

@@ -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/
  */
-/****/
 
 #include "../node/Constants.hpp"
 

+ 5 - 10
osdep/MacEthernetTap.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_OSXETHERNETTAP_HPP
 #define ZT_OSXETHERNETTAP_HPP

+ 5 - 10
osdep/MacEthernetTapAgent.c

@@ -1,15 +1,10 @@
-/*
- * 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
+/* 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/.
  *
- * 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 creates a pair of feth devices with the lower numbered device

+ 10 - 15
osdep/MacEthernetTapAgent.h

@@ -1,27 +1,22 @@
-/*
- * 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_MACETHERNETTAPAGENT_H
 #define ZT_MACETHERNETTAPAGENT_H
 
-#define ZT_MACETHERNETTAPAGENT_EXIT_CODE_SUCCESS 0
-#define ZT_MACETHERNETTAPAGENT_EXIT_CODE_INVALID_REQUEST -1
+#define ZT_MACETHERNETTAPAGENT_EXIT_CODE_SUCCESS		  0
+#define ZT_MACETHERNETTAPAGENT_EXIT_CODE_INVALID_REQUEST  -1
 #define ZT_MACETHERNETTAPAGENT_EXIT_CODE_UNABLE_TO_CREATE -2
-#define ZT_MACETHERNETTAPAGENT_EXIT_CODE_READ_ERROR -3
+#define ZT_MACETHERNETTAPAGENT_EXIT_CODE_READ_ERROR		  -3
 
-#define ZT_MACETHERNETTAPAGENT_STDIN_CMD_PACKET 0
+#define ZT_MACETHERNETTAPAGENT_STDIN_CMD_PACKET	  0
 #define ZT_MACETHERNETTAPAGENT_STDIN_CMD_IFCONFIG 1
-#define ZT_MACETHERNETTAPAGENT_STDIN_CMD_EXIT 2
+#define ZT_MACETHERNETTAPAGENT_STDIN_CMD_EXIT	  2
 
 #define ZT_MACETHERNETTAPAGENT_DEFAULT_SYSTEM_PATH "/Library/Application Support/ZeroTier/One/MacEthernetTapAgent"
 

+ 5 - 10
osdep/MacKextEthernetTap.cpp

@@ -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/
  */
-/****/
 
 #include "MacDNSHelper.hpp"
 

+ 5 - 10
osdep/MacKextEthernetTap.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_MacKextEthernetTap_HPP
 #define ZT_MacKextEthernetTap_HPP

+ 5 - 10
osdep/ManagedRoute.cpp

@@ -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/
  */
-/****/
 
 #include "../node/Constants.hpp"
 #include "../osdep/OSUtils.hpp"

+ 5 - 10
osdep/ManagedRoute.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_MANAGEDROUTE_HPP
 #define ZT_MANAGEDROUTE_HPP

+ 5 - 10
osdep/NeighborDiscovery.cpp

@@ -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/
  */
-/****/
 
 #include "NeighborDiscovery.hpp"
 

+ 5 - 10
osdep/NeighborDiscovery.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_NEIGHBORDISCOVERY_HPP
 #define ZT_NEIGHBORDISCOVERY_HPP

+ 5 - 10
osdep/NetBSDEthernetTap.cpp

@@ -1,15 +1,10 @@
-/*
- * 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
+/* 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/.
  *
- * 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 "NetBSDEthernetTap.hpp"
 

+ 5 - 10
osdep/NetBSDEthernetTap.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_NetBSDEthernetTap_HPP
 #define ZT_NetBSDEthernetTap_HPP

+ 5 - 10
osdep/OSUtils.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 "../node/Constants.hpp"
 #include "../node/Utils.hpp"

+ 5 - 10
osdep/OSUtils.hpp

@@ -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/
  */
-/****/
 
 #ifndef ZT_OSUTILS_HPP
 #define ZT_OSUTILS_HPP

+ 5 - 10
osdep/Phy.hpp

@@ -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/
  */
-/****/
 
 #ifndef ZT_PHY_HPP
 #define ZT_PHY_HPP

+ 5 - 10
osdep/PortMapper.cpp

@@ -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/
  */
-/****/
 
 #ifdef ZT_USE_MINIUPNPC
 

+ 5 - 10
osdep/PortMapper.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/
  */
-/****/
 
 #ifdef ZT_USE_MINIUPNPC
 

+ 5 - 10
osdep/Thread.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_THREAD_HPP
 #define ZT_THREAD_HPP

+ 9 - 1
osdep/WinDNSHelper.cpp

@@ -1,3 +1,11 @@
+/* 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/.
+ *
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
+ */
+
 #include "WinDNSHelper.hpp"
 
 #include <WbemIdl.h>
@@ -304,4 +312,4 @@ void WinDNSHelper::removeDNS(uint64_t nwid)
 	}
 }
 
-}	// namespace ZeroTier
+}	// namespace ZeroTier

+ 9 - 1
osdep/WinDNSHelper.hpp

@@ -1,3 +1,11 @@
+/* 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/.
+ *
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
+ */
+
 #ifndef WIN_DNS_HELPER_H_
 #define WIN_DNS_HELPER_H_
 
@@ -19,4 +27,4 @@ class WinDNSHelper {
 
 }	// namespace ZeroTier
 
-#endif
+#endif

+ 9 - 1
osdep/WinFWHelper.cpp

@@ -1,3 +1,11 @@
+/* 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/.
+ *
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
+ */
+
 #include "WinFWHelper.hpp"
 
 namespace ZeroTier {
@@ -154,4 +162,4 @@ void WinFWHelper::_run(std::string cmd)
 	}
 }
 
-}	// namespace ZeroTier
+}	// namespace ZeroTier

+ 9 - 1
osdep/WinFWHelper.hpp

@@ -1,3 +1,11 @@
+/* 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/.
+ *
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
+ */
+
 #ifndef WIN_FW_HELPER_H_
 #define WIN_FW_HELPER_H_
 
@@ -27,4 +35,4 @@ class WinFWHelper {
 
 }	// namespace ZeroTier
 
-#endif
+#endif

+ 5 - 10
osdep/WindowsEthernetTap.cpp

@@ -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/
  */
-/****/
 
 #include "WindowsEthernetTap.hpp"
 

+ 5 - 10
osdep/WindowsEthernetTap.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_WINDOWSETHERNETTAP_HPP
 #define ZT_WINDOWSETHERNETTAP_HPP

File diff suppressed because it is too large
+ 170 - 175
rule-compiler/rule-compiler.js


+ 5 - 9
rustybits/smeeclient/src/ext.rs

@@ -1,13 +1,9 @@
-/*
- * Copyright (c)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/
  */
 
 #![allow(clippy::uninlined_format_args, clippy::missing_safety_doc)]

+ 5 - 9
rustybits/smeeclient/src/lib.rs

@@ -1,13 +1,9 @@
-/*
- * Copyright (c)2023 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/
  */
 
 pub mod ext;

+ 5 - 9
rustybits/zeroidc/src/error.rs

@@ -1,13 +1,9 @@
-/*
- * Copyright (c)2022 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/
  */
 
 use thiserror::Error;

+ 5 - 9
rustybits/zeroidc/src/ext.rs

@@ -1,13 +1,9 @@
-/*
- * Copyright (c)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/
  */
 
 use std::ffi::{CStr, CString};

+ 5 - 9
rustybits/zeroidc/src/lib.rs

@@ -1,13 +1,9 @@
-/*
- * Copyright (c)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/
  */
 
 #![allow(

+ 5 - 10
service/OneService.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 <algorithm>
 #include <condition_variable>

+ 5 - 10
service/OneService.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_ONESERVICE_HPP
 #define ZT_ONESERVICE_HPP

+ 5 - 10
service/SoftwareUpdater.cpp

@@ -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/
  */
-/****/
 
 #include "../node/Constants.hpp"
 #include "../version.h"

+ 5 - 10
service/SoftwareUpdater.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_SOFTWAREUPDATER_HPP
 #define ZT_SOFTWAREUPDATER_HPP

+ 5 - 15
tcp-proxy/tcp-proxy.cpp

@@ -1,19 +1,9 @@
-/*
- * 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.
+/* 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/.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * (c) ZeroTier, Inc.
+ * https://www.zerotier.com/
  */
 
 // HACK! Will eventually use epoll() or something in Phy<> instead of select().

+ 40 - 44
windows/ZeroTierOne/ZeroTierOneService.cpp

@@ -1,50 +1,42 @@
-/*
- * 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/
  */
-/****/
 
 #pragma region Includes
 
 #if defined(_WIN32) || defined(_WIN64)
 
-#include <winsock2.h>
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-
 #include "ZeroTierOneService.h"
 
-#include "../../version.h"
 #include "../../include/ZeroTierOne.h"
-
 #include "../../node/Constants.hpp"
 #include "../../node/Utils.hpp"
 #include "../../osdep/OSUtils.hpp"
 #include "../../service/OneService.hpp"
+#include "../../version.h"
 
-#pragma endregion // Includes
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+#include <winsock2.h>
+
+#pragma endregion	// Includes
 
 #ifdef ZT_DEBUG_SERVICE
-FILE *SVCDBGfile = (FILE *)0;
+FILE* SVCDBGfile = (FILE*)0;
 ZeroTier::Mutex SVCDBGfile_m;
 #endif
 
-ZeroTierOneService::ZeroTierOneService() :
-	CServiceBase(ZT_SERVICE_NAME,TRUE,TRUE,FALSE),
-	_service((ZeroTier::OneService *)0)
+ZeroTierOneService::ZeroTierOneService() : CServiceBase(ZT_SERVICE_NAME, TRUE, TRUE, FALSE), _service((ZeroTier::OneService*)0)
 {
 #ifdef ZT_DEBUG_SERVICE
 	SVCDBGfile_m.lock();
-	if (!SVCDBGfile)
-		SVCDBGfile = fopen(ZT_DEBUG_SERVICE,"a");
+	if (! SVCDBGfile)
+		SVCDBGfile = fopen(ZT_DEBUG_SERVICE, "a");
 	SVCDBGfile_m.unlock();
 #endif
 
@@ -59,14 +51,13 @@ ZeroTierOneService::~ZeroTierOneService(void)
 	SVCDBGfile_m.lock();
 	if (SVCDBGfile) {
 		fclose(SVCDBGfile);
-		SVCDBGfile = (FILE *)0;
+		SVCDBGfile = (FILE*)0;
 	}
 	SVCDBGfile_m.unlock();
 #endif
 }
 
-void ZeroTierOneService::threadMain()
-	throw()
+void ZeroTierOneService::threadMain() throw()
 {
 	ZT_SVCDBG("ZeroTierOneService::threadMain()\r\n");
 
@@ -75,38 +66,41 @@ restart_node:
 		{
 			ZeroTier::Mutex::Lock _l(_lock);
 			delete _service;
-			_service = (ZeroTier::OneService *)0; // in case newInstance() fails
+			_service = (ZeroTier::OneService*)0;   // in case newInstance() fails
 			_service = ZeroTier::OneService::newInstance(_path.c_str(), ZT_DEFAULT_PORT);
 		}
-		switch(_service->run()) {
+		switch (_service->run()) {
 			case ZeroTier::OneService::ONE_UNRECOVERABLE_ERROR: {
 				std::string err("ZeroTier One encountered an unrecoverable error: ");
 				err.append(_service->fatalErrorMessage());
 				err.append(" (restarting in 5 seconds)");
-				WriteEventLogEntry(const_cast <PSTR>(err.c_str()),EVENTLOG_ERROR_TYPE);
+				WriteEventLogEntry(const_cast<PSTR>(err.c_str()), EVENTLOG_ERROR_TYPE);
 				Sleep(5000);
-			}	goto restart_node;
+			}
+				goto restart_node;
 
 			case ZeroTier::OneService::ONE_IDENTITY_COLLISION: {
 				std::string homeDir(ZeroTier::OneService::platformDefaultHomePath());
 				delete _service;
-				_service = (ZeroTier::OneService *)0;
+				_service = (ZeroTier::OneService*)0;
 				std::string oldid;
-				ZeroTier::OSUtils::readFile((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret").c_str(),oldid);
+				ZeroTier::OSUtils::readFile((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret").c_str(), oldid);
 				if (oldid.length()) {
-					ZeroTier::OSUtils::writeFile((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret.saved_after_collision").c_str(),oldid);
+					ZeroTier::OSUtils::writeFile((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret.saved_after_collision").c_str(), oldid);
 					ZeroTier::OSUtils::rm((homeDir + ZT_PATH_SEPARATOR_S + "identity.secret").c_str());
 					ZeroTier::OSUtils::rm((homeDir + ZT_PATH_SEPARATOR_S + "identity.public").c_str());
 				}
-			}	goto restart_node;
+			}
+				goto restart_node;
 
-			default: // normal termination
+			default:   // normal termination
 				break;
 		}
-	} catch ( ... ) {
+	}
+	catch (...) {
 		// sanity check, shouldn't happen since Node::run() should catch all its own errors
 		// could also happen if we're out of memory though!
-		WriteEventLogEntry("unexpected exception (out of memory?) (trying again in 5 seconds)",EVENTLOG_ERROR_TYPE);
+		WriteEventLogEntry("unexpected exception (out of memory?) (trying again in 5 seconds)", EVENTLOG_ERROR_TYPE);
 		Sleep(5000);
 		goto restart_node;
 	}
@@ -114,23 +108,25 @@ restart_node:
 	{
 		ZeroTier::Mutex::Lock _l(_lock);
 		delete _service;
-		_service = (ZeroTier::OneService *)0;
+		_service = (ZeroTier::OneService*)0;
 	}
 }
 
-void ZeroTierOneService::OnStart(DWORD dwArgc, PSTR *lpszArgv)
+void ZeroTierOneService::OnStart(DWORD dwArgc, PSTR* lpszArgv)
 {
 	ZT_SVCDBG("ZeroTierOneService::OnStart()\r\n");
 
-	if ((dwArgc > 1)&&(lpszArgv[1])&&(strlen(lpszArgv[1]) > 0)) {
+	if ((dwArgc > 1) && (lpszArgv[1]) && (strlen(lpszArgv[1]) > 0)) {
 		this->_path = lpszArgv[1];
-	} else {
+	}
+	else {
 		this->_path = ZeroTier::OneService::platformDefaultHomePath();
 	}
 
 	try {
 		_thread = ZeroTier::Thread::start(this);
-	} catch ( ... ) {
+	}
+	catch (...) {
 		throw (DWORD)ERROR_EXCEPTION_IN_SERVICE;
 	}
 }
@@ -140,7 +136,7 @@ void ZeroTierOneService::OnStop()
 	ZT_SVCDBG("ZeroTierOneService::OnStop()\r\n");
 
 	_lock.lock();
-	ZeroTier::OneService *s = _service;
+	ZeroTier::OneService* s = _service;
 	_lock.unlock();
 
 	if (s) {

+ 34 - 35
windows/ZeroTierOne/ZeroTierOneService.h

@@ -1,69 +1,68 @@
-/*
- * 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/
  */
-/****/
 
 #pragma once
 
 #if defined(_WIN32) || defined(_WIN64)
 
-#include <stdio.h>
-
-#include "ServiceBase.h"
-
-#include <string>
-
 #include "../../node/Mutex.hpp"
 #include "../../osdep/Thread.hpp"
 #include "../../service/OneService.hpp"
+#include "ServiceBase.h"
+
+#include <stdio.h>
+#include <string>
 
 // Uncomment to make debugging Windows services suck slightly less hard.
-//#define ZT_DEBUG_SERVICE "C:\\ZeroTierOneServiceDebugLog.txt"
+// #define ZT_DEBUG_SERVICE "C:\\ZeroTierOneServiceDebugLog.txt"
 
 #ifdef ZT_DEBUG_SERVICE
-extern FILE *SVCDBGfile;
+extern FILE* SVCDBGfile;
 extern ZeroTier::Mutex SVCDBGfile_m;
-#define ZT_SVCDBG(f,...) { SVCDBGfile_m.lock(); fprintf(SVCDBGfile,f,##__VA_ARGS__); fflush(SVCDBGfile); SVCDBGfile_m.unlock(); }
+#define ZT_SVCDBG(f, ...)                                                                                                                                                                                                                      \
+	{                                                                                                                                                                                                                                          \
+		SVCDBGfile_m.lock();                                                                                                                                                                                                                   \
+		fprintf(SVCDBGfile, f, ##__VA_ARGS__);                                                                                                                                                                                                 \
+		fflush(SVCDBGfile);                                                                                                                                                                                                                    \
+		SVCDBGfile_m.unlock();                                                                                                                                                                                                                 \
+	}
 #else
-#define ZT_SVCDBG(f,...) {}
+#define ZT_SVCDBG(f, ...)                                                                                                                                                                                                                      \
+	{                                                                                                                                                                                                                                          \
+	}
 #endif
 
-#define ZT_SERVICE_NAME "ZeroTierOneService"
+#define ZT_SERVICE_NAME			"ZeroTierOneService"
 #define ZT_SERVICE_DISPLAY_NAME "ZeroTier One"
-#define ZT_SERVICE_START_TYPE SERVICE_AUTO_START
+#define ZT_SERVICE_START_TYPE	SERVICE_AUTO_START
 #define ZT_SERVICE_DEPENDENCIES ""
-//#define ZT_SERVICE_ACCOUNT "NT AUTHORITY\\LocalService"
-#define ZT_SERVICE_ACCOUNT NULL
+// #define ZT_SERVICE_ACCOUNT "NT AUTHORITY\\LocalService"
+#define ZT_SERVICE_ACCOUNT	NULL
 #define ZT_SERVICE_PASSWORD NULL
 
-class ZeroTierOneService : public CServiceBase
-{
-public:
-    ZeroTierOneService();
-    virtual ~ZeroTierOneService(void);
+class ZeroTierOneService : public CServiceBase {
+  public:
+	ZeroTierOneService();
+	virtual ~ZeroTierOneService(void);
 
 	/**
 	 * Thread main method; do not call elsewhere
 	 */
-	void threadMain()
-		throw();
+	void threadMain() throw();
 
-protected:
-	virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
+  protected:
+	virtual void OnStart(DWORD dwArgc, PSTR* pszArgv);
 	virtual void OnStop();
 	virtual void OnShutdown();
 
-private:
+  private:
 	std::string _path;
-	ZeroTier::OneService *volatile _service;
+	ZeroTier::OneService* volatile _service;
 	ZeroTier::Mutex _lock;
 	ZeroTier::Thread _thread;
 };

Some files were not shown because too many files changed in this diff