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_manager pa_tnc_attr_manager
21 #ifndef PA_TNC_ATTR_MANAGER_H_
22 #define PA_TNC_ATTR_MANAGER_H_
24 typedef struct pa_tnc_attr_manager_t pa_tnc_attr_manager_t
;
26 #include "pa_tnc_attr.h"
30 typedef pa_tnc_attr_t
* (*pa_tnc_attr_create_t
)(u_int32_t type
, chunk_t value
);
33 * Manages PA-TNC attributes for arbitrary PENs
35 struct pa_tnc_attr_manager_t
{
38 * Add vendor-specific attribute names and creation method
40 * @param vendor_id Private Enterprise Number (PEN)
41 * @param attr_create Vendor-specific attribute create method
42 * @param attr_names Vendor-specific attribute names
44 void (*add_vendor
)(pa_tnc_attr_manager_t
*this, pen_t vendor_id
,
45 pa_tnc_attr_create_t attr_create
,
46 enum_name_t
*attr_names
);
49 * Remove vendor-specific attribute names and creation method
51 * @param vendor_id Private Enterprise Number (PEN)
53 void (*remove_vendor
)(pa_tnc_attr_manager_t
*this, pen_t vendor_id
);
56 * Return the PA-TNC attribute names for a given vendor ID
58 * @param vendor_id Private Enterprise Number (PEN)
59 * @return PA-TNC attribute names if found, NULL else
61 enum_name_t
* (*get_names
)(pa_tnc_attr_manager_t
*this, pen_t vendor_id
);
64 * Create a PA-TNC attribute object from data for a given vendor ID and type
66 * @param vendor_id Private Enterprise Number (PEN)
67 * @param type PA-TNC attribute type
68 * @param value PA-TNC attribute value as encoded data
69 * @return PA-TNC attribute object if supported, NULL else
71 pa_tnc_attr_t
* (*create
)(pa_tnc_attr_manager_t
*this, pen_t vendor_id
,
72 u_int32_t type
, chunk_t value
);
75 * Destroys a pa_tnc_attr_manager_t object.
77 void (*destroy
)(pa_tnc_attr_manager_t
*this);
81 * Create a PA-TNC attribute manager
83 pa_tnc_attr_manager_t
* pa_tnc_attr_manager_create(void);
85 #endif /** PA_TNC_ATTR_MANAGER_H_ @}*/