| 585 | } |
| 586 | |
| 587 | std::string IPv4AddressToString(IPv4Address ip_addr) { |
| 588 | std::array<char, INET_ADDRSTRLEN> buf = {}; |
| 589 | ASSERT(inet_ntop(AF_INET, &ip_addr, buf.data(), sizeof(buf)) == buf.data()); |
| 590 | return std::string(buf.data()); |
| 591 | } |
| 592 | |
| 593 | u32 IPv4AddressToInteger(IPv4Address ip_addr) { |
| 594 | return static_cast<u32>(ip_addr[0]) << 24 | static_cast<u32>(ip_addr[1]) << 16 | |
no test coverage detected