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 * Return the PA-TNC attribute names for a given PEN
32 * @param pen Private Enterprise Number (PEN)
33 * @return pa_attr_names if found, NULL else
35 extern enum_name_t
*get_pa_attr_names(pen_t pen
);
38 * Interface for an RFC 5792 PA-TNC Posture Attribute.
41 struct pa_tnc_attr_t
{
44 * Get the vendor ID of an PA-TNC attribute
46 * @return attribute vendor ID
48 u_int32_t (*get_vendor_id
)(pa_tnc_attr_t
*this);
51 * Get the type of an PA-TNC attribute
53 * @return attribute type
55 u_int32_t (*get_type
)(pa_tnc_attr_t
*this);
58 * Get the value of an PA-TNC attribute
60 * @return attribute value
62 chunk_t (*get_value
)(pa_tnc_attr_t
*this);
67 * @return TRUE if the noskip flag is set
69 bool (*get_noskip_flag
)(pa_tnc_attr_t
*this);
74 * @param noskip_flag TRUE if the noskip flag is to be set
76 void (*set_noskip_flag
)(pa_tnc_attr_t
*this, bool noskip
);
79 * Build value of an PA-TNC attribute from its parameters
81 void (*build
)(pa_tnc_attr_t
*this);
84 * Process the value of an PA-TNC attribute to extract its parameters
86 * @param relative error offset within attribute body
87 * @return result status
89 status_t (*process
)(pa_tnc_attr_t
*this, u_int32_t
*offset
);
92 * Get a new reference to the PA-TNC attribute
94 * @return this, with an increased refcount
96 pa_tnc_attr_t
* (*get_ref
)(pa_tnc_attr_t
*this);
99 * Destroys a pa_tnc_attr_t object.
101 void (*destroy
)(pa_tnc_attr_t
*this);
105 * Create a PA-TNC attribute from data
107 * @param vendor_id attribute vendor ID
108 * @param type attribute type
109 * @param value attribute value
112 pa_tnc_attr_t
* pa_tnc_attr_create_from_data(pen_t vendor_id
, u_int32_t type
,
115 #endif /** PA_TNC_ATTR_H_ @}*/