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

LookupServer: Implement basic mDNS support :^)

The implementation is extremely basic, and is far from fully conforming
to the spec. Among other things, it does not really work in case there
are multiple network adapters.

Nevertheless, it works quite well for the simple case! You can now do
this on your host machine:

$ ping courage.local

and same on your Serenity box:

$ ping host-machine-name.local
This commit is contained in:
Sergey Bugaev 2021-05-04 14:47:42 +03:00 committed by Andreas Kling
parent fd76e07399
commit bb06e720de
6 changed files with 251 additions and 1 deletions

View file

@ -20,11 +20,12 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
Core::EventLoop event_loop;
auto server = LookupServer::LookupServer::construct();
if (pledge("stdio accept inet", nullptr) < 0) {
if (pledge("stdio accept inet rpath", nullptr) < 0) {
perror("pledge");
return 1;
}
unveil("/proc/net/adapters", "r");
unveil(nullptr, nullptr);
return event_loop.exec();