moved file_meas_entry_t struct to header file
[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 typedef struct file_meas_entry_t file_meas_entry_t;
30
31 /**
32 * File Measurement entry
33 */
34 struct file_meas_entry_t {
35 chunk_t measurement;
36 u_int16_t file_name_len;
37 chunk_t file_name;
38 };
39
40 /**
41 * Class implementing the TCG PTS File Measurement attribute
42 *
43 */
44 struct tcg_pts_attr_file_meas_t {
45
46 /**
47 * Public PA-TNC attribute interface
48 */
49 pa_tnc_attr_t pa_tnc_attribute;
50
51 /**
52 * Get Number of Files included
53 *
54 * @return Number of Files included
55 */
56 u_int64_t (*get_number_of_files)(tcg_pts_attr_file_meas_t *this);
57
58 /**
59 * Set Number of Files included
60 *
61 * @param num_files Number of Files included
62 */
63 void (*set_number_of_files)(tcg_pts_attr_file_meas_t *this,
64 u_int64_t num_files);
65
66 /**
67 * Get Request ID
68 *
69 * @return Request ID
70 */
71 u_int16_t (*get_request_id)(tcg_pts_attr_file_meas_t *this);
72
73 /**
74 * Set Request ID
75 *
76 * @param request_id Request ID
77 */
78 void (*set_request_id)(tcg_pts_attr_file_meas_t *this,
79 u_int16_t request_id);
80
81 /**
82 * Get Measurement Length
83 *
84 * @return Measurement Length
85 */
86 u_int16_t (*get_meas_len)(tcg_pts_attr_file_meas_t *this);
87
88 /**
89 * Set Measurement Length
90 *
91 * @param meas_len Measurement Length
92 */
93 void (*set_meas_len)(tcg_pts_attr_file_meas_t *this,
94 u_int16_t meas_len);
95
96 /**
97 * Add a file measurement entry
98 *
99 * @param measurement Measurement value
100 * @param file_name File Name
101 */
102 void (*add_file_meas)(tcg_pts_attr_file_meas_t *this, chunk_t measurement,
103 chunk_t file_name);
104
105 /**
106 * Enumerates over all file measurements
107 * Format: chunk_t *measurement, chunk_t *file_name
108 *
109 * @return enumerator
110 */
111 enumerator_t* (*create_file_meas_enumerator)(tcg_pts_attr_file_meas_t *this);
112 };
113
114 /**
115 * Creates an tcg_pts_attr_file_meas_t object
116 *
117 * @param directory_flag Directory Contents Flag
118 * @param request_id Request ID
119 * @param delimiter Delimiter Character
120 * @param path File Path
121 */
122 pa_tnc_attr_t* tcg_pts_attr_file_meas_create(u_int64_t number_of_files,
123 u_int16_t request_id,
124 u_int16_t meas_len);
125
126 /**
127 * Creates an tcg_pts_attr_file_meas_t object from received data
128 *
129 * @param value unparsed attribute value
130 */
131 pa_tnc_attr_t* tcg_pts_attr_file_meas_create_from_data(chunk_t value);
132
133 #endif /** TCG_PTS_ATTR_FILE_MEAS_H_ @}*/