]> git.ipfire.org Git - thirdparty/strongswan.git/blob
9db702ec0cda62a55db18f83444bb698f851a8a5
[thirdparty/strongswan.git] /
1 /*
2 * Copyright (C) 2013 Tobias Brunner
3 * 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 package org.strongswan.android.logic.imc.attributes;
17
18 public enum PrivateEnterpriseNumber
19 {
20 IETF(0x000000),
21 GOOGLE(0x002B79),
22 ITA(0x00902a),
23 UNASSIGNED(0xfffffe),
24 RESERVED(0xffffff);
25
26 private int mValue;
27
28 /**
29 * Enum for private enterprise numbers (PEN) as allocated by IANA
30 *
31 * @param value numeric value
32 */
33 private PrivateEnterpriseNumber(int value)
34 {
35 mValue = value;
36 }
37
38 /**
39 * Get the numeric value of a PEN
40 *
41 * @return numeric value
42 */
43 public int getValue()
44 {
45 return mValue;
46 }
47
48 /**
49 * Get the enum entry from a numeric value, if defined
50 *
51 * @param value numeric value
52 * @return the enum entry or null
53 */
54 public static PrivateEnterpriseNumber fromValue(int value)
55 {
56 for (PrivateEnterpriseNumber pen : PrivateEnterpriseNumber.values())
57 {
58 if (pen.mValue == value)
59 {
60 return pen;
61 }
62 }
63 return null;
64 }
65 }