blob: fa98eed5982ff6516d9e56cc0076496aaa9eb92b [file] [log] [blame]
Dan Alberte9fca142015-02-18 18:03:26 -08001/*
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#ifndef __ADB_LISTENERS_H
18#define __ADB_LISTENERS_H
19
20#include "adb.h"
21
Elliott Hughese67f1f82015-04-30 17:32:03 -070022#include <string>
23
Dan Alberte9fca142015-02-18 18:03:26 -080024// error/status codes for install_listener.
Elliott Hughes3bd73c12015-05-05 13:10:43 -070025enum InstallStatus {
Dan Alberte9fca142015-02-18 18:03:26 -080026 INSTALL_STATUS_OK = 0,
27 INSTALL_STATUS_INTERNAL_ERROR = -1,
28 INSTALL_STATUS_CANNOT_BIND = -2,
29 INSTALL_STATUS_CANNOT_REBIND = -3,
Elliott Hughes7b506092015-04-20 08:09:20 -070030 INSTALL_STATUS_LISTENER_NOT_FOUND = -4,
Elliott Hughes2d4121c2015-04-17 09:47:42 -070031};
Dan Alberte9fca142015-02-18 18:03:26 -080032
Elliott Hughes3bd73c12015-05-05 13:10:43 -070033InstallStatus install_listener(const std::string& local_name,
34 const char* connect_to,
35 atransport* transport,
Spencer Low5200c662015-07-30 23:07:55 -070036 int no_rebind,
37 std::string* error);
Dan Alberte9fca142015-02-18 18:03:26 -080038
Elliott Hughese67f1f82015-04-30 17:32:03 -070039std::string format_listeners();
Dan Alberte9fca142015-02-18 18:03:26 -080040
Elliott Hughes3bd73c12015-05-05 13:10:43 -070041InstallStatus remove_listener(const char* local_name, atransport* transport);
Dan Alberte9fca142015-02-18 18:03:26 -080042void remove_all_listeners(void);
43
Dan Alberte9fca142015-02-18 18:03:26 -080044#endif /* __ADB_LISTENERS_H */