blob: 21ea0638cfea4d9034fc09fbd356227c833a1c75 [file] [log] [blame]
Paul Stewart454acb62013-05-02 18:13:21 -07001// 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 Vakulenko262be3f2014-07-30 15:25:50 -07005#ifndef DEBUGD_SRC_PACKET_CAPTURE_TOOL_H_
6#define DEBUGD_SRC_PACKET_CAPTURE_TOOL_H_
Paul Stewart454acb62013-05-02 18:13:21 -07007
Ben Chana0011d82014-05-13 00:19:29 -07008#include <map>
Paul Stewart454acb62013-05-02 18:13:21 -07009#include <string>
10
Ben Chan657bed82014-09-02 20:40:51 -070011#include <base/macros.h>
Paul Stewart454acb62013-05-02 18:13:21 -070012#include <dbus-c++/dbus.h>
13
Alex Vakulenko262be3f2014-07-30 15:25:50 -070014#include "debugd/src/subprocess_tool.h"
Paul Stewart454acb62013-05-02 18:13:21 -070015
16namespace debugd {
17
18class ProcessWithId;
19
20class PacketCaptureTool : public SubprocessTool {
21 public:
Ben Chan78f89532014-08-29 09:35:09 -070022 PacketCaptureTool() = default;
23 ~PacketCaptureTool() override = default;
Paul Stewart454acb62013-05-02 18:13:21 -070024
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 Chana0011d82014-05-13 00:19:29 -070029 DBus::Error* error);
Paul Stewart454acb62013-05-02 18:13:21 -070030
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 Chana0011d82014-05-13 00:19:29 -070041} // namespace debugd
Paul Stewart454acb62013-05-02 18:13:21 -070042
Alex Vakulenko262be3f2014-07-30 15:25:50 -070043#endif // DEBUGD_SRC_PACKET_CAPTURE_TOOL_H_