blob: 64eb8e68e1ed9bc35b57df159ecd7576bb417176 [file] [log] [blame]
Kevin Cernekee95d4ae92016-06-19 10:26:29 -07001// Copyright 2016 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <unistd.h>
6
7#include <base/logging.h>
8#include <brillo/flag_helper.h>
9#include <brillo/syslog_logging.h>
10
11#include "arc-networkd/manager.h"
12
13int main(int argc, char* argv[]) {
14 DEFINE_bool(log_to_stderr, false, "Log to both syslog and stderr");
15 DEFINE_string(internal_interface, "br0",
16 "Name of the host interface that connects to the guest");
17 DEFINE_string(container_interface, "arc0",
18 "Name of the guest interface that connects to the host");
19 DEFINE_int32(con_netns, 0, "Container's network namespace (PID)");
20
21 brillo::FlagHelper::Init(argc, argv, "ARC network daemon");
22
23 int flags = brillo::kLogToSyslog | brillo::kLogHeader;
24 if (FLAGS_log_to_stderr)
25 flags |= brillo::kLogToStderr;
26 brillo::InitLog(flags);
27
28 arc_networkd::Manager::Options opt;
29 opt.int_ifname = FLAGS_internal_interface;
30 opt.con_ifname = FLAGS_container_interface;
31 opt.con_netns = FLAGS_con_netns;
32
33 arc_networkd::Manager manager{opt};
34 return manager.Run();
35}