160fd0518a324d72c5acd5620a02c263f6c53668
[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 * Get the PTS Sub-component Depth
54 *
55 * @return PTS Sub-component Depth
56 */
57 u_int32_t (*get_depth)(pts_component_t *this);
58
59 /**
60 * Do evidence measurements on the PTS Functional Component
61 *
62 * @param pts PTS interface
63 * @param evidence returns component evidence measureemt
64 * @return status return code
65 */
66 status_t (*measure)(pts_component_t *this, pts_t *pts,
67 pts_comp_evidence_t** evidence);
68
69 /**
70 * Verify the evidence measurements of the PTS Functional Component
71 *
72 * @param pts PTS interface
73 * @param evidence component evidence measurement to be verified
74 * @return status return code
75 */
76 status_t (*verify)(pts_component_t *this, pts_t *pts,
77 pts_comp_evidence_t *evidence);
78
79
80 /**
81 * Tell the PTS Functional Component to finalize pending registrations
82 * and check for missing measurements
83 *
84 * @return TRUE if finalization successful
85 */
86 bool (*finalize)(pts_component_t *this);
87
88 /**
89 * Destroys a pts_component_t object.
90 */
91 void (*destroy)(pts_component_t *this);
92
93 };
94
95 #endif /** PTS_COMPONENT_H_ @}*/