debug cosmetics

This commit is contained in:
Andreas Steffen
2010-12-10 11:55:02 +01:00
parent cf5866b9c0
commit 755f2419a5
2 changed files with 21 additions and 13 deletions
@@ -325,7 +325,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this,
/* Version */ /* Version */
if (version != PB_TNC_VERSION) if (version != PB_TNC_VERSION)
{ {
DBG1(DBG_TNC, "Unsupported TNCCS Batch Version 0x%01x", version); DBG1(DBG_TNC, "unsupported TNCCS Batch Version 0x%01x", version);
msg = pb_error_message_create(TRUE, IETF_VENDOR_ID, msg = pb_error_message_create(TRUE, IETF_VENDOR_ID,
PB_ERROR_VERSION_NOT_SUPPORTED); PB_ERROR_VERSION_NOT_SUPPORTED);
err_msg = (pb_error_message_t*)msg; err_msg = (pb_error_message_t*)msg;
@@ -337,7 +337,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this,
directionality = (flags & PB_TNC_BATCH_FLAG_D) != PB_TNC_BATCH_FLAG_NONE; directionality = (flags & PB_TNC_BATCH_FLAG_D) != PB_TNC_BATCH_FLAG_NONE;
if (directionality == this->is_server) if (directionality == this->is_server)
{ {
DBG1(DBG_TNC, "Wrong Directionality: Batch is from a PB %s", DBG1(DBG_TNC, "wrong Directionality: Batch is from a PB %s",
directionality ? "Server" : "Client"); directionality ? "Server" : "Client");
msg = pb_error_message_create(TRUE, IETF_VENDOR_ID, msg = pb_error_message_create(TRUE, IETF_VENDOR_ID,
PB_ERROR_INVALID_PARAMETER); PB_ERROR_INVALID_PARAMETER);
@@ -350,7 +350,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this,
this->type = type & 0x0F; this->type = type & 0x0F;
if (this->type > PB_BATCH_ROOF) if (this->type > PB_BATCH_ROOF)
{ {
DBG1(DBG_TNC, "Unknown PB-TNC Batch Type: %d", this->type); DBG1(DBG_TNC, "unknown PB-TNC Batch Type: %d", this->type);
msg = pb_error_message_create(TRUE, IETF_VENDOR_ID, msg = pb_error_message_create(TRUE, IETF_VENDOR_ID,
PB_ERROR_INVALID_PARAMETER); PB_ERROR_INVALID_PARAMETER);
err_msg = (pb_error_message_t*)msg; err_msg = (pb_error_message_t*)msg;
@@ -360,7 +360,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this,
if (!state_transition_upon_receive(state, this->type, this->is_server)) if (!state_transition_upon_receive(state, this->type, this->is_server))
{ {
DBG1(DBG_TNC, "Unexpected PB-TNC Batch Type: %N", DBG1(DBG_TNC, "unexpected PB-TNC Batch Type: %N",
pb_tnc_batch_type_names, this->type); pb_tnc_batch_type_names, this->type);
msg = pb_error_message_create(TRUE, IETF_VENDOR_ID, msg = pb_error_message_create(TRUE, IETF_VENDOR_ID,
PB_ERROR_UNEXPECTED_BATCH_TYPE); PB_ERROR_UNEXPECTED_BATCH_TYPE);
@@ -523,7 +523,8 @@ METHOD(pb_tnc_batch_t, process, status_t,
{ {
return FAILED; return FAILED;
} }
DBG1(DBG_TNC, "processing PB-TNC %N Batch", pb_tnc_batch_type_names,
this->type);
while (this->offset < this->encoding.len) while (this->offset < this->encoding.len)
{ {
status = process_tnc_message(this); status = process_tnc_message(this);
+15 -8
View File
@@ -195,31 +195,38 @@ static status_t handle_messages(private_tnccs_20_t *this, pb_tnc_batch_t *batch)
if (vendor_id == IETF_VENDOR_ID) if (vendor_id == IETF_VENDOR_ID)
{ {
DBG1(DBG_TNC, "%s PB-TNC Error: %N",
fatal ? "fatal" : "non-fatal",
pb_tnc_error_code_names, error_code);
switch (error_code) switch (error_code)
{ {
case PB_ERROR_INVALID_PARAMETER: case PB_ERROR_INVALID_PARAMETER:
case PB_ERROR_UNSUPPORTED_MANDATORY_MESSAGE: case PB_ERROR_UNSUPPORTED_MANDATORY_MESSAGE:
DBG1(DBG_TNC, " at an offset of %u bytes", DBG1(DBG_TNC, "received %s PB-TNC Error '%N' "
"(offset %u bytes)",
fatal ? "fatal" : "non-fatal",
pb_tnc_error_code_names, error_code,
err_msg->get_offset(err_msg)); err_msg->get_offset(err_msg));
break; break;
case PB_ERROR_VERSION_NOT_SUPPORTED: case PB_ERROR_VERSION_NOT_SUPPORTED:
DBG1(DBG_TNC, " with bad version 0x%02x", DBG1(DBG_TNC, "received %s PB-TNC Error '%N' "
"caused by bad version 0x%02x",
fatal ? "fatal" : "non-fatal",
pb_tnc_error_code_names, error_code,
err_msg->get_bad_version(err_msg)); err_msg->get_bad_version(err_msg));
break; break;
case PB_ERROR_UNEXPECTED_BATCH_TYPE: case PB_ERROR_UNEXPECTED_BATCH_TYPE:
case PB_ERROR_LOCAL_ERROR: case PB_ERROR_LOCAL_ERROR:
default: default:
DBG1(DBG_TNC, "received %s PB-TNC Error '%N'",
fatal ? "fatal" : "non-fatal",
pb_tnc_error_code_names, error_code);
break; break;
} }
} }
else else
{ {
DBG1(DBG_TNC, "%s PB-TNC Error (%u) with Vendor ID 0x%06x", DBG1(DBG_TNC, "received %s PB-TNC Error (%u) "
fatal ? "fatal" : "non-fatal", error_code, vendor_id); "with Vendor ID 0x%06x",
fatal ? "fatal" : "non-fatal",
error_code, vendor_id);
} }
break; break;
} }