diff options
author | Yves-Alexis Perez <corsac@corsac.net> | 2012-06-28 21:16:07 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@corsac.net> | 2012-06-28 21:16:07 +0200 |
commit | b34738ed08c2227300d554b139e2495ca5da97d6 (patch) | |
tree | 62f33b52820f2e49f0e53c0f8c636312037c8054 /src/libimcv/pa_tnc/pa_tnc_attr_manager.h | |
parent | 0a9d51a49042a68daa15b0c74a2b7f152f52606b (diff) | |
download | vyos-strongswan-b34738ed08c2227300d554b139e2495ca5da97d6.tar.gz vyos-strongswan-b34738ed08c2227300d554b139e2495ca5da97d6.zip |
Imported Upstream version 4.6.4
Diffstat (limited to 'src/libimcv/pa_tnc/pa_tnc_attr_manager.h')
-rw-r--r-- | src/libimcv/pa_tnc/pa_tnc_attr_manager.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/libimcv/pa_tnc/pa_tnc_attr_manager.h b/src/libimcv/pa_tnc/pa_tnc_attr_manager.h new file mode 100644 index 000000000..40c3ab335 --- /dev/null +++ b/src/libimcv/pa_tnc/pa_tnc_attr_manager.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2011 Andreas Steffen + * HSR Hochschule fuer Technik Rapperswil + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +/** + * @defgroup pa_tnc_attr_manager pa_tnc_attr_manager + * @{ @ingroup libimcv + */ + +#ifndef PA_TNC_ATTR_MANAGER_H_ +#define PA_TNC_ATTR_MANAGER_H_ + +typedef struct pa_tnc_attr_manager_t pa_tnc_attr_manager_t; + +#include "pa_tnc_attr.h" + +#include <library.h> + +typedef pa_tnc_attr_t* (*pa_tnc_attr_create_t)(u_int32_t type, chunk_t value); + +/** + * Manages PA-TNC attributes for arbitrary PENs + */ +struct pa_tnc_attr_manager_t { + + /** + * Add vendor-specific attribute names and creation method + * + * @param vendor_id Private Enterprise Number (PEN) + * @param attr_create Vendor-specific attribute create method + * @param attr_names Vendor-specific attribute names + */ + void (*add_vendor)(pa_tnc_attr_manager_t *this, pen_t vendor_id, + pa_tnc_attr_create_t attr_create, + enum_name_t *attr_names); + + /** + * Remove vendor-specific attribute names and creation method + * + * @param vendor_id Private Enterprise Number (PEN) + */ + void (*remove_vendor)(pa_tnc_attr_manager_t *this, pen_t vendor_id); + + /* + * Return the PA-TNC attribute names for a given vendor ID + * + * @param vendor_id Private Enterprise Number (PEN) + * @return PA-TNC attribute names if found, NULL else + */ + enum_name_t* (*get_names)(pa_tnc_attr_manager_t *this, pen_t vendor_id); + + /** + * Create a PA-TNC attribute object from data for a given vendor ID and type + * + * @param vendor_id Private Enterprise Number (PEN) + * @param type PA-TNC attribute type + * @param value PA-TNC attribute value as encoded data + * @return PA-TNC attribute object if supported, NULL else + */ + pa_tnc_attr_t* (*create)(pa_tnc_attr_manager_t *this, pen_t vendor_id, + u_int32_t type, chunk_t value); + + /** + * Destroys a pa_tnc_attr_manager_t object. + */ + void (*destroy)(pa_tnc_attr_manager_t *this); +}; + +/** + * Create a PA-TNC attribute manager + */ +pa_tnc_attr_manager_t* pa_tnc_attr_manager_create(void); + +#endif /** PA_TNC_ATTR_MANAGER_H_ @}*/ |