|
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 #if !defined(_ABS_EAP_STATE_NOTIFICATION_H_) |
|
22 #define _ABS_EAP_STATE_NOTIFICATION_H_ |
|
23 |
|
24 #include "eap_am_export.h" |
|
25 #include "eap_protocol_layer.h" |
|
26 #include "eap_header.h" |
|
27 |
|
28 class eap_am_network_id_c; |
|
29 |
|
30 enum eap_state_notification_eap_e |
|
31 { |
|
32 eap_state_notification_eap, |
|
33 }; |
|
34 |
|
35 enum eap_state_notification_generic_e |
|
36 { |
|
37 eap_state_notification_generic, |
|
38 }; |
|
39 |
|
40 |
|
41 /// This class is the interface to state notification class. |
|
42 /// This is mostly used for state indications, debugging and protocol testing. |
|
43 /// The lower level could get information of the authentication states. |
|
44 class EAP_EXPORT abs_eap_state_notification_c |
|
45 { |
|
46 private: |
|
47 //-------------------------------------------------- |
|
48 |
|
49 //-------------------------------------------------- |
|
50 protected: |
|
51 //-------------------------------------------------- |
|
52 |
|
53 //-------------------------------------------------- |
|
54 public: |
|
55 //-------------------------------------------------- |
|
56 |
|
57 /** |
|
58 * The destructor of the abs_eap_state_notification_c class does nothing special. |
|
59 */ |
|
60 virtual ~abs_eap_state_notification_c() |
|
61 { |
|
62 } |
|
63 |
|
64 /** |
|
65 * The constructor of the abs_eap_state_notification_c class does nothing special. |
|
66 */ |
|
67 abs_eap_state_notification_c() |
|
68 { |
|
69 } |
|
70 |
|
71 /** |
|
72 * This returns send network id. |
|
73 */ |
|
74 virtual const eap_am_network_id_c * get_send_network_id() const = 0; |
|
75 |
|
76 /** |
|
77 * This returns the protocol layer that send this notification. |
|
78 */ |
|
79 virtual eap_protocol_layer_e get_protocol_layer() const = 0; |
|
80 |
|
81 /** |
|
82 * This returns the protocol on the layer that send this notification. |
|
83 * This is plain 32-bit value because of easy abstraction. |
|
84 * Later we could do more detailed information. |
|
85 * Each protocol layer and EAP type should define own internal states. |
|
86 */ |
|
87 virtual u32_t get_protocol() const = 0; |
|
88 |
|
89 /** |
|
90 * This returns the protocol on the layer that send this notification. |
|
91 * This is eap_type_value_e value. |
|
92 * Before using this check the get_protocol_layer() returns eap_protocol_layer_eap, |
|
93 * eap_protocol_layer_eap_type, eap_protocol_layer_general or eap_protocol_layer_internal_type. |
|
94 */ |
|
95 virtual eap_type_value_e get_eap_type() const = 0; |
|
96 |
|
97 /** |
|
98 * This returns the previous state. |
|
99 * This is plain 32-bit value because of easy abstraction. |
|
100 * Later we could do more detailed information. |
|
101 * Each protocol layer and EAP type should define own internal states. |
|
102 */ |
|
103 virtual u32_t get_previous_state() const = 0; |
|
104 |
|
105 /** |
|
106 * This returns the previous state string. |
|
107 */ |
|
108 virtual eap_const_string get_previous_state_string() const = 0; |
|
109 |
|
110 /** |
|
111 * This returns the current state. |
|
112 * This is plain 32-bit value because of easy abstraction. |
|
113 * Later we could do more detailed information. |
|
114 * Each protocol layer and EAP type should define own internal states. |
|
115 */ |
|
116 virtual u32_t get_current_state() const = 0; |
|
117 |
|
118 /** |
|
119 * This returns the current state string. |
|
120 */ |
|
121 virtual eap_const_string get_current_state_string() const = 0; |
|
122 |
|
123 /** |
|
124 * This returns true when notifier is client, false when server. |
|
125 */ |
|
126 virtual bool get_is_client() const = 0; |
|
127 |
|
128 /** |
|
129 * This returns EAP-Identifier. |
|
130 */ |
|
131 virtual u8_t get_eap_identifier() const = 0; |
|
132 |
|
133 /** |
|
134 * This function sets flag that allows EAP-Core to send EAP-Response/Success. |
|
135 */ |
|
136 virtual bool get_allow_send_eap_success() const = 0; |
|
137 |
|
138 /** |
|
139 * This function sets notification text that is displayed to user. |
|
140 * Text must be localized string. Type of the string is known to adaptation modules. |
|
141 * Type depends on the running environment. |
|
142 * Value true of the parameter needs_confirmation_from_user tells whether |
|
143 * there should be user action to confirm the text. |
|
144 * When notification is information where user action is not needed |
|
145 * the needs_confirmation_from_user parameter should be false. |
|
146 * Mostly it is better to set this false to disrupt the user less. |
|
147 */ |
|
148 virtual eap_status_e set_notification_string( |
|
149 const eap_variable_data_c * const notification_string, |
|
150 const bool needs_confirmation_from_user) = 0; |
|
151 |
|
152 /** |
|
153 * This function gets the notification text that is displayed to user. |
|
154 */ |
|
155 virtual const eap_variable_data_c * get_notification_string() const = 0; |
|
156 |
|
157 /** |
|
158 * This function gets flag that tells whether |
|
159 * there should be user action to confirm the text. |
|
160 */ |
|
161 virtual bool get_needs_confirmation_from_user() const = 0; |
|
162 |
|
163 /** |
|
164 * The authentication error must be set when get_protocol_layer() returns eap_protocol_layer_general |
|
165 * and get_current_state() returns eap_general_state_authentication_error. |
|
166 */ |
|
167 virtual void set_authentication_error(const eap_status_e error) = 0; |
|
168 |
|
169 /** |
|
170 * This function returns the authentication error when get_protocol_layer() returns eap_protocol_layer_general |
|
171 * and get_current_state() returns eap_general_state_authentication_error. |
|
172 */ |
|
173 virtual eap_status_e get_authentication_error() const = 0; |
|
174 |
|
175 /** |
|
176 * This returns the protocol layer string string. |
|
177 */ |
|
178 virtual eap_const_string get_protocol_layer_string() const = 0; |
|
179 |
|
180 /** |
|
181 * This returns the protocol string string. |
|
182 */ |
|
183 virtual eap_const_string get_protocol_string() const = 0; |
|
184 |
|
185 //-------------------------------------------------- |
|
186 }; // class abs_eap_state_notification_c |
|
187 |
|
188 #endif //#if !defined(_ABS_EAP_STATE_NOTIFICATION_H_) |
|
189 |
|
190 //-------------------------------------------------- |
|
191 |
|
192 |
|
193 |
|
194 // End. |