summaryrefslogtreecommitdiffstats
path: root/tools/android/common/adb_connection.h
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 05:12:27 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 05:12:27 +0000
commitc65c6e3150af3dc37471c76b10d2b05cf7367aa3 (patch)
treed1e2cd5de49cd95893c6ab6ce55de6a145951e4f /tools/android/common/adb_connection.h
parent69f406901670991e1d8a5e44346ffba25741b5cd (diff)
downloadchromium_src-c65c6e3150af3dc37471c76b10d2b05cf7367aa3.zip
chromium_src-c65c6e3150af3dc37471c76b10d2b05cf7367aa3.tar.gz
chromium_src-c65c6e3150af3dc37471c76b10d2b05cf7367aa3.tar.bz2
tools/android/forwarder (as well as tools/android/common)
'forwarder' is a tool that can forward a TCP port listening on the device to a port on the host. It works like 'adb forward' but in the reverse direction. It's useful to run tests on the device that need to access TCP services on the host. Review URL: http://codereview.chromium.org/9359003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/android/common/adb_connection.h')
-rw-r--r--tools/android/common/adb_connection.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/android/common/adb_connection.h b/tools/android/common/adb_connection.h
new file mode 100644
index 0000000..48a1a6f
--- /dev/null
+++ b/tools/android/common/adb_connection.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2012 The Chromium 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 TOOLS_ANDROID_COMMON_ADB_CONNECTION_H__
+#define TOOLS_ANDROID_COMMON_ADB_CONNECTION_H__
+#pragma once
+
+namespace tools {
+
+// Creates a socket that can forward to a host socket through ADB.
+// The format of forward_to is <port>:<ip_address>.
+// Returns the socket handle, or -1 on any error.
+int ConnectAdbHostSocket(const char* forward_to);
+
+} // namespace tools
+
+#endif // TOOLS_ANDROID_COMMON_ADB_CONNECTION_H__
+