introduced a PA-TNC attribute manager

This commit is contained in:
Andreas Steffen
2011-09-10 22:39:56 +02:00
parent cf8fd42c77
commit 74eb850dc0
19 changed files with 570 additions and 207 deletions
+31
View File
@@ -13,6 +13,9 @@
*/
#include "ietf_attr.h"
#include "ietf/ietf_attr_pa_tnc_error.h"
#include "ietf/ietf_attr_port_filter.h"
#include "ietf/ietf_attr_product_info.h"
ENUM(ietf_attr_names, IETF_ATTR_TESTING, IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
"Testing",
@@ -30,3 +33,31 @@ ENUM(ietf_attr_names, IETF_ATTR_TESTING, IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
"Factory Default Password Enabled",
);
/**
* See header
*/
pa_tnc_attr_t* ietf_attr_create_from_data(u_int32_t type, chunk_t value)
{
switch (type)
{
case IETF_ATTR_PORT_FILTER:
return ietf_attr_port_filter_create_from_data(value);
case IETF_ATTR_PA_TNC_ERROR:
return ietf_attr_pa_tnc_error_create_from_data(value);
case IETF_ATTR_PRODUCT_INFORMATION:
return ietf_attr_product_info_create_from_data(value);
case IETF_ATTR_TESTING:
case IETF_ATTR_ATTRIBUTE_REQUEST:
case IETF_ATTR_NUMERIC_VERSION:
case IETF_ATTR_STRING_VERSION:
case IETF_ATTR_OPERATIONAL_STATUS:
case IETF_ATTR_INSTALLED_PACKAGES:
case IETF_ATTR_ASSESSMENT_RESULT:
case IETF_ATTR_REMEDIATION_INSTRUCTIONS:
case IETF_ATTR_FORWARDING_ENABLED:
case IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED:
case IETF_ATTR_RESERVED:
default:
return NULL;
}
}
+10
View File
@@ -21,6 +21,8 @@
#ifndef IETF_ATTR_H_
#define IETF_ATTR_H_
#include "pa_tnc/pa_tnc_attr.h"
#include <library.h>
typedef enum ietf_attr_t ietf_attr_t;
@@ -50,4 +52,12 @@ enum ietf_attr_t {
*/
extern enum_name_t *ietf_attr_names;
/**
* Create an IETF PA-TNC attribute from data
*
* @param type attribute type
* @param value attribute value
*/
pa_tnc_attr_t* ietf_attr_create_from_data(u_int32_t type, chunk_t value);
#endif /** IETF_ATTR_H_ @}*/