Draft version of TCG PTS Request Function Component Evidence Attribute
[strongswan.git] / src / libimcv / tcg / tcg_pts_attr_req_funct_comp_evid.h
1 /*
2 * Copyright (C) 2011 Sansar Choinyambuu
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 tcg_pts_attr_req_funct_comp_evid tcg_pts_attr_req_funct_comp_evid
18 * @{ @ingroup tcg_pts_attr_req_funct_comp_evid
19 */
20
21 #ifndef TCG_PTS_ATTR_REQ_FUNCT_COMP_EVID_H_
22 #define TCG_PTS_ATTR_REQ_FUNCT_COMP_EVID_H_
23
24 typedef struct tcg_pts_attr_req_funct_comp_evid_t tcg_pts_attr_req_funct_comp_evid_t;
25 typedef enum pts_attr_req_funct_comp_evid_qualifier_t pts_attr_req_funct_comp_evid_qualifier_t;
26 typedef enum pts_attr_req_funct_comp_name_bin_enum_t pts_attr_req_funct_comp_name_bin_enum_t;
27
28 #include "tcg_attr.h"
29 #include "pa_tnc/pa_tnc_attr.h"
30
31 /**
32 * PTS Request Functional Component Evidence Flags
33 */
34 enum pts_attr_req_funct_comp_evid_flag_t {
35 /** Transitive Trust Chain flag */
36 PTS_REQ_FUNC_COMP_TTC = (1<<0),
37 /** Verify Component flag */
38 PTS_REQ_FUNC_COMP_VER = (1<<1),
39 /** Current Evidence flag */
40 PTS_REQ_FUNC_COMP_CURR = (1<<2),
41 /** PCR Information flag */
42 PTS_REQ_FUNC_COMP_PCR = (1<<3),
43 };
44
45 /**
46 * PTS Request Functional Component Evidence Qualifiers
47 */
48 enum pts_attr_req_funct_comp_evid_qualifier_t {
49 /** Transitive Trust Chain flag */
50 PTS_REQ_FUNC_COMP_QUAL_UNKNOWN = (1<<0),
51 /** Verify Component flag */
52 PTS_REQ_FUNC_COMP_VER = (1<<1),
53 /** Current Evidence flag */
54 PTS_REQ_FUNC_COMP_CURR = (1<<2),
55 /** PCR Information flag */
56 PTS_REQ_FUNC_COMP_PCR = (1<<3),
57 };
58
59 /**
60 * PTS Component Functional Name Binary Enumeration
61 */
62 enum pts_attr_req_funct_comp_name_bin_enum_t {
63 /** Transitive Trust Chain flag */
64 PTS_REQ_FUNC_COMP_TTC = (1<<0),
65 /** Verify Component flag */
66 PTS_REQ_FUNC_COMP_VER = (1<<1),
67 /** Current Evidence flag */
68 PTS_REQ_FUNC_COMP_CURR = (1<<2),
69 /** PCR Information flag */
70 PTS_REQ_FUNC_COMP_PCR = (1<<3),
71 };
72
73 /**
74 * Class implementing the TCG PTS Request Functional Component Evidence attribute
75 *
76 */
77 struct tcg_pts_attr_req_funct_comp_evid_t {
78
79 /**
80 * Public PA-TNC attribute interface
81 */
82 pa_tnc_attr_t pa_tnc_attribute;
83
84 /**
85 * Get flags for PTS Request Functional Component Evidence
86 *
87 * @return Set of flags
88 */
89 pts_attr_req_funct_comp_evid_flag_t (*get_flags)(tcg_pts_attr_req_funct_comp_evid_t *this);
90
91 /**
92 * Set flags for PTS Request Functional Component Evidence
93 *
94 * @param flags Set of flags
95 */
96 void (*set_flags)(tcg_pts_attr_req_funct_comp_evid_t *this,
97 pts_attr_req_funct_comp_evid_flag_t flags);
98
99 /**
100 * Get Sub-component Depth
101 *
102 * @return Sub-component Depth
103 */
104 u_int32_t (*get_sub_component_depth)(tcg_pts_attr_req_funct_comp_evid_t *this);
105
106 /**
107 * Get Component Functional Name Vendor ID
108 *
109 * @return Component Functional Name Vendor ID
110 */
111 u_int32_t (*get_comp_funct_name_vendor_id)(tcg_pts_attr_req_funct_comp_evid_t *this);
112
113
114 /**
115 * Get Family
116 *
117 * @return Functional Name Encoding Family
118 */
119 u_int8_t (*get_family)(tcg_pts_attr_req_funct_comp_evid_t *this);
120
121 /**
122 * Get Qualifier
123 *
124 * @return Functional Name Category Qualifier
125 */
126 u_int8_t (*get_qualifier)(tcg_pts_attr_req_funct_comp_evid_t *this);
127
128 /**
129 * Set family and qualifier for Component Functional Name
130 *
131 * @param family Functional Name Encoding Family
132 * @param qualifier Functional Name Category Qualifier
133 */
134 void (*set_fam_qual)(tcg_pts_attr_req_funct_comp_evid_t *this, u_int8_t family,
135 u_int8_t qualifier);
136
137 /**
138 * Get Component Functional Name
139 *
140 * @return Component Functional Name
141 */
142 u_int32_t (*get_comp_funct_name)(tcg_pts_attr_req_funct_comp_evid_t *this);
143
144
145 /**
146 * Set Component Functional Name
147 *
148 * @param name Component Functional Name
149 */
150 void (*set_comp_funct_name)(tcg_pts_attr_req_funct_comp_evid_t *this,
151 u_int32_t name);
152
153
154 };
155
156 /**
157 * Creates an tcg_pts_attr_req_funct_comp_evid_t object
158 *
159 * @param flags Set of flags
160 * @param depth Sub-component Depth
161 * @param vendor_id Component Functional Name Vendor ID
162 * @param family Functional Name Encoding Family
163 * @param qualifier Functional Name Category Qualifier
164 * @param name Component Functional Name
165 */
166 pa_tnc_attr_t* tcg_pts_attr_req_funct_comp_evid_create(pts_attr_req_funct_comp_evid_flag_t flags,
167 u_int32_t depth,
168 u_int32_t vendor_id,
169 u_int8_t family,
170 u_int8_t qualifier,
171 u_int32_t name);
172
173 /**
174 * Creates an tcg_pts_attr_req_funct_comp_evid_t object from received data
175 *
176 * @param value unparsed attribute value
177 */
178 pa_tnc_attr_t* tcg_pts_attr_req_funct_comp_evid_create_from_data(chunk_t value);
179
180 #endif /** TCG_PTS_ATTR_REQ_FUNCT_COMP_EVID_H_ @}*/