/* * Copyright (c)2013-2021 ZeroTier, Inc. * * Use of this software is governed by the Business Source License included * in the LICENSE.TXT file in the project's root directory. * * Change Date: 2026-01-01 * * On the date above, in accordance with the Business Source License, use * of this software will be governed by version 2.0 of the Apache License. */ /****/ #include #include #include /********************************************************************************************************************/ #ifdef __APPLE__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* These complex macros don't translate well with Rust bindgen, so compute * them with the C compiler and export them. */ extern const unsigned long c_BIOCSBLEN; extern const unsigned long c_BIOCIMMEDIATE; extern const unsigned long c_BIOCSSEESENT; extern const unsigned long c_BIOCSETIF; extern const unsigned long c_BIOCSHDRCMPLT; extern const unsigned long c_BIOCPROMISC; extern const unsigned long c_SIOCGIFINFO_IN6; extern const unsigned long c_SIOCSIFINFO_FLAGS; extern const unsigned long c_SIOCAUTOCONF_START; extern const unsigned long c_SIOCAUTOCONF_STOP; #ifdef __cplusplus } #endif #ifndef IPV6_DONTFRAG #define IPV6_DONTFRAG 62 #endif #endif /* __APPLE__ */ /********************************************************************************************************************/ #if defined(__linux__) || defined(linux) || defined(__LINUX__) || defined(__linux) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* __linux__ */ /********************************************************************************************************************/ #ifdef __cplusplus extern "C" { #endif extern const char *platformDefaultHomePath(); extern int64_t msSinceEpoch(); extern void lockDownFile(const char *path, int isDir); extern void getSecureRandom(void *buf, unsigned int len); extern void sha384(const void *in, unsigned int len, void *out); extern void sha512(const void *in, unsigned int len, void *out); extern void encryptHttpAuthNonce(void *block); extern void decryptHttpAuthNonce(void *block); #ifdef __cplusplus } #endif