|
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 #include "eap_tools.h" |
|
20 #include "simple_config_credential.h" |
|
21 |
|
22 /** @file */ |
|
23 |
|
24 |
|
25 //---------------------------------------------------------------------------- |
|
26 |
|
27 EAP_FUNC_EXPORT simple_config_credential_c::~simple_config_credential_c() |
|
28 { |
|
29 } |
|
30 |
|
31 //---------------------------------------------------------------------------- |
|
32 |
|
33 EAP_FUNC_EXPORT simple_config_credential_c::simple_config_credential_c( |
|
34 abs_eap_am_tools_c * const tools) |
|
35 : m_am_tools(tools) |
|
36 , m_network_index(1ul) |
|
37 , m_SSID(tools) |
|
38 , m_Authentication_Type(simple_config_Authentication_Type_None) |
|
39 , m_Encryption_Type(simple_config_Encryption_Type_None) |
|
40 , m_network_keys(tools) |
|
41 , m_MAC_address(tools) |
|
42 , m_is_valid(false) |
|
43 { |
|
44 if (m_SSID.get_is_valid() == false) |
|
45 { |
|
46 return; |
|
47 } |
|
48 |
|
49 if (m_MAC_address.get_is_valid() == false) |
|
50 { |
|
51 return; |
|
52 } |
|
53 |
|
54 m_is_valid = true; |
|
55 } |
|
56 |
|
57 //---------------------------------------------------------------------------- |
|
58 |
|
59 EAP_FUNC_EXPORT void simple_config_credential_c::set_network_index(const u8_t index) |
|
60 { |
|
61 m_network_index = index; |
|
62 } |
|
63 |
|
64 //---------------------------------------------------------------------------- |
|
65 |
|
66 EAP_FUNC_EXPORT u8_t simple_config_credential_c::get_network_index() |
|
67 { |
|
68 return m_network_index; |
|
69 } |
|
70 |
|
71 //---------------------------------------------------------------------------- |
|
72 |
|
73 EAP_FUNC_EXPORT eap_variable_data_c * simple_config_credential_c::get_SSID() |
|
74 { |
|
75 return &m_SSID; |
|
76 } |
|
77 |
|
78 //---------------------------------------------------------------------------- |
|
79 |
|
80 EAP_FUNC_EXPORT simple_config_Authentication_Type_e simple_config_credential_c::get_Authentication_Type() |
|
81 { |
|
82 return m_Authentication_Type; |
|
83 } |
|
84 |
|
85 //---------------------------------------------------------------------------- |
|
86 |
|
87 EAP_FUNC_EXPORT void simple_config_credential_c::set_Authentication_Type(const simple_config_Authentication_Type_e Authentication_Type) |
|
88 { |
|
89 m_Authentication_Type = Authentication_Type; |
|
90 } |
|
91 |
|
92 //---------------------------------------------------------------------------- |
|
93 |
|
94 EAP_FUNC_EXPORT simple_config_Encryption_Type_e simple_config_credential_c::get_Encryption_Type() |
|
95 { |
|
96 return m_Encryption_Type; |
|
97 } |
|
98 |
|
99 //---------------------------------------------------------------------------- |
|
100 |
|
101 EAP_FUNC_EXPORT void simple_config_credential_c::set_Encryption_Type(const simple_config_Encryption_Type_e Encryption_Type) |
|
102 { |
|
103 m_Encryption_Type = Encryption_Type; |
|
104 } |
|
105 |
|
106 //---------------------------------------------------------------------------- |
|
107 |
|
108 EAP_FUNC_EXPORT eap_array_c<network_key_and_index_c> * simple_config_credential_c::get_network_keys() |
|
109 { |
|
110 return &m_network_keys; |
|
111 } |
|
112 |
|
113 //---------------------------------------------------------------------------- |
|
114 |
|
115 EAP_FUNC_EXPORT eap_variable_data_c * simple_config_credential_c::get_MAC_address() |
|
116 { |
|
117 return &m_MAC_address; |
|
118 } |
|
119 |
|
120 //---------------------------------------------------------------------------- |
|
121 |
|
122 EAP_FUNC_EXPORT bool simple_config_credential_c::get_is_valid() |
|
123 { |
|
124 return m_is_valid; |
|
125 } |
|
126 |
|
127 //---------------------------------------------------------------------------- |
|
128 // End. |