refactored simple component evidence
[strongswan.git] / src / libpts / pts / components / pts_component.h
1 /*
2 * Copyright (C) 2011 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/components/pts_comp_func_name.h"
29 #include "pts/components/pts_comp_evidence.h"
30
31 #include <library.h>
32
33 /**
34 * PTS Functional Component Interface
35 */
36 struct pts_component_t {
37
38 /**
39 * Get the PTS Component Functional Name
40 *
41 * @return PTS Component Functional Name
42 */
43 pts_comp_func_name_t* (*get_comp_func_name)(pts_component_t *this);
44
45 /**
46 * Get the PTS Component Evidence Flags
47 *
48 * @return PTS Component Functional Name
49 */
50 u_int8_t (*get_evidence_flags)(pts_component_t *this);
51
52 /**
53 * Do evidence measurements on the PTS Functional Component
54 *
55 * @param pts PTS interface
56 * @param evidence returns component evidence measureemt
57 * @return status return code
58 */
59 status_t (*measure)(pts_component_t *this, pts_t *pts,
60 pts_comp_evidence_t** evidence);
61
62 /**
63 * Verify the evidence measurements of the PTS Functional Component
64 *
65 * @param pts PTS interface
66 * @param pts_db PTS measurement database
67 * @param evidence component evidence measurement to be verified
68 * @return status return code
69 */
70 status_t (*verify)(pts_component_t *this, pts_t *pts,
71 pts_database_t *pts_db,
72 pts_comp_evidence_t *evidence);
73
74 /**
75 * Destroys a pts_component_t object.
76 */
77 void (*destroy)(pts_component_t *this);
78
79 };
80
81 #endif /** PTS_COMPONENT_H_ @}*/