]>
Commit | Line | Data |
---|---|---|
051dfbd6 | 1 | /* |
e0bfc4d6 | 2 | * Copyright (C) 2011-2012 Andreas Steffen |
051dfbd6 AS |
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 pts_component pts_component | |
18 | * @{ @ingroup pts | |
19 | */ | |
20 | ||
21 | #ifndef PTS_COMPONENT_H_ | |
22 | #define PTS_COMPONENT_H_ | |
23 | ||
24 | typedef struct pts_component_t pts_component_t; | |
25 | ||
cb3ecd5a AS |
26 | #include "pts/pts.h" |
27 | #include "pts/pts_database.h" | |
e0bfc4d6 | 28 | #include "pts/pts_file_meas.h" |
051dfbd6 | 29 | #include "pts/components/pts_comp_func_name.h" |
cb3ecd5a | 30 | #include "pts/components/pts_comp_evidence.h" |
051dfbd6 AS |
31 | |
32 | #include <library.h> | |
33 | ||
34 | /** | |
35 | * PTS Functional Component Interface | |
36 | */ | |
37 | struct pts_component_t { | |
38 | ||
39 | /** | |
40 | * Get the PTS Component Functional Name | |
41 | * | |
42 | * @return PTS Component Functional Name | |
43 | */ | |
44 | pts_comp_func_name_t* (*get_comp_func_name)(pts_component_t *this); | |
45 | ||
a1ac4d5e AS |
46 | /** |
47 | * Get the PTS Component Evidence Flags | |
48 | * | |
49 | * @return PTS Component Functional Name | |
50 | */ | |
51 | u_int8_t (*get_evidence_flags)(pts_component_t *this); | |
52 | ||
824a7824 SC |
53 | /** |
54 | * Get the PTS Sub-component Depth | |
55 | * | |
56 | * @return PTS Sub-component Depth | |
57 | */ | |
58 | u_int32_t (*get_depth)(pts_component_t *this); | |
59 | ||
051dfbd6 | 60 | /** |
cb3ecd5a | 61 | * Do evidence measurements on the PTS Functional Component |
051dfbd6 | 62 | * |
af8354da | 63 | * @param qualifier PTS Component Functional Name Qualifier |
cb3ecd5a AS |
64 | * @param pts PTS interface |
65 | * @param evidence returns component evidence measureemt | |
e0bfc4d6 | 66 | * @param measurements additional file measurements (NULL if not present) |
cb3ecd5a | 67 | * @return status return code |
051dfbd6 | 68 | */ |
af8354da | 69 | status_t (*measure)(pts_component_t *this, u_int8_t qualifier, pts_t *pts, |
ab957aac | 70 | pts_comp_evidence_t** evidence); |
051dfbd6 AS |
71 | |
72 | /** | |
cb3ecd5a | 73 | * Verify the evidence measurements of the PTS Functional Component |
051dfbd6 | 74 | * |
af8354da | 75 | * @param qualifier PTS Component Functional Name Qualifier |
cb3ecd5a | 76 | * @param pts PTS interface |
cb3ecd5a AS |
77 | * @param evidence component evidence measurement to be verified |
78 | * @return status return code | |
051dfbd6 | 79 | */ |
af8354da | 80 | status_t (*verify)(pts_component_t *this, u_int8_t qualifier, pts_t *pts, |
cb3ecd5a | 81 | pts_comp_evidence_t *evidence); |
051dfbd6 | 82 | |
db087023 AS |
83 | /** |
84 | * Tell the PTS Functional Component to finalize pending registrations | |
ddafcda4 | 85 | * and check for missing measurements |
db087023 | 86 | * |
af8354da | 87 | * @param qualifier PTS Component Functional Name Qualifier |
ddafcda4 | 88 | * @return TRUE if finalization successful |
db087023 | 89 | */ |
af8354da AS |
90 | bool (*finalize)(pts_component_t *this, u_int8_t qualifier); |
91 | ||
92 | /** | |
93 | * Get a new reference to the PTS Functional Component | |
94 | * | |
95 | * @return this, with an increased refcount | |
96 | */ | |
97 | pts_component_t* (*get_ref)(pts_component_t *this); | |
db087023 | 98 | |
051dfbd6 AS |
99 | /** |
100 | * Destroys a pts_component_t object. | |
101 | */ | |
102 | void (*destroy)(pts_component_t *this); | |
103 | ||
104 | }; | |
105 | ||
106 | #endif /** PTS_COMPONENT_H_ @}*/ |