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 * %version: 5 % |
|
20 */ |
|
21 |
|
22 #include "eap_loaded_type.h" |
|
23 #include "eap_expanded_type.h" |
|
24 |
|
25 /** @file */ |
|
26 |
|
27 //-------------------------------------------------- |
|
28 |
|
29 eap_loaded_type_c::eap_loaded_type_c( |
|
30 abs_eap_am_tools_c * const tools, |
|
31 CEapTypePlugin * const type_plugin, |
|
32 const eap_type_value_e eap_type, |
|
33 const u32_t index_type, |
|
34 const u32_t index) |
|
35 : m_am_tools(tools) |
|
36 , m_type_plugin(type_plugin) |
|
37 , m_eap_type(eap_type) |
|
38 , m_index_type(index_type) |
|
39 , m_index(index) |
|
40 { |
|
41 } |
|
42 |
|
43 //-------------------------------------------------- |
|
44 |
|
45 eap_loaded_type_c::~eap_loaded_type_c() |
|
46 { |
|
47 delete m_type_plugin; |
|
48 } |
|
49 |
|
50 //-------------------------------------------------- |
|
51 |
|
52 i32_t eap_loaded_type_c::compare(const eap_loaded_type_c * const right) |
|
53 { |
|
54 if (get_index_type() != right->get_index_type()) |
|
55 { |
|
56 return static_cast<i32_t>(get_index_type()) - static_cast<i32_t>(right->get_index_type()); |
|
57 } |
|
58 else if (get_index() != right->get_index()) |
|
59 { |
|
60 return static_cast<i32_t>(get_index()) - static_cast<i32_t>(right->get_index()); |
|
61 } |
|
62 else |
|
63 { |
|
64 // Compares the EAP-type. |
|
65 return get_eap_type().compare(&(right->get_eap_type())); |
|
66 } |
|
67 } |
|
68 |
|
69 //-------------------------------------------------- |
|
70 |
|
71 CEapTypePlugin * eap_loaded_type_c::get_type_plugin() |
|
72 { |
|
73 return m_type_plugin; |
|
74 } |
|
75 |
|
76 //-------------------------------------------------- |
|
77 |
|
78 eap_type_value_e eap_loaded_type_c::get_eap_type() const |
|
79 { |
|
80 return m_eap_type; |
|
81 } |
|
82 |
|
83 //-------------------------------------------------- |
|
84 |
|
85 u32_t eap_loaded_type_c::get_index_type() const |
|
86 { |
|
87 return m_index_type; |
|
88 } |
|
89 |
|
90 //-------------------------------------------------- |
|
91 |
|
92 u32_t eap_loaded_type_c::get_index() const |
|
93 { |
|
94 return m_index; |
|
95 } |
|
96 |
|
97 //-------------------------------------------------- |
|
98 // End |
|