mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
net: create GetNetworkNames()
This commit is contained in:
parent
b45eae4d53
commit
1c3af37881
3 changed files with 17 additions and 1 deletions
|
|
@ -68,6 +68,20 @@ std::string GetNetworkName(enum Network net)
|
|||
assert(false);
|
||||
}
|
||||
|
||||
std::vector<std::string> GetNetworkNames(bool append_unroutable)
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
for (int n = 0; n < NET_MAX; ++n) {
|
||||
const enum Network network{static_cast<Network>(n)};
|
||||
if (network == NET_UNROUTABLE || network == NET_I2P || network == NET_CJDNS || network == NET_INTERNAL) continue;
|
||||
names.emplace_back(GetNetworkName(network));
|
||||
}
|
||||
if (append_unroutable) {
|
||||
names.emplace_back(GetNetworkName(NET_UNROUTABLE));
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
bool static LookupIntern(const std::string& name, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup)
|
||||
{
|
||||
vIP.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue