1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:37:44 +00:00

LookupServer: Turn #defines into enum classes and add formatter

This commit is contained in:
Gunnar Beutner 2021-05-07 23:58:51 +02:00 committed by Andreas Kling
parent 6e70888315
commit 7b3bed7910
11 changed files with 120 additions and 49 deletions

View file

@ -30,7 +30,7 @@ void ClientConnection::die()
Messages::LookupServer::LookupNameResponse ClientConnection::lookup_name(String const& name)
{
auto answers = LookupServer::the().lookup(name, T_A);
auto answers = LookupServer::the().lookup(name, DNSRecordType::A);
if (answers.is_empty())
return { 1, Vector<String>() };
Vector<String> addresses;
@ -50,7 +50,7 @@ Messages::LookupServer::LookupAddressResponse ClientConnection::lookup_address(S
ip_address[2],
ip_address[1],
ip_address[0]);
auto answers = LookupServer::the().lookup(name, T_PTR);
auto answers = LookupServer::the().lookup(name, DNSRecordType::PTR);
if (answers.is_empty())
return { 1, String() };
return { 0, answers[0].record_data() };