Moved debug.[ch] to utils folder

This commit is contained in:
Tobias Brunner
2012-10-24 16:00:51 +02:00
parent d5c143e5be
commit f05b427265
306 changed files with 445 additions and 443 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_assess_result_t private_ietf_attr_assess_result_t;
+1 -1
View File
@@ -21,7 +21,7 @@
#include <bio/bio_reader.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_attr_request_t private_ietf_attr_attr_request_t;
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_default_pwd_enabled_t private_ietf_attr_default_pwd_enabled_t;
+1 -1
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_fwd_enabled_t private_ietf_attr_fwd_enabled_t;
@@ -21,7 +21,7 @@
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_installed_packages_t private_ietf_attr_installed_packages_t;
+1 -1
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_numeric_version_t private_ietf_attr_numeric_version_t;
+1 -1
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
#include <time.h>
+4 -4
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
ENUM(pa_tnc_error_code_names, PA_ERROR_RESERVED,
PA_ERROR_ATTR_TYPE_NOT_SUPPORTED,
@@ -80,7 +80,7 @@ typedef struct private_ietf_attr_pa_tnc_error_t private_ietf_attr_pa_tnc_error_t
* | Max Version | Min Version | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
#define PA_ERROR_VERSION_RESERVED 0x0000
/**
@@ -186,7 +186,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint24(writer, this->error_code.vendor_id);
writer->write_uint32(writer, this->error_code.type);
writer->write_data (writer, this->msg_info);
if (this->error_code.vendor_id == PEN_IETF)
{
switch (this->error_code.type)
@@ -272,7 +272,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
}
reader->destroy(reader);
return SUCCESS;
return SUCCESS;
}
METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+1 -1
View File
@@ -18,7 +18,7 @@
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_port_filter_t private_ietf_attr_port_filter_t;
+1 -1
View File
@@ -17,7 +17,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_product_info_t private_ietf_attr_product_info_t;
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_remediation_instr_t private_ietf_attr_remediation_instr_t;
+3 -3
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ietf_attr_string_version_t private_ietf_attr_string_version_t;
@@ -143,7 +143,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
return FAILED;
}
reader = bio_reader_create(this->value);
if (!reader->read_data8(reader, &version))
{
DBG1(DBG_TNC, "insufficient data for IETF product version number");
@@ -187,7 +187,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
*offset += 1 + (pos - config.ptr);
goto end;
}
this->version = chunk_clone(version);
this->build = chunk_clone(build);
this->config = chunk_clone(config);
+5 -5
View File
@@ -18,7 +18,7 @@
#include <tncif_names.h>
#include <debug.h>
#include <utils/debug.h>
#include <threading/rwlock.h>
typedef struct private_imc_agent_t private_imc_agent_t;
@@ -353,7 +353,7 @@ METHOD(imc_agent_t, create_state, TNC_Result,
has_long = get_bool_attribute(this, conn_id, TNC_ATTRIBUTEID_HAS_LONG_TYPES);
has_excl = get_bool_attribute(this, conn_id, TNC_ATTRIBUTEID_HAS_EXCLUSIVE);
has_soh = get_bool_attribute(this, conn_id, TNC_ATTRIBUTEID_HAS_SOH);
tnccs_p = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFTNCCS_PROTOCOL);
tnccs_p = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFTNCCS_PROTOCOL);
tnccs_v = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFTNCCS_VERSION);
t_p = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFT_PROTOCOL);
t_v = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFT_VERSION);
@@ -408,7 +408,7 @@ METHOD(imc_agent_t, change_state, TNC_Result,
case TNC_CONNECTION_STATE_ACCESS_ISOLATED:
case TNC_CONNECTION_STATE_ACCESS_NONE:
state = find_connection(this, connection_id);
if (!state)
{
DBG1(DBG_IMC, "IMC %u \"%s\" has no state for Connection ID %u",
@@ -436,7 +436,7 @@ METHOD(imc_agent_t, change_state, TNC_Result,
DBG1(DBG_IMC, "IMC %u \"%s\" was notified of unknown state %u "
"for Connection ID %u",
this->id, this->name, new_state, connection_id);
return TNC_RESULT_INVALID_PARAMETER;
return TNC_RESULT_INVALID_PARAMETER;
}
return TNC_RESULT_SUCCESS;
}
@@ -562,7 +562,7 @@ imc_agent_t *imc_agent_create(const char *name,
.connections = linked_list_create(),
.connection_lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
);
*actual_version = TNC_IFIMC_VERSION_1;
DBG1(DBG_IMC, "IMC %u \"%s\" initialized", this->id, this->name);
+1 -1
View File
@@ -22,7 +22,7 @@
#include <pen/pen.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imc_msg_t private_imc_msg_t;
+3 -3
View File
@@ -17,7 +17,7 @@
#include "ita/ita_attr.h"
#include <utils.h>
#include <debug.h>
#include <utils/debug.h>
#include <pen/pen.h>
#include <syslog.h>
@@ -119,7 +119,7 @@ bool libimcv_init(void)
"libimcv.debug_level", IMCV_DEBUG_LEVEL);
imcv_stderr_quiet = lib->settings->get_int(lib->settings,
"libimcv.stderr_quiet", FALSE);
/* activate the imcv debugging hook */
dbg = imcv_dbg;
openlog("imcv", 0, LOG_DAEMON);
@@ -155,7 +155,7 @@ void libimcv_deinit(void)
}
if (ref_put(&libstrongswan_ref))
{
library_deinit();
library_deinit();
}
}
+1 -1
View File
@@ -19,7 +19,7 @@
#include <tncif_names.h>
#include <debug.h>
#include <utils/debug.h>
#include <threading/rwlock.h>
typedef struct private_imv_agent_t private_imv_agent_t;
+1 -1
View File
@@ -22,7 +22,7 @@
#include <pen/pen.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imv_msg_t private_imv_msg_t;
+2 -2
View File
@@ -18,7 +18,7 @@
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ita_attr_command_t private_ita_attr_command_t;
@@ -100,7 +100,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
memcpy(this->command, this->value.ptr, this->value.len);
this->command[this->value.len] = '\0';
return SUCCESS;
return SUCCESS;
}
METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+2 -2
View File
@@ -18,7 +18,7 @@
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_ita_attr_dummy_t private_ita_attr_dummy_t;
@@ -98,7 +98,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
{
this->size = this->value.len;
return SUCCESS;
return SUCCESS;
}
METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+1 -1
View File
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_os_info_t private_os_info_t;
+1 -1
View File
@@ -17,7 +17,7 @@
#include "pa_tnc_attr_manager.h"
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_pa_tnc_attr_manager_t private_pa_tnc_attr_manager_t;
typedef struct entry_t entry_t;
+1 -1
View File
@@ -21,7 +21,7 @@
#include <bio/bio_reader.h>
#include <collections/linked_list.h>
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_pa_tnc_msg_t private_pa_tnc_msg_t;
+2 -2
View File
@@ -32,7 +32,7 @@
#include <tncif_pa_subtypes.h>
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
/* IMC definitions */
@@ -329,7 +329,7 @@ static TNC_Result receive_message(imc_msg_t *in_msg)
break;
}
}
e->destroy(e);
e->destroy(e);
}
else if (attr_type.type == IETF_ATTR_REMEDIATION_INSTRUCTIONS)
{
+2 -2
View File
@@ -17,7 +17,7 @@
#include <tncif_names.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imc_os_state_t private_imc_os_state_t;
@@ -155,7 +155,7 @@ imc_state_t *imc_os_state_create(TNC_ConnectionID connection_id)
.result = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
.connection_id = connection_id,
);
return &this->public.interface;
}
@@ -24,7 +24,7 @@
#include <pen/pen.h>
#include <utils/lexparser.h>
#include <debug.h>
#include <utils/debug.h>
#include <stdio.h>
@@ -17,7 +17,7 @@
#include <tncif_names.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imc_scanner_state_t private_imc_scanner_state_t;
@@ -155,7 +155,7 @@ imc_state_t *imc_scanner_state_create(TNC_ConnectionID connection_id)
.result = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
.connection_id = connection_id,
);
return &this->public.interface;
}
+2 -2
View File
@@ -25,7 +25,7 @@
#include <tncif_pa_subtypes.h>
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
/* IMC definitions */
@@ -36,7 +36,7 @@ static pen_type_t msg_types[] = {
};
static imc_agent_t *imc_test;
/**
* see section 3.8.1 of TCG TNC IF-IMC Specification 1.3
*/
@@ -17,7 +17,7 @@
#include <tncif_names.h>
#include <debug.h>
#include <utils/debug.h>
#include <collections/linked_list.h>
typedef struct private_imc_test_state_t private_imc_test_state_t;
+1 -1
View File
@@ -35,7 +35,7 @@
#include <pen/pen.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
/* IMV definitions */
+3 -3
View File
@@ -15,7 +15,7 @@
#include "imv_os_state.h"
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imv_os_state_t private_imv_os_state_t;
@@ -81,7 +81,7 @@ struct entry_t {
};
/**
* Table of multi-lingual reason string entries
* Table of multi-lingual reason string entries
*/
static entry_t reasons[] = {
{ "en", "" },
@@ -211,7 +211,7 @@ imv_state_t *imv_os_state_create(TNC_ConnectionID connection_id)
.eval = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
.connection_id = connection_id,
);
return &this->public.interface;
}
@@ -27,7 +27,7 @@
#include <pen/pen.h>
#include <collections/linked_list.h>
#include <utils/lexparser.h>
#include <debug.h>
#include <utils/debug.h>
/* IMV definitions */
@@ -16,7 +16,7 @@
#include "imv_scanner_state.h"
#include <utils/lexparser.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imv_scanner_state_t private_imv_scanner_state_t;
@@ -87,7 +87,7 @@ struct entry_t {
};
/**
* Table of multi-lingual reason string entries
* Table of multi-lingual reason string entries
*/
static entry_t reasons[] = {
{ "en", "The following ports are open:" },
@@ -189,7 +189,7 @@ METHOD(imv_state_t, get_reason_string, bool,
if (chunk_equals(lang, pref_lang))
{
this->reason_string = chunk_cat("cc",
chunk_create(reasons[i].string,
chunk_create(reasons[i].string,
strlen(reasons[i].string)),
chunk_create(this->violating_ports,
strlen(this->violating_ports)));
@@ -208,7 +208,7 @@ METHOD(imv_state_t, get_reason_string, bool,
chunk_create(this->violating_ports,
strlen(this->violating_ports)));
*reason_string = this->reason_string;
*reason_language = chunk_create(reasons[0].lang,
*reason_language = chunk_create(reasons[0].lang,
strlen(reasons[0].lang));
return TRUE;
}
@@ -256,7 +256,7 @@ imv_state_t *imv_scanner_state_create(TNC_ConnectionID connection_id)
.eval = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
.connection_id = connection_id,
);
return &this->public.interface;
}
+7 -7
View File
@@ -27,7 +27,7 @@
#include <tncif_pa_subtypes.h>
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
/* IMV definitions */
@@ -130,7 +130,7 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
{
ita_attr_command_t *ita_attr;
char *command;
received_command = TRUE;
ita_attr = (ita_attr_command_t*)attr;
command = ita_attr->get_command(ita_attr);
@@ -139,19 +139,19 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
{
state->set_recommendation(state,
TNC_IMV_ACTION_RECOMMENDATION_ALLOW,
TNC_IMV_EVALUATION_RESULT_COMPLIANT);
TNC_IMV_EVALUATION_RESULT_COMPLIANT);
}
else if (streq(command, "isolate"))
{
state->set_recommendation(state,
TNC_IMV_ACTION_RECOMMENDATION_ISOLATE,
TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR);
TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR);
}
else if (streq(command, "block") || streq(command, "none"))
{
state->set_recommendation(state,
TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS,
TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR);
TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR);
}
else if (streq(command, "retry"))
{
@@ -162,7 +162,7 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
DBG1(DBG_IMV, "unsupported ITA Command '%s'", command);
state->set_recommendation(state,
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
TNC_IMV_EVALUATION_RESULT_ERROR);
TNC_IMV_EVALUATION_RESULT_ERROR);
}
}
else if (attr_type.type == ITA_ATTR_DUMMY)
@@ -199,7 +199,7 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
state->get_connection_id(state),
TNC_RETRY_REASON_IMV_SERIOUS_EVENT);
}
/* repeat the measurement ? */
if (test_state->another_round(test_state, in_msg->get_src_id(in_msg)))
{
@@ -17,7 +17,7 @@
#include <utils/lexparser.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imv_test_state_t private_imv_test_state_t;