blob: 695424d0ad6107574255d695b61a183164c0937b [file] [log] [blame]
mukesh agrawal4d0401c2012-01-06 16:05:31 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
mukesh agrawal6e277772011-09-29 15:04:23 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_WPA_SUPPLICANT_H
6#define SHILL_WPA_SUPPLICANT_H
7
Paul Stewart0654ece2013-03-26 15:21:26 -07008#include <map>
9#include <string>
10#include <vector>
11
mukesh agrawal6e277772011-09-29 15:04:23 -070012#include <base/basictypes.h>
Paul Stewart0654ece2013-03-26 15:21:26 -070013#include <dbus-c++/dbus.h>
mukesh agrawal6e277772011-09-29 15:04:23 -070014
15namespace shill {
16
Paul Stewart0654ece2013-03-26 15:21:26 -070017class CertificateFile;
18struct EapCredentials;
19class NSS;
20
21class WPASupplicant {
22 public:
23 static const char kBSSPropertyBSSID[];
24 static const char kBSSPropertyFrequency[];
25 static const char kBSSPropertyIEs[];
26 static const char kBSSPropertyMode[];
27 static const char kBSSPropertyRates[];
28 static const char kBSSPropertySSID[];
29 static const char kBSSPropertySignal[];
30 static const char kCaPath[];
31 static const char kCurrentBSSNull[];
32 static const char kDBusAddr[];
33 static const char kDBusPath[];
34 static const char kDebugLevelDebug[];
35 static const char kDebugLevelError[];
36 static const char kDebugLevelExcessive[];
37 static const char kDebugLevelInfo[];
38 static const char kDebugLevelMsgDump[];
39 static const char kDebugLevelWarning[];
40 static const char kDriverNL80211[];
Paul Stewart196f50f2013-03-27 18:02:11 -070041 static const char kDriverWired[];
Paul Stewart0654ece2013-03-26 15:21:26 -070042 static const char kEAPParameterAlertUnknownCA[];
43 static const char kEAPParameterFailure[];
44 static const char kEAPParameterSuccess[];
45 static const char kEAPStatusAcceptProposedMethod[];
46 static const char kEAPStatusCompletion[];
47 static const char kEAPStatusLocalTLSAlert[];
48 static const char kEAPStatusParameterNeeded[];
49 static const char kEAPStatusRemoteCertificateVerification[];
50 static const char kEAPStatusRemoteTLSAlert[];
51 static const char kEAPStatusStarted[];
52 static const char kEnginePKCS11[];
53 static const char kErrorNetworkUnknown[];
54 static const char kErrorInterfaceExists[];
55 static const char kInterfacePropertyConfigFile[];
56 static const char kInterfacePropertyCurrentBSS[];
57 static const char kInterfacePropertyDepth[];
58 static const char kInterfacePropertyDriver[];
59 static const char kInterfacePropertyName[];
60 static const char kInterfacePropertyState[];
61 static const char kInterfacePropertySubject[];
62 static const char kInterfaceState4WayHandshake[];
63 static const char kInterfaceStateAssociated[];
64 static const char kInterfaceStateAssociating[];
65 static const char kInterfaceStateAuthenticating[];
66 static const char kInterfaceStateCompleted[];
67 static const char kInterfaceStateDisconnected[];
68 static const char kInterfaceStateGroupHandshake[];
69 static const char kInterfaceStateInactive[];
70 static const char kInterfaceStateScanning[];
71 static const char kKeyManagementMethodSuffixEAP[];
72 static const char kKeyManagementMethodSuffixPSK[];
73 static const char kKeyModeNone[];
74 static const char kNetworkBgscanMethodLearn[];
Christopher Wileya998df22012-07-11 15:14:55 -070075// None is not a real method name, but we interpret 'none' as a request that
76// no background scan parameter should be supplied to wpa_supplicant.
Paul Stewart0654ece2013-03-26 15:21:26 -070077 static const char kNetworkBgscanMethodNone[];
78 static const char kNetworkBgscanMethodSimple[];
79 static const char kNetworkModeInfrastructure[];
80 static const char kNetworkModeAdHoc[];
81 static const char kNetworkModeAccessPoint[];
82 static const char kNetworkPropertyBgscan[];
83 static const char kNetworkPropertyCaPath[];
84 static const char kNetworkPropertyEapKeyManagement[];
85 static const char kNetworkPropertyEapIdentity[];
86 static const char kNetworkPropertyEapEap[];
87 static const char kNetworkPropertyEapInnerEap[];
88 static const char kNetworkPropertyEapAnonymousIdentity[];
89 static const char kNetworkPropertyEapClientCert[];
90 static const char kNetworkPropertyEapPrivateKey[];
91 static const char kNetworkPropertyEapPrivateKeyPassword[];
92 static const char kNetworkPropertyEapCaCert[];
93 static const char kNetworkPropertyEapCaPassword[];
94 static const char kNetworkPropertyEapCertId[];
95 static const char kNetworkPropertyEapKeyId[];
96 static const char kNetworkPropertyEapCaCertId[];
97 static const char kNetworkPropertyEapPin[];
98 static const char kNetworkPropertyEapSubjectMatch[];
99 static const char kNetworkPropertyEngine[];
100 static const char kNetworkPropertyEngineId[];
101 static const char kNetworkPropertyFrequency[];
102 static const char kNetworkPropertyIeee80211w[];
103 static const char kNetworkPropertyMode[];
104 static const char kNetworkPropertySSID[];
105 static const char kNetworkPropertyScanSSID[];
mukesh agrawal64896322011-12-01 01:13:10 +0000106// TODO(quiche): Make the naming scheme more consistent, by adding the
107// object type to the property names below. (crosbug.com/23656)
Paul Stewart0654ece2013-03-26 15:21:26 -0700108 static const char kPropertyAuthAlg[];
109 static const char kPropertyBSSID[];
110 static const char kPropertyMode[];
111 static const char kPropertyPreSharedKey[];
112 static const char kPropertyPrivacy[];
113 static const char kPropertyRSN[];
114 static const char kPropertyScanSSIDs[];
115 static const char kPropertyScanType[];
116 static const char kPropertySecurityProtocol[];
117 static const char kPropertySignal[];
118 static const char kPropertyWEPKey[];
119 static const char kPropertyWEPTxKeyIndex[];
120 static const char kPropertyWPA[];
121 static const char kScanTypeActive[];
122 static const char kSecurityAuthAlg[];
123 static const char kSecurityMethodPropertyKeyManagement[];
124 static const char kSecurityModeRSN[];
125 static const char kSecurityModeWPA[];
mukesh agrawal6e277772011-09-29 15:04:23 -0700126
Paul Stewart0654ece2013-03-26 15:21:26 -0700127 static const uint32_t kDefaultEngine;
128 static const uint32_t kNetworkIeee80211wDisabled;
129 static const uint32_t kNetworkIeee80211wEnabled;
130 static const uint32_t kNetworkIeee80211wRequired;
131 static const uint32_t kNetworkModeInfrastructureInt;
132 static const uint32_t kNetworkModeAdHocInt;
133 static const uint32_t kNetworkModeAccessPointInt;
134 static const uint32_t kScanMaxSSIDsPerScan;
135
Paul Stewart196f50f2013-03-27 18:02:11 -0700136 static const char kSupplicantConfPath[];
137
Paul Stewart0654ece2013-03-26 15:21:26 -0700138 // Populate the wpa_supplicant DBus parameter map |params| with the
139 // credentials in |eap|. To do so, this function may use |certificate_file|
140 // or |nss| to export CA certificates to be passed to wpa_supplicant.
141 static void Populate8021xProperties(
142 const EapCredentials &eap, CertificateFile *certificate_file,
143 NSS *nss, const std::vector<char> nss_identifier,
144 std::map<std::string, DBus::Variant> *params);
mukesh agrawal6e277772011-09-29 15:04:23 -0700145};
146
147} // namespace shill
148
149#endif // SHILL_WPA_SUPPLICANT_H