[debugd] add GetRoutes() API.

This API exposes the system routing table.

BUG=chromium-os:23839
TEST=Adhoc,platform_DebugDaemonGetRoutes
dbus-send --system --fixed --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.GetRoutes \
dict:string:variant:numeric,boolean:true:v6,boolean:true

Change-Id: I2018beff1ec44ba1f145f02a9534923590c3cc04
Signed-off-by: Elly Jones <ellyjones@chromium.org>
diff --git a/debugd/src/process_with_output.h b/debugd/src/process_with_output.h
new file mode 100644
index 0000000..dd78867
--- /dev/null
+++ b/debugd/src/process_with_output.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PROCESS_WITH_OUTPUT_H
+#define PROCESS_WITH_OUTPUT_H
+
+#include <string>
+#include <vector>
+
+#include <base/file_path.h>
+#include <chromeos/process.h>
+
+namespace debugd {
+
+// @brief Represents a process whose output can be collected.
+//
+// The process must be Run() to completion before its output can be collected.
+class ProcessWithOutput : public chromeos::ProcessImpl {
+ public:
+  ProcessWithOutput();
+  ~ProcessWithOutput();
+  bool Init();
+  bool GetOutput(std::string* output);
+  bool GetOutputLines(std::vector<std::string>* output);
+ private:
+  FilePath outfile_path_;
+  FILE *outfile_;
+};
+
+};  // namespace debugd
+
+#endif  // PROCESS_WITH_OUTPUT_H