Temporarily removed DNS support to prevent TLS h_errno conflict. Updated CMakeLists

This commit is contained in:
Joseph Henry
2017-12-07 16:45:02 -08:00
parent 78bf7c3a1f
commit de0ce73023
5 changed files with 13 additions and 7 deletions

View File

@@ -53,9 +53,10 @@ include_directories("${PROJ_DIR}/zto/node")
include_directories("${PROJ_DIR}/zto/service") include_directories("${PROJ_DIR}/zto/service")
file(GLOB zto_src_glob "${ZTO_SRC_DIR}/node/*.cpp" "${ZTO_SRC_DIR}/service/*.cpp" "${ZTO_SRC_DIR}/osdep/OSUtils.cpp" "${ZTO_SRC_DIR}/controller/*.cpp" "${ZTO_SRC_DIR}/osdep/ManagedRoute.cpp") file(GLOB zto_src_glob "${ZTO_SRC_DIR}/node/*.cpp" "${ZTO_SRC_DIR}/service/*.cpp" "${ZTO_SRC_DIR}/osdep/OSUtils.cpp" "${ZTO_SRC_DIR}/controller/*.cpp" "${ZTO_SRC_DIR}/osdep/ManagedRoute.cpp")
add_library(zto ${zto_src_glob}) add_library(zto ${zto_src_glob})
add_dependencies(zto zt)
add_library(httpparser "${ZTO_SRC_DIR}/ext/http-parser/http_parser.c") add_library(httpparser "${ZTO_SRC_DIR}/ext/http-parser/http_parser.c")
target_compile_options(zto PRIVATE -std=c++11 -DZT_SDK=1) target_compile_options(zto PRIVATE -std=c++11 -DZT_SDK=1)
target_link_libraries(zto httpparser) target_link_libraries(zto httpparser zt)
# libzt # libzt
set(LIBZT_SRC_DIR ${PROJ_DIR}/src) set(LIBZT_SRC_DIR ${PROJ_DIR}/src)
@@ -63,7 +64,6 @@ include_directories("${LIBZT_SRC_DIR}")
include_directories("${PROJ_DIR}/include") include_directories("${PROJ_DIR}/include")
file(GLOB libzt_src_glob ${LIBZT_SRC_DIR}/*.cpp) file(GLOB libzt_src_glob ${LIBZT_SRC_DIR}/*.cpp)
add_library(zt ${libzt_src_glob}) add_library(zt ${libzt_src_glob})
add_dependencies(zt zto)
target_compile_options(zt PRIVATE -std=c++11 -DZT_SDK=1 -DLIBZT_TRACE=1) target_compile_options(zt PRIVATE -std=c++11 -DZT_SDK=1 -DLIBZT_TRACE=1)
target_link_libraries(zt zto) target_link_libraries(zt zto)
target_link_libraries(zt lwip) target_link_libraries(zt lwip)

View File

@@ -225,7 +225,7 @@ public:
Mutex _pico_frame_rxbuf_m; Mutex _pico_frame_rxbuf_m;
#endif #endif
std::vector<std::pair<ZeroTier::InetAddress, ZeroTier::InetAddress>> routes; std::vector<std::pair<ZeroTier::InetAddress, ZeroTier::InetAddress> > routes;
void *zt1ServiceRef = NULL; void *zt1ServiceRef = NULL;
char vtap_full_name[64]; char vtap_full_name[64];

View File

@@ -514,7 +514,7 @@ happening sooner than they should.
* LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
* transport. * transport.
*/ */
#define LWIP_DNS 1 #define LWIP_DNS 0
#define LWIP_DNS_API_DECLARE_H_ERRNO 1 #define LWIP_DNS_API_DECLARE_H_ERRNO 1
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------

View File

@@ -36,7 +36,7 @@
#include "lwip/sockets.h" #include "lwip/sockets.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/netdb.h" #include "lwip/netdb.h"
#include "dns.h" //#include "dns.h"
#endif #endif
#if defined(NO_STACK) #if defined(NO_STACK)
#include <sys/socket.h> #include <sys/socket.h>
@@ -291,6 +291,7 @@ int zts_sethostname(const char *name, size_t len)
#endif #endif
} }
/*
struct hostent *zts_gethostbyname(const char *name) struct hostent *zts_gethostbyname(const char *name)
{ {
if (zts_ready() == false) { if (zts_ready() == false) {
@@ -302,7 +303,7 @@ struct hostent *zts_gethostbyname(const char *name)
#endif #endif
#if defined(ZT_LWIP_SEQ_SOCKET) #if defined(ZT_LWIP_SEQ_SOCKET)
// TODO: Test thread safety // TODO: Test thread safety
/*
char buf[256]; char buf[256];
int buflen = 256; int buflen = 256;
int h_err = 0; int h_err = 0;
@@ -316,7 +317,7 @@ struct hostent *zts_gethostbyname(const char *name)
return NULL; // failure return NULL; // failure
} }
return *result; return *result;
*/
return lwip_gethostbyname(name); return lwip_gethostbyname(name);
#endif #endif
#if defined(ZT_PICO_BSD_SOCKET) #if defined(ZT_PICO_BSD_SOCKET)
@@ -325,6 +326,7 @@ struct hostent *zts_gethostbyname(const char *name)
#endif #endif
return NULL; return NULL;
} }
*/
int zts_close(int fd) int zts_close(int fd)
{ {
@@ -606,6 +608,7 @@ int zts_shutdown(int fd, int how)
#endif #endif
} }
/*
int zts_add_dns_nameserver(struct sockaddr *addr) int zts_add_dns_nameserver(struct sockaddr *addr)
{ {
DEBUG_EXTRA(); DEBUG_EXTRA();
@@ -646,6 +649,7 @@ int zts_del_dns_nameserver(struct sockaddr *addr)
return -1; return -1;
#endif #endif
} }
*/
/* The rationale for the following correctional methods is as follows: /* The rationale for the following correctional methods is as follows:

View File

@@ -280,10 +280,12 @@ void lwip_eth_rx(VirtualTap *tap, const ZeroTier::MAC &from, const ZeroTier::MAC
} }
} }
/*
void lwip_dns_init() void lwip_dns_init()
{ {
dns_init(); dns_init();
} }
*/
void lwip_start_dhcp(void *netif) void lwip_start_dhcp(void *netif)
{ {