|
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 #if !defined(_AKA_STATE_H_) |
|
21 #define _AKA_STATE_H_ |
|
22 |
|
23 #include "eap_tools.h" |
|
24 #include "eap_am_export.h" |
|
25 #include "eap_base_type.h" |
|
26 #include "eap_variable_data.h" |
|
27 #include "eap_type_aka_header.h" |
|
28 #include "eap_type_aka_types.h" |
|
29 #include "eap_type_aka_payloads.h" |
|
30 #include "abs_eap_base_timer.h" |
|
31 #include "eap_type_aka_authentication_vector.h" |
|
32 #include "eap_type_aka_state_notification.h" |
|
33 #include "eap_am_network_id.h" |
|
34 |
|
35 |
|
36 const u32_t AKA_STATE_MAX_TYPES = 5; |
|
37 |
|
38 |
|
39 //----------------------------------------------- |
|
40 |
|
41 /// This class stores the valid AKA messages (aka_subtype_e) |
|
42 /// within a one state (eap_type_aka_state_variable_e). |
|
43 class EAP_EXPORT eap_type_aka_state_variable_parameters_c |
|
44 { |
|
45 private: |
|
46 |
|
47 /// Array includes valid AKA messages (aka_subtype_e). |
|
48 aka_subtype_e m_valid_types[AKA_STATE_MAX_TYPES]; |
|
49 |
|
50 /// The handler of this state must be initiator (server, authenticator). |
|
51 bool m_must_be_initiator; |
|
52 |
|
53 /// The handler of this state must be responsed (client, peer). |
|
54 bool m_must_be_responder; |
|
55 |
|
56 bool m_dummy_1_for_alignment; |
|
57 |
|
58 bool m_dummy_2_for_alignment; |
|
59 |
|
60 public: |
|
61 |
|
62 /** |
|
63 * Destructor does nothing. |
|
64 */ |
|
65 EAP_FUNC_IMPORT virtual ~eap_type_aka_state_variable_parameters_c(); |
|
66 |
|
67 /** |
|
68 * Constructor initializes attributes with default values. |
|
69 */ |
|
70 EAP_FUNC_IMPORT eap_type_aka_state_variable_parameters_c(); |
|
71 |
|
72 /** |
|
73 * This function checks the AKA message is valid in this state. |
|
74 */ |
|
75 EAP_FUNC_IMPORT bool check_valid_types(aka_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 AKA message types. |
|
84 */ |
|
85 EAP_FUNC_IMPORT void init_state( |
|
86 const bool must_be_initiator, |
|
87 const bool must_be_responder, |
|
88 const aka_subtype_e type0, |
|
89 const aka_subtype_e type1, |
|
90 const aka_subtype_e type2, |
|
91 const aka_subtype_e type3, |
|
92 const aka_subtype_e type4 |
|
93 ); |
|
94 }; |
|
95 |
|
96 |
|
97 //----------------------------------------------- |
|
98 |
|
99 #endif //#if !defined(_AKA_STATE_H_) |
|
100 |
|
101 //-------------------------------------------------- |
|
102 |
|
103 |
|
104 |
|
105 // End. |