Implemented TCG PTS Simple Evidence Final and Request File Measurement attributes
[strongswan.git] / src / libimcv / tcg / tcg_pts_attr_req_file_meas.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_file_meas tcg_pts_attr_req_file_meas
18 * @{ @ingroup tcg_pts_attr_req_file_meas
19 */
20
21 #ifndef TCG_PTS_ATTR_REQ_FILE_MEAS_H_
22 #define TCG_PTS_ATTR_REQ_FILE_MEAS_H_
23
24 typedef struct tcg_pts_attr_req_file_meas_t tcg_pts_attr_req_file_meas_t;
25
26 #include "tcg_attr.h"
27 #include "pa_tnc/pa_tnc_attr.h"
28
29 /**
30 * Class implementing the TCG PTS Request File Measurement attribute
31 *
32 */
33 struct tcg_pts_attr_req_file_meas_t {
34
35 /**
36 * Public PA-TNC attribute interface
37 */
38 pa_tnc_attr_t pa_tnc_attribute;
39
40 /**
41 * Get flag for PTS Request File Measurement
42 *
43 * @return Directory Contents flag
44 */
45 bool (*get_directory_flag)(tcg_pts_attr_req_file_meas_t *this);
46
47 /**
48 * Set flag for PTS Request File Measurement
49 *
50 * @param directory_flag Directory Contents flag
51 */
52 void (*set_directory_flag)(tcg_pts_attr_req_file_meas_t *this,
53 bool directory_flag);
54
55 /**
56 * Get Request ID
57 *
58 * @return Request ID
59 */
60 u_int16_t (*get_request_id)(tcg_pts_attr_req_file_meas_t *this);
61
62 /**
63 * Set Request ID
64 *
65 * @param request_id Request ID
66 */
67 void (*set_request_id)(tcg_pts_attr_req_file_meas_t *this,
68 u_int16_t hash_algorithm);
69
70 /**
71 * Get Delimiter
72 *
73 * @return UTF-8 encoding of a Delimiter Character
74 */
75 u_int32_t (*get_delimiter)(tcg_pts_attr_req_file_meas_t *this);
76
77 /**
78 * Set Delimiter
79 *
80 * @param delimiter UTF-8 encoding of a Delimiter Character
81 */
82 void (*set_delimiter)(tcg_pts_attr_req_file_meas_t *this,
83 u_int32_t delimiter);
84
85 /**
86 * Get Fully Qualified File Path Name
87 *
88 * @return File Path
89 */
90 chunk_t (*get_file_path)(tcg_pts_attr_req_file_meas_t *this);
91
92 /**
93 * Set Fully Qualified File Path Name
94 *
95 * @param path File Path
96 */
97 void (*set_file_path)(tcg_pts_attr_req_file_meas_t *this,
98 chunk_t path);
99
100 };
101
102 /**
103 * Creates an tcg_pts_attr_req_file_meas_t object
104 *
105 * @param directory_flag Directory Contents Flag
106 * @param request_id Request ID
107 * @param delimiter Delimiter Character
108 * @param path File Path
109 */
110 pa_tnc_attr_t* tcg_pts_attr_req_file_meas_create(bool directory_flag,
111 u_int16_t request_id,
112 u_int32_t delimiter,
113 chunk_t path);
114
115 /**
116 * Creates an tcg_pts_attr_req_file_meas_t object from received data
117 *
118 * @param value unparsed attribute value
119 */
120 pa_tnc_attr_t* tcg_pts_attr_req_file_meas_create_from_data(chunk_t value);
121
122 #endif /** TCG_PTS_ATTR_REQ_FILE_MEAS_H_ @}*/