|
1 /* |
|
2 * Copyright (c) 2001-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: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef _MSCHAPV2_STATE_H_ |
|
22 #define _MSCHAPV2_STATE_H_ |
|
23 |
|
24 #include "eap_am_export.h" |
|
25 #include "abs_eap_am_tools.h" |
|
26 |
|
27 /** |
|
28 * This is the internal state of the MSCHAPV2 EAP type. |
|
29 */ |
|
30 enum eap_type_mschapv2_state_variable_e |
|
31 { |
|
32 // Common |
|
33 eap_type_mschapv2_state_none, |
|
34 |
|
35 eap_type_mschapv2_state_success, |
|
36 eap_type_mschapv2_state_failure, |
|
37 |
|
38 // Client |
|
39 eap_type_mschapv2_state_identity_request, |
|
40 eap_type_mschapv2_state_challenge_request, |
|
41 eap_type_mschapv2_state_success_request, |
|
42 eap_type_mschapv2_state_failure_request, |
|
43 eap_type_mschapv2_state_change_password_request, |
|
44 |
|
45 // Server |
|
46 eap_type_mschapv2_state_identity_response, |
|
47 eap_type_mschapv2_state_challenge_response, |
|
48 eap_type_mschapv2_state_success_response, |
|
49 eap_type_mschapv2_state_failure_response, |
|
50 eap_type_mschapv2_state_change_password_response |
|
51 }; |
|
52 |
|
53 class EAP_EXPORT eap_type_mschapv2_state_c |
|
54 { |
|
55 |
|
56 private: |
|
57 |
|
58 /// This is pointer to the tools class. |
|
59 abs_eap_am_tools_c * const m_am_tools; |
|
60 |
|
61 bool m_is_client; |
|
62 eap_type_mschapv2_state_variable_e m_state; |
|
63 eap_type_mschapv2_state_variable_e m_prev_state; |
|
64 eap_type_mschapv2_state_variable_e m_next_state; |
|
65 |
|
66 bool m_failure_message_received; |
|
67 |
|
68 public: |
|
69 eap_type_mschapv2_state_c(abs_eap_am_tools_c * const tools, const bool client); |
|
70 |
|
71 EAP_FUNC_IMPORT virtual ~eap_type_mschapv2_state_c(); |
|
72 |
|
73 eap_type_mschapv2_state_variable_e get_state() const; |
|
74 |
|
75 void set_state(const eap_type_mschapv2_state_variable_e new_state); |
|
76 |
|
77 void set_state(const eap_type_mschapv2_state_variable_e new_state, const eap_type_mschapv2_state_variable_e next_state); |
|
78 |
|
79 bool is_valid_state(const eap_type_mschapv2_state_variable_e new_state) const; |
|
80 |
|
81 void set_failure_message_received(); |
|
82 |
|
83 void unset_failure_message_received(); |
|
84 |
|
85 void cancel_eap_failure_timer(); |
|
86 }; |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 #endif //_MSCHAPV2_STATE_H_ |