MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / ParseIPData

Function ParseIPData

src/ipgroups.cpp:63–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63vector<CSubNet> ParseIPData(string input) {
64 vector<string> lines;
65 vector<CSubNet> results;
66 boost::split(lines, input, boost::is_any_of("\n"));
67 for (size_t i = 0; i < lines.size(); i++) {
68 // Skip empty lines and comments.
69 if (lines[i].size() == 0) continue;
70 if (lines[i][0] == '#') continue;
71
72 CSubNet subNet(lines[i]);
73 if (!subNet.IsValid()) {
74 LogPrintf("Failed to parse IP address from IP data file at line %d: %s\n", i, SanitizeString(lines[i]));
75 continue;
76 }
77 results.push_back(subNet);
78 }
79 return results;
80}
81
82// Hack around the fact that some platforms, especially on Linux, have root stores
83// that openssl/curl can't find by default. This is the root cert used by check.torproject.org

Callers 3

LoadIPDataFromWebFunction · 0.85
LoadIPGroupsFromFileFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 4

SanitizeStringFunction · 0.85
sizeMethod · 0.45
IsValidMethod · 0.45
push_backMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68