1e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert/* 2e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * Copyright (C) 2015 The Android Open Source Project 3e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * 4e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * Licensed under the Apache License, Version 2.0 (the "License"); 5e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * you may not use this file except in compliance with the License. 6e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * You may obtain a copy of the License at 7e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * 8e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * http://www.apache.org/licenses/LICENSE-2.0 9e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * 10e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * Unless required by applicable law or agreed to in writing, software 11e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * distributed under the License is distributed on an "AS IS" BASIS, 12e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * See the License for the specific language governing permissions and 14e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert * limitations under the License. 15e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert */ 16e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert 17e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert#ifndef __ADB_LISTENERS_H 18e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert#define __ADB_LISTENERS_H 19e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert 20e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert#include "adb.h" 21e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert 22e67f1f87d9b1188ec8617035db7006c37ee7b21eElliott Hughes#include <string> 23e67f1f87d9b1188ec8617035db7006c37ee7b21eElliott Hughes 24eaae97e127717750b4264d9b6617b845f9bc701fDavid Pursell#include <android-base/macros.h> 25eaae97e127717750b4264d9b6617b845f9bc701fDavid Pursell 26e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert// error/status codes for install_listener. 273bd73c12c07dcefc965abeef535ac53c4754d682Elliott Hughesenum InstallStatus { 28e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert INSTALL_STATUS_OK = 0, 29e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert INSTALL_STATUS_INTERNAL_ERROR = -1, 30e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert INSTALL_STATUS_CANNOT_BIND = -2, 31e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert INSTALL_STATUS_CANNOT_REBIND = -3, 327b506090e1ac51f4990f17621c6e33847b0632a2Elliott Hughes INSTALL_STATUS_LISTENER_NOT_FOUND = -4, 332d4121c0dcc93382bcd7ea6476f433d8254919ddElliott Hughes}; 34e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert 35eaae97e127717750b4264d9b6617b845f9bc701fDavid PursellInstallStatus install_listener(const std::string& local_name, const char* connect_to, 36eaae97e127717750b4264d9b6617b845f9bc701fDavid Pursell atransport* transport, int no_rebind, int* resolved_tcp_port, 375200c6670f041550c23821fec8e8e49b30ef6d29Spencer Low std::string* error); 38e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert 39e67f1f87d9b1188ec8617035db7006c37ee7b21eElliott Hughesstd::string format_listeners(); 40e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert 413bd73c12c07dcefc965abeef535ac53c4754d682Elliott HughesInstallStatus remove_listener(const char* local_name, atransport* transport); 42e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albertvoid remove_all_listeners(void); 43e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert 44e9fca14c9e555a9d02e1d94ba6d3b290673ea26bDan Albert#endif /* __ADB_LISTENERS_H */ 45