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 | #ifndef SHILL_OPENVPN_DRIVER_ |
| 6 | #define SHILL_OPENVPN_DRIVER_ |
| 7 | |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame^] | 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <gtest/gtest_prod.h> // for FRIEND_TEST |
| 12 | |
| 13 | #include "shill/key_value_store.h" |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 14 | #include "shill/vpn_driver.h" |
| 15 | |
| 16 | namespace shill { |
| 17 | |
| 18 | class Error; |
| 19 | |
| 20 | class OpenVPNDriver : public VPNDriver { |
| 21 | public: |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame^] | 22 | explicit OpenVPNDriver(const KeyValueStore &args); |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 23 | virtual ~OpenVPNDriver(); |
| 24 | |
| 25 | // Inherited from VPNDriver. |
| 26 | virtual void Connect(Error *error); |
| 27 | |
| 28 | private: |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame^] | 29 | friend class OpenVPNDriverTest; |
| 30 | FRIEND_TEST(OpenVPNDriverTest, AppendFlag); |
| 31 | FRIEND_TEST(OpenVPNDriverTest, AppendValueOption); |
| 32 | FRIEND_TEST(OpenVPNDriverTest, InitOptions); |
| 33 | FRIEND_TEST(OpenVPNDriverTest, InitOptionsNoHost); |
| 34 | |
| 35 | void InitOptions(std::vector<std::string> *options, Error *error); |
| 36 | |
| 37 | void AppendValueOption(const std::string &property, |
| 38 | const std::string &option, |
| 39 | std::vector<std::string> *options); |
| 40 | void AppendFlag(const std::string &property, |
| 41 | const std::string &option, |
| 42 | std::vector<std::string> *options); |
| 43 | |
| 44 | KeyValueStore args_; |
| 45 | |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 46 | DISALLOW_COPY_AND_ASSIGN(OpenVPNDriver); |
| 47 | }; |
| 48 | |
| 49 | } // namespace shill |
| 50 | |
| 51 | #endif // SHILL_OPENVPN_DRIVER_ |