summaryrefslogtreecommitdiff
path: root/Userland/Services/DHCPClient/main.cpp
blob: 812ab78275d162e5f82f8c30b6e43cb09d3c0d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Copyright (c) 2020, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include "DHCPv4Client.h"
#include <LibCore/EventLoop.h>
#include <LibCore/System.h>
#include <LibMain/Main.h>

ErrorOr<int> serenity_main(Main::Arguments)
{
    TRY(Core::System::pledge("stdio unix inet cpath rpath"));
    Core::EventLoop event_loop;

    TRY(Core::System::unveil("/proc/net/", "r"));
    TRY(Core::System::unveil(nullptr, nullptr));

    auto client = TRY(DHCPv4Client::try_create());

    TRY(Core::System::pledge("stdio inet cpath rpath"));
    return event_loop.exec();
}