8b610c00d731ba6c64bd8e9098e089d2d004a159
[strongswan.git] / src / libimcv / tcg / tcg_pts_attr_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_file_meas tcg_pts_attr_file_meas
18 * @{ @ingroup tcg_pts_attr_file_meas
19 */
20
21 #ifndef TCG_PTS_ATTR_FILE_MEAS_H_
22 #define TCG_PTS_ATTR_FILE_MEAS_H_
23
24 typedef struct tcg_pts_attr_file_meas_t tcg_pts_attr_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 File Measurement attribute
31 *
32 */
33 struct tcg_pts_attr_file_meas_t {
34
35 /**
36 * Public PA-TNC attribute interface
37 */
38 pa_tnc_attr_t pa_tnc_attribute;
39
40 /**
41 * Get Number of Files included
42 *
43 * @return Number of Files included
44 */
45 u_int64_t (*get_number_of_files)(tcg_pts_attr_file_meas_t *this);
46
47 /**
48 * Set Number of Files included
49 *
50 * @param num_files Number of Files included
51 */
52 void (*set_number_of_files)(tcg_pts_attr_file_meas_t *this,
53 u_int64_t num_files);
54
55 /**
56 * Get Request ID
57 *
58 * @return Request ID
59 */
60 u_int16_t (*get_request_id)(tcg_pts_attr_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_file_meas_t *this,
68 u_int16_t request_id);
69
70 /**
71 * Get Measurement Length
72 *
73 * @return Measurement Length
74 */
75 u_int16_t (*get_meas_len)(tcg_pts_attr_file_meas_t *this);
76
77 /**
78 * Set Measurement Length
79 *
80 * @param meas_len Measurement Length
81 */
82 void (*set_meas_len)(tcg_pts_attr_file_meas_t *this,
83 u_int16_t meas_len);
84
85 /**
86 * Add a file measurement entry
87 *
88 * @param measurement Measurement value
89 * @param file_name File Name
90 */
91 void (*add_file_meas)(tcg_pts_attr_file_meas_t *this, chunk_t measurement,
92 chunk_t file_name);
93
94 /**
95 * Enumerates over all file measurements
96 * Format: chunk_t *measurement, chunk_t *file_name
97 *
98 * @return enumerator
99 */
100 enumerator_t* (*create_file_meas_enumerator)(tcg_pts_attr_file_meas_t *this);
101 };
102
103 /**
104 * Creates an tcg_pts_attr_file_meas_t object
105 *
106 * @param directory_flag Directory Contents Flag
107 * @param request_id Request ID
108 * @param delimiter Delimiter Character
109 * @param path File Path
110 */
111 pa_tnc_attr_t* tcg_pts_attr_file_meas_create(u_int64_t number_of_files,
112 u_int16_t request_id,
113 u_int16_t meas_len);
114
115 /**
116 * Creates an tcg_pts_attr_file_meas_t object from received data
117 *
118 * @param value unparsed attribute value
119 */
120 pa_tnc_attr_t* tcg_pts_attr_file_meas_create_from_data(chunk_t value);
121
122 #endif /** TCG_PTS_ATTR_FILE_MEAS_H_ @}*/