summaryrefslogtreecommitdiff
path: root/Userland/Services/LookupServer
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-02 19:54:34 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-03 21:14:06 +0200
commit065040872f62f608374da6709502033720442882 (patch)
treec9e974c1d32837df87ad334515a1535113fdc756 /Userland/Services/LookupServer
parentd47f15ab8b8ff545864fed2a0e275674c1431549 (diff)
downloadserenity-065040872f62f608374da6709502033720442882.zip
Userland: Change IPC funcs to use plain arguments instead of a struct
Instead of having a single overloaded handle method each method gets its own unique method name now.
Diffstat (limited to 'Userland/Services/LookupServer')
-rw-r--r--Userland/Services/LookupServer/ClientConnection.cpp18
-rw-r--r--Userland/Services/LookupServer/ClientConnection.h4
2 files changed, 11 insertions, 11 deletions
diff --git a/Userland/Services/LookupServer/ClientConnection.cpp b/Userland/Services/LookupServer/ClientConnection.cpp
index 51adca6e07..98f5e3fb18 100644
--- a/Userland/Services/LookupServer/ClientConnection.cpp
+++ b/Userland/Services/LookupServer/ClientConnection.cpp
@@ -28,9 +28,9 @@ void ClientConnection::die()
s_connections.remove(client_id());
}
-Messages::LookupServer::LookupNameResponse ClientConnection::handle(const Messages::LookupServer::LookupName& message)
+Messages::LookupServer::LookupNameResponse ClientConnection::lookup_name(String const& name)
{
- auto answers = LookupServer::the().lookup(message.name(), T_A);
+ auto answers = LookupServer::the().lookup(name, T_A);
if (answers.is_empty())
return { 1, Vector<String>() };
Vector<String> addresses;
@@ -40,16 +40,16 @@ Messages::LookupServer::LookupNameResponse ClientConnection::handle(const Messag
return { 0, move(addresses) };
}
-Messages::LookupServer::LookupAddressResponse ClientConnection::handle(const Messages::LookupServer::LookupAddress& message)
+Messages::LookupServer::LookupAddressResponse ClientConnection::lookup_address(String const& address)
{
- if (message.address().length() != 4)
+ if (address.length() != 4)
return { 1, String() };
- IPv4Address address { (const u8*)message.address().characters() };
+ IPv4Address ip_address { (const u8*)address.characters() };
auto name = String::formatted("{}.{}.{}.{}.in-addr.arpa",
- address[3],
- address[2],
- address[1],
- address[0]);
+ ip_address[3],
+ ip_address[2],
+ ip_address[1],
+ ip_address[0]);
auto answers = LookupServer::the().lookup(name, T_PTR);
if (answers.is_empty())
return { 1, String() };
diff --git a/Userland/Services/LookupServer/ClientConnection.h b/Userland/Services/LookupServer/ClientConnection.h
index 2c0e39cbb8..3289e36be0 100644
--- a/Userland/Services/LookupServer/ClientConnection.h
+++ b/Userland/Services/LookupServer/ClientConnection.h
@@ -26,8 +26,8 @@ public:
virtual void die() override;
private:
- virtual Messages::LookupServer::LookupNameResponse handle(const Messages::LookupServer::LookupName&) override;
- virtual Messages::LookupServer::LookupAddressResponse handle(const Messages::LookupServer::LookupAddress&) override;
+ virtual Messages::LookupServer::LookupNameResponse lookup_name(String const&) override;
+ virtual Messages::LookupServer::LookupAddressResponse lookup_address(String const&) override;
};
}