ladybird/Userland/Services/DHCPClient/main.cpp
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00

32 lines
843 B
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "DHCPv4Client.h"
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/System.h>
#include <LibMain/Main.h>
ErrorOr<int> serenity_main(Main::Arguments args)
{
Vector<DeprecatedString> interfaces;
Core::ArgsParser parser;
parser.add_positional_argument(interfaces, "Interfaces to run DHCP server on", "interfaces");
parser.parse(args);
TRY(Core::System::pledge("stdio unix inet cpath rpath"));
Core::EventLoop event_loop;
TRY(Core::System::unveil("/sys/kernel/net/", "r"));
TRY(Core::System::unveil(nullptr, nullptr));
auto client = TRY(DHCPv4Client::try_create(interfaces));
TRY(Core::System::pledge("stdio inet cpath rpath"));
return event_loop.exec();
}