2
* Copyright (C) 2013 Tobias Brunner
3
* Copyright (C) 2012 Christoph Buehler
4
* Copyright (C) 2012 Patrick Loetscher
5
* Hochschule fuer Technik Rapperswil
7
* This program is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License as published by the
9
* Free Software Foundation; either version 2 of the License, or (at your
10
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18
package org.strongswan.android.logic.imc.attributes;
20
public enum AttributeType
22
/* IETF standard PA-TNC attribute types defined by RFC 5792 */
23
IETF_TESTING(PrivateEnterpriseNumber.IETF, 0),
24
IETF_ATTRIBUTE_REQUEST(PrivateEnterpriseNumber.IETF, 1),
25
IETF_PRODUCT_INFORMATION(PrivateEnterpriseNumber.IETF, 2),
26
IETF_NUMERIC_VERSION(PrivateEnterpriseNumber.IETF, 3),
27
IETF_STRING_VERSION(PrivateEnterpriseNumber.IETF, 4),
28
IETF_OPERATIONAL_STATUS(PrivateEnterpriseNumber.IETF, 5),
29
IETF_PORT_FILTER(PrivateEnterpriseNumber.IETF, 6),
30
IETF_INSTALLED_PACKAGES(PrivateEnterpriseNumber.IETF, 7),
31
IETF_PA_TNC_ERROR(PrivateEnterpriseNumber.IETF, 8),
32
IETF_ASSESSMENT_RESULT(PrivateEnterpriseNumber.IETF, 9),
33
IETF_REMEDIATION_INSTRUCTIONS(PrivateEnterpriseNumber.IETF, 10),
34
IETF_FORWARDING_ENABLED(PrivateEnterpriseNumber.IETF, 11),
35
IETF_FACTORY_DEFAULT_PWD_ENABLED(PrivateEnterpriseNumber.IETF, 12),
36
IETF_RESERVED(PrivateEnterpriseNumber.IETF, 0xffffffff),
38
ITA_SETTINGS(PrivateEnterpriseNumber.ITA, 4),
39
ITA_DEVICE_ID(PrivateEnterpriseNumber.ITA, 8);
41
private PrivateEnterpriseNumber mVendor;
45
* Enum type for vendor specific attributes (defined in their namespace)
47
* @param vendor private enterprise number of vendor
48
* @param type vendor specific attribute type
50
private AttributeType(PrivateEnterpriseNumber vendor, int type)
57
* Get private enterprise number of vendor
61
public PrivateEnterpriseNumber getVendor()
67
* Get vendor specific type
77
* Get the enum entry from the given numeric values, if defined
79
* @param vendor vendor id
80
* @param type vendor specific type
81
* @return enum entry or null
83
public static AttributeType fromValues(int vendor, int type)
85
PrivateEnterpriseNumber pen = PrivateEnterpriseNumber.fromValue(vendor);
91
for (AttributeType attr : AttributeType.values())
93
if (attr.mVendor == pen && attr.mType == type)