2 * Copyright (C) 2011 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
17 * @defgroup pa_tnc_attr pa_tnc_attr
21 #ifndef PA_TNC_ATTR_H_
22 #define PA_TNC_ATTR_H_
24 typedef struct pa_tnc_attr_t pa_tnc_attr_t
;
30 * Interface for an RFC 5792 PA-TNC Posture Attribute.
33 struct pa_tnc_attr_t
{
36 * Get the vendor ID of an PA-TNC attribute
38 * @return attribute vendor ID
40 u_int32_t (*get_vendor_id
)(pa_tnc_attr_t
*this);
43 * Get the type of an PA-TNC attribute
45 * @return attribute type
47 u_int32_t (*get_type
)(pa_tnc_attr_t
*this);
50 * Get the value of an PA-TNC attribute
52 * @return attribute value
54 chunk_t (*get_value
)(pa_tnc_attr_t
*this);
59 * @return TRUE if the noskip flag is set
61 bool (*get_noskip_flag
)(pa_tnc_attr_t
*this);
66 * @param noskip_flag TRUE if the noskip flag is to be set
68 void (*set_noskip_flag
)(pa_tnc_attr_t
*this, bool noskip
);
71 * Build value of an PA-TNC attribute from its parameters
73 void (*build
)(pa_tnc_attr_t
*this);
76 * Process the value of an PA-TNC attribute to extract its parameters
78 * @param relative error offset within attribute body
79 * @return result status
81 status_t (*process
)(pa_tnc_attr_t
*this, u_int32_t
*offset
);
84 * Get a new reference to the PA-TNC attribute
86 * @return this, with an increased refcount
88 pa_tnc_attr_t
* (*get_ref
)(pa_tnc_attr_t
*this);
91 * Destroys a pa_tnc_attr_t object.
93 void (*destroy
)(pa_tnc_attr_t
*this);
97 * Create a PA-TNC attribute from data
99 * @param vendor_id attribute vendor ID
100 * @param type attribute type
101 * @param value attribute value
104 pa_tnc_attr_t
* pa_tnc_attr_create_from_data(pen_t vendor_id
, u_int32_t type
,
107 #endif /** PA_TNC_ATTR_H_ @}*/