diff options
author | Roshan Pius <rpius@google.com> | 2015-12-07 23:59:37 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-12-07 23:59:37 +0000 |
commit | f4879a671a056a24b780392ced4cc7c38fbbb063 (patch) | |
tree | ab6a545a76c986cdad23683674e5e545e35c5c5b | |
parent | 805ddd67282555b1983aeffdbbd67f22383eed3b (diff) | |
parent | 51ac846707cf05933612cb111f173afec146c267 (diff) | |
download | shill-f4879a671a056a24b780392ced4cc7c38fbbb063.tar.gz |
shill-test-proxy: Implement RPC methods (Part 9)
am: 51ac846707
* commit '51ac846707cf05933612cb111f173afec146c267':
shill-test-proxy: Implement RPC methods (Part 9)
-rw-r--r-- | test-rpc-proxy/proxy_rpc_server.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test-rpc-proxy/proxy_rpc_server.cc b/test-rpc-proxy/proxy_rpc_server.cc index 30c79b93..b64cd7a9 100644 --- a/test-rpc-proxy/proxy_rpc_server.cc +++ b/test-rpc-proxy/proxy_rpc_server.cc @@ -326,6 +326,39 @@ XmlRpc::XmlRpcValue QueryTdlsLink( } return status; } + +XmlRpc::XmlRpcValue AddWakePacketSource( + XmlRpc::XmlRpcValue params_in, + ProxyShillWifiClient* shill_wifi_client) { + if (!ValidateNumOfElements(params_in, 2)) { + return false; + } + const std::string& interface_name(params_in[0]); + const std::string& source_ip(params_in[1]); + return shill_wifi_client->AddWakePacketSource(interface_name, source_ip); +} + +XmlRpc::XmlRpcValue RemoveWakePacketSource( + XmlRpc::XmlRpcValue params_in, + ProxyShillWifiClient* shill_wifi_client) { + if (!ValidateNumOfElements(params_in, 2)) { + return false; + } + const std::string& interface_name(params_in[0]); + const std::string& source_ip(params_in[1]); + return shill_wifi_client->RemoveWakePacketSource(interface_name, source_ip); +} + +XmlRpc::XmlRpcValue RemoveAllWakePacketSources( + XmlRpc::XmlRpcValue params_in, + ProxyShillWifiClient* shill_wifi_client) { + if (!ValidateNumOfElements(params_in, 1)) { + return false; + } + const std::string& interface_name(params_in[0]); + return shill_wifi_client->RemoveAllWakePacketSources(interface_name); +} + ProxyRpcServerMethod::ProxyRpcServerMethod( const std::string& method_name, const RpcServerMethodHandler& handler, @@ -398,6 +431,11 @@ void ProxyRpcServer::Run() { RegisterRpcMethod("discover_tdls_link", base::Bind(&DiscoverTdlsLink)); RegisterRpcMethod("establish_tdls_link", base::Bind(&EstablishTdlsLink)); RegisterRpcMethod("query_tdls_link", base::Bind(&QueryTdlsLink)); + RegisterRpcMethod("add_wake_packet_source", base::Bind(&AddWakePacketSource)); + RegisterRpcMethod("remove_wake_packet_source", + base::Bind(&RemoveWakePacketSource)); + RegisterRpcMethod("remove_all_wake_packet_sources", + base::Bind(&RemoveAllWakePacketSources)); XmlRpc::XmlRpcServer::work(-1.0); } |