summaryrefslogtreecommitdiff
path: root/test-rpc-proxy
diff options
context:
space:
mode:
Diffstat (limited to 'test-rpc-proxy')
-rw-r--r--test-rpc-proxy/proxy_dbus_shill_wifi_client.cc40
-rw-r--r--test-rpc-proxy/proxy_dbus_shill_wifi_client.h10
-rw-r--r--test-rpc-proxy/proxy_shill_wifi_client.h10
3 files changed, 42 insertions, 18 deletions
diff --git a/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc b/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc
index d951a7d0..fb739e1b 100644
--- a/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc
+++ b/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc
@@ -559,20 +559,44 @@ bool ProxyDbusShillWifiClient::QueryTdlsLink(
}
bool ProxyDbusShillWifiClient::AddWakePacketSource(
- std::string interface_name,
- std::string source_ip_address) {
- return true;
+ const std::string& interface_name,
+ const std::string& source_ip_address) {
+ brillo::VariantDictionary device_params;
+ device_params.insert(std::make_pair(
+ shill::kNameProperty, brillo::Any(interface_name)));
+ std::unique_ptr<DeviceProxy> device =
+ dbus_client_->GetMatchingDeviceProxy(device_params);
+ if (!device) {
+ return false;
+ }
+ return device->AddWakeOnPacketConnection(source_ip_address, nullptr);
}
bool ProxyDbusShillWifiClient::RemoveWakePacketSource(
- std::string interface_name,
- std::string source_ip_address) {
- return true;
+ const std::string& interface_name,
+ const std::string& source_ip_address) {
+ brillo::VariantDictionary device_params;
+ device_params.insert(std::make_pair(
+ shill::kNameProperty, brillo::Any(interface_name)));
+ std::unique_ptr<DeviceProxy> device =
+ dbus_client_->GetMatchingDeviceProxy(device_params);
+ if (!device) {
+ return false;
+ }
+ return device->RemoveWakeOnPacketConnection(source_ip_address, nullptr);
}
bool ProxyDbusShillWifiClient::RemoveAllWakePacketSources(
- std::string interface_name) {
- return true;
+ const std::string& interface_name) {
+ brillo::VariantDictionary device_params;
+ device_params.insert(std::make_pair(
+ shill::kNameProperty, brillo::Any(interface_name)));
+ std::unique_ptr<DeviceProxy> device =
+ dbus_client_->GetMatchingDeviceProxy(device_params);
+ if (!device) {
+ return false;
+ }
+ return device->RemoveAllWakeOnPacketConnections(nullptr);
}
void ProxyDbusShillWifiClient::SetAutoConnectInServiceParams(
diff --git a/test-rpc-proxy/proxy_dbus_shill_wifi_client.h b/test-rpc-proxy/proxy_dbus_shill_wifi_client.h
index 46b3411b..b02a0e1e 100644
--- a/test-rpc-proxy/proxy_dbus_shill_wifi_client.h
+++ b/test-rpc-proxy/proxy_dbus_shill_wifi_client.h
@@ -97,11 +97,11 @@ class ProxyDbusShillWifiClient : public ProxyShillWifiClient {
bool QueryTdlsLink(const std::string& interface_name,
const std::string& peer_mac_address,
std::string* status) override;
- bool AddWakePacketSource(std::string interface_name,
- std::string source_ip_address) override;
- bool RemoveWakePacketSource(std::string interface_name,
- std::string source_ip_address) override;
- bool RemoveAllWakePacketSources(std::string interface_name) override;
+ bool AddWakePacketSource(const std::string& interface_name,
+ const std::string& source_ip_address) override;
+ bool RemoveWakePacketSource(const std::string& interface_name,
+ const std::string& source_ip_address) override;
+ bool RemoveAllWakePacketSources(const std::string& interface_name) override;
private:
void SetAutoConnectInServiceParams(AutoConnectType autoconnect,
diff --git a/test-rpc-proxy/proxy_shill_wifi_client.h b/test-rpc-proxy/proxy_shill_wifi_client.h
index ffb34aaf..dc3c2a0f 100644
--- a/test-rpc-proxy/proxy_shill_wifi_client.h
+++ b/test-rpc-proxy/proxy_shill_wifi_client.h
@@ -116,11 +116,11 @@ class ProxyShillWifiClient {
virtual bool QueryTdlsLink(const std::string& interface_name,
const std::string& peer_mac_address,
std::string* status) = 0;
- virtual bool AddWakePacketSource(std::string interface_name,
- std::string source_ip_address) = 0;
- virtual bool RemoveWakePacketSource(std::string interface_name,
- std::string source_ip_address) = 0;
- virtual bool RemoveAllWakePacketSources(std::string interface_name) = 0;
+ virtual bool AddWakePacketSource(const std::string& interface_name,
+ const std::string& source_ip_address) = 0;
+ virtual bool RemoveWakePacketSource(const std::string& interface_name,
+ const std::string& source_ip_address) = 0;
+ virtual bool RemoveAllWakePacketSources(const std::string& interface_name) = 0;
std::string GetModeFromStationType(StationType station_type);
};