blob: a5284809b03510a1c50fd19f8d162df24f9a5f6a [file] [log] [blame]
Alex Deymod5561a52015-09-03 23:17:52 -07001// Automatic generation of D-Bus interfaces:
2// - org.chromium.debugd
3#ifndef ____CHROMEOS_DBUS_BINDING____________________BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_DEBUGD_CLIENT_OUT_DEFAULT_GEN_INCLUDE_DEBUGD_DBUS_PROXIES_H
4#define ____CHROMEOS_DBUS_BINDING____________________BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_DEBUGD_CLIENT_OUT_DEFAULT_GEN_INCLUDE_DEBUGD_DBUS_PROXIES_H
5#include <memory>
6#include <string>
7#include <vector>
8
9#include <base/bind.h>
10#include <base/callback.h>
11#include <base/logging.h>
12#include <base/macros.h>
13#include <base/memory/ref_counted.h>
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070014#include <brillo/any.h>
15#include <brillo/dbus/dbus_method_invoker.h>
16#include <brillo/dbus/dbus_property.h>
17#include <brillo/dbus/dbus_signal_handler.h>
18#include <brillo/errors/error.h>
19#include <brillo/variant_dictionary.h>
Alex Deymod5561a52015-09-03 23:17:52 -070020#include <dbus/bus.h>
21#include <dbus/message.h>
22#include <dbus/object_manager.h>
23#include <dbus/object_path.h>
24#include <dbus/object_proxy.h>
25
26namespace org {
27namespace chromium {
28
29// Abstract interface proxy for org::chromium::debugd.
30class debugdProxyInterface {
31 public:
32 virtual ~debugdProxyInterface() = default;
33
34 // Starts pinging the specified hostname with the specified options, with
35 // output directed to the given output file descriptor. The returned opaque
36 // string functions as a handle for this particular ping. Multiple pings
37 // can be running at once.
38 virtual bool PingStart(
39 const dbus::FileDescriptor& in_outfd,
40 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070041 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -070042 std::string* out_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070043 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -070044 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
45
46 // Starts pinging the specified hostname with the specified options, with
47 // output directed to the given output file descriptor. The returned opaque
48 // string functions as a handle for this particular ping. Multiple pings
49 // can be running at once.
50 virtual void PingStartAsync(
51 const dbus::FileDescriptor& in_outfd,
52 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070053 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -070054 const base::Callback<void(const std::string& /*handle*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070055 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -070056 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
57
58 // Stops a running ping.
59 virtual bool PingStop(
60 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070061 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -070062 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
63
64 // Stops a running ping.
65 virtual void PingStopAsync(
66 const std::string& in_handle,
67 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070068 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -070069 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
70
71 // Start system/kernel tracing. If tracing is already enabled it is
72 // stopped first and any collected events are discarded. The kernel
73 // must have been configured to support tracing.
74 virtual bool SystraceStart(
75 const std::string& in_categories,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070076 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -070077 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
78
79 // Start system/kernel tracing. If tracing is already enabled it is
80 // stopped first and any collected events are discarded. The kernel
81 // must have been configured to support tracing.
82 virtual void SystraceStartAsync(
83 const std::string& in_categories,
84 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070085 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -070086 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
87
88 // Stop system/kernel tracing and write the collected event data.
89 virtual bool SystraceStop(
90 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070091 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -070092 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
93
94 // Stop system/kernel tracing and write the collected event data.
95 virtual void SystraceStopAsync(
96 const dbus::FileDescriptor& in_outfd,
97 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -070098 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -070099 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
100
101 // Return current status for system/kernel tracing including whether it
102 // is enabled, the tracing clock, and the set of events enabled.
103 virtual bool SystraceStatus(
104 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700105 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700106 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
107
108 // Return current status for system/kernel tracing including whether it
109 // is enabled, the tracing clock, and the set of events enabled.
110 virtual void SystraceStatusAsync(
111 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700112 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700113 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
114
115 virtual bool TracePathStart(
116 const dbus::FileDescriptor& in_outfd,
117 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700118 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700119 std::string* out_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700120 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700121 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
122
123 virtual void TracePathStartAsync(
124 const dbus::FileDescriptor& in_outfd,
125 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700126 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700127 const base::Callback<void(const std::string& /*handle*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700128 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700129 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
130
131 // Stops a running tracepath.
132 virtual bool TracePathStop(
133 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700134 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700135 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
136
137 // Stops a running tracepath.
138 virtual void TracePathStopAsync(
139 const std::string& in_handle,
140 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700141 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700142 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
143
144 // Returns the routing table.
145 virtual bool GetRoutes(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700146 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700147 std::vector<std::string>* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700148 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700149 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
150
151 // Returns the routing table.
152 virtual void GetRoutesAsync(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700153 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700154 const base::Callback<void(const std::vector<std::string>& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700155 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700156 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
157
158 // Returns modem information as a JSON string. See the design document for
159 // a rationale.
160 virtual bool GetModemStatus(
161 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700162 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700163 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
164
165 // Returns modem information as a JSON string. See the design document for
166 // a rationale.
167 virtual void GetModemStatusAsync(
168 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700169 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700170 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
171
172 // Runs the specified command through the modem serial interface and
173 // returns the output.
174 virtual bool RunModemCommand(
175 const std::string& in_command,
176 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700177 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700178 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
179
180 // Runs the specified command through the modem serial interface and
181 // returns the output.
182 virtual void RunModemCommandAsync(
183 const std::string& in_command,
184 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700185 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700186 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
187
188 // Returns network information as a JSON string. See the design document
189 // for a rationale.
190 virtual bool GetNetworkStatus(
191 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700192 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700193 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
194
195 // Returns network information as a JSON string. See the design document
196 // for a rationale.
197 virtual void GetNetworkStatusAsync(
198 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700199 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700200 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
201
202 // Returns WiMAX information as a JSON string. See the design document for
203 // a rationale.
204 virtual bool GetWiMaxStatus(
205 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700206 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700207 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
208
209 // Returns WiMAX information as a JSON string. See the design document for
210 // a rationale.
211 virtual void GetWiMaxStatusAsync(
212 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700213 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700214 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
215
216 // Runs system-wide perf profiling. The profile parameters are selected by
217 // perf_args.
218 virtual bool GetPerfOutput(
219 uint32_t in_duration_sec,
220 const std::vector<std::string>& in_perf_args,
221 int32_t* out_status,
222 std::vector<uint8_t>* out_perf_data,
223 std::vector<uint8_t>* out_perf_stat,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700224 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700225 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
226
227 // Runs system-wide perf profiling. The profile parameters are selected by
228 // perf_args.
229 virtual void GetPerfOutputAsync(
230 uint32_t in_duration_sec,
231 const std::vector<std::string>& in_perf_args,
232 const base::Callback<void(int32_t /*status*/, const std::vector<uint8_t>& /*perf_data*/, const std::vector<uint8_t>& /*perf_stat*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700233 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700234 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
235
236 // Runs system-wide perf profiling. It can can profile events other than
237 // cycles (example: iTLB-misses), and can collect branch profiles. It can
238 // also return raw counter values. The exact profile or counters to be
239 // collected is chosen at random and depends on what CPU is used by the
240 // system (certain CPUs do not support certain profiling modes).
241 virtual bool GetRandomPerfOutput(
242 uint32_t in_duration_sec,
243 int32_t* out_status,
244 std::vector<uint8_t>* out_perf_data,
245 std::vector<uint8_t>* out_perf_stat,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700246 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700247 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
248
249 // Runs system-wide perf profiling. It can can profile events other than
250 // cycles (example: iTLB-misses), and can collect branch profiles. It can
251 // also return raw counter values. The exact profile or counters to be
252 // collected is chosen at random and depends on what CPU is used by the
253 // system (certain CPUs do not support certain profiling modes).
254 virtual void GetRandomPerfOutputAsync(
255 uint32_t in_duration_sec,
256 const base::Callback<void(int32_t /*status*/, const std::vector<uint8_t>& /*perf_data*/, const std::vector<uint8_t>& /*perf_stat*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700257 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700258 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
259
260 // Returns perf event data. Does systemwide profiling. It can profile
261 // events other than cycles (example: iTLB-misses), and can collect branch
262 // profiles. The exact profile to be collected is chosen at random
263 // and depends on what CPU is used by the system (certain CPUs do not
264 // support certain profiling modes).
265 virtual bool GetRichPerfData(
266 uint32_t in_duration_sec,
267 std::vector<uint8_t>* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700268 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700269 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
270
271 // Returns perf event data. Does systemwide profiling. It can profile
272 // events other than cycles (example: iTLB-misses), and can collect branch
273 // profiles. The exact profile to be collected is chosen at random
274 // and depends on what CPU is used by the system (certain CPUs do not
275 // support certain profiling modes).
276 virtual void GetRichPerfDataAsync(
277 uint32_t in_duration_sec,
278 const base::Callback<void(const std::vector<uint8_t>& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700279 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700280 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
281
282 // DEPRECATED: Use DumpDebugLogs instead.
283 // Packages up system logs into a .tar.gz and returns it over the supplied
284 // file descriptor.
285 virtual bool GetDebugLogs(
286 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700287 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700288 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
289
290 // DEPRECATED: Use DumpDebugLogs instead.
291 // Packages up system logs into a .tar.gz and returns it over the supplied
292 // file descriptor.
293 virtual void GetDebugLogsAsync(
294 const dbus::FileDescriptor& in_outfd,
295 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700296 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700297 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
298
299 // Packages up system logs into a .tar(.gz) and returns it over the
300 // supplied file descriptor.
301 virtual bool DumpDebugLogs(
302 bool in_is_compressed,
303 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700304 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700305 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
306
307 // Packages up system logs into a .tar(.gz) and returns it over the
308 // supplied file descriptor.
309 virtual void DumpDebugLogsAsync(
310 bool in_is_compressed,
311 const dbus::FileDescriptor& in_outfd,
312 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700313 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700314 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
315
316 // Enables or disables debug mode for a specified subsystem.
317 virtual bool SetDebugMode(
318 const std::string& in_subsystem,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700319 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700320 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
321
322 // Enables or disables debug mode for a specified subsystem.
323 virtual void SetDebugModeAsync(
324 const std::string& in_subsystem,
325 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700326 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700327 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
328
329 // Fetches the contents of a single system log, identified by name. See
330 // /src/log_tool.cc for a list of valid names.
331 virtual bool GetLog(
332 const std::string& in_log,
333 std::string* out_contents,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700334 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700335 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
336
337 // Fetches the contents of a single system log, identified by name. See
338 // /src/log_tool.cc for a list of valid names.
339 virtual void GetLogAsync(
340 const std::string& in_log,
341 const base::Callback<void(const std::string& /*contents*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700342 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700343 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
344
345 // Returns all the system logs.
346 virtual bool GetAllLogs(
347 std::map<std::string, std::string>* out_logs,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700348 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700349 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
350
351 // Returns all the system logs.
352 virtual void GetAllLogsAsync(
353 const base::Callback<void(const std::map<std::string, std::string>& /*logs*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700354 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700355 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
356
357 // Returns system logs for feedback reports.
358 virtual bool GetFeedbackLogs(
359 std::map<std::string, std::string>* out_logs,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700360 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700361 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
362
363 // Returns system logs for feedback reports.
364 virtual void GetFeedbackLogsAsync(
365 const base::Callback<void(const std::map<std::string, std::string>& /*logs*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700366 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700367 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
368
369 // Returns list of User log file names that Chrome itself must collect.
370 // These logfiles are relative to the user's profile path and must be
371 // collected separately for each user.
372 virtual bool GetUserLogFiles(
373 std::map<std::string, std::string>* out_user_log_files,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700374 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700375 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
376
377 // Returns list of User log file names that Chrome itself must collect.
378 // These logfiles are relative to the user's profile path and must be
379 // collected separately for each user.
380 virtual void GetUserLogFilesAsync(
381 const base::Callback<void(const std::map<std::string, std::string>& /*user_log_files*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700382 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700383 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
384
385 // Example method. See /doc/hacking.md.
386 virtual bool GetExample(
387 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700388 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700389 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
390
391 // Example method. See /doc/hacking.md.
392 virtual void GetExampleAsync(
393 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700394 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700395 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
396
397 // Returns information about network interfaces as a JSON string.
398 virtual bool GetInterfaces(
399 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700400 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700401 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
402
403 // Returns information about network interfaces as a JSON string.
404 virtual void GetInterfacesAsync(
405 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700406 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700407 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
408
409 // Tests ICMP connectivity to a specified host.
410 virtual bool TestICMP(
411 const std::string& in_host,
412 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700413 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700414 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
415
416 // Tests ICMP connectivity to a specified host.
417 virtual void TestICMPAsync(
418 const std::string& in_host,
419 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700420 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700421 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
422
423 // Tests ICMP connectivity to a specified host (with options).
424 virtual bool TestICMPWithOptions(
425 const std::string& in_host,
426 const std::map<std::string, std::string>& in_options,
427 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700428 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700429 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
430
431 // Tests ICMP connectivity to a specified host (with options).
432 virtual void TestICMPWithOptionsAsync(
433 const std::string& in_host,
434 const std::map<std::string, std::string>& in_options,
435 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700436 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700437 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
438
439 // Runs BatteryFirmware utility.
440 virtual bool BatteryFirmware(
441 const std::string& in_option,
442 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700443 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700444 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
445
446 // Runs BatteryFirmware utility.
447 virtual void BatteryFirmwareAsync(
448 const std::string& in_option,
449 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700450 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700451 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
452
453 // Runs Smartctl utility.
454 virtual bool Smartctl(
455 const std::string& in_option,
456 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700457 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700458 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
459
460 // Runs Smartctl utility.
461 virtual void SmartctlAsync(
462 const std::string& in_option,
463 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700464 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700465 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
466
467 // Starts running memtester.
468 virtual bool MemtesterStart(
469 const dbus::FileDescriptor& in_outfd,
470 uint32_t in_memory,
471 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700472 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700473 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
474
475 // Starts running memtester.
476 virtual void MemtesterStartAsync(
477 const dbus::FileDescriptor& in_outfd,
478 uint32_t in_memory,
479 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700480 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700481 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
482
483 // Stops running memtester.
484 virtual bool MemtesterStop(
485 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700486 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700487 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
488
489 // Stops running memtester.
490 virtual void MemtesterStopAsync(
491 const std::string& in_handle,
492 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700493 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700494 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
495
496 // Starts running badblocks test.
497 virtual bool BadblocksStart(
498 const dbus::FileDescriptor& in_outfd,
499 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700500 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700501 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
502
503 // Starts running badblocks test.
504 virtual void BadblocksStartAsync(
505 const dbus::FileDescriptor& in_outfd,
506 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700507 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700508 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
509
510 // Stops running badblocks.
511 virtual bool BadblocksStop(
512 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700513 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700514 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
515
516 // Stops running badblocks.
517 virtual void BadblocksStopAsync(
518 const std::string& in_handle,
519 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700520 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700521 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
522
523 // Starts a packet capture with the specified options, with diagnostic
524 // status directed to the "statfd" file descriptor and packet capture
525 // data sent to the "outfd" file descriptor. The returned opaque string
526 // functions as a handle for this particular packet capture. Multiple
527 // captures can be running at once. Captures can be initiated on
528 // Ethernet-like devices or WiFi devices in "client mode" (showing only
529 // Ethernet frames) by specifying the "device" parameter (see below).
530 // By specifying a channel, the script will find or create a "monitor
531 // mode" interface if one is available and produce an "over the air"
532 // packet capture. The name of the output packet capture file is sent
533 // to the output file descriptor.
534 virtual bool PacketCaptureStart(
535 const dbus::FileDescriptor& in_statfd,
536 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700537 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700538 std::string* out_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700539 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700540 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
541
542 // Starts a packet capture with the specified options, with diagnostic
543 // status directed to the "statfd" file descriptor and packet capture
544 // data sent to the "outfd" file descriptor. The returned opaque string
545 // functions as a handle for this particular packet capture. Multiple
546 // captures can be running at once. Captures can be initiated on
547 // Ethernet-like devices or WiFi devices in "client mode" (showing only
548 // Ethernet frames) by specifying the "device" parameter (see below).
549 // By specifying a channel, the script will find or create a "monitor
550 // mode" interface if one is available and produce an "over the air"
551 // packet capture. The name of the output packet capture file is sent
552 // to the output file descriptor.
553 virtual void PacketCaptureStartAsync(
554 const dbus::FileDescriptor& in_statfd,
555 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700556 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700557 const base::Callback<void(const std::string& /*handle*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700558 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700559 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
560
561 // Stops a running packet capture.
562 virtual bool PacketCaptureStop(
563 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700564 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700565 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
566
567 // Stops a running packet capture.
568 virtual void PacketCaptureStopAsync(
569 const std::string& in_handle,
570 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700571 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700572 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
573
574 // Triggers show-task-states(T) SysRq.
575 // See https://www.kernel.org/doc/Documentation/sysrq.txt.
576 virtual bool LogKernelTaskStates(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700577 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700578 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
579
580 // Triggers show-task-states(T) SysRq.
581 // See https://www.kernel.org/doc/Documentation/sysrq.txt.
582 virtual void LogKernelTaskStatesAsync(
583 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700584 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700585 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
586
587 // Triggers uploading of system crashes (the crash_sender program).
588 virtual bool UploadCrashes(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700589 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700590 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
591
592 // Triggers uploading of system crashes (the crash_sender program).
593 virtual void UploadCrashesAsync(
594 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700595 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700596 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
597
598 // Removes rootfs verification. Requires a system reboot before it will
599 // take effect. Restricted to pre-owner dev mode.
600 virtual bool RemoveRootfsVerification(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700601 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700602 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
603
604 // Removes rootfs verification. Requires a system reboot before it will
605 // take effect. Restricted to pre-owner dev mode.
606 virtual void RemoveRootfsVerificationAsync(
607 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700608 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700609 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
610
611 // Enables OS booting from a USB image. Restricted to pre-owner dev mode.
612 virtual bool EnableBootFromUsb(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700613 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700614 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
615
616 // Enables OS booting from a USB image. Restricted to pre-owner dev mode.
617 virtual void EnableBootFromUsbAsync(
618 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700619 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700620 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
621
622 // Sets up sshd to provide an SSH server immediately and on future reboots.
623 // Also installs the test SSH keys to allow access by cros tools. Requires
624 // that rootfs verification has been removed. Restricted to pre-owner dev
625 // mode.
626 virtual bool ConfigureSshServer(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700627 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700628 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
629
630 // Sets up sshd to provide an SSH server immediately and on future reboots.
631 // Also installs the test SSH keys to allow access by cros tools. Requires
632 // that rootfs verification has been removed. Restricted to pre-owner dev
633 // mode.
634 virtual void ConfigureSshServerAsync(
635 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700636 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700637 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
638
639 // Sets both the system and dev mode password for the indicated account.
640 // Restricted to pre-owner dev mode.
641 virtual bool SetUserPassword(
642 const std::string& in_username,
643 const std::string& in_password,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700644 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700645 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
646
647 // Sets both the system and dev mode password for the indicated account.
648 // Restricted to pre-owner dev mode.
649 virtual void SetUserPasswordAsync(
650 const std::string& in_username,
651 const std::string& in_password,
652 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700653 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700654 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
655
656 // Sets up Chrome for remote debugging. It will take effect after a reboot
657 // and using port 9222.
658 // Requires that rootfs verification has been removed. Restricted to
659 // pre-owner dev mode.
660 virtual bool EnableChromeRemoteDebugging(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700661 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700662 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
663
664 // Sets up Chrome for remote debugging. It will take effect after a reboot
665 // and using port 9222.
666 // Requires that rootfs verification has been removed. Restricted to
667 // pre-owner dev mode.
668 virtual void EnableChromeRemoteDebuggingAsync(
669 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700670 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700671 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
672
673 // Convenience function to enable a predefined set of tools from the Chrome
674 // UI. Equivalent to calling these functions in order:
675 // 1. EnableBootFromUsb()
676 // 2. ConfigureSshServer()
677 // 3. SetUserPassword("root", root_password)
678 // Requires that rootfs verification has been removed. If any sub-function
679 // fails, this function will exit with an error without attempting any
680 // further configuration or rollback. Restricted to pre-owner dev mode.
681 virtual bool EnableChromeDevFeatures(
682 const std::string& in_root_password,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700683 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700684 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
685
686 // Convenience function to enable a predefined set of tools from the Chrome
687 // UI. Equivalent to calling these functions in order:
688 // 1. EnableBootFromUsb()
689 // 2. ConfigureSshServer()
690 // 3. SetUserPassword("root", root_password)
691 // Requires that rootfs verification has been removed. If any sub-function
692 // fails, this function will exit with an error without attempting any
693 // further configuration or rollback. Restricted to pre-owner dev mode.
694 virtual void EnableChromeDevFeaturesAsync(
695 const std::string& in_root_password,
696 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700697 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700698 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
699
700 // Queries which dev features have been enabled. Each dev feature will be
701 // indicated by a bit flag in the return value. Flags are defined in the
702 // DevFeatureFlag enumeration. If the dev tools are unavailable (system is
703 // not in dev mode/pre-login state), the DEV_FEATURES_DISABLED flag will be
704 // set and the rest of the bits will always be set to 0.
705 virtual bool QueryDevFeatures(
706 int32_t* out_features,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700707 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700708 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
709
710 // Queries which dev features have been enabled. Each dev feature will be
711 // indicated by a bit flag in the return value. Flags are defined in the
712 // DevFeatureFlag enumeration. If the dev tools are unavailable (system is
713 // not in dev mode/pre-login state), the DEV_FEATURES_DISABLED flag will be
714 // set and the rest of the bits will always be set to 0.
715 virtual void QueryDevFeaturesAsync(
716 const base::Callback<void(int32_t /*features*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700717 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700718 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
719
720 // Allow uploading of device coredump files.
721 virtual bool EnableDevCoredumpUpload(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700722 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700723 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
724
725 // Allow uploading of device coredump files.
726 virtual void EnableDevCoredumpUploadAsync(
727 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700728 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700729 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
730
731 // Disallow uploading of device coredump files.
732 virtual bool DisableDevCoredumpUpload(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700733 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700734 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
735
736 // Disallow uploading of device coredump files.
737 virtual void DisableDevCoredumpUploadAsync(
738 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700739 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700740 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
741};
742
743} // namespace chromium
744} // namespace org
745
746namespace org {
747namespace chromium {
748
749// Interface proxy for org::chromium::debugd.
750class debugdProxy final : public debugdProxyInterface {
751 public:
752 debugdProxy(const scoped_refptr<dbus::Bus>& bus) :
753 bus_{bus},
754 dbus_object_proxy_{
755 bus_->GetObjectProxy(service_name_, object_path_)} {
756 }
757
758 ~debugdProxy() override {
759 bus_->RemoveObjectProxy(
760 service_name_, object_path_, base::Bind(&base::DoNothing));
761 }
762
763 void ReleaseObjectProxy(const base::Closure& callback) {
764 bus_->RemoveObjectProxy(service_name_, object_path_, callback);
765 }
766
767 const dbus::ObjectPath& GetObjectPath() const {
768 return object_path_;
769 }
770
771 dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
772
773 // Starts pinging the specified hostname with the specified options, with
774 // output directed to the given output file descriptor. The returned opaque
775 // string functions as a handle for this particular ping. Multiple pings
776 // can be running at once.
777 bool PingStart(
778 const dbus::FileDescriptor& in_outfd,
779 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700780 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700781 std::string* out_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700782 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700783 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700784 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700785 timeout_ms,
786 dbus_object_proxy_,
787 "org.chromium.debugd",
788 "PingStart",
789 error,
790 in_outfd,
791 in_destination,
792 in_options);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700793 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -0700794 response.get(), error, out_handle);
795 }
796
797 // Starts pinging the specified hostname with the specified options, with
798 // output directed to the given output file descriptor. The returned opaque
799 // string functions as a handle for this particular ping. Multiple pings
800 // can be running at once.
801 void PingStartAsync(
802 const dbus::FileDescriptor& in_outfd,
803 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700804 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700805 const base::Callback<void(const std::string& /*handle*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700806 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700807 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700808 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700809 timeout_ms,
810 dbus_object_proxy_,
811 "org.chromium.debugd",
812 "PingStart",
813 success_callback,
814 error_callback,
815 in_outfd,
816 in_destination,
817 in_options);
818 }
819
820 // Stops a running ping.
821 bool PingStop(
822 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700823 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700824 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700825 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700826 timeout_ms,
827 dbus_object_proxy_,
828 "org.chromium.debugd",
829 "PingStop",
830 error,
831 in_handle);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700832 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -0700833 response.get(), error);
834 }
835
836 // Stops a running ping.
837 void PingStopAsync(
838 const std::string& in_handle,
839 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700840 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700841 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700842 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700843 timeout_ms,
844 dbus_object_proxy_,
845 "org.chromium.debugd",
846 "PingStop",
847 success_callback,
848 error_callback,
849 in_handle);
850 }
851
852 // Start system/kernel tracing. If tracing is already enabled it is
853 // stopped first and any collected events are discarded. The kernel
854 // must have been configured to support tracing.
855 bool SystraceStart(
856 const std::string& in_categories,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700857 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700858 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700859 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700860 timeout_ms,
861 dbus_object_proxy_,
862 "org.chromium.debugd",
863 "SystraceStart",
864 error,
865 in_categories);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700866 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -0700867 response.get(), error);
868 }
869
870 // Start system/kernel tracing. If tracing is already enabled it is
871 // stopped first and any collected events are discarded. The kernel
872 // must have been configured to support tracing.
873 void SystraceStartAsync(
874 const std::string& in_categories,
875 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700876 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700877 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700878 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700879 timeout_ms,
880 dbus_object_proxy_,
881 "org.chromium.debugd",
882 "SystraceStart",
883 success_callback,
884 error_callback,
885 in_categories);
886 }
887
888 // Stop system/kernel tracing and write the collected event data.
889 bool SystraceStop(
890 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700891 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700892 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700893 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700894 timeout_ms,
895 dbus_object_proxy_,
896 "org.chromium.debugd",
897 "SystraceStop",
898 error,
899 in_outfd);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700900 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -0700901 response.get(), error);
902 }
903
904 // Stop system/kernel tracing and write the collected event data.
905 void SystraceStopAsync(
906 const dbus::FileDescriptor& in_outfd,
907 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700908 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700909 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700910 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700911 timeout_ms,
912 dbus_object_proxy_,
913 "org.chromium.debugd",
914 "SystraceStop",
915 success_callback,
916 error_callback,
917 in_outfd);
918 }
919
920 // Return current status for system/kernel tracing including whether it
921 // is enabled, the tracing clock, and the set of events enabled.
922 bool SystraceStatus(
923 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700924 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700925 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700926 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700927 timeout_ms,
928 dbus_object_proxy_,
929 "org.chromium.debugd",
930 "SystraceStatus",
931 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700932 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -0700933 response.get(), error, out_status);
934 }
935
936 // Return current status for system/kernel tracing including whether it
937 // is enabled, the tracing clock, and the set of events enabled.
938 void SystraceStatusAsync(
939 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700940 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700941 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700942 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700943 timeout_ms,
944 dbus_object_proxy_,
945 "org.chromium.debugd",
946 "SystraceStatus",
947 success_callback,
948 error_callback);
949 }
950
951 bool TracePathStart(
952 const dbus::FileDescriptor& in_outfd,
953 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700954 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700955 std::string* out_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700956 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700957 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700958 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700959 timeout_ms,
960 dbus_object_proxy_,
961 "org.chromium.debugd",
962 "TracePathStart",
963 error,
964 in_outfd,
965 in_destination,
966 in_options);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700967 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -0700968 response.get(), error, out_handle);
969 }
970
971 void TracePathStartAsync(
972 const dbus::FileDescriptor& in_outfd,
973 const std::string& in_destination,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700974 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -0700975 const base::Callback<void(const std::string& /*handle*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700976 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -0700977 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700978 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700979 timeout_ms,
980 dbus_object_proxy_,
981 "org.chromium.debugd",
982 "TracePathStart",
983 success_callback,
984 error_callback,
985 in_outfd,
986 in_destination,
987 in_options);
988 }
989
990 // Stops a running tracepath.
991 bool TracePathStop(
992 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700993 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -0700994 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -0700995 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -0700996 timeout_ms,
997 dbus_object_proxy_,
998 "org.chromium.debugd",
999 "TracePathStop",
1000 error,
1001 in_handle);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001002 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001003 response.get(), error);
1004 }
1005
1006 // Stops a running tracepath.
1007 void TracePathStopAsync(
1008 const std::string& in_handle,
1009 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001010 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001011 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001012 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001013 timeout_ms,
1014 dbus_object_proxy_,
1015 "org.chromium.debugd",
1016 "TracePathStop",
1017 success_callback,
1018 error_callback,
1019 in_handle);
1020 }
1021
1022 // Returns the routing table.
1023 bool GetRoutes(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001024 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -07001025 std::vector<std::string>* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001026 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001027 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001028 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001029 timeout_ms,
1030 dbus_object_proxy_,
1031 "org.chromium.debugd",
1032 "GetRoutes",
1033 error,
1034 in_options);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001035 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001036 response.get(), error, out_result);
1037 }
1038
1039 // Returns the routing table.
1040 void GetRoutesAsync(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001041 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -07001042 const base::Callback<void(const std::vector<std::string>& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001043 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001044 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001045 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001046 timeout_ms,
1047 dbus_object_proxy_,
1048 "org.chromium.debugd",
1049 "GetRoutes",
1050 success_callback,
1051 error_callback,
1052 in_options);
1053 }
1054
1055 // Returns modem information as a JSON string. See the design document for
1056 // a rationale.
1057 bool GetModemStatus(
1058 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001059 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001060 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001061 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001062 timeout_ms,
1063 dbus_object_proxy_,
1064 "org.chromium.debugd",
1065 "GetModemStatus",
1066 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001067 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001068 response.get(), error, out_status);
1069 }
1070
1071 // Returns modem information as a JSON string. See the design document for
1072 // a rationale.
1073 void GetModemStatusAsync(
1074 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001075 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001076 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001077 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001078 timeout_ms,
1079 dbus_object_proxy_,
1080 "org.chromium.debugd",
1081 "GetModemStatus",
1082 success_callback,
1083 error_callback);
1084 }
1085
1086 // Runs the specified command through the modem serial interface and
1087 // returns the output.
1088 bool RunModemCommand(
1089 const std::string& in_command,
1090 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001091 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001092 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001093 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001094 timeout_ms,
1095 dbus_object_proxy_,
1096 "org.chromium.debugd",
1097 "RunModemCommand",
1098 error,
1099 in_command);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001100 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001101 response.get(), error, out_status);
1102 }
1103
1104 // Runs the specified command through the modem serial interface and
1105 // returns the output.
1106 void RunModemCommandAsync(
1107 const std::string& in_command,
1108 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001109 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001110 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001111 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001112 timeout_ms,
1113 dbus_object_proxy_,
1114 "org.chromium.debugd",
1115 "RunModemCommand",
1116 success_callback,
1117 error_callback,
1118 in_command);
1119 }
1120
1121 // Returns network information as a JSON string. See the design document
1122 // for a rationale.
1123 bool GetNetworkStatus(
1124 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001125 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001126 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001127 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001128 timeout_ms,
1129 dbus_object_proxy_,
1130 "org.chromium.debugd",
1131 "GetNetworkStatus",
1132 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001133 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001134 response.get(), error, out_status);
1135 }
1136
1137 // Returns network information as a JSON string. See the design document
1138 // for a rationale.
1139 void GetNetworkStatusAsync(
1140 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001141 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001142 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001143 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001144 timeout_ms,
1145 dbus_object_proxy_,
1146 "org.chromium.debugd",
1147 "GetNetworkStatus",
1148 success_callback,
1149 error_callback);
1150 }
1151
1152 // Returns WiMAX information as a JSON string. See the design document for
1153 // a rationale.
1154 bool GetWiMaxStatus(
1155 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001156 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001157 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001158 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001159 timeout_ms,
1160 dbus_object_proxy_,
1161 "org.chromium.debugd",
1162 "GetWiMaxStatus",
1163 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001164 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001165 response.get(), error, out_status);
1166 }
1167
1168 // Returns WiMAX information as a JSON string. See the design document for
1169 // a rationale.
1170 void GetWiMaxStatusAsync(
1171 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001172 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001173 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001174 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001175 timeout_ms,
1176 dbus_object_proxy_,
1177 "org.chromium.debugd",
1178 "GetWiMaxStatus",
1179 success_callback,
1180 error_callback);
1181 }
1182
1183 // Runs system-wide perf profiling. The profile parameters are selected by
1184 // perf_args.
1185 bool GetPerfOutput(
1186 uint32_t in_duration_sec,
1187 const std::vector<std::string>& in_perf_args,
1188 int32_t* out_status,
1189 std::vector<uint8_t>* out_perf_data,
1190 std::vector<uint8_t>* out_perf_stat,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001191 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001192 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001193 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001194 timeout_ms,
1195 dbus_object_proxy_,
1196 "org.chromium.debugd",
1197 "GetPerfOutput",
1198 error,
1199 in_duration_sec,
1200 in_perf_args);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001201 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001202 response.get(), error, out_status, out_perf_data, out_perf_stat);
1203 }
1204
1205 // Runs system-wide perf profiling. The profile parameters are selected by
1206 // perf_args.
1207 void GetPerfOutputAsync(
1208 uint32_t in_duration_sec,
1209 const std::vector<std::string>& in_perf_args,
1210 const base::Callback<void(int32_t /*status*/, const std::vector<uint8_t>& /*perf_data*/, const std::vector<uint8_t>& /*perf_stat*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001211 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001212 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001213 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001214 timeout_ms,
1215 dbus_object_proxy_,
1216 "org.chromium.debugd",
1217 "GetPerfOutput",
1218 success_callback,
1219 error_callback,
1220 in_duration_sec,
1221 in_perf_args);
1222 }
1223
1224 // Runs system-wide perf profiling. It can can profile events other than
1225 // cycles (example: iTLB-misses), and can collect branch profiles. It can
1226 // also return raw counter values. The exact profile or counters to be
1227 // collected is chosen at random and depends on what CPU is used by the
1228 // system (certain CPUs do not support certain profiling modes).
1229 bool GetRandomPerfOutput(
1230 uint32_t in_duration_sec,
1231 int32_t* out_status,
1232 std::vector<uint8_t>* out_perf_data,
1233 std::vector<uint8_t>* out_perf_stat,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001234 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001235 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001236 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001237 timeout_ms,
1238 dbus_object_proxy_,
1239 "org.chromium.debugd",
1240 "GetRandomPerfOutput",
1241 error,
1242 in_duration_sec);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001243 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001244 response.get(), error, out_status, out_perf_data, out_perf_stat);
1245 }
1246
1247 // Runs system-wide perf profiling. It can can profile events other than
1248 // cycles (example: iTLB-misses), and can collect branch profiles. It can
1249 // also return raw counter values. The exact profile or counters to be
1250 // collected is chosen at random and depends on what CPU is used by the
1251 // system (certain CPUs do not support certain profiling modes).
1252 void GetRandomPerfOutputAsync(
1253 uint32_t in_duration_sec,
1254 const base::Callback<void(int32_t /*status*/, const std::vector<uint8_t>& /*perf_data*/, const std::vector<uint8_t>& /*perf_stat*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001255 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001256 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001257 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001258 timeout_ms,
1259 dbus_object_proxy_,
1260 "org.chromium.debugd",
1261 "GetRandomPerfOutput",
1262 success_callback,
1263 error_callback,
1264 in_duration_sec);
1265 }
1266
1267 // Returns perf event data. Does systemwide profiling. It can profile
1268 // events other than cycles (example: iTLB-misses), and can collect branch
1269 // profiles. The exact profile to be collected is chosen at random
1270 // and depends on what CPU is used by the system (certain CPUs do not
1271 // support certain profiling modes).
1272 bool GetRichPerfData(
1273 uint32_t in_duration_sec,
1274 std::vector<uint8_t>* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001275 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001276 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001277 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001278 timeout_ms,
1279 dbus_object_proxy_,
1280 "org.chromium.debugd",
1281 "GetRichPerfData",
1282 error,
1283 in_duration_sec);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001284 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001285 response.get(), error, out_status);
1286 }
1287
1288 // Returns perf event data. Does systemwide profiling. It can profile
1289 // events other than cycles (example: iTLB-misses), and can collect branch
1290 // profiles. The exact profile to be collected is chosen at random
1291 // and depends on what CPU is used by the system (certain CPUs do not
1292 // support certain profiling modes).
1293 void GetRichPerfDataAsync(
1294 uint32_t in_duration_sec,
1295 const base::Callback<void(const std::vector<uint8_t>& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001296 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001297 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001298 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001299 timeout_ms,
1300 dbus_object_proxy_,
1301 "org.chromium.debugd",
1302 "GetRichPerfData",
1303 success_callback,
1304 error_callback,
1305 in_duration_sec);
1306 }
1307
1308 // DEPRECATED: Use DumpDebugLogs instead.
1309 // Packages up system logs into a .tar.gz and returns it over the supplied
1310 // file descriptor.
1311 bool GetDebugLogs(
1312 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001313 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001314 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001315 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001316 timeout_ms,
1317 dbus_object_proxy_,
1318 "org.chromium.debugd",
1319 "GetDebugLogs",
1320 error,
1321 in_outfd);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001322 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001323 response.get(), error);
1324 }
1325
1326 // DEPRECATED: Use DumpDebugLogs instead.
1327 // Packages up system logs into a .tar.gz and returns it over the supplied
1328 // file descriptor.
1329 void GetDebugLogsAsync(
1330 const dbus::FileDescriptor& in_outfd,
1331 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001332 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001333 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001334 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001335 timeout_ms,
1336 dbus_object_proxy_,
1337 "org.chromium.debugd",
1338 "GetDebugLogs",
1339 success_callback,
1340 error_callback,
1341 in_outfd);
1342 }
1343
1344 // Packages up system logs into a .tar(.gz) and returns it over the
1345 // supplied file descriptor.
1346 bool DumpDebugLogs(
1347 bool in_is_compressed,
1348 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001349 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001350 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001351 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001352 timeout_ms,
1353 dbus_object_proxy_,
1354 "org.chromium.debugd",
1355 "DumpDebugLogs",
1356 error,
1357 in_is_compressed,
1358 in_outfd);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001359 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001360 response.get(), error);
1361 }
1362
1363 // Packages up system logs into a .tar(.gz) and returns it over the
1364 // supplied file descriptor.
1365 void DumpDebugLogsAsync(
1366 bool in_is_compressed,
1367 const dbus::FileDescriptor& in_outfd,
1368 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001369 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001370 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001371 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001372 timeout_ms,
1373 dbus_object_proxy_,
1374 "org.chromium.debugd",
1375 "DumpDebugLogs",
1376 success_callback,
1377 error_callback,
1378 in_is_compressed,
1379 in_outfd);
1380 }
1381
1382 // Enables or disables debug mode for a specified subsystem.
1383 bool SetDebugMode(
1384 const std::string& in_subsystem,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001385 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001386 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001387 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001388 timeout_ms,
1389 dbus_object_proxy_,
1390 "org.chromium.debugd",
1391 "SetDebugMode",
1392 error,
1393 in_subsystem);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001394 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001395 response.get(), error);
1396 }
1397
1398 // Enables or disables debug mode for a specified subsystem.
1399 void SetDebugModeAsync(
1400 const std::string& in_subsystem,
1401 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001402 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001403 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001404 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001405 timeout_ms,
1406 dbus_object_proxy_,
1407 "org.chromium.debugd",
1408 "SetDebugMode",
1409 success_callback,
1410 error_callback,
1411 in_subsystem);
1412 }
1413
1414 // Fetches the contents of a single system log, identified by name. See
1415 // /src/log_tool.cc for a list of valid names.
1416 bool GetLog(
1417 const std::string& in_log,
1418 std::string* out_contents,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001419 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001420 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001421 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001422 timeout_ms,
1423 dbus_object_proxy_,
1424 "org.chromium.debugd",
1425 "GetLog",
1426 error,
1427 in_log);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001428 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001429 response.get(), error, out_contents);
1430 }
1431
1432 // Fetches the contents of a single system log, identified by name. See
1433 // /src/log_tool.cc for a list of valid names.
1434 void GetLogAsync(
1435 const std::string& in_log,
1436 const base::Callback<void(const std::string& /*contents*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001437 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001438 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001439 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001440 timeout_ms,
1441 dbus_object_proxy_,
1442 "org.chromium.debugd",
1443 "GetLog",
1444 success_callback,
1445 error_callback,
1446 in_log);
1447 }
1448
1449 // Returns all the system logs.
1450 bool GetAllLogs(
1451 std::map<std::string, std::string>* out_logs,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001452 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001453 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001454 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001455 timeout_ms,
1456 dbus_object_proxy_,
1457 "org.chromium.debugd",
1458 "GetAllLogs",
1459 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001460 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001461 response.get(), error, out_logs);
1462 }
1463
1464 // Returns all the system logs.
1465 void GetAllLogsAsync(
1466 const base::Callback<void(const std::map<std::string, std::string>& /*logs*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001467 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001468 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001469 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001470 timeout_ms,
1471 dbus_object_proxy_,
1472 "org.chromium.debugd",
1473 "GetAllLogs",
1474 success_callback,
1475 error_callback);
1476 }
1477
1478 // Returns system logs for feedback reports.
1479 bool GetFeedbackLogs(
1480 std::map<std::string, std::string>* out_logs,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001481 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001482 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001483 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001484 timeout_ms,
1485 dbus_object_proxy_,
1486 "org.chromium.debugd",
1487 "GetFeedbackLogs",
1488 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001489 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001490 response.get(), error, out_logs);
1491 }
1492
1493 // Returns system logs for feedback reports.
1494 void GetFeedbackLogsAsync(
1495 const base::Callback<void(const std::map<std::string, std::string>& /*logs*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001496 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001497 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001498 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001499 timeout_ms,
1500 dbus_object_proxy_,
1501 "org.chromium.debugd",
1502 "GetFeedbackLogs",
1503 success_callback,
1504 error_callback);
1505 }
1506
1507 // Returns list of User log file names that Chrome itself must collect.
1508 // These logfiles are relative to the user's profile path and must be
1509 // collected separately for each user.
1510 bool GetUserLogFiles(
1511 std::map<std::string, std::string>* out_user_log_files,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001512 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001513 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001514 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001515 timeout_ms,
1516 dbus_object_proxy_,
1517 "org.chromium.debugd",
1518 "GetUserLogFiles",
1519 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001520 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001521 response.get(), error, out_user_log_files);
1522 }
1523
1524 // Returns list of User log file names that Chrome itself must collect.
1525 // These logfiles are relative to the user's profile path and must be
1526 // collected separately for each user.
1527 void GetUserLogFilesAsync(
1528 const base::Callback<void(const std::map<std::string, std::string>& /*user_log_files*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001529 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001530 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001531 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001532 timeout_ms,
1533 dbus_object_proxy_,
1534 "org.chromium.debugd",
1535 "GetUserLogFiles",
1536 success_callback,
1537 error_callback);
1538 }
1539
1540 // Example method. See /doc/hacking.md.
1541 bool GetExample(
1542 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001543 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001544 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001545 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001546 timeout_ms,
1547 dbus_object_proxy_,
1548 "org.chromium.debugd",
1549 "GetExample",
1550 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001551 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001552 response.get(), error, out_result);
1553 }
1554
1555 // Example method. See /doc/hacking.md.
1556 void GetExampleAsync(
1557 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001558 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001559 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001560 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001561 timeout_ms,
1562 dbus_object_proxy_,
1563 "org.chromium.debugd",
1564 "GetExample",
1565 success_callback,
1566 error_callback);
1567 }
1568
1569 // Returns information about network interfaces as a JSON string.
1570 bool GetInterfaces(
1571 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001572 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001573 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001574 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001575 timeout_ms,
1576 dbus_object_proxy_,
1577 "org.chromium.debugd",
1578 "GetInterfaces",
1579 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001580 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001581 response.get(), error, out_result);
1582 }
1583
1584 // Returns information about network interfaces as a JSON string.
1585 void GetInterfacesAsync(
1586 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001587 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001588 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001589 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001590 timeout_ms,
1591 dbus_object_proxy_,
1592 "org.chromium.debugd",
1593 "GetInterfaces",
1594 success_callback,
1595 error_callback);
1596 }
1597
1598 // Tests ICMP connectivity to a specified host.
1599 bool TestICMP(
1600 const std::string& in_host,
1601 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001602 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001603 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001604 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001605 timeout_ms,
1606 dbus_object_proxy_,
1607 "org.chromium.debugd",
1608 "TestICMP",
1609 error,
1610 in_host);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001611 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001612 response.get(), error, out_result);
1613 }
1614
1615 // Tests ICMP connectivity to a specified host.
1616 void TestICMPAsync(
1617 const std::string& in_host,
1618 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001619 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001620 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001621 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001622 timeout_ms,
1623 dbus_object_proxy_,
1624 "org.chromium.debugd",
1625 "TestICMP",
1626 success_callback,
1627 error_callback,
1628 in_host);
1629 }
1630
1631 // Tests ICMP connectivity to a specified host (with options).
1632 bool TestICMPWithOptions(
1633 const std::string& in_host,
1634 const std::map<std::string, std::string>& in_options,
1635 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001636 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001637 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001638 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001639 timeout_ms,
1640 dbus_object_proxy_,
1641 "org.chromium.debugd",
1642 "TestICMPWithOptions",
1643 error,
1644 in_host,
1645 in_options);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001646 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001647 response.get(), error, out_result);
1648 }
1649
1650 // Tests ICMP connectivity to a specified host (with options).
1651 void TestICMPWithOptionsAsync(
1652 const std::string& in_host,
1653 const std::map<std::string, std::string>& in_options,
1654 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001655 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001656 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001657 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001658 timeout_ms,
1659 dbus_object_proxy_,
1660 "org.chromium.debugd",
1661 "TestICMPWithOptions",
1662 success_callback,
1663 error_callback,
1664 in_host,
1665 in_options);
1666 }
1667
1668 // Runs BatteryFirmware utility.
1669 bool BatteryFirmware(
1670 const std::string& in_option,
1671 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001672 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001673 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001674 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001675 timeout_ms,
1676 dbus_object_proxy_,
1677 "org.chromium.debugd",
1678 "BatteryFirmware",
1679 error,
1680 in_option);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001681 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001682 response.get(), error, out_result);
1683 }
1684
1685 // Runs BatteryFirmware utility.
1686 void BatteryFirmwareAsync(
1687 const std::string& in_option,
1688 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001689 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001690 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001691 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001692 timeout_ms,
1693 dbus_object_proxy_,
1694 "org.chromium.debugd",
1695 "BatteryFirmware",
1696 success_callback,
1697 error_callback,
1698 in_option);
1699 }
1700
1701 // Runs Smartctl utility.
1702 bool Smartctl(
1703 const std::string& in_option,
1704 std::string* out_result,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001705 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001706 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001707 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001708 timeout_ms,
1709 dbus_object_proxy_,
1710 "org.chromium.debugd",
1711 "Smartctl",
1712 error,
1713 in_option);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001714 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001715 response.get(), error, out_result);
1716 }
1717
1718 // Runs Smartctl utility.
1719 void SmartctlAsync(
1720 const std::string& in_option,
1721 const base::Callback<void(const std::string& /*result*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001722 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001723 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001724 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001725 timeout_ms,
1726 dbus_object_proxy_,
1727 "org.chromium.debugd",
1728 "Smartctl",
1729 success_callback,
1730 error_callback,
1731 in_option);
1732 }
1733
1734 // Starts running memtester.
1735 bool MemtesterStart(
1736 const dbus::FileDescriptor& in_outfd,
1737 uint32_t in_memory,
1738 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001739 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001740 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001741 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001742 timeout_ms,
1743 dbus_object_proxy_,
1744 "org.chromium.debugd",
1745 "MemtesterStart",
1746 error,
1747 in_outfd,
1748 in_memory);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001749 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001750 response.get(), error, out_status);
1751 }
1752
1753 // Starts running memtester.
1754 void MemtesterStartAsync(
1755 const dbus::FileDescriptor& in_outfd,
1756 uint32_t in_memory,
1757 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001758 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001759 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001760 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001761 timeout_ms,
1762 dbus_object_proxy_,
1763 "org.chromium.debugd",
1764 "MemtesterStart",
1765 success_callback,
1766 error_callback,
1767 in_outfd,
1768 in_memory);
1769 }
1770
1771 // Stops running memtester.
1772 bool MemtesterStop(
1773 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001774 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001775 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001776 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001777 timeout_ms,
1778 dbus_object_proxy_,
1779 "org.chromium.debugd",
1780 "MemtesterStop",
1781 error,
1782 in_handle);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001783 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001784 response.get(), error);
1785 }
1786
1787 // Stops running memtester.
1788 void MemtesterStopAsync(
1789 const std::string& in_handle,
1790 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001791 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001792 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001793 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001794 timeout_ms,
1795 dbus_object_proxy_,
1796 "org.chromium.debugd",
1797 "MemtesterStop",
1798 success_callback,
1799 error_callback,
1800 in_handle);
1801 }
1802
1803 // Starts running badblocks test.
1804 bool BadblocksStart(
1805 const dbus::FileDescriptor& in_outfd,
1806 std::string* out_status,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001807 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001808 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001809 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001810 timeout_ms,
1811 dbus_object_proxy_,
1812 "org.chromium.debugd",
1813 "BadblocksStart",
1814 error,
1815 in_outfd);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001816 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001817 response.get(), error, out_status);
1818 }
1819
1820 // Starts running badblocks test.
1821 void BadblocksStartAsync(
1822 const dbus::FileDescriptor& in_outfd,
1823 const base::Callback<void(const std::string& /*status*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001824 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001825 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001826 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001827 timeout_ms,
1828 dbus_object_proxy_,
1829 "org.chromium.debugd",
1830 "BadblocksStart",
1831 success_callback,
1832 error_callback,
1833 in_outfd);
1834 }
1835
1836 // Stops running badblocks.
1837 bool BadblocksStop(
1838 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001839 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001840 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001841 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001842 timeout_ms,
1843 dbus_object_proxy_,
1844 "org.chromium.debugd",
1845 "BadblocksStop",
1846 error,
1847 in_handle);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001848 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001849 response.get(), error);
1850 }
1851
1852 // Stops running badblocks.
1853 void BadblocksStopAsync(
1854 const std::string& in_handle,
1855 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001856 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001857 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001858 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001859 timeout_ms,
1860 dbus_object_proxy_,
1861 "org.chromium.debugd",
1862 "BadblocksStop",
1863 success_callback,
1864 error_callback,
1865 in_handle);
1866 }
1867
1868 // Starts a packet capture with the specified options, with diagnostic
1869 // status directed to the "statfd" file descriptor and packet capture
1870 // data sent to the "outfd" file descriptor. The returned opaque string
1871 // functions as a handle for this particular packet capture. Multiple
1872 // captures can be running at once. Captures can be initiated on
1873 // Ethernet-like devices or WiFi devices in "client mode" (showing only
1874 // Ethernet frames) by specifying the "device" parameter (see below).
1875 // By specifying a channel, the script will find or create a "monitor
1876 // mode" interface if one is available and produce an "over the air"
1877 // packet capture. The name of the output packet capture file is sent
1878 // to the output file descriptor.
1879 bool PacketCaptureStart(
1880 const dbus::FileDescriptor& in_statfd,
1881 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001882 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -07001883 std::string* out_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001884 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001885 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001886 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001887 timeout_ms,
1888 dbus_object_proxy_,
1889 "org.chromium.debugd",
1890 "PacketCaptureStart",
1891 error,
1892 in_statfd,
1893 in_outfd,
1894 in_options);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001895 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001896 response.get(), error, out_handle);
1897 }
1898
1899 // Starts a packet capture with the specified options, with diagnostic
1900 // status directed to the "statfd" file descriptor and packet capture
1901 // data sent to the "outfd" file descriptor. The returned opaque string
1902 // functions as a handle for this particular packet capture. Multiple
1903 // captures can be running at once. Captures can be initiated on
1904 // Ethernet-like devices or WiFi devices in "client mode" (showing only
1905 // Ethernet frames) by specifying the "device" parameter (see below).
1906 // By specifying a channel, the script will find or create a "monitor
1907 // mode" interface if one is available and produce an "over the air"
1908 // packet capture. The name of the output packet capture file is sent
1909 // to the output file descriptor.
1910 void PacketCaptureStartAsync(
1911 const dbus::FileDescriptor& in_statfd,
1912 const dbus::FileDescriptor& in_outfd,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001913 const brillo::VariantDictionary& in_options,
Alex Deymod5561a52015-09-03 23:17:52 -07001914 const base::Callback<void(const std::string& /*handle*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001915 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001916 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001917 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001918 timeout_ms,
1919 dbus_object_proxy_,
1920 "org.chromium.debugd",
1921 "PacketCaptureStart",
1922 success_callback,
1923 error_callback,
1924 in_statfd,
1925 in_outfd,
1926 in_options);
1927 }
1928
1929 // Stops a running packet capture.
1930 bool PacketCaptureStop(
1931 const std::string& in_handle,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001932 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001933 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001934 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001935 timeout_ms,
1936 dbus_object_proxy_,
1937 "org.chromium.debugd",
1938 "PacketCaptureStop",
1939 error,
1940 in_handle);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001941 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001942 response.get(), error);
1943 }
1944
1945 // Stops a running packet capture.
1946 void PacketCaptureStopAsync(
1947 const std::string& in_handle,
1948 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001949 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001950 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001951 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001952 timeout_ms,
1953 dbus_object_proxy_,
1954 "org.chromium.debugd",
1955 "PacketCaptureStop",
1956 success_callback,
1957 error_callback,
1958 in_handle);
1959 }
1960
1961 // Triggers show-task-states(T) SysRq.
1962 // See https://www.kernel.org/doc/Documentation/sysrq.txt.
1963 bool LogKernelTaskStates(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001964 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001965 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001966 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001967 timeout_ms,
1968 dbus_object_proxy_,
1969 "org.chromium.debugd",
1970 "LogKernelTaskStates",
1971 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001972 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07001973 response.get(), error);
1974 }
1975
1976 // Triggers show-task-states(T) SysRq.
1977 // See https://www.kernel.org/doc/Documentation/sysrq.txt.
1978 void LogKernelTaskStatesAsync(
1979 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001980 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07001981 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001982 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001983 timeout_ms,
1984 dbus_object_proxy_,
1985 "org.chromium.debugd",
1986 "LogKernelTaskStates",
1987 success_callback,
1988 error_callback);
1989 }
1990
1991 // Triggers uploading of system crashes (the crash_sender program).
1992 bool UploadCrashes(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001993 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07001994 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07001995 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07001996 timeout_ms,
1997 dbus_object_proxy_,
1998 "org.chromium.debugd",
1999 "UploadCrashes",
2000 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002001 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002002 response.get(), error);
2003 }
2004
2005 // Triggers uploading of system crashes (the crash_sender program).
2006 void UploadCrashesAsync(
2007 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002008 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002009 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002010 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002011 timeout_ms,
2012 dbus_object_proxy_,
2013 "org.chromium.debugd",
2014 "UploadCrashes",
2015 success_callback,
2016 error_callback);
2017 }
2018
2019 // Removes rootfs verification. Requires a system reboot before it will
2020 // take effect. Restricted to pre-owner dev mode.
2021 bool RemoveRootfsVerification(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002022 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002023 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002024 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002025 timeout_ms,
2026 dbus_object_proxy_,
2027 "org.chromium.debugd",
2028 "RemoveRootfsVerification",
2029 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002030 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002031 response.get(), error);
2032 }
2033
2034 // Removes rootfs verification. Requires a system reboot before it will
2035 // take effect. Restricted to pre-owner dev mode.
2036 void RemoveRootfsVerificationAsync(
2037 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002038 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002039 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002040 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002041 timeout_ms,
2042 dbus_object_proxy_,
2043 "org.chromium.debugd",
2044 "RemoveRootfsVerification",
2045 success_callback,
2046 error_callback);
2047 }
2048
2049 // Enables OS booting from a USB image. Restricted to pre-owner dev mode.
2050 bool EnableBootFromUsb(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002051 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002052 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002053 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002054 timeout_ms,
2055 dbus_object_proxy_,
2056 "org.chromium.debugd",
2057 "EnableBootFromUsb",
2058 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002059 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002060 response.get(), error);
2061 }
2062
2063 // Enables OS booting from a USB image. Restricted to pre-owner dev mode.
2064 void EnableBootFromUsbAsync(
2065 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002066 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002067 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002068 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002069 timeout_ms,
2070 dbus_object_proxy_,
2071 "org.chromium.debugd",
2072 "EnableBootFromUsb",
2073 success_callback,
2074 error_callback);
2075 }
2076
2077 // Sets up sshd to provide an SSH server immediately and on future reboots.
2078 // Also installs the test SSH keys to allow access by cros tools. Requires
2079 // that rootfs verification has been removed. Restricted to pre-owner dev
2080 // mode.
2081 bool ConfigureSshServer(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002082 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002083 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002084 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002085 timeout_ms,
2086 dbus_object_proxy_,
2087 "org.chromium.debugd",
2088 "ConfigureSshServer",
2089 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002090 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002091 response.get(), error);
2092 }
2093
2094 // Sets up sshd to provide an SSH server immediately and on future reboots.
2095 // Also installs the test SSH keys to allow access by cros tools. Requires
2096 // that rootfs verification has been removed. Restricted to pre-owner dev
2097 // mode.
2098 void ConfigureSshServerAsync(
2099 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002100 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002101 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002102 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002103 timeout_ms,
2104 dbus_object_proxy_,
2105 "org.chromium.debugd",
2106 "ConfigureSshServer",
2107 success_callback,
2108 error_callback);
2109 }
2110
2111 // Sets both the system and dev mode password for the indicated account.
2112 // Restricted to pre-owner dev mode.
2113 bool SetUserPassword(
2114 const std::string& in_username,
2115 const std::string& in_password,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002116 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002117 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002118 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002119 timeout_ms,
2120 dbus_object_proxy_,
2121 "org.chromium.debugd",
2122 "SetUserPassword",
2123 error,
2124 in_username,
2125 in_password);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002126 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002127 response.get(), error);
2128 }
2129
2130 // Sets both the system and dev mode password for the indicated account.
2131 // Restricted to pre-owner dev mode.
2132 void SetUserPasswordAsync(
2133 const std::string& in_username,
2134 const std::string& in_password,
2135 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002136 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002137 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002138 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002139 timeout_ms,
2140 dbus_object_proxy_,
2141 "org.chromium.debugd",
2142 "SetUserPassword",
2143 success_callback,
2144 error_callback,
2145 in_username,
2146 in_password);
2147 }
2148
2149 // Sets up Chrome for remote debugging. It will take effect after a reboot
2150 // and using port 9222.
2151 // Requires that rootfs verification has been removed. Restricted to
2152 // pre-owner dev mode.
2153 bool EnableChromeRemoteDebugging(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002154 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002155 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002156 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002157 timeout_ms,
2158 dbus_object_proxy_,
2159 "org.chromium.debugd",
2160 "EnableChromeRemoteDebugging",
2161 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002162 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002163 response.get(), error);
2164 }
2165
2166 // Sets up Chrome for remote debugging. It will take effect after a reboot
2167 // and using port 9222.
2168 // Requires that rootfs verification has been removed. Restricted to
2169 // pre-owner dev mode.
2170 void EnableChromeRemoteDebuggingAsync(
2171 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002172 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002173 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002174 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002175 timeout_ms,
2176 dbus_object_proxy_,
2177 "org.chromium.debugd",
2178 "EnableChromeRemoteDebugging",
2179 success_callback,
2180 error_callback);
2181 }
2182
2183 // Convenience function to enable a predefined set of tools from the Chrome
2184 // UI. Equivalent to calling these functions in order:
2185 // 1. EnableBootFromUsb()
2186 // 2. ConfigureSshServer()
2187 // 3. SetUserPassword("root", root_password)
2188 // Requires that rootfs verification has been removed. If any sub-function
2189 // fails, this function will exit with an error without attempting any
2190 // further configuration or rollback. Restricted to pre-owner dev mode.
2191 bool EnableChromeDevFeatures(
2192 const std::string& in_root_password,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002193 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002194 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002195 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002196 timeout_ms,
2197 dbus_object_proxy_,
2198 "org.chromium.debugd",
2199 "EnableChromeDevFeatures",
2200 error,
2201 in_root_password);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002202 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002203 response.get(), error);
2204 }
2205
2206 // Convenience function to enable a predefined set of tools from the Chrome
2207 // UI. Equivalent to calling these functions in order:
2208 // 1. EnableBootFromUsb()
2209 // 2. ConfigureSshServer()
2210 // 3. SetUserPassword("root", root_password)
2211 // Requires that rootfs verification has been removed. If any sub-function
2212 // fails, this function will exit with an error without attempting any
2213 // further configuration or rollback. Restricted to pre-owner dev mode.
2214 void EnableChromeDevFeaturesAsync(
2215 const std::string& in_root_password,
2216 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002217 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002218 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002219 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002220 timeout_ms,
2221 dbus_object_proxy_,
2222 "org.chromium.debugd",
2223 "EnableChromeDevFeatures",
2224 success_callback,
2225 error_callback,
2226 in_root_password);
2227 }
2228
2229 // Queries which dev features have been enabled. Each dev feature will be
2230 // indicated by a bit flag in the return value. Flags are defined in the
2231 // DevFeatureFlag enumeration. If the dev tools are unavailable (system is
2232 // not in dev mode/pre-login state), the DEV_FEATURES_DISABLED flag will be
2233 // set and the rest of the bits will always be set to 0.
2234 bool QueryDevFeatures(
2235 int32_t* out_features,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002236 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002237 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002238 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002239 timeout_ms,
2240 dbus_object_proxy_,
2241 "org.chromium.debugd",
2242 "QueryDevFeatures",
2243 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002244 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002245 response.get(), error, out_features);
2246 }
2247
2248 // Queries which dev features have been enabled. Each dev feature will be
2249 // indicated by a bit flag in the return value. Flags are defined in the
2250 // DevFeatureFlag enumeration. If the dev tools are unavailable (system is
2251 // not in dev mode/pre-login state), the DEV_FEATURES_DISABLED flag will be
2252 // set and the rest of the bits will always be set to 0.
2253 void QueryDevFeaturesAsync(
2254 const base::Callback<void(int32_t /*features*/)>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002255 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002256 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002257 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002258 timeout_ms,
2259 dbus_object_proxy_,
2260 "org.chromium.debugd",
2261 "QueryDevFeatures",
2262 success_callback,
2263 error_callback);
2264 }
2265
2266 // Allow uploading of device coredump files.
2267 bool EnableDevCoredumpUpload(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002268 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002269 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002270 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002271 timeout_ms,
2272 dbus_object_proxy_,
2273 "org.chromium.debugd",
2274 "EnableDevCoredumpUpload",
2275 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002276 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002277 response.get(), error);
2278 }
2279
2280 // Allow uploading of device coredump files.
2281 void EnableDevCoredumpUploadAsync(
2282 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002283 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002284 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002285 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002286 timeout_ms,
2287 dbus_object_proxy_,
2288 "org.chromium.debugd",
2289 "EnableDevCoredumpUpload",
2290 success_callback,
2291 error_callback);
2292 }
2293
2294 // Disallow uploading of device coredump files.
2295 bool DisableDevCoredumpUpload(
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002296 brillo::ErrorPtr* error,
Alex Deymod5561a52015-09-03 23:17:52 -07002297 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002298 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002299 timeout_ms,
2300 dbus_object_proxy_,
2301 "org.chromium.debugd",
2302 "DisableDevCoredumpUpload",
2303 error);
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002304 return response && brillo::dbus_utils::ExtractMethodCallResults(
Alex Deymod5561a52015-09-03 23:17:52 -07002305 response.get(), error);
2306 }
2307
2308 // Disallow uploading of device coredump files.
2309 void DisableDevCoredumpUploadAsync(
2310 const base::Callback<void()>& success_callback,
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002311 const base::Callback<void(brillo::Error*)>& error_callback,
Alex Deymod5561a52015-09-03 23:17:52 -07002312 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
Alex Vakulenko3f39d5c2015-10-13 09:27:13 -07002313 brillo::dbus_utils::CallMethodWithTimeout(
Alex Deymod5561a52015-09-03 23:17:52 -07002314 timeout_ms,
2315 dbus_object_proxy_,
2316 "org.chromium.debugd",
2317 "DisableDevCoredumpUpload",
2318 success_callback,
2319 error_callback);
2320 }
2321
2322 private:
2323 scoped_refptr<dbus::Bus> bus_;
2324 const std::string service_name_{"org.chromium.debugd"};
2325 const dbus::ObjectPath object_path_{"/org/chromium/debugd"};
2326 dbus::ObjectProxy* dbus_object_proxy_;
2327
2328 DISALLOW_COPY_AND_ASSIGN(debugdProxy);
2329};
2330
2331} // namespace chromium
2332} // namespace org
2333
2334#endif // ____CHROMEOS_DBUS_BINDING____________________BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_DEBUGD_CLIENT_OUT_DEFAULT_GEN_INCLUDE_DEBUGD_DBUS_PROXIES_H