Changeset View
Changeset View
Standalone View
Standalone View
src/netbase.cpp
Show All 39 Lines | enum Network ParseNetwork(std::string net) { | ||||
boost::to_lower(net); | boost::to_lower(net); | ||||
if (net == "ipv4") { | if (net == "ipv4") { | ||||
return NET_IPV4; | return NET_IPV4; | ||||
} | } | ||||
if (net == "ipv6") { | if (net == "ipv6") { | ||||
return NET_IPV6; | return NET_IPV6; | ||||
} | } | ||||
if (net == "onion") { | if (net == "onion") { | ||||
return NET_TOR; | return NET_ONION; | ||||
} | } | ||||
if (net == "tor") { | if (net == "tor") { | ||||
LogPrintf("Warning: net name 'tor' is deprecated and will be removed " | LogPrintf("Warning: net name 'tor' is deprecated and will be removed " | ||||
"in the future. You should use 'onion' instead.\n"); | "in the future. You should use 'onion' instead.\n"); | ||||
return NET_TOR; | return NET_ONION; | ||||
} | } | ||||
return NET_UNROUTABLE; | return NET_UNROUTABLE; | ||||
} | } | ||||
std::string GetNetworkName(enum Network net) { | std::string GetNetworkName(enum Network net) { | ||||
switch (net) { | switch (net) { | ||||
case NET_IPV4: | case NET_IPV4: | ||||
return "ipv4"; | return "ipv4"; | ||||
case NET_IPV6: | case NET_IPV6: | ||||
return "ipv6"; | return "ipv6"; | ||||
case NET_TOR: | case NET_ONION: | ||||
return "onion"; | return "onion"; | ||||
default: | default: | ||||
return ""; | return ""; | ||||
} | } | ||||
} | } | ||||
static bool LookupIntern(const char *pszName, std::vector<CNetAddr> &vIP, | static bool LookupIntern(const char *pszName, std::vector<CNetAddr> &vIP, | ||||
unsigned int nMaxSolutions, bool fAllowLookup) { | unsigned int nMaxSolutions, bool fAllowLookup) { | ||||
▲ Show 20 Lines • Show All 711 Lines • Show Last 20 Lines |