Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [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 | #include "shill/vpn_service.h" |
| 6 | |
| 7 | #include <base/logging.h> |
| 8 | |
| 9 | #include "shill/technology.h" |
| 10 | #include "shill/vpn_driver.h" |
| 11 | |
| 12 | using std::string; |
| 13 | |
| 14 | namespace shill { |
| 15 | |
Darin Petkov | 79d74c9 | 2012-03-07 17:20:32 +0100 | [diff] [blame] | 16 | VPNService::VPNService(ControlInterface *control, |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 17 | EventDispatcher *dispatcher, |
| 18 | Metrics *metrics, |
| 19 | Manager *manager, |
| 20 | VPNDriver *driver) |
Darin Petkov | 79d74c9 | 2012-03-07 17:20:32 +0100 | [diff] [blame] | 21 | : Service(control, dispatcher, metrics, manager, Technology::kVPN), |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 22 | driver_(driver) {} |
| 23 | |
| 24 | VPNService::~VPNService() {} |
| 25 | |
| 26 | void VPNService::Connect(Error *error) { |
Darin Petkov | 6aa2187 | 2012-03-09 16:10:19 +0100 | [diff] [blame^] | 27 | Service::Connect(error); |
Darin Petkov | 79d74c9 | 2012-03-07 17:20:32 +0100 | [diff] [blame] | 28 | driver_->Connect(this, error); |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 29 | } |
| 30 | |
Darin Petkov | 6aa2187 | 2012-03-09 16:10:19 +0100 | [diff] [blame^] | 31 | void VPNService::Disconnect(Error *error) { |
| 32 | Service::Disconnect(error); |
| 33 | driver_->Disconnect(); |
| 34 | } |
| 35 | |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 36 | string VPNService::GetStorageIdentifier() const { |
| 37 | NOTIMPLEMENTED(); |
| 38 | return ""; |
| 39 | } |
| 40 | |
| 41 | string VPNService::GetDeviceRpcId(Error *error) { |
| 42 | NOTIMPLEMENTED(); |
| 43 | error->Populate(Error::kNotSupported); |
| 44 | return "/"; |
| 45 | } |
| 46 | |
| 47 | } // namespace shill |