mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
add ifname4 and ifname6 options
This commit is contained in:
parent
006e4526e8
commit
a92652f4ad
2 changed files with 20 additions and 2 deletions
|
@ -74,6 +74,22 @@ namespace i2p
|
|||
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash ());
|
||||
routerInfo.AddNTCPAddress (host.c_str(), port);
|
||||
}
|
||||
|
||||
std::string ifname4; i2p::config::GetOption("ifname4", ifname4);
|
||||
if(ifname4.size())
|
||||
{
|
||||
std::string host = i2p::util::net::GetInterfaceAddress(ifname4, false).to_string();
|
||||
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash());
|
||||
routerInfo.AddNTCPAddress (host.c_str(), port);
|
||||
}
|
||||
std::string ifname6; i2p::config::GetOption("ifname6", ifname6);
|
||||
if (ifname6.size())
|
||||
{
|
||||
std::string host = i2p::util::net::GetInterfaceAddress(ifname6, true).to_string();
|
||||
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash());
|
||||
routerInfo.AddNTCPAddress (host.c_str(), port);
|
||||
}
|
||||
|
||||
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |
|
||||
i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer); // LR, BC
|
||||
routerInfo.SetProperty ("netId", std::to_string (m_NetID));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue