shortened some type names and enforced encoding rules
[strongswan.git] / src / libimcv / tcg / tcg_pts_attr_meas_algo.h
1 /*
2 * Copyright (C) 2011 Sansar Choinyambuu
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 tcg_pts_attr_meas_algo tcg_pts_attr_meas_algo
18 * @{ @ingroup tcg_pts_attr_meas_algo
19 */
20
21 #ifndef TCG_PTS_ATTR_MEAS_ALGO_H_
22 #define TCG_PTS_ATTR_MEAS_ALGO_H_
23
24 typedef struct tcg_pts_attr_meas_algo_t tcg_pts_attr_meas_algo_t;
25 typedef enum pts_meas_algorithms_t pts_meas_algorithms_t;
26
27 #include "tcg_attr.h"
28 #include "pa_tnc/pa_tnc_attr.h"
29
30 /**
31 * PTS Measurement Algorithms
32 */
33 enum pts_meas_algorithms_t {
34 /** SHA-384 */
35 PTS_MEAS_ALGO_SHA1 = (1<<0),
36 /** SHA-256 */
37 PTS_MEAS_ALGO_SHA256 = (1<<1),
38 /** SHA-1 */
39 PTS_MEAS_ALGO_SHA384 = (1<<2),
40 };
41
42 /**
43 * Class implementing the TCG Measurement Algorithm Attribute
44 *
45 */
46 struct tcg_pts_attr_meas_algo_t {
47
48 /**
49 * Public PA-TNC attribute interface
50 */
51 pa_tnc_attr_t pa_tnc_attribute;
52
53 /**
54 * Get PTS Measurement Algorithm Set
55 *
56 * @return set of algorithms
57 */
58 pts_meas_algorithms_t (*get_algorithms)(tcg_pts_attr_meas_algo_t *this);
59
60 /**
61 * Set PTS Measurement Algorithm Set
62 *
63 * @param flags set of algorithms
64 */
65 void (*set_algorithms)(tcg_pts_attr_meas_algo_t *this,
66 pts_meas_algorithms_t algorithms);
67
68 };
69
70 /**
71 * Creates an tcg_pts_attr_meas_algo_t object
72 *
73 * @param algorithms set of algorithms
74 */
75 pa_tnc_attr_t* tcg_pts_attr_meas_algo_create(pts_meas_algorithms_t algorithms);
76
77 /**
78 * Creates an tcg_pts_attr_meas_algo_t object from received data
79 *
80 * @param value unparsed attribute value
81 */
82 pa_tnc_attr_t* tcg_pts_attr_meas_algo_create_from_data(chunk_t value);
83
84 #endif /** TCG_PTS_ATTR_MEAS_ALGO_H_ @}*/