transfer IMA file measurements via PA-TNC
[strongswan.git] / src / libpts / pts / components / pts_component.h
1 /*
2 * Copyright (C) 2011-2012 Andreas Steffen
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
26 #include "pts/pts.h"
27 #include "pts/pts_database.h"
28 #include "pts/pts_file_meas.h"
29 #include "pts/components/pts_comp_func_name.h"
30 #include "pts/components/pts_comp_evidence.h"
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
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
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
60 /**
61 * Do evidence measurements on the PTS Functional Component
62 *
63 * @param pts PTS interface
64 * @param evidence returns component evidence measureemt
65 * @param measurements additional file measurements (NULL if not present)
66 * @return status return code
67 */
68 status_t (*measure)(pts_component_t *this, pts_t *pts,
69 pts_comp_evidence_t** evidence,
70 pts_file_meas_t** measurements);
71
72 /**
73 * Verify the evidence measurements of the PTS Functional Component
74 *
75 * @param pts PTS interface
76 * @param evidence component evidence measurement to be verified
77 * @return status return code
78 */
79 status_t (*verify)(pts_component_t *this, pts_t *pts,
80 pts_comp_evidence_t *evidence);
81
82 /**
83 * Tell the PTS Functional Component to finalize pending registrations
84 * and check for missing measurements
85 *
86 * @return TRUE if finalization successful
87 */
88 bool (*finalize)(pts_component_t *this);
89
90 /**
91 * Destroys a pts_component_t object.
92 */
93 void (*destroy)(pts_component_t *this);
94
95 };
96
97 #endif /** PTS_COMPONENT_H_ @}*/