1 //
2 // Copyright (C) 2015 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef PROXY_RPC_IN_DATA_TYPES_H
18 #define PROXY_RPC_IN_DATA_TYPES_H
19 
20 #include <string>
21 
22 #include <XmlRpcValue.h>
23 
24 #include "proxy_shill_wifi_client.h"
25 #include "proxy_rpc_security_types.h"
26 
27 // Describes how to configure wpa_supplicant on a DUT.
28 class BgscanConfiguration {
29  public:
30   static const int kDefaultShortIntervalSeconds;
31   static const int kDefaultLongIntervalSeconds;
32   static const int kDefaultSignalThreshold;
33   static const char kDefaultScanMethod[];
34 
35   BgscanConfiguration(XmlRpc::XmlRpcValue* xml_rpc_value_in);
36 
37   std::string interface_;
38   int signal_threshold_;
39   int short_interval_;
40   int long_interval_;
41   std::string method_;
42 };
43 
44 // Describes parameters used in WiFi connection attempts.
45 class AssociationParameters {
46  public:
47   static const int kDefaultDiscoveryTimeoutSeconds;
48   static const int kDefaultAssociationTimeoutSeconds;
49   static const int kDefaultConfigurationTimeoutSeconds;
50 
51   AssociationParameters(XmlRpc::XmlRpcValue* xml_rpc_value_in);
52 
53   std::string ssid_;
54   int discovery_timeout_seconds_;
55   int association_timeout_seconds_;
56   int configuration_timeout_seconds_;
57   bool is_hidden_;
58   bool save_credentials_;
59   ProxyShillWifiClient::StationType station_type_;
60   std::string guid_;
61   bool expect_failure_;
62   ProxyShillWifiClient::AutoConnectType autoconnect_type_;
63   std::unique_ptr<BgscanConfiguration> bgscan_config_;
64   std::unique_ptr<SecurityConfig> security_config_;
65 };
66 
67 // Describes a group of optional settings for use with ConfigureService.
68 // The Manager in shill has a method ConfigureService which takes a dictionary
69 // of parameters, and uses some of them to look up a service, and sets the
70 // remainder of the properties on the service.  This struct represents
71 // some of the optional parameters that can be set in this way.  Current
72 // consumers of this interface look up the service by GUID.
73 class ConfigureServiceParameters {
74  public:
75   ConfigureServiceParameters(XmlRpc::XmlRpcValue* xml_rpc_value_in);
76 
77   std::string guid_;
78   std::string passphrase_;
79   ProxyShillWifiClient::AutoConnectType autoconnect_type_;
80 };
81 
82 #endif // PROXY_RPC_IN_DATA_TYPES_H
83