Defined functional components within ITA namespace
[strongswan.git] / src / libpts / 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_flag_t pts_attr_req_funct_comp_evid_flag_t;
26
27 #include "tcg_attr.h"
28 #include "pts/pts_funct_comp_name.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_FLAG_TTC = (1<<7),
37 /** Verify Component flag */
38 PTS_REQ_FUNC_COMP_FLAG_VER = (1<<6),
39 /** Current Evidence flag */
40 PTS_REQ_FUNC_COMP_FLAG_CURR = (1<<5),
41 /** PCR Information flag */
42 PTS_REQ_FUNC_COMP_FLAG_PCR = (1<<4),
43 };
44
45 /**
46 * Class implementing the TCG PTS Request Functional Component Evidence attribute
47 *
48 */
49 struct tcg_pts_attr_req_funct_comp_evid_t {
50
51 /**
52 * Public PA-TNC attribute interface
53 */
54 pa_tnc_attr_t pa_tnc_attribute;
55
56 /**
57 * Get flags for PTS Request Functional Component Evidence
58 *
59 * @return Set of flags
60 */
61 pts_attr_req_funct_comp_evid_flag_t (*get_flags)(tcg_pts_attr_req_funct_comp_evid_t *this);
62
63 /**
64 * Set flags for PTS Request Functional Component Evidence
65 *
66 * @param flags Set of flags
67 */
68 void (*set_flags)(tcg_pts_attr_req_funct_comp_evid_t *this,
69 pts_attr_req_funct_comp_evid_flag_t flags);
70
71 /**
72 * Get Sub-component Depth
73 *
74 * @return Sub-component Depth
75 */
76 u_int32_t (*get_sub_component_depth)(tcg_pts_attr_req_funct_comp_evid_t *this);
77
78 /**
79 * Get Component Functional Name Vendor ID
80 *
81 * @return Component Functional Name Vendor ID
82 */
83 u_int32_t (*get_comp_funct_name_vendor_id)(tcg_pts_attr_req_funct_comp_evid_t *this);
84
85 /**
86 * Get Family
87 *
88 * @return Functional Name Family
89 */
90 u_int8_t (*get_family)(tcg_pts_attr_req_funct_comp_evid_t *this);
91
92 /**
93 * Get Qualifier
94 *
95 * @return Functional Name Category Qualifier
96 */
97 pts_qualifier_t (*get_qualifier)(tcg_pts_attr_req_funct_comp_evid_t *this);
98
99 /**
100 * Set qualifier for Component Functional Name
101 *
102 * @param qualifier Functional Name Category Qualifier
103 */
104 void (*set_qualifier)(tcg_pts_attr_req_funct_comp_evid_t *this,
105 pts_qualifier_t qualifier);
106
107 /**
108 * Get Component Functional Name
109 *
110 * @return Component Functional Name
111 */
112 pts_ita_funct_comp_name_t (*get_comp_funct_name)(tcg_pts_attr_req_funct_comp_evid_t *this);
113
114
115 /**
116 * Set Component Functional Name
117 *
118 * @param name Component Functional Name
119 */
120 void (*set_comp_funct_name)(tcg_pts_attr_req_funct_comp_evid_t *this,
121 pts_ita_funct_comp_name_t name);
122
123
124 };
125
126 /**
127 * Creates an tcg_pts_attr_req_funct_comp_evid_t object
128 *
129 * @param flags Set of flags
130 * @param depth Sub-component Depth
131 * @param vendor_id Component Functional Name Vendor ID
132 * @param qualifier Functional Name Category Qualifier
133 * @param name Component Functional Name
134 */
135 pa_tnc_attr_t* tcg_pts_attr_req_funct_comp_evid_create(pts_attr_req_funct_comp_evid_flag_t flags,
136 u_int32_t depth, u_int32_t vendor_id,
137 pts_qualifier_t qualifier,
138 pts_ita_funct_comp_name_t name);
139
140 /**
141 * Creates an tcg_pts_attr_req_funct_comp_evid_t object from received data
142 *
143 * @param value Unparsed attribute value
144 */
145 pa_tnc_attr_t* tcg_pts_attr_req_funct_comp_evid_create_from_data(chunk_t value);
146
147 #endif /** TCG_PTS_ATTR_REQ_FUNCT_COMP_EVID_H_ @}*/