blob: 76737bccc4db3038587e11478d28601dcc98ae2f [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 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
Thieu Lefb46caf2012-03-08 11:57:15 -080010#include <base/memory/scoped_ptr.h>
11
Paul Stewart26b327e2011-10-19 11:38:09 -070012#include "shill/event_dispatcher.h"
Darin Petkova7b89492011-07-27 12:48:17 -070013#include "shill/glib.h"
Paul Stewart75897df2011-04-27 09:05:53 -070014#include "shill/manager.h"
Thieu Le3426c8f2012-01-11 17:35:11 -080015#include "shill/metrics.h"
Darin Petkov633ac6f2011-07-08 13:56:13 -070016#include "shill/sockets.h"
Paul Stewart75897df2011-04-27 09:05:53 -070017
18namespace shill {
19
Darin Petkov633ac6f2011-07-08 13:56:13 -070020class Config;
21class ControlInterface;
Thieu Lefb46caf2012-03-08 11:57:15 -080022class DHCPProvider;
Darin Petkov887f2982011-07-14 16:10:17 -070023class GLib;
Thieu Lefb46caf2012-03-08 11:57:15 -080024class ProxyFactory;
25class RoutingTable;
26class RTNLHandler;
Darin Petkov633ac6f2011-07-08 13:56:13 -070027
Paul Stewart75897df2011-04-27 09:05:53 -070028class Daemon {
29 public:
Darin Petkova7b89492011-07-27 12:48:17 -070030 Daemon(Config *config, ControlInterface *control);
Paul Stewart75897df2011-04-27 09:05:53 -070031 ~Daemon();
Darin Petkov633ac6f2011-07-08 13:56:13 -070032
mukesh agrawal8f317b62011-07-15 11:53:23 -070033 void AddDeviceToBlackList(const std::string &device_name);
Gaurav Shah71354762011-11-28 19:22:49 -080034 void SetStartupProfiles(const std::vector<std::string> &profile_path);
35 // Main for connection manager. Starts main process and holds event
36 // loop.
Paul Stewart75897df2011-04-27 09:05:53 -070037 void Run();
Thieu Le1271d682011-11-02 22:48:19 +000038 void Quit();
Paul Stewart75897df2011-04-27 09:05:53 -070039
40 private:
Darin Petkov633ac6f2011-07-08 13:56:13 -070041 friend class ShillDaemonTest;
42
Darin Petkova7b89492011-07-27 12:48:17 -070043 void Start();
Thieu Le1271d682011-11-02 22:48:19 +000044 void Stop();
Darin Petkov633ac6f2011-07-08 13:56:13 -070045
Paul Stewart75897df2011-04-27 09:05:53 -070046 Config *config_;
47 ControlInterface *control_;
Thieu Le3426c8f2012-01-11 17:35:11 -080048 Metrics metrics_;
Thieu Lefb46caf2012-03-08 11:57:15 -080049 ProxyFactory *proxy_factory_;
50 RTNLHandler *rtnl_handler_;
51 RoutingTable *routing_table_;
52 DHCPProvider *dhcp_provider_;
53 scoped_ptr<Manager> manager_;
Paul Stewart75897df2011-04-27 09:05:53 -070054 EventDispatcher dispatcher_;
Darin Petkov633ac6f2011-07-08 13:56:13 -070055 Sockets sockets_;
Darin Petkova7b89492011-07-27 12:48:17 -070056 GLib glib_;
Paul Stewart75897df2011-04-27 09:05:53 -070057};
58
59} // namespace shill
60
Darin Petkov633ac6f2011-07-08 13:56:13 -070061#endif // SHILL_DAEMON_H_