MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParseNetwork

Function ParseNetwork

src/netbase.cpp:87–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85DNSLookupFn g_dns_lookup{WrappedGetAddrInfo};
86
87enum Network ParseNetwork(const std::string& net_in) {
88 std::string net = ToLower(net_in);
89 if (net == "ipv4") return NET_IPV4;
90 if (net == "ipv6") return NET_IPV6;
91 if (net == "onion") return NET_ONION;
92 if (net == "tor") {
93 LogPrintf("Warning: net name 'tor' is deprecated and will be removed in the future. You should use 'onion' instead.\n");
94 return NET_ONION;
95 }
96 if (net == "i2p") {
97 return NET_I2P;
98 }
99 if (net == "cjdns") {
100 return NET_CJDNS;
101 }
102 return NET_UNROUTABLE;
103}
104
105std::string GetNetworkName(enum Network net)
106{

Callers 5

auth_cbMethod · 0.85
AppInitMainFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85
getnodeaddressesFunction · 0.85

Calls 1

ToLowerFunction · 0.50

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68