diff options
Diffstat (limited to 'transport.h')
-rw-r--r-- | transport.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/transport.h b/transport.h index 86186936..fc0e322d 100644 --- a/transport.h +++ b/transport.h @@ -31,6 +31,7 @@ #include <string> #include <string_view> #include <thread> +#include <unordered_map> #include <vector> #include <android-base/macros.h> @@ -98,6 +99,8 @@ extern const char* const kFeatureSendRecv2LZ4; extern const char* const kFeatureSendRecv2Zstd; // adbd supports dry-run send for send/recv v2. extern const char* const kFeatureSendRecv2DryRunSend; +// adbd supports delayed acks. +extern const char* const kFeatureDelayedAck; TransportId NextTransportId(); @@ -296,6 +299,10 @@ class atransport : public enable_weak_from_this<atransport> { #if ADB_HOST void SetUsbHandle(usb_handle* h) { usb_handle_ = h; } usb_handle* GetUsbHandle() { return usb_handle_; } + + // Interface for management/filter on forward:reverse: configuration. + void UpdateReverseConfig(std::string_view service_addr); + bool IsReverseConfigured(const std::string& local_addr); #endif const TransportId id; @@ -344,6 +351,10 @@ class atransport : public enable_weak_from_this<atransport> { bool has_feature(const std::string& feature) const; + bool SupportsDelayedAck() const { + return delayed_ack_; + } + // Loads the transport's feature set from the given string. void SetFeatures(const std::string& features_string); @@ -419,6 +430,15 @@ class atransport : public enable_weak_from_this<atransport> { std::mutex mutex_; + bool delayed_ack_ = false; + +#if ADB_HOST + // Track remote addresses against local addresses (configured) + // through `adb reverse` commands. + // Access constrained to primary thread by virtue of check_main_thread(). + std::unordered_map<std::string, std::string> reverse_forwards_; +#endif + DISALLOW_COPY_AND_ASSIGN(atransport); }; |