blob: 19ff5f339da24a7efaeb36549acfc64ac4c0ad86 [file] [log] [blame]
Paul Stewart75897df2011-04-27 09:05:53 -07001// Copyright (c) 2011 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 <time.h>
Paul Stewart75897df2011-04-27 09:05:53 -07006#include <stdio.h>
Chris Masoneee929b72011-05-10 10:02:18 -07007
Paul Stewart75897df2011-04-27 09:05:53 -07008#include <string>
9
Chris Masoneee929b72011-05-10 10:02:18 -070010#include <base/logging.h>
11
Paul Stewart75897df2011-04-27 09:05:53 -070012#include "shill/control_interface.h"
13#include "shill/manager.h"
14
15using std::string;
16
17namespace shill {
18Manager::Manager(ControlInterface *control_interface,
Paul Stewart0af98bf2011-05-10 17:38:08 -070019 EventDispatcher *dispatcher)
Chris Masone413a3192011-05-09 17:10:05 -070020 : adaptor_(control_interface->CreateManagerAdaptor(this)),
Paul Stewart0af98bf2011-05-10 17:38:08 -070021 device_info_(dispatcher),
Paul Stewart75897df2011-04-27 09:05:53 -070022 running_(false) {
Chris Masoneee929b72011-05-10 10:02:18 -070023 // Initialize Interface monitor, so we can detect new interfaces
Chris Masoneb07006b2011-05-14 16:10:04 -070024 VLOG(2) << "Manager initialized.";
Paul Stewart75897df2011-04-27 09:05:53 -070025}
26
Paul Stewart0af98bf2011-05-10 17:38:08 -070027Manager::~Manager() {}
Paul Stewart75897df2011-04-27 09:05:53 -070028
29void Manager::Start() {
Paul Stewart0af98bf2011-05-10 17:38:08 -070030 LOG(INFO) << "Manager started.";
Paul Stewart75897df2011-04-27 09:05:53 -070031 running_ = true;
Chris Masone413a3192011-05-09 17:10:05 -070032 adaptor_->UpdateRunning();
Paul Stewart0af98bf2011-05-10 17:38:08 -070033 device_info_.Start();
Paul Stewart75897df2011-04-27 09:05:53 -070034}
35
36void Manager::Stop() {
37 running_ = false;
Chris Masone413a3192011-05-09 17:10:05 -070038 adaptor_->UpdateRunning();
Paul Stewart75897df2011-04-27 09:05:53 -070039}
40
41} // namespace shill