blob: a0be608eddb49c683a97e5c22a390bb0e5b83076 [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
Ben Chana0011d82014-05-13 00:19:29 -07005#ifndef PACKET_CAPTURE_TOOL_H_
6#define 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
11#include <base/basictypes.h>
12#include <dbus-c++/dbus.h>
13
14#include "subprocess_tool.h"
15
16namespace debugd {
17
18class ProcessWithId;
19
20class PacketCaptureTool : public SubprocessTool {
21 public:
22 PacketCaptureTool();
Ben Chana0011d82014-05-13 00:19:29 -070023 virtual ~PacketCaptureTool();
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
Ben Chana0011d82014-05-13 00:19:29 -070043#endif // PACKET_CAPTURE_TOOL_H_