|
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_STACK_INTERFACE_H_) |
|
22 #define _ABS_EAP_STACK_INTERFACE_H_ |
|
23 |
|
24 #include "eap_am_export.h" |
|
25 |
|
26 class eap_am_network_id_c; |
|
27 class eap_general_header_base_c; |
|
28 |
|
29 |
|
30 /// The abs_eap_stack_interface_c class declares common pure virtual functions |
|
31 /// a lower layer class of EAP-stack could call from upper layer class. |
|
32 /// Main purpose of this interface is documenting those functions. |
|
33 /// Note the each interface could include other functions too. |
|
34 /// Those are defined in each individual interface. |
|
35 class EAP_EXPORT abs_eap_stack_interface_c |
|
36 { |
|
37 private: |
|
38 //-------------------------------------------------- |
|
39 |
|
40 /** |
|
41 * The set_is_valid() function sets the state of the object valid. |
|
42 * The creator of this object calls this function after it is initialized. |
|
43 */ |
|
44 virtual void set_is_valid() = 0; |
|
45 |
|
46 //-------------------------------------------------- |
|
47 protected: |
|
48 //-------------------------------------------------- |
|
49 |
|
50 //-------------------------------------------------- |
|
51 public: |
|
52 //-------------------------------------------------- |
|
53 |
|
54 /** |
|
55 * The destructor of the abs_eap_stack_interface_c class does nothing special. |
|
56 */ |
|
57 virtual ~abs_eap_stack_interface_c() |
|
58 { |
|
59 } |
|
60 |
|
61 /** |
|
62 * The constructor of the abs_eap_stack_interface_c does nothing special. |
|
63 */ |
|
64 abs_eap_stack_interface_c() |
|
65 { |
|
66 } |
|
67 |
|
68 /** |
|
69 * The configure() function is called after the constructor of the |
|
70 * object is successfully executed. During the function call the object |
|
71 * could query the configuration. Each derived class must define this function. |
|
72 * Needed configuration depends on the implementation. |
|
73 */ |
|
74 virtual eap_status_e configure() = 0; |
|
75 |
|
76 /** |
|
77 * The shutdown() function is called before the destructor of the |
|
78 * object is executed. During the function call the object |
|
79 * could shutdown the operations, for example cancel timers. |
|
80 * Each derived class must define this function. |
|
81 */ |
|
82 virtual eap_status_e shutdown() = 0; |
|
83 |
|
84 /** |
|
85 * The packet_process() function processes the received packet. |
|
86 * The return value of this function should be used only for traces |
|
87 * and error counters. You MUST NOT make any decision of authentication session |
|
88 * based on the return value. The stack calls abs_eap_core_c::state_notification() |
|
89 * function when authentication session terminates unsuccessfully or ends successfully. |
|
90 * You MUST make decision of authentication session based on the state_notification() call. |
|
91 * See more abs_eap_core_c::state_notification(). |
|
92 * @param receive_network_id carries the addresses and type of the received packet. |
|
93 * @param packet_data includes the buffer of the packet. |
|
94 * @param packet_length is length in bytes of the EAP-packet. |
|
95 */ |
|
96 virtual eap_status_e packet_process( |
|
97 const eap_am_network_id_c * const receive_network_id, |
|
98 eap_general_header_base_c * const packet_data, |
|
99 const u32_t packet_length) = 0; |
|
100 |
|
101 /** |
|
102 * Object must indicate it's validity. |
|
103 * If object initialization fails this function must return false. |
|
104 * @return This function returns the validity of this object. |
|
105 */ |
|
106 virtual bool get_is_valid() = 0; |
|
107 |
|
108 //-------------------------------------------------- |
|
109 }; // class abs_eap_stack_interface_c |
|
110 |
|
111 #endif //#if !defined(_ABS_EAP_STACK_INTERFACE_H_) |
|
112 |
|
113 //-------------------------------------------------- |
|
114 |
|
115 |
|
116 |
|
117 // End. |