Darin Petkov | e6ca320 | 2012-10-19 14:49:56 +0200 | [diff] [blame] | 1 | // Copyright (c) 2012 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 | #ifndef SHILL_SHIMS_PPP_H_ |
| 6 | #define SHILL_SHIMS_PPP_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/basictypes.h> |
| 11 | #include <base/memory/scoped_ptr.h> |
| 12 | |
| 13 | namespace base { |
| 14 | class AtExitManager; |
| 15 | } // namespace base |
| 16 | |
| 17 | namespace DBus { |
| 18 | class BusDispatcher; |
| 19 | class Connection; |
| 20 | } // namespace DBus |
| 21 | |
| 22 | namespace shill { |
| 23 | |
| 24 | namespace shims { |
| 25 | |
| 26 | class TaskProxy; |
| 27 | |
| 28 | class PPP { |
| 29 | public: |
| 30 | PPP(); |
| 31 | ~PPP(); |
| 32 | |
| 33 | void Start(); |
| 34 | void Stop(); |
| 35 | |
| 36 | bool GetSecret(std::string *username, std::string *password); |
| 37 | void OnConnect(const std::string &ifname); |
| 38 | void OnDisconnect(); |
| 39 | |
| 40 | private: |
| 41 | bool CreateProxy(); |
| 42 | void DestroyProxy(); |
| 43 | |
| 44 | static std::string ConvertIPToText(const void *addr); |
| 45 | |
| 46 | scoped_ptr<DBus::BusDispatcher> dispatcher_; |
| 47 | scoped_ptr<DBus::Connection> connection_; |
| 48 | scoped_ptr<TaskProxy> proxy_; |
| 49 | |
| 50 | static base::AtExitManager *exit_manager_; |
| 51 | |
| 52 | DISALLOW_COPY_AND_ASSIGN(PPP); |
| 53 | }; |
| 54 | |
| 55 | } // namespace shims |
| 56 | |
| 57 | } // namespace shill |
| 58 | |
| 59 | #endif // SHILL_SHIMS_PPP_H_ |