26
|
1 |
/*
|
|
2 |
* Copyright (c) 2001-2010 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: Class creates and reads the messages used in EAP-general settings interface on the server side.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
|
19 |
* %version: 11 %
|
|
20 |
*/
|
|
21 |
|
|
22 |
// This is enumeration of EAPOL source code.
|
|
23 |
#if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
|
|
24 |
#undef EAP_FILE_NUMBER_ENUM
|
|
25 |
#define EAP_FILE_NUMBER_ENUM 48
|
|
26 |
#undef EAP_FILE_NUMBER_DATE
|
|
27 |
#define EAP_FILE_NUMBER_DATE 1127594498
|
|
28 |
#endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
#include "eap_am_memory.h"
|
|
33 |
#include "eap_tools.h"
|
|
34 |
#include "eap_general_settings_server_message_if.h"
|
|
35 |
#include "eap_crypto_api.h"
|
|
36 |
#include "eap_state_notification.h"
|
|
37 |
#include "eap_automatic_variable.h"
|
|
38 |
#include "eap_network_id_selector.h"
|
|
39 |
#include "eap_config.h"
|
|
40 |
#include "eap_am_general_settings.h"
|
|
41 |
|
|
42 |
//--------------------------------------------------
|
|
43 |
|
|
44 |
//
|
|
45 |
EAP_FUNC_EXPORT eap_general_settings_server_message_if_c::~eap_general_settings_server_message_if_c()
|
|
46 |
{
|
|
47 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
48 |
|
|
49 |
EAP_TRACE_DEBUG(
|
|
50 |
m_am_tools,
|
|
51 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
52 |
(EAPL("eap_general_settings_server_message_if_c::~eap_general_settings_server_message_if_c(): this = 0x%08x\n"),
|
|
53 |
this));
|
|
54 |
|
|
55 |
EAP_ASSERT(m_shutdown_was_called == true);
|
|
56 |
|
|
57 |
delete m_am_settings;
|
|
58 |
|
|
59 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
60 |
}
|
|
61 |
|
|
62 |
//--------------------------------------------------
|
|
63 |
|
|
64 |
#if defined(_WIN32) && !defined(__GNUC__)
|
|
65 |
#pragma warning( disable : 4355 ) // 'this' : used in base member initializer list
|
|
66 |
#endif
|
|
67 |
|
|
68 |
//
|
|
69 |
EAP_FUNC_EXPORT eap_general_settings_server_message_if_c::eap_general_settings_server_message_if_c(
|
|
70 |
abs_eap_am_tools_c * const tools)
|
|
71 |
: m_partner(0)
|
|
72 |
, m_am_settings(new_eap_am_general_settings_c(tools, this))
|
|
73 |
, m_am_tools(tools)
|
|
74 |
, m_error_code(eap_status_ok)
|
|
75 |
, m_error_function(eap_tlv_message_type_function_none)
|
|
76 |
, m_is_valid(false)
|
|
77 |
, m_shutdown_was_called(false)
|
|
78 |
{
|
|
79 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
80 |
|
|
81 |
EAP_TRACE_DEBUG(
|
|
82 |
m_am_tools,
|
|
83 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
84 |
(EAPL("eap_general_settings_server_message_if_c::eap_general_settings_server_message_if_c(): %s, this = 0x%08x => 0x%08x, compiled %s %s.\n"),
|
|
85 |
(m_is_client == true) ? "client": "server",
|
|
86 |
this,
|
|
87 |
dynamic_cast<abs_eap_base_timer_c *>(this),
|
|
88 |
__DATE__,
|
|
89 |
__TIME__));
|
|
90 |
|
|
91 |
if (m_am_settings != 0
|
|
92 |
&& m_am_settings->get_is_valid() == true)
|
|
93 |
{
|
|
94 |
set_is_valid();
|
|
95 |
}
|
|
96 |
|
|
97 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
98 |
}
|
|
99 |
|
|
100 |
//--------------------------------------------------
|
|
101 |
|
|
102 |
//
|
|
103 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::configure(
|
|
104 |
const eap_variable_data_c * const client_configuration)
|
|
105 |
{
|
|
106 |
EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true);
|
|
107 |
|
|
108 |
EAP_TRACE_DEBUG(
|
|
109 |
m_am_tools,
|
|
110 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
111 |
(EAPL("%s: eap_general_settings_server_message_if_c::configure()\n"),
|
|
112 |
(m_is_client == true) ? "client": "server"));
|
|
113 |
|
|
114 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::configure()");
|
|
115 |
|
|
116 |
eap_status_e status(eap_status_process_general_error);
|
|
117 |
|
|
118 |
if (m_am_settings != 0)
|
|
119 |
{
|
|
120 |
status = m_am_settings->configure();
|
|
121 |
if (status != eap_status_ok)
|
|
122 |
{
|
|
123 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
124 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
125 |
}
|
|
126 |
}
|
|
127 |
|
|
128 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
129 |
}
|
|
130 |
|
|
131 |
//--------------------------------------------------
|
|
132 |
|
|
133 |
//
|
|
134 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::shutdown()
|
|
135 |
{
|
|
136 |
EAP_TRACE_DEBUG(
|
|
137 |
m_am_tools,
|
|
138 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
139 |
(EAPL("%s: eap_general_settings_server_message_if_c::shutdown(), m_shutdown_was_called=%d\n"),
|
|
140 |
(m_is_client == true) ? "client": "server",
|
|
141 |
m_shutdown_was_called));
|
|
142 |
|
|
143 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::shutdown()");
|
|
144 |
|
|
145 |
EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true);
|
|
146 |
|
|
147 |
if (m_shutdown_was_called == true)
|
|
148 |
{
|
|
149 |
// Shutdown function was called already.
|
|
150 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
151 |
}
|
|
152 |
m_shutdown_was_called = true;
|
|
153 |
|
|
154 |
if (m_am_settings != 0)
|
|
155 |
{
|
|
156 |
(void) m_am_settings->shutdown();
|
|
157 |
}
|
|
158 |
|
|
159 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
160 |
}
|
|
161 |
|
|
162 |
//--------------------------------------------------
|
|
163 |
|
|
164 |
//
|
|
165 |
EAP_FUNC_EXPORT void eap_general_settings_server_message_if_c::set_partner(abs_eap_am_message_if_c * const partner)
|
|
166 |
{
|
|
167 |
m_partner = partner;
|
|
168 |
}
|
|
169 |
|
|
170 |
//--------------------------------------------------
|
|
171 |
|
|
172 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::send_error_message(
|
|
173 |
const eap_status_e error_code,
|
|
174 |
const eap_tlv_message_type_function_e function)
|
|
175 |
{
|
|
176 |
eap_status_e status(eap_status_ok);
|
|
177 |
|
|
178 |
{
|
|
179 |
// Creates message data composed of Attribute-Value Pairs.
|
|
180 |
eap_process_tlv_message_data_c message(m_am_tools);
|
|
181 |
|
|
182 |
if (message.get_is_valid() == false)
|
|
183 |
{
|
|
184 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
185 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
186 |
}
|
|
187 |
|
|
188 |
status = message.add_parameter_data(
|
|
189 |
eap_tlv_message_type_error,
|
|
190 |
static_cast<u32_t>(error_code));
|
|
191 |
if (status != eap_status_ok)
|
|
192 |
{
|
|
193 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
194 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
195 |
}
|
|
196 |
|
|
197 |
status = message.add_parameter_data(function);
|
|
198 |
if (status != eap_status_ok)
|
|
199 |
{
|
|
200 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
201 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
202 |
}
|
|
203 |
|
|
204 |
status = send_message(&message);
|
|
205 |
}
|
|
206 |
|
|
207 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
208 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
209 |
}
|
|
210 |
|
|
211 |
//--------------------------------------------------
|
|
212 |
|
|
213 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::send_message(eap_process_tlv_message_data_c * const message)
|
|
214 |
{
|
|
215 |
// Sends message data composed of Attribute-Value Pairs.
|
|
216 |
|
|
217 |
EAP_TRACE_DATA_DEBUG(
|
|
218 |
m_am_tools,
|
|
219 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
220 |
(EAPL("eap_core_client_message_if_c::send_message()"),
|
|
221 |
message->get_message_data(),
|
|
222 |
message->get_message_data_length()));
|
|
223 |
|
|
224 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::send_message()");
|
|
225 |
|
|
226 |
|
|
227 |
eap_status_e send_status = m_partner->send_data(
|
|
228 |
message->get_message_data(),
|
|
229 |
message->get_message_data_length());
|
|
230 |
|
|
231 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
232 |
return EAP_STATUS_RETURN(m_am_tools, send_status);
|
|
233 |
}
|
|
234 |
|
|
235 |
//--------------------------------------------------
|
|
236 |
|
|
237 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::process_message_type_error(
|
|
238 |
EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
|
|
239 |
{
|
|
240 |
eap_status_e status(eap_status_ok);
|
|
241 |
|
|
242 |
eap_process_tlv_message_data_c message_data(m_am_tools);
|
|
243 |
|
|
244 |
if (message_data.get_is_valid() == false)
|
|
245 |
{
|
|
246 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
247 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
248 |
}
|
|
249 |
|
|
250 |
// Error payload is the first in this case.
|
|
251 |
status = message_data.read_parameter_data(parameters, eap_message_payload_index_function, eap_tlv_message_type_error, &m_error_code);
|
|
252 |
if (status != eap_status_ok)
|
|
253 |
{
|
|
254 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
255 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
256 |
}
|
|
257 |
|
|
258 |
// Fuction payload is the second in this case.
|
|
259 |
status = message_data.read_parameter_data(parameters, eap_message_payload_index_first_parameter, &m_error_function);
|
|
260 |
|
|
261 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
262 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
263 |
}
|
|
264 |
|
|
265 |
//--------------------------------------------------
|
|
266 |
|
|
267 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::process_message(eap_process_tlv_message_data_c * const message)
|
|
268 |
{
|
|
269 |
// Parses message data composed of Attribute-Value Pairs.
|
|
270 |
|
|
271 |
EAP_TRACE_DATA_DEBUG(
|
|
272 |
m_am_tools,
|
|
273 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
274 |
(EAPL("eap_general_settings_server_message_if_c::process_message()"),
|
|
275 |
message->get_message_data(),
|
|
276 |
message->get_message_data_length()));
|
|
277 |
|
|
278 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::process_message()");
|
|
279 |
|
|
280 |
eap_array_c<eap_tlv_header_c> parameters(m_am_tools);
|
|
281 |
|
|
282 |
eap_status_e status = message->parse_message_data(¶meters);
|
|
283 |
if (status != eap_status_ok)
|
|
284 |
{
|
|
285 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
286 |
|
|
287 |
(void) send_error_message(
|
|
288 |
status,
|
|
289 |
eap_tlv_message_type_function_none);
|
|
290 |
|
|
291 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
292 |
}
|
|
293 |
|
|
294 |
if (parameters.get_object_count() == 0)
|
|
295 |
{
|
|
296 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
297 |
|
|
298 |
status = eap_status_illegal_parameter;
|
|
299 |
|
|
300 |
(void) send_error_message(
|
|
301 |
status,
|
|
302 |
eap_tlv_message_type_function_none);
|
|
303 |
|
|
304 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
305 |
}
|
|
306 |
|
|
307 |
const eap_tlv_header_c * const function_header = parameters.get_object(eap_message_payload_index_function);
|
|
308 |
if (function_header == 0
|
|
309 |
|| (function_header->get_type() != eap_tlv_message_type_error
|
|
310 |
&& function_header->get_type() != eap_tlv_message_type_function))
|
|
311 |
{
|
|
312 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
313 |
|
|
314 |
status = eap_status_illegal_parameter;
|
|
315 |
|
|
316 |
(void) send_error_message(
|
|
317 |
status,
|
|
318 |
eap_tlv_message_type_function_none);
|
|
319 |
|
|
320 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
321 |
}
|
|
322 |
|
|
323 |
if (function_header->get_type() == eap_tlv_message_type_error)
|
|
324 |
{
|
|
325 |
status = process_message_type_error(¶meters);
|
|
326 |
}
|
|
327 |
else // function_header->get_type() == eap_tlv_message_type_function
|
|
328 |
{
|
|
329 |
eap_tlv_message_type_function_e function(eap_tlv_message_type_function_none);
|
|
330 |
|
|
331 |
status = message->get_parameter_data(function_header, &function);
|
|
332 |
if (status != eap_status_ok)
|
|
333 |
{
|
|
334 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
335 |
|
|
336 |
(void) send_error_message(
|
|
337 |
status,
|
|
338 |
eap_tlv_message_type_function_none);
|
|
339 |
|
|
340 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
341 |
}
|
|
342 |
|
|
343 |
switch(function)
|
|
344 |
{
|
|
345 |
case eap_tlv_message_type_function_general_settings_set_eap_methods:
|
|
346 |
status = set_eap_methods(¶meters);
|
|
347 |
break;
|
|
348 |
case eap_tlv_message_type_function_general_settings_get_eap_methods:
|
|
349 |
status = get_eap_methods(¶meters);
|
|
350 |
break;
|
|
351 |
case eap_tlv_message_type_function_general_settings_get_certificate_lists:
|
|
352 |
status = get_certificate_lists(¶meters);
|
|
353 |
break;
|
|
354 |
case eap_tlv_message_type_function_general_settings_delete_all_eap_settings:
|
|
355 |
status = delete_all_eap_settings(¶meters);
|
|
356 |
break;
|
|
357 |
case eap_tlv_message_type_function_general_settings_copy_all_eap_settings:
|
|
358 |
status = copy_all_eap_settings(¶meters);
|
|
359 |
break;
|
|
360 |
default:
|
|
361 |
EAP_TRACE_ERROR(
|
|
362 |
m_am_tools,
|
|
363 |
TRACE_FLAGS_DEFAULT,
|
|
364 |
(EAPL("ERROR: process_data(): unknown function %d.\n"),
|
|
365 |
function));
|
|
366 |
|
|
367 |
status = eap_status_illegal_parameter;
|
|
368 |
|
|
369 |
EAP_ASSERT_ANYWAY_TOOLS(m_am_tools);
|
|
370 |
};
|
|
371 |
|
|
372 |
if (status != eap_status_ok
|
|
373 |
&& status != eap_status_success
|
|
374 |
&& status != eap_status_pending_request
|
|
375 |
&& status != eap_status_completed_request
|
|
376 |
&& status != eap_status_drop_packet_quietly)
|
|
377 |
{
|
|
378 |
(void) send_error_message(
|
|
379 |
status,
|
|
380 |
function);
|
|
381 |
}
|
|
382 |
}
|
|
383 |
|
|
384 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
385 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
386 |
}
|
|
387 |
|
|
388 |
//--------------------------------------------------
|
|
389 |
|
|
390 |
/// Function receives the data message from lower layer.
|
|
391 |
/// Data is formatted to Attribute-Value Pairs.
|
|
392 |
/// Look at eap_tlv_header_c and eap_tlv_message_data_c.
|
|
393 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::process_data(const void * const data, const u32_t length)
|
|
394 |
{
|
|
395 |
eap_status_e status(eap_status_process_general_error);
|
|
396 |
|
|
397 |
{
|
|
398 |
eap_process_tlv_message_data_c message(m_am_tools);
|
|
399 |
|
|
400 |
if (message.get_is_valid() == false)
|
|
401 |
{
|
|
402 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
403 |
|
|
404 |
status = eap_status_allocation_error;
|
|
405 |
|
|
406 |
(void) send_error_message(
|
|
407 |
status,
|
|
408 |
eap_tlv_message_type_function_none);
|
|
409 |
|
|
410 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
411 |
}
|
|
412 |
|
|
413 |
status = message.set_message_data(length, data);
|
|
414 |
if (status != eap_status_ok)
|
|
415 |
{
|
|
416 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
417 |
|
|
418 |
(void) send_error_message(
|
|
419 |
status,
|
|
420 |
eap_tlv_message_type_function_none);
|
|
421 |
|
|
422 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
423 |
}
|
|
424 |
|
|
425 |
status = process_message(&message);
|
|
426 |
}
|
|
427 |
|
|
428 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
429 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
430 |
}
|
|
431 |
|
|
432 |
//--------------------------------------------------
|
|
433 |
|
|
434 |
//
|
|
435 |
EAP_FUNC_EXPORT void eap_general_settings_server_message_if_c::set_is_valid()
|
|
436 |
{
|
|
437 |
m_is_valid = true;
|
|
438 |
}
|
|
439 |
|
|
440 |
//--------------------------------------------------
|
|
441 |
|
|
442 |
//
|
|
443 |
EAP_FUNC_EXPORT bool eap_general_settings_server_message_if_c::get_is_valid()
|
|
444 |
{
|
|
445 |
return m_is_valid;
|
|
446 |
}
|
|
447 |
|
|
448 |
//--------------------------------------------------
|
|
449 |
|
|
450 |
//
|
|
451 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::timer_expired(
|
|
452 |
const u32_t id, void *data)
|
|
453 |
{
|
|
454 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
455 |
|
|
456 |
EAP_TRACE_DEBUG(
|
|
457 |
m_am_tools,
|
|
458 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
459 |
(EAPL("TIMER: %s: [0x%08x]->eap_general_settings_server_message_if_c::timer_expired(id 0x%02x, data 0x%08x).\n"),
|
|
460 |
(m_is_client == true) ? "client": "server",
|
|
461 |
this,
|
|
462 |
id,
|
|
463 |
data));
|
|
464 |
|
|
465 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::timer_expired()");
|
|
466 |
|
|
467 |
|
|
468 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
469 |
}
|
|
470 |
|
|
471 |
//--------------------------------------------------
|
|
472 |
|
|
473 |
//
|
|
474 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::timer_delete_data(
|
|
475 |
const u32_t id, void *data)
|
|
476 |
{
|
|
477 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
478 |
|
|
479 |
EAP_TRACE_DEBUG(
|
|
480 |
m_am_tools,
|
|
481 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
482 |
(EAPL("TIMER: %s: [0x%08x]->eap_general_settings_server_message_if_c::timer_delete_data(id 0x%02x, data 0x%08x).\n"),
|
|
483 |
(m_is_client == true) ? "client": "server",
|
|
484 |
this, id, data));
|
|
485 |
|
|
486 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::timer_delete_data()");
|
|
487 |
|
|
488 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
489 |
}
|
|
490 |
|
|
491 |
//--------------------------------------------------
|
|
492 |
|
|
493 |
eap_status_e eap_general_settings_server_message_if_c::set_eap_methods(
|
|
494 |
EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
|
|
495 |
{
|
|
496 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
497 |
|
|
498 |
EAP_TRACE_DEBUG(
|
|
499 |
m_am_tools,
|
|
500 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
501 |
(EAPL("%s: eap_general_settings_server_message_if_c::set_eap_methods()\n"),
|
|
502 |
(m_is_client == true) ? "client": "server"));
|
|
503 |
|
|
504 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::set_eap_methods()");
|
|
505 |
|
|
506 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
507 |
|
|
508 |
eap_status_e status(eap_status_ok);
|
|
509 |
|
|
510 |
u32_t parameter_index(eap_message_payload_index_first_parameter);
|
|
511 |
|
|
512 |
eap_process_tlv_message_data_c message_data(m_am_tools);
|
|
513 |
|
|
514 |
if (message_data.get_is_valid() == false)
|
|
515 |
{
|
|
516 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
517 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
518 |
}
|
|
519 |
|
|
520 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
521 |
|
|
522 |
eap_method_settings_c internal_settings(m_am_tools);
|
|
523 |
|
|
524 |
status = message_data.read_parameter_data(parameters, parameter_index, &internal_settings);
|
|
525 |
if (status != eap_status_ok)
|
|
526 |
{
|
|
527 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
528 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
529 |
}
|
|
530 |
|
|
531 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
532 |
|
|
533 |
status = m_am_settings->set_eap_methods(
|
|
534 |
&internal_settings
|
|
535 |
);
|
|
536 |
|
|
537 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
538 |
|
|
539 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
540 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
541 |
}
|
|
542 |
|
|
543 |
//--------------------------------------------------
|
|
544 |
|
|
545 |
eap_status_e eap_general_settings_server_message_if_c::get_eap_methods(
|
|
546 |
EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
|
|
547 |
{
|
|
548 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
549 |
|
|
550 |
EAP_TRACE_DEBUG(
|
|
551 |
m_am_tools,
|
|
552 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
553 |
(EAPL("%s: eap_general_settings_server_message_if_c::get_eap_methods()\n"),
|
|
554 |
(m_is_client == true) ? "client": "server"));
|
|
555 |
|
|
556 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::get_eap_methods()");
|
|
557 |
|
|
558 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
559 |
|
|
560 |
eap_status_e status(eap_status_ok);
|
|
561 |
|
|
562 |
u32_t parameter_index(eap_message_payload_index_first_parameter);
|
|
563 |
|
|
564 |
eap_process_tlv_message_data_c message_data(m_am_tools);
|
|
565 |
|
|
566 |
if (message_data.get_is_valid() == false)
|
|
567 |
{
|
|
568 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
569 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
570 |
}
|
|
571 |
|
|
572 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
573 |
|
|
574 |
eap_method_settings_c internal_settings(m_am_tools);
|
|
575 |
|
|
576 |
status = message_data.read_parameter_data(parameters, parameter_index, &internal_settings);
|
|
577 |
if (status != eap_status_ok)
|
|
578 |
{
|
|
579 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
580 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
581 |
}
|
|
582 |
|
|
583 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
584 |
|
|
585 |
status = m_am_settings->get_eap_methods(
|
|
586 |
&internal_settings
|
|
587 |
);
|
|
588 |
|
|
589 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
590 |
|
|
591 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
592 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
593 |
}
|
|
594 |
|
|
595 |
//--------------------------------------------------
|
|
596 |
|
|
597 |
eap_status_e eap_general_settings_server_message_if_c::get_certificate_lists(
|
|
598 |
EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
|
|
599 |
{
|
|
600 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
601 |
|
|
602 |
EAP_TRACE_DEBUG(
|
|
603 |
m_am_tools,
|
|
604 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
605 |
(EAPL("%s: eap_general_settings_server_message_if_c::get_certificate_lists()\n"),
|
|
606 |
(m_is_client == true) ? "client": "server"));
|
|
607 |
|
|
608 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::get_certificate_lists()");
|
|
609 |
|
|
610 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
611 |
|
|
612 |
eap_status_e status(eap_status_ok);
|
|
613 |
|
|
614 |
u32_t parameter_index(eap_message_payload_index_first_parameter);
|
|
615 |
|
|
616 |
eap_process_tlv_message_data_c message_data(m_am_tools);
|
|
617 |
|
|
618 |
if (message_data.get_is_valid() == false)
|
|
619 |
{
|
|
620 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
621 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
622 |
}
|
|
623 |
|
|
624 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
625 |
|
|
626 |
eap_method_settings_c internal_settings(m_am_tools);
|
|
627 |
|
|
628 |
status = message_data.read_parameter_data(parameters, parameter_index, &internal_settings);
|
|
629 |
if (status != eap_status_ok)
|
|
630 |
{
|
|
631 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
632 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
633 |
}
|
|
634 |
|
|
635 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
636 |
|
|
637 |
status = m_am_settings->get_certificate_lists(
|
|
638 |
&internal_settings
|
|
639 |
);
|
|
640 |
|
|
641 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
642 |
|
|
643 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
644 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
645 |
}
|
|
646 |
|
|
647 |
//--------------------------------------------------
|
|
648 |
|
|
649 |
eap_status_e eap_general_settings_server_message_if_c::delete_all_eap_settings(
|
|
650 |
EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
|
|
651 |
{
|
|
652 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
653 |
|
|
654 |
EAP_TRACE_DEBUG(
|
|
655 |
m_am_tools,
|
|
656 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
657 |
(EAPL("%s: eap_general_settings_server_message_if_c::get_certificate_lists()\n"),
|
|
658 |
(m_is_client == true) ? "client": "server"));
|
|
659 |
|
|
660 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::delete_all_eap_settings()");
|
|
661 |
|
|
662 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
663 |
|
|
664 |
eap_status_e status(eap_status_ok);
|
|
665 |
|
|
666 |
u32_t parameter_index(eap_message_payload_index_first_parameter);
|
|
667 |
|
|
668 |
eap_process_tlv_message_data_c message_data(m_am_tools);
|
|
669 |
|
|
670 |
if (message_data.get_is_valid() == false)
|
|
671 |
{
|
|
672 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
673 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
674 |
}
|
|
675 |
|
|
676 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
677 |
|
|
678 |
eap_method_settings_c internal_settings(m_am_tools);
|
|
679 |
|
|
680 |
status = message_data.read_parameter_data(parameters, parameter_index, &internal_settings);
|
|
681 |
if (status != eap_status_ok)
|
|
682 |
{
|
|
683 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
684 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
685 |
}
|
|
686 |
|
|
687 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
688 |
|
|
689 |
status = m_am_settings->delete_all_eap_settings(
|
|
690 |
&internal_settings
|
|
691 |
);
|
|
692 |
|
|
693 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
694 |
|
|
695 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
696 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
697 |
}
|
|
698 |
|
|
699 |
//--------------------------------------------------
|
|
700 |
|
|
701 |
eap_status_e eap_general_settings_server_message_if_c::copy_all_eap_settings(
|
|
702 |
EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
|
|
703 |
{
|
|
704 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
705 |
|
|
706 |
EAP_TRACE_DEBUG(
|
|
707 |
m_am_tools,
|
|
708 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
709 |
(EAPL("%s: eap_general_settings_server_message_if_c::get_certificate_lists()\n"),
|
|
710 |
(m_is_client == true) ? "client": "server"));
|
|
711 |
|
|
712 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_general_settings_server_message_if_c::copy_all_eap_settings()");
|
|
713 |
|
|
714 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
715 |
|
|
716 |
eap_status_e status(eap_status_ok);
|
|
717 |
|
|
718 |
u32_t parameter_index(eap_message_payload_index_first_parameter);
|
|
719 |
|
|
720 |
eap_process_tlv_message_data_c message_data(m_am_tools);
|
|
721 |
|
|
722 |
if (message_data.get_is_valid() == false)
|
|
723 |
{
|
|
724 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
725 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
726 |
}
|
|
727 |
|
|
728 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
729 |
|
|
730 |
eap_method_settings_c internal_settings(m_am_tools);
|
|
731 |
|
|
732 |
status = message_data.read_parameter_data(parameters, parameter_index, &internal_settings);
|
|
733 |
if (status != eap_status_ok)
|
|
734 |
{
|
|
735 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
736 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
737 |
}
|
|
738 |
|
|
739 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
740 |
|
|
741 |
status = m_am_settings->copy_all_eap_settings(
|
|
742 |
&internal_settings
|
|
743 |
);
|
|
744 |
|
|
745 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
746 |
|
|
747 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
748 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
749 |
}
|
|
750 |
|
|
751 |
//--------------------------------------------------
|
|
752 |
|
|
753 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::complete_set_eap_methods(const eap_method_settings_c * const internal_settings)
|
|
754 |
{
|
|
755 |
eap_status_e status(eap_status_process_general_error);
|
|
756 |
|
|
757 |
EAP_TRACE_DEBUG(
|
|
758 |
m_am_tools,
|
|
759 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
760 |
(EAPL("%s: eap_core_server_message_if_c::complete_set_eap_methods()\n"),
|
|
761 |
(m_is_client == true) ? "client": "server"));
|
|
762 |
|
|
763 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_set_eap_methods()");
|
|
764 |
|
|
765 |
{
|
|
766 |
// Creates message data composed of Attribute-Value Pairs.
|
|
767 |
eap_process_tlv_message_data_c message(m_am_tools);
|
|
768 |
|
|
769 |
if (message.get_is_valid() == false)
|
|
770 |
{
|
|
771 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
772 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
773 |
}
|
|
774 |
|
|
775 |
status = message.add_parameter_data(eap_tlv_message_type_function_general_settings_complete_set_eap_methods);
|
|
776 |
if (status != eap_status_ok)
|
|
777 |
{
|
|
778 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
779 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
780 |
}
|
|
781 |
|
|
782 |
status = message.add_parameter_data(internal_settings);
|
|
783 |
if (status != eap_status_ok)
|
|
784 |
{
|
|
785 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
786 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
787 |
}
|
|
788 |
|
|
789 |
status = send_message(&message);
|
|
790 |
}
|
|
791 |
|
|
792 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
793 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
794 |
}
|
|
795 |
|
|
796 |
//--------------------------------------------------
|
|
797 |
|
|
798 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::complete_get_eap_methods(const eap_method_settings_c * const internal_settings)
|
|
799 |
{
|
|
800 |
eap_status_e status(eap_status_process_general_error);
|
|
801 |
|
|
802 |
EAP_TRACE_DEBUG(
|
|
803 |
m_am_tools,
|
|
804 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
805 |
(EAPL("%s: eap_core_server_message_if_c::complete_get_eap_methods()\n"),
|
|
806 |
(m_is_client == true) ? "client": "server"));
|
|
807 |
|
|
808 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_get_eap_methods()");
|
|
809 |
|
|
810 |
{
|
|
811 |
// Creates message data composed of Attribute-Value Pairs.
|
|
812 |
eap_process_tlv_message_data_c message(m_am_tools);
|
|
813 |
|
|
814 |
if (message.get_is_valid() == false)
|
|
815 |
{
|
|
816 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
817 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
818 |
}
|
|
819 |
|
|
820 |
status = message.add_parameter_data(eap_tlv_message_type_function_general_settings_complete_get_eap_methods);
|
|
821 |
if (status != eap_status_ok)
|
|
822 |
{
|
|
823 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
824 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
825 |
}
|
|
826 |
|
|
827 |
status = message.add_parameter_data(internal_settings);
|
|
828 |
if (status != eap_status_ok)
|
|
829 |
{
|
|
830 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
831 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
832 |
}
|
|
833 |
|
|
834 |
status = send_message(&message);
|
|
835 |
}
|
|
836 |
|
|
837 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
838 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
839 |
}
|
|
840 |
|
|
841 |
//--------------------------------------------------
|
|
842 |
|
|
843 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::complete_get_certificate_lists(const eap_method_settings_c * const internal_settings)
|
|
844 |
{
|
|
845 |
eap_status_e status(eap_status_process_general_error);
|
|
846 |
|
|
847 |
EAP_TRACE_DEBUG(
|
|
848 |
m_am_tools,
|
|
849 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
850 |
(EAPL("%s: eap_core_server_message_if_c::complete_get_certificate_lists()\n"),
|
|
851 |
(m_is_client == true) ? "client": "server"));
|
|
852 |
|
|
853 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_get_certificate_lists()");
|
|
854 |
|
|
855 |
{
|
|
856 |
// Creates message data composed of Attribute-Value Pairs.
|
|
857 |
eap_process_tlv_message_data_c message(m_am_tools);
|
|
858 |
|
|
859 |
if (message.get_is_valid() == false)
|
|
860 |
{
|
|
861 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
862 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
863 |
}
|
|
864 |
|
|
865 |
status = message.add_parameter_data(eap_tlv_message_type_function_general_settings_complete_get_certificate_lists);
|
|
866 |
if (status != eap_status_ok)
|
|
867 |
{
|
|
868 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
869 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
870 |
}
|
|
871 |
|
|
872 |
status = message.add_parameter_data(internal_settings);
|
|
873 |
if (status != eap_status_ok)
|
|
874 |
{
|
|
875 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
876 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
877 |
}
|
|
878 |
|
|
879 |
status = send_message(&message);
|
|
880 |
}
|
|
881 |
|
|
882 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
883 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
884 |
}
|
|
885 |
|
|
886 |
//--------------------------------------------------
|
|
887 |
|
|
888 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::complete_delete_all_eap_settings(const eap_method_settings_c * const internal_settings)
|
|
889 |
{
|
|
890 |
eap_status_e status(eap_status_process_general_error);
|
|
891 |
|
|
892 |
EAP_TRACE_DEBUG(
|
|
893 |
m_am_tools,
|
|
894 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
895 |
(EAPL("%s: eap_core_server_message_if_c::complete_delete_all_eap_settings()\n"),
|
|
896 |
(m_is_client == true) ? "client": "server"));
|
|
897 |
|
|
898 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_delete_all_eap_settings()");
|
|
899 |
|
|
900 |
{
|
|
901 |
// Creates message data composed of Attribute-Value Pairs.
|
|
902 |
eap_process_tlv_message_data_c message(m_am_tools);
|
|
903 |
|
|
904 |
if (message.get_is_valid() == false)
|
|
905 |
{
|
|
906 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
907 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
908 |
}
|
|
909 |
|
|
910 |
status = message.add_parameter_data(eap_tlv_message_type_function_general_settings_complete_delete_all_eap_settings);
|
|
911 |
if (status != eap_status_ok)
|
|
912 |
{
|
|
913 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
914 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
915 |
}
|
|
916 |
|
|
917 |
status = message.add_parameter_data(internal_settings);
|
|
918 |
if (status != eap_status_ok)
|
|
919 |
{
|
|
920 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
921 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
922 |
}
|
|
923 |
|
|
924 |
status = send_message(&message);
|
|
925 |
}
|
|
926 |
|
|
927 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
928 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
929 |
}
|
|
930 |
|
|
931 |
//--------------------------------------------------
|
|
932 |
|
|
933 |
EAP_FUNC_EXPORT eap_status_e eap_general_settings_server_message_if_c::complete_copy_all_eap_settings(const eap_method_settings_c * const internal_settings)
|
|
934 |
{
|
|
935 |
eap_status_e status(eap_status_process_general_error);
|
|
936 |
|
|
937 |
EAP_TRACE_DEBUG(
|
|
938 |
m_am_tools,
|
|
939 |
EAP_TRACE_FLAGS_MESSAGE_DATA,
|
|
940 |
(EAPL("%s: eap_core_server_message_if_c::complete_copy_all_eap_settings()\n"),
|
|
941 |
(m_is_client == true) ? "client": "server"));
|
|
942 |
|
|
943 |
EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_copy_all_eap_settings()");
|
|
944 |
|
|
945 |
{
|
|
946 |
// Creates message data composed of Attribute-Value Pairs.
|
|
947 |
eap_process_tlv_message_data_c message(m_am_tools);
|
|
948 |
|
|
949 |
if (message.get_is_valid() == false)
|
|
950 |
{
|
|
951 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
952 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
953 |
}
|
|
954 |
|
|
955 |
status = message.add_parameter_data(eap_tlv_message_type_function_general_settings_complete_copy_all_eap_settings);
|
|
956 |
if (status != eap_status_ok)
|
|
957 |
{
|
|
958 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
959 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
960 |
}
|
|
961 |
|
|
962 |
status = message.add_parameter_data(internal_settings);
|
|
963 |
if (status != eap_status_ok)
|
|
964 |
{
|
|
965 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
966 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
967 |
}
|
|
968 |
|
|
969 |
status = send_message(&message);
|
|
970 |
}
|
|
971 |
|
|
972 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
973 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
974 |
}
|
|
975 |
|
|
976 |
//--------------------------------------------------
|
|
977 |
// End.
|