mirror of https://github.com/oxen-io/lokinet
fix up names of functions to be less hidious.
This commit is contained in:
parent
1ee545d6d2
commit
0600f42814
|
@ -742,7 +742,7 @@ namespace llarp
|
|||
return false;
|
||||
}
|
||||
|
||||
const auto maybe = GetInterfaceIP6(m_IfName);
|
||||
const auto maybe = GetInterfaceIPv6Address(m_IfName);
|
||||
if (maybe.has_value())
|
||||
{
|
||||
m_OurIP6 = *maybe;
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace llarp
|
|||
}
|
||||
else
|
||||
{
|
||||
if (const auto maybe = GetIFAddr(ifname, af))
|
||||
if (const auto maybe = GetInterfaceAddr(ifname, af))
|
||||
{
|
||||
m_ourAddr = *maybe;
|
||||
}
|
||||
|
|
|
@ -546,7 +546,7 @@ namespace llarp
|
|||
}
|
||||
|
||||
std::optional<IpAddress>
|
||||
GetIFAddr(const std::string& ifname, int af)
|
||||
GetInterfaceAddr(const std::string& ifname, int af)
|
||||
{
|
||||
sockaddr_storage s;
|
||||
sockaddr* sptr = (sockaddr*)&s;
|
||||
|
@ -558,7 +558,7 @@ namespace llarp
|
|||
}
|
||||
|
||||
std::optional<huint128_t>
|
||||
GetInterfaceIP6(std::string ifname)
|
||||
GetInterfaceIPv6Address(std::string ifname)
|
||||
{
|
||||
sockaddr_storage s;
|
||||
sockaddr* sptr = (sockaddr*)&s;
|
||||
|
|
|
@ -75,17 +75,17 @@ namespace llarp
|
|||
|
||||
/// get network interface address for network interface with ifname
|
||||
std::optional<IpAddress>
|
||||
GetIFAddr(const std::string& ifname, int af = AF_INET);
|
||||
GetInterfaceAddr(const std::string& ifname, int af = AF_INET);
|
||||
|
||||
/// get an interface's ip6 address
|
||||
std::optional<huint128_t>
|
||||
GetInterfaceIP6(std::string ifname);
|
||||
GetInterfaceIPv6Address(std::string ifname);
|
||||
|
||||
#ifdef _WIN32
|
||||
namespace net
|
||||
{
|
||||
std::optional<int>
|
||||
GetIfIndex(std::string ip);
|
||||
GetInterfaceIndex(huint32_t ip);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -286,12 +286,10 @@ namespace llarp::net
|
|||
}
|
||||
|
||||
std::optional<int>
|
||||
GetIfIndex(std::string ip)
|
||||
GetInterfaceIndex(huint32_t ip)
|
||||
{
|
||||
llarp::huint32_t h{};
|
||||
h.FromString(ip);
|
||||
std::optional<int> ret = std::nullopt;
|
||||
ForEachWIN32Interface([&ret, n = ToNet(h)](auto* iface) {
|
||||
ForEachWIN32Interface([&ret, n = ToNet(ip)](auto* iface) {
|
||||
if (ret.has_value())
|
||||
return;
|
||||
if (iface->dwForwardNextHop == n.n)
|
||||
|
|
|
@ -306,7 +306,7 @@ namespace llarp::vpn
|
|||
{
|
||||
if (ifaddr.fam == AF_INET6)
|
||||
{
|
||||
const auto maybe = net::GetIfIndex(ip.ToString());
|
||||
const auto maybe = net::GetInterfaceIndex(ip);
|
||||
if (maybe.has_value())
|
||||
{
|
||||
NetSH(
|
||||
|
|
Loading…
Reference in New Issue