Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 5 | #ifndef SHILL_DAEMON_H_ |
6 | #define SHILL_DAEMON_H_ | ||||
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 7 | |
mukesh agrawal | 8f317b6 | 2011-07-15 11:53:23 -0700 | [diff] [blame] | 8 | #include <string> |
9 | |||||
Paul Stewart | 26b327e | 2011-10-19 11:38:09 -0700 | [diff] [blame] | 10 | #include "shill/event_dispatcher.h" |
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 11 | #include "shill/glib.h" |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 12 | #include "shill/manager.h" |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 13 | #include "shill/sockets.h" |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 14 | |
15 | namespace shill { | ||||
16 | |||||
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 17 | class Config; |
18 | class ControlInterface; | ||||
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 19 | class GLib; |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 20 | |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 21 | class Daemon { |
22 | public: | ||||
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 23 | Daemon(Config *config, ControlInterface *control); |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 24 | ~Daemon(); |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 25 | |
mukesh agrawal | 8f317b6 | 2011-07-15 11:53:23 -0700 | [diff] [blame] | 26 | void AddDeviceToBlackList(const std::string &device_name); |
Gaurav Shah | 7135476 | 2011-11-28 19:22:49 -0800 | [diff] [blame^] | 27 | void SetStartupProfiles(const std::vector<std::string> &profile_path); |
28 | // Main for connection manager. Starts main process and holds event | ||||
29 | // loop. | ||||
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 30 | void Run(); |
Thieu Le | 1271d68 | 2011-11-02 22:48:19 +0000 | [diff] [blame] | 31 | void Quit(); |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 32 | |
33 | private: | ||||
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 34 | friend class ShillDaemonTest; |
35 | |||||
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 36 | void Start(); |
Thieu Le | 1271d68 | 2011-11-02 22:48:19 +0000 | [diff] [blame] | 37 | void Stop(); |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 38 | |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 39 | Config *config_; |
40 | ControlInterface *control_; | ||||
41 | Manager manager_; | ||||
42 | EventDispatcher dispatcher_; | ||||
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 43 | Sockets sockets_; |
Darin Petkov | a7b8949 | 2011-07-27 12:48:17 -0700 | [diff] [blame] | 44 | GLib glib_; |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 45 | }; |
46 | |||||
47 | } // namespace shill | ||||
48 | |||||
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 49 | #endif // SHILL_DAEMON_H_ |