Replaced DH_NONCE state with TPM_INIT state
[strongswan.git] / src / libimcv / pa_tnc / pa_tnc_attr_manager.h
1 /*
2 * Copyright (C) 2011 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 /**
17 * @defgroup pa_tnc_attr_manager pa_tnc_attr_manager
18 * @{ @ingroup libimcv
19 */
20
21 #ifndef PA_TNC_ATTR_MANAGER_H_
22 #define PA_TNC_ATTR_MANAGER_H_
23
24 typedef struct pa_tnc_attr_manager_t pa_tnc_attr_manager_t;
25
26 #include "pa_tnc_attr.h"
27
28 #include <library.h>
29
30 typedef pa_tnc_attr_t* (*pa_tnc_attr_create_t)(u_int32_t type, chunk_t value);
31
32 /**
33 * Manages PA-TNC attributes for arbitrary PENs
34 */
35 struct pa_tnc_attr_manager_t {
36
37 /**
38 * Add vendor-specific attribute names and creation method
39 *
40 * @param vendor_id Private Enterprise Number (PEN)
41 * @param attr_create Vendor-specific attribute create method
42 * @param attr_names Vendor-specific attribute names
43 */
44 void (*add_vendor)(pa_tnc_attr_manager_t *this, pen_t vendor_id,
45 pa_tnc_attr_create_t attr_create,
46 enum_name_t *attr_names);
47
48 /**
49 * Remove vendor-specific attribute names and creation method
50 *
51 * @param vendor_id Private Enterprise Number (PEN)
52 */
53 void (*remove_vendor)(pa_tnc_attr_manager_t *this, pen_t vendor_id);
54
55 /*
56 * Return the PA-TNC attribute names for a given vendor ID
57 *
58 * @param vendor_id Private Enterprise Number (PEN)
59 * @return PA-TNC attribute names if found, NULL else
60 */
61 enum_name_t* (*get_names)(pa_tnc_attr_manager_t *this, pen_t vendor_id);
62
63 /**
64 * Create a PA-TNC attribute object from data for a given vendor ID and type
65 *
66 * @param vendor_id Private Enterprise Number (PEN)
67 * @param type PA-TNC attribute type
68 * @param value PA-TNC attribute value as encoded data
69 * @return PA-TNC attribute object if supported, NULL else
70 */
71 pa_tnc_attr_t* (*create)(pa_tnc_attr_manager_t *this, pen_t vendor_id,
72 u_int32_t type, chunk_t value);
73
74 /**
75 * Destroys a pa_tnc_attr_manager_t object.
76 */
77 void (*destroy)(pa_tnc_attr_manager_t *this);
78 };
79
80 /**
81 * Create a PA-TNC attribute manager
82 */
83 pa_tnc_attr_manager_t* pa_tnc_attr_manager_create(void);
84
85 #endif /** PA_TNC_ATTR_MANAGER_H_ @}*/