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 | |
Darin Petkov | a42afe3 | 2013-02-05 16:53:52 +0100 | [diff] [blame] | 5 | #ifndef SHILL_OPENVPN_DRIVER_H_ |
| 6 | #define SHILL_OPENVPN_DRIVER_H_ |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 7 | |
Darin Petkov | 14c29ec | 2012-03-02 11:34:19 +0100 | [diff] [blame] | 8 | #include <map> |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 9 | #include <string> |
| 10 | #include <vector> |
| 11 | |
Darin Petkov | 1fa8194 | 2012-04-02 11:38:08 +0200 | [diff] [blame] | 12 | #include <base/file_path.h> |
Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 13 | #include <base/memory/scoped_ptr.h> |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 14 | #include <gtest/gtest_prod.h> // for FRIEND_TEST |
| 15 | |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 16 | #include "shill/glib.h" |
Paul Stewart | e93b038 | 2012-04-24 13:11:28 -0700 | [diff] [blame] | 17 | #include "shill/ipconfig.h" |
Darin Petkov | f20994f | 2012-03-05 16:12:19 +0100 | [diff] [blame] | 18 | #include "shill/refptr_types.h" |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 19 | #include "shill/rpc_task.h" |
Darin Petkov | 3f9131c | 2012-03-20 11:37:32 +0100 | [diff] [blame] | 20 | #include "shill/service.h" |
Darin Petkov | 4646302 | 2012-03-29 14:57:32 +0200 | [diff] [blame] | 21 | #include "shill/sockets.h" |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 22 | #include "shill/vpn_driver.h" |
| 23 | |
Darin Petkov | 5a85047 | 2012-06-06 15:44:24 +0200 | [diff] [blame] | 24 | namespace base { |
| 25 | |
| 26 | template<typename T> |
| 27 | class WeakPtr; |
| 28 | |
| 29 | } // namespace base; |
| 30 | |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 31 | namespace shill { |
| 32 | |
Paul Stewart | 5baebb7 | 2013-03-14 11:43:29 -0700 | [diff] [blame] | 33 | class CertificateFile; |
Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 34 | class ControlInterface; |
Paul Stewart | ca6abd4 | 2012-03-01 15:45:29 -0800 | [diff] [blame] | 35 | class DeviceInfo; |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 36 | class Error; |
Darin Petkov | f20994f | 2012-03-05 16:12:19 +0100 | [diff] [blame] | 37 | class Metrics; |
Darin Petkov | 3c5e4dc | 2012-04-02 14:44:27 +0200 | [diff] [blame] | 38 | class NSS; |
Darin Petkov | 4646302 | 2012-03-29 14:57:32 +0200 | [diff] [blame] | 39 | class OpenVPNManagementServer; |
Darin Petkov | 5a85047 | 2012-06-06 15:44:24 +0200 | [diff] [blame] | 40 | class ProcessKiller; |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 41 | |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 42 | class OpenVPNDriver : public VPNDriver, |
| 43 | public RPCTaskDelegate { |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 44 | public: |
Darin Petkov | 0cd0d1e | 2013-02-11 12:49:10 +0100 | [diff] [blame] | 45 | enum ReconnectReason { |
| 46 | kReconnectReasonUnknown, |
| 47 | kReconnectReasonOffline, |
| 48 | kReconnectReasonTLSError, |
| 49 | }; |
| 50 | |
Paul Stewart | ca6abd4 | 2012-03-01 15:45:29 -0800 | [diff] [blame] | 51 | OpenVPNDriver(ControlInterface *control, |
Darin Petkov | f20994f | 2012-03-05 16:12:19 +0100 | [diff] [blame] | 52 | EventDispatcher *dispatcher, |
| 53 | Metrics *metrics, |
| 54 | Manager *manager, |
Paul Stewart | ca6abd4 | 2012-03-01 15:45:29 -0800 | [diff] [blame] | 55 | DeviceInfo *device_info, |
Paul Stewart | 451aa7f | 2012-04-11 19:07:58 -0700 | [diff] [blame] | 56 | GLib *glib); |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 57 | virtual ~OpenVPNDriver(); |
| 58 | |
Darin Petkov | 0cd0d1e | 2013-02-11 12:49:10 +0100 | [diff] [blame] | 59 | virtual void OnReconnecting(ReconnectReason reason); |
Darin Petkov | 271fe52 | 2012-03-27 13:47:29 +0200 | [diff] [blame] | 60 | |
Darin Petkov | aba8932 | 2013-03-11 14:48:22 +0100 | [diff] [blame] | 61 | // Resets the VPN state and deallocates all resources. If there's a service |
| 62 | // associated through Connect, sets its state to Service::kStateIdle and |
| 63 | // disassociates from the service. |
| 64 | virtual void IdleService(); |
Darin Petkov | 0440b9b | 2012-04-17 16:11:56 +0200 | [diff] [blame] | 65 | |
Darin Petkov | aba8932 | 2013-03-11 14:48:22 +0100 | [diff] [blame] | 66 | // Resets the VPN state and deallocates all resources. If there's a service |
| 67 | // associated through Connect, sets its state to Service::kStateFailure, sets |
Darin Petkov | 1c049c7 | 2013-03-21 13:15:45 +0100 | [diff] [blame] | 68 | // the failure reason to |failure|, sets its ErrorDetails property to |
| 69 | // |error_details|, and disassociates from the service. |
| 70 | virtual void FailService(Service::ConnectFailure failure, |
| 71 | const std::string &error_details); |
Darin Petkov | aba8932 | 2013-03-11 14:48:22 +0100 | [diff] [blame] | 72 | |
| 73 | // Returns true if an option was appended. |
Darin Petkov | 4646302 | 2012-03-29 14:57:32 +0200 | [diff] [blame] | 74 | bool AppendValueOption(const std::string &property, |
| 75 | const std::string &option, |
| 76 | std::vector<std::string> *options); |
| 77 | |
| 78 | // Returns true if a flag was appended. |
| 79 | bool AppendFlag(const std::string &property, |
| 80 | const std::string &option, |
| 81 | std::vector<std::string> *options); |
| 82 | |
Darin Petkov | a42afe3 | 2013-02-05 16:53:52 +0100 | [diff] [blame] | 83 | protected: |
| 84 | // Inherited from VPNDriver. |Connect| initiates the VPN connection by |
| 85 | // creating a tunnel device. When the device index becomes available, this |
| 86 | // instance is notified through |ClaimInterface| and resumes the connection |
| 87 | // process by setting up and spawning an external 'openvpn' process. IP |
| 88 | // configuration settings are passed back from the external process through |
| 89 | // the |Notify| RPC service method. |
| 90 | virtual void Connect(const VPNServiceRefPtr &service, Error *error); |
| 91 | virtual bool ClaimInterface(const std::string &link_name, |
| 92 | int interface_index); |
| 93 | virtual void Disconnect(); |
| 94 | virtual std::string GetProviderType() const; |
| 95 | virtual void OnConnectionDisconnected(); |
| 96 | virtual void OnConnectTimeout(); |
| 97 | |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 98 | private: |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 99 | friend class OpenVPNDriverTest; |
Paul Stewart | ca6abd4 | 2012-03-01 15:45:29 -0800 | [diff] [blame] | 100 | FRIEND_TEST(OpenVPNDriverTest, ClaimInterface); |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 101 | FRIEND_TEST(OpenVPNDriverTest, Cleanup); |
Darin Petkov | f20994f | 2012-03-05 16:12:19 +0100 | [diff] [blame] | 102 | FRIEND_TEST(OpenVPNDriverTest, Connect); |
Darin Petkov | 79d74c9 | 2012-03-07 17:20:32 +0100 | [diff] [blame] | 103 | FRIEND_TEST(OpenVPNDriverTest, ConnectTunnelFailure); |
Darin Petkov | 5a85047 | 2012-06-06 15:44:24 +0200 | [diff] [blame] | 104 | FRIEND_TEST(OpenVPNDriverTest, DeleteInterface); |
Darin Petkov | 6aa2187 | 2012-03-09 16:10:19 +0100 | [diff] [blame] | 105 | FRIEND_TEST(OpenVPNDriverTest, Disconnect); |
Darin Petkov | 6059674 | 2012-03-05 12:17:17 +0100 | [diff] [blame] | 106 | FRIEND_TEST(OpenVPNDriverTest, GetRouteOptionEntry); |
Darin Petkov | ca8a0e6 | 2012-09-26 13:16:52 +0200 | [diff] [blame] | 107 | FRIEND_TEST(OpenVPNDriverTest, InitCAOptions); |
Darin Petkov | 4e1b3f8 | 2012-09-27 13:22:37 +0200 | [diff] [blame] | 108 | FRIEND_TEST(OpenVPNDriverTest, InitClientAuthOptions); |
Darin Petkov | 1a462de | 2012-05-02 11:10:48 +0200 | [diff] [blame] | 109 | FRIEND_TEST(OpenVPNDriverTest, InitEnvironment); |
Darin Petkov | 55771b7 | 2012-04-25 09:25:19 +0200 | [diff] [blame] | 110 | FRIEND_TEST(OpenVPNDriverTest, InitLoggingOptions); |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 111 | FRIEND_TEST(OpenVPNDriverTest, InitOptions); |
Darin Petkov | 4b94484 | 2012-09-21 10:48:48 +0200 | [diff] [blame] | 112 | FRIEND_TEST(OpenVPNDriverTest, InitOptionsHostWithPort); |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 113 | FRIEND_TEST(OpenVPNDriverTest, InitOptionsNoHost); |
Darin Petkov | e0d5dd1 | 2012-04-04 16:10:48 +0200 | [diff] [blame] | 114 | FRIEND_TEST(OpenVPNDriverTest, InitPKCS11Options); |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 115 | FRIEND_TEST(OpenVPNDriverTest, Notify); |
Paul Stewart | 91a43cb | 2013-03-02 21:34:15 -0800 | [diff] [blame] | 116 | FRIEND_TEST(OpenVPNDriverTest, NotifyUMA); |
Darin Petkov | 79d74c9 | 2012-03-07 17:20:32 +0100 | [diff] [blame] | 117 | FRIEND_TEST(OpenVPNDriverTest, NotifyFail); |
Darin Petkov | a5e07ef | 2012-07-09 14:27:57 +0200 | [diff] [blame] | 118 | FRIEND_TEST(OpenVPNDriverTest, OnDefaultServiceChanged); |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 119 | FRIEND_TEST(OpenVPNDriverTest, OnOpenVPNDied); |
Darin Petkov | 14c29ec | 2012-03-02 11:34:19 +0100 | [diff] [blame] | 120 | FRIEND_TEST(OpenVPNDriverTest, ParseForeignOption); |
| 121 | FRIEND_TEST(OpenVPNDriverTest, ParseForeignOptions); |
| 122 | FRIEND_TEST(OpenVPNDriverTest, ParseIPConfiguration); |
Darin Petkov | 1a462de | 2012-05-02 11:10:48 +0200 | [diff] [blame] | 123 | FRIEND_TEST(OpenVPNDriverTest, ParseLSBRelease); |
Darin Petkov | 6059674 | 2012-03-05 12:17:17 +0100 | [diff] [blame] | 124 | FRIEND_TEST(OpenVPNDriverTest, ParseRouteOption); |
| 125 | FRIEND_TEST(OpenVPNDriverTest, SetRoutes); |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 126 | FRIEND_TEST(OpenVPNDriverTest, SpawnOpenVPN); |
Darin Petkov | 4b94484 | 2012-09-21 10:48:48 +0200 | [diff] [blame] | 127 | FRIEND_TEST(OpenVPNDriverTest, SplitPortFromHost); |
Paul Stewart | 291a473 | 2012-03-14 19:19:02 -0700 | [diff] [blame] | 128 | FRIEND_TEST(OpenVPNDriverTest, VerifyPaths); |
| 129 | |
Darin Petkov | 0cd0d1e | 2013-02-11 12:49:10 +0100 | [diff] [blame] | 130 | // The map is a sorted container that allows us to iterate through the options |
| 131 | // in order. |
| 132 | typedef std::map<int, std::string> ForeignOptions; |
| 133 | typedef std::map<int, IPConfig::Route> RouteOptions; |
| 134 | |
Darin Petkov | c418b4b | 2012-10-05 11:42:52 +0200 | [diff] [blame] | 135 | static const char kDefaultCACertificates[]; |
Darin Petkov | ca8a0e6 | 2012-09-26 13:16:52 +0200 | [diff] [blame] | 136 | |
Paul Stewart | 291a473 | 2012-03-14 19:19:02 -0700 | [diff] [blame] | 137 | static const char kOpenVPNPath[]; |
| 138 | static const char kOpenVPNScript[]; |
Paul Stewart | ebd3856 | 2012-03-23 13:06:40 -0700 | [diff] [blame] | 139 | static const Property kProperties[]; |
Darin Petkov | 14c29ec | 2012-03-02 11:34:19 +0100 | [diff] [blame] | 140 | |
Darin Petkov | 1a462de | 2012-05-02 11:10:48 +0200 | [diff] [blame] | 141 | static const char kLSBReleaseFile[]; |
| 142 | static const char kChromeOSReleaseName[]; |
| 143 | static const char kChromeOSReleaseVersion[]; |
| 144 | |
Darin Petkov | 0cd0d1e | 2013-02-11 12:49:10 +0100 | [diff] [blame] | 145 | static const int kReconnectOfflineTimeoutSeconds; |
| 146 | static const int kReconnectTLSErrorTimeoutSeconds; |
Darin Petkov | 14c29ec | 2012-03-02 11:34:19 +0100 | [diff] [blame] | 147 | |
| 148 | static void ParseIPConfiguration( |
| 149 | const std::map<std::string, std::string> &configuration, |
| 150 | IPConfig::Properties *properties); |
| 151 | static void ParseForeignOptions(const ForeignOptions &options, |
| 152 | IPConfig::Properties *properties); |
| 153 | static void ParseForeignOption(const std::string &option, |
Darin Petkov | e8587e3 | 2012-07-02 13:56:07 +0200 | [diff] [blame] | 154 | std::vector<std::string> *domain_search, |
| 155 | std::vector<std::string> *dns_servers); |
Darin Petkov | 6059674 | 2012-03-05 12:17:17 +0100 | [diff] [blame] | 156 | static IPConfig::Route *GetRouteOptionEntry(const std::string &prefix, |
| 157 | const std::string &key, |
| 158 | RouteOptions *routes); |
| 159 | static void ParseRouteOption(const std::string &key, |
| 160 | const std::string &value, |
| 161 | RouteOptions *routes); |
| 162 | static void SetRoutes(const RouteOptions &routes, |
| 163 | IPConfig::Properties *properties); |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 164 | |
Darin Petkov | 4b94484 | 2012-09-21 10:48:48 +0200 | [diff] [blame] | 165 | // If |host| is in the "name:port" format, sets up |name| and |port| |
| 166 | // appropriately and returns true. Otherwise, returns false. |
| 167 | static bool SplitPortFromHost(const std::string &host, |
| 168 | std::string *name, |
| 169 | std::string *port); |
| 170 | |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 171 | void InitOptions(std::vector<std::string> *options, Error *error); |
Darin Petkov | ca8a0e6 | 2012-09-26 13:16:52 +0200 | [diff] [blame] | 172 | bool InitCAOptions(std::vector<std::string> *options, Error *error); |
Darin Petkov | 4e1b3f8 | 2012-09-27 13:22:37 +0200 | [diff] [blame] | 173 | void InitClientAuthOptions(std::vector<std::string> *options); |
Darin Petkov | e0d5dd1 | 2012-04-04 16:10:48 +0200 | [diff] [blame] | 174 | void InitPKCS11Options(std::vector<std::string> *options); |
| 175 | bool InitManagementChannelOptions( |
| 176 | std::vector<std::string> *options, Error *error); |
Darin Petkov | 55771b7 | 2012-04-25 09:25:19 +0200 | [diff] [blame] | 177 | void InitLoggingOptions(std::vector<std::string> *options); |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 178 | |
Darin Petkov | 1a462de | 2012-05-02 11:10:48 +0200 | [diff] [blame] | 179 | void InitEnvironment(std::vector<std::string> *environment); |
| 180 | bool ParseLSBRelease(std::map<std::string, std::string> *lsb_release); |
| 181 | |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 182 | bool SpawnOpenVPN(); |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 183 | |
Darin Petkov | aba8932 | 2013-03-11 14:48:22 +0100 | [diff] [blame] | 184 | // Implements the public IdleService and FailService methods. Resets the VPN |
| 185 | // state and deallocates all resources. If there's a service associated |
Darin Petkov | 1c049c7 | 2013-03-21 13:15:45 +0100 | [diff] [blame] | 186 | // through Connect, sets its state |state|; if |state| is |
| 187 | // Service::kStateFailure, sets the failure reason to |failure| and its |
| 188 | // ErrorDetails property to |error_details|; disassociates from the service. |
| 189 | void Cleanup(Service::ConnectState state, |
| 190 | Service::ConnectFailure failure, |
| 191 | const std::string &error_details); |
Darin Petkov | aba8932 | 2013-03-11 14:48:22 +0100 | [diff] [blame] | 192 | |
Darin Petkov | 0cd0d1e | 2013-02-11 12:49:10 +0100 | [diff] [blame] | 193 | static int GetReconnectTimeoutSeconds(ReconnectReason reason); |
| 194 | |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 195 | // Called when the openpvn process exits. |
| 196 | static void OnOpenVPNDied(GPid pid, gint status, gpointer data); |
| 197 | |
Darin Petkov | 5a85047 | 2012-06-06 15:44:24 +0200 | [diff] [blame] | 198 | // Standalone callback used to delete the tunnel interface when the openvpn |
| 199 | // process dies. |
Darin Petkov | 5dbd261 | 2012-06-07 16:22:16 +0200 | [diff] [blame] | 200 | static void DeleteInterface(const base::WeakPtr<DeviceInfo> &device_info, |
Darin Petkov | 5a85047 | 2012-06-06 15:44:24 +0200 | [diff] [blame] | 201 | int interface_index); |
| 202 | |
Darin Petkov | b536a74 | 2012-04-26 11:31:28 +0200 | [diff] [blame] | 203 | // Inherit from VPNDriver to add custom properties. |
| 204 | virtual KeyValueStore GetProvider(Error *error); |
| 205 | |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 206 | // Implements RPCTaskDelegate. |
Darin Petkov | 209e629 | 2012-04-20 11:33:32 +0200 | [diff] [blame] | 207 | virtual void GetLogin(std::string *user, std::string *password); |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 208 | virtual void Notify(const std::string &reason, |
| 209 | const std::map<std::string, std::string> &dict); |
| 210 | |
Darin Petkov | a5e07ef | 2012-07-09 14:27:57 +0200 | [diff] [blame] | 211 | void OnDefaultServiceChanged(const ServiceRefPtr &service); |
| 212 | |
Paul Stewart | 91a43cb | 2013-03-02 21:34:15 -0800 | [diff] [blame] | 213 | void ReportConnectionMetrics(); |
| 214 | |
Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 215 | ControlInterface *control_; |
Darin Petkov | f20994f | 2012-03-05 16:12:19 +0100 | [diff] [blame] | 216 | Metrics *metrics_; |
Paul Stewart | ca6abd4 | 2012-03-01 15:45:29 -0800 | [diff] [blame] | 217 | DeviceInfo *device_info_; |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 218 | GLib *glib_; |
Darin Petkov | 4646302 | 2012-03-29 14:57:32 +0200 | [diff] [blame] | 219 | Sockets sockets_; |
| 220 | scoped_ptr<OpenVPNManagementServer> management_server_; |
Darin Petkov | 3c5e4dc | 2012-04-02 14:44:27 +0200 | [diff] [blame] | 221 | NSS *nss_; |
Paul Stewart | 5baebb7 | 2013-03-14 11:43:29 -0700 | [diff] [blame] | 222 | scoped_ptr<CertificateFile> certificate_file_; |
Darin Petkov | 5a85047 | 2012-06-06 15:44:24 +0200 | [diff] [blame] | 223 | ProcessKiller *process_killer_; |
Albert Chaulk | 0e1cdea | 2013-02-27 15:32:55 -0800 | [diff] [blame] | 224 | base::FilePath lsb_release_file_; |
Darin Petkov | 79d74c9 | 2012-03-07 17:20:32 +0100 | [diff] [blame] | 225 | |
| 226 | VPNServiceRefPtr service_; |
Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 227 | scoped_ptr<RPCTask> rpc_task_; |
Paul Stewart | ca6abd4 | 2012-03-01 15:45:29 -0800 | [diff] [blame] | 228 | std::string tunnel_interface_; |
mukesh agrawal | 9da0777 | 2013-05-15 14:15:17 -0700 | [diff] [blame] | 229 | VirtualDeviceRefPtr device_; |
Albert Chaulk | 0e1cdea | 2013-02-27 15:32:55 -0800 | [diff] [blame] | 230 | base::FilePath tls_auth_file_; |
Darin Petkov | 3189a47 | 2012-10-05 09:55:33 +0200 | [diff] [blame] | 231 | IPConfig::Properties ip_properties_; |
Darin Petkov | fe6a937 | 2012-02-28 16:25:06 +0100 | [diff] [blame] | 232 | |
Darin Petkov | 36a3ace | 2012-03-06 17:22:14 +0100 | [diff] [blame] | 233 | // The PID of the spawned openvpn process. May be 0 if no process has been |
| 234 | // spawned yet or the process has died. |
| 235 | int pid_; |
| 236 | |
| 237 | // Child exit watch callback source tag. |
| 238 | unsigned int child_watch_tag_; |
| 239 | |
Darin Petkov | a5e07ef | 2012-07-09 14:27:57 +0200 | [diff] [blame] | 240 | // Default service watch callback tag. |
| 241 | int default_service_callback_tag_; |
| 242 | |
Darin Petkov | 33af05c | 2012-02-28 10:10:30 +0100 | [diff] [blame] | 243 | DISALLOW_COPY_AND_ASSIGN(OpenVPNDriver); |
| 244 | }; |
| 245 | |
| 246 | } // namespace shill |
| 247 | |
Darin Petkov | a42afe3 | 2013-02-05 16:53:52 +0100 | [diff] [blame] | 248 | #endif // SHILL_OPENVPN_DRIVER_H_ |