tweaks for Windows cmake build

This commit is contained in:
joseph.henry
2018-01-30 17:27:40 -08:00
parent cc52c3c59c
commit 2c5634343a
15 changed files with 336 additions and 267 deletions

View File

@@ -150,7 +150,7 @@ bool VirtualTap::addIp(const InetAddress &ip)
bool VirtualTap::removeIp(const InetAddress &ip)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
Mutex::Lock _l(_ips_m);
std::vector<InetAddress>::iterator i(std::find(_ips.begin(),_ips.end(),ip));
//if (i == _ips.end()) {
@@ -257,12 +257,12 @@ void VirtualTap::threadMain()
void VirtualTap::phyOnUnixClose(PhySocket *sock, void **uptr)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
}
void VirtualTap::phyOnUnixData(PhySocket *sock, void **uptr, void *data, ssize_t len)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
#if defined(LIBZT_RAW)
VirtualSocket *vs = (VirtualSocket*)*uptr;
if (vs == NULL) {
@@ -276,7 +276,7 @@ void VirtualTap::phyOnUnixData(PhySocket *sock, void **uptr, void *data, ssize_t
void VirtualTap::phyOnUnixWritable(PhySocket *sock, void **uptr, bool stack_invoked)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
#if defined(LIBZT_RAW)
if (sock) {
Read(sock,uptr,stack_invoked);
@@ -289,7 +289,7 @@ void VirtualTap::phyOnUnixWritable(PhySocket *sock, void **uptr, bool stack_invo
bool VirtualTap::routeAdd(const InetAddress &ip, const InetAddress &nm, const InetAddress &gw)
{
bool err = false;
DEBUG_EXTRA();
DEBUG_EXTRA("");
#if defined(STACK_LWIP)
// general_lwip_init_interface(this, NULL, "n1", _mac, ip, nm, gw);
// general_turn_on_interface(NULL);
@@ -307,7 +307,7 @@ bool VirtualTap::routeAdd(const InetAddress &ip, const InetAddress &nm, const In
bool VirtualTap::routeDelete(const InetAddress &ip, const InetAddress &nm)
{
bool err = false;
DEBUG_EXTRA();
DEBUG_EXTRA("");
#if defined(STACK_LWIP)
// general_lwip_init_interface(this, NULL, "n1", _mac, ip, nm, gw);
// general_turn_on_interface(NULL);
@@ -325,7 +325,7 @@ bool VirtualTap::routeDelete(const InetAddress &ip, const InetAddress &nm)
void VirtualTap::addVirtualSocket(VirtualSocket *vs)
{
#if defined(LIBZT_RAW)
DEBUG_EXTRA();
DEBUG_EXTRA("");
Mutex::Lock _l(_tcpconns_m);
_VirtualSockets.push_back(vs);
#endif
@@ -334,7 +334,7 @@ void VirtualTap::addVirtualSocket(VirtualSocket *vs)
void VirtualTap::removeVirtualSocket()
{
#if defined(LIBZT_RAW)
DEBUG_EXTRA();
DEBUG_EXTRA("");
Mutex::Lock _l(_tcpconns_m);
for (int i=0; i<_VirtualSockets.size(); i++) {
if (vs == _VirtualSockets[i]) {

View File

@@ -170,7 +170,7 @@ VirtualTap *getAnyTap()
uint64_t zts_get_node_id_from_file(const char *filepath)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
std::string fname("identity.public");
std::string fpath(filepath);
std::string oldid;
@@ -362,7 +362,7 @@ void zts_get_rfc4193_addr(struct sockaddr_storage *addr, const uint64_t nwid, co
int zts_join(const uint64_t nwid)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (nwid == 0) {
return -1;
}
@@ -382,7 +382,7 @@ int zts_join(const uint64_t nwid)
int zts_leave(const uint64_t nwid)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (nwid == 0) {
return -1;
}
@@ -413,7 +413,7 @@ int zts_ready()
int zts_start(const char *path, bool blocking = false)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zt1Service) {
return 0; // already initialized, ok
}
@@ -448,7 +448,7 @@ int zts_start(const char *path, bool blocking = false)
int zts_startjoin(const char *path, const uint64_t nwid)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
int err = zts_start(path, true);
while (true) {
try {
@@ -468,7 +468,7 @@ int zts_startjoin(const char *path, const uint64_t nwid)
void zts_stop()
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zt1Service) {
zt1Service->terminate();
// disableTaps();
@@ -480,7 +480,7 @@ void zts_stop()
void zts_get_path(char *homePath, size_t len)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (homeDir.length()) {
memset(homePath, 0, len);
size_t buf_len = len < homeDir.length() ? len : homeDir.length();
@@ -490,7 +490,7 @@ void zts_get_path(char *homePath, size_t len)
uint64_t zts_get_node_id()
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zt1Service) {
return zt1Service->getNode()->address();
}
@@ -499,7 +499,7 @@ uint64_t zts_get_node_id()
unsigned long zts_get_peer_count()
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zt1Service) {
return zt1Service->getNode()->peers()->peerCount;
}
@@ -510,7 +510,7 @@ unsigned long zts_get_peer_count()
int zts_get_peer_address(char *peer, const uint64_t nodeId)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zt1Service) {
ZT_PeerList *pl = zt1Service->getNode()->peers();
// uint64_t addr;
@@ -527,7 +527,7 @@ int zts_get_peer_address(char *peer, const uint64_t nodeId)
void zts_allow_http_control(bool allowed)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
// TODO
}

View File

@@ -257,7 +257,7 @@ int zts_getpeername(int fd, struct sockaddr *addr, socklen_t *addrlen)
int zts_gethostname(char *name, size_t len)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zts_ready() == false) {
DEBUG_ERROR("service not started yet, call zts_startjoin()");
return -1;
@@ -275,7 +275,7 @@ int zts_gethostname(char *name, size_t len)
int zts_sethostname(const char *name, size_t len)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zts_ready() == false) {
DEBUG_ERROR("service not started yet, call zts_startjoin()");
return -1;
@@ -373,7 +373,7 @@ int zts_poll(struct pollfd *fds, nfds_t nfds, int timeout)
int zts_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
struct timeval *timeout)
{
//DEBUG_EXTRA();
//DEBUG_EXTRA("");
/*
if (zts_ready() == false) {
DEBUG_ERROR("service not started yet, call zts_startjoin()");
@@ -611,7 +611,7 @@ int zts_shutdown(int fd, int how)
int zts_add_dns_nameserver(struct sockaddr *addr)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zts_ready() == false) {
DEBUG_ERROR("service not started yet, call zts_startjoin()");
return -1;
@@ -634,7 +634,7 @@ int zts_add_dns_nameserver(struct sockaddr *addr)
int zts_del_dns_nameserver(struct sockaddr *addr)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
if (zts_ready() == false) {
DEBUG_ERROR("service not started yet, call zts_startjoin()");
return -1;

View File

@@ -90,7 +90,7 @@ err_t tapif_init(struct netif *netif)
/*
static void tcp_timeout(void *data)
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
LWIP_UNUSED_ARG(data);
#if TCP_DEBUG && LWIP_TCP
// tcp_debug_print_pcbs();
@@ -129,7 +129,7 @@ static void main_thread(void *arg)
// initialize the lwIP stack
void lwip_driver_init()
{
DEBUG_EXTRA();
DEBUG_EXTRA("");
driver_m.lock(); // unlocked from callback indicating completion of driver init
if (lwip_driver_initialized == true) {
return;