95a596ce0c24b4b1399e83858a9d5f848537cf53
[strongswan.git] / src / libimcv / pa_tnc / pa_tnc_attr.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 pa_tnc_attr pa_tnc_attr
18 * @{ @ingroup libimcv
19 */
20
21 #ifndef PA_TNC_ATTR_H_
22 #define PA_TNC_ATTR_H_
23
24 typedef struct pa_tnc_attr_t pa_tnc_attr_t;
25
26 #include <library.h>
27 #include <pen/pen.h>
28
29 /**
30 * Interface for an RFC 5792 PA-TNC Posture Attribute.
31 *
32 */
33 struct pa_tnc_attr_t {
34
35 /**
36 * Get the vendor ID of an PA-TNC attribute
37 *
38 * @return attribute vendor ID
39 */
40 u_int32_t (*get_vendor_id)(pa_tnc_attr_t *this);
41
42 /**
43 * Get the type of an PA-TNC attribute
44 *
45 * @return attribute type
46 */
47 u_int32_t (*get_type)(pa_tnc_attr_t *this);
48
49 /**
50 * Get the value of an PA-TNC attribute
51 *
52 * @return attribute value
53 */
54 chunk_t (*get_value)(pa_tnc_attr_t *this);
55
56 /**
57 * Get the noskip flag
58 *
59 * @return TRUE if the noskip flag is set
60 */
61 bool (*get_noskip_flag)(pa_tnc_attr_t *this);
62
63 /**
64 * Set the noskip flag
65 *
66 * @param noskip_flag TRUE if the noskip flag is to be set
67 */
68 void (*set_noskip_flag)(pa_tnc_attr_t *this, bool noskip);
69
70 /**
71 * Build value of an PA-TNC attribute from its parameters
72 */
73 void (*build)(pa_tnc_attr_t *this);
74
75 /**
76 * Process the value of an PA-TNC attribute to extract its parameters
77 *
78 * @return result status
79 */
80 status_t (*process)(pa_tnc_attr_t *this);
81
82 /**
83 * Get a new reference to the PA-TNC attribute
84 *
85 * @return this, with an increased refcount
86 */
87 pa_tnc_attr_t* (*get_ref)(pa_tnc_attr_t *this);
88
89 /**
90 * Destroys a pa_tnc_attr_t object.
91 */
92 void (*destroy)(pa_tnc_attr_t *this);
93 };
94
95 /**
96 * Create a PA-TNC attribute from data
97 *
98 * @param vendor_id attribute vendor ID
99 * @param type attribute type
100 * @param value attribute value
101 *
102 */
103 pa_tnc_attr_t* pa_tnc_attr_create_from_data(pen_t vendor_id, u_int32_t type,
104 chunk_t value);
105
106 #endif /** PA_TNC_ATTR_H_ @}*/