|
@@ -45,9 +45,6 @@
|
|
#define ZT_TCP_PROXY_UDP_POOL_START_PORT 10000
|
|
#define ZT_TCP_PROXY_UDP_POOL_START_PORT 10000
|
|
#define ZT_TCP_PROXY_CONNECTION_TIMEOUT_SECONDS 300
|
|
#define ZT_TCP_PROXY_CONNECTION_TIMEOUT_SECONDS 300
|
|
|
|
|
|
-// Uncomment to print tracing output to stdout
|
|
|
|
-#define ZT_TCP_PROXY_TRACE
|
|
|
|
-
|
|
|
|
using namespace ZeroTier;
|
|
using namespace ZeroTier;
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -138,10 +135,6 @@ struct TcpProxyService
|
|
if (rm != reverseMappings.end()) {
|
|
if (rm != reverseMappings.end()) {
|
|
Client &c = *(rm->second);
|
|
Client &c = *(rm->second);
|
|
|
|
|
|
-#ifdef ZT_TCP_PROXY_TRACE
|
|
|
|
- printf("UDP [%u] %s >> %.16llx\n",len,reinterpret_cast<const InetAddress *>(from)->toString().c_str(),(unsigned long long)&c);
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
unsigned long mlen = len;
|
|
unsigned long mlen = len;
|
|
if (c.newVersion)
|
|
if (c.newVersion)
|
|
mlen += 7; // new clients get IP info
|
|
mlen += 7; // new clients get IP info
|
|
@@ -168,10 +161,6 @@ struct TcpProxyService
|
|
for(unsigned long i=0;i<len;++i)
|
|
for(unsigned long i=0;i<len;++i)
|
|
c.tcpWriteBuf[c.tcpWritePtr++] = ((const char *)data)[i];
|
|
c.tcpWriteBuf[c.tcpWritePtr++] = ((const char *)data)[i];
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
-#ifdef ZT_TCP_PROXY_TRACE
|
|
|
|
- printf("UDP [%u] %s >> (unknown, discarded)\n",len,reinterpret_cast<const InetAddress *>(from)->toString().c_str());
|
|
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -191,10 +180,6 @@ struct TcpProxyService
|
|
c.lastActivity = time((time_t *)0);
|
|
c.lastActivity = time((time_t *)0);
|
|
c.newVersion = false;
|
|
c.newVersion = false;
|
|
*uptrN = (void *)&c;
|
|
*uptrN = (void *)&c;
|
|
-
|
|
|
|
-#ifdef ZT_TCP_PROXY_TRACE
|
|
|
|
- printf("TCP connect from %s -> %.16llx\n",reinterpret_cast<const InetAddress *>(from)->toString().c_str(),(unsigned long long)&c);
|
|
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
|
|
|
|
void phyOnTcpClose(PhySocket *sock,void **uptr)
|
|
void phyOnTcpClose(PhySocket *sock,void **uptr)
|