|
|
@ -92,7 +92,7 @@ namespace i2p |
|
|
|
if (!ntcp2proxy.empty ()) ntcp2Published = false; |
|
|
|
if (!ntcp2proxy.empty ()) ntcp2Published = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
uint8_t caps = 0; |
|
|
|
uint8_t caps = 0, addressCaps = 0; |
|
|
|
if (ipv4) |
|
|
|
if (ipv4) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string host = "127.0.0.1"; |
|
|
|
std::string host = "127.0.0.1"; |
|
|
@ -109,8 +109,11 @@ namespace i2p |
|
|
|
if (ntcp2Published) |
|
|
|
if (ntcp2Published) |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, boost::asio::ip::address_v4::from_string (host), port); |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, boost::asio::ip::address_v4::from_string (host), port); |
|
|
|
else // add non-published NTCP2 address
|
|
|
|
else // add non-published NTCP2 address
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
addressCaps = i2p::data::RouterInfo::AddressCaps::eV4; |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv); |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (ssu) |
|
|
|
if (ssu) |
|
|
|
{ |
|
|
|
{ |
|
|
|
routerInfo.AddSSUAddress (host.c_str(), port, nullptr); |
|
|
|
routerInfo.AddSSUAddress (host.c_str(), port, nullptr); |
|
|
@ -138,8 +141,12 @@ namespace i2p |
|
|
|
ntcp2Host = host; |
|
|
|
ntcp2Host = host; |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, boost::asio::ip::address_v6::from_string (ntcp2Host), port); |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, boost::asio::ip::address_v6::from_string (ntcp2Host), port); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (!ipv4) // no other ntcp2 addresses yet
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!ipv4) // no other ntcp2 addresses yet
|
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv); |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv); |
|
|
|
|
|
|
|
addressCaps |= i2p::data::RouterInfo::AddressCaps::eV6; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (ssu) |
|
|
|
if (ssu) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -154,6 +161,8 @@ namespace i2p |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, yggaddr, port); |
|
|
|
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, yggaddr, port); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (addressCaps) |
|
|
|
|
|
|
|
routerInfo.SetUnreachableAddressesTransportCaps (addressCaps); |
|
|
|
routerInfo.SetCaps (caps); // caps + L
|
|
|
|
routerInfo.SetCaps (caps); // caps + L
|
|
|
|
routerInfo.SetProperty ("netId", std::to_string (m_NetID)); |
|
|
|
routerInfo.SetProperty ("netId", std::to_string (m_NetID)); |
|
|
|
routerInfo.SetProperty ("router.version", I2P_VERSION); |
|
|
|
routerInfo.SetProperty ("router.version", I2P_VERSION); |
|
|
@ -494,7 +503,6 @@ namespace i2p |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (supportsV6) |
|
|
|
if (supportsV6) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_RouterInfo.EnableV6 (); |
|
|
|
|
|
|
|
// insert v6 addresses if necessary
|
|
|
|
// insert v6 addresses if necessary
|
|
|
|
bool foundSSU = false, foundNTCP2 = false; |
|
|
|
bool foundSSU = false, foundNTCP2 = false; |
|
|
|
uint16_t port = 0; |
|
|
|
uint16_t port = 0; |
|
|
@ -538,6 +546,7 @@ namespace i2p |
|
|
|
m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, boost::asio::ip::address::from_string (ntcp2Host), ntcp2Port); |
|
|
|
m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, boost::asio::ip::address::from_string (ntcp2Host), ntcp2Port); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
m_RouterInfo.EnableV6 (); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
m_RouterInfo.DisableV6 (); |
|
|
|
m_RouterInfo.DisableV6 (); |
|
|
|