OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 #include "chromeos/dbus/dbus_client.h" | 12 #include "chromeos/dbus/dbus_client.h" |
13 #include "chromeos/dbus/dbus_method_call_status.h" | 13 #include "chromeos/dbus/dbus_method_call_status.h" |
14 #include "chromeos/dbus/shill_client_helper.h" | 14 #include "chromeos/dbus/shill_client_helper.h" |
15 | 15 |
16 namespace dbus { | 16 namespace dbus { |
| 17 class ObjectPath; |
| 18 } |
17 | 19 |
18 class ObjectPath; | 20 namespace net { |
19 | 21 class IPEndPoint; |
20 } // namespace dbus | 22 } |
21 | 23 |
22 namespace chromeos { | 24 namespace chromeos { |
23 | 25 |
24 class ShillPropertyChangedObserver; | 26 class ShillPropertyChangedObserver; |
25 | 27 |
26 // ShillManagerClient is used to communicate with the Shill Manager | 28 // ShillManagerClient is used to communicate with the Shill Manager |
27 // service. All methods should be called from the origin thread which | 29 // service. All methods should be called from the origin thread which |
28 // initializes the DBusThreadManager instance. | 30 // initializes the DBusThreadManager instance. |
29 class CHROMEOS_EXPORT ShillManagerClient : public DBusClient { | 31 class CHROMEOS_EXPORT ShillManagerClient : public DBusClient { |
30 public: | 32 public: |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const base::DictionaryValue& properties, | 187 const base::DictionaryValue& properties, |
186 const ObjectPathCallback& callback, | 188 const ObjectPathCallback& callback, |
187 const ErrorCallback& error_callback) = 0; | 189 const ErrorCallback& error_callback) = 0; |
188 | 190 |
189 // Calls GetService method. | 191 // Calls GetService method. |
190 // |callback| is called after the method call succeeds. | 192 // |callback| is called after the method call succeeds. |
191 virtual void GetService(const base::DictionaryValue& properties, | 193 virtual void GetService(const base::DictionaryValue& properties, |
192 const ObjectPathCallback& callback, | 194 const ObjectPathCallback& callback, |
193 const ErrorCallback& error_callback) = 0; | 195 const ErrorCallback& error_callback) = 0; |
194 | 196 |
195 // Verify that the given data corresponds to a trusted device, and return true | 197 // Verifies that the given data corresponds to a trusted device, and returns |
196 // to the callback if it is. | 198 // true to the callback if it is. |
197 virtual void VerifyDestination(const VerificationProperties& properties, | 199 virtual void VerifyDestination(const VerificationProperties& properties, |
198 const BooleanCallback& callback, | 200 const BooleanCallback& callback, |
199 const ErrorCallback& error_callback) = 0; | 201 const ErrorCallback& error_callback) = 0; |
200 | 202 |
201 // Verify that the given data corresponds to a trusted device, and if it is, | 203 // Verifies that the given data corresponds to a trusted device, and if it is, |
202 // return the encrypted credentials for connecting to the network represented | 204 // returns the encrypted credentials for connecting to the network represented |
203 // by the given |service_path|, encrypted using the |public_key| for the | 205 // by the given |service_path|, encrypted using the |public_key| for the |
204 // trusted device. If the device is not trusted, return the empty string. | 206 // trusted device. If the device is not trusted, returns the empty string. |
205 virtual void VerifyAndEncryptCredentials( | 207 virtual void VerifyAndEncryptCredentials( |
206 const VerificationProperties& properties, | 208 const VerificationProperties& properties, |
207 const std::string& service_path, | 209 const std::string& service_path, |
208 const StringCallback& callback, | 210 const StringCallback& callback, |
209 const ErrorCallback& error_callback) = 0; | 211 const ErrorCallback& error_callback) = 0; |
210 | 212 |
211 // Verify that the given data corresponds to a trusted device, and return the | 213 // Verifies that the given data corresponds to a trusted device, and returns |
212 // |data| encrypted using the |public_key| for the trusted device. If the | 214 // the |data| encrypted using the |public_key| for the trusted device. If the |
213 // device is not trusted, return the empty string. | 215 // device is not trusted, returns the empty string. |
214 virtual void VerifyAndEncryptData(const VerificationProperties& properties, | 216 virtual void VerifyAndEncryptData(const VerificationProperties& properties, |
215 const std::string& data, | 217 const std::string& data, |
216 const StringCallback& callback, | 218 const StringCallback& callback, |
217 const ErrorCallback& error_callback) = 0; | 219 const ErrorCallback& error_callback) = 0; |
218 | 220 |
219 // For each technology present, connect to the "best" service available. | 221 // For each technology present, connects to the "best" service available. |
220 // Called once the user is logged in and certificates are loaded. | 222 // Called once the user is logged in and certificates are loaded. |
221 virtual void ConnectToBestServices(const base::Closure& callback, | 223 virtual void ConnectToBestServices(const base::Closure& callback, |
222 const ErrorCallback& error_callback) = 0; | 224 const ErrorCallback& error_callback) = 0; |
223 | 225 |
| 226 // Requests that shill program the NIC so that packets incoming on |
| 227 // |ip_connection| wake up the CPU. |
| 228 virtual void AddWakeOnPacketConnection( |
| 229 const net::IPEndPoint& ip_endpoint, |
| 230 const base::Closure& callback, |
| 231 const ErrorCallback& error_callback) = 0; |
| 232 |
| 233 // Removes a request to wake up on packets coming on |ip_connection|. |
| 234 virtual void RemoveWakeOnPacketConnection( |
| 235 const net::IPEndPoint& ip_endpoint, |
| 236 const base::Closure& callback, |
| 237 const ErrorCallback& error_callback) = 0; |
| 238 |
| 239 // Clears all requests to wake up on packets. |
| 240 virtual void RemoveAllWakeOnPacketConnections( |
| 241 const base::Closure& callback, |
| 242 const ErrorCallback& error_callback) = 0; |
| 243 |
224 // Returns an interface for testing (stub only), or returns NULL. | 244 // Returns an interface for testing (stub only), or returns NULL. |
225 virtual TestInterface* GetTestInterface() = 0; | 245 virtual TestInterface* GetTestInterface() = 0; |
226 | 246 |
227 protected: | 247 protected: |
228 friend class ShillManagerClientTest; | 248 friend class ShillManagerClientTest; |
229 | 249 |
230 // Create() should be used instead. | 250 // Create() should be used instead. |
231 ShillManagerClient(); | 251 ShillManagerClient(); |
232 | 252 |
233 private: | 253 private: |
234 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); | 254 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); |
235 }; | 255 }; |
236 | 256 |
237 } // namespace chromeos | 257 } // namespace chromeos |
238 | 258 |
239 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ | 259 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
OLD | NEW |