Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Alex Vakulenko | 262be3f | 2014-07-30 15:25:50 -0700 | [diff] [blame] | 5 | #ifndef DEBUGD_SRC_PACKET_CAPTURE_TOOL_H_ |
| 6 | #define DEBUGD_SRC_PACKET_CAPTURE_TOOL_H_ |
Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 7 | |
Ben Chan | a0011d8 | 2014-05-13 00:19:29 -0700 | [diff] [blame] | 8 | #include <map> |
Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 9 | #include <string> |
| 10 | |
Ben Chan | 657bed8 | 2014-09-02 20:40:51 -0700 | [diff] [blame] | 11 | #include <base/macros.h> |
Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 12 | #include <dbus-c++/dbus.h> |
| 13 | |
Alex Vakulenko | 262be3f | 2014-07-30 15:25:50 -0700 | [diff] [blame] | 14 | #include "debugd/src/subprocess_tool.h" |
Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 15 | |
| 16 | namespace debugd { |
| 17 | |
| 18 | class ProcessWithId; |
| 19 | |
| 20 | class PacketCaptureTool : public SubprocessTool { |
| 21 | public: |
Ben Chan | 78f8953 | 2014-08-29 09:35:09 -0700 | [diff] [blame] | 22 | PacketCaptureTool() = default; |
| 23 | ~PacketCaptureTool() override = default; |
Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 24 | |
| 25 | std::string Start( |
| 26 | const DBus::FileDescriptor& status_fd, |
| 27 | const DBus::FileDescriptor& output_fd, |
| 28 | const std::map<std::string, DBus::Variant>& options, |
Ben Chan | a0011d8 | 2014-05-13 00:19:29 -0700 | [diff] [blame] | 29 | DBus::Error* error); |
Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 30 | |
| 31 | private: |
| 32 | static bool AddValidatedStringOption( |
| 33 | const std::map<std::string, DBus::Variant>& options, |
| 34 | const std::string& dbus_option, |
| 35 | const std::string& command_line_option, |
| 36 | ProcessWithId* p); |
| 37 | |
| 38 | DISALLOW_COPY_AND_ASSIGN(PacketCaptureTool); |
| 39 | }; |
| 40 | |
Ben Chan | a0011d8 | 2014-05-13 00:19:29 -0700 | [diff] [blame] | 41 | } // namespace debugd |
Paul Stewart | 454acb6 | 2013-05-02 18:13:21 -0700 | [diff] [blame] | 42 | |
Alex Vakulenko | 262be3f | 2014-07-30 15:25:50 -0700 | [diff] [blame] | 43 | #endif // DEBUGD_SRC_PACKET_CAPTURE_TOOL_H_ |