|
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(_GSMSIM_STATE_H_) |
|
22 #define _GSMSIM_STATE_H_ |
|
23 |
|
24 #include "eap_tools.h" |
|
25 #include "eap_am_export.h" |
|
26 #include "eap_base_type.h" |
|
27 #include "eap_variable_data.h" |
|
28 #include "eap_type_gsmsim_header.h" |
|
29 #include "eap_type_gsmsim_types.h" |
|
30 #include "eap_type_gsmsim_payloads.h" |
|
31 #include "abs_eap_type_gsmsim_state.h" |
|
32 #include "abs_eap_base_timer.h" |
|
33 #if defined(USE_EAP_TYPE_SERVER_GSMSIM) |
|
34 #include "eap_sim_triplets.h" |
|
35 #endif //#if defined(USE_EAP_TYPE_SERVER_GSMSIM) |
|
36 #include "eap_type_gsmsim_state_notification.h" |
|
37 #include "eap_am_network_id.h" |
|
38 |
|
39 |
|
40 const u32_t GSMSIM_STATE_MAX_TYPES = 4; |
|
41 |
|
42 |
|
43 //----------------------------------------------- |
|
44 |
|
45 /// This class stores the valid GSMSIM messages (gsmsim_subtype_e) |
|
46 /// within a one state (eap_type_gsmsim_state_variable_e). |
|
47 class EAP_EXPORT eap_type_gsmsim_state_variable_parameters_c |
|
48 { |
|
49 private: |
|
50 |
|
51 /// Array includes valid GSMSIM messages (gsmsim_subtype_e). |
|
52 gsmsim_subtype_e m_valid_types[GSMSIM_STATE_MAX_TYPES]; |
|
53 |
|
54 /// The handler of this state must be initiator (server, authenticator). |
|
55 bool m_must_be_initiator; |
|
56 |
|
57 /// The handler of this state must be responsed (client, peer). |
|
58 bool m_must_be_responder; |
|
59 |
|
60 public: |
|
61 |
|
62 /** |
|
63 * Destructor does nothing. |
|
64 */ |
|
65 EAP_FUNC_IMPORT virtual ~eap_type_gsmsim_state_variable_parameters_c(); |
|
66 |
|
67 /** |
|
68 * Constructor initializes attributes with default values. |
|
69 */ |
|
70 EAP_FUNC_IMPORT eap_type_gsmsim_state_variable_parameters_c(); |
|
71 |
|
72 /** |
|
73 * This function checks the GSMSIM message is valid in this state. |
|
74 */ |
|
75 EAP_FUNC_IMPORT bool check_valid_types(gsmsim_subtype_e type) const; |
|
76 |
|
77 /** |
|
78 * This function checks the initiator is valid in this state. |
|
79 */ |
|
80 EAP_FUNC_IMPORT bool check_initiator(const bool is_initiator) const; |
|
81 |
|
82 /** |
|
83 * This function initializes this state to allow three GSMSIM message types. |
|
84 */ |
|
85 EAP_FUNC_IMPORT void init_state( |
|
86 const bool must_be_initiator, |
|
87 const bool must_be_responder, |
|
88 const gsmsim_subtype_e type0, |
|
89 const gsmsim_subtype_e type1, |
|
90 const gsmsim_subtype_e type2, |
|
91 const gsmsim_subtype_e type3 |
|
92 ); |
|
93 }; |
|
94 |
|
95 |
|
96 #endif //#if !defined(_GSMSIM_STATE_H_) |
|
97 |
|
98 //-------------------------------------------------- |
|
99 |
|
100 |
|
101 |
|
102 // End. |