blob: ef7a3623b54da71d83dbe6e6e7dd0d76c26a7fcb [file] [log] [blame]
Darin Petkov633ac6f2011-07-08 13:56:13 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
Paul Stewart75897df2011-04-27 09:05:53 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Darin Petkov633ac6f2011-07-08 13:56:13 -07005#ifndef SHILL_DAEMON_H_
6#define SHILL_DAEMON_H_
Paul Stewart75897df2011-04-27 09:05:53 -07007
mukesh agrawal8f317b62011-07-15 11:53:23 -07008#include <string>
9
Paul Stewart26b327e2011-10-19 11:38:09 -070010#include "shill/event_dispatcher.h"
Darin Petkova7b89492011-07-27 12:48:17 -070011#include "shill/glib.h"
Paul Stewart75897df2011-04-27 09:05:53 -070012#include "shill/manager.h"
Darin Petkov633ac6f2011-07-08 13:56:13 -070013#include "shill/sockets.h"
Paul Stewart75897df2011-04-27 09:05:53 -070014
15namespace shill {
16
Darin Petkov633ac6f2011-07-08 13:56:13 -070017class Config;
18class ControlInterface;
Darin Petkov887f2982011-07-14 16:10:17 -070019class GLib;
Darin Petkov633ac6f2011-07-08 13:56:13 -070020
Paul Stewart75897df2011-04-27 09:05:53 -070021class Daemon {
22 public:
Darin Petkova7b89492011-07-27 12:48:17 -070023 Daemon(Config *config, ControlInterface *control);
Paul Stewart75897df2011-04-27 09:05:53 -070024 ~Daemon();
Darin Petkov633ac6f2011-07-08 13:56:13 -070025
mukesh agrawal8f317b62011-07-15 11:53:23 -070026 void AddDeviceToBlackList(const std::string &device_name);
Gaurav Shah71354762011-11-28 19:22:49 -080027 void SetStartupProfiles(const std::vector<std::string> &profile_path);
28 // Main for connection manager. Starts main process and holds event
29 // loop.
Paul Stewart75897df2011-04-27 09:05:53 -070030 void Run();
Thieu Le1271d682011-11-02 22:48:19 +000031 void Quit();
Paul Stewart75897df2011-04-27 09:05:53 -070032
33 private:
Darin Petkov633ac6f2011-07-08 13:56:13 -070034 friend class ShillDaemonTest;
35
Darin Petkova7b89492011-07-27 12:48:17 -070036 void Start();
Thieu Le1271d682011-11-02 22:48:19 +000037 void Stop();
Darin Petkov633ac6f2011-07-08 13:56:13 -070038
Paul Stewart75897df2011-04-27 09:05:53 -070039 Config *config_;
40 ControlInterface *control_;
41 Manager manager_;
42 EventDispatcher dispatcher_;
Darin Petkov633ac6f2011-07-08 13:56:13 -070043 Sockets sockets_;
Darin Petkova7b89492011-07-27 12:48:17 -070044 GLib glib_;
Paul Stewart75897df2011-04-27 09:05:53 -070045};
46
47} // namespace shill
48
Darin Petkov633ac6f2011-07-08 13:56:13 -070049#endif // SHILL_DAEMON_H_