mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17:35 +00:00
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.
This commit is contained in:
parent
d47f15ab8b
commit
065040872f
50 changed files with 897 additions and 839 deletions
|
@ -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() };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue