Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1 | /* |
| 2 | * hidl interface for wpa_hostapd daemon |
| 3 | * Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi> |
| 4 | * Copyright (c) 2004-2018, Roshan Pius <rpius@google.com> |
| 5 | * |
| 6 | * This software may be distributed under the terms of the BSD license. |
| 7 | * See README for more details. |
| 8 | */ |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 9 | #include <iomanip> |
| 10 | #include <sstream> |
| 11 | #include <string> |
| 12 | #include <vector> |
| 13 | |
| 14 | #include <android-base/file.h> |
| 15 | #include <android-base/stringprintf.h> |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 16 | |
| 17 | #include "hostapd.h" |
| 18 | #include "hidl_return_util.h" |
| 19 | |
Roshan Pius | 3455af4 | 2018-02-01 09:19:49 -0800 | [diff] [blame] | 20 | extern "C" |
| 21 | { |
| 22 | #include "utils/eloop.h" |
| 23 | } |
| 24 | |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 25 | // The HIDL implementation for hostapd creates a hostapd.conf dynamically for |
| 26 | // each interface. This file can then be used to hook onto the normal config |
| 27 | // file parsing logic in hostapd code. Helps us to avoid duplication of code |
| 28 | // in the HIDL interface. |
| 29 | // TOOD(b/71872409): Add unit tests for this. |
| 30 | namespace { |
| 31 | constexpr char kConfFileNameFmt[] = "/data/vendor/wifi/hostapd/hostapd_%s.conf"; |
| 32 | |
| 33 | using android::base::RemoveFileIfExists; |
| 34 | using android::base::StringPrintf; |
| 35 | using android::base::WriteStringToFile; |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 36 | using android::hardware::wifi::hostapd::V1_1::IHostapd; |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 37 | |
| 38 | std::string WriteHostapdConfig( |
| 39 | const std::string& interface_name, const std::string& config) |
| 40 | { |
| 41 | const std::string file_path = |
| 42 | StringPrintf(kConfFileNameFmt, interface_name.c_str()); |
| 43 | if (WriteStringToFile( |
| 44 | config, file_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, |
| 45 | getuid(), getgid())) { |
| 46 | return file_path; |
| 47 | } |
| 48 | // Diagnose failure |
| 49 | int error = errno; |
| 50 | wpa_printf( |
| 51 | MSG_ERROR, "Cannot write hostapd config to %s, error: %s", |
| 52 | file_path.c_str(), strerror(error)); |
| 53 | struct stat st; |
| 54 | int result = stat(file_path.c_str(), &st); |
| 55 | if (result == 0) { |
| 56 | wpa_printf( |
| 57 | MSG_ERROR, "hostapd config file uid: %d, gid: %d, mode: %d", |
| 58 | st.st_uid, st.st_gid, st.st_mode); |
| 59 | } else { |
| 60 | wpa_printf( |
| 61 | MSG_ERROR, |
| 62 | "Error calling stat() on hostapd config file: %s", |
| 63 | strerror(errno)); |
| 64 | } |
| 65 | return ""; |
| 66 | } |
| 67 | |
| 68 | std::string CreateHostapdConfig( |
| 69 | const IHostapd::IfaceParams& iface_params, |
| 70 | const IHostapd::NetworkParams& nw_params) |
| 71 | { |
| 72 | if (nw_params.ssid.size() > |
| 73 | static_cast<uint32_t>( |
| 74 | IHostapd::ParamSizeLimits::SSID_MAX_LEN_IN_BYTES)) { |
| 75 | wpa_printf( |
| 76 | MSG_ERROR, "Invalid SSID size: %zu", nw_params.ssid.size()); |
| 77 | return ""; |
| 78 | } |
Roshan Pius | 0b8a64f | 2018-01-23 11:42:34 -0800 | [diff] [blame] | 79 | if ((nw_params.encryptionType != IHostapd::EncryptionType::NONE) && |
| 80 | (nw_params.pskPassphrase.size() < |
| 81 | static_cast<uint32_t>( |
| 82 | IHostapd::ParamSizeLimits:: |
| 83 | WPA2_PSK_PASSPHRASE_MIN_LEN_IN_BYTES) || |
| 84 | nw_params.pskPassphrase.size() > |
| 85 | static_cast<uint32_t>( |
| 86 | IHostapd::ParamSizeLimits:: |
| 87 | WPA2_PSK_PASSPHRASE_MAX_LEN_IN_BYTES))) { |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 88 | wpa_printf( |
| 89 | MSG_ERROR, "Invalid psk passphrase size: %zu", |
| 90 | nw_params.pskPassphrase.size()); |
| 91 | return ""; |
| 92 | } |
| 93 | |
| 94 | // SSID string |
| 95 | std::stringstream ss; |
| 96 | ss << std::hex; |
| 97 | ss << std::setfill('0'); |
| 98 | for (uint8_t b : nw_params.ssid) { |
| 99 | ss << std::setw(2) << static_cast<unsigned int>(b); |
| 100 | } |
| 101 | const std::string ssid_as_string = ss.str(); |
| 102 | |
| 103 | // Encryption config string |
| 104 | std::string encryption_config_as_string; |
| 105 | switch (nw_params.encryptionType) { |
| 106 | case IHostapd::EncryptionType::NONE: |
| 107 | // no security params |
| 108 | break; |
| 109 | case IHostapd::EncryptionType::WPA: |
| 110 | encryption_config_as_string = StringPrintf( |
| 111 | "wpa=3\n" |
| 112 | "wpa_pairwise=TKIP CCMP\n" |
| 113 | "wpa_passphrase=%s", |
| 114 | nw_params.pskPassphrase.c_str()); |
| 115 | break; |
| 116 | case IHostapd::EncryptionType::WPA2: |
| 117 | encryption_config_as_string = StringPrintf( |
| 118 | "wpa=2\n" |
| 119 | "rsn_pairwise=CCMP\n" |
| 120 | "wpa_passphrase=%s", |
| 121 | nw_params.pskPassphrase.c_str()); |
| 122 | break; |
| 123 | default: |
| 124 | wpa_printf(MSG_ERROR, "Unknown encryption type"); |
| 125 | return ""; |
| 126 | } |
| 127 | |
| 128 | std::string channel_config_as_string; |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 129 | if (iface_params.V1_0.channelParams.enableAcs) { |
| 130 | std::string chanlist_as_string; |
| 131 | for (const auto &range : |
| 132 | iface_params.channelParams.acsChannelRanges) { |
| 133 | if (range.start != range.end) { |
| 134 | chanlist_as_string += |
| 135 | StringPrintf("%d-%d ", range.start, range.end); |
| 136 | } else { |
| 137 | chanlist_as_string += StringPrintf("%d ", range.start); |
| 138 | } |
| 139 | } |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 140 | channel_config_as_string = StringPrintf( |
| 141 | "channel=0\n" |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 142 | "acs_exclude_dfs=%d\n" |
| 143 | "chanlist=%s", |
| 144 | iface_params.V1_0.channelParams.acsShouldExcludeDfs, |
| 145 | chanlist_as_string.c_str()); |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 146 | } else { |
| 147 | channel_config_as_string = StringPrintf( |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 148 | "channel=%d", iface_params.V1_0.channelParams.channel); |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | // Hw Mode String |
| 152 | std::string hw_mode_as_string; |
Roshan Pius | 4944647 | 2018-03-07 10:23:46 -0800 | [diff] [blame] | 153 | std::string ht_cap_vht_oper_chwidth_as_string; |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 154 | switch (iface_params.V1_0.channelParams.band) { |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 155 | case IHostapd::Band::BAND_2_4_GHZ: |
Roshan Pius | e453f71 | 2018-02-09 15:49:57 -0800 | [diff] [blame] | 156 | hw_mode_as_string = "hw_mode=g"; |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 157 | break; |
| 158 | case IHostapd::Band::BAND_5_GHZ: |
Roshan Pius | 4944647 | 2018-03-07 10:23:46 -0800 | [diff] [blame] | 159 | hw_mode_as_string = "hw_mode=a"; |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 160 | if (iface_params.V1_0.channelParams.enableAcs) { |
Roshan Pius | 4944647 | 2018-03-07 10:23:46 -0800 | [diff] [blame] | 161 | ht_cap_vht_oper_chwidth_as_string = |
| 162 | "ht_capab=[HT40+]\n" |
| 163 | "vht_oper_chwidth=1"; |
| 164 | } |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 165 | break; |
| 166 | case IHostapd::Band::BAND_ANY: |
Roshan Pius | 4944647 | 2018-03-07 10:23:46 -0800 | [diff] [blame] | 167 | hw_mode_as_string = "hw_mode=any"; |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 168 | if (iface_params.V1_0.channelParams.enableAcs) { |
Roshan Pius | 4944647 | 2018-03-07 10:23:46 -0800 | [diff] [blame] | 169 | ht_cap_vht_oper_chwidth_as_string = |
| 170 | "ht_capab=[HT40+]\n" |
| 171 | "vht_oper_chwidth=1"; |
| 172 | } |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 173 | break; |
| 174 | default: |
| 175 | wpa_printf(MSG_ERROR, "Invalid band"); |
| 176 | return ""; |
| 177 | } |
| 178 | |
| 179 | return StringPrintf( |
| 180 | "interface=%s\n" |
| 181 | "driver=nl80211\n" |
Daichi Ueura | caa74a8 | 2018-02-14 22:25:39 +0900 | [diff] [blame] | 182 | "ctrl_interface=/data/vendor/wifi/hostapd/ctrl\n" |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 183 | // ssid2 signals to hostapd that the value is not a literal value |
| 184 | // for use as a SSID. In this case, we're giving it a hex |
| 185 | // std::string and hostapd needs to expect that. |
| 186 | "ssid2=%s\n" |
| 187 | "%s\n" |
| 188 | "ieee80211n=%d\n" |
| 189 | "ieee80211ac=%d\n" |
Roshan Pius | e453f71 | 2018-02-09 15:49:57 -0800 | [diff] [blame] | 190 | "%s\n" |
Roshan Pius | 4944647 | 2018-03-07 10:23:46 -0800 | [diff] [blame] | 191 | "%s\n" |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 192 | "ignore_broadcast_ssid=%d\n" |
| 193 | "wowlan_triggers=any\n" |
| 194 | "%s\n", |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 195 | iface_params.V1_0.ifaceName.c_str(), ssid_as_string.c_str(), |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 196 | channel_config_as_string.c_str(), |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 197 | iface_params.V1_0.hwModeParams.enable80211N ? 1 : 0, |
| 198 | iface_params.V1_0.hwModeParams.enable80211AC ? 1 : 0, |
Roshan Pius | 4944647 | 2018-03-07 10:23:46 -0800 | [diff] [blame] | 199 | hw_mode_as_string.c_str(), ht_cap_vht_oper_chwidth_as_string.c_str(), |
| 200 | nw_params.isHidden ? 1 : 0, encryption_config_as_string.c_str()); |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 201 | } |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 202 | |
| 203 | // hostapd core functions accept "C" style function pointers, so use global |
| 204 | // functions to pass to the hostapd core function and store the corresponding |
| 205 | // std::function methods to be invoked. |
| 206 | // |
| 207 | // NOTE: Using the pattern from the vendor HAL (wifi_legacy_hal.cpp). |
| 208 | // |
| 209 | // Callback to be invoked once setup is complete |
| 210 | std::function<void(struct hostapd_data*)> on_setup_complete_internal_callback; |
| 211 | void onAsyncSetupCompleteCb(void* ctx) |
| 212 | { |
| 213 | struct hostapd_data* iface_hapd = (struct hostapd_data*)ctx; |
| 214 | if (on_setup_complete_internal_callback) { |
| 215 | on_setup_complete_internal_callback(iface_hapd); |
| 216 | // Invalidate this callback since we don't want this firing |
| 217 | // again. |
| 218 | on_setup_complete_internal_callback = nullptr; |
| 219 | } |
| 220 | } |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 221 | } // namespace |
| 222 | |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 223 | namespace android { |
| 224 | namespace hardware { |
| 225 | namespace wifi { |
| 226 | namespace hostapd { |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 227 | namespace V1_1 { |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 228 | namespace implementation { |
| 229 | using hidl_return_util::call; |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 230 | using namespace android::hardware::wifi::hostapd::V1_0; |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 231 | |
| 232 | Hostapd::Hostapd(struct hapd_interfaces* interfaces) : interfaces_(interfaces) |
| 233 | {} |
| 234 | |
| 235 | Return<void> Hostapd::addAccessPoint( |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 236 | const V1_0::IHostapd::IfaceParams& iface_params, |
| 237 | const NetworkParams& nw_params, addAccessPoint_cb _hidl_cb) |
| 238 | { |
| 239 | return call( |
| 240 | this, &Hostapd::addAccessPointInternal, _hidl_cb, iface_params, |
| 241 | nw_params); |
| 242 | } |
| 243 | |
| 244 | Return<void> Hostapd::addAccessPoint_1_1( |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 245 | const IfaceParams& iface_params, const NetworkParams& nw_params, |
| 246 | addAccessPoint_cb _hidl_cb) |
| 247 | { |
| 248 | return call( |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 249 | this, &Hostapd::addAccessPointInternal_1_1, _hidl_cb, iface_params, |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 250 | nw_params); |
| 251 | } |
| 252 | |
| 253 | Return<void> Hostapd::removeAccessPoint( |
| 254 | const hidl_string& iface_name, removeAccessPoint_cb _hidl_cb) |
| 255 | { |
| 256 | return call( |
| 257 | this, &Hostapd::removeAccessPointInternal, _hidl_cb, iface_name); |
| 258 | } |
| 259 | |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 260 | Return<void> Hostapd::terminate() |
| 261 | { |
Roshan Pius | 3455af4 | 2018-02-01 09:19:49 -0800 | [diff] [blame] | 262 | wpa_printf(MSG_INFO, "Terminating..."); |
| 263 | eloop_terminate(); |
| 264 | return Void(); |
| 265 | } |
| 266 | |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 267 | Return<void> Hostapd::registerCallback( |
| 268 | const sp<IHostapdCallback>& callback, registerCallback_cb _hidl_cb) |
| 269 | { |
| 270 | return call( |
| 271 | this, &Hostapd::registerCallbackInternal, _hidl_cb, callback); |
| 272 | } |
| 273 | |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 274 | HostapdStatus Hostapd::addAccessPointInternal( |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 275 | const V1_0::IHostapd::IfaceParams& iface_params, |
| 276 | const NetworkParams& nw_params) |
| 277 | { |
| 278 | return {HostapdStatusCode::FAILURE_UNKNOWN, ""}; |
| 279 | } |
| 280 | |
| 281 | HostapdStatus Hostapd::addAccessPointInternal_1_1( |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 282 | const IfaceParams& iface_params, const NetworkParams& nw_params) |
| 283 | { |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 284 | if (hostapd_get_iface(interfaces_, iface_params.V1_0.ifaceName.c_str())) { |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 285 | wpa_printf( |
| 286 | MSG_ERROR, "Interface %s already present", |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 287 | iface_params.V1_0.ifaceName.c_str()); |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 288 | return {HostapdStatusCode::FAILURE_IFACE_EXISTS, ""}; |
| 289 | } |
| 290 | const auto conf_params = CreateHostapdConfig(iface_params, nw_params); |
| 291 | if (conf_params.empty()) { |
| 292 | wpa_printf(MSG_ERROR, "Failed to create config params"); |
| 293 | return {HostapdStatusCode::FAILURE_ARGS_INVALID, ""}; |
| 294 | } |
| 295 | const auto conf_file_path = |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 296 | WriteHostapdConfig(iface_params.V1_0.ifaceName, conf_params); |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 297 | if (conf_file_path.empty()) { |
| 298 | wpa_printf(MSG_ERROR, "Failed to write config file"); |
| 299 | return {HostapdStatusCode::FAILURE_UNKNOWN, ""}; |
| 300 | } |
| 301 | std::string add_iface_param_str = StringPrintf( |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 302 | "%s config=%s", iface_params.V1_0.ifaceName.c_str(), |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 303 | conf_file_path.c_str()); |
| 304 | std::vector<char> add_iface_param_vec( |
| 305 | add_iface_param_str.begin(), add_iface_param_str.end() + 1); |
| 306 | if (hostapd_add_iface(interfaces_, add_iface_param_vec.data()) < 0) { |
| 307 | wpa_printf( |
| 308 | MSG_ERROR, "Adding interface %s failed", |
| 309 | add_iface_param_str.c_str()); |
| 310 | return {HostapdStatusCode::FAILURE_UNKNOWN, ""}; |
| 311 | } |
| 312 | struct hostapd_data* iface_hapd = |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 313 | hostapd_get_iface(interfaces_, iface_params.V1_0.ifaceName.c_str()); |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 314 | WPA_ASSERT(iface_hapd != nullptr && iface_hapd->iface != nullptr); |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 315 | // Register the setup complete callbacks |
| 316 | on_setup_complete_internal_callback = |
| 317 | [this](struct hostapd_data* iface_hapd) { |
| 318 | wpa_printf( |
| 319 | MSG_DEBUG, "AP interface setup completed - state %s", |
| 320 | hostapd_state_text(iface_hapd->iface->state)); |
| 321 | if (iface_hapd->iface->state == HAPD_IFACE_DISABLED) { |
| 322 | // Invoke the failure callback on all registered |
| 323 | // clients. |
| 324 | for (const auto& callback : callbacks_) { |
| 325 | callback->onFailure( |
| 326 | iface_hapd->conf->iface); |
| 327 | } |
| 328 | } |
| 329 | }; |
| 330 | iface_hapd->setup_complete_cb = onAsyncSetupCompleteCb; |
| 331 | iface_hapd->setup_complete_cb_ctx = iface_hapd; |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 332 | if (hostapd_enable_iface(iface_hapd->iface) < 0) { |
| 333 | wpa_printf( |
| 334 | MSG_ERROR, "Enabling interface %s failed", |
Daisuke Niwa | c1bd20f | 2019-01-09 13:51:02 +0900 | [diff] [blame^] | 335 | iface_params.V1_0.ifaceName.c_str()); |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 336 | return {HostapdStatusCode::FAILURE_UNKNOWN, ""}; |
| 337 | } |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 338 | return {HostapdStatusCode::SUCCESS, ""}; |
| 339 | } |
| 340 | |
| 341 | HostapdStatus Hostapd::removeAccessPointInternal(const std::string& iface_name) |
| 342 | { |
Roshan Pius | 087d869 | 2017-12-27 14:11:44 -0800 | [diff] [blame] | 343 | std::vector<char> remove_iface_param_vec( |
| 344 | iface_name.begin(), iface_name.end() + 1); |
| 345 | if (hostapd_remove_iface(interfaces_, remove_iface_param_vec.data()) < |
| 346 | 0) { |
| 347 | wpa_printf( |
| 348 | MSG_ERROR, "Removing interface %s failed", |
| 349 | iface_name.c_str()); |
| 350 | return {HostapdStatusCode::FAILURE_UNKNOWN, ""}; |
| 351 | } |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 352 | return {HostapdStatusCode::SUCCESS, ""}; |
| 353 | } |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 354 | |
| 355 | HostapdStatus Hostapd::registerCallbackInternal( |
| 356 | const sp<IHostapdCallback>& callback) |
| 357 | { |
| 358 | callbacks_.push_back(callback); |
| 359 | return {HostapdStatusCode::SUCCESS, ""}; |
| 360 | } |
| 361 | |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 362 | } // namespace implementation |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 363 | } // namespace V1_1 |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 364 | } // namespace hostapd |
| 365 | } // namespace wifi |
| 366 | } // namespace hardware |
| 367 | } // namespace android |