]> git.ipfire.org Git - thirdparty/strongswan.git/blame - src/libimcv/pts/components/pts_component.h
Some whitespace fixes
[thirdparty/strongswan.git] / src / libimcv / pts / components / pts_component.h
CommitLineData
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
24typedef 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>
975472e4 33#include <bio/bio_writer.h>
051dfbd6
AS
34
35/**
b9949e98 36 * PTS Functional Component Interface
051dfbd6
AS
37 */
38struct pts_component_t {
39
40 /**
41 * Get the PTS Component Functional Name
42 *
43 * @return PTS Component Functional Name
44 */
45 pts_comp_func_name_t* (*get_comp_func_name)(pts_component_t *this);
46
a1ac4d5e
AS
47 /**
48 * Get the PTS Component Evidence Flags
49 *
50 * @return PTS Component Functional Name
51 */
b12c53ce 52 uint8_t (*get_evidence_flags)(pts_component_t *this);
a1ac4d5e 53
824a7824
SC
54 /**
55 * Get the PTS Sub-component Depth
56 *
57 * @return PTS Sub-component Depth
58 */
b12c53ce 59 uint32_t (*get_depth)(pts_component_t *this);
824a7824 60
051dfbd6 61 /**
cb3ecd5a 62 * Do evidence measurements on the PTS Functional Component
051dfbd6 63 *
af8354da 64 * @param qualifier PTS Component Functional Name Qualifier
cb3ecd5a
AS
65 * @param pts PTS interface
66 * @param evidence returns component evidence measureemt
e0bfc4d6 67 * @param measurements additional file measurements (NULL if not present)
cb3ecd5a 68 * @return status return code
051dfbd6 69 */
b12c53ce 70 status_t (*measure)(pts_component_t *this, uint8_t qualifier, pts_t *pts,
ab957aac 71 pts_comp_evidence_t** evidence);
051dfbd6
AS
72
73 /**
cb3ecd5a 74 * Verify the evidence measurements of the PTS Functional Component
051dfbd6 75 *
af8354da 76 * @param qualifier PTS Component Functional Name Qualifier
cb3ecd5a 77 * @param pts PTS interface
cb3ecd5a
AS
78 * @param evidence component evidence measurement to be verified
79 * @return status return code
051dfbd6 80 */
b12c53ce 81 status_t (*verify)(pts_component_t *this, uint8_t qualifier, pts_t *pts,
cb3ecd5a 82 pts_comp_evidence_t *evidence);
051dfbd6 83
db087023
AS
84 /**
85 * Tell the PTS Functional Component to finalize pending registrations
ddafcda4 86 * and check for missing measurements
db087023 87 *
af8354da 88 * @param qualifier PTS Component Functional Name Qualifier
975472e4 89 * @param result writer appending concise measurement result
ddafcda4 90 * @return TRUE if finalization successful
db087023 91 */
b12c53ce 92 bool (*finalize)(pts_component_t *this, uint8_t qualifier,
975472e4 93 bio_writer_t *result);
af8354da
AS
94
95 /**
96 * Get a new reference to the PTS Functional Component
97 *
98 * @return this, with an increased refcount
99 */
100 pts_component_t* (*get_ref)(pts_component_t *this);
db087023 101
051dfbd6
AS
102 /**
103 * Destroys a pts_component_t object.
104 */
105 void (*destroy)(pts_component_t *this);
106
107};
108
109#endif /** PTS_COMPONENT_H_ @}*/