#include <limits.h>
#include <stdint.h>
#include <sys/types.h>
#include <functional>
#include <string>
#include <android-base/macros.h>
#include "adb_trace.h"
#include "fdevent/fdevent.h"
#include "socket.h"
#include "types.h"
Go to the source code of this file.
|
| enum | TransportType { kTransportUsb
, kTransportLocal
, kTransportAny
, kTransportHost
} |
| |
| enum | ConnectionState {
kCsAny = -1
, kCsConnecting = 0
, kCsAuthorizing
, kCsUnauthorized
,
kCsNoPerm
, kCsDetached
, kCsOffline
, kCsBootloader
,
kCsDevice
, kCsHost
, kCsRecovery
, kCsSideload
,
kCsRescue
} |
| |
| enum class | HostRequestResult { Handled
, SwitchedTransport
, Unhandled
} |
| |
|
| std::string | command_to_string (uint32_t cmd) |
| |
| std::string | adb_version () |
| |
| uint32_t | calculate_apacket_checksum (const apacket *packet) |
| |
| std::string | to_string (ConnectionState state) |
| |
| bool | ConnectionStateIsOnline (ConnectionState state) |
| |
| void | print_packet (const char *label, apacket *p) |
| |
| void | handle_packet (apacket *p, atransport *t) |
| |
| bool | is_one_device_mandatory () |
| |
| int | launch_server (const std::string &socket_spec, const char *one_device) |
| |
| int | adb_server_main (int is_daemon, const std::string &socket_spec, const char *one_device, int ack_reply_fd) |
| |
| std::string | getEmulatorSerialString (int console_port) |
| |
| unique_fd | service_to_fd (std::string_view name, atransport *transport) |
| |
| unique_fd | daemon_service_to_fd (std::string_view name, atransport *transport) |
| |
| asocket * | daemon_service_to_socket (std::string_view name, atransport *transport) |
| |
| unique_fd | execute_abb_command (std::string_view command) |
| |
| bool | handle_forward_request (const char *service, atransport *transport, int reply_fd) |
| |
| bool | handle_forward_request (const char *service, std::function< atransport *(std::string *error)> transport_acquirer, int reply_fd) |
| |
| apacket * | get_apacket () |
| |
| void | put_apacket (apacket *p) |
| |
| HostRequestResult | handle_host_request (std::string_view service, TransportType type, const char *serial, TransportId transport_id, int reply_fd, asocket *s) |
| |
| void | handle_online (atransport *t) |
| |
| void | handle_offline (atransport *t) |
| |
| void | send_connect (atransport *t) |
| |
| void | send_tls_request (atransport *t) |
| |
| void | send_ready (unsigned local, unsigned remote, atransport *t, uint32_t ack_bytes) |
| |
| void | parse_banner (const std::string &, atransport *t) |
| |
| void | usb_init () |
| |
◆ A_AUTH
| #define A_AUTH 0x48545541 |
◆ A_CLSE
| #define A_CLSE 0x45534c43 |
◆ A_CNXN
| #define A_CNXN 0x4e584e43 |
◆ A_OKAY
| #define A_OKAY 0x59414b4f |
◆ A_OPEN
| #define A_OPEN 0x4e45504f |
◆ A_STLS
| #define A_STLS 0x534C5453 |
◆ A_STLS_VERSION
| #define A_STLS_VERSION 0x01000000 |
◆ A_STLS_VERSION_MIN
| #define A_STLS_VERSION_MIN 0x01000000 |
◆ A_SYNC
| #define A_SYNC 0x434e5953 |
◆ A_VERSION
| #define A_VERSION 0x01000001 |
◆ A_VERSION_MIN
| #define A_VERSION_MIN 0x01000000 |
◆ A_VERSION_SKIP_CHECKSUM
| #define A_VERSION_SKIP_CHECKSUM 0x01000001 |
◆ A_WRTE
| #define A_WRTE 0x45545257 |
◆ ABB_ARG_DELIMITER
| #define ABB_ARG_DELIMITER ('\0') |
◆ ADB_CLASS
◆ ADB_DBC_CLASS
| #define ADB_DBC_CLASS 0xDC |
◆ ADB_DBC_SUBCLASS
| #define ADB_DBC_SUBCLASS 0x2 |
◆ ADB_PROTOCOL
◆ ADB_SERVER_VERSION
| #define ADB_SERVER_VERSION 41 |
◆ ADB_SUBCLASS
| #define ADB_SUBCLASS 0x42 |
◆ ADB_VERSION_MAJOR
| #define ADB_VERSION_MAJOR 1 |
◆ ADB_VERSION_MINOR
| #define ADB_VERSION_MINOR 0 |
◆ CHUNK_SIZE
| #define CHUNK_SIZE (64 * 1024) |
◆ DEBUG_PACKETS
◆ DEFAULT_ADB_LOCAL_TRANSPORT_PORT
| #define DEFAULT_ADB_LOCAL_TRANSPORT_PORT 5555 |
◆ print_packet
| #define print_packet |
( |
|
tag, |
|
|
|
p |
|
) |
| |
◆ TOKEN_SIZE
◆ USB_FFS_ADB_EP
◆ USB_FFS_ADB_EP0
◆ USB_FFS_ADB_IN
◆ USB_FFS_ADB_OUT
◆ USB_FFS_ADB_PATH
| #define USB_FFS_ADB_PATH "/dev/usb-ffs/adb/" |
◆ TransportId
◆ ConnectionState
| Enumerator |
|---|
| kCsAny | |
| kCsConnecting | |
| kCsAuthorizing | |
| kCsUnauthorized | |
| kCsNoPerm | |
| kCsDetached | |
| kCsOffline | |
| kCsBootloader | |
| kCsDevice | |
| kCsHost | |
| kCsRecovery | |
| kCsSideload | |
| kCsRescue | |
◆ HostRequestResult
| Enumerator |
|---|
| Handled | |
| SwitchedTransport | |
| Unhandled | |
◆ TransportType
| Enumerator |
|---|
| kTransportUsb | |
| kTransportLocal | |
| kTransportAny | |
| kTransportHost | |
◆ adb_server_main()
| int adb_server_main |
( |
int |
is_daemon, |
|
|
const std::string & |
socket_spec, |
|
|
const char * |
one_device, |
|
|
int |
ack_reply_fd |
|
) |
| |
◆ adb_version()
| std::string adb_version |
( |
| ) |
|
◆ calculate_apacket_checksum()
| uint32_t calculate_apacket_checksum |
( |
const apacket * |
packet | ) |
|
◆ command_to_string()
| std::string command_to_string |
( |
uint32_t |
cmd | ) |
|
◆ ConnectionStateIsOnline()
◆ daemon_service_to_fd()
◆ daemon_service_to_socket()
◆ execute_abb_command()
| unique_fd execute_abb_command |
( |
std::string_view |
command | ) |
|
◆ get_apacket()
◆ getEmulatorSerialString()
| std::string getEmulatorSerialString |
( |
int |
console_port | ) |
|
◆ handle_forward_request() [1/2]
| bool handle_forward_request |
( |
const char * |
service, |
|
|
atransport * |
transport, |
|
|
int |
reply_fd |
|
) |
| |
◆ handle_forward_request() [2/2]
| bool handle_forward_request |
( |
const char * |
service, |
|
|
std::function< atransport *(std::string *error)> |
transport_acquirer, |
|
|
int |
reply_fd |
|
) |
| |
◆ handle_host_request()
◆ handle_offline()
◆ handle_online()
◆ handle_packet()
◆ is_one_device_mandatory()
| bool is_one_device_mandatory |
( |
| ) |
|
◆ launch_server()
| int launch_server |
( |
const std::string & |
socket_spec, |
|
|
const char * |
one_device |
|
) |
| |
◆ parse_banner()
| void parse_banner |
( |
const std::string & |
banner, |
|
|
atransport * |
t |
|
) |
| |
◆ print_packet()
| void print_packet |
( |
const char * |
label, |
|
|
apacket * |
p |
|
) |
| |
◆ put_apacket()
◆ send_connect()
◆ send_ready()
| void send_ready |
( |
unsigned |
local, |
|
|
unsigned |
remote, |
|
|
atransport * |
t, |
|
|
uint32_t |
ack_bytes |
|
) |
| |
◆ send_tls_request()
◆ service_to_fd()
◆ to_string()
◆ usb_init()
◆ adb_device_banner
| const char* adb_device_banner |
|
extern |
◆ INITIAL_DELAYED_ACK_BYTES
| constexpr size_t INITIAL_DELAYED_ACK_BYTES = 32 * 1024 * 1024 |
|
constexpr |
◆ LINUX_MAX_SOCKET_SIZE
| constexpr size_t LINUX_MAX_SOCKET_SIZE = 4194304 |
|
constexpr |
◆ MAX_PAYLOAD
| constexpr size_t MAX_PAYLOAD = 1024 * 1024 |
|
constexpr |
◆ MAX_PAYLOAD_V1
| constexpr size_t MAX_PAYLOAD_V1 = 4 * 1024 |
|
constexpr |