|
1 /* |
|
2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declaration of the ScanInfoIe class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GENSCANINFOIE_H |
|
20 #define GENSCANINFOIE_H |
|
21 |
|
22 #include "genscaninfo.h" |
|
23 |
|
24 /** Defines the possible types of security information elements. */ |
|
25 enum ScanInfoIeType |
|
26 { |
|
27 ScanInfoIeTypeRsn, |
|
28 ScanInfoIeTypeWpa, |
|
29 ScanInfoIeTypeWapi |
|
30 }; |
|
31 |
|
32 /** Defines the possible types of key management suites. */ |
|
33 enum ScanInfoIeKeyManagement |
|
34 { |
|
35 ScanInfoIeKeyManagementEap, |
|
36 ScanInfoIeKeyManagementPsk, |
|
37 ScanInfoIeKeyManagementWapiCertificate, |
|
38 ScanInfoIeKeyManagementWapiPsk |
|
39 }; |
|
40 |
|
41 /** |
|
42 * Class determining the security mode of an access point. |
|
43 */ |
|
44 NONSHARABLE_CLASS( ScanInfoIe ) |
|
45 { |
|
46 public: // Methods |
|
47 |
|
48 // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * C++ constructor. |
|
52 */ |
|
53 ScanInfoIe(); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~ScanInfoIe(); |
|
59 |
|
60 // New methods |
|
61 |
|
62 /** |
|
63 * Parses the given scan information and returns the security |
|
64 * mode of the BSS. |
|
65 * |
|
66 * @param info Scan information to be parsed. |
|
67 * @return Security mode of the BSS. |
|
68 */ |
|
69 WlanSecurityMode SecurityMode( |
|
70 ScanInfo& info ) const; |
|
71 |
|
72 private: // Methods |
|
73 |
|
74 /** |
|
75 * Checks whether the given memory buffers are equal. |
|
76 * |
|
77 * @param pl Pointer to parameter1 data. |
|
78 * @param ll Length of parameter1 data. |
|
79 * @param pr Pointer to parameter2 data. |
|
80 * @param rl Length of parameter2 data. |
|
81 * @return 0 if data is same or similar |
|
82 * !0 if data is not similar |
|
83 */ |
|
84 int Compare( |
|
85 const unsigned char* pl, |
|
86 int ll, |
|
87 const unsigned char* pr, |
|
88 int rl ) const; |
|
89 |
|
90 /** |
|
91 * Checks whether the given information element defines |
|
92 * the expected key management suite. |
|
93 * |
|
94 * @param ie_type Type of of the information element. |
|
95 * @param key_type Expected key management suite. |
|
96 * @param ie_length Length of the IE. |
|
97 * @param ie_data Pointer to the beginning of the IE data. |
|
98 * @return true_t if expected key management suite is defined, |
|
99 * false_t otherwise. |
|
100 */ |
|
101 bool_t IsKeyManagement( |
|
102 ScanInfoIeType ie_type, |
|
103 ScanInfoIeKeyManagement key_type, |
|
104 u8_t ie_length, |
|
105 const u8_t* ie_data ) const; |
|
106 |
|
107 /** |
|
108 * Checks whether the given information element defines |
|
109 * valid ciphers suites for WPA2. |
|
110 * |
|
111 * @param ie_type Type of of the information element. |
|
112 * @param ie_length Length of the IE. |
|
113 * @param ie_data Pointer to the beginning of the IE data. |
|
114 * @return true_t if cipher suites are for WPA2, false_t otherwise. |
|
115 */ |
|
116 bool_t IsWpa2Ciphers( |
|
117 ScanInfoIeType ie_type, |
|
118 u8_t ie_length, |
|
119 const u8_t* ie_data ) const; |
|
120 |
|
121 /** |
|
122 * Prohibit copy constructor. |
|
123 */ |
|
124 ScanInfoIe( |
|
125 const ScanInfoIe& ); |
|
126 /** |
|
127 * Prohibit assigment operator. |
|
128 */ |
|
129 ScanInfoIe& operator= ( |
|
130 const ScanInfoIe& ); |
|
131 }; |
|
132 |
|
133 #endif // GENSCANINFOIE_H |