added java example

This commit is contained in:
Joseph Henry
2017-05-04 13:06:39 -07:00
parent 64f2634960
commit 890e32e88b
29 changed files with 673 additions and 75 deletions

View File

@@ -92,10 +92,23 @@ namespace ZeroTier {
bool SocketTap::addIp(const InetAddress &ip)
{
if(picostack) {
DEBUG_INFO("addr = %s", ip.toString().c_str());
picostack->pico_init_interface(this, ip);
_ips.push_back(ip);
if(picostack) {
if(ip.isV4())
{
#if defined(SDK_IPV4)
DEBUG_INFO("addr = %s", ip.toString().c_str());
picostack->pico_init_interface(this, ip);
_ips.push_back(ip);
#endif
}
if(ip.isV6())
{
#if defined(SDK_IPV6)
DEBUG_INFO("addr = %s", ip.toString().c_str());
picostack->pico_init_interface(this, ip);
_ips.push_back(ip);
#endif
}
std::sort(_ips.begin(),_ips.end());
return true;
}