mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 05:13:58 -07:00
Rest -> MPL except controller.
This commit is contained in:
parent
9aff094b6f
commit
f6d52dd96c
57 changed files with 2411 additions and 2371 deletions
|
@ -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
Load diff
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 creates a pair of feth devices with the lower numbered device
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 "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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
Load diff
|
@ -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)]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,19 +1,9 @@
|
|||
/*
|
||||
* ZeroTier One - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
|
||||
/* 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/.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* (c) ZeroTier, Inc.
|
||||
* https://www.zerotier.com/
|
||||
*/
|
||||
|
||||
// HACK! Will eventually use epoll() or something in Phy<> instead of select().
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue