Allow to treat specified Attribute-Type-Not-Supported errors as non-fatal
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2012 Andreas Steffen
|
||||
* Copyright (C) 2011-2014 Andreas Steffen
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -58,6 +58,11 @@ struct private_imc_agent_t {
|
||||
*/
|
||||
linked_list_t *additional_ids;
|
||||
|
||||
/**
|
||||
* list of non-fatal unsupported PA-TNC attribute types
|
||||
*/
|
||||
linked_list_t *non_fatal_attr_types;
|
||||
|
||||
/**
|
||||
* list of TNCC connection entries
|
||||
*/
|
||||
@@ -510,11 +515,29 @@ METHOD(imc_agent_t, create_id_enumerator, enumerator_t*,
|
||||
return this->additional_ids->create_enumerator(this->additional_ids);
|
||||
}
|
||||
|
||||
METHOD(imc_agent_t, add_non_fatal_attr_type, void,
|
||||
private_imc_agent_t *this, pen_type_t type)
|
||||
{
|
||||
pen_type_t *type_p;
|
||||
|
||||
type_p = malloc_thing(pen_type_t);
|
||||
*type_p = type;
|
||||
this->non_fatal_attr_types->insert_last(this->non_fatal_attr_types, type_p);
|
||||
}
|
||||
|
||||
METHOD(imc_agent_t, get_non_fatal_attr_types, linked_list_t*,
|
||||
private_imc_agent_t *this)
|
||||
{
|
||||
return this->non_fatal_attr_types;
|
||||
}
|
||||
|
||||
METHOD(imc_agent_t, destroy, void,
|
||||
private_imc_agent_t *this)
|
||||
{
|
||||
DBG1(DBG_IMC, "IMC %u \"%s\" terminated", this->id, this->name);
|
||||
this->additional_ids->destroy(this->additional_ids);
|
||||
this->non_fatal_attr_types->destroy_function(this->non_fatal_attr_types,
|
||||
free);
|
||||
this->connections->destroy_function(this->connections, free);
|
||||
this->connection_lock->destroy(this->connection_lock);
|
||||
free(this);
|
||||
@@ -550,6 +573,8 @@ imc_agent_t *imc_agent_create(const char *name,
|
||||
.reserve_additional_ids = _reserve_additional_ids,
|
||||
.count_additional_ids = _count_additional_ids,
|
||||
.create_id_enumerator = _create_id_enumerator,
|
||||
.add_non_fatal_attr_type = _add_non_fatal_attr_type,
|
||||
.get_non_fatal_attr_types = _get_non_fatal_attr_types,
|
||||
.destroy = _destroy,
|
||||
},
|
||||
.name = name,
|
||||
@@ -557,6 +582,7 @@ imc_agent_t *imc_agent_create(const char *name,
|
||||
.type_count = type_count,
|
||||
.id = id,
|
||||
.additional_ids = linked_list_create(),
|
||||
.non_fatal_attr_types = linked_list_create(),
|
||||
.connections = linked_list_create(),
|
||||
.connection_lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2012 Andreas Steffen
|
||||
* Copyright (C) 2011-2014 Andreas Steffen
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -171,6 +171,16 @@ struct imc_agent_t {
|
||||
*/
|
||||
enumerator_t* (*create_id_enumerator)(imc_agent_t *this);
|
||||
|
||||
/**
|
||||
* Add an item to the list of non-fatal unsupported PA-TNC attribute types
|
||||
*/
|
||||
void (*add_non_fatal_attr_type)(imc_agent_t *this, pen_type_t type);
|
||||
|
||||
/**
|
||||
* Get a list of non-fatal unsupported PA-TNC attribute types
|
||||
*/
|
||||
linked_list_t* (*get_non_fatal_attr_types)(imc_agent_t *this);
|
||||
|
||||
/**
|
||||
* Destroys an imc_agent_t object
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Andreas Steffen
|
||||
* Copyright (C) 2012-2014 Andreas Steffen
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -210,6 +210,7 @@ static void print_assessment_trailer(bool first)
|
||||
METHOD(imc_msg_t, receive, TNC_Result,
|
||||
private_imc_msg_t *this, bool *fatal_error)
|
||||
{
|
||||
linked_list_t *non_fatal_types;
|
||||
TNC_UInt32 target_imc_id;
|
||||
enumerator_t *enumerator;
|
||||
pa_tnc_attr_t *attr;
|
||||
@@ -282,7 +283,9 @@ METHOD(imc_msg_t, receive, TNC_Result,
|
||||
this->dst_id : this->agent->get_id(this->agent);
|
||||
|
||||
/* preprocess any received IETF standard error attributes */
|
||||
*fatal_error = this->pa_msg->process_ietf_std_errors(this->pa_msg);
|
||||
non_fatal_types = this->agent->get_non_fatal_attr_types(this->agent);
|
||||
*fatal_error = this->pa_msg->process_ietf_std_errors(this->pa_msg,
|
||||
non_fatal_types);
|
||||
|
||||
/* preprocess any received IETF assessment result attribute */
|
||||
enumerator = this->pa_msg->create_attribute_enumerator(this->pa_msg);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Andreas Steffen
|
||||
* Copyright (C) 2012-2014 Andreas Steffen
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
|
||||
Reference in New Issue
Block a user