2 * Copyright (C) 2011 Sansar Choinyambuu
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
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
21 #ifndef TCG_PTS_ATTR_REQ_FUNCT_COMP_EVID_H_
22 #define TCG_PTS_ATTR_REQ_FUNCT_COMP_EVID_H_
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_flag_t pts_attr_req_funct_comp_evid_flag_t
;
26 typedef enum pts_attr_req_funct_comp_type_t pts_attr_req_funct_comp_type_t
;
27 typedef enum pts_attr_req_funct_comp_name_bin_enum_t pts_attr_req_funct_comp_name_bin_enum_t
;
28 typedef struct tcg_pts_qualifier_t tcg_pts_qualifier_t
;
31 #include "pa_tnc/pa_tnc_attr.h"
34 * PTS Request Functional Component Evidence Flags
36 enum pts_attr_req_funct_comp_evid_flag_t
{
37 /** Transitive Trust Chain flag */
38 PTS_REQ_FUNC_COMP_FLAG_TTC
= (1<<0),
39 /** Verify Component flag */
40 PTS_REQ_FUNC_COMP_FLAG_VER
= (1<<1),
41 /** Current Evidence flag */
42 PTS_REQ_FUNC_COMP_FLAG_CURR
= (1<<2),
43 /** PCR Information flag */
44 PTS_REQ_FUNC_COMP_FLAG_PCR
= (1<<3),
48 * PTS Component Functional Type for Qualifier field
50 enum pts_attr_req_funct_comp_type_t
{
52 PTS_FUNC_COMP_TYPE_UNKNOWN
= 0x0,
53 /** Trusted Platform */
54 PTS_FUNC_COMP_TYPE_TRUSTED
= 0x1,
55 /** Operating System */
56 PTS_FUNC_COMP_TYPE_OS
= 0x2,
57 /** Graphical User Interface */
58 PTS_FUNC_COMP_TYPE_GUI
= 0x3,
60 PTS_FUNC_COMP_TYPE_APP
= 0x4,
62 PTS_FUNC_COMP_TYPE_NET
= 0x5,
64 PTS_FUNC_COMP_TYPE_LIB
= 0x6,
65 /** TNC Defined Component */
66 PTS_FUNC_COMP_TYPE_TNC
= 0x7,
67 /** All matching Components */
68 PTS_FUNC_COMP_TYPE_ALL
= 0xF,
72 * PTS Component Functional Name Binary Enumeration
74 enum pts_attr_req_funct_comp_name_bin_enum_t
{
76 PTS_FUNC_COMP_NAME_IGNORE
= 0x0000,
78 PTS_FUNC_COMP_NAME_CRTM
= 0x0001,
80 PTS_FUNC_COMP_NAME_BIOS
= 0x0002,
81 /** Platform Extensions */
82 PTS_FUNC_COMP_NAME_PLAT_EXT
= 0x0003,
83 /** Motherboard firmware */
84 PTS_FUNC_COMP_NAME_BOARD
= 0x0004,
85 /** Initial Program Loader */
86 PTS_FUNC_COMP_NAME_INIT_LOADER
= 0x0005,
88 PTS_FUNC_COMP_NAME_OPT_ROMS
= 0x0006,
92 * Qualifier for Functional Component
94 struct tcg_pts_qualifier_t
{
97 pts_attr_req_funct_comp_type_t type
;
101 * Class implementing the TCG PTS Request Functional Component Evidence attribute
104 struct tcg_pts_attr_req_funct_comp_evid_t
{
107 * Public PA-TNC attribute interface
109 pa_tnc_attr_t pa_tnc_attribute
;
112 * Get flags for PTS Request Functional Component Evidence
114 * @return Set of flags
116 pts_attr_req_funct_comp_evid_flag_t (*get_flags
)(tcg_pts_attr_req_funct_comp_evid_t
*this);
119 * Set flags for PTS Request Functional Component Evidence
121 * @param flags Set of flags
123 void (*set_flags
)(tcg_pts_attr_req_funct_comp_evid_t
*this,
124 pts_attr_req_funct_comp_evid_flag_t flags
);
127 * Get Sub-component Depth
129 * @return Sub-component Depth
131 u_int32_t (*get_sub_component_depth
)(tcg_pts_attr_req_funct_comp_evid_t
*this);
134 * Get Component Functional Name Vendor ID
136 * @return Component Functional Name Vendor ID
138 u_int32_t (*get_comp_funct_name_vendor_id
)(tcg_pts_attr_req_funct_comp_evid_t
*this);
143 * @return Functional Name Family
145 u_int8_t (*get_family
)(tcg_pts_attr_req_funct_comp_evid_t
*this);
150 * @return Functional Name Category Qualifier
152 tcg_pts_qualifier_t (*get_qualifier
)(tcg_pts_attr_req_funct_comp_evid_t
*this);
155 * Set qualifier for Component Functional Name
157 * @param qualifier Functional Name Category Qualifier
159 void (*set_qualifier
)(tcg_pts_attr_req_funct_comp_evid_t
*this,
160 tcg_pts_qualifier_t qualifier
);
163 * Get Component Functional Name
165 * @return Component Functional Name
167 pts_attr_req_funct_comp_name_bin_enum_t (*get_comp_funct_name
)(tcg_pts_attr_req_funct_comp_evid_t
*this);
171 * Set Component Functional Name
173 * @param name Component Functional Name
175 void (*set_comp_funct_name
)(tcg_pts_attr_req_funct_comp_evid_t
*this,
176 pts_attr_req_funct_comp_name_bin_enum_t name
);
182 * Creates an tcg_pts_attr_req_funct_comp_evid_t object
184 * @param flags Set of flags
185 * @param depth Sub-component Depth
186 * @param vendor_id Component Functional Name Vendor ID
187 * @param qualifier Functional Name Category Qualifier
188 * @param name Component Functional Name
190 pa_tnc_attr_t
* tcg_pts_attr_req_funct_comp_evid_create(pts_attr_req_funct_comp_evid_flag_t flags
,
193 tcg_pts_qualifier_t qualifier
,
194 pts_attr_req_funct_comp_name_bin_enum_t name
);
197 * Creates an tcg_pts_attr_req_funct_comp_evid_t object from received data
199 * @param value unparsed attribute value
201 pa_tnc_attr_t
* tcg_pts_attr_req_funct_comp_evid_create_from_data(chunk_t value
);
203 #endif /** TCG_PTS_ATTR_REQ_FUNCT_COMP_EVID_H_ @}*/