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_DEBUG_DAEMON_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
6 #define CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 6 #define CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 virtual void TestICMP(const std::string& ip_address, | 138 virtual void TestICMP(const std::string& ip_address, |
139 const TestICMPCallback& callback) = 0; | 139 const TestICMPCallback& callback) = 0; |
140 | 140 |
141 // Tests ICMP connectivity to a specified host. The |ip_address| contains the | 141 // Tests ICMP connectivity to a specified host. The |ip_address| contains the |
142 // IPv4 or IPv6 address of the host, for example "8.8.8.8". | 142 // IPv4 or IPv6 address of the host, for example "8.8.8.8". |
143 virtual void TestICMPWithOptions( | 143 virtual void TestICMPWithOptions( |
144 const std::string& ip_address, | 144 const std::string& ip_address, |
145 const std::map<std::string, std::string>& options, | 145 const std::map<std::string, std::string>& options, |
146 const TestICMPCallback& callback) = 0; | 146 const TestICMPCallback& callback) = 0; |
147 | 147 |
| 148 // Called once EnableDebuggingFeatures() is complete. |succeeded| will be true |
| 149 // if debugging features have been successfully enabled. |
| 150 typedef base::Callback<void(bool succeeded)> EnableDebuggingCallback; |
| 151 |
| 152 // Enables debugging features (sshd, boot from USB). |password| is a new |
| 153 // password for root user. Can be only called in dev mode. |
| 154 virtual void EnableDebuggingFeatures( |
| 155 const std::string& password, |
| 156 const EnableDebuggingCallback& callback) = 0; |
| 157 |
| 158 enum DebuggingFeature { |
| 159 DEV_FEATURE_NONE = 0, |
| 160 DEV_FEATURES_DISABLED = 1 << 0, |
| 161 DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED = 1 << 1, |
| 162 DEV_FEATURE_BOOT_FROM_USB_ENABLED = 1 << 2, |
| 163 DEV_FEATURE_SSH_SERVER_CONFIGURED = 1 << 3, |
| 164 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET = 1 << 4, |
| 165 DEV_FEATURE_SYSTEM_ROOT_PASSWORD_SET = 1 << 5, |
| 166 DEV_FEATURE_ALL_ENABLED = |
| 167 DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED | |
| 168 DEV_FEATURE_BOOT_FROM_USB_ENABLED | |
| 169 DEV_FEATURE_SSH_SERVER_CONFIGURED | |
| 170 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET | |
| 171 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET, |
| 172 }; |
| 173 |
| 174 // Called once QueryDebuggingFeatures() is complete. |succeeded| will be true |
| 175 // if debugging features have been successfully enabled. |feature_mask| is a |
| 176 // bitmask made out of DebuggingFeature enum values. |
| 177 typedef base::Callback<void(bool succeeded, |
| 178 int feature_mask)> QueryDevFeaturesCallback; |
| 179 // Checks which debugging features have been already enabled. |
| 180 virtual void QueryDebuggingFeatures( |
| 181 const QueryDevFeaturesCallback& callback) = 0; |
| 182 |
| 183 // Removes rootfs verification from the file system. Can be only called in |
| 184 // dev mode. |
| 185 virtual void RemoveRootfsVerification( |
| 186 const EnableDebuggingCallback& callback) = 0; |
| 187 |
148 // Trigger uploading of crashes. | 188 // Trigger uploading of crashes. |
149 virtual void UploadCrashes() = 0; | 189 virtual void UploadCrashes() = 0; |
150 | 190 |
151 // Factory function, creates a new instance and returns ownership. | 191 // Factory function, creates a new instance and returns ownership. |
152 // For normal usage, access the singleton via DBusThreadManager::Get(). | 192 // For normal usage, access the singleton via DBusThreadManager::Get(). |
153 static DebugDaemonClient* Create(); | 193 static DebugDaemonClient* Create(); |
154 | 194 |
155 protected: | 195 protected: |
156 // Create() should be used instead. | 196 // Create() should be used instead. |
157 DebugDaemonClient(); | 197 DebugDaemonClient(); |
158 | 198 |
159 private: | 199 private: |
160 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); | 200 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); |
161 }; | 201 }; |
162 | 202 |
163 } // namespace chromeos | 203 } // namespace chromeos |
164 | 204 |
165 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 205 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
OLD | NEW |