15c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// 25c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// Copyright (C) 2015 The Android Open Source Project 35c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// 45c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// Licensed under the Apache License, Version 2.0 (the "License") override; 55c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// you may not use this file except in compliance with the License. 65c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// You may obtain a copy of the License at 75c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// 85c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// http://www.apache.org/licenses/LICENSE-2.0 95c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// 105c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// Unless required by applicable law or agreed to in writing, software 115c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// distributed under the License is distributed on an "AS IS" BASIS, 125c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// See the License for the specific language governing permissions and 145c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// limitations under the License. 155c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// 165c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius 175c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius#ifndef PROXY_DBUS_SHILL_WIFI_CLIENT_H 185c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius#define PROXY_DBUS_SHILL_WIFI_CLIENT_H 195c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius 205c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius#include "proxy_dbus_client.h" 215c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius#include "proxy_shill_wifi_client.h" 225c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius 235c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// This is the class implementing the ShillWifiClient abstract interface for a Dbus 245c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius// Client. 255c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Piusclass ProxyDbusShillWifiClient : public ProxyShillWifiClient { 265c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius public: 279cfc26a516f58d6f0c5f066c779b332d81cd0c4eRoshan Pius ProxyDbusShillWifiClient(scoped_refptr<dbus::Bus> dbus_bus); 289cfc26a516f58d6f0c5f066c779b332d81cd0c4eRoshan Pius ~ProxyDbusShillWifiClient() override = default; 299cfc26a516f58d6f0c5f066c779b332d81cd0c4eRoshan Pius bool SetLogging() override; 309cfc26a516f58d6f0c5f066c779b332d81cd0c4eRoshan Pius bool RemoveAllWifiEntries() override; 3158f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius bool ConfigureServiceByGuid(const std::string& guid, 3258f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius AutoConnectType autoconnect, 3358f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius const std::string& passphrase) override; 3458f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius bool ConfigureWifiService(const std::string& ssid, 3558f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius const std::string& security, 3658f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius const brillo::VariantDictionary& security_params, 375c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius bool save_credentials, 385c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius StationType station_type, 395c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius bool hidden_network, 4058f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius const std::string& guid, 415c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius AutoConnectType autoconnect) override; 42f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius bool ConnectToWifiNetwork(const std::string& ssid, 43f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius const std::string& security, 44f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius const brillo::VariantDictionary& security_params, 455c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius bool save_credentials, 465c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius StationType station_type, 475c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius bool hidden_network, 48f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius const std::string& guid, 495c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius AutoConnectType autoconnect, 50f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius long discovery_timeout_milliseconds, 51f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius long association_timeout_milliseconds, 52f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius long configuration_timeout_milliseconds, 53f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius long* discovery_time_milliseconds, 54f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius long* association_time_milliseconds, 55f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius long* configuration_time_milliseconds, 56f751cd3cd732ee302ebc813a2c09fd286bf6d38aRoshan Pius std::string* failure_reason) override; 5782c4ed9c51c24d5458e1cc3c018e682f483b2ccdRoshan Pius bool DisconnectFromWifiNetwork(const std::string& ssid, 5882c4ed9c51c24d5458e1cc3c018e682f483b2ccdRoshan Pius long disconnect_timeout_milliseconds, 5982c4ed9c51c24d5458e1cc3c018e682f483b2ccdRoshan Pius long* disconnect_time_milliseconds, 6082c4ed9c51c24d5458e1cc3c018e682f483b2ccdRoshan Pius std::string* failure_reason) override; 6182c4ed9c51c24d5458e1cc3c018e682f483b2ccdRoshan Pius bool ConfigureBgScan(const std::string& interface_name, 6282c4ed9c51c24d5458e1cc3c018e682f483b2ccdRoshan Pius const std::string& method_name, 633a62e235646ec19bee71e8dbee5208282dcd13b5Alex Vakulenko uint16_t short_interval, 643a62e235646ec19bee71e8dbee5208282dcd13b5Alex Vakulenko uint16_t long_interval, 6582c4ed9c51c24d5458e1cc3c018e682f483b2ccdRoshan Pius int signal_threshold) override; 66a5354f8fe745e91d9de5dd8d9c1396c4ba076d24Roshan Pius bool GetActiveWifiSsids(std::vector<std::string>* ssids) override; 67a5354f8fe745e91d9de5dd8d9c1396c4ba076d24Roshan Pius bool WaitForServiceStates(const std::string& ssid, 685c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius const std::vector<std::string>& expected_states, 69a5354f8fe745e91d9de5dd8d9c1396c4ba076d24Roshan Pius long wait_timeout_milliseconds, 70a5354f8fe745e91d9de5dd8d9c1396c4ba076d24Roshan Pius std::string* final_state, 71a5354f8fe745e91d9de5dd8d9c1396c4ba076d24Roshan Pius long* wait_time_milliseconds) override; 726a5ac27e04f987fe108cea5745368917f6067b2dRoshan Pius bool CreateProfile(const std::string& profile_name) override; 736a5ac27e04f987fe108cea5745368917f6067b2dRoshan Pius bool PushProfile(const std::string& profile_name) override; 746a5ac27e04f987fe108cea5745368917f6067b2dRoshan Pius bool PopProfile(const std::string& profile_name) override; 756a5ac27e04f987fe108cea5745368917f6067b2dRoshan Pius bool RemoveProfile(const std::string& profile_name) override; 765c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius bool CleanProfiles() override; 778d439de5ced728792cc239de20efa508758c227dRoshan Pius bool DeleteEntriesForSsid(const std::string& ssid) override; 788d439de5ced728792cc239de20efa508758c227dRoshan Pius bool ListControlledWifiInterfaces(std::vector<std::string>* interface_names) override; 798d439de5ced728792cc239de20efa508758c227dRoshan Pius bool Disconnect(const std::string& ssid) override; 80c047fb393a7d364de958ce3881d75b75bb428da3Roshan Pius bool GetServiceOrder(std::string* service_order) override; 81c047fb393a7d364de958ce3881d75b75bb428da3Roshan Pius bool SetServiceOrder(const std::string& service_order) override; 82c047fb393a7d364de958ce3881d75b75bb428da3Roshan Pius bool GetServiceProperties(const std::string& ssid, 83c047fb393a7d364de958ce3881d75b75bb428da3Roshan Pius brillo::VariantDictionary* properties) override; 845c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius bool SetSchedScan(bool enable) override; 8578dfe30f944f6eb63e6b56b632e3c048fbcd2524Roshan Pius bool GetPropertyOnDevice(const std::string& interface_name, 8678dfe30f944f6eb63e6b56b632e3c048fbcd2524Roshan Pius const std::string& property_name, 8778dfe30f944f6eb63e6b56b632e3c048fbcd2524Roshan Pius brillo::Any* property_value) override; 8878dfe30f944f6eb63e6b56b632e3c048fbcd2524Roshan Pius bool SetPropertyOnDevice(const std::string& interface_name, 8978dfe30f944f6eb63e6b56b632e3c048fbcd2524Roshan Pius const std::string& property_name, 9078dfe30f944f6eb63e6b56b632e3c048fbcd2524Roshan Pius const brillo::Any& property_value) override; 919cac82a4fda9ceee25e69b21686645daa4266afbRoshan Pius bool RequestRoam(const std::string& interface_name, const std::string& bssid) override; 929cac82a4fda9ceee25e69b21686645daa4266afbRoshan Pius bool SetDeviceEnabled(const std::string& interface_name, bool enable) override; 9390d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius bool DiscoverTdlsLink(const std::string& interface_name, 9490d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius const std::string& peer_mac_address) override; 9590d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius bool EstablishTdlsLink(const std::string& interface_name, 9690d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius const std::string& peer_mac_address) override; 9790d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius bool QueryTdlsLink(const std::string& interface_name, 9890d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius const std::string& peer_mac_address, 9990d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius std::string* status) override; 100be28266e1e51a76629f109063eb7fe1ea38823a8Roshan Pius bool AddWakePacketSource(const std::string& interface_name, 101be28266e1e51a76629f109063eb7fe1ea38823a8Roshan Pius const std::string& source_ip_address) override; 102be28266e1e51a76629f109063eb7fe1ea38823a8Roshan Pius bool RemoveWakePacketSource(const std::string& interface_name, 103be28266e1e51a76629f109063eb7fe1ea38823a8Roshan Pius const std::string& source_ip_address) override; 104be28266e1e51a76629f109063eb7fe1ea38823a8Roshan Pius bool RemoveAllWakePacketSources(const std::string& interface_name) override; 1055c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius 1065c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius private: 10758f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius void SetAutoConnectInServiceParams(AutoConnectType autoconnect, 10858f74a182a788f7e1a9219b099fb502a4fc07f48Roshan Pius brillo::VariantDictionary* service_params); 10990d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius bool PerformTdlsOperation(const std::string& interface_name, 11090d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius const std::string& operation, 11190d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius const std::string& peer_mac_address, 11290d08ac5a43d06f6674edc394f4a0d05cf2298b9Roshan Pius std::string* out_params); 1135c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius std::unique_ptr<ProxyDbusClient> dbus_client_; 1145c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius}; 1155c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius 1165c01b468e7dc6bfd74928bbd5e9726df374fd252Roshan Pius#endif // PROXY_DBUS_SHILL_WIFI_CLIENT_H 117