Implemented TCG PTS Attributes
[strongswan.git] / src / libimcv / tcg / tcg_pts_attr_proto_caps.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_proto_caps tcg_pts_attr_proto_caps
18 * @{ @ingroup tcg_pts_attr_proto_caps
19 */
20
21 #ifndef TCG_PTS_ATTR_PROTO_CAPS_H_
22 #define TCG_PTS_ATTR_PROTO_CAPS_H_
23
24 typedef struct tcg_pts_attr_proto_caps_t tcg_pts_attr_proto_caps_t;
25 typedef enum pts_attr_proto_caps_flag_t pts_attr_proto_caps_flag_t;
26
27 #include "tcg_attr.h"
28 #include "pa_tnc/pa_tnc_attr.h"
29
30 /**
31 * PTS Protocol Capabilities Flags
32 */
33 enum pts_attr_proto_caps_flag_t {
34 /** XML based Evidence Support flag */
35 PTS_PROTO_CAPS_XML = (1<<0),
36 /** Trusted Platform Evidence flag */
37 PTS_PROTO_CAPS_T = (1<<1),
38 /** DH Nonce Negotiation Support flag */
39 PTS_PROTO_CAPS_DH = (1<<2),
40 /** Verification Support flag */
41 PTS_PROTO_CAPS_VER = (1<<3),
42 /** Current (In-Memory) Evidence Support flag */
43 PTS_PROTO_CAPS_CURRENT = (1<<4),
44 };
45
46 /**
47 * Class implementing the TCG PTS Protocol Capabilities Attribute
48 *
49 */
50 struct tcg_pts_attr_proto_caps_t {
51
52 /**
53 * Public PA-TNC attribute interface
54 */
55 pa_tnc_attr_t pa_tnc_attribute;
56
57 /**
58 * Get PTS procol capabilities flags
59 *
60 * @return set of flags
61 */
62 pts_attr_proto_caps_flag_t (*get_flags)(tcg_pts_attr_proto_caps_t *this);
63
64 /**
65 * Set PTS procol capabilities flags
66 *
67 * @param flags set of flags
68 */
69 void (*set_flags)(tcg_pts_attr_proto_caps_t *this,
70 pts_attr_proto_caps_flag_t flags);
71
72 };
73
74 /**
75 * Creates an tcg_pts_attr_proto_caps_t object
76 *
77 * @param flags set of flags
78 */
79 pa_tnc_attr_t* tcg_pts_attr_proto_caps_create(pts_attr_proto_caps_flag_t flags);
80
81 /**
82 * Creates an tcg_pts_attr_proto_caps_t object from received data
83 *
84 * @param value unparsed attribute value
85 */
86 pa_tnc_attr_t* tcg_pts_attr_proto_caps_create_from_data(chunk_t value);
87
88 #endif /** TCG_PTS_ATTR_PROTO_CAPS_H_ @}*/