|
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(_SIMPLE_CONFIG_BASE_RECORD_H_) |
|
22 #define _SIMPLE_CONFIG_BASE_RECORD_H_ |
|
23 |
|
24 |
|
25 #include "simple_config_types.h" |
|
26 #include "eap_array.h" |
|
27 #include "eap_header.h" |
|
28 |
|
29 class abs_simple_config_base_record_c; |
|
30 class abs_eap_am_tools_c; |
|
31 class eap_am_network_id_c; |
|
32 class simple_config_record_header_c; |
|
33 class eap_rogue_ap_entry_c; |
|
34 |
|
35 |
|
36 /// The simple_config_base_record_c class declares pure virtual functions |
|
37 /// a user class of SIMPLE_CONFIG-record class could call. |
|
38 class EAP_EXPORT simple_config_base_record_c |
|
39 { |
|
40 private: |
|
41 //-------------------------------------------------- |
|
42 |
|
43 /// This is back pointer to object which created this object. |
|
44 /// The simple_config_base_record_c object sends packets to the network using m_type_partner object. |
|
45 /// @see abs_simple_config_base_record_c. |
|
46 abs_simple_config_base_record_c *m_type_partner; |
|
47 |
|
48 /// This is pointer to the tools class. @see abs_eap_am_tools_c. |
|
49 abs_eap_am_tools_c * const m_am_tools; |
|
50 |
|
51 /** |
|
52 * The set_is_valid() function sets the state of the object valid. |
|
53 * The creator of this object calls this function after it is initialized. |
|
54 */ |
|
55 virtual void set_is_valid() = 0; |
|
56 |
|
57 //-------------------------------------------------- |
|
58 protected: |
|
59 //-------------------------------------------------- |
|
60 |
|
61 //-------------------------------------------------- |
|
62 public: |
|
63 //-------------------------------------------------- |
|
64 |
|
65 /** |
|
66 * The destructor of the simple_config_base_record_c class does nothing special. |
|
67 */ |
|
68 EAP_FUNC_IMPORT virtual ~simple_config_base_record_c(); |
|
69 |
|
70 /** |
|
71 * The constructor of the simple_config_base_record_c class simply initializes the attributes. |
|
72 * @param tools is pointer to the tools class. @see abs_eap_am_tools_c. |
|
73 * @param partner is back pointer to object which created this object. |
|
74 * The simple_config_base_record_c object sends packets to the network using m_type_partner object. |
|
75 */ |
|
76 EAP_FUNC_IMPORT simple_config_base_record_c( |
|
77 abs_eap_am_tools_c * const tools); |
|
78 |
|
79 /** |
|
80 * Type partner is object below the simple_config_base_record_c object. |
|
81 * @return The get_type_partner() function returns the pointer to the partner class. |
|
82 */ |
|
83 EAP_FUNC_IMPORT abs_simple_config_base_record_c * get_type_partner(); |
|
84 |
|
85 EAP_FUNC_IMPORT void set_type_partner(abs_simple_config_base_record_c * const partner); |
|
86 |
|
87 /** |
|
88 * The configure() function is called after the constructor of the |
|
89 * object is successfully executed. During the function call the object |
|
90 * could query the configuration. Each derived class must define this function. |
|
91 */ |
|
92 virtual eap_status_e configure() = 0; |
|
93 |
|
94 /** |
|
95 * The shutdown() function is called before the destructor of the |
|
96 * object is executed. During the function call the object |
|
97 * could shutdown the operations, for example cancel timers. |
|
98 * Each derived class must define this function. |
|
99 */ |
|
100 virtual eap_status_e shutdown() = 0; |
|
101 |
|
102 /** |
|
103 * This function sets the NAI realm. |
|
104 */ |
|
105 virtual eap_status_e set_nai_realm(const eap_variable_data_c * const NAI_realm) = 0; |
|
106 |
|
107 /** |
|
108 * This function sends starts EAP-SIMPLE_CONFIG/PEAP after a start message is received. |
|
109 */ |
|
110 virtual eap_status_e start_simple_config_authentication( |
|
111 const eap_variable_data_c * const NAI ///< This is the full NAI of the client. |
|
112 ) = 0; |
|
113 |
|
114 /** |
|
115 * This function processes the received packet. |
|
116 * @param simple_config_packet points to the buffer of the whole reassembled SIMPLE_CONFIG-packet. |
|
117 */ |
|
118 virtual eap_status_e packet_process( |
|
119 eap_variable_data_c * const simple_config_packet, |
|
120 const u8_t received_eap_identifier) = 0; |
|
121 |
|
122 /** |
|
123 * Object must indicate it's validity. |
|
124 * If object initialization fails this function must return false. |
|
125 * @return This function returns the validity of this object. |
|
126 */ |
|
127 virtual bool get_is_valid() = 0; |
|
128 |
|
129 /** |
|
130 * This function resets the reused simple_config_base_record_c object. |
|
131 */ |
|
132 virtual eap_status_e reset() = 0; |
|
133 |
|
134 //-------------------------------------------------- |
|
135 }; // class simple_config_base_record_c |
|
136 |
|
137 #endif //#if !defined(_SIMPLE_CONFIG_BASE_RECORD_H_) |
|
138 |
|
139 //-------------------------------------------------- |
|
140 |
|
141 |
|
142 |
|
143 // End. |