blob: 91175bc68dc54be3dd34d2cf0f2f975da1b041c0 [file] [log] [blame]
Paul Stewart75897df2011-04-27 09:05:53 -07001// Copyright (c) 2010 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 <stdio.h>
6#include <glib.h>
7
8#include <algorithm>
9#include <string>
10#include <vector>
11
12#include "shill/shill_logging.h"
13#include "shill/shill_daemon.h"
14#include "shill/control_interface.h"
15#include "shill/dbus_control.h"
16
17using std::max;
18using std::min;
19using std::string;
20using std::vector;
21
22namespace shill {
23
24static const char kTaggedFilePath[] = "/var/lib/shill";
25
26// Daemon: Main for connection manager. Starts main process and holds event
27// loop.
28
29Daemon::Daemon(Config *config, ControlInterface *control)
30 : config_(config),
31 control_(control),
32 manager_(control_, &dispatcher_) { }
33Daemon::~Daemon() {}
34
35
36void Daemon::Run() {
37 GMainLoop* loop = g_main_loop_new(NULL, false);
38 SHILL_LOG(INFO, SHILL_LOG_DAEMON) << "Running main loop.";
39 g_main_loop_run(loop);
40}
41
42
43} // namespace shill