Android-cuttlefish cvd tool
adb_listeners.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include "adb.h"
20
21#include <string>
22
23#include <android-base/macros.h>
24
25inline constexpr const char* kSmartSocketConnectTo = "*smartsocket*";
26
27// error/status codes for install_listener.
34};
35
36inline constexpr int INSTALL_LISTENER_NO_REBIND = 1 << 0;
37inline constexpr int INSTALL_LISTENER_DISABLED = 1 << 1;
38
39InstallStatus install_listener(const std::string& local_name, const char* connect_to,
40 atransport* transport, int flags, int* resolved_tcp_port,
41 std::string* error);
42
43std::string format_listeners();
44
45InstallStatus remove_listener(const char* local_name, atransport* transport);
47
48#if ADB_HOST
49void enable_server_sockets();
50void close_smartsockets();
51#endif
std::string format_listeners()
Definition: adb_listeners.cpp:129
constexpr int INSTALL_LISTENER_DISABLED
Definition: adb_listeners.h:37
InstallStatus remove_listener(const char *local_name, atransport *transport)
Definition: adb_listeners.cpp:146
constexpr int INSTALL_LISTENER_NO_REBIND
Definition: adb_listeners.h:36
InstallStatus
Definition: adb_listeners.h:28
@ INSTALL_STATUS_CANNOT_REBIND
Definition: adb_listeners.h:32
@ INSTALL_STATUS_OK
Definition: adb_listeners.h:29
@ INSTALL_STATUS_CANNOT_BIND
Definition: adb_listeners.h:31
@ INSTALL_STATUS_LISTENER_NOT_FOUND
Definition: adb_listeners.h:33
@ INSTALL_STATUS_INTERNAL_ERROR
Definition: adb_listeners.h:30
InstallStatus install_listener(const std::string &local_name, const char *connect_to, atransport *transport, int flags, int *resolved_tcp_port, std::string *error)
Definition: adb_listeners.cpp:190
void remove_all_listeners()
Definition: adb_listeners.cpp:158
constexpr const char * kSmartSocketConnectTo
Definition: adb_listeners.h:25
Definition: transport.h:261
#define error(format, args...)
Definition: fec_private.h:201