adb: Add "adb disconnect" command for disconnecting TCP/IP devices.

Also check that device is not already connected in "adb connect"

Change-Id: I5f84b56b63d8c6932f23791cac319fd6bc39d36c
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/adb/adb.h b/adb/adb.h
index 713666f..b958682 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -270,11 +270,17 @@
 
 /* cause new transports to be init'd and added to the list */
 void register_socket_transport(int s, const char *serial, int port, int local);
+
+/* this should only be used for the "adb disconnect" command */
+void unregister_transport(atransport *t);
+
 void register_usb_transport(usb_handle *h, const char *serial, unsigned writeable);
 
 /* this should only be used for transports with connection_state == CS_NOPERM */
 void unregister_usb_transport(usb_handle *usb);
 
+atransport *find_transport(const char *serial);
+
 int service_to_fd(const char *name);
 #if ADB_HOST
 asocket *host_service_to_socket(const char*  name, const char *serial);