mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
show local SSU2 address
This commit is contained in:
parent
f184f550b9
commit
6eba061c2a
4 changed files with 19 additions and 8 deletions
|
@ -346,7 +346,12 @@ namespace i2p
|
|||
}
|
||||
if (enable && !found)
|
||||
{
|
||||
m_RouterInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey);
|
||||
uint8_t addressCaps = 0;
|
||||
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
|
||||
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
|
||||
if (ipv4) addressCaps |= i2p::data::RouterInfo::AddressCaps::eV4;
|
||||
if (ipv6) addressCaps |= i2p::data::RouterInfo::AddressCaps::eV6;
|
||||
m_RouterInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, addressCaps);
|
||||
updated = true;
|
||||
}
|
||||
if (updated)
|
||||
|
|
|
@ -631,11 +631,11 @@ namespace data
|
|||
m_Addresses->push_back(std::move(addr));
|
||||
}
|
||||
|
||||
void RouterInfo::AddSSU2Address (const uint8_t * staticKey)
|
||||
void RouterInfo::AddSSU2Address (const uint8_t * staticKey, uint8_t caps)
|
||||
{
|
||||
auto addr = std::make_shared<Address>();
|
||||
addr->transportStyle = eTransportSSU2;
|
||||
addr->caps = 0;
|
||||
addr->caps = caps;
|
||||
addr->date = 0;
|
||||
memcpy (addr->s, staticKey, 32);
|
||||
m_Addresses->push_back(std::move(addr));
|
||||
|
|
|
@ -190,7 +190,7 @@ namespace data
|
|||
void AddSSUAddress (const char * host, int port, const uint8_t * key, int mtu = 0);
|
||||
void AddNTCP2Address (const uint8_t * staticKey, const uint8_t * iv,
|
||||
const boost::asio::ip::address& host = boost::asio::ip::address(), int port = 0, uint8_t caps = 0);
|
||||
void AddSSU2Address (const uint8_t * staticKey); // non published
|
||||
void AddSSU2Address (const uint8_t * staticKey, uint8_t caps = 0); // non published
|
||||
bool AddIntroducer (const Introducer& introducer);
|
||||
bool RemoveIntroducer (const boost::asio::ip::udp::endpoint& e);
|
||||
void SetUnreachableAddressesTransportCaps (uint8_t transports); // bitmask of AddressCaps
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue