2 * Copyright (C) 2011-2012 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
18 * @ingroup libstrongswan
29 typedef enum pen_t pen_t
;
30 typedef struct pen_type_t pen_type_t
;
33 * Private enterprise numbers allocated by IANA.
35 * http://www.iana.org/assignments/enterprise-numbers
38 PEN_IETF
= 0x000000, /* 0 */
39 PEN_IBM
= 0x000002, /* 2 */
40 PEN_MICROSOFT
= 0x000137, /* 311 */
41 PEN_REDHAT
= 0x000908, /* 2312 */
42 PEN_ALTIGA
= 0x000c04, /* 3076 */
43 PEN_OSC
= 0x002358, /* 9048 */
44 PEN_DEBIAN
= 0x002572, /* 9586 */
45 PEN_GOOGLE
= 0x002B79, /* 11129 */
46 PEN_TCG
= 0x005597, /* 21911 */
47 PEN_CANONICAL
= 0x007132, /* 28978 */
48 PEN_FEDORA
= 0x0076C1, /* 30401 */
49 PEN_FHH
= 0x0080ab, /* 32939 */
50 PEN_ITA
= 0x00902a, /* 36906 */
51 PEN_OPENPTS
= 0x00950e, /* 38158 */
52 PEN_UNASSIGNED
= 0xfffffe, /* 16777214 */
53 PEN_RESERVED
= 0xffffff, /* 16777215 */
57 * Vendor specific type in vendor specific namespace.
65 * Create a pen_type_t struct
67 * @param vendor_id vendor ID to create a pen_type_t
68 * @param type type to create a pen_type_t
69 * @return created pen_type_t
71 static inline pen_type_t
pen_type_create(pen_t vendor_id
, u_int32_t type
)
73 pen_type_t pen_type
= { vendor_id
, type
};
78 * Check two pen_type_t for equality.
80 * @param a first pen_type_t to compare
81 * @param b second pen_type_t to compare
82 * @return TRUE if a == b
84 static inline bool pen_type_equals(pen_type_t a
, pen_type_t b
)
86 return a
.vendor_id
== b
.vendor_id
&& a
.type
== b
.type
;
90 * Check if a pen_type_t matches vendor and type.
92 * @param pen_type pen_type_t to compare
93 * @param vendor_id vendor to check in pen_type
94 * @param type type to check in pen_type
95 * @return TRUE if vendor_id and type matches pen_type
97 static inline bool pen_type_is(pen_type_t pen_type
,
98 pen_t vendor_id
, u_int32_t type
)
100 return pen_type
.vendor_id
== vendor_id
&& pen_type
.type
== type
;
104 * enum names for pen_t.
106 extern enum_name_t
*pen_names
;
108 #endif /** PEN_H_ @}*/