feature: add expand ptr from address feature

This commit is contained in:
Nick Peng
2023-03-31 23:28:34 +08:00
parent d402d62cc5
commit fbdcb7ba41
5 changed files with 107 additions and 13 deletions

View File

@@ -49,7 +49,18 @@ DNSRecord::~DNSRecord() {}
bool DNSRecord::Parser(const std::string &line)
{
std::vector<std::string> fields = StringSplit(line, '\t');
std::vector<std::string> fields_first = StringSplit(line, '\t');
std::vector<std::string> fields;
for (const auto &f : fields_first) {
std::vector<std::string> fields_second = StringSplit(f, ' ');
for (const auto &s : fields_second) {
if (s.length() > 0) {
fields.push_back(s);
}
}
}
if (fields.size() < 3) {
std::cerr << "Invalid DNS record: " << line << ", size: " << fields.size() << std::endl;
return false;