implemented ITA Get Settings and ITA Settings attributes
[strongswan.git] / src / libimcv / ita / ita_attr.c
1 /*
2 * Copyright (C) 2011-2012 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #include "ita_attr.h"
17 #include "ita/ita_attr_command.h"
18 #include "ita/ita_attr_dummy.h"
19 #include "ita/ita_attr_get_settings.h"
20 #include "ita/ita_attr_settings.h"
21
22 ENUM(ita_attr_names, ITA_ATTR_COMMAND, ITA_ATTR_SETTINGS,
23 "Command",
24 "Dummy",
25 "Get Settings",
26 "Settings"
27 );
28
29 /**
30 * See header
31 */
32 pa_tnc_attr_t* ita_attr_create_from_data(u_int32_t type, chunk_t value)
33 {
34 switch (type)
35 {
36 case ITA_ATTR_COMMAND:
37 return ita_attr_command_create_from_data(value);
38 case ITA_ATTR_DUMMY:
39 return ita_attr_dummy_create_from_data(value);
40 case ITA_ATTR_GET_SETTINGS:
41 return ita_attr_get_settings_create_from_data(value);
42 case ITA_ATTR_SETTINGS:
43 return ita_attr_settings_create_from_data(value);
44 default:
45 return NULL;
46 }
47 }