mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-20 05:28:01 +00:00
Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev
This commit is contained in:
commit
70efa5f606
@ -1031,25 +1031,21 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
|||||||
|
|
||||||
if (b.count("dns")) {
|
if (b.count("dns")) {
|
||||||
json &dns = b["dns"];
|
json &dns = b["dns"];
|
||||||
if (dns.is_array()) {
|
if (dns.is_object()) {
|
||||||
json nda = json::array();
|
json nd;
|
||||||
for(unsigned int i=0;i<dns.size();++i) {
|
|
||||||
json &d = dns[i];
|
nd["domain"] = dns["domain"];
|
||||||
if (d.is_object()) {
|
|
||||||
json nd = json::object();
|
json &srv = dns["servers"];
|
||||||
nd["domain"] = d["domain"];
|
if (srv.is_array()) {
|
||||||
json &srv = d["servers"];
|
json ns = json::array();
|
||||||
if (srv.is_array()) {
|
for(unsigned int i=0;i<srv.size();++i) {
|
||||||
json ns = json::array();
|
ns.push_back(srv[i]);
|
||||||
for(unsigned int j=0;j<srv.size();++j) {
|
|
||||||
ns.push_back(srv[i]);
|
|
||||||
}
|
|
||||||
nd["servers"] = ns;
|
|
||||||
}
|
|
||||||
nda.push_back(nd);
|
|
||||||
}
|
}
|
||||||
|
nd["servers"] = ns;
|
||||||
}
|
}
|
||||||
network["dns"] = nda;
|
|
||||||
|
network["dns"] = nd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,10 +11,22 @@ LOCAL_C_INCLUDES := \
|
|||||||
LOCAL_LDLIBS := -llog
|
LOCAL_LDLIBS := -llog
|
||||||
# LOCAL_CFLAGS := -g
|
# LOCAL_CFLAGS := -g
|
||||||
|
|
||||||
|
APP_UNIFIED_HEADERS := true
|
||||||
|
|
||||||
LOCAL_CFLAGS := -DZT_USE_MINIUPNPC
|
LOCAL_CFLAGS := -DZT_USE_MINIUPNPC
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),x86_64)
|
||||||
|
LOCAL_CXXFLAGS := -maes -mpclmul -msse4.1
|
||||||
|
endif
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||||
|
LOCAL_ARM_NEON := true
|
||||||
|
LOCAL_CXXFLAGS := -march=armv8-a+crypto -mfloat-abi=softfp -mfpu=neon -maes -isystem $NDK/sysroot/usr/include/$TRIPLE
|
||||||
|
endif
|
||||||
|
|
||||||
# ZeroTierOne SDK source files
|
# ZeroTierOne SDK source files
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
|
$(ZT1)/node/AES.cpp \
|
||||||
|
$(ZT1)/node/Bond.cpp \
|
||||||
|
$(ZT1)/node/BondController.cpp \
|
||||||
$(ZT1)/node/C25519.cpp \
|
$(ZT1)/node/C25519.cpp \
|
||||||
$(ZT1)/node/Capability.cpp \
|
$(ZT1)/node/Capability.cpp \
|
||||||
$(ZT1)/node/CertificateOfMembership.cpp \
|
$(ZT1)/node/CertificateOfMembership.cpp \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# NDK_TOOLCHAIN_VERSION := clang3.5
|
# NDK_TOOLCHAIN_VERSION := clang3.5
|
||||||
APP_STL := c++_static
|
APP_STL := c++_static
|
||||||
APP_CPPFLAGS := -Wall -fstack-protector -fexceptions -fno-strict-aliasing -frtti -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
|
APP_CPPFLAGS := -Wall -fstack-protector -fexceptions -fno-strict-aliasing -frtti -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
|
||||||
APP_PLATFORM := android-14
|
APP_PLATFORM := android-21
|
||||||
APP_ABI := all
|
APP_ABI := all
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <arm_neon.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define Te1_r(x) ZT_ROR32(Te0[x], 8U)
|
#define Te1_r(x) ZT_ROR32(Te0[x], 8U)
|
||||||
#define Te2_r(x) ZT_ROR32(Te0[x], 16U)
|
#define Te2_r(x) ZT_ROR32(Te0[x], 16U)
|
||||||
#define Te3_r(x) ZT_ROR32(Te0[x], 24U)
|
#define Te3_r(x) ZT_ROR32(Te0[x], 24U)
|
||||||
|
@ -111,13 +111,21 @@
|
|||||||
#include <mmintrin.h>
|
#include <mmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(ZT_ARCH_ARM_HAS_NEON))
|
#if (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(ZT_ARCH_ARM_HAS_NEON))
|
||||||
|
#if (defined(__APPLE__) && !defined(__LP64__)) || (defined(__ANDROID__) && defined(__arm__))
|
||||||
|
#ifdef ZT_ARCH_ARM_HAS_NEON
|
||||||
|
#undef ZT_ARCH_ARM_HAS_NEON
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
#ifndef ZT_ARCH_ARM_HAS_NEON
|
#ifndef ZT_ARCH_ARM_HAS_NEON
|
||||||
#define ZT_ARCH_ARM_HAS_NEON 1
|
#define ZT_ARCH_ARM_HAS_NEON 1
|
||||||
#endif
|
#endif
|
||||||
#include <arm_neon.h>
|
#include <arm_neon.h>
|
||||||
/*#include <arm_acle.h>*/
|
/*#include <arm_acle.h>*/
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// Define ZT_NO_TYPE_PUNNING to disable reckless casts on anything other than x86/x64.
|
// Define ZT_NO_TYPE_PUNNING to disable reckless casts on anything other than x86/x64.
|
||||||
#if (!(defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || defined(i386) || defined(__i386) || defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(_M_IX86) || defined(__X86__) || defined(_X86_) || defined(__I86__) || defined(__INTEL__) || defined(__386)))
|
#if (!(defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || defined(i386) || defined(__i386) || defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(_M_IX86) || defined(__X86__) || defined(_X86_) || defined(__I86__) || defined(__INTEL__) || defined(__386)))
|
||||||
|
@ -42,6 +42,14 @@
|
|||||||
#include "Mutex.hpp"
|
#include "Mutex.hpp"
|
||||||
#include "Salsa20.hpp"
|
#include "Salsa20.hpp"
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <TargetConditionals.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__ANDROID__) && defined(__aarch64__)
|
||||||
|
#include <asm/hwcap.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
|
||||||
const uint64_t Utils::ZERO256[4] = {0ULL,0ULL,0ULL,0ULL};
|
const uint64_t Utils::ZERO256[4] = {0ULL,0ULL,0ULL,0ULL};
|
||||||
@ -51,6 +59,13 @@ const char Utils::HEXCHARS[16] = { '0','1','2','3','4','5','6','7','8','9','a','
|
|||||||
#ifdef ZT_ARCH_ARM_HAS_NEON
|
#ifdef ZT_ARCH_ARM_HAS_NEON
|
||||||
Utils::ARMCapabilities::ARMCapabilities() noexcept
|
Utils::ARMCapabilities::ARMCapabilities() noexcept
|
||||||
{
|
{
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
this->aes = true;
|
||||||
|
this->crc32 = true;
|
||||||
|
this->pmull = true;
|
||||||
|
this->sha1 = true;
|
||||||
|
this->sha2 = true;
|
||||||
|
#else
|
||||||
#ifdef HWCAP2_AES
|
#ifdef HWCAP2_AES
|
||||||
if (sizeof(void *) == 4) {
|
if (sizeof(void *) == 4) {
|
||||||
const long hwcaps2 = getauxval(AT_HWCAP2);
|
const long hwcaps2 = getauxval(AT_HWCAP2);
|
||||||
@ -70,6 +85,7 @@ Utils::ARMCapabilities::ARMCapabilities() noexcept
|
|||||||
#ifdef HWCAP2_AES
|
#ifdef HWCAP2_AES
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif // TARGET_OS_IPHONE
|
||||||
}
|
}
|
||||||
|
|
||||||
const Utils::ARMCapabilities Utils::ARMCAP;
|
const Utils::ARMCapabilities Utils::ARMCAP;
|
||||||
|
@ -272,7 +272,8 @@ tapReadConfiguration(
|
|||||||
|
|
||||||
if (status == NDIS_STATUS_SUCCESS)
|
if (status == NDIS_STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
if (configParameter->ParameterType == NdisParameterString)
|
if (configParameter->ParameterType == NdisParameterString
|
||||||
|
&& configParameter->ParameterData.StringData.Length <= sizeof(Adapter->NetCfgInstanceIdBuffer) - sizeof(WCHAR))
|
||||||
{
|
{
|
||||||
DEBUGP (("[TAP] NdisReadConfiguration (NetCfgInstanceId=%wZ)\n",
|
DEBUGP (("[TAP] NdisReadConfiguration (NetCfgInstanceId=%wZ)\n",
|
||||||
&configParameter->ParameterData.StringData ));
|
&configParameter->ParameterData.StringData ));
|
||||||
|
Loading…
Reference in New Issue
Block a user