read PDP server name from strongswan.conf
[strongswan.git] / src / libimcv / ietf / ietf_attr.c
1 /*
2 * Copyright (C) 2011 Andreas Steffen, HSR Hochschule fuer Technik Rapperswil
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15 #include "ietf_attr.h"
16 #include "ietf/ietf_attr_pa_tnc_error.h"
17 #include "ietf/ietf_attr_port_filter.h"
18 #include "ietf/ietf_attr_product_info.h"
19
20 ENUM(ietf_attr_names, IETF_ATTR_TESTING, IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
21 "Testing",
22 "Attribute Request",
23 "Product Information",
24 "Numeric Version",
25 "String Version",
26 "Operational Status",
27 "Port Filter",
28 "Installed Packages",
29 "PA-TNC Error",
30 "Assessment Result",
31 "Remediation Instructions",
32 "Forwarding Enabled",
33 "Factory Default Password Enabled",
34 );
35
36 /**
37 * See header
38 */
39 pa_tnc_attr_t* ietf_attr_create_from_data(u_int32_t type, chunk_t value)
40 {
41 switch (type)
42 {
43 case IETF_ATTR_PORT_FILTER:
44 return ietf_attr_port_filter_create_from_data(value);
45 case IETF_ATTR_PA_TNC_ERROR:
46 return ietf_attr_pa_tnc_error_create_from_data(value);
47 case IETF_ATTR_PRODUCT_INFORMATION:
48 return ietf_attr_product_info_create_from_data(value);
49 case IETF_ATTR_TESTING:
50 case IETF_ATTR_ATTRIBUTE_REQUEST:
51 case IETF_ATTR_NUMERIC_VERSION:
52 case IETF_ATTR_STRING_VERSION:
53 case IETF_ATTR_OPERATIONAL_STATUS:
54 case IETF_ATTR_INSTALLED_PACKAGES:
55 case IETF_ATTR_ASSESSMENT_RESULT:
56 case IETF_ATTR_REMEDIATION_INSTRUCTIONS:
57 case IETF_ATTR_FORWARDING_ENABLED:
58 case IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED:
59 case IETF_ATTR_RESERVED:
60 default:
61 return NULL;
62 }
63 }