blob: daccf3635f9a94aa3198adec32a5c50fd2fc66b9 [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[];
41 static const char kEAPParameterAlertUnknownCA[];
42 static const char kEAPParameterFailure[];
43 static const char kEAPParameterSuccess[];
44 static const char kEAPStatusAcceptProposedMethod[];
45 static const char kEAPStatusCompletion[];
46 static const char kEAPStatusLocalTLSAlert[];
47 static const char kEAPStatusParameterNeeded[];
48 static const char kEAPStatusRemoteCertificateVerification[];
49 static const char kEAPStatusRemoteTLSAlert[];
50 static const char kEAPStatusStarted[];
51 static const char kEnginePKCS11[];
52 static const char kErrorNetworkUnknown[];
53 static const char kErrorInterfaceExists[];
54 static const char kInterfacePropertyConfigFile[];
55 static const char kInterfacePropertyCurrentBSS[];
56 static const char kInterfacePropertyDepth[];
57 static const char kInterfacePropertyDriver[];
58 static const char kInterfacePropertyName[];
59 static const char kInterfacePropertyState[];
60 static const char kInterfacePropertySubject[];
61 static const char kInterfaceState4WayHandshake[];
62 static const char kInterfaceStateAssociated[];
63 static const char kInterfaceStateAssociating[];
64 static const char kInterfaceStateAuthenticating[];
65 static const char kInterfaceStateCompleted[];
66 static const char kInterfaceStateDisconnected[];
67 static const char kInterfaceStateGroupHandshake[];
68 static const char kInterfaceStateInactive[];
69 static const char kInterfaceStateScanning[];
70 static const char kKeyManagementMethodSuffixEAP[];
71 static const char kKeyManagementMethodSuffixPSK[];
72 static const char kKeyModeNone[];
73 static const char kNetworkBgscanMethodLearn[];
Christopher Wileya998df22012-07-11 15:14:55 -070074// None is not a real method name, but we interpret 'none' as a request that
75// no background scan parameter should be supplied to wpa_supplicant.
Paul Stewart0654ece2013-03-26 15:21:26 -070076 static const char kNetworkBgscanMethodNone[];
77 static const char kNetworkBgscanMethodSimple[];
78 static const char kNetworkModeInfrastructure[];
79 static const char kNetworkModeAdHoc[];
80 static const char kNetworkModeAccessPoint[];
81 static const char kNetworkPropertyBgscan[];
82 static const char kNetworkPropertyCaPath[];
83 static const char kNetworkPropertyEapKeyManagement[];
84 static const char kNetworkPropertyEapIdentity[];
85 static const char kNetworkPropertyEapEap[];
86 static const char kNetworkPropertyEapInnerEap[];
87 static const char kNetworkPropertyEapAnonymousIdentity[];
88 static const char kNetworkPropertyEapClientCert[];
89 static const char kNetworkPropertyEapPrivateKey[];
90 static const char kNetworkPropertyEapPrivateKeyPassword[];
91 static const char kNetworkPropertyEapCaCert[];
92 static const char kNetworkPropertyEapCaPassword[];
93 static const char kNetworkPropertyEapCertId[];
94 static const char kNetworkPropertyEapKeyId[];
95 static const char kNetworkPropertyEapCaCertId[];
96 static const char kNetworkPropertyEapPin[];
97 static const char kNetworkPropertyEapSubjectMatch[];
98 static const char kNetworkPropertyEngine[];
99 static const char kNetworkPropertyEngineId[];
100 static const char kNetworkPropertyFrequency[];
101 static const char kNetworkPropertyIeee80211w[];
102 static const char kNetworkPropertyMode[];
103 static const char kNetworkPropertySSID[];
104 static const char kNetworkPropertyScanSSID[];
mukesh agrawal64896322011-12-01 01:13:10 +0000105// TODO(quiche): Make the naming scheme more consistent, by adding the
106// object type to the property names below. (crosbug.com/23656)
Paul Stewart0654ece2013-03-26 15:21:26 -0700107 static const char kPropertyAuthAlg[];
108 static const char kPropertyBSSID[];
109 static const char kPropertyMode[];
110 static const char kPropertyPreSharedKey[];
111 static const char kPropertyPrivacy[];
112 static const char kPropertyRSN[];
113 static const char kPropertyScanSSIDs[];
114 static const char kPropertyScanType[];
115 static const char kPropertySecurityProtocol[];
116 static const char kPropertySignal[];
117 static const char kPropertyWEPKey[];
118 static const char kPropertyWEPTxKeyIndex[];
119 static const char kPropertyWPA[];
120 static const char kScanTypeActive[];
121 static const char kSecurityAuthAlg[];
122 static const char kSecurityMethodPropertyKeyManagement[];
123 static const char kSecurityModeRSN[];
124 static const char kSecurityModeWPA[];
mukesh agrawal6e277772011-09-29 15:04:23 -0700125
Paul Stewart0654ece2013-03-26 15:21:26 -0700126 static const uint32_t kDefaultEngine;
127 static const uint32_t kNetworkIeee80211wDisabled;
128 static const uint32_t kNetworkIeee80211wEnabled;
129 static const uint32_t kNetworkIeee80211wRequired;
130 static const uint32_t kNetworkModeInfrastructureInt;
131 static const uint32_t kNetworkModeAdHocInt;
132 static const uint32_t kNetworkModeAccessPointInt;
133 static const uint32_t kScanMaxSSIDsPerScan;
134
135 // Populate the wpa_supplicant DBus parameter map |params| with the
136 // credentials in |eap|. To do so, this function may use |certificate_file|
137 // or |nss| to export CA certificates to be passed to wpa_supplicant.
138 static void Populate8021xProperties(
139 const EapCredentials &eap, CertificateFile *certificate_file,
140 NSS *nss, const std::vector<char> nss_identifier,
141 std::map<std::string, DBus::Variant> *params);
mukesh agrawal6e277772011-09-29 15:04:23 -0700142};
143
144} // namespace shill
145
146#endif // SHILL_WPA_SUPPLICANT_H