| 63 | } |
| 64 | |
| 65 | HostDBRecord::Handle |
| 66 | HostFile::lookup(const HostDBHash &hash) |
| 67 | { |
| 68 | HostDBRecord::Handle result; |
| 69 | |
| 70 | // If looking for an IPv4 or IPv6 address, check the host file. |
| 71 | if (hash.db_mark == HOSTDB_MARK_IPV6 || hash.db_mark == HOSTDB_MARK_IPV4) { |
| 72 | if (auto spot = forward.find(hash.host_name); spot != forward.end()) { |
| 73 | result = (hash.db_mark == HOSTDB_MARK_IPV4) ? spot->second.record_4 : spot->second.record_6; |
| 74 | } |
| 75 | } else if (hash.db_mark != HOSTDB_MARK_SRV) { |
| 76 | if (auto spot = reverse.find(hash.ip); spot != reverse.end()) { |
| 77 | result = spot->second; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | return result; |
| 82 | } |
| 83 | |
| 84 | std::shared_ptr<HostFile> |
| 85 | ParseHostFile(swoc::file::path const &path, ts_seconds interval) |
no test coverage detected